Quantcast

For some reason, Galakras have multiple IDs, so we have to work around that

p3lim [10-17-13 - 09:57]
For some reason, Galakras have multiple IDs, so we have to work around that
Filename
Encounters.lua
HabeebIt.lua
diff --git a/Encounters.lua b/Encounters.lua
index 29f9ed0..87d42ca 100644
--- a/Encounters.lua
+++ b/Encounters.lua
@@ -55,7 +55,7 @@ local encounters = {
 	[145910] = 849, -- The Fallen Protectors
 	[145911] = 866, -- Norushen
 	[145912] = 867, -- Sha of Pride
-	[145913] = 868, -- Galakras
+	[145913] = {868, 881}, -- Galakras
 	[145914] = 864, -- Iron Juggernaut
 	[145915] = 856, -- Kor'kron Dark Shaman
 	[145916] = 850, -- General Nazgrim
diff --git a/HabeebIt.lua b/HabeebIt.lua
index 16b4ffa..7798fd2 100644
--- a/HabeebIt.lua
+++ b/HabeebIt.lua
@@ -279,7 +279,19 @@ function Container:Update()

 	local currentInstance = EJ_GetCurrentInstance()
 	EJ_SelectInstance(currentInstance > 0 and currentInstance or 322)
-	EJ_SelectEncounter(currentEncounterID)
+
+	if(type(currentEncounterID) == 'table') then
+		for _, value in pairs(currentEncounterID) do
+			EJ_SelectEncounter(value)
+
+			if(EJ_GetNumLoot > 0) then
+				currentEncounterID = value
+				break
+			end
+		end
+	else
+		EJ_SelectEncounter(currentEncounterID)
+	end

 	local _, _, classID = UnitClass('player')
 	EJ_SetLootFilter(classID, GetLootSpecialization() or GetSpecializationInfo(GetSpecialization() or 0) or 0)