Here are a few examples of what events and code that you can use to trigger animations, simply copy-paste the events and code into their fields, remeber that the events go in the singlerow editbox and the code into the big editbox.
--------------------------------------------
They are all written in the form of:
Description.
Startevents.
Startcode.
Endevents.
Endcode.
--------------------------------------------
Trigger on combopoint, begins to animate when you have N or more combopoint(s),
trigger a stop when you go below N combopoint.
Change N to whatever number of combopoints you want to have for this specific trigger.
UNIT_COMBO_POINTS
function (...)
if GetComboPoints("player", "target") >= 1 then
return true
end
return false
end
UNIT_COMBO_POINTS
function (...)
if GetComboPoints("player", "target") < 1 then
return true
end
return false
end
--------------------------------------------
This triggers the animation when a specific debuff is applied to the current target target, or if the new target already got the debuff applied.
The debuff used in the example is Mangle from catform, just change the text in "Mangle (Cat)" to whatever name of a debuff you want to check for
UNIT_AURA PLAYER_TARGET_CHANGED
function (event, unit, ...)
if not unit == "target" then return false end
for i=1, 40 do
local name, _, _, _, type = UnitAura("target", i, "HARMFUL")
if (name == "Mangle") then
return true
end
end
return false
end
UNIT_AURA PLAYER_TARGET_CHANGED
function (event, unit, ...)
if not unit == "target" then return false end
for i=1, 40 do
local name, _, _, _, type = UnitAura("target", i, "HARMFUL")
if (name == "Mangle") then
return false
end
end
return true
end
--------------------------------------------
This triggers the animation if you are lacking a certain buff and are in combat.
The buff in this example is Battle Shot/Commanding Shout.
UNIT_AURA PLAYER_REGEN_ENABLED
function (event, unit, ...)
if not unit == "player" then return false end
if not InCombatLockdown() then return false end
for i=1, 40 do
local name, _, _, _, type = UnitAura("player", i, "HELPFUL")
if (name == "BuffName") then
return false
end
end
return true
end
UNIT_AURA PLAYER_REGEN_ENABLED
function (event, unit, ...)
if not unit == "player" then return false end
if not InCombatLockdown() then return false end
for i=1, 40 do
local name, _, _, _, type = UnitAura("player", i, "HELPFUL")
if (name == "BuffName") then
return true
end
end
return false
end
--------------------------------------------
Trigger the animation when you go below a certain percentage of mana, and to change it to any other percentual value just change the 40 to what percentage you want.
UNIT_MANA
function (event, unit)
if not unit == "player" then return end
local val = UnitMana("player")
local maxVal = UnitManaMax("player")
if (val/maxVal*100 <= 40) then
return true
end
return false
end
UNIT_MANA
function (event, unit)
if not unit == "player" then return end
local val = UnitMana("player")
local maxVal = UnitManaMax("player")
if (val/maxVal*100 <= 40) then
return false
end
return true
end
Facts
- Date created
- 01 Jul 2008
- Last updated
- 11 May 2009