WoWInterface SVN RaidWatch2

[/] [trunk/] [RaidWatch_Icecrown/] [TheCrimsonHall/] [BloodPrinceCouncil.lua] - Rev 22

Compare with Previous | Blame | View Log

local mod = RW:Boss("Blood Prince Council", "Icecrown Citadel", "The Crimson Hall")
local L

mod.BossIcon = [[Interface\Icons\achievement_boss_princetaldaram]]
mod.SubCatIcon = [[Interface\Icons\achievement_dungeon_crimsonhall]]

------------------------------------
-- Variables
-- Invocation of Blood
local tInvocationCD, wInvocation, iInvocation
-- Conjure Empowered Flame
local tEmpFlameCD, tEmpFlameCast, iEmpFlameTarget, wEmpFlameTarget, mEmpFlameTarget, dEmpFlameTarget
-- Empowered Shock Vortex
local tEmpShockCD, tEmpShockCast, wEmpShock
local iSock, wShock, mShock, dShock
-- Shadow Resonance
local tShadwoResCD
-- Shadow Prison
local wPrison, tPrisonDur

local tBerserk

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

function mod:OnRegister()
        L = mod:RegisterLocale("enUS")
        if L then               
                L.target_switch = "Target Switch possible"
                
                L.invocation_switch = "Switch to %s!"
                L.invocation_switch_opt = "Warning for when its time to switch target"
                
                L.shock_cast_warning = "Shock Vortex: Spread Out!"
                
                L.flame_emote = "Empowered Flames speed toward (%S+)!"
                
                L.prison_stacks = "Shadow Prison x %d"
                L.prison_stacks_opt = "Warning when Shadow Prison reaches 2 stacks"
        end
        L = mod:GetLocale()
        mod.L = L
        
        mod:SetTrigger(37973, 37972, 37970)
        mod:SetWin()
        
        self:AddToCategory(RW.LBB["Prince Valanar"] or "Prince Valanar", 72039, 72037)
        self:AddToCategory(RW.LBB["Prince Taldaram"] or "Prince Taldaram", 72040)
        self:AddToCategory(RW.LBB["Prince Keleseth"] or "Prince Keleseth", 71943)
        
        local shockName = GetSpellInfo(72039)
        self:AddRangeCheckOption("ShowRangeCheck", shockName, 12, true)
        
        -- General
        tBerserk                        = self:BerserkTimer(600)
        tInvocationCD           = self:CDTimer(46, L.target_switch, 70952)      
        wInvocation                     = self:CustomWarning(L.invocation_switch, L.invocation_switch_opt, 70952)
        iInvocation                     = self:Icon("SKULL", 70952)
        
        -- Taldaram
        tEmpFlameCD                     = self:CDTimer(20, 72040)
        tEmpFlameCast           = self:CastTimer(72040)
        wEmpFlameTarget         = self:RunawayWarning(72040)
        mEmpFlameTarget         = self:TargetMessage(72040)
        iEmpFlameTarget         = self:Icon("CROSS", 72040, false, 10)
        dEmpFlameTarget         = self:DirectionTo(72040)
        
        -- Valanar
        tEmpShockCD                     = self:CDTimer(20, 72039)
        tEmpShockCast           = self:CastTimer(72039)
        wEmpShock                       = self:RunawayWarning(L.shock_cast_warning, 72039)
        iSock                           = self:Icon("SQUARE", 72037, false, 6)
        wShock                          = self:RunawayWarning(72037)
        mShock                          = self:TargetMessage(72037)
        dShock                          = self:DirectionFrom(72037)
        
        --Keleseth
        tShadwoResCD            = self:CDTimer(10, 71943, nil, nil, false)
        
        -- Shadow Prison
        tPrisonDur                      = self:DurTimer(10, 72999)
        wPrison                         = self:CustomWarning(L.prison_stacks, L.prison_stacks_opt, 72999)
end

-----------------------------------------
-- Locals
local TaldaramCID = 37973
local KelesethCID = 37972
local ValanarCID = 37970
local prisonSpam

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

function mod:OnEngage(trigger)
        self:Track("Invocation", 70952, 70981, 70982)
        self:Track("EmpShock", 72039, 73037, 73038, 73039)
        self:Track("NormalShock", 72037)
        self:Track("EmpFlame", 72040)
        self:Track("ShadowRes", 71943)
        self:Track("Prison", 72999)
        
        tInvocationCD:Start()
        tBerserk:Start()
        
        prisonSpam = 0
end

function mod:Invocation(event, args)
        if event == "SPELL_AURA_APPLIED" then
                local cID = self:CUIDFromGUID(args.dGUID)
                tInvocationCD:Start()
                wInvocation:Show(args.dName)
                
                if UnitName("boss1") == args.dName then
                        iInvocation:Show("boss1")
                elseif UnitName("boss2") == args.dName then
                        iInvocation:Show("boss2")
                elseif UnitName("boss3") == args.dName then
                        iInvocation:Show("boss3")
                end             
                
                tEmpFlameCD:Stop()
                tEmpShockCD:Stop()
                
                if cID == TaldaramCID then
                        tEmpFlameCD:Start(7)
                elseif cID == KelesethCID then
                elseif cID == ValanarCID then
                        tEmpShockCD:Start(7)
                end
        end
end

local function rangeHider()
        RW.Callbacks:Fire("RangeCheckShow", false)
end

function mod:EmpShock(event, args)
        if event == "SPELL_CAST_START" then
                tEmpShockCD:Start()
                tEmpShockCast:Start()
                wEmpShock:Show()
                
                if self.db.profile.ShowRangeCheck then
                        RW.Callbacks:Fire("RangeCheckShow", true, 12)
                        self:Schedule("RwmoveRange", 8, rangeHider)
                end
        end
end


function mod:scanShockTarget()
        local target = self:GetMobTarget(37970)
        if target then
                if target == self.pName then
                        SendChatMessage("Shock Vortex on "..self.pName.."!", "SAY")
                
                elseif self.Party.group[target] then
                        local uID = self.Party.group[target].id
                        if uID and CheckInteractDistance(uID, 2) then
                                wShock:Show()
                        end
                end
                
                iSock:Show(target)
                mShock:Show(target)
                dShock:Show(target, 12, 15)
        end
end

function mod:NormalShock(event, args)
        if event == "SPELL_CAST_START" then
                self:Schedule("ShockTarget", 0.2, "scanShockTarget")
        end
end


function mod:EmpFlame(event, args)
        if event == "SPELL_CAST_START" then
                tEmpFlameCD:Start()
                tEmpFlameCast:Start()
        end
end

function mod:ShadowRes(event, args)
        if event == "SPELL_CAST_SUCCESS" then
                tShadwoResCD:Start()
        end
end

function mod:Prison(event, args)
        if event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_APPLIED_DOSE" then
                if args:IsPlayer() then
                        if (args.amount or 1) >= 10 and ((GetTime() - prisonSpam) > 2) then
                                wPrison:Show(args.amount or 2)
                                prisonSpam = GetTime()
                        end
                        tPrisonDur:Start()
                end
        end
end

function mod:CHAT_MSG_RAID_BOSS_EMOTE(event, msg, name)
        local target = msg:match(L.flame_emote)
        if target then
                if target == self.pName then
                        wEmpFlameTarget:Show()
                end
                mEmpFlameTarget:Show(target)
                iEmpFlameTarget:Show(target)
                dEmpFlameTarget:Show(target, 12)
        end
end

Compare with Previous | Blame