Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

trig 0 on EveryFrame

trigger:
function()
if timestamp!=nil
if GetTime()-timestamp<=20
return true
else
timestamp=nil
end
return false

OR
TRIG 1 on COMBAT_LOG_EVENT
trigger:
function()
if event=killedAnything
if berserker/battle stance
if IsSpellUsable
timestamp=GetTime()
end
else if defensive stance
timestamp = GetTime()
end
else if event spell victory rush
timestamp=nil
end
return false

OR
TRIG 3 on UPDATE_SHAPESHIFT_FORM
trig at get(variableVictory)==true
untrig at usedVictory
Duration: TimeRemaining
----------------------

unitaura/ever frame
function()
local stance = GetShapeshiftForm()
if stance~=2 then
local usable, _ = IsUsableSpell("Victory Rush")
if usable==nil and timestamp ~=nil then
backup = timestamp
print("unusable, bkup: "..backup)
timestamp = nil
elseif timestamp==nil and backup~=nil then
timestamp=backup
print("usable, timestamp backed up"..timestamp)
else print ("other weird condition")
end
end
if timestamp ~= nil then
if GetTime() - timestamp <= 20 then
print(GetTime()-timestamp)
return true
else
print("Time elapsed. timestamp=nil")
timestamp = nil
backup=nil
end
end
return false
end

untrig
function()
if timestamp==nil then
return true
end
end

trig2
combat log event
function (...)
local event = select(3, ...)
local src = select(4, ...)

if event == "PARTY_KILL" and src == UnitGUID("player") then


timestamp = GetTime()
print("Killed someone. Victory rush should ACTIVATE")
elseif event == "SPELL_DAMAGE" or event == "SPELL_MISSED" then
local dest = select(7, ...)
local spell = select(11, ...)
if src == UnitGUID("player") and dest == UnitGUID("target") and spell ==
"Victory Rush" then
print("used victory rush")
end
end
return false
end

You might also like