Advertisement
Guest User

For ifoldz

a guest
Dec 9th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.14 KB | None | 0 0
  1. aura_env.updateInterval = 0.05
  2. aura_env.lastUpdate = GetTime()
  3. aura_env.targetWipeInterval = 5
  4.  
  5. aura_env.showCooldownRing = true
  6. aura_env.invertCooldownRing = false
  7. aura_env.showRangeHighlight = true
  8.  
  9. aura_env.enabledToggle = "ALT-SHIFT-T"
  10. aura_env.cooldownsToggle = "ALT-SHIFT-R"
  11.  
  12. WA_MiniHekili_Ret_Enabled = WeakAurasSaved.displays[aura_env.id].hekiliEnabled == nil and true or WeakAurasSaved.displays[aura_env.id].hekiliEnabled
  13. WA_MiniHekili_Ret_CDs = WeakAurasSaved.displays[aura_env.id].hekiliCooldowns == nil and false or WeakAurasSaved.displays[aura_env.id].hekiliCooldowns
  14.  
  15. aura_env.bindsInitialized = false
  16.  
  17. aura_env.keyhandler = aura_env.keyhandler or CreateFrame("Button", aura_env.id.."_Keyhandler", UIParent)
  18. aura_env.keyhandler.parent = aura_env
  19. aura_env.keyhandler:RegisterForClicks("AnyDown")
  20. aura_env.keyhandler:SetScript("OnClick", function (self, button, down)
  21. if button == "Cooldowns" then
  22. WA_MiniHekili_Ret_CDs = not WA_MiniHekili_Ret_CDs
  23. print("|cFF00FFFFMini-Hekili Cooldowns: " .. ( WA_MiniHekili_Ret_CDs and "|cFF00FF00ENABLED|r" or "|cFFFF0000DISABLED|r" ) )
  24. elseif button == "Enabled" then
  25. WA_MiniHekili_Ret_Enabled = not WA_MiniHekili_Ret_Enabled
  26. print("|cFF00FFFFMini-Hekili: " .. ( WA_MiniHekili_Ret_Enabled and "|cFF00FF00ENABLED|r" or "|cFFFF0000DISABLED|r" ) )
  27. end
  28.  
  29. WeakAurasSaved.displays[self.parent.id].hekiliEnabled = WA_MiniHekili_Ret_Enabled
  30. WeakAurasSaved.displays[self.parent.id].hekiliCooldowns = WA_MiniHekili_Ret_CDs
  31. end)
  32.  
  33. function aura_env.setupBinds()
  34.  
  35. if InCombatLockdown() then return end
  36.  
  37. ClearOverrideBindings( aura_env.keyhandler )
  38. SetOverrideBindingClick( aura_env.keyhandler, true, aura_env.enabledToggle, aura_env.id.."_Keyhandler", "Enabled" )
  39. SetOverrideBindingClick( aura_env.keyhandler, true, aura_env.cooldownsToggle, aura_env.id.."_Keyhandler", "Cooldowns" )
  40.  
  41.  
  42.  
  43. aura_env.bindsInitialized = true
  44.  
  45. end
  46.  
  47. aura_env.setupBinds()
  48. aura_env.recommended = 35395
  49. aura_env.timeToReady = 0
  50. aura_env.timeOffset = 0
  51.  
  52. aura_env.targets = {}
  53. aura_env.targetCount = 0
  54.  
  55. aura_env.talents = {
  56. final_verdict = { 1, 1, 1 },
  57. execution_sentence = { 1, 2, 1 },
  58. consecration = { 1, 3, 1 },
  59.  
  60. the_fires_of_justice = { 2, 1, 1 },
  61. zeal = { 2, 2, 1 },
  62. greater_judgment = { 2, 3, 1 },
  63.  
  64. fist_of_justice = { 3, 1, 1 },
  65. repentance = { 3, 2, 1 },
  66. blinding_light = { 3, 3, 1 },
  67.  
  68. virtues_blade = { 4, 1, 1 },
  69. blade_of_wrath = { 4, 2, 1 },
  70. divine_hammer = { 4, 3, 1 },
  71.  
  72. justicars_vengeance = {5, 1, 1 },
  73. eye_for_an_eye = { 5, 2, 1 },
  74. word_of_glory = { 5, 3, 1 },
  75.  
  76. divine_intervention = { 6, 1, 1 },
  77. divine_steed = { 6, 2, 1 },
  78. seal_of_light = {6, 3, 1 },
  79.  
  80. divine_purpose = { 7, 1, 1 },
  81. crusade = { 7, 2, 1 },
  82. holy_wrath = { 7, 3, 1 }
  83. }
  84.  
  85. aura_env.talented = {}
  86.  
  87. aura_env.abilities = {
  88. avenging_wrath = 31884,
  89. blade_of_justice = 184575,
  90. blade_of_wrath = 184575,
  91. consecration = 205228,
  92. crusade = 224668,
  93. crusader_strike = 35395,
  94. divine_storm = 53385,
  95. divine_hammer = 198034,
  96. execution_sentence = 213757,
  97. hammer_of_justice = 853,
  98. holy_wrath = 210220,
  99. judgment = 20271,
  100. justicars_vengeance = 215661,
  101. templars_verdict = 85256,
  102. wake_of_ashes = 205273,
  103. zeal = 217020
  104. }
  105.  
  106. aura_env.chargedAbilities = {
  107. crusader_strike = 35395,
  108. zeal = 217020,
  109. avenging_wrath = 31884,
  110. crusade = 224668
  111. }
  112.  
  113. aura_env.chargesMax = {}
  114. aura_env.chargeTime = {}
  115.  
  116. aura_env.treatAsCooldown = {
  117. holy_wrath = true,
  118. crusade = true,
  119. avenging_wrath = true,
  120. }
  121.  
  122. aura_env.abilityNames = {}
  123.  
  124. for k,v in pairs( aura_env.abilities ) do
  125. aura_env.abilityNames[ v ] = GetSpellInfo( v )
  126. end
  127.  
  128. aura_env.cooldowns = {}
  129. aura_env.charges = {}
  130.  
  131. aura_env.buffs = {
  132. avenging_wrath = 31884,
  133. crusade = 224668,
  134. divine_purpose = 223819,
  135. the_fires_of_justice = 209785,
  136. whisper_of_the_nathrezim = 207633,
  137. }
  138.  
  139. aura_env.buffNames = {}
  140.  
  141. for k,v in pairs( aura_env.buffs ) do
  142. aura_env.buffNames[ v ] = GetSpellInfo( v )
  143. end
  144.  
  145. aura_env.buffRemains = {}
  146.  
  147. aura_env.debuffs = {
  148. judgment = 197277,
  149.  
  150. }
  151.  
  152. -- ITEM 137020 whisper_of_the_nathrezim
  153.  
  154.  
  155. aura_env.debuffNames = {}
  156.  
  157. for k,v in pairs( aura_env.debuffs ) do
  158. aura_env.debuffNames[ v ] = GetSpellInfo( v )
  159. end
  160.  
  161. aura_env.debuffRemains = {}
  162.  
  163. function aura_env.rec( spell )
  164. aura_env.recommended = aura_env.abilities[ spell ]
  165. aura_env.timeToReady = aura_env.cooldowns[ spell ]
  166. end
  167.  
  168. function aura_env.ready( spell )
  169. if aura_env.talents[ spell ] and not aura_env.talented[ spell ] then
  170. return false
  171. end
  172.  
  173. if aura_env.cooldowns[ spell ] + 0.1 < aura_env.timeToReady then
  174. aura_env.timeOffset = aura_env.cooldowns[ spell ] + 0.1 -- build in a 0.1s buffer
  175. return true
  176. end
  177. return false
  178. end
  179.  
  180. function aura_env.try( spell, conditions )
  181. if not aura_env.ready( spell ) then return end
  182. if conditions ~= nil and not conditions then return end
  183. aura_env.rec( spell )
  184. end
  185.  
  186. function aura_env.buffRem( buff )
  187. return max( 0, aura_env.buffRemains[ buff ] - aura_env.timeOffset )
  188. end
  189.  
  190. function aura_env.buffUp( buff )
  191. return max( 0, aura_env.buffRemains[ buff ] - aura_env.timeOffset ) > 0
  192. end
  193.  
  194. function aura_env.debuffRem( debuff )
  195. return max( 0, aura_env.debuffRemains[ debuff ] - aura_env.timeOffset )
  196. end
  197.  
  198. function aura_env.debuffUp( debuff )
  199. return max( 0, aura_env.debuffRemains[ debuff ] - aura_env.timeOffset ) > 0
  200. end
  201.  
  202. function aura_env.chargeCt( spell )
  203. local rounded = tonumber( format( "%.1f", aura_env.timeOffset ) ) - 0.1
  204.  
  205. return min( aura_env.chargesMax[ spell ], aura_env.charges[ spell ] + rounded / aura_env.chargeTime[ spell ] )
  206. end
  207.  
  208.  
  209. function aura_env.cdLeft( spell )
  210. return max( 0, aura_env.cooldowns[ spell ] - aura_env.timeOffset )
  211. end
  212.  
  213. function aura_env.num_targets()
  214. return aura_env.targetCount
  215. end
  216.  
  217.  
  218. aura_env.buff = {
  219. handler = {}
  220. }
  221.  
  222. setmetatable( aura_env.buff, { __index = function( t, k )
  223. t.handler.aura = k
  224. return t.handler
  225. end } )
  226.  
  227. setmetatable( aura_env.buff.handler, { __index = function( t, k )
  228. if k == 'up' or k == 'react' then
  229. return aura_env.buffUp( t.aura )
  230. elseif k == 'remains' then
  231. return aura_env.buffRem( t.aura )
  232. end
  233. end } )
  234.  
  235. aura_env.debuff = {
  236. handler = {}
  237. }
  238.  
  239.  
  240. setmetatable( aura_env.debuff, { __index = function( t, k )
  241. t.handler.aura = k
  242. return t.handler
  243. end } )
  244.  
  245. setmetatable( aura_env.debuff.handler, { __index = function( t, k )
  246. if k == 'up' or k == 'react' then
  247. return aura_env.debuffUp( t.aura )
  248. elseif k == 'remains' then
  249. return aura_env.debuffRem( t.aura )
  250. end
  251. end } )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement