Skip to content

Commit

Permalink
Merge pull request #34 from slow-loris/maxValue
Browse files Browse the repository at this point in the history
Max value
  • Loading branch information
Aviana authored Sep 19, 2019
2 parents e2cfb89 + 87a2c97 commit ef4d0fa
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions YaHT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,21 @@ end

function YaHT:COMBAT_LOG_EVENT_UNFILTERED()
local _, event, _, casterID, _, _, _, targetID, targetName, _, _, spellID, name, _, extra_spell_id, _, _, resisted, blocked, absorbed = CombatLogGetCurrentEventInfo()
local _, rank, icon, castTime = GetSpellInfo(spellID)
local _, rank, icon, castTime = GetSpellInfo(spellID)
local icon, castTime = select(3, GetSpellInfo(spellID))
if event == "SWING_DAMAGE" or event == "ENVIRONMENTAL_DAMAGE" or event == "RANGE_DAMAGE" or event == "SPELL_DAMAGE" then
if resisted or blocked or absorbed then return end
if targetID == UnitGUID("player") then
if name == AimedShot then
AimedDelay = 1
castTime = 3000
else
CastingBarFrame.maxValue = CastingBarFrame.maxValue + math.min(CastingBarFrame:GetValue(),AimedDelay)
AimedDelay = 1
castTime = 3000
else
local maxValue
maxValue = 0
if not CastingBarFrame.maxValue == nil then
maxValue = CastingBarFrame.maxValue
end
CastingBarFrame.maxValue = maxValue + math.min(CastingBarFrame:GetValue(),AimedDelay)
CastingBarFrame:SetMinMaxValues(0, CastingBarFrame.maxValue)
if AimedDelay > 0.2 then
AimedDelay = AimedDelay - 0.2
Expand Down

0 comments on commit ef4d0fa

Please sign in to comment.