Quantcast

Added: Crystal of Insanity detection (both Resto and Elemental)

Taracque [05-22-13 - 17:44]
Added: Crystal of Insanity detection (both Resto and Elemental)
Changed: 5.3 compatibility
Filename
Change_log.txt
Elementarist.lua
Elementarist.toc
modules/elemental.lua
modules/restoration.lua
diff --git a/Change_log.txt b/Change_log.txt
index 09d681a..ae83e58 100755
--- a/Change_log.txt
+++ b/Change_log.txt
@@ -1,3 +1,7 @@
+**v3.2.0**
+* Added: Crystal of Insanity detection (both Resto and Elemental)
+* Changed: 5.3 compatibility
+
 **v3.1.7**
 * Fixed: Fixed a LUA error if used on Enhancement talent

diff --git a/Elementarist.lua b/Elementarist.lua
index 74ef19a..b2004d9 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Elementarist 3.1.7
+-- Elementarist 3.2.0
 --
 -- 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.1.7';
+Elementarist.versionNumber = '3.2.0';
 Elementarist.enabled = true;
 Elementarist.playerName = UnitName("player")
 Elementarist.playerGUID = UnitGUID("player")
@@ -50,7 +50,9 @@ Elementarist.tier6Talent = nil
 Elementarist.lastSpell = nil
 Elementarist.CustomIDs = {
 	["Alchemist's Flask Item"] = 75525,
-	["Alchemist's Flask Spell"] = 79640
+	["Alchemist's Flask Spell"] = 79640,
+	["Crystal of Insanity Item"] = 86569,
+	["Crystal of Insanity Spell"] = 127230
 }
 Elementarist.SpellList = {
 	["Flame Shock"] = GetSpellInfo(8050),
@@ -80,6 +82,7 @@ Elementarist.SpellList = {
 	-- other buffs
 	["Demonic Pact"] = GetSpellInfo(48090),
 	["Alchemist's Flask"] = GetSpellInfo(Elementarist.CustomIDs["Alchemist's Flask Spell"]),
+	["Crystal of Insanity"] = GetSpellInfo(Elementarist.CustomIDs["Crystal of Insanity Spell"]),
 	["Flask of the Draconic Mind"] = GetSpellInfo(79470),
 	["Flask of the Warm Sun"] = GetSpellInfo(105691),
 	["Lifeblood"] = GetSpellInfo(55503),
diff --git a/Elementarist.toc b/Elementarist.toc
index 6b5797f..1198849 100755
--- a/Elementarist.toc
+++ b/Elementarist.toc
@@ -1,8 +1,8 @@
-## Interface: 50200
+## Interface: 50300
 ## Title: Elementarist
 ## Notes: Elemental shaman spell rotation helper
 ## Author: Taracque, Felmosórongy of Arathor
-## Version: 3.1.7
+## Version: 3.2.0
 ## SavedVariables: ElementaristDB
 ## OptionalDeps: OmniCC, SpellFlash
 ## Dependencies:
diff --git a/modules/elemental.lua b/modules/elemental.lua
index 48a8a3f..9f50a43 100755
--- a/modules/elemental.lua
+++ b/modules/elemental.lua
@@ -226,18 +226,29 @@ Elementarist.elemental = {
 		local name, expirationTime, _

 		-- Alchemy Flask of Enhancement
-		if GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0 then
+		if (GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) or (GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0) then
 			name = Elementarist:hasBuff("player", Elementarist.SpellList["Flask of the Warm Sun"]);
 			if (name == nil) then
 				name = Elementarist:hasBuff("player", Elementarist.SpellList["Flask of the Draconic Mind"]);
 			end
 			if (name == nil) 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"])
+				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"])
+						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"])
+						end
+						return nil,icon
 					end
-					return nil,icon
 				end
 			end
 		end
diff --git a/modules/restoration.lua b/modules/restoration.lua
index f26c23e..702b9af 100755
--- a/modules/restoration.lua
+++ b/modules/restoration.lua
@@ -221,16 +221,29 @@ Elementarist.restoration = {
 		local name, expirationTime, _

 		-- Alchemy Flask of Enhancement
-		if GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0 then
-			name = Elementarist:hasBuff("player", Elementarist.SpellList["Flask of Falling Leaves"]);
-			local name2 = Elementarist:hasBuff("player", Elementarist.SpellList["Flask of the Warm Sun"]);
-			if (name == nil) and (name2 == nil) 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"])
+		if (GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) or (GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0) then
+			name = Elementarist:hasBuff("player", Elementarist.SpellList["Flask of the Warm Sun"]);
+			if (name == nil) then
+				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"])
+						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"])
+						end
+						return nil,icon
 					end
-					return nil,icon
 				end
 			end
 		end