Advertisement
adde88

Priest core stuff

Aug 15th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.48 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. --------------------------------- PRIEST ---------------------------------------
  3. --------------------------------------------------------------------------------
  4.  
  5. Zylla.Voidform_Summary = true
  6. Zylla.S2M_Summary = true
  7.  
  8. --Zylla.Voidform_Drain_Stacks = 0
  9. --Zylla.Voidform_Current_Drain_Rate = 0
  10. --Zylla.SA_TOTAL = 0
  11.  
  12. function Zylla.SA_Cleanup(guid)
  13. if Zylla.SA_STATS[guid] then
  14. Zylla.SA_TOTAL = Zylla.SA_TOTAL - Zylla.SA_STATS[guid].Count
  15. if Zylla.SA_TOTAL < 0 then
  16. Zylla.SA_TOTAL = 0
  17. end
  18. Zylla.SA_STATS[guid].Count = nil
  19. Zylla.SA_STATS[guid].LastUpdate = nil
  20. Zylla.SA_STATS[guid] = nil
  21. Zylla.SA_NUM_UNITS = Zylla.SA_NUM_UNITS - 1
  22. if Zylla.SA_NUM_UNITS < 0 then
  23. Zylla.SA_NUM_UNITS = 0
  24. end
  25. end
  26. end
  27.  
  28. NeP.Listener:Add('Zylla.SA', 'COMBAT_LOG_EVENT_UNFILTERED', function(timestamp,combatevent,_,sourceGUID,sourcename,_,_,destGUID,destname,_,_,spellid,spellname,_,_,_,_,_,_,_,spellcritical,_,_,_,spellmultistrike)
  29. if Zylla.class == 5 then
  30. local CurrentTime = GetTime()
  31. Zylla.SA_NUM_UNITS = Zylla.SA_NUM_UNITS or 0
  32. Zylla.SA_TOTAL = Zylla.SA_TOTAL or 0
  33. -- Stats buffer
  34. Zylla.SA_STATS = Zylla.SA_STATS or {}
  35. Zylla.SA_DEAD = Zylla.SA_DEAD or {}
  36. Zylla.LAST_CONTINUITY_CHECK = Zylla.LAST_CONTINUITY_CHECK or GetTime()
  37. if sourceGUID == UnitGUID("player") then
  38. if spellid == 147193 and combatevent == "SPELL_CAST_SUCCESS" then -- Shadowy Apparition Spawned
  39. if not Zylla.SA_STATS[destGUID] or Zylla.SA_STATS[destGUID] == nil then
  40. Zylla.SA_STATS[destGUID] = {}
  41. Zylla.SA_STATS[destGUID].Count = 0
  42. Zylla.SA_NUM_UNITS = Zylla.SA_NUM_UNITS + 1
  43. end
  44. Zylla.SA_TOTAL = Zylla.SA_TOTAL + 1
  45. --print('SA spawn :'..Zylla.SA_TOTAL..' remaining SA')
  46. Zylla.SA_STATS[destGUID].Count = Zylla.SA_STATS[destGUID].Count + 1
  47. Zylla.SA_STATS[destGUID].LastUpdate = CurrentTime
  48. elseif spellid == 148859 and combatevent == "SPELL_DAMAGE" then --Auspicious Spirit Hit
  49. if Zylla.SA_TOTAL < 0 then
  50. Zylla.SA_TOTAL = 0
  51. else
  52. Zylla.SA_TOTAL = Zylla.SA_TOTAL - 1
  53. end
  54. --print('SA hit :'..Zylla.SA_TOTAL..' remaining SA')
  55. if Zylla.SA_STATS[destGUID] and Zylla.SA_STATS[destGUID].Count > 0 then
  56. Zylla.SA_STATS[destGUID].Count = Zylla.SA_STATS[destGUID].Count - 1
  57. Zylla.SA_STATS[destGUID].LastUpdate = CurrentTime
  58. if Zylla.SA_STATS[destGUID].Count <= 0 then
  59. Zylla.SA_Cleanup(destGUID)
  60. end
  61. end
  62. end
  63. end
  64. if Zylla.SA_TOTAL < 0 then
  65. Zylla.SA_TOTAL = 0
  66. end
  67. for guid,count in pairs(Zylla.SA_STATS) do
  68. if (CurrentTime - Zylla.SA_STATS[guid].LastUpdate) > 10 then
  69. --If we haven't had a new SA spawn in 10sec, that means all SAs that are out have hit the target (usually), or, the target disappeared.
  70. Zylla.SA_Cleanup(guid)
  71. end
  72. end
  73. if (combatevent == "UNIT_DIED" or combatevent == "UNIT_DESTROYED" or combatevent == "SPELL_INSTAKILL") then -- Unit Died, remove them from the target list.
  74. Zylla.SA_Cleanup(destGUID)
  75. end
  76.  
  77. if UnitIsDeadOrGhost("player") or not UnitAffectingCombat("player") or not InCombatLockdown() then -- We died, or, exited combat, go ahead and purge the list
  78. for guid,count in pairs(Zylla.SA_STATS) do
  79. Zylla.SA_Cleanup(guid)
  80. end
  81. Zylla.SA_STATS = {}
  82. Zylla.SA_NUM_UNITS = 0
  83. Zylla.SA_TOTAL = 0
  84. end
  85. if CurrentTime - Zylla.LAST_CONTINUITY_CHECK > 10 then --Force check of unit count every 10sec
  86. local newUnits = 0
  87. for guid,count in pairs(Zylla.SA_STATS) do
  88. newUnits = newUnits + 1
  89. end
  90. Zylla.SA_NUM_UNITS = newUnits
  91. Zylla.LAST_CONTINUITY_CHECK = CurrentTime
  92. end
  93. if Zylla.SA_NUM_UNITS > 0 then
  94. local totalSAs = 0
  95. for guid,count in pairs(Zylla.SA_STATS) do
  96. if Zylla.SA_STATS[guid].Count <= 0 or (UnitIsDeadOrGhost(guid)) then
  97. Zylla.SA_DEAD[guid] = true
  98. else
  99. totalSAs = totalSAs + Zylla.SA_STATS[guid].Count
  100. end
  101. end
  102. if totalSAs > 0 and Zylla.SA_TOTAL > 0 then
  103. return true
  104. end
  105. end
  106. return false
  107. end
  108. end)
  109.  
  110. NeP.Listener:Add('Zylla_VF_S2M', 'COMBAT_LOG_EVENT_UNFILTERED', function(timestamp,combatevent,_,sourceGUID,sourcename,_,_,destGUID,destname,_,_,spellid,spellname,_,_,_,_,_,_,_,spellcritical,_,_,_,spellmultistrike)
  111. if Zylla.class == 5 then
  112. local CurrentTime = GetTime()
  113. Zylla.Voidform_Total_Stacks = Zylla.Voidform_Total_Stacks or 0
  114. Zylla.Voidform_Previous_Stack_Time = Zylla.Voidform_Previous_Stack_Time or 0
  115. Zylla.Voidform_Drain_Stacks = Zylla.Voidform_Drain_Stacks or 0
  116. Zylla.Voidform_VoidTorrent_Stacks = Zylla.Voidform_VoidTorrent_Stacks or 0
  117. Zylla.Voidform_Dispersion_Stacks = Zylla.Voidform_Dispersion_Stacks or 0
  118. Zylla.Voidform_Current_Drain_Rate = Zylla.Voidform_Current_Drain_Rate or 0
  119. if Zylla.Voidform_Total_Stacks >= 100 then
  120. if (CurrentTime - Zylla.Voidform_Previous_Stack_Time) >= 1 then
  121. Zylla.Voidform_Previous_Stack_Time = CurrentTime
  122. Zylla.Voidform_Total_Stacks = Zylla.Voidform_Total_Stacks + 1
  123. if Zylla.Voidform_VoidTorrent_Start == nil and Zylla.Voidform_Dispersion_Start == nil then
  124. Zylla.Voidform_Drain_Stacks = Zylla.Voidform_Drain_Stacks + 1
  125. -- print('Zylla.Voidform_Drain_Stacks1: '..Zylla.Voidform_Drain_Stacks)
  126. Zylla.Voidform_Current_Drain_Rate = (9.0 + ((Zylla.Voidform_Drain_Stacks - 1) / 2))
  127. -- print('Zylla.Voidform_Current_Drain_Rate1: '..Zylla.Voidform_Current_Drain_Rate)
  128. elseif Zylla.Voidform_VoidTorrent_Start ~= nil then
  129. Zylla.Voidform_VoidTorrent_Stacks = Zylla.Voidform_VoidTorrent_Stacks + 1
  130. else
  131. Zylla.Voidform_Dispersion_Stacks = Zylla.Voidform_Dispersion_Stacks + 1
  132. end
  133. end
  134. end
  135. if sourceGUID == UnitGUID("player") then
  136. if spellid == 194249 then
  137. if combatevent == "SPELL_AURA_APPLIED" then -- Entered Voidform
  138. Zylla.Voidform_Previous_Stack_Time = CurrentTime
  139. Zylla.Voidform_VoidTorrent_Start = nil
  140. Zylla.Voidform_Dispersion_Start = nil
  141. Zylla.Voidform_Drain_Stacks = 1
  142. Zylla.Voidform_Start_Time = CurrentTime
  143. Zylla.Voidform_Total_Stacks = 1
  144. Zylla.Voidform_VoidTorrent_Stacks = 0
  145. Zylla.Voidform_Dispersion_Stacks = 0
  146. elseif combatevent == "SPELL_AURA_APPLIED_DOSE" then -- New Voidform Stack
  147. Zylla.Voidform_Previous_Stack_Time = CurrentTime
  148. Zylla.Voidform_Total_Stacks = Zylla.Voidform_Total_Stacks + 1
  149. if Zylla.Voidform_VoidTorrent_Start == nil and Zylla.Voidform_Dispersion_Start == nil then
  150. Zylla.Voidform_Drain_Stacks = Zylla.Voidform_Drain_Stacks + 1
  151. -- print('Zylla.Voidform_Drain_Stacks2: '..Zylla.Voidform_Drain_Stacks)
  152. Zylla.Voidform_Current_Drain_Rate = (9.0 + ((Zylla.Voidform_Drain_Stacks - 1) / 2))
  153. -- print('Zylla.Voidform_Current_Drain_Rate2: '..Zylla.Voidform_Current_Drain_Rate)
  154. elseif Zylla.Voidform_VoidTorrent_Start ~= nil then
  155. Zylla.Voidform_VoidTorrent_Stacks = Zylla.Voidform_VoidTorrent_Stacks + 1
  156. else
  157. Zylla.Voidform_Dispersion_Stacks = Zylla.Voidform_Dispersion_Stacks + 1
  158. end
  159. elseif combatevent == "SPELL_AURA_REMOVED" then -- Exited Voidform
  160. if Zylla.Voidform_Summary == true then
  161. print("Voidform Info:")
  162. print("--------------------------")
  163. print(string.format("Voidform Duration: %.2f seconds", (CurrentTime-Zylla.Voidform_Start_Time)))
  164. if Zylla.Voidform_Total_Stacks > 100 then
  165. print(string.format("Voidform Stacks: 100 (+%.0f)", (Zylla.Voidform_Total_Stacks - 100)))
  166. else
  167. print(string.format("Voidform Stacks: %.0f", Zylla.Voidform_Total_Stacks))
  168. end
  169. print(string.format("Dispersion Stacks: %.0f", Zylla.Voidform_Dispersion_Stacks))
  170. print(string.format("Void Torrent Stacks: %.0f", Zylla.Voidform_VoidTorrent_Stacks))
  171. print("Final Drain: "..Zylla.Voidform_Drain_Stacks.." stacks, "..Zylla.Voidform_Current_Drain_Rate.." / sec")
  172. end
  173. Zylla.Voidform_VoidTorrent_Start = nil
  174. Zylla.Voidform_Dispersion_Start = nil
  175. Zylla.Voidform_Drain_Stacks = 0
  176. Zylla.Voidform_Current_Drain_Rate = 0
  177. Zylla.Voidform_Start_Time = nil
  178. Zylla.Voidform_Total_Stacks = 0
  179. Zylla.Voidform_VoidTorrent_Stacks = 0
  180. Zylla.Voidform_Dispersion_Stacks = 0
  181. end
  182.  
  183. elseif spellid == 205065 then
  184. if combatevent == "SPELL_AURA_APPLIED" then -- Started channeling Void Torrent
  185. Zylla.Voidform_VoidTorrent_Start = CurrentTime
  186. elseif combatevent == "SPELL_AURA_REMOVED" and Zylla.Voidform_VoidTorrent_Start ~= nil then -- Stopped channeling Void Torrent
  187. Zylla.Voidform_VoidTorrent_Start = nil
  188. end
  189.  
  190. elseif spellid == 47585 then
  191. if combatevent == "SPELL_AURA_APPLIED" then -- Started channeling Dispersion
  192. Zylla.Voidform_Dispersion_Start = CurrentTime
  193. elseif combatevent == "SPELL_AURA_REMOVED" and Zylla.Voidform_Dispersion_Start ~= nil then -- Stopped channeling Dispersion
  194. Zylla.Voidform_Dispersion_Start = nil
  195. end
  196.  
  197. elseif spellid == 212570 then
  198. if combatevent == "SPELL_AURA_APPLIED" then -- Gain Surrender to Madness
  199. Zylla.Voidform_S2M_Activated = true
  200. Zylla.Voidform_S2M_Start = CurrentTime
  201. elseif combatevent == "SPELL_AURA_REMOVED" then -- Lose Surrender to Madness
  202. Zylla.Voidform_S2M_Activated = false
  203. end
  204. end
  205.  
  206. elseif destGUID == UnitGUID("player") and (combatevent == "UNIT_DIED" or combatevent == "UNIT_DESTROYED" or combatevent == "SPELL_INSTAKILL") and Zylla.Voidform_S2M_Activated == true then
  207. Zylla.Voidform_S2M_Activated = false
  208. if Zylla.S2M_Summary == true then
  209. print("Surrender to Madness Info:")
  210. print("--------------------------")
  211. print(string.format("S2M Duration: %.2f seconds", (CurrentTime-Zylla.Voidform_S2M_Start)))
  212. print(string.format("Voidform Duration: %.2f seconds", (CurrentTime-Zylla.Voidform_Start_Time)))
  213. if Zylla.Voidform_Total_Stacks > 100 then
  214. print(string.format("Voidform Stacks: 100 (+%.0f)", (Zylla.Voidform_Total_Stacks - 100)))
  215. else
  216. print(string.format("Voidform Stacks: %.0f", Zylla.Voidform_Total_Stacks))
  217. end
  218. print(string.format("Dispersion Stacks: %.0f", Zylla.Voidform_Dispersion_Stacks))
  219. print(string.format("Void Torrent Stacks: %.0f", Zylla.Voidform_VoidTorrent_Stacks))
  220. print("Final Drain: "..Zylla.Voidform_Drain_Stacks.." stacks, "..Zylla.Voidform_Current_Drain_Rate.." / sec")
  221. end
  222. Zylla.Voidform_S2M_Start = nil
  223. Zylla.Voidform_VoidTorrent_Start = nil
  224. Zylla.Voidform_Dispersion_Start = nil
  225. Zylla.Voidform_Drain_Stacks = 0
  226. Zylla.Voidform_Current_Drain_Rate = 0
  227. Zylla.Voidform_Start_Time = nil
  228. Zylla.Voidform_Total_Stacks = 0
  229. Zylla.Voidform_VoidTorrent_Stacks = 0
  230. Zylla.Voidform_Dispersion_Stacks = 0
  231. end
  232. end
  233. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement