Advertisement
Guest User

Surge Fix

a guest
Sep 15th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.58 KB | None | 0 0
  1. local ktSurgedIDs =
  2.   {
  3.     [20684] = {
  4.       name = "Charged Shot",
  5.       tiers = {
  6.         t1 = { 34718, 34719 },
  7.         t2 = { 48940, 48949 },
  8.         t3 = { 48941, 48950 },
  9.         t4 = { 48942, 48951 },
  10.         t5 = { 48943, 48952 },
  11.         t6 = { 48944, 48953 },
  12.         t7 = { 48945, 48954 },
  13.         t8 = { 48946, 48955 },
  14.         t9 = { 48947, 48956 }
  15.       }
  16.     },
  17.     [20734] = {
  18.       name = "Wild Barrage",
  19.       tiers = {
  20.         t1 = { 34772, 34773 },
  21.         t2 = { 48904, 48913 },
  22.         t3 = { 48905, 48914 },
  23.         t4 = { 48906, 48915 },
  24.         t5 = { 48907, 48916 },
  25.         t6 = { 48908, 48917 },
  26.         t7 = { 48909, 48918 },
  27.         t8 = { 48910, 48919 },
  28.         t9 = { 48911, 48920 }
  29.       }
  30.     },
  31.     [21056] = {
  32.       name = "Rapid Fire",
  33.       tiers = {
  34.         t1 = { 35356, 35357, 35358, 35359, 38937, 51501 },
  35.         t2 = { 51391, 51400, 51410, 51419 },
  36.         t3 = { 51392, 51401, 51411, 51420 },
  37.         t4 = { 51393, 51402, 51412, 51421 },
  38.         t5 = { 51394, 51403, 51413, 51422 },
  39.         t6 = { 51395, 51404, 51414, 51423 },
  40.         t7 = { 51396, 51405, 51415, 51424 },
  41.         t8 = { 51397, 51406, 51416, 51425 },
  42.         t9 = { 51398, 51407, 51417, 51426 }
  43.       }
  44.     },
  45.     [21490] = {
  46.       name = "Astral Infusion",
  47.       tiers = {
  48.         t1 = { 35870, 54717 },
  49.         t2 = { 49730, 54718 },
  50.         t3 = { 49731, 54719 },
  51.         t4 = { 49732, 54720 },
  52.         t5 = { 49733, 54721 },
  53.         t6 = { 49734, 54722 },
  54.         t7 = { 49735, 54723 },
  55.         t8 = { 49736, 54724 },
  56.         t9 = { 49737, 54725 }
  57.       }
  58.     },
  59.     [21650] = {
  60.       name = "True Shot",
  61.       tiers = {
  62.         t1 = { 36052, 36085 },
  63.         t2 = { 49078, 49114 },
  64.         t3 = { 49079, 49115 },
  65.         t4 = { 49080, 49116 },
  66.         t5 = { 49081, 49117 },
  67.         t6 = { 49082, 49118 },
  68.         t7 = { 49083, 49119 },
  69.         t8 = { 49084, 49121 },
  70.         t9 = { 49085, 49122 }
  71.       }
  72.     },
  73.     [23274] = {
  74.       name = "Assassinate",
  75.       tiers = {
  76.         t1 = { 38905, 39324, 39325, 69215, 69224 },
  77.         t2 = { 49051, 49060, 49069, 69216, 69225 },
  78.         t3 = { 49052, 49061, 49070, 69217, 69226 },
  79.         t4 = { 49053, 49062, 49071, 69218, 69227 },
  80.         t5 = { 49054, 49063, 49072, 69219, 69228 },
  81.         t6 = { 49055, 49064, 49073, 69220, 69229 },
  82.         t7 = { 49056, 49065, 49074, 69221, 69230 },
  83.         t8 = { 49057, 49066, 49075, 69222, 69231 },
  84.         t9 = { 49058, 49067, 49076, 69223, 69232 }
  85.       }
  86.     },
  87.     [23418] = {
  88.       name = "Dual Fire",
  89.       tiers = {
  90.         t1 = { 39068, 53286 },
  91.         t2 = { 49558, 53287 },
  92.         t3 = { 49560, 53288 },
  93.         t4 = { 49561, 53289 },
  94.         t5 = { 49562, 53290 },
  95.         t6 = { 49563, 53291 },
  96.         t7 = { 49564, 53292 },
  97.         t8 = { 49565, 53293 },
  98.         t9 = { 49566, 53294 }
  99.       }
  100.     },
  101.     [23441] = {
  102.       name = "Runes of Protection",
  103.       tiers = {
  104.         t1 = { 39092, 39327, 69761 },
  105.         t2 = { 49225, 49234 },
  106.         t3 = { 49226, 49235 },
  107.         t4 = { 49227, 49236 },
  108.         t5 = { 49228, 49237 },
  109.         t6 = { 49229, 49238 },
  110.         t7 = { 49230, 49239 },
  111.         t8 = { 49231, 49240 },
  112.         t9 = { 49232, 49241 }
  113.       }
  114.     },
  115.     [23463] = {
  116.       name = "Healing Torrent",
  117.       tiers = {
  118.         t1 = { 39116, 39131 },
  119.         t2 = { 49640, 49649 },
  120.         t3 = { 49641, 49650 },
  121.         t4 = { 49642, 49651 },
  122.         t5 = { 49643, 49652 },
  123.         t6 = { 49644, 49653 },
  124.         t7 = { 49645, 49654 },
  125.         t8 = { 49646, 49655 },
  126.         t9 = { 49647, 49656 }
  127.       }
  128.     },
  129.     [23468] = {
  130.       name = "Healing Salve",
  131.       tiers = {
  132.         t1 = { 39121, 47601 },
  133.         t2 = { 49586, 49631 },
  134.         t3 = { 49587, 49632 },
  135.         t4 = { 49588, 49633 },
  136.         t5 = { 49589, 49634 },
  137.         t6 = { 49590, 49635 },
  138.         t7 = { 49591, 49636 },
  139.         t8 = { 49592, 49637 },
  140.         t9 = { 49593, 49638 }
  141.       }
  142.     },
  143.     [23479] = {
  144.       name = "Vitality Burst",
  145.       tiers = {
  146.         t1 = { 39132, 39133 },
  147.         t2 = { 49658, 49667 },
  148.         t3 = { 49659, 49668 },
  149.         t4 = { 49660, 49669 },
  150.         t5 = { 49661, 49670 },
  151.         t6 = { 49662, 49671 },
  152.         t7 = { 49663, 49672 },
  153.         t8 = { 49664, 49673 },
  154.         t9 = { 49665, 49674 }
  155.       }
  156.     },
  157.     [23481] = {
  158.       name = "Voidspring",
  159.       tiers = {
  160.         t1 = { 39134, 47600 },
  161.         t2 = { 51800, 53475 },
  162.         t3 = { 51801, 53476 },
  163.         t4 = { 51802, 53477 },
  164.         t5 = { 51803, 53478 },
  165.         t6 = { 51804, 53479 },
  166.         t7 = { 51805, 53480 },
  167.         t8 = { 51806, 53481 },
  168.         t9 = { 51807, 53482 }
  169.       }
  170.     },
  171.     [27504] = {
  172.       name = "Sustain",
  173.       tiers = {
  174.         t1 = { 43326, 43398 },
  175.         t2 = { 51850, 51863 },
  176.         t3 = { 51851, 51864 },
  177.         t4 = { 51852, 51865 },
  178.         t5 = { 51853, 51866 },
  179.         t6 = { 51854, 51867 },
  180.         t7 = { 51855, 51868 },
  181.         t8 = { 51856, 51869 },
  182.         t9 = { 51857, 51870 }
  183.       }
  184.     },
  185.     [27736] = {
  186.       name = "Arcane Missiles",
  187.       tiers = {
  188.         t1 = { 43570, 43619 },
  189.         t2 = { 54941, 54989 },
  190.         t3 = { 54942, 54990 },
  191.         t4 = { 54943, 54991 },
  192.         t5 = { 54944, 54992 },
  193.         t6 = { 54945, 54993 },
  194.         t7 = { 54946, 54994 },
  195.         t8 = { 54947, 54995 },
  196.         t9 = { 54948, 54996 }
  197.       }
  198.     },
  199.     [27774] = {
  200.       name = "Chill",
  201.       tiers = {
  202.         t1 = { 43609, 43613 },
  203.         t2 = { 49178, 49198 },
  204.         t3 = { 49179, 49199 },
  205.         t4 = { 49180, 49200 },
  206.         t5 = { 49181, 49201 },
  207.         t6 = { 49182, 49202 },
  208.         t7 = { 49183, 49203 },
  209.         t8 = { 49184, 49204 },
  210.         t9 = { 49185, 49205 }
  211.       }
  212.     },
  213.     [23959] = {
  214.       name = "Regenerative Pulse",
  215.       tiers = {
  216.         t1 = { 39646, 47078, 47079, 47080, 47081, 47082, 47090 },
  217.         t2 = { 51691, 51702, 51711, 51720, 51729 },
  218.         t3 = { 51692, 51703, 51712, 51721, 51730 },
  219.         t4 = { 51693, 51704, 51713, 51722, 51731 },
  220.         t5 = { 51695, 51705, 51714, 51723, 51732 },
  221.         t6 = { 51696, 51706, 51715, 51724, 51733 },
  222.         t7 = { 51697, 51707, 51716, 51725, 51734 },
  223.         t8 = { 51698, 51708, 51717, 51726, 51735 },
  224.         t9 = { 51699, 51709, 51718, 51727, 51736 }
  225.       }
  226.     }
  227.   }
  228.  
  229. function AlpacaActions:RefreshCombatAction(wndAction)
  230.   local objSpell = wndAction:FindChild("Button"):GetContent().spell
  231.  
  232.   if not objSpell then
  233.     return
  234.   end
  235.  
  236. --CHANGE BEGINS HERE
  237.   local tCooldowns = {}
  238.   if ktSurgedIDs[objSpell:GetBaseSpellId()] then
  239.         for idx, spellID in ipairs(ktSurgedIDs[objSpell:GetBaseSpellId()].tiers["t"..objSpell:GetTier()]) do
  240.             tCooldowns[idx] = GameLib.GetSpell(spellID):GetCooldownRemaining()
  241.         end
  242.   else
  243.         tCooldowns[1] = objSpell:GetCooldownRemaining()
  244.   end
  245.  
  246.   local fCooldownRemaining = math.max(unpack(tCooldowns))
  247. --CHANGE ENDS HERE
  248.   local tAbilityCharges = objSpell:GetAbilityCharges()
  249.   local nChargesMax = tAbilityCharges.nChargesMax
  250.   local nChargesRemaining = tAbilityCharges.nChargesRemaining
  251.   local fRechargeRemaining = tAbilityCharges.fRechargeTime * tAbilityCharges.fRechargePercentRemaining
  252.          
  253.   if nChargesMax > 0 then
  254.     if nChargesRemaining == 0 then
  255.       self:MoveButton(wndAction:FindChild("Button"), math.min(1, fRechargeRemaining / self.tSettings.tCombatActionBar.nCutoff))
  256.     else
  257.       self:MoveButton(wndAction:FindChild("Button"), 0)
  258.     end
  259.   else
  260.     self:MoveButton(wndAction:FindChild("Button"), math.min(1, fCooldownRemaining / self.tSettings.tCombatActionBar.nCutoff))
  261.   end
  262. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement