Code:
registerFunction("extinguish", "e:n", " ", function(self, args)
local op1, op2 = args[2], args[3]
local rv1, rv2 = op1[1](self, op1),op2[1](self, op2)
if(!validEntity(rv1)) then return 0 end
if(!isOwner(self, rv1)) then return end
if rv2 then rv1:Extinguish(); end
end)
registerFunction("sequence", "e:s", " ", function(self, args)
local op1, op2 = args[2],args[3]
local rv1, rv2 = op1[1](self, op1),op2[1](self, op2)
if(!validEntity(rv1)) then return 0 end
if(!isOwner(self, rv1)) then return end
local sequence = rv1:LookupSequence( rv2 )
rv1:SetSequence(sequence)
end)
registerFunction("setHealth", "e:n", " ", function(self, args)
local op1, op2 = args[2],args[3]
local rv1, rv2 = op1[1](self, op1),op2[1](self, op2)
if(!validEntity(rv1)) then return 0 end
if(!isOwner(self, rv1)) then return end
rv1:SetHealth( rv2 )
end)
registerFunction("npcSetEnemy", "e:e", " ", function(self, args)
local op1, op2 = args[2],args[3]
local rv1, rv2 = op1[1](self, op1),op2[1](self, op2)
if(!validEntity(rv1)) then return 0 end
if(!isOwner(self, rv1)) then return end
rv1:SetEnemy( rv2 )
end)
/* NEW functions */
registerFunction("takeDamage", "e:ne", " ", function(self, args)
local op1, op2, op3 = args[2],args[3],args[4]
local rv1, rv2, rv3 = op1[1](self, op1),op2[1](self, op2),op3[1](self, op3)
if(!isOwner(self, rv1)) then return end
if(!validEntity(rv1)) then return 0 end
rv1:TakeDamage( rv2, rv3 )
end)
registerFunction("createEffect", "svv", " ", function(self, args)
local op1, op2, op3 = args[2],args[3],args[4]
local rv1, rv2, rv3 = op1[1](self, op1),op2[1](self, op2),op3[1](self, op3)
local effectdata = EffectData()
local vPoint = Vector(rv2[1],rv2[2],rv2[3])
local vPointUp = Vector(rv3[1],rv3[2],rv3[3])
if (rv1 == "Explosion") then return 0 end
if (rv1 == "dof_node") then return 0 end
effectdata:SetOrigin( vPointUp )
effectdata:SetStart( vPoint )
effectdata:SetScale( 1 )
util.Effect( rv1, effectdata )
end)