WoWInterface SVN RaidWatch2

[/] [trunk/] [RaidWatch_Icecrown/] [TheCrimsonHall/] [Blood-QueenLanathel.lua] - Rev 22

Compare with Previous | Blame | View Log

local mod = RW:Boss("Blood-Queen Lana'thel", "Icecrown Citadel", "The Crimson Hall")
local L

mod.BossIcon = [[Interface\Icons\achievement_boss_lanathel]]

------------------------------------
-- Variables
-- Pact of the Darkfallen
local wPact, mPact, tPactCD, iPact
-- Swarming Shadows
local tSwarmDur, tSwarmCD, mSwarm, wSwarm, iSwarm
-- Bite
local tEssenceDur, tEssenceFirst, wEssence, tEssenceNext
-- Frenzy
local tFrenzyDur, wFrenzy
-- vampires
local mVampCount
-- Air Phase
local tAirPhaseCD, tAirPhaseDur, wAirPhase

local tBerserk

-----------------------------------
-- Init

function mod:OnRegister()
        L = mod:RegisterLocale("enUS")
        if L then
                L.whisper_bitten = "Whisper people that get bitten"
                L.whisper_message = "You have been bitten!"
                
                L.air_phase_group = "Air Phase"
                L.air_phase_cd = "Next Air Phase"
                L.air_phase_cd_opt = "Timer for next Air Phase"
                L.air_phase_dur = "Air Phase Ends"
                L.air_phase_dur_opt = "Timer for when the Air Phase ends"
                L.air_phase_warn = "Air Phase starting!"
                L.air_phase_warn_opt = "Warning when Air phase starts"
                
                L.bitten_option = "Warning when you get bitten"
                
                L.vamp_count = "Vampire %d: %s"
                L.vamp_count_opt = "Show vampire count message"
                
                L.frenzy = "You need to bite someone!"
                L.frenzy_opt = "Show warning when you have to bite someone"
                
                L.shadow = "Shadows amass and swarm around (%S+)!"
                
                L.next_bite = "Next bite wave (%d)"
                L.next_bite_opt = "Timer for the next wave of bites"
        end
        L = mod:GetLocale()
        mod.L = L
        
        mod:SetTrigger(37955)
        mod:SetWin()
        
        local airPhaseIcon = select(3, GetSpellInfo(71772))
        
        local boltName = GetSpellInfo(71446)
        self:AddRangeCheckOption("ShowRangeCheck", boltName, 6, self.isCaster)
        self:AddBoolOption("WhisperBitten", L.whisper_bitten, nil, false, [[Interface\ICONS\inv_misc_enggizmos_13]])
        
        tBerserk                = self:BerserkTimer(320)
        
        tPactCD                 = self:CDTimer(30, 71340)
        tSwarm                  = self:DurTargetTimer(6, 71264)
        tSwarmCD                = self:CDTimer(30, 71264)
        tSwarmDur               = self:DurTimer(6, 71264)
        tAirPhaseCD             = self:CustomTimer(120, L.air_phase_cd, L.air_phase_cd_opt, airPhaseIcon, L.air_phase_group)
        tAirPhaseDur    = self:CustomTimer(15, L.air_phase_dur, L.air_phase_dur_opt, airPhaseIcon, L.air_phase_group)
        
        wPact                   = self:RunawayWarning(71340, nil, nil, nil, "Personal", "RW: ComeCloser")
        wSwarm                  = self:RunawayWarning(71264, nil, nil, nil, "Negative")
        wAirPhase               = self:CustomWarning(L.air_phase_warn, L.air_phase_warn_opt, airPhaseIcon, L.air_phase_group)

        mPact                   = self:TargetMessage(71340, nil, nil, nil, "Information")
        mSwarm                  = self:TargetMessage(71264)
        
        iPact                   = self:Icon("TRIANGLE", 71340, false, 10, "CROSS", "SQUARE")
        iSwarm                  = self:Icon("SKULL", 71264, false, 8)
        
        -- Bite
        tEssenceDur             = self:DurTimer(70, 70867)
        tEssenceFirst   = self:CDTimer(15, 70867)
        tEssenceNext    = self:CustomTimer(70.2,  L.next_bite, L.next_bite_opt, 70867)
        wEssence                = self:CustomWarning(L.whisper_message, L.bitten_option, 70867)
        tFrenzyDur              = self:DurTimer(10, 70877)
        
        mVampCount              = self:CustomMessage(L.vamp_count, L.vamp_count_opt, 70867)
        wFrenzy                 = self:CustomWarning(L.frenzy, L.frenzy_opt, 70877)
end

-----------------------------------------
-- Locals
local vampCount
local nextBiteSpam
local nextWaveCount
local vamps = {}

-----------------------------------------
-- Start

function mod:OnEngage(trigger)
        self:Track("Pact", 71340)
        self:Track("Swarm", 71265, 71277, 72638, 72639, 72640)
        self:Track("Essence", 70867, 70879, 70949, 71473, 71525, 71530, 71531, 71532, 71533)
        self:Track("Frenzy", 70877, 71474)
        self:Track("Fear", 73070)

        vampCount = 0
        nextBiteSpam = 0
        nextWaveCount = 1
        wipe(vamps)
        
        tBerserk:Start()
        tPactCD:Start(15)
        tEssenceFirst:Start()
        
        if self:InstanceSize() == 25 then
                tAirPhaseCD:Start(125)
        else
                tAirPhaseCD:Start(120)
        end
        
        if self.db.profile.ShowRangeCheck then
                RW.Callbacks:Fire("RangeCheckShow", true, 6)
        end
        self:SendMessage("RW_StartBiteBuddy")
end

function mod:OnEnd(wipe, trigger)
        self:SendMessage("RW_StopBiteBuddy")
end

function mod:Pact(event, args)
        if event == "SPELL_AURA_APPLIED" then
                if args:IsPlayer() then
                        wPact:Show()
                end
                mPact:AddDelayTarget(args.dName)
                mPact:DelayedShow(0.2)
                tPactCD:Start()
                iPact:Show(args.dName)
        
        elseif event == "SPELL_AURA_REMOVED" then
                iPact:Hide(args.dName)
        end
end

function mod:Swarm(event, args)
        if event == "SPELL_AURA_APPLIED" then
                tSwarmDur:Start(args.dName)
        end
end

function mod:Fear(event, args)
        if event == "SPELL_CAST_SUCCESS" then
                if self:InstanceSize() == 25 then
                        tAirPhaseCD:Start(100)
                else
                        tAirPhaseCD:Start()
                end
                tAirPhaseDur:Start()
                wAirPhase:Show()
        end
end

--------------------
-- Bite
function mod:Essence(event, args)
        if event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_REFRESHED" then
                if not vamps[args.dName] then
                        vamps[args.dName] = true
                        vampCount = vampCount + 1
                        mVampCount:Show(vampCount, args.dName)
                        if args:IsPlayer() then
                                wEssence:Show()
                        end
                        
                        if self.DB.WhisperBitten then
                                if self.Party.group[args.dName] then
                                        SendChatMessage(L.whisper_message, "WHISPER", nil, args.dName)
                                end
                        end
                end
                
                local size = self:InstanceSize()
                
                if args:IsPlayer() then
                        
                        if size == 25 then
                                tEssenceDur:Start(60)
                        else
                                tEssenceDur:Start()
                        end
                        tFrenzyDur:Stop()
                end
                
                if GetTime() - nextBiteSpam > 20 then
                        nextWaveCount = nextWaveCount * 2
                        if size == 25 then
                                tEssenceNext:Start(60.2, nextWaveCount)
                        else
                                tEssenceNext:Start(nextWaveCount)
                        end
                        nextBiteSpam = GetTime()
                end
        end
end

function mod:Frenzy(event, args)
        if event == "SPELL_AURA_APPLIED" then
                if args:IsPlayer() then
                        wFrenzy:Show()
                        tEssenceDur:Stop()
                        tFrenzyDur:Start()
                end             
        end
end

--------------------
-- Swarm
function mod:CHAT_MSG_RAID_BOSS_EMOTE(event, msg, name)
        local target = msg:match(L.shadow)
        if target then
                if target == self.pName then
                        wSwarm:Show()
                end
                mSwarm:Show(target)
                tSwarmCD:Start()
                iSwarm:Show(target)
        end
end

Compare with Previous | Blame