From 3b7a1e4626ee1b3f86619a90d3425bf2270296bc Mon Sep 17 00:00:00 2001 From: Taracque Date: Sat, 18 Oct 2014 15:41:02 +0200 Subject: [PATCH] More tune on rotation, iLVL detection added. Earthquake is now in single target rotation, if iLVL>=575 and enabled in the configuration --- Elementarist.lua | 16 ++++++++++++++++ modules/elemental.lua | 22 +++++++++++----------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/Elementarist.lua b/Elementarist.lua index 5396334..28893d3 100755 --- a/Elementarist.lua +++ b/Elementarist.lua @@ -41,6 +41,7 @@ Elementarist.SFHistory = { ["misc"] = nil, ["int"] = nil } +Elementarist.iLvl = 0; Elementarist.talent = "" Elementarist.role = "" Elementarist.talentUnsure = true @@ -132,6 +133,7 @@ Elementarist.eventFrame:RegisterEvent("ADDON_LOADED"); Elementarist.eventFrame:RegisterEvent("PLAYER_LOGIN"); Elementarist.eventFrame:RegisterEvent("PLAYER_ALIVE"); Elementarist.eventFrame:RegisterEvent("PLAYER_ENTERING_WORLD"); +Elementarist.eventFrame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED"); -- Define our Event Handlers here Elementarist.events = {} @@ -169,6 +171,7 @@ end function Elementarist.events.PLAYER_ALIVE() -- check anything Elementarist:detectTalent() + Elementarist:detectiLevel(); Elementarist:ApplySettings() -- Elementarist.eventFrame:UnregisterEvent("PLAYER_ALIVE") @@ -176,6 +179,11 @@ end function Elementarist.events.PLAYER_ENTERING_WORLD() Elementarist:detectTalent() + Elementarist:detectiLevel(); +end + +function Elementarist.events.PLAYER_EQUIPMENT_CHANGED() + Elementarist:detectiLevel(); end function Elementarist.events.PLAYER_LOGIN() @@ -225,6 +233,9 @@ function Elementarist.events.ADDON_LOADED(addon) -- check if talent is elemental Elementarist:detectTalent() + + -- detect equiped item level + Elementarist:detectiLevel() Elementarist.playerLevel = UnitLevel("player") @@ -306,6 +317,11 @@ function Elementarist:InitSettings() if not ElementaristDB.shieldrelativePoint then ElementaristDB.shieldrelativePoint = "CENTER" end end +function Elementarist:detectiLevel() + local _,ilvl = GetAverageItemLevel(); + Elementarist.iLvl = ilvl; +end + function Elementarist:detectTalent() local spec = GetSpecialization() local _,playerClass; diff --git a/modules/elemental.lua b/modules/elemental.lua index 24ff341..ada7c16 100755 --- a/modules/elemental.lua +++ b/modules/elemental.lua @@ -98,6 +98,16 @@ Elementarist.elemental = { end end + -- if item level >575 and Earthquake is enabled + if ((ElementaristDB.EnableEQ) and (Elementarist.iLvl>=575)) or (Elementarist.person["foeCount"]>1) then + if (exspell1 ~= Elementarist.SpellList["Earthquake"]) and (exspell2 ~= Elementarist.SpellList["Earthquake"]) and ((Elementarist.SpellList["Earthquake"]) ~= spellInCast) then + d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earthquake"]) + if (d) and (d<0.5) then + return Elementarist.SpellList["Earthquake"] + end + end + end + -- if Tier6 talent is Unleashed Fury Unleash Flame if (Elementarist.tier6Talent == 21773) then if (exspell1 ~= Elementarist.SpellList["Unleash Flame"]) and (exspell2 ~= Elementarist.SpellList["Unleash Flame"]) then @@ -134,7 +144,7 @@ Elementarist.elemental = { doFS = true end end - if (doFS) and ((fsExpiration - GetTime() - timeshift) < 0) then + if (doFS) and ((fsExpiration - GetTime() - timeshift) < 9) then return Elementarist.SpellList["Flame Shock"] end end @@ -351,16 +361,6 @@ Elementarist.elemental = { end end - -- if >=4 foes are available, and Earthquake not on cd - if (ElementaristDB.EnableEQ) then - if (Elementarist.person["foeCount"]>=4) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earthquake"]) - if (d) and (d<0.5) then - return Elementarist.SpellList["Earthquake"] - end - end - end - -- check if purgeable buff is on target (not sure if this is ok) if Elementarist:SpellAvailable(Elementarist.SpellList["Purge"]) then if IsSpellInRange(Elementarist.SpellList["Purge"], "target") == 1 then -- 1.7.9.5