From 343d1675e1c96a22205152190ff5bf396f58cbed Mon Sep 17 00:00:00 2001 From: Taracque Date: Fri, 14 Jun 2013 11:44:20 +0200 Subject: [PATCH] Fixed: Wrong logic, if both alchemist flask, and Crystal of Insanity presents --- Change_log.txt | 3 +++ Elementarist.lua | 4 ++-- Elementarist.toc | 2 +- modules/elemental.lua | 26 +++++++++++--------------- modules/restoration.lua | 26 +++++++++++--------------- 5 files changed, 28 insertions(+), 33 deletions(-) diff --git a/Change_log.txt b/Change_log.txt index ae83e58..2bb3f30 100755 --- a/Change_log.txt +++ b/Change_log.txt @@ -1,3 +1,6 @@ +**v3.2.1** +* Fixed: Wrong logic, if both alchemist flask, and Crystal of Insanity presents + **v3.2.0** * Added: Crystal of Insanity detection (both Resto and Elemental) * Changed: 5.3 compatibility diff --git a/Elementarist.lua b/Elementarist.lua index b2004d9..2207357 100755 --- a/Elementarist.lua +++ b/Elementarist.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Elementarist 3.2.0 +-- Elementarist 3.2.1 -- -- Shows the advised spell for an elemental shaman for optimal DPS output. ------------------------------------------------------------------------------- @@ -8,7 +8,7 @@ Elementarist = {Locals = {}} local L = Elementarist.Locals -Elementarist.versionNumber = '3.2.0'; +Elementarist.versionNumber = '3.2.1'; Elementarist.enabled = true; Elementarist.playerName = UnitName("player") Elementarist.playerGUID = UnitGUID("player") diff --git a/Elementarist.toc b/Elementarist.toc index 1198849..c3043f8 100755 --- a/Elementarist.toc +++ b/Elementarist.toc @@ -2,7 +2,7 @@ ## Title: Elementarist ## Notes: Elemental shaman spell rotation helper ## Author: Taracque, Felmosórongy of Arathor -## Version: 3.2.0 +## Version: 3.2.1 ## SavedVariables: ElementaristDB ## OptionalDeps: OmniCC, SpellFlash ## Dependencies: diff --git a/modules/elemental.lua b/modules/elemental.lua index 9f50a43..55acb33 100755 --- a/modules/elemental.lua +++ b/modules/elemental.lua @@ -223,7 +223,7 @@ Elementarist.elemental = { -- Lifeblood Herbalism spell local d, e - local name, expirationTime, _ + local name, expirationTime, _, name2, exp2 -- Alchemy Flask of Enhancement if (GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) or (GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0) then @@ -232,22 +232,18 @@ Elementarist.elemental = { name = Elementarist:hasBuff("player", Elementarist.SpellList["Flask of the Draconic Mind"]); end if (name == nil) then - if (GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0) then - name, _, _, _, _, _, expirationTime = Elementarist:hasBuff("player", Elementarist.SpellList["Crystal of Insanity"], false, Elementarist.CustomIDs["Crystal of Insanity Spell"]); - if (name == nil) or (expirationTime < 2) then - if (icon == nil) then - icon = GetItemIcon(Elementarist.CustomIDs["Crystal of Insanity Item"]) + name, _, _, _, _, _, expirationTime = Elementarist:hasBuff("player", Elementarist.SpellList["Crystal of Insanity"], false, Elementarist.CustomIDs["Crystal of Insanity Spell"]); + name2, _, _, _, _, _, exp2 = Elementarist:hasBuff("player", Elementarist.SpellList["Alchemist's Flask"], false, Elementarist.CustomIDs["Alchemist's Flask Spell"]); + + if ((name == nil) and (name2 == nil)) or (((name ~= nil) and (expirationTime<2)) or ((name2 ~= nil) and (exp2<2))) then + if (GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0) then + if (name == nil) or (expirationTime < 2) then + return nil,GetItemIcon(Elementarist.CustomIDs["Crystal of Insanity Item"]) end - return nil,icon - end - end - if (GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) then - name, _, _, _, _, _, expirationTime = Elementarist:hasBuff("player", Elementarist.SpellList["Alchemist's Flask"], false, Elementarist.CustomIDs["Alchemist's Flask Spell"]); - if (name == nil) or (expirationTime < 2) then - if (icon == nil) then - icon = GetItemIcon(Elementarist.CustomIDs["Alchemist's Flask Item"]) + elseif (GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) then + if (name2 == nil) or (expirationTime2 < 2) then + return nil,GetItemIcon(Elementarist.CustomIDs["Alchemist's Flask Item"]) end - return nil,icon end end end diff --git a/modules/restoration.lua b/modules/restoration.lua index 702b9af..5dd3da4 100755 --- a/modules/restoration.lua +++ b/modules/restoration.lua @@ -218,7 +218,7 @@ Elementarist.restoration = { MiscSpell = function(self) local d, e - local name, expirationTime, _ + local name, expirationTime, _, name2, exp2 -- Alchemy Flask of Enhancement if (GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) or (GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0) then @@ -227,22 +227,18 @@ Elementarist.restoration = { name = Elementarist:hasBuff("player", Elementarist.SpellList["Flask of the Draconic Mind"]); end if (name == nil) then - if (GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0) then - name, _, _, _, _, _, expirationTime = Elementarist:hasBuff("player", Elementarist.SpellList["Crystal of Insanity"], false, Elementarist.CustomIDs["Crystal of Insanity Spell"]); - if (name == nil) or (expirationTime < 2) then - if (icon == nil) then - icon = GetItemIcon(Elementarist.CustomIDs["Crystal of Insanity Item"]) + name, _, _, _, _, _, expirationTime = Elementarist:hasBuff("player", Elementarist.SpellList["Crystal of Insanity"], false, Elementarist.CustomIDs["Crystal of Insanity Spell"]); + name2, _, _, _, _, _, exp2 = Elementarist:hasBuff("player", Elementarist.SpellList["Alchemist's Flask"], false, Elementarist.CustomIDs["Alchemist's Flask Spell"]); + + if ((name == nil) and (name2 == nil)) or (((name ~= nil) and (expirationTime<2)) or ((name2 ~= nil) and (exp2<2))) then + if (GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0) then + if (name == nil) or (expirationTime < 2) then + return nil,GetItemIcon(Elementarist.CustomIDs["Crystal of Insanity Item"]) end - return nil,icon - end - end - if (GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) then - name, _, _, _, _, _, expirationTime = Elementarist:hasBuff("player", Elementarist.SpellList["Alchemist's Flask"], false, Elementarist.CustomIDs["Alchemist's Flask Spell"]); - if (name == nil) or (expirationTime < 2) then - if (icon == nil) then - icon = GetItemIcon(Elementarist.CustomIDs["Alchemist's Flask Item"]) + elseif (GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) then + if (name2 == nil) or (expirationTime2 < 2) then + return nil,GetItemIcon(Elementarist.CustomIDs["Alchemist's Flask Item"]) end - return nil,icon end end end -- 1.7.9.5