stoneharry

Untitled

Nov 7th, 2012
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. -- ID of creature
  3. local entryid = 1 -- should NEVER be 1 as it is - 1 is usually waypoint
  4.  
  5. function HeraldSpawns(pUnit, Event)
  6. pUnit:RegisterEvent("SaySomethingHerald", 5000, 1)
  7. end
  8.  
  9. function SaySomethingHerald(pUnit)
  10. local chance = math.random(1,4)
  11. if(chance == 1) then
  12. pUnit:SendChatMessage(12, 0, "Got some spare change?")
  13. elseif(chance == 2) then
  14. pUnit:SendChatMessage(12, 0, "Mind your own business, pal!")
  15. elseif(chance == 3) then
  16. pUnit:SendChatMessage(12, 0, "Are you looking for a fight, you prick?")
  17. elseif(chance == 4) then
  18. pUnit:SendChatMessage(12, 0, "Come over here!")
  19. end
  20. pUnit:RegisterEvent("SaySomethingHerald", math.random(1000, 60000*5), 1) -- send a message every 0-5 minutes
  21. end
  22.  
  23. function CreatureDieda(pUnit, Event)
  24. pUnit:RemoveEvents()
  25. end
  26.  
  27. RegisterUnitEvent(entryid, 18, "HeraldSpawns")
  28. RegisterUnitEvent(entryid, 4, "CreatureDieda")
Advertisement
Add Comment
Please, Sign In to add comment