From d377066f2fa87bf499896131edf4b92bad34ffbd Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Tue, 2 Mar 2010 20:57:23 +0000 Subject: [PATCH] - added InCombat,EndCastSpell functions - changes in arcane mage - every class uses InCombat to know if it should buff itself - corruption has a higher priority than agony - do not cast a curse if another curse is present git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@236 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 12 +++++++ Locale-enUS.lua | 3 +- Locale-frFR.lua | 3 +- Ovale.lua | 88 +++++++++++++++++++++++++++++++------------------- Ovale.toc | 2 +- OvaleCompile.lua | 25 ++++++++------ defaut/Chaman.lua | 14 +++++--- defaut/Demoniste.lua | 33 +++++++++++-------- defaut/Mage.lua | 12 ++++++- defaut/Paladin.lua | 46 ++++++++++++++------------ defaut/Pretre.lua | 24 +++++++------- 11 files changed, 167 insertions(+), 95 deletions(-) diff --git a/Condition.lua b/Condition.lua index e29d0da..3e91dcf 100644 --- a/Condition.lua +++ b/Condition.lua @@ -464,6 +464,15 @@ Ovale.conditions= return 0,limit end end, + EndCastTime = function(condition) + local name, rank, icon, cost, isFunnel, powerType, castTime = Ovale:GetSpellInfoOrNil(condition[1]) + local actionCooldownStart, actionCooldownDuration, actionEnable = Ovale:GetComputedSpellCD(name) + local startCast = actionCooldownStart + actionCooldownDuration + if startCastelement.time) then + local timeB = Ovale:CalculerMeilleureAction(element.time) + self:Log(tempsA.." "..element.comparison.." "..timeB) + if element.comparison == "more" and (not tempsA or tempsA>timeB) then if Ovale.trace then Ovale:Print(element.type.." return 0") end return 0 - elseif element.comparison == "less" and tempsA and tempsA=element.time) then + elseif element.comparison == "at least" and (not tempsA or tempsA>=timeB) then if Ovale.trace then Ovale:Print(element.type.." return 0") end return 0 end @@ -1705,7 +1723,7 @@ function Ovale:ChargerDefaut() list = {}, apparence = {enCombat=false, iconWidth = 64, iconHeight = 64, margin = 4, smallIconWidth=28, smallIconHeight=28, raccourcis=true, numeric=false, avecCible = false, - verrouille = false, vertical = false, predictif=false, highlightIcon = true, clickThru = false, latencyCorrection=true}, + verrouille = false, vertical = false, predictif=false, highlightIcon = true, clickThru = false, latencyCorrection=true, hideVehicule=true}, skin = {SkinID="Blizzard", Backdrop = true, Gloss = false, Colors = {}} } }) @@ -1740,12 +1758,16 @@ function Ovale:UpdateVisibility() end self.frame:Show() + + if Ovale.db.profile.apparence.hideVehicule and UnitInVehicle("player") then + self.frame:Hide() + end - if (Ovale.db.profile.apparence.avecCible and not UnitExists("target")) then + if Ovale.db.profile.apparence.avecCible and not UnitExists("target") then self.frame:Hide() end - if (Ovale.db.profile.apparence.enCombat and not Ovale.enCombat) then + if Ovale.db.profile.apparence.enCombat and not Ovale.enCombat then self.frame:Hide() end diff --git a/Ovale.toc b/Ovale.toc index 010a079..271b0f6 100644 --- a/Ovale.toc +++ b/Ovale.toc @@ -3,7 +3,7 @@ ## Notes: Show the icon of the next spell to cast ## Notes-frFR: Affiche l'icône du prochain sort à lancer ## Author: Sidoine -## Version: 3.3.27 +## Version: 3.3.28 ## OptionalDeps: Ace3, ButtonFacade, Recount, LibBabble-CreatureType-3.0 ## SavedVariables: OvaleDB ## SavedVariablesPerCharacter: OvaleDBPC diff --git a/OvaleCompile.lua b/OvaleCompile.lua index 2e5e06e..783cf6d 100644 --- a/OvaleCompile.lua +++ b/OvaleCompile.lua @@ -35,6 +35,10 @@ local function ParseParameters(params) return paramList end +local function ParseTime(value) + return AddNode({type="time", value=tonumber(value)}) +end + local function ParseFunction(func, params) local paramList = ParseParameters(params) local newNode = { type="function", func=func, params=paramList} @@ -142,7 +146,7 @@ local function ParseAnd(a,b) end local function ParseBefore(a,b) - local newNode = {type="before", time=tonumber(a), a=node[tonumber(b)]} + local newNode = {type="before", time=node[tonumber(a)], a=node[tonumber(b)]} return AddNode(newNode) end @@ -162,7 +166,7 @@ local function ParseOr(a,b) end local function ParseCompare(comp,t,a) - local newNode = {type="compare", comparison=comp, time=tonumber(t), a=node[tonumber(a)]} + local newNode = {type="compare", comparison=comp, time=node[tonumber(t)], a=node[tonumber(a)]} return AddNode(newNode) end @@ -234,18 +238,19 @@ local function ParseAddIcon(params, text) while (1==1) do local was = text text = string.gsub(text, "(%w+)%s*%((.-)%)", ParseFunction) + text = string.gsub(text, "(%d+%.?%d*)s", ParseTime) text = string.gsub(text, "between%s+node(%d+)%s+and%s+node(%d+)", ParseBetween) text = string.gsub(text, "from%s+node(%d+)%s+until%s+node(%d+)", ParseFromUntil) text = string.gsub(text, "node(%d+)%s+and%s+node(%d+)", ParseAnd) text = string.gsub(text, "node(%d+)%s+or%s+node(%d+)", ParseOr) - text = string.gsub(text, "(%d+%.?%d*)s%s+before%s+node(%d+)", ParseBefore) + text = string.gsub(text, "node(%d+)%s+before%s+node(%d+)", ParseBefore) text = string.gsub(text, "if%s+node(%d+)%s+node(%d+)",ParseIf) text = string.gsub(text, "unless%s+node(%d+)%s+node(%d+)",ParseUnless) text = string.gsub(text, "{([node%d ]*)}", ParseGroup) - text = string.gsub(text, "(more)%s+than%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare) - text = string.gsub(text, "(less)%s+than%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare) - text = string.gsub(text, "(at least)%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare) - text = string.gsub(text, "(at most)%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare) + text = string.gsub(text, "(more)%s+than%s+node(%d+)%s+node(%d+)", ParseCompare) + text = string.gsub(text, "(less)%s+than%s+node(%d+)%s+node(%d+)", ParseCompare) + text = string.gsub(text, "(at least)%s+node(%d+)%s+node(%d+)", ParseCompare) + text = string.gsub(text, "(at most)%s+node(%d+)%s+node(%d+)", ParseCompare) if (was == text) then break @@ -382,13 +387,15 @@ function Ovale:DebugNode(node) elseif (node.type == "or") then text = self:DebugNode(node.a).." or "..self:DebugNode(node.b) elseif (node.type == "before") then - text = node.time .. "s before "..self:DebugNode(node.a) + text = self:DebugNode(node.time) .. " before "..self:DebugNode(node.a) elseif (node.type == "between") then text = "between "..self:DebugNode(node.a).." and "..self:DebugNode(node.b) elseif (node.type == "fromuntil") then text = "from "..self:DebugNode(node.a).." until "..self:DebugNode(node.b) elseif (node.type == "compare") then - text = node.comparison.." than "..node.time.."s "..self:DebugNode(node.a) + text = node.comparison.." than "..self:DebugNode(node.time).." "..self:DebugNode(node.a) + elseif (node.type == "time") then + text = node.value.."s" else text = "#unknown node type#" end diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua index b10b802..22426dc 100644 --- a/defaut/Chaman.lua +++ b/defaut/Chaman.lua @@ -68,7 +68,10 @@ AddIcon help=main { unless TalentPoints(TALENTFLURRY more 0) { - if WeaponEnchantExpires(mainhand 2) Spell(FLAMETHONG) + unless InCombat() + { + if WeaponEnchantExpires(mainhand 400) Spell(FLAMETHONG) + } if BuffExpires(WATERSHIELD 2) Spell(WATERSHIELD) if CheckBoxOn(firenova) { @@ -80,14 +83,17 @@ AddIcon help=main if TargetDebuffExpires(FLAMESHOCK 0 mine=1) Spell(FLAMESHOCK) unless TargetDebuffExpires(FLAMESHOCK 1.6 haste=spell mine=1) Spell(LAVABURST) - if CheckBoxOn(chain) and 1.4s before Spell(LAVABURST) and CastTime(LIGHTNINGBOLT more 1.5) + if CheckBoxOn(chain) and CastTime(LIGHTNINGBOLT more 1.5) and at least 0s from Spell(LAVABURST) until EndCastTime(CHAINLIGHTNING) Spell(CHAINLIGHTNING) Spell(LIGHTNINGBOLT) } if TalentPoints(TALENTFLURRY more 0) { - if WeaponEnchantExpires(mainhand 2) Spell(WINDFURYWEAPON) - if WeaponEnchantExpires(offhand 2) Spell(FLAMETHONG) + unless InCombat() + { + if WeaponEnchantExpires(mainhand 400) Spell(WINDFURYWEAPON) + if WeaponEnchantExpires(offhand 400) Spell(FLAMETHONG) + } if CheckBoxOn(aoe) and BuffPresent(MAELSTROMWEAPON stacks=5) Spell(CHAINLIGHTNING) if BuffPresent(MAELSTROMWEAPON stacks=5) Spell(LIGHTNINGBOLT) diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua index f28ddd9..62ed14a 100644 --- a/defaut/Demoniste.lua +++ b/defaut/Demoniste.lua @@ -63,13 +63,18 @@ ScoreSpells(CURSEELEMENTS SHADOWBOLT HAUNT UNSTABLEAFFLICTION IMMOLATE CONFLAGRA AddIcon help=main { -if BuffExpires(FELARMOR) Spell(FELARMOR) -if WeaponEnchantExpires(mainhand 5) + +unless InCombat() { - if TalentPoints(TALENTEMBERSTORM more 0) Spell(FIRESTONE) - Spell(SPELLSTONE) - Spell(FIRESTONE) + if BuffExpires(FELARMOR 400) Spell(FELARMOR) + if WeaponEnchantExpires(mainhand 400) + { + if TalentPoints(TALENTEMBERSTORM more 0) Spell(FIRESTONE) + Spell(SPELLSTONE) + Spell(FIRESTONE) + } } + if Glyph(GLYPHLIFETAP) and BuffExpires(LIFETAP 0) Spell(LIFETAP) if List(curse elements) and TargetDebuffExpires(CURSEELEMENTS 2) and TargetDeadIn(more 8) Spell(CURSEELEMENTS) if TalentPoints(TALENTSHADOWEMBRACE more 0) and TargetDebuffExpires(SHADOWEMBRACE 0) Spell(SHADOWBOLT) @@ -84,16 +89,18 @@ if TalentPoints(TALENTBACKDRAFT more 0) and TargetDebuffPresent(IMMOLATE mine=1) if TargetDebuffExpires(IMMOLATE 1.5 mine=1 haste=spell) and TargetDebuffExpires(UNSTABLEAFFLICTION 0 mine=1) and {TargetLifePercent(more 25) or TalentPoints(TALENTDECIMATION more 0)} and TargetDeadIn(more 8) Spell(IMMOLATE) -if List(curse doom) and TargetDebuffExpires(CURSEDOOM 0 mine=1) -{ - if TargetDeadIn(more 60) Spell(CURSEDOOM) - if TargetDebuffExpires(CURSEAGONY 0 mine=1) Spell(CURSEAGONY) -} -if List(curse tongues) and TargetDebuffExpires(CURSETONGUES 2) Spell(CURSETONGUES) -if List(curse weakness) and TargetDebuffExpires(CURSEWEAKNESS 2) Spell(CURSEWEAKNESS) -if List(curse agony) and TargetDebuffExpires(CURSEAGONY 0 mine=1) and TargetDeadIn(more 10) Spell(CURSEAGONY) + if TargetDebuffExpires(CORRUPTION 0 mine=1) and TargetDebuffExpires(SEEDOFCORRUPTION 0 mine=1) and TargetDeadIn(more 9) and TalentPoints(TALENTEMBERSTORM less 1) Spell(CORRUPTION) + +if TargetDebuffExpires(CURSEDOOM 0) and TargetDebuffExpires(CURSETONGUES 2) and TargetDebuffExpires(CURSEWEAKNESS 2) + and TargetDebuffExpires(CURSEAGONY 0 mine=1) and TargetDebuffExpires(CURSEELEMENTS 2) +{ + if List(curse doom) and TargetDeadIn(more 60) Spell(CURSEDOOM) + if List(curse tongues) Spell(CURSETONGUES) + if List(curse weakness) Spell(CURSEWEAKNESS) + if TargetDeadIn(more 10) Spell(CURSEAGONY) +} if BuffPresent(DECIMATION) Spell(SOULFIRE) diff --git a/defaut/Mage.lua b/defaut/Mage.lua index 8474d49..013f727 100644 --- a/defaut/Mage.lua +++ b/defaut/Mage.lua @@ -30,6 +30,10 @@ Define(MIRRORIMAGE 55342) Define(SUMMONWATERELEMENTAL 31687) Define(PRESENCEOFMIND 12043) +Define(MAGEARMOR 6117) +Define(MOLTENARMOR 30482) +Define(ICEARMOR 7302) + AddCheckBox(scorch SpellName(SCORCH) default talent=TALENTIMPROVEDSCORSH) AddCheckBox(abarr SpellName(ARCANEBARRAGE) default talent=TALENTARCANEBARRAGE) @@ -48,6 +52,12 @@ ScoreSpells(SCORCH PYROBLAST LIVINGBOMB FROSTFIREBOLT FIREBALL SUMMONWATERELEMEN AddIcon help=main { + unless InCombat() + { + if BuffExpires(MAGEARMOR 400) or BuffExpires(MOLTENARMOR 400) or BuffExpires(ICEARMOR 400) + Spell(MOLTENARMOR) + } + if TalentPoints(TALENTLIVINGBOMB more 0) { #Fire spec @@ -71,7 +81,7 @@ AddIcon help=main if TalentPoints(TALENTARCANEBARRAGE more 0) { #Arcane spec - unless DebuffPresent(ARCANEBLAST stacks=3) + unless DebuffPresent(ARCANEBLAST stacks=4) Spell(ARCANEBLAST) if BuffPresent(MISSILEBARRAGE) Spell(ARCANEMISSILES) diff --git a/defaut/Paladin.lua b/defaut/Paladin.lua index 7078a3e..7fd9a49 100644 --- a/defaut/Paladin.lua +++ b/defaut/Paladin.lua @@ -57,29 +57,33 @@ SpellInfo(AVENGINGWRATH cd=180) AddIcon help=main { - if List(sceau piete) and BuffExpires(SEALRIGHTEOUSNESS 3) Spell(SEALRIGHTEOUSNESS) - if List(sceau autorite) and BuffExpires(SEALCOMMAND 3) Spell(SEALCOMMAND) - if List(sceau vengeance) - { - if BuffExpires(SEALVENGEANCE 3) Spell(SEALVENGEANCE) - if BuffExpires(SEALCORRUPTION 3) Spell(SEALCORRUPTION) - } - if TargetTargetIsPlayer(yes) Spell(HOLYSHIELD) - Spell(HAMMEROFTHERIGHTEOUS) + unless InCombat() + { + if List(sceau piete) and BuffExpires(SEALRIGHTEOUSNESS 400) Spell(SEALRIGHTEOUSNESS) + if List(sceau autorite) and BuffExpires(SEALCOMMAND 400) Spell(SEALCOMMAND) + if List(sceau vengeance) + { + if BuffExpires(SEALVENGEANCE 400) Spell(SEALVENGEANCE) + if BuffExpires(SEALCORRUPTION 400) Spell(SEALCORRUPTION) + } + } - Spell(CRUSADERSTRIKE) - Spell(HAMMEROFWRATH usable=1) - if List(jugement lumiere) Spell(JUDGELIGHT) - if List(jugement sagesse) Spell(JUDGEWISDOM) - if CheckBoxOn(tempete) Spell(DIVINESTORM) - if HasShield() Spell(SHIELDOFRIGHTEOUSNESS) - if TalentPoints(TALENTGUARDEDBYTHELIGHT more 0) and BuffExpires(DIVINEPLEA 0) Spell(DIVINEPLEA) - if CheckBoxOn(consecration) Spell(CONSECRATE) - if BuffPresent(THEARTOFWAR) Spell(EXORCISM) - if CheckBoxOn(coleredivine) Spell(HOLYWRATH) + if TargetTargetIsPlayer(yes) Spell(HOLYSHIELD) + Spell(HAMMEROFTHERIGHTEOUS) - Spell(HOLYSHOCK) - if BuffPresent(THEARTOFWAR) Spell(FLASHOFLIGHT priority=2) + Spell(CRUSADERSTRIKE) + Spell(HAMMEROFWRATH usable=1) + if List(jugement lumiere) Spell(JUDGELIGHT) + if List(jugement sagesse) Spell(JUDGEWISDOM) + if CheckBoxOn(tempete) Spell(DIVINESTORM) + if HasShield() Spell(SHIELDOFRIGHTEOUSNESS) + if TalentPoints(TALENTGUARDEDBYTHELIGHT more 0) and BuffExpires(DIVINEPLEA 0) Spell(DIVINEPLEA) + if CheckBoxOn(consecration) Spell(CONSECRATE) + if BuffPresent(THEARTOFWAR) Spell(EXORCISM) + if CheckBoxOn(coleredivine) Spell(HOLYWRATH) + + Spell(HOLYSHOCK) + if BuffPresent(THEARTOFWAR) Spell(FLASHOFLIGHT priority=2) } AddIcon help=cd diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua index 6cb005d..c1615b2 100644 --- a/defaut/Pretre.lua +++ b/defaut/Pretre.lua @@ -40,17 +40,19 @@ ScoreSpells(MB SWP VT DP MF) # Add main monitor AddIcon help=main { - -#Check shadowform is up -unless BuffPresent(SF) - Spell(SF) - -# Refresh inner fire -if BuffExpires(IF 60) - Spell(IF) - -if BuffExpires(VE 60) - Spell(VE) +unless InCombat() +{ + #Check shadowform is up + unless BuffPresent(SF) + Spell(SF) + + # Refresh inner fire + if BuffExpires(IF 400) + Spell(IF) + + if BuffExpires(VE 400) + Spell(VE) +} #if inner focus is active, cast mind blast if BuffPresent(Focus) -- 1.7.9.5