Difference between revisions of "LUA:AddToWard"

(Created page with "= LUA Functions: HasGroup() = Checks to see if the given spawn has a group ==== Syntax ==== HasGroup(param1) ==== Parameters ==== ; Required - ''param1'' (Spawn) : ''param1'' ...")
 
Line 1: Line 1:
= LUA Functions: HasGroup() =
+
= LUA Functions: AddToWard() =
Checks to see if the given spawn has a group
+
Adds the given amount to the ward
  
 
==== Syntax ====
 
==== Syntax ====
HasGroup(param1)
+
AddToWard(param1)
  
  
 
==== Parameters ====
 
==== Parameters ====
; Required - ''param1'' (Spawn)
+
; Required - ''param1'' (int32)
: ''param1'' is the spawn we want to check
+
: ''param1'' is the amount to add
  
 
==== Usage ====
 
==== Usage ====
 
<pre>
 
<pre>
function hailed(NPC, Spawn)
+
function tick(Caster, Target)
     if HasGroup(NPC) then
+
     AddToWard(5)
        Say(NPC, "I have friends!")
 
    else
 
        Say(NPC, "I am a loner!")
 
    end
 
 
end
 
end
 
</pre>
 
</pre>
  
This will cause the spawn to say if they are in a group or not when hailed
+
This will add 5 more points of damage absorb to the ward every tick
  
 
== Notes ==
 
== Notes ==
This will work on both NPC's and player's
+
Must be in a spell script
 +
 
 +
This won't do anything if the spell script hasn't used AddWard at some point before the call to this function.
 +
 
 +
You can not go over the base amount given by the param in AddWard

Revision as of 22:02, 28 August 2013

LUA Functions: AddToWard()

Adds the given amount to the ward

Syntax

AddToWard(param1)


Parameters

Required - param1 (int32)
param1 is the amount to add

Usage

function tick(Caster, Target)
    AddToWard(5)
end

This will add 5 more points of damage absorb to the ward every tick

Notes

Must be in a spell script

This won't do anything if the spell script hasn't used AddWard at some point before the call to this function.

You can not go over the base amount given by the param in AddWard