Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function(allstates,e,...)
- --Get the current timestamp
- local timestamp = GetTime()
- --note: shield is every 50 seconds
- --First spawns 12 sec in, then every 46 sec
- --These can be modified if better data is found
- --Also you can change the boss emote string to search for
- local first,interval,search
- first = 12
- interval = 46
- search = "d"
- --Initialize a state table
- local state = {}
- --Set some default state values
- state.changed = true
- state.show = true
- state.name = "Healing Imps"
- state.icon = nil
- state.stacks = 1
- state.progressType = "timed"
- state.autoHide = false
- if e == "PLAYER_REGEN_DISABLED" then
- --We just entered combat
- if UnitName("boss1") == "Agatha" then
- --If we entered combat and the boss is agatha, trigger
- --Reset the table, and add one entry for the timer
- --this entry is set to the first set
- state.duration = first
- state.expirationTime = timestamp + first
- end
- elseif e == "CHAT_MSG_SAY" then
- --There was a chat message, we might need to reset
- local msg = ...
- if msg then
- --make sure we actually got a message
- if string.match(msg, search) then
- --Imps just spawned, reset timer to new interval
- --Reset the table, and add one entry for the timer
- --this entry is set to the new interval
- state.duration = interval
- state.expirationTime = timestamp + interval
- end
- end
- elseif e == "PLAYER_REGEN_ENABLED" or e == "PLAYER_DEAD" then
- --Left combat or died, reset the whole thing
- end
- --Place the new state in the allstates table, overwriting the old data
- allstates = {state}
- --Test Output
- print("here-localstate")
- for k,v in pairs(state) do
- print(k.." : "..tostring(v))
- end
- print("here-allstates")
- for k,v in pairs(allstates) do
- print(k.." : -----------------")
- for k,v in pairs(v) do
- print(k.." : "..tostring(v))
- end
- end
- --End Test
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment