Quantcast

Better Flame Shock tracking on non targeted units

Taracque [05-16-15 - 13:28]
Better Flame Shock tracking on non targeted units
Filename
Change_log.txt
Elementarist.lua
diff --git a/Change_log.txt b/Change_log.txt
index 12271a2..fc43911 100755
--- a/Change_log.txt
+++ b/Change_log.txt
@@ -1,3 +1,6 @@
+***v3.4.4
+* Fixed: Better Flame Shock tracking on non targeted units
+
 ***v3.4.3
 * Fixed: at least the GCD always calculated as a shift between two spells
 * Fixed: Liquid Magma not shown if has no 10 sec remaining from the fire totem
diff --git a/Elementarist.lua b/Elementarist.lua
index b57ef86..c047494 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Elementarist 3.4.3
+-- Elementarist 3.4.4
 --
 -- 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.4.3';
+Elementarist.versionNumber = '3.4.4';
 Elementarist.enabled = true;
 Elementarist.playerName = UnitName("player")
 Elementarist.playerGUID = UnitGUID("player")
@@ -470,35 +470,35 @@ end
 function Elementarist:CountPerson(time, event, sguid, sname, sflags, dguid, dname, dflags)
 	local suffix = event:match(".+(_.-)$")
 	if Elementarist.HostileFilter[suffix] then
-		local stype = 0;
-		local dtype = 0;
+		local stype = false;
+		local dtype = false;

-		if (sguid) and (sguid:sub(5,5)) and (tonumber(sguid:sub(5,5), 16)) then
-			stype = (tonumber(sguid:sub(5,5), 16)) % 8;
+		if (sguid) and (sguid:sub(1,6)) and ((sguid:sub(1,6) == 'Player') or (sguid:sub(1,6) == 'Creatu')) then
+			stype = true;
 		end
-		if (dguid) and (dguid:sub(5,5)) and (tonumber(dguid:sub(5,5), 16)) then
-			dtype = (tonumber(dguid:sub(5,5), 16)) % 8;
+		if (dguid) and (dguid:sub(1,6)) and ((dguid:sub(1,6) == 'Player') or (dguid:sub(1,6) == 'Creatu')) then
+			dtype = true;
 		end
-		if (bit.band(dflags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE) and (bit.band(dflags, COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) == COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) and ((dtype==0) or (dtype==3)) then
+		if (bit.band(dflags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE) and (bit.band(dflags, COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) == COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) and (dtype) then
 			if (not Elementarist.person["foe"][dguid]) then
 				Elementarist.person["foeCount"] = Elementarist.person["foeCount"] + 1
 				Elementarist:Debug('Enemy added', Elementarist.person["foeCount"] .. " " .. dguid .. " " .. dflags)
 			end
 			Elementarist.person["foe"][dguid] = GetTime()
-    	elseif (bit.band(sflags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE) and (bit.band(sflags, COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) == COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) and ((stype==0) or (stype==3)) then
+    	elseif (bit.band(sflags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE) and (bit.band(sflags, COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) == COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) and (stype) then
 			if ((not Elementarist.person["foe"][sguid]) or (Elementarist.person["foe"][sguid]==0)) then
 				Elementarist.person["foeCount"] = Elementarist.person["foeCount"] + 1
 				Elementarist:Debug('Enemy added', Elementarist.person["foeCount"] .. " " .. sguid .. " flags: " .. dflags)
 			end
 			Elementarist.person["foe"][sguid] = GetTime()
 		end
-		if (bit.band(dflags, COMBATLOG_OBJECT_REACTION_FRIENDLY) == COMBATLOG_OBJECT_REACTION_FRIENDLY) and ((dtype==0) or (dtype==3)) then
+		if (bit.band(dflags, COMBATLOG_OBJECT_REACTION_FRIENDLY) == COMBATLOG_OBJECT_REACTION_FRIENDLY) and (dtype) then
 			if ((not Elementarist.person["friend"][dguid]) or (Elementarist.person["friend"][dguid]==0)) then
 				Elementarist.person["friendCount"] = Elementarist.person["friendCount"] + 1
 				Elementarist:Debug('Friend added', Elementarist.person["friendCount"] .. " " .. dguid .. " flags: " .. dflags)
 			end
 			Elementarist.person["friend"][dguid] = GetTime()
-    	elseif (bit.band(sflags, COMBATLOG_OBJECT_REACTION_FRIENDLY) == COMBATLOG_OBJECT_REACTION_FRIENDLY) and ((stype==0) or (stype==3)) then
+    	elseif (bit.band(sflags, COMBATLOG_OBJECT_REACTION_FRIENDLY) == COMBATLOG_OBJECT_REACTION_FRIENDLY) and (stype) then
 			if ((not Elementarist.person["friend"][sguid]) or (Elementarist.person["friend"][sguid]==0)) then
 				Elementarist.person["friendCount"] = Elementarist.person["friendCount"] + 1
 				Elementarist:Debug('Friend added', Elementarist.person["friendCount"] .. " " .. sguid .. " " .. sflags)