Advertisement
Rochet2

Boss stuff

Mar 31st, 2012
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.95 KB | None | 0 0
  1. local OnCombat, OnLeaveCombat, OnKilledTarget, OnDied, Phase_1, Phase_Last, Shadowbolt
  2.  
  3. --When he's aggro'd
  4. function OnCombat(pUnit, event)
  5.     pUnit:SendChatMessage(14, 0, "Only fools seek death!")
  6.     pUnit:RegisterEvent(Phase_1, 5000, 0)
  7. end
  8.  
  9. -- When he dies
  10. function OnDied(pUnit, event)
  11.     pUnit:SendChatMessage(14, 0, "I've got to run! NO! STAY AWAY FROM THE LIGHT!")
  12.     pUnit:RemoveEvents()
  13. end
  14.  
  15. -- When he kills a player
  16. function OnKilledTarget(pUnit, event)
  17.     pUnit:SendChatMessage(14, 0, "Fall to the shadows!")
  18. end
  19.  
  20. -- When he leaves combat (either players run or entire group wipes
  21. function OnLeaveCombat(pUnit, event)
  22.     pUnit:SendChatMessage(14, 0, "The shadows have prevailed!")
  23.     pUnit:RemoveEvents()
  24. end
  25.    
  26. --Phase One
  27. function Phase_1(pUnit, Event)
  28.     if (pUnit:GetHealthPct() <= 50) then
  29.         pUnit:RemoveEvents()
  30.         pUnit:SendChatMessage(14, 0, "You're really starting to piss me off!")
  31.         pUnit:RegisterEvent(Phase_Last, 5000, 0)
  32.     end
  33. end
  34.    
  35. --2nd and final phase
  36. function Phase_Last(pUnit, event)
  37.     if (pUnit:GetHealthPct() <= 20) then
  38.         pUnit:RemoveEvents()
  39.         pUnit:SendChatMessage(14, 0, "I can not fail! FELL THE SHADOWS!")
  40.         --pUnit:Root() -- gonna wanna use this if he's a spellcaster to prevent moving around.          
  41.         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.
  42.     end
  43. end
  44.    
  45. function Shadowbolt(pUnit, event)
  46.     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
  47.         pUnit:FullCastSpellOnTarget(39026, pUnit:GetMainTank())
  48.     end
  49. end
  50.    
  51. RegisterUnitEvent(88803, 1, OnCombat)
  52. RegisterUnitEvent(88803, 2, OnLeaveCombat)
  53. RegisterUnitEvent(88803, 3, OnKilledTarget)
  54. RegisterUnitEvent(88803, 4, OnDied)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement