Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wotlk cooldown additions #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Icons/Spell_Holy_LayOnHands_Improved.tga
Binary file not shown.
61 changes: 44 additions & 17 deletions PallyPower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,17 @@ function PallyPowerBlessingsGrid_Update(self, elapsed)
AllPallys[name].CooldownInfo = {}
end
local CooldownInfo = AllPallys[name].CooldownInfo
for id = 1, 2 do

for id = 1, 4 do
if CooldownInfo[id] then
-- use extra icon to show weather LoH is improved or not
if (id == 1) then
if (CooldownInfo[id].improved > 0) then
_G[fname .. "CIcon" .. id]:SetTexture("Interface\\AddOns\\PallyPower\\Icons\\Spell_Holy_LayOnHands_Improved")
else
_G[fname .. "CIcon" .. id]:SetTexture("Interface\\Icons\\Spell_Holy_LayOnHands")
end
end
_G[fname .. "CIcon" .. id]:Show()
_G[fname .. "CSkill" .. id]:Show()
if CooldownInfo[id].start ~= 0 and CooldownInfo[id].duration ~= 0 then
Expand Down Expand Up @@ -1362,6 +1371,12 @@ function PallyPower:ScanCooldowns()
CooldownInfo[cd].start = start
CooldownInfo[cd].duration = duration
CooldownInfo[cd].remaining = math.max(start + duration - GetTime(), 0)
if cd == 1 then -- improved Lay on Hands
CooldownInfo[cd].improved = select(5, GetTalentInfo(1, self.isWrath and 4 or 7))
end
if (cd == 3) and self.isWrath then -- improved Divine Guardian
CooldownInfo[cd].improved = select(5, GetTalentInfo(2, 25))
end
break
end
end
Expand Down Expand Up @@ -1470,7 +1485,7 @@ function PallyPower:SendSelf(sender)
if #AllPallys[self.player].CooldownInfo > 0 then
local s = ""
CooldownInfo = AllPallys[self.player].CooldownInfo
for i = 1, 2 do
for i = 1, self.isWrath and 4 or 2 do
if CooldownInfo[i] then
if not CooldownInfo[i].duration then
s = s .. ":n"
Expand All @@ -1482,8 +1497,13 @@ function PallyPower:SendSelf(sender)
else
s = s .. ":" .. CooldownInfo[i].remaining
end
if not CooldownInfo[i].improved then
s = s .. ":n"
else
s = s .. ":" .. CooldownInfo[i].improved
end
else
s = s .. ":n:n"
s = s .. ":n:n:n"
end
Cooldowns = s
end
Expand Down Expand Up @@ -1838,24 +1858,31 @@ function PallyPower:ParseMessage(sender, msg)
end

if strfind(msg, "COOLDOWNS") then
local _, duration1, remaining1, duration2, remaining2 = strsplit(":", msg)
local senderCooldownList = strsplittable(":", msg)
local isOldPP = (#senderCooldownList % 3) > 0 -- if data is sent from older PP only use 2 params
local dataSize = isOldPP and 3 or 2
local senderCooldownTable = {
duration = {},
remaining = {},
improved = {}
}
for i = 1, #senderCooldownList, i + (dataSize) do
SaschaJankowiak marked this conversation as resolved.
Show resolved Hide resolved
local cdIndex = math.ceil(i / dataSize)
senderCooldownTable.duration[cdIndex] = tonumber(senderCooldownList[i])
senderCooldownTable.remaining[cdIndex] = tonumber(senderCooldownList[i+1])
senderCooldownTable.improved[cdIndex] = (not isOldPP) and tonumber(senderCooldownList[i+2]) or 0
end
if AllPallys[sender] then
if not AllPallys[sender].CooldownInfo then
AllPallys[sender].CooldownInfo = {}
end
if not AllPallys[sender].CooldownInfo[1] and remaining1 ~= "n" then
AllPallys[sender].CooldownInfo[1] = {}
duration1 = tonumber(duration1)
remaining1 = tonumber(remaining1)
AllPallys[sender].CooldownInfo[1].start = GetTime() - (duration1 - remaining1)
AllPallys[sender].CooldownInfo[1].duration = duration1
end
if not AllPallys[sender].CooldownInfo[2] and remaining2 ~= "n" then
AllPallys[sender].CooldownInfo[2] = {}
duration2 = tonumber(duration2)
remaining2 = tonumber(remaining2)
AllPallys[sender].CooldownInfo[2].start = GetTime() - (duration2 - remaining2)
AllPallys[sender].CooldownInfo[2].duration = duration2
for i=1, #self.Cooldowns do
if not AllPallys[sender].CooldownInfo[i] and senderCooldownTable.remaining[i] ~= nil then
AllPallys[sender].CooldownInfo[i] = {}
AllPallys[sender].CooldownInfo[i].duration = senderCooldownTable.duration[i]
AllPallys[sender].CooldownInfo[i].start = GetTime() - (senderCooldownTable.duration[i] - senderCooldownTable.remaining[i])
AllPallys[sender].CooldownInfo[i].improved = senderCooldownTable.improved[i] or 0
end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions PallyPowerValues.lua
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ PallyPower.Auras = PallyPower.isWrath and {
PallyPower.Cooldowns = {
[1] = {633, 2800, 10310, 27154, 48788}, -- Lay On Hands
[2] = {19752}, -- Divine Intervention
[3] = {53527, 53530}, -- Divine Guardian
[4] = {31821} -- Aura Mastery
}

-------------------------------------------------------------------
Expand Down
Loading