Code:
function MasterofPuppets_spell1(Unit,event)
unit:castspellontarget(34240,Unit:GetMainTank())
unit:castspellontarget(46480,Unit:GetMainTank())
end
function MasterofPuppets_spell2(unit,event)
unit:castspell(38533,Unit:GetRandomPlayer(0))
end
function MasterofPuppets_phase1(unit,event)
if unit:GetHealthPct() < 85 then
unit:removeevents()
unit:registerevent("MasterofPuppets_spell1",8000, 0)
unit:sendchatmessage(11, 0, "I hope you like bugs!!")
unit:spawncreature(18133, 791.269531, 8475.882813, 21.224709, -2.765212, 14, 120000)
unit:spawncreature(18133, 767.243713, 8483.705078, 22.512442, 0.166998, 14, 120000
unit:spawncreature(18133, 745.955688, 8516.423828, 21.926340, 2.391304, 14, 120000
unit:spawncreature(18133, 791.269531, 8475.882813, 21.224709, -2.765212, 14, 120000)
unit:spawncreature(18133, 767.243713, 8483.705078, 22.512442, 0.166998, 14, 120000
unit:spawncreature(18133, 745.955688, 8516.423828, 21.926340, 2.391304, 14, 120000
unit:spawncreature(18133, 791.269531, 8475.882813, 21.224709, -2.765212, 14, 120000)
unit:spawncreature(18133, 767.243713, 8483.705078, 22.512442, 0.166998, 14, 120000
unit:spawncreature(18133, 745.955688, 8516.423828, 21.926340, 2.391304, 14, 120000
unit:RegisterEvent("MasterofPuppets_phase2")
end
function MasterofPuppets_phase2(unit,event)
if unit:GetHealthPct() < 50 then
unit:sendchatmessage(11, 0, "I didn't expect this much from you, Not it's time for me to Show you my true power")
unit:spawncreature(18133, 791.269531, 8475.882813, 21.224709, -2.765212, 14, 120000)
unit:spawncreature(18133, 767.243713, 8483.705078, 22.512442, 0.166998, 14, 120000
unit:spawncreature(18133, 745.955688, 8516.423828, 21.926340, 2.391304, 14, 120000
unit:spawncreature(18133, 791.269531, 8475.882813, 21.224709, -2.765212, 14, 120000)
unit:spawncreature(18133, 767.243713, 8483.705078, 22.512442, 0.166998, 14, 120000
unit:spawncreature(18133, 745.955688, 8516.423828, 21.926340, 2.391304, 14, 120000
unit:spawncreature(18133, 791.269531, 8475.882813, 21.224709, -2.765212, 14, 120000)
unit:spawncreature(18133, 767.243713, 8483.705078, 22.512442, 0.166998, 14, 120000
unit:spawncreature(18133, 745.955688, 8516.423828, 21.926340, 2.391304, 14, 120000
unit:spawncreature(18133, 791.269531, 8475.882813, 21.224709, -2.765212, 14, 120000)
unit:spawncreature(18133, 767.243713, 8483.705078, 22.512442, 0.166998, 14, 120000
unit:spawncreature(18133, 745.955688, 8516.423828, 21.926340, 2.391304, 14, 120000
unit:spawncreature(18133, 791.269531, 8475.882813, 21.224709, -2.765212, 14, 120000)
unit:spawncreature(18133, 767.243713, 8483.705078, 22.512442, 0.166998, 14, 120000
unit:spawncreature(18133, 745.955688, 8516.423828, 21.926340, 2.391304, 14, 120000
unit:spawncreature(18133, 791.269531, 8475.882813, 21.224709, -2.765212, 14, 120000)
unit:spawncreature(18133, 767.243713, 8483.705078, 22.512442, 0.166998, 14, 120000
unit:spawncreature(18133, 745.955688, 8516.423828, 21.926340, 2.391304, 14, 120000
unit:RemoveEvents();
unit:registerevent("masterofpuppets_spell1)
unit:registerevent("masterofpuppets_spell2)
end
function MasterofPuppets_phase3(unit,event)
if unit:GetHealthPtc 10
unit:removeevents()
unit:setscale(2)
unit:sendchatmessage(11, 0, "Take that Bastards")
unit:castspell(40508)
unit:castspell(40508)
unit:castspell(40508)
unit:RegisterEvent("MasterofPuppets_spell1",1000, 0)
unit:RegisterEvent("Masterofpuppets_spell2",1000, 0)
end
function MasterofPuppets_OnCombat(Unit, event)
Unit:SendChatMessage(11, 0, "I've been expecting you ,too bad you're going to die!")
Unit:RegisterEvent("MasterofPuppets_Phase1",1000, 0)
end
function MasterofPuppets_OnLeaveCombat(Unit, event)
Unit:RemoveEvents();
Unit:SendChatMessage(11, 0, "Run coward run!")
Unit:SetScale(4)
end
function MasterofPuppets_OnKilledTarget(Unit, event)
Unit:SendChatMessage(11, 0, "Your life energy is mine Bwhahaha!")
Unit:CastSpell(39321)
end
function MasterofPuppets_Death(Unit, event)
Unit:RemoveEvents();
Unit:SetScale(1)
unit:sendchatmessage(11, 0, "How.. how can I fail?")
end
RegisterUnitEvent(9007, 1, "MasterofPuppets_OnCombat")
RegisterUnitEvent(9007, 2, "MasterofPuppets_OnLeaveCombat")
RegisterUnitEvent(9007, 3, "MasterofPuppets_OnKilledTarget")
RegisterUnitEvent(9007, 4, "MasterofPuppets_Death")