All pastes #175021 Raw Edit

Someone

public lua v1 · immutable
·published 2006-09-18 12:59 UTC
rendered paste body
----------------------------------      Module Prototype      ----------------------------------BigWigs.modulePrototype.core = BigWigsBigWigs.modulePrototype.debugFrame = ChatFrame5BigWigs.modulePrototype.revision = 1 -- To be overridden by the module!function BigWigs.modulePrototype:IsBossModule()	return self.zonename and self.enabletrigger and trueendfunction BigWigs.modulePrototype:GenericBossDeath(msg)	if msg == string.format(UNITDIESOTHER, self:ToString()) then		if self.db.profile.bosskill then self:TriggerEvent("BigWigs_Message", string.format(L["%s has been defeated"], self:ToString()), "Green", nil, "Victory") end		self:TriggerEvent("BigWigs_RemoveRaidIcon")		self.core:ToggleModuleActive(self, false)	endendfunction BigWigs.modulePrototype:Scan()	local t = self.enabletrigger	if not t then return false end	if type(t) == "string" then t = {t} end	for _, mob in pairs(t) do		if UnitName("target") == mob and UnitAffectingCombat("target") then			return true		elseif UnitName("playertarget") == mob and UnitAffectingCombat("playertarget") then			return true		else			local i			for i = 1, GetNumRaidMembers(), 1 do				if UnitName("raid"..i.."target") == mob and UnitAffectingCombat("raid"..i.."target") then					return true				end			end		end	end	return falseendfunction BigWigs.modulePrototype:CheckForEngage()	local go = self:Scan()	local running = self:IsEventScheduled(self:ToString().."_CheckStart")	if go then		self:CancelScheduledEvent(self:ToString().."_CheckStart")		self:UnregisterEvent("PLAYER_REGEN_DISABLED")		-- okay so what now		self:TriggerEvent("BigWigs_SendSync", "StartSync") -- send a sync?		-- maybe just self:BossEngaged() and require the modules that use this		-- to create that function?	elseif not running then		self:ScheduleRepeatingEvent(self:ToString().."_CheckStart", self.CheckForEngage, .5, self)	endendfunction BigWigs.modulePrototype:CheckForWipe()	-- If we are a hunter, we need to check for the FD buff.	local _, class = UnitClass("player")	local check = true	if class == "HUNTER" then		for i = 1, 16 do			local buff = UnitBuff("player", i)			if buff and buff == "Interface\\Icons\\Ability_Rogue_FeignDeath" then				check = false				break			end		end	end	if not check then return end	self:RegisterEvent("PLAYER_REGEN_DISABLED", "CheckForEngage")	local go = self:Scan()	local running = self:IsEventScheduled(self:ToString().."_CheckWipe")	if not go then		self:TriggerEvent("BigWigs_RebootModule", self)	elseif not running then		self:ScheduleRepeatingEvent(self:ToString().."_CheckWipe", self.CheckForWipe, 2, self)	endend