aSapswillvillager133771751.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/aSapswillvillager133771751.lua
  3. Script Purpose : Spawn script for a happy Sapswill villager.
  4. Script Author : Scatman
  5. Script Date : 2009.01.11
  6. Script Notes :
  7. --]]
  8. local ADiplomaticMission = 166
  9. function spawn(NPC)
  10. AddTimer(NPC, 5000, "EmoteLoop")
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function hailed(NPC, Spawn)
  16. if HasQuest(Spawn, ADiplomaticMission) and not QuestStepIsComplete(Spawn, ADiplomaticMission, 5) then
  17. SetStepComplete(Spawn, ADiplomaticMission, 5)
  18. end
  19. FaceTarget(NPC, Spawn)
  20. choice = math.random(1, 3)
  21. if choice == 1 then
  22. Say(NPC, "Get some swill, diplomat! Is good!")
  23. else
  24. Say(NPC, "Dishpan hands? Huh? Oh! Dip-lo-mat! Ha! Funny!")
  25. end
  26. end
  27. function EmoteLoop(NPC)
  28. math.randomseed(os.time())
  29. local choice = math.random(1,2)
  30. if choice == 1 then
  31. PlayAnimation(NPC, 11150)
  32. AddTimer(NPC, 9000, "Idle")
  33. else
  34. PlayAnimation(NPC, 13054)
  35. AddTimer(NPC, 11200, "Idle")
  36. end
  37. end
  38. function Idle(NPC)
  39. PlayAnimation(NPC, 323)
  40. EmoteLoop(NPC)
  41. end