From d9bfd388eb1a57a4c0ace1ad6fe42aa9799cfd24 Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Thu, 10 Mar 2011 22:42:21 +0000 Subject: [PATCH] - revert change for mm hunter - small fix for warlock - added AddFunction command git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@374 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Ovale.lua | 5 +++-- Ovale.toc | 2 +- OvaleCompile.lua | 20 ++++++++++++++++++-- defaut/Chasseur.lua | 14 +++++++++----- defaut/Demoniste.lua | 4 ++-- defaut/Guerrier.lua | 3 ++- 6 files changed, 35 insertions(+), 13 deletions(-) diff --git a/Ovale.lua b/Ovale.lua index 567028c..e495fb0 100644 --- a/Ovale.lua +++ b/Ovale.lua @@ -1269,7 +1269,8 @@ function Ovale:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd) Ovale:Print("add spell "..spellId.." at "..startCast.." currentTime = "..self.currentTime.. " nextCast="..self.attenteFinCast) end - --Coût du sort (uniquement si dans le futur, dans le passé l'énergie est déjà dépensée) + --Effet du sort au moment où il est lancé + --(donc si il est déjà lancé, on n'en tient pas compte) if endCast >= self.maintenant then --Mana local _, _, _, cost = GetSpellInfo(spellId) @@ -1321,7 +1322,7 @@ function Ovale:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd) end end - -- Effets du sort + -- Effets du sort au moment où il atteint sa cible if newSpellInfo then -- Cooldown du sort local cd = self:GetCD(spellId) diff --git a/Ovale.toc b/Ovale.toc index 5d53228..a62bfd0 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.0.28 +## Version: 4.0.29 ## 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 5054dc0..d60c4a8 100644 --- a/OvaleCompile.lua +++ b/OvaleCompile.lua @@ -2,6 +2,7 @@ local L = LibStub("AceLocale-3.0"):GetLocale("Ovale") local node={} local defines = {} +local customFunctions = {} local function AddNode(newNode) node[#node+1] = newNode @@ -44,6 +45,10 @@ local function ParseNumber(dummy, value) end local function ParseFunction(prefix, func, params) + if not prefix and not params and customFunctions[func] then + return customFunctions[func] + end + local paramList = ParseParameters(params) if func ~= "" then paramList.target = prefix @@ -280,7 +285,7 @@ local function ParseDefine(key, value) return "" end -local function ParseAddIcon(params, text) +local function ParseCommands(text) local original = text while (1==1) do local was = text @@ -331,8 +336,12 @@ local function ParseAddIcon(params, text) Ovale:Print("syntax error:"..text) return nil end - + return masterNode +end + +local function ParseAddIcon(params, text) -- On convertit le numéro de node en node + local masterNode = ParseCommands(text) masterNode = node[tonumber(masterNode)] masterNode.params = ParseParameters(params) if masterNode.params.talent and not HasTalent(masterNode.params.talent) then @@ -417,6 +426,13 @@ function Ovale:Compile(text) -- On compile les AddCheckBox et AddListItem text = self:CompileInputs(text) + for p,t in string.gmatch(text, "AddFunction%s+(%w+)%s*(%b{})") do + local newNode = ParseCommands(t) + if newNode then + customFunction[p] = newNode + end + end + local masterNodes ={} -- On compile les AddIcon diff --git a/defaut/Chasseur.lua b/defaut/Chasseur.lua index e78f512..4c57261 100644 --- a/defaut/Chasseur.lua +++ b/defaut/Chasseur.lua @@ -115,9 +115,11 @@ AddIcon help=main mastery=2 } #/serpent_sting,if=!ticking&target.health_pct<=80 - if Mana(more 24) and TargetDebuffExpires(SERPENTSTING 0 mine=1) and TargetDeadIn(more 8) and TargetLifePercent(less 80) Spell(SERPENTSTING) + if Mana(more 24) and TargetDebuffExpires(SERPENTSTING 0 mine=1) and TargetDeadIn(more 8) #and TargetLifePercent(less 80) + Spell(SERPENTSTING) #/chimera_shot,if=target.health_pct<=80 - if Mana(more 49) and TargetLifePercent(less 80) Spell(CHIMERASHOT) + if Mana(more 49) #and TargetLifePercent(less 80) + Spell(CHIMERASHOT) #/steady_shot,if=buff.pre_improved_steady_shot.up&buff.improved_steady_shot.remains<3 if Mana(less 40) or Counter(ss equal 1) Spell(STEADYSHOT) #/kill_shot @@ -127,15 +129,17 @@ AddIcon help=main mastery=2 if Glyph(GLYPHOFARCANESHOT) { #/aimed_shot,if=target.health_pct>80|buff.rapid_fire.up|buff.bloodlust.up - if TargetLifePercent(more 80) or BuffPresent(RAPIDFIRE) or BuffPresent(heroism) if Mana(more 49) Spell(AIMEDSHOT) + if #TargetLifePercent(more 80) or + BuffPresent(RAPIDFIRE) or BuffPresent(heroism) if Mana(more 49) Spell(AIMEDSHOT) #/arcane_shot,if=(focus>=66|cooldown.chimera_shot.remains>=5)&(target.health_pct<80&!buff.rapid_fire.up&!buff.bloodlust.up) - if {Mana(more 65) or spell(CHIMERASHOT)>5} and {TargetLifePercent(less 80) and BuffExpires(RAPIDFIRE) and BuffExpires(heroism)} + if {Mana(more 65) or spell(CHIMERASHOT)>5} and {#TargetLifePercent(less 80) and + BuffExpires(RAPIDFIRE) and BuffExpires(heroism)} if Mana(more 24) Spell(ARCANESHOT) } unless Glyph(GLYPHOFARCANESHOT) { #/aimed_shot,if=cooldown.chimera_shot.remains>5|focus>=80|buff.rapid_fire.up|buff.bloodlust.up|target.health_pct>80 - if {spell(CHIMERASHOT)>5} or Mana(more 79) or BuffPresent(RAPIDFIRE) or BuffPresent(heroism) or TargetLifePercent(more 80) + if {spell(CHIMERASHOT)>5} or Mana(more 79) or BuffPresent(RAPIDFIRE) or BuffPresent(heroism) #or TargetLifePercent(more 80) if Mana(more 49) Spell(AIMEDSHOT) } #/steady_shot diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua index 4b1d27c..c48f2f0 100644 --- a/defaut/Demoniste.lua +++ b/defaut/Demoniste.lua @@ -117,10 +117,10 @@ AddIcon help=main mastery=1 Spell(HAUNT) #/fel_flame,if=buff.tier11_4pc_caster.react&dot.unstable_affliction.remains<8 if ArmorSetParts(T11 more 3) and TargetDebuffExpires(UNSTABLEAFFLICTION 8) Spell(FELFLAME) - #/shadowflame - if CheckBoxOn(shadowflame) Spell(SHADOWFLAME) #/drain_soul,interrupt=1,if=target.health_pct<=25 if TargetLifePercent(less 25) Spell(DRAINSOUL) + #/shadowflame + if CheckBoxOn(shadowflame) Spell(SHADOWFLAME) if TalentPoints(BANETALENT more 2) { diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua index 3c15950..f661eeb 100644 --- a/defaut/Guerrier.lua +++ b/defaut/Guerrier.lua @@ -79,6 +79,7 @@ Define(RENDDEBUFF 94009) Define(INCITE 86627) Define(BATTLETRANCE 12964) Define(SLAUGHTER 84584) +Define(THUNDERSTRUCK 87096) #Talents Define(SLAMTALENT 2233) @@ -248,7 +249,7 @@ AddIcon help=main mastery=3 Spell(SHOCKWAVE) } Spell(REVENGE usable=1) - #Spell(SHOCKWAVE) + #if BuffPresent(THUNDERSTRUCK) Spell(SHOCKWAVE) Spell(SHIELDSLAM) if TargetDebuffExpires(meleeslow) Spell(THUNDERCLAP) Spell(VICTORYRUSH usable=1) -- 1.7.9.5