Difference between revisions of "LUA:AddControlEffect"

(Notes)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= LUA Functions: AddControlEffect() =
+
{{LUAFunction
Adds a control effect (mez/stun) to the given spawn.
+
|Name = AddControlEffect
 +
|Description = Adds a control effect (mez/stun) to the given spawn.
 +
|Param1 = Spawn
 +
|Param1Desc = must be a reference to a player or NPC.
 +
|Param2 = int8
 +
|Param2Desc = must be a valid number representing a control effect to add (see below)
 +
|OptionalParam1 = int8
 +
|OptionalParam1Desc = if set to 1, only add the control effect to the first param spawn
 +
|Example =
 +
<pre>
 +
function cast(Caster, Target)
 +
  -- Mez the target.
 +
  AddControlEffect(Target, 1)
 +
end
 +
</pre>
 +
|ExampleDesc = This will mez the target.
 +
|Notes = If this is used in a spell script a small amount of hate will be added to the target, if the effect is considered hostile.
  
  
==== Syntax ====
+
=== Types ===
AddControlEffect(param1, param2)
 
  
 +
1 - Mez
  
==== Parameters ====
+
2 - Stifle
; Required - ''param1'' (Spawn), ''param2'' (int8)
 
: ''param1'' must be a reference to a player or NPC.
 
: ''param2'' must be a number from 1 to 4 representing the type of effect to add
 
  
 +
3 - Daze
  
==== Usage ====
+
4 - Stun
function cast(Caster, Target)
 
  -- Mez the target.
 
  AddControlEffect(Target, 1)
 
end
 
  
This will mez the target.
+
5 - Root
  
 +
6 - Fear
  
== Notes ==
+
7 - Waterwalking
If this is used in a spell script a small amount of hate will be added to the target.
+
 
; Types
+
8 - Underwater Moonjumps
: 1 - Mez
+
 
: 2 - Stifle
+
11 - Snare
: 3 - Daze
+
 
: 4 - Stun
+
12 - Flight
: 5 - Root
+
 
: 6 - Fear
+
13 - Glide
: 7 - Waterwalking
+
 
: 8 - Underwater Moonjumps
+
14 - Safefall
 +
}}

Latest revision as of 11:55, 30 January 2021


LUA:AllFunctions - AddControlEffect

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


Adds a control effect (mez/stun) to the given spawn.

Syntax

AddControlEffect(param1, param2, [opt param1])

Parameters

Required - param1 (Spawn), param2 (int8)
param1 must be a reference to a player or NPC.
param2 must be a valid number representing a control effect to add (see below)
Optional - opt param1 (int8)
opt param1 if set to 1, only add the control effect to the first param spawn

Example

function cast(Caster, Target)
  -- Mez the target.
  AddControlEffect(Target, 1)
end

This will mez the target.

Notes

If this is used in a spell script a small amount of hate will be added to the target, if the effect is considered hostile.


Types

1 - Mez

2 - Stifle

3 - Daze

4 - Stun

5 - Root

6 - Fear

7 - Waterwalking

8 - Underwater Moonjumps

11 - Snare

12 - Flight

13 - Glide

14 - Safefall