Difference between revisions of "LUA:AddWard"

 
Line 1: Line 1:
= LUA Functions: AddWard() =
+
{{LUAFunction
Adds a ward with the given amount
+
|Name = AddWard
 
+
|Description = Adds a ward with the given amount
==== Syntax ====
+
|Param1 = in32
AddWard(param1, [param2], [param3], [param4])
+
|Param1Desc = is the amount of the ward
 
+
|OptionalParam1 = bool
 
+
|OptionalParam1Desc = is if we want to keep the spell active or remove it when the ward is depleted
==== Parameters ====
+
|OptionalParam2 = int8
; Required - ''param1'' (int32)
+
|OptionalParam2Desc = is the type of ward
: ''param1'' is the amount of the ward
+
|OptionalParam3 = int8
; Optional - ''param2'' (bool), ''param3'' (int8), ''param4'' (int8)
+
|OptionalParam3Desc = is the damage type to absorb if ward type is magical
: ''param2'' - is if we want to keep the spell active or remove it when the ward is depleted
+
|Example =
: ''param3'' is the type of ward
 
: ''param4'' is the damage type to absorb if ward type is magical
 
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function cast(Caster, Target)
 
function cast(Caster, Target)
Line 20: Line 16:
 
end
 
end
 
</pre>
 
</pre>
 +
|ExampleDesc = Adds a ward that will absorb 25 damage
 +
|Notes = Can only be used in a spell script
  
Adds a ward that will absorb 25 damage
+
The ward will be applied to the targets of the spell that uses this spell script
  
== Notes ==
+
=== Ward Type ===
Can only be used in a spell script
 
  
The ward will be applied to the targets of the spell that uses this spell script
+
0 - all
 +
 
 +
1 - physical
  
ward type is 0 - all, 1 - physical, 2 - magical
+
2 - magical
  
 
damage type is the magical damage to absorb
 
damage type is the magical damage to absorb
 +
}}

Latest revision as of 12:07, 30 January 2021


LUA:AllFunctions - AddWard

Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker


Adds a ward with the given amount

Syntax

AddWard(param1, [opt param1], [opt param2], [opt param3])

Parameters

Required - param1 (in32)
param1 is the amount of the ward
Optional - opt param1 (bool), opt param2 (int8), opt param3 (int8)
opt param1 is if we want to keep the spell active or remove it when the ward is depleted
opt param2 is the type of ward
opt param3 is the damage type to absorb if ward type is magical

Example

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

Ward Type

0 - all

1 - physical

2 - magical

damage type is the magical damage to absorb