WoWInterface SVN RaidWatch2

[/] [trunk/] [RaidWatch_Icecrown/] [ThePlagueworks/] [Festergut.lua] - Rev 22

Compare with Previous | Blame | View Log

local mod = RW:Boss("Festergut", "Icecrown Citadel", "The Plagueworks")
local L

mod.BossIcon = [[Interface\Icons\achievement_boss_festergutrotface]]
mod.SubCatIcon = [[Interface\Icons\achievement_dungeon_plaguewing]]

---------------------------
-- Variables
--Spores
local iSpore, tSporeExplode, tSporeCD, wSpore, wSporeRun, mSpore, dSpores
--Inhale
local tInhaleCD, wInhale, mInhaleSoon
--Inhaled
local mInhaledStacks
--Pungent
local tPungentCD, tPungentcast, mPungentSoon, wPungentCast
--Gastric Bloat
local tGastricDur, tGastricCD, mGastric
--Vile Gas
local iVileGas, mVileGas, tVileGasCD, tVileGasDur
local tEnrage
-- Goo
local wGoo

local RoleBits = RW.Utils.Constants.RoleBits

---------------------------
-- Init 
function mod:OnRegister()
        L = mod:RegisterLocale("enUS")
        if L then
                L.YellPull = "Fun time!"
                L.Yellkill = "Da...Daddy..."
        end
        L = mod:GetLocale()
        mod.L = L
        
        mod:SetTrigger(L.YellPull, 36626)
        mod:SetWin(36626, L.Yellkill)
        
        local gasName = GetSpellInfo(69240)
        self:AddRangeCheckOption("ShowRangeCheck", gasName, 8, self.isCaster)
        
        tEnrage                 = self:BerserkTimer(300)
        
        tSporeCD                = self:CDTimer(35, 69278)
        tSporeExplode   = self:DurTimer(12, 69278)
        tInhaleCD               = self:CDTimer(30, 69165)
        tPungentCD              = self:CDTimer(30, 73032)
        tPungentcast    = self:CastTimer(3, 73032)
        tGastricCD              = self:CDTimer(11, 72219, nil, nil, bit.bor(RoleBits.TANK, RoleBits.HEALER))
        tGastricDur             = self:DurTargetStackTimer(100, 72219, nil, nil,  RoleBits.TANK)
        tVileGasCD              = self:CDTimer(20, 69240)
        tVileGasDur             = self:DurTimer(6, 69240)
        
        wSporeRun               = self:RunawayWarning(69278)
        wSpore                  = self:Warning(69278)
        wInhale                 = self:CastWarning(69165)
        wPungentCast    = self:CastWarning(73032)
        wGoo                    = self:CastWarning(72458)
        
        mSpore                  = self:TargetMessage(69278)
        mInhaleSoon             = self:SoonMessage(69165)
        mInhaledStacks  = self:StackMessage(71912)
        mPungentSoon    = self:SoonMessage(73032)
        mGastric                = self:TargetStackMessage(72219, nil, nil, bit.bor(RoleBits.TANK, RoleBits.HEALER))
        mVileGas                = self:TargetMessage(69240)
        
        dSpores                 = self:DirectionTo(69278)
        
        iSpore                  = self:Icon("STAR", 69278, false, 12, "CIRCLE", "DIAMOND")
        iVileGas                = self:Icon("SKULL", 69240, false, 6, "CROSS", "SQUARE")
end
---------------------------
-- Locals
local gooSpell = GetSpellInfo(72310)
local gooSpam

---------------------------
-- Start
function mod:OnEngage(trigger)
        self:Track("Spores", 69279)
        self:Track("Inhale", 69165)
        self:Track("Inhaled", 71912, 69166)
        self:Track("Pungent", 73032, 69195, 71219, 73031)
        self:Track("Gastric", 72219, 72214, 72551, 72552, 72553, 72231)
        self:Track("VileGas", 69240, 71218)

        tSporeCD:Start(15)
        tInhaleCD:Start(30)
        mInhaleSoon:Schedule(25, "5s")
        
        self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
        gooSpam = 0
        
        tEnrage:Start()
        
        if self.db.profile.ShowRangeCheck then
                RW.Callbacks:Fire("RangeCheckShow", true, 8)
        end
end

function mod:Spores(event, args)
        if event == "SPELL_CAST_SUCCESS" then
                tSporeCD:Start()
                tVileGasCD:Start()
                tSporeExplode:Start()
        
        elseif event == "SPELL_AURA_APPLIED" then
                if args:IsPlayer() then
                        wSporeRun:Show()
                else
                        wSpore:Show()
                end
                mSpore:AddDelayTarget(args.dName)
                mSpore:DelayedShow(0.8)
                iSpore:Show(args.dName)
                dSpores:Show(args.dName, 12)
                
                RW.Callbacks:Fire("RangeCheckShow", true, 12)
                RW.Callbacks:Fire("RangeCheckFilterClear")
                RW.Callbacks:Fire("RangeCheckFilterIcons", true)                
                RW.Callbacks:Fire("RangeCheckFilterAddIcon", "STAR", "CIRCLE", "DIAMOND")
        
        elseif event == "SPELL_AURA_REMOVED" then
                RW.Callbacks:Fire("RangeCheckShow", false)
        end
end

function mod:Inhale(event, args)
        if event == "SPELL_CAST_START" then
                tInhaleCD:Schedule(3.5)
                wInhale:Show()
                mInhaleSoon:Schedule(27.5, "5s")
        end
end

function mod:Inhaled(event, args)
        if event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_APPLIED_DOSE" then
                mInhaledStacks:Show(args.amount or 1)
                
                if (args.amount or 1) >= 3 then
                        mInhaleSoon:Cancel()
                        tInhaleCD:Stop()
                        
                        tPungentCD:Start()
                        mPungentSoon:Schedule(25, "5s")
                end
        end
end

function mod:Pungent(event, args)
        if event == "SPELL_CAST_START" then
                tPungentcast:Start()
                wPungentCast:Show()
                tPungentCD:Stop()
                mPungentSoon:Cancel()
                
                tInhaleCD:Schedule(3)
                mInhaleSoon:Schedule(27, "5s")
                
                tVileGasCD:Start(10)
                tSporeCD:Start(20)
        end
end

function mod:Gastric(event, args)
        if event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_APPLIED_DOSE" then
                tGastricCD:Start()
                tGastricDur:Unschedule(args.dName)
                tGastricDur:Schedule(13, 87, args.dName, args.amount or 1)
                mGastric:Show(args.dName, args.amount or 1)
        
        elseif event == "SPELL_AURA_REMOVED" then
                tGastricDur:Cancel(args.dName)
        end
end

function mod:VileGas(event, args)
        if event == "SPELL_AURA_APPLIED" then
                mVileGas:AddDelayTarget(args.dName)
                mVileGas:DelayedShow(0.8)
                tVileGasDur:Start()
                iVileGas:Show(args.dName)
                
        elseif event == "SPELL_AURA_REMOVED" then
                iVileGas:Hide(args.dName)
        end
end

function mod:UNIT_SPELLCAST_SUCCEEDED(unit, spell)
        if spell == gooSpell and (GetTime() - gooSpam) > 2 then
                wGoo:Show()
                gooSpam = GetTime()
        end
end

Compare with Previous | Blame