Difference between revisions of "LUA:AddWard"

(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: AddWard() =
Checks to see if the given spawn has a group
+
Adds a ward with the given amount
  
 
==== Syntax ====
 
==== Syntax ====
HasGroup(param1)
+
AddWard(param1)
  
  
 
==== Parameters ====
 
==== Parameters ====
; Required - ''param1'' (Spawn)
+
; Required - ''param1'' (int32)
: ''param1'' is the spawn we want to check
+
: ''param1'' is the amount of the ward
  
 
==== Usage ====
 
==== Usage ====
 
<pre>
 
<pre>
function hailed(NPC, Spawn)
+
function cast(Caster, Target)
     if HasGroup(NPC) then
+
     AddWard(25)
        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
+
Adds a ward that will absorb 25 damage
  
 
== Notes ==
 
== Notes ==
This will work on both NPC's and player's
+
Can only be used in a spell script
 +
 
 +
The ward will be applied to the targets of the spell that uses this spell script

Revision as of 21:54, 28 August 2013

LUA Functions: AddWard()

Adds a ward with the given amount

Syntax

AddWard(param1)


Parameters

Required - param1 (int32)
param1 is the amount of the ward

Usage

function cast(Caster, Target)
    AddWard(25)
end

Adds a ward that will absorb 25 damage

Notes

Can only be used in a spell script

The ward will be applied to the targets of the spell that uses this spell script