From 974cae7769a35e2ca05bbc4271f7b2f31e691200 Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Wed, 30 Dec 2009 17:07:45 +0000 Subject: [PATCH] - Some changes to the syntax introduced in 3.3.6. Now forceduration is a parameter to TargetDebuffPresent/Expires() functions. It can be a duration in seconds if SpellInfo is not defined for the spell. - The syntax of between X and X has been changed. Now it is "less than Ns between X and Y" or "more than Ns between X and Y" which should be more explicit - added "buff" text git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@178 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 6 +++++- Locale-enUS.lua | 3 ++- Locale-frFR.lua | 3 ++- Ovale.lua | 33 ++++++++++++++++++++++++++------- Ovale.toc | 2 +- OvaleCompile.lua | 6 +++--- defaut/Druide.lua | 2 +- 7 files changed, 40 insertions(+), 15 deletions(-) diff --git a/Condition.lua b/Condition.lua index 7a652f2..8207975 100644 --- a/Condition.lua +++ b/Condition.lua @@ -204,7 +204,7 @@ local function GetTargetAura(condition, filter, target) stacks = 1 end local spellId = condition[1] - local aura = Ovale:GetAura(target, filter, spellId) + local aura = Ovale:GetAura(target, filter, spellId, condition.forceduration) -- if Ovale.trace then -- Ovale:Print("GetTargetAura = start = ".. nilstring(aura.start) .. " end = "..nilstring(aura.ending).." stacks = " ..nilstring(aura.stacks).."/"..stacks) -- end @@ -613,6 +613,10 @@ Ovale.conditions= end return compare(Ovale.pointsTalent[condition[1]], condition[2], condition[3]) end, + TargetDispellableBuffPresent = function(condition) + + return nil + end, -- Test if a buff is present on the target -- 1 : buff spell id -- stacks : how many stacks diff --git a/Locale-enUS.lua b/Locale-enUS.lua index 657ec91..d65b2fc 100644 --- a/Locale-enUS.lua +++ b/Locale-enUS.lua @@ -41,4 +41,5 @@ L["Prédictif"] = "Two abilities" L["Affiche les deux prochains sorts et pas uniquement le suivant"] = "Display two abilities and not only one" L["Défilement"] = "Scrolling" L["Les icônes se déplacent"] = "Scroll the icons" -L["multidot"] = "Damage Over Time on multiple targets" \ No newline at end of file +L["multidot"] = "Damage Over Time on multiple targets" +L["buff"] = "Buffs" \ No newline at end of file diff --git a/Locale-frFR.lua b/Locale-frFR.lua index 3c6e826..629af7b 100644 --- a/Locale-frFR.lua +++ b/Locale-frFR.lua @@ -41,4 +41,5 @@ L["Prédictif"] = "Deux sorts" L["Affiche les deux prochains sorts et pas uniquement le suivant"] = true L["Défilement"] = true L["Les icônes se déplacent"] = true -L["multidot"] = "Multicible pour DoTs" \ No newline at end of file +L["multidot"] = "Multicible pour DoTs" +L["buff"] = "Améliorations" \ No newline at end of file diff --git a/Ovale.lua b/Ovale.lua index ef7209b..fbc8b13 100644 --- a/Ovale.lua +++ b/Ovale.lua @@ -782,7 +782,7 @@ function Ovale:AddRune(time, type, value) end end -function Ovale:GetAura(target, filter, spellId) +function Ovale:GetAura(target, filter, spellId, forceduration) if not self.aura[target] then self.aura[target] = {} end @@ -815,8 +815,12 @@ function Ovale:GetAura(target, filter, spellId) myAura.mine = (unitCaster == "player") myAura.start = expirationTime - duration - if self.spellInfo[name] and self.spellInfo[name].forceduration then - duration = self.spellInfo[name].duration + if self.spellInfo[name] and forceduration then + if self.spellInfo[name].duration then + duration = self.spellInfo[name].duration + else + duration = forceduration + end end if expirationTime>0 then @@ -1281,17 +1285,32 @@ function Ovale:CalculerMeilleureAction(element) local tempsA = Ovale:CalculerMeilleureAction(element.a) if (tempsA==nil) then if Ovale.trace then Ovale:Print(element.type.." return nil") end - return nil + if element.comparison == "more" then + return 0 + else + return nil + end end local tempsB = Ovale:CalculerMeilleureAction(element.b) if (tempsB==nil) then if Ovale.trace then Ovale:Print(element.type.." return nil") end - return nil + if element.comparison == "more" then + return 0 + else + return nil + end end - if (tempsA>tempsB and tempsA-tempsBtempsB then + diff = tempsA - tempsB + else + diff = tempsB - tempsA + end + + if element.comparison == "more" and diff>element.time then if Ovale.trace then Ovale:Print(element.type.." return 0") end return 0 - elseif (tempsB>tempsA and tempsB-tempsA