Difference between revisions of "LUA:AddThreatTransfer"

(Created page with "= LUA Functions: IsFlanking() = Checks to see if the given spawn is flanking the target spawn ==== Syntax ==== IsFlanking(param1, param2) ==== Parameters ==== ; Required - ''p...")
 
Line 1: Line 1:
= LUA Functions: IsFlanking() =
+
= LUA Functions: AddThreatTransfer() =
Checks to see if the given spawn is flanking the target spawn
+
Adds a threat transfer for the given percentage
  
 
==== Syntax ====
 
==== Syntax ====
IsFlanking(param1, param2)
+
AddThreatTransfer(param1, param2, param3)
  
  
 
==== Parameters ====
 
==== Parameters ====
; Required - ''param1'' (Spawn), ''param2'' (Spawn)
+
; Required - ''param1'' (Spawn), ''param2'' (Spawn), ''param3'' (float)
: ''param1'' is the spawn who will be checking the other
+
: ''param1'' is the spawn who will be transferring the hate
: ''param2'' is the spawn we want to know if it is flanking
+
: ''param2'' is the spawn who we transfer the hate to
 +
: ''param3'' is the percentage of hate to transfer
  
  
 
==== Usage ====
 
==== Usage ====
 
<pre>
 
<pre>
function precast(Caster, Target)
+
function cast(Caster, Target)
     return IsFlanking(Target, Caster)
+
     AddThreatTransfer(Caster, Target, 30)
 
end
 
end
 
</pre>
 
</pre>
  
Will check to see if the caster is flanking the target before casting
+
When cast this spell will add a threat transfer of 30%
 +
 
 +
== Notes ==
 +
Only 1 threat transfer can be active at a time
 +
 
 +
This function can only be used in a spell script

Revision as of 17:34, 16 December 2013

LUA Functions: AddThreatTransfer()

Adds a threat transfer for the given percentage

Syntax

AddThreatTransfer(param1, param2, param3)


Parameters

Required - param1 (Spawn), param2 (Spawn), param3 (float)
param1 is the spawn who will be transferring the hate
param2 is the spawn who we transfer the hate to
param3 is the percentage of hate to transfer


Usage

function cast(Caster, Target)
    AddThreatTransfer(Caster, Target, 30)
end

When cast this spell will add a threat transfer of 30%

Notes

Only 1 threat transfer can be active at a time

This function can only be used in a spell script