Skip to content

Commit

Permalink
Fix the durations for the other polymorph ranks
Browse files Browse the repository at this point in the history
  • Loading branch information
funkjedi committed Sep 16, 2019
1 parent 93928b4 commit 880ac9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion SheepMonitor.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: Sheep Monitor
## Notes: Provides various methods of notification to help you keep track of your flock.
## Author: funkjedi
## Version: 1.21
## Version: 1.22
## SavedVariables: SheepMonitorDatabase
## OptionalDeps: Ace3, LibAuras, LibAuraInfo-1.0

Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.22
- use correct durations based on Polymorph rank

1.21
- added support for Polymorph (Rank 2), Polymorph (Rank 3) and Polymorph (Rank 4)

Expand Down
19 changes: 9 additions & 10 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ function SheepMonitor:OnInitialize()

self:CreateInterfaceOptions()
--InterfaceOptionsFrame_OpenToCategory('SheepMonitor')

if (self:IsClassic()) {
LibAuraInfo.auraInfo[118] = '20;1'
LibAuraInfo.auraInfo[12824] = '30;1'
LibAuraInfo.auraInfo[12825] = '40;1'
LibAuraInfo.auraInfo[12826] = '50;1'
LibAuraInfo.auraInfo[28272] = '50;1'
}
end

function SheepMonitor:IsClassic()
Expand Down Expand Up @@ -76,16 +84,7 @@ function SheepMonitor:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
timestamp = GetTime(),
duration = LibAuraInfo:GetDuration(spellId, sourceGUID, destGUID),
}
if self:IsClassic() then
local playerLevel = UnitLevel('player')
if spellId == 118 and playerLevel < 20 then
aura.duration = 20
elseif spellId == 118 and playerLevel < 40 then
aura.duration = 30
elseif spellId == 118 and playerLevel < 60 then
aura.duration = 40
end
elseif destGUID == UnitGUID('target') then
if not self:IsClassic() and destGUID == UnitGUID('target') then
aura.duration = select(5, LibAuras:UnitAura('target', spellId, 'PLAYER|HARMFUL')) or 0
end
self:AuraApplied(aura)
Expand Down

0 comments on commit 880ac9b

Please sign in to comment.