Thread: Addon help
View Single Post
09-19-15, 04:40 PM   #13
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by Lombra View Post
Aren't you going to want to wait with disbanding until everyone else has looted?
I gave up on the disbanding, instead i'm just leaving the group, but i still can't find a way to guarantee that i looted the mob before leaving.

Code:
local champions = {"Deathtalon", "Doomroller", "Terrorfist", "Vengeance"}

caelUI.rares:SetScript("OnEvent", function(self, event, addon, arg)

	if event == "CHAT_MSG_MONSTER_YELL" and (arg == "Frogan" or arg == "Shadow-Lord Iskar" or arg == "Siegemaster Mar\'tak" or arg == "Tyrant Velhari") and not IsInRaid() then
		self:RegisterEvent("PLAYER_TARGET_CHANGED")
	end

	if event == "PLAYER_TARGET_CHANGED" then
		for name = 1, #champions do
			if UnitName("target") == champions[name] then

				self:RegisterEvent("PLAYER_REGEN_ENABLED")

				-- C_LFGList.CreateListing(Category ID, "groupName", itemLevel, "voiceChat", "comment", autoAccept)
				C_LFGList.CreateListing(16, UnitName("target"), 0, "", "Join quick !", true)

				C_Timer.After(5, function()
					ConvertToRaid()
				end)

				self:UnregisterEvent("PLAYER_TARGET_CHANGED")
			end
		end
	end

	if event == "PLAYER_REGEN_ENABLED" then
		C_Timer.After(5, function()
			C_LFGList.RemoveListing()
			LeaveParty()
		end)

		self:UnregisterEvent("PLAYER_REGEN_ENABLED")
	end
end)
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
  Reply With Quote