Krinolin

Flameh

Mar 10th, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local NPC_ID = 70001
  2.  
  3. function Flameh_CombatStart(pUnit, event)
  4.     pUnit:RegisterEvent(Flameh_SpellHandler, 15000, 0)
  5. end
  6.  
  7. function Flameh_SpellHandler(pUnit, event)
  8. local spellSelection = math.random(1, 3)
  9.     if (spellSelection == 1) then
  10.         pUnit:FullCastSpellOnTarget(75413, pUnit:GetRandomPlayer())
  11.     end
  12.     if (spellSelection == 2) then
  13.         pUnit:FullCastSpellOnTarget(74527, pUnit:GetRandomPlayer())
  14.     end
  15.     if (spellSelection == 3) then
  16.         pUnit:CastSpell(68335)
  17.     end
  18. end
  19.  
  20. function Flameh_LeaveCombat(pUnit, event)
  21. pUnit:RemoveEvents()
  22. end
  23.  
  24. function Flameh_OnDied(pUnit, event)
  25. pUnit:RemoveEvents()
  26. end
  27.  
  28. RegisterCreatureEvent(NPC_ID, 1, Flameh_CombatStart)
  29. RegisterCreatureEvent(NPC_ID, 2, Flameh_LeaveCombat)
  30. RegisterCreatureEvent(NPC_ID, 4, Flameh_OnDied)
Advertisement
Add Comment
Please, Sign In to add comment