StewardQuyntar.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. --[[
  2. Script Name : SpawnScripts/Castleview/StewardQuyntar.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.02 07:11:17
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local CalloutTimer = false
  10. function spawn(NPC)
  11. ProvidesQuest(NPC,5765)
  12. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  13. end
  14. function InRange(NPC, Spawn) --Quest Callout
  15. if GetFactionAmount(Spawn,11)<0 then
  16. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  17. FaceTarget(NPC, Spawn)
  18. elseif GetRace(Spawn)== 4 or GetRace(Spawn)== 8 then
  19. if not HasQuest(Spawn,5765) and not HasCompletedQuest(Spawn, 5765)then
  20. Talk(NPC,Spawn)
  21. elseif CalloutTimer == false then
  22. CalloutTimer = true
  23. AddTimer(NPC,90000,"ResetCallout",1,Spawn)
  24. Talk(NPC,Spawn)
  25. end
  26. elseif CalloutTimer == false then
  27. CalloutTimer = true
  28. AddTimer(NPC,90000,"ResetCallout",1,Spawn)
  29. Talk(NPC,Spawn)
  30. end
  31. end
  32. function ResetCallout(NPC,Spawn)
  33. CalloutTimer = false
  34. end
  35. function hailed(NPC, Spawn)
  36. if GetFactionAmount(Spawn,11)<0 then
  37. PlayFlavor(NPC,"","","shakefist",0,0,Spawn)
  38. else
  39. if GetRace(Spawn)== 4 or GetRace(Spawn)== 8 then
  40. if not HasQuest(Spawn,5765) and not HasCompletedQuest(Spawn, 5765)then
  41. FaceTarget(NPC, Spawn)
  42. Dialog.New(NPC, Spawn)
  43. Dialog.AddDialog("Well met, friend. I assume you are a newly arrived refugee, for I've not seen your face. I welcome you to your new home, Qeynos.")
  44. Dialog.AddVoiceover("voiceover/english/steward_quyntar/qey_village04/steward_quyntar001.mp3", 2250914827, 3581344012)
  45. PlayFlavor(NPC,"","","salute",0,0,Spawn)
  46. Dialog.AddOption("And I am glad to be here.", "Dialog1")
  47. Dialog.AddOption("I'll have to continue this conversation a bit later.")
  48. Dialog.Start()
  49. else
  50. Talk(NPC,Spawn)
  51. end
  52. else
  53. Talk(NPC,Spawn)
  54. end
  55. end
  56. end
  57. function Talk(NPC,Spawn)
  58. FaceTarget(NPC, Spawn)
  59. local choice = MakeRandomInt(1,2)
  60. if choice == 1 then
  61. PlayFlavor(NPC,"voiceover/english/steward_quyntar/qey_village04/qst_steward_quyntar_callout1_e7d4a59e.mp3","I trust you find the day to your liking. Safe travels to you.","hello",704563926,296687769,Spawn)
  62. elseif choice == 2 then
  63. PlayFlavor(NPC,"voiceover/english/steward_quyntar/qey_village04/qst_steward_quyntar_hail1_a1370939.mp3","I trust you are enjoying this splendid day. Safe travels to you.","nod",1077432596,453293758,Spawn)
  64. end
  65. end
  66. function respawn(NPC)
  67. spawn(NPC)
  68. end
  69. function Dialog1(NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. Dialog.New(NPC, Spawn)
  72. Dialog.AddDialog("I can only imagine the trials and travails you endured on your journey. Another with less conviction would not have survived. Cast away those horrible memories, for you are among friends. Let me direct you to your new home.")
  73. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  74. Dialog.AddVoiceover("voiceover/english/steward_quyntar/qey_village04/steward_quyntar002.mp3", 1019635355, 1120858185)
  75. Dialog.AddOption("I have just arrived, friend. I do not have a house yet.", "Dialog2")
  76. Dialog.Start()
  77. end
  78. function Dialog2(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. Dialog.AddDialog("You are mistaken. The Queen of Qeynos, Antonia Bayle, provides all refugees with shelter from the elements. You have a house here in Castleview. In turn, she asks that you offer the same kindness to others.")
  82. Dialog.AddVoiceover("voiceover/english/steward_quyntar/qey_village04/steward_quyntar003.mp3", 413619197, 1841471264)
  83. PlayFlavor(NPC,"","","no",0,0,Spawn)
  84. Dialog.AddOption("Then I must thank her. You said this was Castleview. Am I not in Qeynos?", "QuestStart")
  85. Dialog.Start()
  86. end
  87. function QuestStart(NPC,Spawn)
  88. FaceTarget(NPC, Spawn)
  89. OfferQuest(NPC,Spawn,5765)
  90. end