Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local OnCombat, OnLeaveCombat, OnKilledTarget, OnDied, Phase_1, Phase_Last, Shadowbolt
- --When he's aggro'd
- function OnCombat(pUnit, event)
- pUnit:SendChatMessage(14, 0, "Only fools seek death!")
- pUnit:RegisterEvent(Phase_1, 5000, 0)
- end
- -- When he dies
- function OnDied(pUnit, event)
- pUnit:SendChatMessage(14, 0, "I've got to run! NO! STAY AWAY FROM THE LIGHT!")
- pUnit:RemoveEvents()
- end
- -- When he kills a player
- function OnKilledTarget(pUnit, event)
- pUnit:SendChatMessage(14, 0, "Fall to the shadows!")
- end
- -- When he leaves combat (either players run or entire group wipes
- function OnLeaveCombat(pUnit, event)
- pUnit:SendChatMessage(14, 0, "The shadows have prevailed!")
- pUnit:RemoveEvents()
- end
- --Phase One
- function Phase_1(pUnit, Event)
- if (pUnit:GetHealthPct() <= 50) then
- pUnit:RemoveEvents()
- pUnit:SendChatMessage(14, 0, "You're really starting to piss me off!")
- pUnit:RegisterEvent(Phase_Last, 5000, 0)
- end
- end
- --2nd and final phase
- function Phase_Last(pUnit, event)
- if (pUnit:GetHealthPct() <= 20) then
- pUnit:RemoveEvents()
- pUnit:SendChatMessage(14, 0, "I can not fail! FELL THE SHADOWS!")
- --pUnit:Root() -- gonna wanna use this if he's a spellcaster to prevent moving around.
- pUnit:RegisterEvent(Shadowbolt, 3000, 0) -- This will cast it once every three seconds, if he's a caster you'll want him to chain it so set it to 1100 miliseconds as the cast time is 1 sec.
- end
- end
- function Shadowbolt(pUnit, event)
- if(not pUnit:IsCasting()) then -- check whether the NPC is casting already. If not, then cast again. Spellcasting can be delayed by the players. This also lets you use any time delay when registering Shadowbolt, since the spells wont interrupt eachother
- pUnit:FullCastSpellOnTarget(39026, pUnit:GetMainTank())
- end
- end
- RegisterUnitEvent(88803, 1, OnCombat)
- RegisterUnitEvent(88803, 2, OnLeaveCombat)
- RegisterUnitEvent(88803, 3, OnKilledTarget)
- RegisterUnitEvent(88803, 4, OnDied)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement