Difference between revisions of "LUA:ClearHate"

(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: ClearHate() =
Adds hate to ''param2'' from ''param1''
+
Clears the hate from the given spawn
  
  
 
==== Syntax ====
 
==== Syntax ====
AddHate(param1, param2, param3)
+
ClearHate(param1, [param2])
  
  
 
==== Parameters ====
 
==== Parameters ====
; Required - ''param1'' (Spawn), ''param2'' (Spawn), ''param3'' (sint32)
+
; Required - ''param1'' (Spawn)
: ''param1'' is the spawn that is adding hate
+
: ''param1'' is the spawn who's hate list we want to modify
: ''param2'' is the spawn recieving the hate
+
; Optional - ''param2'' (Spawn)
: ''param3'' is the amount of hate to add
+
: ''param3'' if given only this spawn will be removed from the hate list
  
 
==== Usage ====
 
==== Usage ====
 
<pre>
 
<pre>
function cast(Caster, Target)
+
function hailed_busy(NPC, Spawn)
     -- Add 50 hate to the target
+
     ClearHate(NPC, Spawn)
    AddHate(Caster, Target, 50)
 
 
end
 
end
 
</pre>
 
</pre>
  
This is a simple taunt spell that adds 50 hate to the target.
+
This will clear the hate this spawn has towards whoever hails it while in combat
  
 
== 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.
+
If the second spawn is not given the entire hate list will be cleared

Revision as of 20:57, 28 August 2013

LUA Functions: ClearHate()

Clears the hate from the given spawn


Syntax

ClearHate(param1, [param2])


Parameters

Required - param1 (Spawn)
param1 is the spawn who's hate list we want to modify
Optional - param2 (Spawn)
param3 if given only this spawn will be removed from the hate list

Usage

function hailed_busy(NPC, Spawn)
    ClearHate(NPC, Spawn)
end

This will clear the hate this spawn has towards whoever hails it while in combat

Notes

If the second spawn is not given the entire hate list will be cleared