function(states, event, ...)
if event == "OPTIONS" then
states[""] = {
name = "Greater Storm Elemental",
icon = 2065626,
arg = 1,
duration = 180,
expirationTime = GetTime() + 180,
progressType = "timed",
autoHide = true,
changed = true,
show = true,
}
return true
end
if event == "PLAYER_ENTERING_WORLD" and states[""] then
states[""].show = false
states[""].changed = true
return true
elseif event == "PLAYER_TOTEM_UPDATE" then
local arg = ...
if arg then --actual event
local haveTotem, name, startTime, duration, icon = GetTotemInfo(arg)
if haveTotem and icon == 2065626 then
states[""] = {
name = name,
icon = icon,
arg = arg,
duration = duration,
expirationTime = startTime + duration,
progressType = "timed",
autoHide = true,
changed = true,
show = true,
}
return true
elseif states[""] and states[""].arg == arg then
states[""].show = false
states[""].changed = true
return true
end
else --options closed
for i=1, 5 do
local haveTotem, name, startTime, duration, icon = GetTotemInfo(i)
if haveTotem and icon == 2065626 then
states[""] = {
name = name,
icon = icon,
arg = i,
duration = duration,
expirationTime = startTime + duration,
progressType = "timed",
autoHide = true,
changed = true,
show = true,
}
return true
end
end
end
end
end