Razish / japp

JA++ server and client modification for Jedi Academy
GNU General Public License v2.0
44 stars 30 forks source link

Add: NPC JPLua API #324

Open keyten opened 9 years ago

keyten commented 9 years ago

Something like this:

local props = {}
props.type = "stormtrooper"
props.name = "anyname" -- as in npc spawn type name
props.angles = Vector3(0,0,0)
props.position = Vector3(0,0,0)
props.health = 100
props.weapon = WP_MELEE

local npc = SpawnNPC(props)
-- or GetNPC(npcname) or GetNPC(npcentity)
npc:WalkTo(vec)
npc:RunTo(vec)
npc:TurnTo(vec)
npc:Attack -- other npc or player
npc:SetAnim -- sets current animation
npc:GiveWeapon -- gives weapon to npc
npc:GetWeapon -- current weap
npc:SetWeapon
npc:Get / SetHealth
npc:Kill
npc:Teleport
npc:UseAltAttack -- true or false

-- and pain / kill events

Would be great :)