From 657682057b98078305da042fe46748fe3db3d5d9 Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Sun, 8 Mar 2009 11:55:48 +0000 Subject: [PATCH] - bug fix: sometimes the spell with the highest priority was not prioritized while casting a spell - default for mages of all specs git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@24 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 11 ++++++++ Ovale.lua | 18 +++++++++++++ OvaleCompile.lua | 2 +- OvaleIcone.lua | 18 +------------ defaut/Guerrier.lua | 10 +++++--- defaut/Mage.lua | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 108 insertions(+), 22 deletions(-) diff --git a/Condition.lua b/Condition.lua index 9437928..ad8b695 100644 --- a/Condition.lua +++ b/Condition.lua @@ -124,6 +124,17 @@ Ovale.conditions= end return nil end, + Casting = function(condition) + local spell = UnitCastingInfo("player") + if (not spell) then + return nil + end + if (Ovale:GetSpellInfoOrNil(condition[1])==spell) then + return 0 + else + return nil + end + end, -- Test if a list of checkboxes is off -- 1,... : the checkboxes names CheckBoxOff = function(condition) diff --git a/Ovale.lua b/Ovale.lua index c63e068..d033a70 100644 --- a/Ovale.lua +++ b/Ovale.lua @@ -541,6 +541,21 @@ function Ovale:ChercherBouton(sort) end end +function Ovale:InitCalculerMeilleureAction() + self.attenteFinCast = 0 + + -- On attend que le sort courant soit fini + local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitCastingInfo("player") + if (spell) then + self.attenteFinCast = endTime/1000 - Ovale.maintenant + end + + local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitChannelInfo("player") + if (spell and not Ovale.canStopChannelling[spell]) then + self.attenteFinCast = endTime/1000 - Ovale.maintenant + end +end + function Ovale:CalculerMeilleureAction(element) if (self.bug and not self.trace) then return nil @@ -590,6 +605,9 @@ function Ovale:CalculerMeilleureAction(element) else restant = duration - (self.maintenant - start); end + if (restant minAttente) then - minAttente = attenteFinCast - end - end - - local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitChannelInfo("player") - if (spell and not Ovale.canStopChannelling[spell]) then - local attenteFinCast = endTime/1000 - Ovale.maintenant - if (attenteFinCast > minAttente) then - minAttente = attenteFinCast - end - end - if (meilleureAction~=self.actionCourante or self.ancienneAttente==nil or (minAttente~=0 and minAttente>self.ancienneAttente+0.01)) then self.actionCourante = meilleureAction diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua index a0a365c..39094a6 100644 --- a/defaut/Guerrier.lua +++ b/defaut/Guerrier.lua @@ -74,8 +74,8 @@ AddIcon if TargetLifePercent(less 20) { - if Mana(more 39) Spell(WHIRLWIND) - if Mana(more 44) Spell(BLOODTHIRST) + Spell(WHIRLWIND) + Spell(BLOODTHIRST) if BuffPresent(SLAMBUFF) and Mana(more 29) Spell(SLAM) Spell(EXECUTE) } @@ -91,8 +91,7 @@ AddIcon Spell(DEVASTATE) if TalentPoints(SLAMTALENT more 1) - and AfterWhiteHit(0.2) - Spell(SLAM) + Spell(SLAM) } if Stance(1) #combat @@ -108,6 +107,9 @@ AddIcon Spell(CONCUSSIONBLOW) Spell(DEVASTATE) + + if TalentPoints(SLAMTALENT more 1) + Spell(SLAM) } diff --git a/defaut/Mage.lua b/defaut/Mage.lua index e69de29..6331e95 100644 --- a/defaut/Mage.lua +++ b/defaut/Mage.lua @@ -0,0 +1,71 @@ +Ovale.defaut["MAGE"]= +[[ +Define(TALENTLIVINGBOMB 1852) +Define(TALENTPIERCINGICE 61) +Define(TALENTCHILLEDTOTHEBONES 1856) +Define(TALENTARCANEBARRAGE 1847) + +Define(HOTSTREAK 48108) +Define(IMPROVEDSCORCH 22959) + +Define(PYROBLAST 11366) +Define(LIVINGBOMB 44457) +Define(SCORCH 2948) +Define(FROSTFIREBOLT 44614) +Define(FROSTBOLT 116) +Define(FIREBALL 133) +Define(ARCANEBARRAGE 44425) +Define(ARCANEMISSILES 5143) +Define(ARCANEBLAST 30451) + +Define(COMBUSTION 11129) +Define(ICYVEINS 12472) +Define(MIRRORIMAGE 55342) +Define(SUMMONWATERELEMENTAL 31687) +Define(PRESENCEOFMIND 12043) + +AddCheckBox(scorch SpellName(SCORCH)) + +AddIcon +{ + if TalentPoints(TALENTLIVINGBOMB more 0) + { + #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 TalentPoints(TALENTPIERCINGICE more 0) + Spell(FROSTFIREBOLT) + if TalentPoints(TALENTPIERCINGICE less 1) + Spell(FIREBALL) + } + + if TalentPoints(TALENTCHILLEDTOTHEBONES more 0) + { + #Frost spec + Spell(SUMMONWATERELEMENTAL) + Spell(FROSTBOLT) + } + + if TalentPoints(TALENTARCANEBARRAGE more 0) + { + #Arcane spec + unless BuffPresent(ARCANEBLAST stacks=3) or {BuffPresent(ARCANEBLAST stacks=2) and Casting(ARCANEBLAST)} + Spell(ARCANEBLAST) + Spell(ARCANEMISSILES) + } +} + +AddIcon +{ + Spell(MIRRORIMAGE) +} + +AddIcon +{ + Spell(COMBUSTION) + Spell(ICYVEINS) + Spell(PRESENCEOFMIND) +} + +]] \ No newline at end of file -- 1.7.9.5