SapswillVillageMusician.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --[[
  2. Script Name : SapswillVillageMusician.lua
  3. Script Purpose : Spawn script for Sapswill musician.
  4. Script Author : Scatman
  5. Script Date : 2009.01.11
  6. Modified Date : 2020.18.04
  7. Modified by : premierio015
  8. Script Notes : Added missing guitar visual effect
  9. --]]
  10. local ADiplomaticMission = 166
  11. function spawn(NPC)
  12. EmoteLoop(NPC)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function hailed(NPC, Spawn)
  18. if HasCompletedQuest(Spawn, ADiplomaticMission) or HasQuest(Spawn, ADiplomaticMission) then
  19. QuestTalk(NPC, Spawn)
  20. else
  21. NormalTalk(NPC, Spawn)
  22. end
  23. end
  24. function EmoteLoop(NPC)
  25. PlayAnimation(NPC, 20839)
  26. AddTimer(NPC, 1000, "EmoteLoop")
  27. end
  28. function NormalTalk(NPC, Spawn)
  29. FaceTarget(NPC, Spawn)
  30. choice = math.random(1, 3)
  31. if choice == 1 then
  32. Say(NPC, "What you mean backwards? Expert I am!")
  33. else
  34. Say(NPC, "Course I know what I'm doing! What you mean backwards?")
  35. end
  36. end
  37. function QuestTalk(NPC, Spawn)
  38. if HasQuest(Spawn, ADiplomaticMission) and not QuestStepIsComplete(Spawn, ADiplomaticMission, 1) then
  39. SetStepComplete(Spawn, ADiplomaticMission, 1)
  40. end
  41. FaceTarget(NPC, Spawn)
  42. choice = math.random(1, 3)
  43. if choice == 1 then
  44. Say(NPC, "I play special tune for diplomats!")
  45. else
  46. Say(NPC, "Happy meeting, diplomat!")
  47. end
  48. end