diff --git a/Ovale.lua b/Ovale.lua index 389183d..4933bf7 100644 --- a/Ovale.lua +++ b/Ovale.lua @@ -36,6 +36,8 @@ Ovale.score = 0 Ovale.maxScore = 0 Ovale.serial = 0 Ovale.counter = {} +Ovale.lastSpellName = nil +Ovale.lastSpellTime = 0 Ovale.arbre = {} @@ -330,6 +332,21 @@ function Ovale:GetOtherDebuffs(spellName) return self.otherDebuffs[spellName] end +function Ovale:WithHaste(temps, hate) + if not temps then + temps = 0 + end + if (not hate) then + return temps + elseif (hate == "spell") then + return temps/(1+self.spellHaste/100) + elseif (hate == "melee") then + return temps/(1+self.meleeHaste/100) + else + return temps + end +end + function Ovale:COMBAT_LOG_EVENT_UNFILTERED(event, ...) if self.otherDebuffsEnabled then local time, event, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = select(1, ...) @@ -340,7 +357,7 @@ function Ovale:COMBAT_LOG_EVENT_UNFILTERED(event, ...) if auraType == "DEBUFF" and self.spellInfo[spellName] and self.spellInfo[spellName].duration then local otherDebuff = self:GetOtherDebuffs(spellName) if event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_REFRESH" then - otherDebuff[destGUID] = Ovale.maintenant + self.spellInfo[spellName].duration + otherDebuff[destGUID] = Ovale.maintenant + self:WithHaste(self.spellInfo[spellName].duration, self.spellInfo[spellName].durationhaste) -- self:Print("ajout de "..spellName.." à "..destGUID) elseif event == "SPELL_AURA_REMOVED" then otherDebuff[destGUID] = nil @@ -555,9 +572,13 @@ function Ovale:OnEnable() end function Ovale:UNIT_SPELLCAST_SENT(event,unit,name,rank,target) - -- self:Print("UNIT_SPELLCAST_SENT"..event.." unit="..unit.." name="..name.." tank="..rank.." target="..target) +-- self:Print("UNIT_SPELLCAST_SENT"..event.." unit="..unit.." name="..name.." tank="..rank.." target="..target) + if unit=="player" then + self.lastSpellName = name + self.lastSpellTime = GetTime() + end + if unit=="player" and self.enCombat then - -- self.lastSpellCast=name if self.spellInfo[name] then if self.spellInfo[name].resetcounter then self.counter[self.spellInfo[name].resetcounter] = 0 @@ -1029,11 +1050,15 @@ function Ovale:InitCalculerMeilleureAction() local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitCastingInfo("player") if (spell) then self:AddSpellToStack(spell, startTime/1000, endTime/1000, endTime/1000) - end - - local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitChannelInfo("player") - if (spell) then - self:AddSpellToStack(spell, startTime/1000, endTime/1000, endTime/1000) + else + local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitChannelInfo("player") + if (spell) then + self:AddSpellToStack(spell, startTime/1000, endTime/1000, endTime/1000) + elseif self.lastSpellName then + if self.lastSpellName and self.maintenant - self.lastSpellTime<0.3 then + self:AddSpellToStack(self.lastSpellName, self.lastSpellTime, self.lastSpellTime, self.lastSpellTime) + end + end end end diff --git a/defaut/Chevalier.lua b/defaut/Chevalier.lua index 84f471f..2450ff6 100644 --- a/defaut/Chevalier.lua +++ b/defaut/Chevalier.lua @@ -35,7 +35,6 @@ Define(RAISEDEAD 46584) Define(HORNOFWINTER 57330) AddCheckBox(rolldes SpellName(GLYPHDISEASE) default glyph=GLYPHDISEASE) -AddCheckBox(horn SpellName(HORNOFWINTER) default) SpellAddTargetDebuff(ICYTOUCH FROSTFEVER=15) SpellAddTargetDebuff(PLAGUESTRIKE BLOODPLAGUE=15) @@ -56,7 +55,7 @@ AddIcon help=main { Spell(DANCINGRUNEWEAPON usable=1) - if CheckBoxOn(horn) and BuffExpires(HORNOFWINTER 2) Spell(HORNOFWINTER) + if BuffExpires(HORNOFWINTER 2) Spell(HORNOFWINTER) if CheckBoxOn(rolldes) and Glyph(GLYPHDISEASE) and TargetDebuffPresent(FROSTFEVER mine=1) and TargetDebuffPresent(BLOODPLAGUE mine=1) and diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua index 2dde6a0..52a3751 100644 --- a/defaut/Pretre.lua +++ b/defaut/Pretre.lua @@ -23,7 +23,7 @@ SpellAddTargetDebuff(SWP SWP=18) SpellInfo(SWP duration=18) SpellAddBuff(SWP SW=15) SpellAddTargetDebuff(VT VT=15) -SpellInfo(VT duration=15) +SpellInfo(VT duration=15 durationhaste=spell) SpellAddBuff(VT SW=15) SpellInfo(MF canStopChannelling=3) SpellAddBuff(MF SW=15) @@ -31,7 +31,7 @@ SpellInfo(MB cd=5.5) SpellAddBuff(MB SW=15) SpellAddBuff(IF IF=1800) SpellAddTargetDebuff(DP DP=24) -SpellInfo(DP duration=24) +SpellInfo(DP duration=24 durationhaste=spell) SpellInfo(Focus cd=180) SpellInfo(Dispersion cd=120) SpellInfo(Shadowfiend cd=300)