WoWInterface SVN RaidWatch2

[/] [trunk/] [RaidWatch_Icecrown/] [TheLowerSpire/] [LadyDeathwhisper.lua] - Rev 22

Compare with Previous | Blame | View Log

local mod = RW:Boss("Lady Deathwhisper", "Icecrown Citadel", "The Lower Spire")
local L

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

---------------------
-- Variables

-- Lady
local tDominateDur, tDominateCD, mDominate, dDominate
local tDNDCD, tDNDDur, wDND
local tTouchDur, tTouchCD, mTouch
local wFrostBolt, tFrostboltCD, tFrostboltCast

-- Adds
local tNextAdds
local iEmpowerment, wEmpowerment
local wTorpor, mTorpor
local wShroud
local wMartyr, iMartyr, tMartyrCast
local wDeformed
local iTransform, wTransform
local iAnimatedMelee, iAnimatedCaster, wAnimated

-- General
local tBerserk
local mPhase, wPhase

local RoleBits = RW.Utils.Constants.RoleBits

function mod:OnRegister()
        L = mod:RegisterLocale("enUS")
        if L then
                L.YellPull = "What is this disturbance? You dare trespass upon this hallowed ground? This shall be your final resting place!"
                L.YellWin = "All part of the Master's plan.... Your end is inevitable...."
                
                L.adds = "Adds"         
                L.mana_barrier = "Mana Barrier"
                L.phasewarning = "Phase 2 Starting!"
                L.phasewarning_opt = "Phase Switch"
                
                L.next_adds = "New Adds"
                L.next_adds_opt = "Timer for when the next set of adds spawn"
                L.next_adds_group = "Add spawns"
                
                L.deformed_name = "Deformed Fanatic"
                L.deformed_name_opt = "Warn for new Deformed Fanatics"
                
                L.reanim = "Arise, and exult in your pure form!"
                L.reanim_spawned = "Reanimated Spawned!"
                L.reanim_spawned_opt = "Warning for new spawns"
                L.reanim_spawned_group = "Reanimated Spawns"
                L.reanim_fanatic = "Reanimated Fanatic"
                L.reanim_adherent = "Reanimated Adherent"
        end
        L = mod:GetLocale()
        mod.L = L
        
        mod:SetTrigger(L.YellPull, 36855)
        mod:SetWin(L.YellWin)
        
        self:AddToCategory((RW.LBB[self:GetName()] or self:GetName()), 71289, 72109, 71204, 72502)
        self:AddToCategory(L.adds , 70901, 71237, 70768, 72499, 70900, 71235, 71234, L.reanim_spawned_group)
        
        self:AddBoolOption("ManaShieldHelath", "Show Mana Barrier health", (RW.LBB[self:GetName()] or self:GetName()), true, select(3, GetSpellInfo(70842)))
        
        tNextAdds               = self:CustomTimer(60, L.next_adds, L.next_adds_opt, [[Interface\Icons\Achievement_PVP_H_10]], L.next_adds_group)
        tDominateDur    = self:DurTargetTimer(20, 71289, nil, nil, false)
        tDominateCD             = self:CDTimer(40, 71289)
        tDNDCD                  = self:CDTimer(20, 72109)
        tDNDDur                 = self:DurTimer(10, 72109)
        tTouchDur               = self:DurTargetStackTimer(30, 71204, nil, nil, RoleBits.TANK)
        tTouchCD                = self:CDTimer(10, 71204, nil, nil, RoleBits.TANK)
        tBerserk                = self:BerserkTimer(600)
        tMartyrCast             = self:CastTimer(72499)
        tFrostboltCD    = self:CDTimer(11, 72502, nil, nil, false)
        tFrostboltCast  = self:CastTimer(72502)
        
        wDND                    = self:RunawayWarning(72109)
        wPhase                  = self:CustomWarning(L.phasewarning, L.phasewarning, [[Interface\Icons\Achievement_PVP_A_02.blp]], L.phasewarning_opt)
        wTransform              = self:CastWarning(70900)
        wEmpowerment    = self:CastWarning(70901)
        wTorpor                 = self:Warning(71237)
        wShroud                 = self:CastWarning(70768)
        wMartyr                 = self:CastWarning(72499)
        wAnimated               = self:CustomWarning(L.reanim_spawned, L.reanim_spawned_opt ,[[Interface\Icons\Spell_DeathKnight_Explode_Ghoul]] , L.reanim_spawned_group)
        wFrostBolt              = self:CastWarning(72502, nil, nil, false)
        
        mDominate               = self:TargetMessage(71289)
        mTouch                  = self:TargetStackMessage(71204, nil, nil, RoleBits.TANK)
        mPhase                  = self:PhaseMessage()
        mTorpor                 = self:TargetMessage(71237, nil, nil, false)
        
        iEmpowerment    = self:Icon("DIAMOND", 70901, false)
        iMartyr                 = self:Icon("CIRCLE", 72499, false)
        iTransform              = self:Icon("SKULL", 70900, false)
        
        iAnimatedMelee  = self:Icon("CROSS", 71235, false)
        iAnimatedCaster = self:Icon("SQUARE", 71234, false)
        
        dDominate               = self:DirectionTo(71289, nil, nil, false)
end

----------------------
-- Locals

local mcTargets = {}

local function addHandler(time)
        tNextAdds:Start(time)
        if mod:IsHeroic() then
                mod:Schedule("Adds", 45, addHandler, 45)
        else
                mod:Schedule("Adds", 60, addHandler)
        end
end

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

function mod:OnEngage(trigger)
        -- Lady
        self:Track("Dominate", 71289)
        self:Track("DND", 72109, 72108, 71001, 72110)
        self:Track("ManaBarrier", 70842)
        self:Track("Touch", 71204)
        self:Track("FrostBolt", 72502, 72501)
        -- Adds
        self:Track("DarkTransform", 70900)
        self:Track("Empowerment", 70901)
        self:Track("Torpor", 71237)
        self:Track("Shroud", 70768)
        self:Track("Martyr", 72499, 72500)
        
        self:YellTrack("Reanimated", L.reanim)
        
        tBerserk:Start()
        
        if self.db.profile.ManaShieldHelath then
                RW.Callbacks:Fire("MPBPowerByID", 36855, nil, nil, select(3, GetSpellInfo(70842)))
        end
        
        tNextAdds:Start(7)
        mod:Schedule("Adds", 7, addHandler, self:IsHeroic() and 45 or nil)
        
        wipe(mcTargets)
end

function mod:OnEnd(wipe, trigger)
        RW.Callbacks:Fire("MPBPowerHideByID", 36855)
end

local function showMCTargets()
        mDominate:Show(table.concat(mcTargets, "<, >"))
        wipe(mcTargets)
end



function mod:Dominate(event, args)
        if event == "SPELL_AURA_APPLIED" then
                tDominateDur:Start(args.dName)
                tDominateCD:Start()
                mcTargets[#mcTargets + 1] = args.dName
                self:Schedule("MCTargets", 0.2, showMCTargets)
                dDominate:Show(args.dName)
                
        elseif event == "SPELL_AURA_REMOVED" then
                tDominateDur:Cancel(args.dName)
                dDominate:Hide(args.dName)
        end
end

function mod:DND(event, args)
        if event == "SPELL_CAST_SUCCESS" then
                tDNDCD:Start()
                tDNDDur:Start()
                
        elseif event == "SPELL_AURA_APPLIED" then
                if args:IsPlayer() then
                        wDND:Show()
                end
        end
end

function mod:ManaBarrier(event, args)
        if event == "SPELL_AURA_REMOVED" then
                if not self:IsHeroic() then
                        self:Unschedule("Adds")
                        tNextAdds:Stop()        
                end
                mPhase:Show(2)
                wPhase:Show()
                RW.Callbacks:Fire("MPBPowerHideByID", 36855)
        end
end

function mod:Touch(event, args)
        if event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_APPLIED_DOSE" then
                tTouchDur:Start(args.dName, args.amount or 1)
                mTouch:Show(args.dName, args.amount or 1)
                tTouchCD:Start()
        end
end

-- Dark Transformation
do
        local function transformScanner(gUID, scanNR)
                local target = mod:UIDFromGUID(gUID)
                
                if target then
                        iTransform:Show(target)
                elseif scanNR < 10 then
                        mod:Schedule("TransformScan", 0.5, transformScanner, gUID or "", scanNR + 1)
                end
        end

        function mod:DarkTransform(event, args)
                if event == "SPELL_CAST_START" then
                        wTransform:Show()
                        self:Schedule("TransformScan", 0.2, transformScanner, args.sGUID or "", 1)
                end
        end
end

-- Dark Empoverment
do
        local function empScanner(gUID, scanNR)
                local target = mod:UIDFromGUID(gUID)

                if target then
                        iEmpowerment:Show(gUID)
                end
                
                if not target and scanNR < 10 then
                        mod:Schedule("EmpScanner", 0.2, empScanner, gUID or "", scanNR + 1)
                end
        end

        function mod:Empowerment(event, args)
                if event == "SPELL_CAST_START" then
                        wEmpowerment:Show()
                        self:Schedule("EmpScanner", 0.2, empScanner, args.sGUID or "", 1)
                end
        end
end

function mod:Torpor(event, args)
        if event == "SPELL_AURA_APPLIED" then
                if args:IsPlayer() then
                        wTorpor:Show()
                end
                mTorpor:AddDelayTarget(args.dName)
                mTorpor:DelayedShow(0.2)
        end
end

function mod:Shroud(event, args)
        if event == "SPELL_CAST_START" then
                if UnitGUID("target") == args.sGUID and self.isCaster then
                        wShroud:Show()
                end
        end
end

do
        local function martyrScanner(gUID, scanNR)
                local target = mod:UIDFromGUID(gUID)

                iMartyr:Show(gUID)
                
                if not target and scanNR < 5 then
                        mod:Schedule("MartyrScanner", 1, martyrScanner, gUID or "", scanNR + 1)
                end
        end
        
        function mod:Martyr(event, args)
                if event == "SPELL_CAST_START" then
                        tMartyrCast:Start()
                        wMartyr:Show()
                        self:Schedule("MartyrScanner", 0.2, martyrScanner, args.sGUID or "", 1)
                end
        end
end

do
        local function reanimScanner(nr)
                
                local fanatic = mod:UIDFromName(L.reanim_fanatic)
                local adherent = mod:UIDFromName(L.reanim_adherent)
                
                if fanatic then iAnimatedCaster:Show(fanatic) end
                if adherent then iAnimatedMelee:Show(adherent) end
                
                if (not fanatic and not adherent) and nr < 10 then
                        mod:Schedule("ReanimScanner", 0.4, reanimScanner, nr+1)
                end
        end

        function mod:Reanimated(event, msg)
                self:Schedule("ReanimScanner", 0.2, reanimScanner, 1)
                wAnimated:Show()
        end
end

function mod:FrostBolt(event, args)
        if event == "SPELL_CAST_START" then
                wFrostBolt:Show()
                tFrostboltCast:Start()
                tFrostboltCD:Start()
        
        elseif event == "SPELL_INTERRUPT" then
                tFrostboltCast:Stop()
        end
end

Compare with Previous | Blame