diff --git a/Condition.lua b/Condition.lua index 21ecf10..eca50c7 100644 --- a/Condition.lua +++ b/Condition.lua @@ -206,7 +206,7 @@ local function GetTargetAura(condition, filter, target) local spellId = condition[1] local aura = Ovale:GetAura(target, filter, spellId) if Ovale.trace then - Ovale:Print("GetTargetAura = start = ".. nilstring(aura.start) .. " end = "..nilstring(aura.ending).." stacks = " ..nilstring(aura.stacks).."/"..stacks) + -- Ovale:Print("GetTargetAura = start = ".. nilstring(aura.start) .. " end = "..nilstring(aura.ending).." stacks = " ..nilstring(aura.stacks).."/"..stacks) end if (not condition.mine or aura.mine) and aura.stacks>=stacks then return aura.start, aura.ending diff --git a/Ovale.lua b/Ovale.lua index be0cef8..5dae2b3 100644 --- a/Ovale.lua +++ b/Ovale.lua @@ -943,9 +943,9 @@ function Ovale:InitCalculerMeilleureAction() self.state.rune[i].type = GetRuneType(i) local start, duration, runeReady = GetRuneCooldown(i) if runeReady then - self.state.rune[i].cd = 0 + self.state.rune[i].cd = start else - self.state.rune[i].cd = duration - (self.maintenant - start) + self.state.rune[i].cd = duration + start if self.state.rune[i].cd<0 then self.state.rune[i].cd = 0 end @@ -1230,7 +1230,7 @@ function Ovale:CalculerMeilleureAction(element) end elseif (element.type == "before") then if (Ovale.trace) then - self:Print(element.time.."s before") + self:Print(element.time.."s before ["..element.nodeId.."]") end local startA, endA = Ovale:CalculerMeilleureAction(element.a) return addTime(startA, -element.time), addTime(endA, -element.time) @@ -1258,17 +1258,20 @@ function Ovale:CalculerMeilleureAction(element) return nil elseif (element.type == "and" or element.type == "if") then if (Ovale.trace) then - if Ovale.trace then Ovale:Print(element.type.." return nil") end - self:Print(element.type) + self:Print(element.type.." ["..element.nodeId.."]") end local startA, endA = Ovale:CalculerMeilleureAction(element.a) if (startA==nil) then - if Ovale.trace then Ovale:Print(element.type.." return nil") end + if Ovale.trace then Ovale:Print(element.type.." return nil ["..element.nodeId.."]") end + return nil + end + if startA == endA then + if Ovale.trace then Ovale:Print(element.type.." return startA=endA ["..element.nodeId.."]") end return nil end local startB, endB, prioriteB, elementB = Ovale:CalculerMeilleureAction(element.b) if isAfter(startB, endA) or isAfter(startA, endB) then - if Ovale.trace then Ovale:Print(element.type.." return nil") end + if Ovale.trace then Ovale:Print(element.type.." return nil ["..element.nodeId.."]") end return nil end if isBefore(startB, startA) then @@ -1278,7 +1281,7 @@ function Ovale:CalculerMeilleureAction(element) endB = endA end if Ovale.trace then - Ovale:Print(element.type.." return "..nilstring(startB)..","..nilstring(endB)) + Ovale:Print(element.type.." return "..nilstring(startB)..","..nilstring(endB).." ["..element.nodeId.."]") end return startB, endB, prioriteB, elementB elseif (element.type == "unless") then @@ -1329,7 +1332,7 @@ function Ovale:CalculerMeilleureAction(element) local bestElement if (Ovale.trace) then - self:Print(element.type) + self:Print(element.type.." ["..element.nodeId.."]") end for k, v in ipairs(element.nodes) do @@ -1378,9 +1381,9 @@ function Ovale:CalculerMeilleureAction(element) if (meilleurTempsFils) then if (Ovale.trace) then if bestElement then - self:Print("group best action "..bestElement.params[1].." remains "..meilleurTempsFils) + self:Print("group best action "..bestElement.params[1].." remains "..meilleurTempsFils..","..nilstring(bestEnd).." ["..element.nodeId.."]") else - self:Print("group no best action") + self:Print("group no best action returns "..meilleurTempsFils..","..nilstring(bestEnd).." ["..element.nodeId.."]") end end return meilleurTempsFils, bestEnd, meilleurePrioriteFils, bestElement diff --git a/OvaleCompile.lua b/OvaleCompile.lua index 3f1a402..ac9639a 100644 --- a/OvaleCompile.lua +++ b/OvaleCompile.lua @@ -3,6 +3,12 @@ local L = LibStub("AceLocale-3.0"):GetLocale("Ovale") local node={} local defines = {} +local function AddNode(newNode) + node[#node+1] = newNode + newNode.nodeId = #node + return "node"..#node +end + local function ParseParameters(params) local paramList = {} for k,v in string.gmatch(params, "(%w+)=([-%w]+)") do @@ -29,8 +35,7 @@ end local function ParseFunction(func, params) local paramList = ParseParameters(params) local newNode = { type="function", func=func, params=paramList} - node[#node+1] = newNode - return "node"..#node + return AddNode(newNode) end local function ParseSpellAddDebuff(params) @@ -87,38 +92,32 @@ end local function ParseIf(a, b) local newNode = {type="if", a=node[tonumber(a)], b=node[tonumber(b)]} - node[#node+1] = newNode - return "node"..#node + return AddNode(newNode) end local function ParseUnless(a, b) local newNode = {type="unless", a=node[tonumber(a)], b=node[tonumber(b)]} - node[#node+1] = newNode - return "node"..#node + return AddNode(newNode) end local function ParseAnd(a,b) local newNode = {type="and", a=node[tonumber(a)], b=node[tonumber(b)]} - node[#node+1] = newNode - return "node"..#node + return AddNode(newNode) end local function ParseBefore(a,b) local newNode = {type="before", time=tonumber(a), a=node[tonumber(b)]} - node[#node+1] = newNode - return "node"..#node + return AddNode(newNode) end local function ParseBetween(t,a,b) local newNode = {type="between", time=tonumber(t), a=node[tonumber(a)], b=node[tonumber(b)]} - node[#node+1] = newNode - return "node"..#node + return AddNode(newNode) end local function ParseOr(a,b) local newNode = {type="or", a=node[tonumber(a)], b=node[tonumber(b)]} - node[#node+1] = newNode - return "node"..#node + return AddNode(newNode) end local function ParseGroup(text) @@ -136,8 +135,7 @@ local function ParseGroup(text) end local newNode = {type="group", nodes=nodes} - node[#node+1] = newNode - return "node"..#node + return AddNode(newNode) end local function subtest(text, pattern, func) diff --git a/OvaleIcone.lua b/OvaleIcone.lua index a9106bd..acf7054 100644 --- a/OvaleIcone.lua +++ b/OvaleIcone.lua @@ -73,7 +73,7 @@ local function Update(self, minAttente, actionTexture, actionInRange, actionCool -- Le temps restant if (Ovale.db.profile.apparence.numeric) then - self.remains:SetText(string.format("%.1f", minAttente)) + self.remains:SetText(string.format("%.1f", minAttente - Ovale.maintenant)) self.remains:Show() else self.remains:Hide() diff --git a/defaut/Chevalier.lua b/defaut/Chevalier.lua index 973800e..907dd3e 100644 --- a/defaut/Chevalier.lua +++ b/defaut/Chevalier.lua @@ -11,7 +11,7 @@ Define(BLOODSTRIKE 45902) Define(BLOODBOIL 48721) Define(BLOODPLAGUE 59879) Define(FROSTFEVER 59921) -Define(PESTILENCE 50842) +Define(PESTILENCE 50842)a Define(ICYTOUCH 45477) Define(PLAGUESTRIKE 45462) Define(HEARTSTRIKE 55050) @@ -27,11 +27,12 @@ Define(DANCINGRUNEWEAPON 49028) Define(FROSTSTRIKE 49143) Define(HYSTERIA 49016) Define(SUMMONGARGOYLE 49206) -Define(GLYPHDISEASE 63959) +Define(GLYPHDISEASE 63334) Define(GLYPHHOWLINGBLAST 63961) Define(ABOMINATIONMIGHT 53136) Define(TALENTABOMINATIONMIGHT 2105) Define(RAISEDEAD 46584) +Define(HORNOFWINTER 57330) AddCheckBox(rolldes SpellName(GLYPHDISEASE)) @@ -52,9 +53,12 @@ ScoreSpells(HOWLINGBLAST HEARTSTRIKE BLOODSTRIKE DEATHSTRIKE SCOURGESTRIKE OBLIT AddIcon help=main { Spell(DANCINGRUNEWEAPON usable=1) + + if BuffExpires(HORNOFWINTER 2) Spell(HORNOFWINTER) - if CheckBoxOn(rolldes) and Glyph(GLYPHDISEASE) and TargetDebuffExpires(FROSTFEVER 2 mine=1) and TargetDebuffPresent(FROSTFEVER mine=1) and - TargetDebuffExpires(BLOODPLAGUE 2 mine=1) and TargetDebuffPresent(BLOODPLAGUE mine=1) + if CheckBoxOn(rolldes) and Glyph(GLYPHDISEASE) + and TargetDebuffPresent(FROSTFEVER mine=1) and TargetDebuffPresent(BLOODPLAGUE mine=1) and + {TargetDebuffExpires(FROSTFEVER 3 mine=1) or TargetDebuffExpires(BLOODPLAGUE 3 mine=1)} Spell(PESTILENCE) if TargetDebuffPresent(FROSTFEVER mine=1) and TargetDebuffPresent(BLOODPLAGUE mine=1) @@ -81,7 +85,7 @@ AddIcon help=main } } - if CheckBoxOn(rolldes) and TalentPoints(TALENTABOMINATIONMIGHT more 0) and BuffPresent(ABOMINATIONMIGHT no) + if CheckBoxOn(rolldes) and TalentPoints(TALENTABOMINATIONMIGHT more 0) and BuffExpires(ABOMINATIONMIGHT 0) Spell(DEATHSTRIKE) if TargetDebuffExpires(FROSTFEVER 0 mine=1) and Runes(frost 1)