Difference between revisions of "LUA:SetInCombat"

(Created page with "= LUA Functions: AddHate() = Adds hate to ''param2'' from ''param1'' ==== Syntax ==== AddHate(param1, param2, param3) ==== Parameters ==== ; Required - ''param1'' (Spawn), ''...")
 
 
Line 1: Line 1:
= LUA Functions: AddHate() =
+
= LUA Functions: SetInCombat() =
Adds hate to ''param2'' from ''param1''
+
Sets the given spawns combat state
  
  
 
==== Syntax ====
 
==== Syntax ====
AddHate(param1, param2, param3)
+
SetInCombat(param1, param2)
  
  
 
==== Parameters ====
 
==== Parameters ====
; Required - ''param1'' (Spawn), ''param2'' (Spawn), ''param3'' (sint32)
+
; Required - ''param1'' (Spawn), ''param2'' (bool)
: ''param1'' is the spawn that is adding hate
+
: ''param1'' is the spawn who's combat state we want to change
: ''param2'' is the spawn recieving the hate
+
: ''param2'' true if you want to put the spawn in combat, false if you want to take the spawn out of combat
: ''param3'' is the amount of hate to add
 
  
 
==== Usage ====
 
==== Usage ====
 
<pre>
 
<pre>
function cast(Caster, Target)
+
function hailed(NPC, Spawn)
     -- Add 50 hate to the target
+
     SetInCombat(NPC, true)
    AddHate(Caster, Target, 50)
 
 
end
 
end
 
</pre>
 
</pre>
  
This is a simple taunt spell that adds 50 hate to the target.
+
This will cause the spawn to enter combat mode when it is hailed
  
 
== Notes ==
 
== Notes ==
If this is called from a spell script then the target/targets will be determined by the spell data(encounter AE, true AE, single target, etc...), the param is still required though.
+
When putting the spawn into combat it will kill any scripted movement it has and won't resume it until combat is toggled off.

Latest revision as of 17:25, 28 August 2013

LUA Functions: SetInCombat()

Sets the given spawns combat state


Syntax

SetInCombat(param1, param2)


Parameters

Required - param1 (Spawn), param2 (bool)
param1 is the spawn who's combat state we want to change
param2 true if you want to put the spawn in combat, false if you want to take the spawn out of combat

Usage

function hailed(NPC, Spawn)
    SetInCombat(NPC, true)
end

This will cause the spawn to enter combat mode when it is hailed

Notes

When putting the spawn into combat it will kill any scripted movement it has and won't resume it until combat is toggled off.