StewardLoralei.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --[[
  2. Script Name : SpawnScripts/Nettleville/StewardLoralei.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.07.20 05:07:43
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local CalloutTimer = false
  10. function spawn(NPC)
  11. ProvidesQuest(NPC,5763)
  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, "", "", "shakefist", 0, 0, Spawn)
  17. FaceTarget(NPC, Spawn)
  18. elseif GetRace(Spawn)== 9 or GetRace(Spawn)== 11 or GetRace(Spawn) == 19 or GetRace(Spawn) == 11 or GetRace(Spawn) == 10 or GetRace(Spawn) >= 12 or GetRace(Spawn)<= 14 then
  19. if not HasQuest(Spawn,5763) and not HasCompletedQuest(Spawn, 5763) and HasQuest(Spawn, 5762) and not HasCompletedQuest(Spawn, 5762)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 GetRace(Spawn)== 9 or GetRace(Spawn)== 11 or GetRace(Spawn) == 19 or GetRace(Spawn) == 11 or GetRace(Spawn) == 10 or GetRace(Spawn) >= 12 or GetRace(Spawn)<= 14 then
  37. if not HasQuest(Spawn,5763) and not HasCompletedQuest(Spawn, 5763) and not HasQuest(Spawn, 5762) and not HasCompletedQuest(Spawn, 5762) then
  38. FaceTarget(NPC, Spawn)
  39. Dialog.New(NPC, Spawn)
  40. Dialog.AddDialog("Welcome to Qeynos. Your journey here was harsh, but it's behind you now. Relax ... you are among friends.")
  41. Dialog.AddVoiceover("voiceover/english/steward_loralei/qey_village01/steward_loralei001.mp3", 1283138706, 2903739350)
  42. PlayFlavor(NPC,"","","hello",0,0,Spawn)
  43. Dialog.AddOption("Thank you for the welcome.","Dialog1")
  44. Dialog.AddOption("I'll have to continue this conversation a bit later.")
  45. Dialog.Start()
  46. else
  47. Talk(NPC,Spawn)
  48. end
  49. else
  50. Talk(NPC,Spawn)
  51. end
  52. end
  53. function Talk(NPC,Spawn)
  54. FaceTarget(NPC, Spawn)
  55. local choice = MakeRandomInt(1,2)
  56. if choice == 1 then
  57. PlayFlavor(NPC,"voiceover/english/steward_loralei/qey_village01/qst_steward_loralei_callout1_34b39557.mp3","Good day to you, friend. I wish you good luck today!","hello",2416972639,966576334,Spawn)
  58. elseif choice == 2 then
  59. PlayFlavor(NPC,"voiceover/english/steward_loralei/qey_village01/qst_steward_loralei_hail1_7d12d980.mp3","Good day to you, friend. Good luck on your journey.","nod",749070938,2751400419,Spawn)
  60. end
  61. end
  62. function respawn(NPC)
  63. spawn(NPC)
  64. end
  65. function Dialog1(NPC, Spawn)
  66. FaceTarget(NPC, Spawn)
  67. Dialog.New(NPC, Spawn)
  68. Dialog.AddDialog("It's the least I can do. I, too, was a refugee not long ago, until Qeynos offered me a new home. In turn, I now welcome all those rescued from cruel misfortune. I also show new refugees to their houses.")
  69. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  70. Dialog.AddVoiceover("voiceover/english/steward_loralei/qey_village01/steward_loralei002.mp3", 472694717, 329939381)
  71. Dialog.AddOption("House? I'm sorry, but I can't afford a new house.", "Dialog2")
  72. Dialog.Start()
  73. end
  74. function Dialog2(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. Dialog.New(NPC, Spawn)
  77. Dialog.AddDialog("Afford? No, no ... The Queen gave you a house. She would kiss a gnoll before making refugees sleep on the streets! She has set aside a small house for you here in Nettleville. All she asks in return is that you do your part in helping Qeynos prosper.")
  78. Dialog.AddVoiceover("voiceover/english/steward_loralei/qey_village01/steward_loralei003.mp3", 2360050608, 3531314477)
  79. PlayFlavor(NPC,"","","no",0,0,Spawn)
  80. Dialog.AddOption("Thank you! What is Nettleville?", "QuestStart")
  81. Dialog.Start()
  82. end
  83. function QuestStart(NPC,Spawn)
  84. FaceTarget(NPC, Spawn)
  85. OfferQuest(NPC,Spawn,5763)
  86. end