From 90e69c9773e9818410f296baaf13e200172b4399 Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Sun, 15 May 2011 16:25:20 +0000 Subject: [PATCH] - fix with BuffExpires and BuffDuration, which did not use the target parameter - added checkboxon, checkboxoff, and list/item parameters to AddListItem, AddCheckBox and AddIcon - fury warrior: death wish is not an enrage git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@409 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 4 ++-- Ovale.lua | 6 +++++ Ovale.toc | 2 +- OvaleCompile.lua | 65 +++++++++++++++++++++++++++++++++++++++----------- defaut/Demoniste.lua | 2 ++ defaut/Guerrier.lua | 8 +++---- 6 files changed, 66 insertions(+), 21 deletions(-) diff --git a/Condition.lua b/Condition.lua index e2aab46..585dff3 100644 --- a/Condition.lua +++ b/Condition.lua @@ -348,14 +348,14 @@ Ovale.conditions= --if not name then -- return nil -- end - local start, ending = GetTargetAura(condition, "HELPFUL", "player") + local start, ending = GetTargetAura(condition, "HELPFUL", getTarget(condition.target)) return compare(diffTime(start, ending), condition[2], condition[3]) end, -- Test if a buff will expire on the player after a given time -- 1 : buff spell id -- 2 : expiration time BuffExpires = function(condition) - local start, ending = GetTargetAura(condition, "HELPFUL", "player") + local start, ending = GetTargetAura(condition, "HELPFUL", getTarget(condition.target)) local timeBefore = avecHate(condition[2], condition.haste) if Ovale.trace then Ovale:Print("timeBefore = " .. nilstring(timeBefore)) diff --git a/Ovale.lua b/Ovale.lua index c1c1ccc..14c5539 100644 --- a/Ovale.lua +++ b/Ovale.lua @@ -2343,10 +2343,16 @@ end local function OnCheckBoxValueChanged(widget) Ovale.db.profile.check[widget.userdata.k] = widget:GetValue() + if Ovale.casesACocher[widget.userdata.k].compile then + Ovale.needCompile = true + end end local function OnDropDownValueChanged(widget) Ovale.db.profile.list[widget.userdata.k] = widget.value + if Ovale.listes[widget.userdata.k].compile then + Ovale.needCompile = true + end end function Ovale:ToggleOptions() diff --git a/Ovale.toc b/Ovale.toc index 30ca7ba..a2a2bb5 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: 4.1.1 +## Version: 4.1.2 ## OptionalDeps: Ace3, ButtonFacade, Recount, Skada, LibBabble-CreatureType-3.0, LibRangeCheck-2.0 ## SavedVariables: OvaleDB ## SavedVariablesPerCharacter: OvaleDBPC diff --git a/OvaleCompile.lua b/OvaleCompile.lua index b6b4358..ab5d258 100644 --- a/OvaleCompile.lua +++ b/OvaleCompile.lua @@ -247,13 +247,53 @@ local function subtest(text, pattern, func) return text end -local function ParseAddListItem(list, item, text, params) - local paramList = ParseParameters(params) - if (paramList.talent and not HasTalent(paramList.talent)) or - (paramList.glyph and not HasGlyph(paramList.glyph)) then - return "" +local function TestConditions(paramList) + if paramList.glyph and not HasGlyph(paramList.glyph) then + return false end if paramList.mastery and paramList.mastery~=GetPrimaryTalentTree() then + return false + end + if paramList.talent and not HasTalent(paramList.talent) then + return false + end + if paramList.checkboxon then + local cb = paramList.checkboxon + if not Ovale.casesACocher[cb] then + Ovale.casesACocher[cb] = {} + end + Ovale.casesACocher[cb].compile = true + if not Ovale.db.profile.check[cb] then + return false + end + end + if paramList.checkboxoff then + local cb = paramList.checkboxoff + if not Ovale.casesACocher[cb] then + Ovale.casesACocher[cb] = {} + end + Ovale.casesACocher[cb].compile = true + if Ovale.db.profile.check[cb] then + return false + end + end + if paramList.list and paramList.item then + local list = paramList.list + local key = paramList.item + if not Ovale.listes[list] then + Ovale.listes[list] = { items = {}} + end + Ovale.listes[list].compile = true + if Ovale.db.profile.list[list] ~= key then + return false + end + end + return true +end + +local function ParseAddListItem(list, item, text, params) + local paramList = ParseParameters(params) + if not TestConditions(paramList) then return "" end if (not Ovale.listes[list]) then @@ -266,16 +306,16 @@ local function ParseAddListItem(list, item, text, params) return "" end + local function ParseAddCheckBox(item, text, params) local paramList = ParseParameters(params) - if (paramList.talent and not HasTalent(paramList.talent)) or - (paramList.glyph and not HasGlyph(paramList.glyph)) then + if not TestConditions(paramList) then return "" end - if paramList.mastery and paramList.mastery~=GetPrimaryTalentTree() then - return "" + if not Ovale.casesACocher[item] then + Ovale.casesACocher[item] = {} end - Ovale.casesACocher[item] = {text = text} + Ovale.casesACocher[item].text = text if paramList[1] and paramList[1]=="default" then Ovale.casesACocher[item].checked = true end @@ -352,10 +392,7 @@ local function ParseAddIcon(params, text) local masterNode = ParseCommands(text) masterNode = node[tonumber(masterNode)] masterNode.params = ParseParameters(params) - if masterNode.params.talent and not HasTalent(masterNode.params.talent) then - return nil - end - if masterNode.params.mastery and masterNode.params.mastery~=GetPrimaryTalentTree() then + if not TestConditions(masterNode.params) then return nil end return masterNode diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua index c7e6cc6..65e2cbb 100644 --- a/defaut/Demoniste.lua +++ b/defaut/Demoniste.lua @@ -1,8 +1,10 @@ Ovale.defaut["WARLOCK"]= [[ Define(BANEOFAGONY 980) + Spellinfo(BANEOFAGONY duration=24) SpellAddTargetDebuff(BANEOFAGONY BANEOFAGONY=24) Define(BANEOFDOOM 603) + SpellInfo(BANEOFDOOM duration=60) SpellAddTargetDebuff(BANEOFDOOM BANEOFDOOM=60) Define(BANEOFHAVOC 80240) SpellAddTargetDebuff(BANEOFHAVOC BANEOFHAVOC=300) diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua index 1987077..41c3e04 100644 --- a/defaut/Guerrier.lua +++ b/defaut/Guerrier.lua @@ -226,10 +226,10 @@ AddIcon help=main mastery=2 if TalentPoints(TITANSGRIPTALENT more 0) { #/berserker_rage,if=!(buff.death_wish.up|buff.enrage.up|buff.unholy_frenzy.up)&rage>15&cooldown.raging_blow.remains<1 - if BuffExpires(DEATHWISH 0) and BuffExpires(RECKLESSNESS 0) and BuffExpires(ENRAGE 0) and Mana(less 15) and + if BuffExpires(RECKLESSNESS 0) and BuffExpires(ENRAGE 0) and Mana(less 15) and 1s before Spell(RAGINGBLOW) Spell(BERSERKERRAGE) #/raging_blow - if BuffPresent(DEATHWISH) or BuffPresent(RECKLESSNESS) or BuffPresent(ENRAGE) or BuffPresent(BERSERKERRAGE) + if BuffPresent(RECKLESSNESS) or BuffPresent(ENRAGE) or BuffPresent(BERSERKERRAGE) Spell(RAGINGBLOW) } #/slam,if=buff.bloodsurge.react @@ -239,10 +239,10 @@ AddIcon help=main mastery=2 if TalentPoints(TITANSGRIPTALENT less 1) { #/berserker_rage,if=!(buff.death_wish.up|buff.enrage.up|buff.unholy_frenzy.up)&rage>15&cooldown.raging_blow.remains<1 - if BuffExpires(DEATHWISH 0) and BuffExpires(RECKLESSNESS 0) and BuffExpires(ENRAGE 0) and Mana(less 15) and + if BuffExpires(RECKLESSNESS 0) and BuffExpires(ENRAGE 0) and Mana(less 15) and 1s before Spell(RAGINGBLOW) Spell(BERSERKERRAGE) #/raging_blow - if BuffPresent(DEATHWISH) or BuffPresent(RECKLESSNESS) or BuffPresent(ENRAGE) or BuffPresent(BERSERKERRAGE) + if BuffPresent(RECKLESSNESS) or BuffPresent(ENRAGE) or BuffPresent(BERSERKERRAGE) Spell(RAGINGBLOW) } -- 1.7.9.5