From 29c6bc0a208355684fc9fd4b94a9496fb5b5c43c Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Sat, 12 Mar 2011 14:17:45 +0000 Subject: [PATCH] - added lua inline functions. ex [return GetCombatRating(11)] will return the spell critical rating - balance druid: some changes to match simulationcraft - fire mage, frost mage: minor changes to match simulationcraft - added T11 balance druid - fixes for AddFunction command - checkboxes and lists can be moved git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@376 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 3 ++ Ovale.lua | 28 ++++++++++++++- Ovale.toc | 2 +- OvaleCompile.lua | 22 +++++++++--- OvaleEquipement.lua | 11 ++++++ OvaleFrame.lua | 12 +++---- defaut/Druide.lua | 59 +++++++++++++++---------------- defaut/Guerrier.lua | 2 +- defaut/Mage.lua | 98 ++++++++++++++++++++++++++++++--------------------- 9 files changed, 151 insertions(+), 86 deletions(-) diff --git a/Condition.lua b/Condition.lua index f213c34..da968df 100644 --- a/Condition.lua +++ b/Condition.lua @@ -739,6 +739,9 @@ Ovale.conditions= maxHealth = function(condition) return UnitMaxHealth(getTarget(condition.target)) end, + maxMana = function(condition) + return UnitPowerMax(getTarget(condition.target)) + end, NextSwing = function(condition) local ret = OvaleSwing:GetNext(condition[1]) if condition[2] and ret then diff --git a/Ovale.lua b/Ovale.lua index e495fb0..dfb71c5 100644 --- a/Ovale.lua +++ b/Ovale.lua @@ -269,6 +269,24 @@ local options = get = function(info) return Ovale.db.profile.apparence.margin end, set = function(info,value) Ovale.db.profile.apparence.margin = value; Ovale:UpdateFrame() end }, + iconShiftX = + { + order = 5.6, + type = "range", + name = L["Décalage horizontal des options"], + min = -256, max = 256, step = 1, + get = function(info) return Ovale.db.profile.apparence.iconShiftX end, + set = function(info,value) Ovale.db.profile.apparence.iconShiftX = value; Ovale:UpdateFrame() end + }, + iconShiftY = + { + order = 5.7, + type = "range", + name = L["Décalage vertical des options"], + min = -256, max = 256, step = 1, + get = function(info) return Ovale.db.profile.apparence.iconShiftY end, + set = function(info,value) Ovale.db.profile.apparence.iconShiftY = value; Ovale:UpdateFrame() end + }, raccourcis = { order = 6, @@ -2066,6 +2084,10 @@ function Ovale:CalculerMeilleureAction(element) end end end + elseif element.type == "lua" then + local ret = loadstring(element.lua)() + self:Log("lua "..nilstring(ret)) + return ret, 0, 0 elseif (element.type == "group") then local meilleurTempsFils local bestEnd @@ -2077,6 +2099,10 @@ function Ovale:CalculerMeilleureAction(element) self:Print(element.type.." ["..element.nodeId.."]") end + if #element.nodes == 1 then + return Ovale:CalculerMeilleureAction(element.nodes[1]) + end + for k, v in ipairs(element.nodes) do local newStart, newEnd, priorite, nouveauElement = Ovale:CalculerMeilleureAction(v) if newStart~=nil and newStart0 if BuffPresent(ECLIPSESOLAR) Spell(SUNFIRE nored=1) + #/moonfire,if=!ticking&buff.t11_4pc_caster.down&!dot.sunfire.remains>0 Spell(MOONFIRE nored=1) } - - if TargetDebuffExpires(INSECTSWARM 1 mine=1) and TargetDeadIn(more 6) - Spell(INSECTSWARM nored=1) - if TargetDebuffExpires(INSECTSWARM 3 mine=1) and TargetDeadIn(more 6) and BuffPresent(ECLIPSESOLAR) and Eclipse(less 16) - Spell(INSECTSWARM nored=1) + #/starsurge,if=!((eclipse<=-87&eclipse_dir=-1)|(eclipse>=80&eclipse_dir=1)) + unless {Eclipse(less -88) and BuffExpires(ECLIPSELUNAR)} or {Eclipse(more 79) and BuffExpires(ECLIPSESOLAR)} + Spell(STARSURGE) - Spell(STARSURGE) - - if BuffPresent(ECLIPSELUNAR) or Eclipse(equal -100) - { - Spell(STARFIRE) - } - - if BuffPresent(ECLIPSESOLAR) or Eclipse(equal 100) - { - Spell(WRATH) - } - - if TargetDebuffExpires(INSECTSWARM 0 mine=1) and TargetDeadIn(more 6) - Spell(INSECTSWARM) - - - if {Eclipse(equal 0) and CheckBoxOn(wrath)} or Eclipse(less 0) - Spell(WRATH) - - if {Eclipse(equal 0) and CheckBoxOff(wrath)} or Eclipse(more 0) - Spell(STARFIRE) + #/innervate,if=mana_pct<50 + if ManaPercent(less 50) Spell(INNERVATE) + #/starfire,if=eclipse_dir=1 + if BuffPresent(ECLIPSELUNAR) or Eclipse(equal -100) Spell(STARFIRE) + #/wrath,if=eclipse_dir=-1 + if BuffPresent(ECLIPSESOLAR) or Eclipse(equal 100) Spell(WRATH) + if Eclipse(more 0) Spell(STARFIRE) + if Eclipse(less 0) Spell(WRATH) + #/starfire + Spell(STARFIRE) } AddIcon help=cd mastery=1 { - Spell(FORCEOFNATURE) - Spell(STARFALL) + #/starfall,if=buff.lunar_eclipse.up&buff.t11_4pc_caster.down + if BuffPresent(ECLIPSELUNAR) and BuffExpires(ASTRALALIGNMENT) Spell(STARFALL) + #/treants,time>=5 + if TimeInCombat(more 5) Spell(FORCEOFNATURE) Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) } diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua index f661eeb..7b18394 100644 --- a/defaut/Guerrier.lua +++ b/defaut/Guerrier.lua @@ -239,7 +239,7 @@ AddIcon help=main mastery=3 { if List(shout command) and {Mana(less 20) or BuffExpires(stamina 3)} Spell(COMMANDINGSHOUT nored=1) if List(shout battle) and {Mana(less 20) or BuffExpires(strengthagility 3)} Spell(BATTLESHOUT nored=1) - if TargetClassification(worldboss) and CheckBoxOn(demo) and TargetDebuffExpires(lowerphysicaldamage 2) Spell(DEMOSHOUT nored=1) + if CheckBoxOn(demo) and TargetDebuffExpires(lowerphysicaldamage 2) Spell(DEMOSHOUT nored=1) if LifePercent(less 75) Spell(VICTORYRUSH usable=1) if CheckBoxOn(multi) diff --git a/defaut/Mage.lua b/defaut/Mage.lua index f30777f..de140a3 100644 --- a/defaut/Mage.lua +++ b/defaut/Mage.lua @@ -73,11 +73,9 @@ Define(FIRESTARTERTALENT 11431) Define(CRITICALMASSTALENT 10541) Define(IMPROVEDSCORCH 10547) -#CheckBoxes -AddListItem(fb fb SpellName(FIREBALL) default) -AddListItem(fb ffb SpellName(FROSTFIREBOLT) mastery=2) -AddListItem(frb frb SpellName(FROSTBOLT) default) -AddListItem(frb ffb SpellName(FROSTFIREBOLT) mastery=3) +#Glyphs +Define(GLYPHOFFROSTFIRE 61205) +Define(GLYPHOFFROSTBOLT 56370) ScoreSpells(SCORCH PYROBLAST LIVINGBOMB FROSTFIREBOLT FIREBALL SUMMONWATERELEMENTAL PETFREEZE FROSTBOLT ARCANEBLAST ARCANEMISSILES ARCANEBARRAGE DEEPFREEZE ICELANCE) @@ -136,40 +134,41 @@ AddIcon help=cd mastery=1 if TargetDeadIn(more 10) Spell(FLAMEORB) #/presence_of_mind,arcane_blast Spell(PRESENCEOFMIND) - } AddIcon help=main mastery=2 { unless InCombat() if BuffExpires(MAGEARMOR 400) and BuffExpires(MOLTENARMOR 400) and BuffExpires(ICEARMOR 400) Spell(MOLTENARMOR) - - if TalentPoints(CRITICALMASSTALENT more 0) and TargetDebuffExpires(CRITICALMASS) and TargetDebuffExpires(SHADOWANDFLAME) Spell(SCORCH) - if TargetDebuffPresent(LIVINGBOMB mine=1) and TargetDebuffPresent(IGNITE mine=1) - and TargetDebuffPresent(PYROBLAST mine=1) + #/scorch,debuff=1 + if TalentPoints(CRITICALMASSTALENT more 0) and TargetDebuffExpires(magicalcrittaken 0) Spell(SCORCH) + #/combustion,if=dot.living_bomb.ticking&dot.ignite.ticking&dot.pyroblast.ticking + if TargetDebuffPresent(LIVINGBOMB mine=1) and TargetDebuffPresent(IGNITE mine=1) and TargetDebuffPresent(PYROBLAST mine=1) Spell(COMBUSTION) + #/living_bomb,if=!ticking if TargetDebuffExpires(LIVINGBOMB 0 mine=1) and TargetDeadIn(more 12) Spell(LIVINGBOMB) + #/pyroblast_hs,if=buff.hot_streak.react if BuffPresent(HOTSTREAK) Spell(PYROBLAST) + #/mage_armor,if=mana_pct<5 + if BuffExpires(MAGEARMOR 0) and ManaPercent(less 5) Spell(MAGEARMOR) if TalentPoints(FIRESTARTERTALENT more 0) and Speed(more 0) Spell(SCORCH) - if ManaPercent(less 5) Spell(SCORCH) - if List(fb fb) and TargetDeadIn(less 60) Spell(FIREBALL) - if List(fb ffb) and TargetDeadIn(less 60) Spell(FROSTFIREBOLT) - if List(fb fb) and ManaPercent(more 39) Spell(FIREBALL) - if List(fb ffb) and ManaPercent(more 39) Spell(FROSTFIREBOLT) - if ManaPercent(less 95) and TalentPoints(IMPROVEDSCORCH more 0) - { - unless 60s before Spell(EVOCATION) Spell(SCORCH) - } - Spell(EVOCATION) - if TalentPoints(IMPROVEDSCORCH more 0) Spell(SCORCH) + #/frostfire_bolt + if Glyph(GLYPHOFFROSTFIRE) Spell(FROSTFIREBOLT usable=1) + #/fireball + Spell(FIREBALL usable=1) + Spell(SCORCH) } AddIcon help=cd mastery=2 { - if BuffPresent(heroism) or TargetDeadIn(less 40) Item(VOLCANICPOTION) - if TargetBuffStealable(yes) Spell(SPELLSTEAL) + if TargetBuffStealable(yes) Spell(SPELLSTEAL) if TargetIsInterruptible(yes) Spell(COUNTERSPELL) + + #if BuffPresent(heroism) or TargetDeadIn(less 40) Item(VOLCANICPOTION) + #/mana_gem,if=mana_deficit>12500 if ManaPercent(less 85) Item(MANAGEMITEM) - if TargetDeadIn(more 24) Spell(MIRRORIMAGE) + #/mirror_image,if=target.time_to_die>=25 + if TargetDeadIn(more 24) Spell(MIRRORIMAGE) + #/flame_orb,if=target.time_to_die>=12 if TargetDeadIn(more 11) Spell(FLAMEORB) Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) @@ -178,37 +177,54 @@ AddIcon help=cd mastery=2 AddIcon help=main mastery=3 { unless InCombat() if BuffExpires(MAGEARMOR 400) and BuffExpires(MOLTENARMOR 400) and BuffExpires(ICEARMOR 400) Spell(MOLTENARMOR) - if PetPresent(no) Spell(SUMMONWATERELEMENTAL) - if BuffPresent(FINGERSOFFROST stacks=1) Spell(DEEPFREEZE) - if BuffPresent(BRAINFREEZE) and BuffPresent(FINGERSOFFROST) Spell(FROSTFIREBOLT) + + #/deep_freeze + Spell(DEEPFREEZE) + #/frostfire_bolt,if=buff.brain_freeze.react&buff.fingers_of_frost.react + if BuffPresent(BRAINFREEZE) and BuffPresent(FINGERSOFFROST) {Spell(FROSTFIREBOLT) Spell(FIREBALL)} + #/ice_lance,if=buff.fingers_of_frost.stack>1 if BuffPresent(FINGERSOFFROST stacks=2) Spell(ICELANCE) + #/ice_lance,if=buff.fingers_of_frost.react&pet.water_elemental.cooldown.freeze.remains60 + if ManaPercent(less 5) and TargetDeadIn(more 60) Spell(EVOCATION) + #/ice_lance,moving=1 if Speed(more 0) Spell(ICELANCE) + #/fire_blast,moving=1 if Speed(more 0) Spell(FIREBLAST) + #/frostbolt + if Glyph(GLYPHOFFROSTBOLT) Spell(FROSTBOLT) + if Glyph(GLYPHOFFROSTBOLT no) + { + #/frostbolt,if=!cooldown.early_frost.remains + if castTime(FROSTBOLT) < timeWithHaste(1.5) Spell(FROSTBOLT) + #/frostfire_bolt + Spell(FROSTFIREBOLT) + Spell(FROSTBOLT) + } } AddIcon help=cd mastery=3 { - if BuffPresent(heroism) or TargetDeadIn(less 40) Item(VOLCANICPOTION) + #if BuffPresent(heroism) or TargetDeadIn(less 40) Item(VOLCANICPOTION) if TargetBuffStealable(yes) Spell(SPELLSTEAL) if TargetIsInterruptible(yes) Spell(COUNTERSPELL) + + #/mana_gem,if=mana_deficit>12500 if ManaPercent(less 85) Item(MANAGEMITEM) - unless 15s before Spell(DEEPFREEZE) - { - unless 30s before Spell(FLAMEORB) - { - unless 30s before Spell(ICYVEINS) Spell(COLDSNAP) - } - } + #/cold_snap,if=cooldown.deep_freeze.remains>15&cooldown.frostfire_orb.remains>30&cooldown.icy_veins.remains>30 + unless 15s before Spell(DEEPFREEZE) or 30s before Spell(FLAMEORB) or 30s before Spell(ICYVEINS) Spell(COLDSNAP) + #/frostfire_orb,if=target.time_to_die>=12 if TargetDeadIn(more 11) Spell(FLAMEORB) + #/mirror_image,if=target.time_to_die>=25 if TargetDeadIn(more 24) Spell(MIRRORIMAGE) - unless BuffPresent(ICYVEINS) Spell(ICYVEINS) + #/icy_veins,if=buff.icy_veins.down&buff.bloodlust.down + if BuffExpires(ICYVEINS 0) and BuffExpires(heroism 0) Spell(ICYVEINS) Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) } -- 1.7.9.5