Difference between revisions of "LUA:ProcessSpell"

(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: ProcessSpell() =
Adds hate to ''param2'' from ''param1''
+
Makes the given spawn cast on the given target using the spell list assigned in the DB
  
  
 
==== Syntax ====
 
==== Syntax ====
AddHate(param1, param2, param3)
+
ProcessSpell(param1, param2, param3)
  
  
 
==== Parameters ====
 
==== Parameters ====
; Required - ''param1'' (Spawn), ''param2'' (Spawn), ''param3'' (sint32)
+
; Required - ''param1'' (Spawn), ''param2'' (Spawn), ''param3'' (float)
: ''param1'' is the spawn that is adding hate
+
: ''param1'' is the spawn casting
: ''param2'' is the spawn recieving the hate
+
: ''param2'' is the target
: ''param3'' is the amount of hate to add
+
: ''param3'' is the distance between the two spawns
  
 
==== Usage ====
 
==== Usage ====
 
<pre>
 
<pre>
function cast(Caster, Target)
+
function hailed(NPC, Spawn)
     -- Add 50 hate to the target
+
     ProcessSpell(NPC, Spawn, GetDistance(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 make the spawn try to cast a spell on the player who hails it
  
 
== 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.
+
Returns a bool, true if a spell started to be cast

Latest revision as of 20:18, 28 August 2013

LUA Functions: ProcessSpell()

Makes the given spawn cast on the given target using the spell list assigned in the DB


Syntax

ProcessSpell(param1, param2, param3)


Parameters

Required - param1 (Spawn), param2 (Spawn), param3 (float)
param1 is the spawn casting
param2 is the target
param3 is the distance between the two spawns

Usage

function hailed(NPC, Spawn)
    ProcessSpell(NPC, Spawn, GetDistance(NPC, Spawn))
end

This will make the spawn try to cast a spell on the player who hails it

Notes

Returns a bool, true if a spell started to be cast