Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.95 KB | None | 0 0
  1.     if InitialSetupDone == false then
  2.         -- Without this, the default power bar will display Mana instead of Maelstrom in Ghost Wolf
  3.         oldUnitPower = UnitPower
  4.         UnitPower = (function(unitId, powerType, luaOrigin)
  5.             if luaOrigin and luaOrigin == "power.lua" then
  6.                 local currentSpec = GetSpecialization()
  7.                 if currentSpec ~= nil then
  8.                     local specId = GetSpecializationInfo(currentSpec)
  9.                     if specId == 262 or specId == 263 then -- Elemental or Enhancement
  10.                         return oldUnitPower(unitId, SPELL_POWER_MAELSTROM)
  11.                     end
  12.                 end
  13.             end
  14.             return oldUnitPower(unitId, powerType)
  15.         end)
  16.         oldUnitPowerMax = UnitPowerMax
  17.         UnitPowerMax = (function(unitId, powerType, luaOrigin)
  18.             if luaOrigin and luaOrigin == "power.lua" then
  19.                 local currentSpec = GetSpecialization()
  20.                 if currentSpec ~= nil then
  21.                     local specId = GetSpecializationInfo(currentSpec)
  22.                     if specId == 262 or specId == 263 then -- Elemental or Enhancement
  23.                         return oldUnitPowerMax(unitId, SPELL_POWER_MAELSTROM)
  24.                     end
  25.                 end
  26.             end
  27.             return oldUnitPowerMax(unitId, powerType)
  28.         end)
  29.         -- Without this, using Ghost Wolf will disable the alternate power bar
  30.         oldUnitPowerType = UnitPowerType
  31.         UnitPowerType = (function(...)
  32.             local currentSpec = GetSpecialization()
  33.             if currentSpec ~= nil then
  34.                 local specId = GetSpecializationInfo(currentSpec)
  35.                 if specId == 262 or specId == 263 then -- Elemental or Enhancement
  36.                     return SPELL_POWER_MAELSTROM, "MAELSTROM"
  37.                 end
  38.             end
  39.             return oldUnitPowerType(...)
  40.         end)
  41.         InitialSetupDone = true
  42.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement