Code:
function Sartharion_OnCombat(Unit, Event)
Unit:SendChatMessage(14, 0, "It is my charge to watch over these eggs. I will see you burn before any harm comes to them!")
Unit:PlaySoundToSet(14093)
Unit:RegisterEvent("Sartharion_Bomb", 2000, 0)
Unit:RegisterEvent("Sartharion_Divebomb", math.random (29000,31000), 0)
Unit:RegisterEvent("Sartharion_FunBomb", math.random(24000,29000), 0)
Unit:RegisterEvent("Sartharion_Cleave", math.random(42000,48000), 0)
Unit:RegisterEvent("Sartharion_FlameBreath", math.random (32000,36000), 0)
Unit:RegisterEvent("Sartharion_Meteor", math.random (110000,120000), 0)
Unit:RegisterEvent("Sartharion_Berserk", 480000, 1)
end
function Sartharion_Bomb(Unit, Event)
local target = Unit:GetRandomPlayer(0)
if (target ~= nil and target == target) then
Unit:CastSpellOnTarget(55362, Unit:GetRandomPlayer(7))
Unit:CastSpellOnTarget(20474, Unit:GetRandomPlayer(7))
end
end
function Sartharion_Divebomb(Unit, Event)
local chance = math.random (1,2)
if (chance == 1) then
Unit:SendChatMessage(14, 0, "Such flammable little insects...")
Unit:PlaySoundToSet(14099)
Unit:CastSpellOnTarget(35181, Unit:GetRandomPlayer(7))
end
if (chance == 2) then
Unit:SendChatMessage(14, 0, "Your charred bones will litter the floor!")
Unit:PlaySoundToSet(14100)
Unit:CastSpellOnTarget(35181, Unit:GetRandomPlayer(7))
end
end
function Sartharion_FunBomb(Unit, Event)
Unit:SendChatMessage(14, 0, "How much heat can you take?")
Unit:PlaySoundToSet(14101)
Unit:CastSpellOnTarget(20547, Unit:GetRandomPlayer(7))
end
function Sartharion_Cleave(Unit, Event)
Unit:FullCastSpell(56909)
end
function Sartharion_FlameBreath(Unit, Event)
Unit:PlaySoundToSet(14098)
Unit:SendChatMessage(14, 0, "Burn, you miserable wretches!")
Unit:FullCastSpell(56908)
end
function Sartharion_Meteor(Unit, Event)
Unit:SendChatMessage(14, 0, "All will be reduced to ash!")
Unit:PlaySoundToSet(14102)
local target = Unit:GetRandomPlayer(0)
local x, y, z = target:GetX(), target:GetY(), target:GetZ()
if (target ~= nil) then
Unit:CastSpellAoF(x, y, z, 31340)
end
end
function Sartharion_Berserk(Unit, Event)
Unit:PlaySoundToSet(61254)
Unit:SendChatMessage(14, 0, "This pathetic siege ends NOW!")
Unit:FullCastSpell(61254)
end
function Sartharion_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
function Sartharion_OnKilledTarget(Unit, Event)
Unit:SendChatMessage(14, 0, "You will make a fine meal for the hatchlings.")
Unit:PlaySoundToSet(14094)
end
function Sartharion_OnDeath(Unit, Event)
Unit:SendChatMessage(14, 0, "Such is the price... of failure...")
Unit:PlaySoundToSet(14107)
Unit:RemoveEvents()
end
RegisterUnitEvent(28860, 1, "Sartharion_OnCombat")
RegisterUnitEvent(28860, 2, "Sartharion_OnLeaveCombat")
RegisterUnitEvent(28860, 3, "Sartharion_OnKilledTarget")
RegisterUnitEvent(28860, 4, "Sartharion_OnDeath")