WoWInterface SVN RaidWatch2

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

Compare with Previous | Blame | View Log

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

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

---------------------------
-- Variables
local tActive
local tAddsCD, wAdds
local mMark, wMarkSoon, wMark
local wFrenzy
local mRune, tRuneDur, tRuneCD
local tNovaCD
local tBoil, mBoil
local tBerserk

local RoleBits = RW.Utils.Constants.RoleBits

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

function mod:OnRegister()
        L = mod:RegisterLocale("enUS")
        if L then
                L.YellPullHorde = "Kor'kron, move out! Champions, watch your backs. The Scourge have been..."
                L.YellPullAlliance = "Let's get a move on then! Move ou..."
                L.YellWin = "I... Am... Released..."
                
                L.active = " active"
                L.active_opt = "Timer for when the fight starts"
                L.active_grup = "Fight start"
                
                L.blood_opt = "Blood Power \"health\" frame"
                L.blood = "Blood Power"
                
                L.mark_soon = "Mark of the Fallen Champion soon"
                L.mark_soon_opt = "Warning at 90 stacks"
                
                L.rune_applied = "Rune of Blood on %s"
                L.rune_applied_opt = "Warning when it is applied on someone."
        end
        L = mod:GetLocale()
        self.L = L
        
        self:SetTrigger(L.YellPullHorde, L.YellPullAlliance, 37813)
        self:SetWin()
        self:SetDelay(120)
        
        
        local novaName = GetSpellInfo(73058)
        
        self:AddBoolOption("BloodPFrame", L.blood_opt, nil, nil, select(3, GetSpellInfo(72370)))
        self:AddRangeCheckOption("ShowRangeCheck", novaName, 12, self.isCaster)
        
        tBerserk        = self:BerserkTimer(480)
        
        tActive         = self:CustomTimer(98, (RW.LBB[self:GetName()] or self:GetName())..L.active, L.active_opt, select(3, GetSpellInfo(72370)),  L.active_grup)
        tAddsCD         = self:CDTimer(40, 72173)
        tRuneDur        = self:DurTargetTimer(20 ,72410, nil, nil, false)
        tRuneCD         = self:CDTimer(20, 72410, nil, nil, bit.bor(RoleBits.TANK, RoleBits.HEALER))
        tNovaCD         = self:CDTimer(20, 73058)
        tBoil           = self:DurTimer(15, 72385, nil, nil, false)
        
        wAdds           = self:Warning(72173)
        wMarkSoon       = self:CustomWarning(L.mark_soon, L.mark_soon_opt, 72293)
        wFrenzy         = self:Warning(72737)
        wMark           = self:Warning(72293)
        wRune           = self:CustomWarning(L.rune_applied, L.rune_applied_opt, 72293, nil, nil, false)
        
        mMark           = self:TargetMessage(72293)
        mRune           = self:TargetMessage(72410, nil, nil, bit.bor(RoleBits.TANK, RoleBits.HEALER))
        mBoil           = self:TargetMessage(72385, nil, nil, false)
end

---------------------------
-- Locals
local bloodStacks
local markSpamm
local markCount
local summonSpamm

local function updateBlood()    
        local uID = mod:UIDFromCID(37813)
        if uID then
                bloodStacks = UnitPower(uID) / UnitPowerMax(uID)
        end
        if bloodStacks > 0.85 then
                if not markSpamm then
                        wMarkSoon:Show()
                        markSpamm = true
                end
        end
        return bloodStacks
end

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

function mod:OnEngage(trigger)
        self:Track("Adds", 72173, 72357, 72356, 72358, 72172)
        self:Track("Mark", 72254, 72280, 72293, 72444, 72445, 72279, 72260, 72278, 72255, 72256, 72446) -- 72293 is the one cast and applied, remove the rest after comfirm
        self:Track("Frenzy", 72737)
        self:Track("Rune", 72410, 72408, 72409, 72447, 72448, 72449)
        self:Track("Nova", 73058, 72378)
        self:Track("BoilingBlood", 72385)
        
        markSpamm = false
        summonSpamm = 0
        markCount = 0
        bloodStacks = 0
        
        if self.db.profile.BloodPFrame then
                RW.Callbacks:Fire("MPBPowerByID", 37813, nil, nil, select(3, GetSpellInfo(72370)))
        end
        
        if UnitFactionGroup("player") == "Horde" then
                tActive:Start()
                tAddsCD:Schedule(98)
                if self:IsHeroic() then
                        tBerserk:Schedule(98, 380)
                else
                        tBerserk:Schedule(98)
                end
        else
                tActive:Start(48)
                tAddsCD:Schedule(48)
                if self:IsHeroic() then
                        tBerserk:Schedule(48, 380)
                else
                        tBerserk:Schedule(48)
                end
        end
        if self.db.profile.ShowRangeCheck then
                RW.Callbacks:Fire("RangeCheckShow", true, 12)
        end
end

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

function mod:Adds(event, args)
        if event == "SPELL_CAST_SUCCESS" then
                if (GetTime() - summonSpamm) > 2 then                   
                        wAdds:Show()
                        summonSpamm = GetTime()
                end
                tAddsCD:Start()
        end
end

function mod:Mark(event, args)
        if event == "SPELL_AURA_APPLIED" then
                if args:IsPlayer() then
                        wMark:Show()
                end
                mMark:Show(args.dName)
                markCount = markCount + 1
                markSpamm = false
        end
end

function mod:Frenzy(event, args)
        if event == "SPELL_AURA_APPLIED" then
                wFrenzy:Show()
        end
end

function mod:Rune(event, args)
        if event == "SPELL_AURA_APPLIED" then
                tRuneDur:Start(args.dName)
                mRune:Show(args.dName)
                wRune:Show(args.dName)
                tRuneCD:Start()
        end
end

function mod:Nova(event, args)
        if event == "SPELL_CAST_START" then
                tNovaCD:Start()
        end
end

function mod:BoilingBlood(event, args)
        if event == "SPELL_AURA_APPLIED" then
                mBoil:AddDelayTarget(args.dName)
                mBoil:DelayedShow(0.5)
                tBoil:Start()
        end
end

Compare with Previous | Blame