Difference between revisions of "LUA:AddControlEffect"

(Syntax)
Line 1: Line 1:
 +
{{PageHeaderChild|LUA|AddControlEffect}}
 +
 
= LUA Functions: AddControlEffect() =
 
= LUA Functions: AddControlEffect() =
 
Adds a control effect (mez/stun) to the given spawn.
 
Adds a control effect (mez/stun) to the given spawn.

Revision as of 21:42, 25 April 2015

LUA - AddControlEffect

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


LUA Functions: AddControlEffect()

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


Syntax

AddControlEffect(param1, param2, [param3])

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 - param3 (int8)
param3 if set to 1, only add the control effect to the first param spawn

Usage

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