Difference between revisions of "LUA:GetRunbackDistance"

(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: GetRunbackDistance() =
Adds hate to ''param2'' from ''param1''
+
Gets the distance to the given spawns run back location
  
  
 
==== Syntax ====
 
==== Syntax ====
AddHate(param1, param2, param3)
+
GetRunbackDistance(param1)
  
  
 
==== Parameters ====
 
==== Parameters ====
; Required - ''param1'' (Spawn), ''param2'' (Spawn), ''param3'' (sint32)
+
; Required - ''param1'' (Spawn)
: ''param1'' is the spawn that is adding hate
+
: ''param1'' is the spawn whos run back distance we want
: ''param2'' is the spawn recieving the hate
 
: ''param3'' is the amount of hate to add
 
  
 
==== Usage ====
 
==== Usage ====
 
<pre>
 
<pre>
function cast(Caster, Target)
+
function hailed_busy(NPC, Spawn)
     -- Add 50 hate to the target
+
     Say(NPC, "I am " .. GetRunbackDistance(NPC) .. " from my run back location")
    AddHate(Caster, Target, 50)
 
 
end
 
end
 
</pre>
 
</pre>
  
This is a simple taunt spell that adds 50 hate to the target.
+
This will have the spawn respond to a hail while it is in combat with the distance to its run back location.
  
 
== 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.
+
This returns a float value

Latest revision as of 19:10, 28 August 2013

LUA Functions: GetRunbackDistance()

Gets the distance to the given spawns run back location


Syntax

GetRunbackDistance(param1)


Parameters

Required - param1 (Spawn)
param1 is the spawn whos run back distance we want

Usage

function hailed_busy(NPC, Spawn)
    Say(NPC, "I am " .. GetRunbackDistance(NPC) .. " from my run back location")
end

This will have the spawn respond to a hail while it is in combat with the distance to its run back location.

Notes

This returns a float value