From b61edb58d511aa2a5d7e2579ce1bf0fe815ffe6f Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Sun, 3 May 2009 14:35:03 +0000 Subject: [PATCH] - a lot of fixes for shaman (elemental and enhancement) and mage (fire and arcane) - and a small fix for rogue (better refresh for slice and dice) - added DebuffExpires function - added an optional time parameter to TargetDebuffPresent (see enh shaman) - added SpellAddDebuff, SpellAddTargetDebuff options(see Mage) for casted spells that add a buff or a debuff (better than doNotRepeat for DOTs because it allows stacking! I should correct other scripts) git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@51 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- .pkgmeta | 2 + Condition.lua | 159 +++++++++++++++++++++++++---------------------------- Ovale.lua | 5 ++ Ovale.toc | 2 +- OvaleCompile.lua | 44 ++++++++++++++- OvaleIcone.lua | 3 +- defaut/Chaman.lua | 21 ++++++- defaut/Mage.lua | 8 ++- defaut/Voleur.lua | 10 ++-- embeds.xml | 2 + 10 files changed, 159 insertions(+), 97 deletions(-) diff --git a/.pkgmeta b/.pkgmeta index 66edb34..3bc71e8 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -11,4 +11,6 @@ externals: Libs/AceLocale-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceLocale-3.0 Libs/LibStub: svn://svn.wowace.com/wow/ace3/mainline/trunk/LibStub Libs/LibBabble-CreatureType-3.0: svn://svn.wowace.com/wow/libbabble-creaturetype-3-0/mainline/trunk + Libs/CallbackHandler-1.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/CallbackHandler-1.0 + \ No newline at end of file diff --git a/Condition.lua b/Condition.lua index 28443df..39bb292 100644 --- a/Condition.lua +++ b/Condition.lua @@ -52,6 +52,39 @@ local function testbool(a, condition) end end +local function GetTargetAura(condition, filter, target) + local spellId = condition[1] + local auraName, auraRank, auraIcon = Ovale:GetSpellInfoOrNil(spellId) + local i=1; + local timeLeft = nil + local stacksLeft = nil + while (true) do + local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable = UnitAura(target, i, filter); + if (not name) then + break + end + if (not condition.mine or unitCaster=="player") then + if (name == auraName and icon == auraIcon) then + timeLeft = expirationTime - Ovale.maintenant + stacksLeft = count + break + end + end + i = i + 1; + end + + if (Ovale.currentSpellInfo and spellId and Ovale.currentSpellInfo[target][filter] and + Ovale.currentSpellInfo[target][filter][spellId]) then + if (not timeLeft or timeLeft < Ovale.attenteFinCast) then + stacksLeft = 1 + else + stacksLeft = stacksLeft + 1 + end + timeLeft = Ovale.currentSpellInfo[target][filter][spellId] + Ovale.attenteFinCast + end + return timeLeft, stacksLeft +end + Ovale.conditions= { -- Test if a white hit just occured @@ -84,54 +117,25 @@ Ovale.conditions= -- 1 : buff spell id -- 2 : expiration time BuffExpires = function(condition) - local buffName = Ovale:GetSpellInfoOrNil(condition[1]) - local i=1; - while (true) do - local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable = UnitBuff("player", i); - if (not name) then - break - end - if (name == buffName) then - local timeLeft = expirationTime - Ovale.maintenant - local timeBefore = avecHate(condition[2], condition.haste) - if (timeLeft=condition.stacks)) then + return 0 + else return nil end - local buffName, buffRank, buffIcon = Ovale:GetSpellInfoOrNil(condition[1]) - i=1; - while (true) do - local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable = UnitBuff("player", i); - if (not name) then - break - end - if (name == buffName and icon==buffIcon) then - if (condition.stacks) then - if (count>=condition.stacks) then - return 0 - else - return nil - end - else - return 0 - end - end - i = i + 1; - end - return nil end, Casting = function(condition) local spell = UnitCastingInfo("player") @@ -171,6 +175,17 @@ Ovale.conditions= local points = GetComboPoints("player") return compare(points, condition[1], condition[2]) end, + DebuffExpires = function(condition) + local timeLeft, stacksLeft = GetTargetAura(condition, "HARMFUL", "player") + local tempsMax = avecHate(condition[2], condition.haste) + if (not timeLeft or timeLeftcondition[2])) then + if (stacksLeft~=0 and condition.stacks and stacksLeft start + duration and minAttente > 0) then + if (Ovale.maintenant + minAttente > start + duration + 0.01 and minAttente > 0 + and minAttente>Ovale.attenteFinCast) then self.icone:SetVertexColor(0.75,0,0) else self.icone:SetVertexColor(1,1,1) diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua index aa11db7..3383a61 100644 --- a/defaut/Chaman.lua +++ b/defaut/Chaman.lua @@ -11,6 +11,10 @@ Define(STORMSTRIKE 17364) Define(LAVALASH 60103) Define(LIGHTNINGSHIELD 324) Define(MAELSTROMWEAPON 53817) +Define(ELEMENTALMASTERY 16166) +Define(SHAMANISTICRAGE 30823) +Define(THUNDERSTORM 51490) +Define(FERALSPIRIT 51533) AddCheckBox(chain SpellName(CHAINLIGHTNING)) AddCheckBox(melee L(Melee)) @@ -19,7 +23,7 @@ AddIcon { unless CheckBoxOn(melee) { - if BuffExpires(FLAMETHONG 2) Spell(FLAMETHONG) + # if BuffExpires(FLAMETHONG 2) Spell(FLAMETHONG) if BuffExpires(WATERSHIELD 2) Spell(WATERSHIELD) if TargetDebuffExpires(FLAMESHOCK 0) Spell(FLAMESHOCK) Spell(LAVABURST doNotRepeat=1) @@ -29,7 +33,7 @@ AddIcon if CheckBoxOn(melee) { if TargetDebuffExpires(FLAMESHOCK 0) Spell(FLAMESHOCK) - if TargetDebuffPresent(FLAMESHOCK) Spell(EARTHSHOCK) + if TargetDebuffPresent(FLAMESHOCK 5) Spell(EARTHSHOCK) if BuffExpires(LIGHTNINGSHIELD 0) Spell(LIGHTNINGSHIELD) Spell(STORMSTRIKE) Spell(LAVALASH) @@ -38,4 +42,17 @@ AddIcon } } +AddIcon +{ + Spell(ELEMENTALMASTERY) + Spell(FERALSPIRIT) +} + +AddIcon size=small +{ + if ManaPercent(less 25) + Spell(SHAMANISTICRAGE) + if ManaPercent(less 50) + Spell(THUNDERSTORM) +} ]] \ No newline at end of file diff --git a/defaut/Mage.lua b/defaut/Mage.lua index e2c7333..a17ee39 100644 --- a/defaut/Mage.lua +++ b/defaut/Mage.lua @@ -26,6 +26,10 @@ Define(PRESENCEOFMIND 12043) AddCheckBox(scorch SpellName(SCORCH)) +SpellAddDebuff(ARCANEBLAST ARCANEBLAST=10) +SpellAddTargetDebuff(SCORCH IMPROVEDSCORCH=30) +SpellAddTargetDebuff(LIVINGBOMB LIVINGBOMB=12) + AddIcon { if TalentPoints(TALENTLIVINGBOMB more 0) @@ -33,7 +37,7 @@ AddIcon #Fire spec if BuffPresent(HOTSTREAK) Spell(PYROBLAST) if TargetDebuffExpires(LIVINGBOMB 0 mine=1) Spell(LIVINGBOMB) - if TargetDebuffExpires(IMPROVEDSCORCH 2 stacks=5) and CheckBoxOn(scorch) Spell(SCORCH) + if TargetDebuffExpires(IMPROVEDSCORCH 5.5 stacks=5) and CheckBoxOn(scorch) Spell(SCORCH) if TalentPoints(TALENTPIERCINGICE more 0) Spell(FROSTFIREBOLT) if TalentPoints(TALENTPIERCINGICE less 1) @@ -50,7 +54,7 @@ AddIcon if TalentPoints(TALENTARCANEBARRAGE more 0) { #Arcane spec - unless BuffPresent(ARCANEBLAST stacks=3) or {BuffPresent(ARCANEBLAST stacks=2) and Casting(ARCANEBLAST)} + if DebuffExpires(ARCANEBLAST 0 stacks=3) Spell(ARCANEBLAST) Spell(ARCANEMISSILES) } diff --git a/defaut/Voleur.lua b/defaut/Voleur.lua index fdd78f3..f41409c 100644 --- a/defaut/Voleur.lua +++ b/defaut/Voleur.lua @@ -28,12 +28,6 @@ AddIcon Spell(SLICEANDDICE) } - unless TargetDebuffPresent(RUPTURE) - { - if ComboPoints(more 3) - Spell(RUPTURE) - } - if {TargetDebuffPresent(RUPTURE) or TargetDebuffPresent(DEEPWOUNDS) or TargetDebuffPresent(REND) or TargetDebuffPresent(RIP)} and BuffExpires(HUNGERFORBLOOD 2) Spell(HUNGERFORBLOOD) @@ -46,6 +40,10 @@ AddIcon Spell(ENVENOM) Spell(SLICEANDDICE) } + + if TargetDebuffExpires(RUPTURE 0) + Spell(RUPTURE) + if TalentPoints(TALENTVILEPOISONS more 0) Spell(ENVENOM) Spell(EVISCERATE) diff --git a/embeds.xml b/embeds.xml index 7f3aded..fe03baa 100644 --- a/embeds.xml +++ b/embeds.xml @@ -2,6 +2,7 @@ ..\FrameXML\UI.xsd">