aggixx

Untitled

Jun 27th, 2016
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. -- Havoc Fury Trigger
  2. function(event, ...)
  3. if event == "UNIT_POWER_FREQUENT" then
  4. local unit, power = ...;
  5. if unit == "player" and power == "FURY" then
  6. aura_env.fury = UnitPower(unit, SPELL_POWER_FURY);
  7. --print(string.format("%s %d", event, aura_env.fury));
  8. end
  9. elseif event == "UNIT_MAXPOWER" then
  10. aura_env.fury_max = UnitPowerMax("player", SPELL_POWER_FURY);
  11. elseif event == "COMBAT_LOG_EVENT_UNFILTERED" then
  12. local _, cEvent, _, sGUID = ...;
  13. if sGUID == UnitGUID("player") then
  14. if cEvent == "SPELL_DAMAGE" and (select(12, ...) == 222031 or select(12, ...) == 201427) and select(21, ...) then
  15. aura_env.buffer = 20;
  16. elseif cEvent == "SPELL_ENERGIZE" and select(12, ...) == 193840 then
  17. aura_env.buffer = 0;
  18. elseif cEvent == "SPELL_PERIODIC_ENERGIZE" and select(12, ...) == 203650 then
  19. --[[local d = 0;
  20. if aura_env.lastPrep then
  21. d = GetTime() - aura_env.lastPrep;
  22. end
  23. print(string.format("%.3f %.3f", GetTime(), d));
  24. aura_env.lastPrep = GetTime();]]
  25.  
  26. aura_env.preparedTick(aura_env.preparedCurrentTick);
  27. elseif cEvent == "SPELL_AURA_APPLIED" and select(12, ...) == 203650 then
  28. aura_env.prepared = {};
  29. aura_env.preparedCurrentTick = 1;
  30. for i=1,aura_env.preparedTicks do
  31. aura_env.prepared[i] = GetTime() + aura_env.preparedInterval * i;
  32. end
  33. aura_env.scheduleTick(1);
  34. end
  35. end
  36. elseif event == "PLAYER_REGEN_ENABLED" then
  37. aura_env.buffer = 0;
  38. elseif event == "WA_PREPARED_TICK" then
  39. aura_env.preparedTick(..., true);
  40. end
  41. return true;
  42. end
Advertisement
Add Comment
Please, Sign In to add comment