9
3

MasterArcherNightbow.lua 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. --[[
  2. Script Name : SpawnScripts/ElddarGrove/MasterArcherNightbow.lua
  3. Script Purpose : Master Archer Nightbow <Bowyer>
  4. Script Author : Dorbin
  5. Script Date : 2022.05.08
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local arrows = 5521
  10. local deposit = 5523
  11. local Priest1 = 5772
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  14. ProvidesQuest(NPC,deposit)
  15. end
  16. function InRange(NPC,Spawn)
  17. -- if not HasCompletedQuest (Spawn, deposit) and not HasQuest (Spawn, deposit) then
  18. if MakeRandomInt(1, 100) <= 60 and GetFactionAmount(Spawn,11)>0 then
  19. FaceTarget(NPC, Spawn)
  20. choice = math.random(1,2)
  21. if choice == 1 then
  22. PlayFlavor(NPC, "voiceover/english/master_archer_nightbow/qey_elddar/100_merchant_halfelf_nightbow_callout1_f29bf504.mp3", "Welcome to In-Range. How can I oblige you, traveler?", "", 514837561, 1511494370, Spawn)
  23. elseif choice == 2 then
  24. PlayFlavor(NPC, "voiceover/english/master_archer_nightbow/qey_elddar/100_merchant_halfelf_nightbow_multhail2_8e9f4cb0.mp3", "What is it you need, traveler?", "", 4065639405, 4258763812, Spawn)
  25. end
  26. end
  27. end
  28. --end
  29. function hailed(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. if GetFactionAmount(Spawn,11) <0 then
  32. AddPrimaryEntityCommand(NPC,"hail")
  33. choice = MakeRandomInt(1,2)
  34. if choice == 1 then
  35. PlayFlavor(NPC, "voiceover/english/halfelf_eco_evil_1/ft/service/banker/halfelf_banker_service_evil_1_notcitizen_gf_c0c992e7.mp3", "I'm afraid your business is not welcome here. So, please go away!", "shakefist", 2088886924, 3736631596, Spawn)
  36. elseif choice == 2 then
  37. PlayFlavor(NPC, "voiceover/english/halfelf_eco_good_1/ft/service/armorsmith/halfelf_armorsmith_service_good_1_notcitizen_gf_5f06e404.mp3", "Only those who swear alegence with Qeynos can purchase their goods here!", "heckno", 1584866727, 581589457, Spawn)
  38. end
  39. else
  40. FaceTarget(NPC, Spawn)
  41. Dialog.New(NPC, Spawn)
  42. Dialog.AddDialog("Welcome to In-Range. If you need help with anything, just let me know.")
  43. Dialog.AddVoiceover("voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow.mp3", 416492633, 699282975)
  44. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  45. if HasCompletedQuest(Spawn, arrows) and not HasQuest(Spawn,deposit) and not HasCompletedQuest(Spawn, deposit) then
  46. Dialog.AddOption("How is business?", "Delivery")
  47. end
  48. if HasQuest(Spawn,Priest1) and GetQuestStepProgress(Spawn,Priest1,1)==0 then
  49. Dialog.AddOption("I hear you have lately been injured.", "Priest")
  50. end
  51. if GetQuestStep(Spawn,arrows)==1 then
  52. Dialog.AddOption("I'm here to pick up arrows for Patrolman Fanthis.", "Pickup")
  53. end
  54. if GetQuestStep(Spawn,deposit)==2 then
  55. Dialog.AddOption("Here is the receipt for your deposit to the Qeynos Exchange.", "Delivered")
  56. end
  57. Dialog.AddOption("I appreciate it. Thank you.")
  58. Dialog.Start()
  59. end
  60. end
  61. function Pickup(NPC, Spawn)
  62. SetStepComplete(Spawn,arrows, 1)
  63. FaceTarget(NPC, Spawn)
  64. Dialog.New(NPC, Spawn)
  65. Dialog.AddDialog("Perfect! I've actually had these arrows ready for the better part of a week now. I'm surprised he hasn't come by to pick them up earlier. Please do tell Fanthis to be more punctual next time he orders from me.")
  66. Dialog.AddVoiceover("voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow000.mp3", 2435179288, 2250697055)
  67. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  68. Dialog.AddOption("I'll let him know.")
  69. Dialog.Start()
  70. end
  71. function Delivery(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. Dialog.New(NPC, Spawn)
  74. Dialog.AddDialog("You were the one who brought those arrows back to Fanthis, correct? I would never forget a face like yours. If you'd be willing, I need my deposit taken over to the Qeynos Exchange in Qeynos Harbor. If Fanthis trusted you with his errand I'm certain you'll do fine with this one.")
  75. Dialog.AddVoiceover("voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow001.mp3", 3825875299, 2066482180)
  76. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  77. Dialog.AddOption("Sure. I'll head to the Qeynos Exchange for you.", "Delivery2")
  78. Dialog.AddOption("That is too far out of my way. Sorry.")
  79. Dialog.Start()
  80. end
  81. function Delivery2(NPC, Spawn)
  82. FaceTarget(NPC, Spawn)
  83. OfferQuest(NPC, Spawn,deposit)
  84. end
  85. function Delivered(NPC, Spawn)
  86. SetStepComplete(Spawn,deposit, 2)
  87. FaceTarget(NPC, Spawn)
  88. Dialog.New(NPC, Spawn)
  89. Dialog.AddDialog("I hope Grisvane didn't give you any trouble. Sometimes he's a bit gruff with those he doesn't know. Please allow me to pay you for your trouble. Perhaps we will do other business in the future.")
  90. Dialog.AddVoiceover("voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow003.mp3", 1662759058, 2206697138)
  91. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  92. Dialog.AddOption("It was no problem.")
  93. Dialog.Start()
  94. end
  95. function Priest(NPC, Spawn)
  96. FaceTarget(NPC, Spawn)
  97. Dialog.New(NPC, Spawn)
  98. Dialog.AddDialog("Injured? Nonsense! I'm fit as a falchion! Well ... except for this little splinter in my finger here. Smarts like a devil, it does.")
  99. Dialog.AddVoiceover("voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow004.mp3", 777229878, 3203644005)
  100. PlayFlavor(NPC, "", "", "heckno", 0, 0, Spawn)
  101. Dialog.AddOption("Let me see. That doesn't look like a little splinter at all!","Priesta")
  102. Dialog.Start()
  103. end
  104. function Priesta(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. Dialog.New(NPC, Spawn)
  107. Dialog.AddDialog("Oh, it's nothing ... although it wedged itself under the nail pretty good. Happens all the time in my line of work. I tried to get it out myself the other day, and only made things worse. It's starting to look a bit funny. See the green color?")
  108. Dialog.AddVoiceover("voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow006.mp3", 3334031312, 952690457)
  109. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  110. Dialog.AddOption("Madam, your finger is severely infected! Please, let me help you.","Priestb")
  111. Dialog.Start()
  112. end
  113. function Priestb(NPC, Spawn)
  114. FaceTarget(NPC, Spawn)
  115. Dialog.New(NPC, Spawn)
  116. Dialog.AddDialog("Infected? Is it serious? Well, you are an adept, so I guess you would know. Can anything be done?")
  117. Dialog.AddVoiceover("voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow007.mp3", 625347903, 1608099602)
  118. PlayFlavor(NPC, "", "", "confused", 0, 0, Spawn)
  119. Dialog.AddOption("In the name of the gods, I will heal you.","Priestc")
  120. Dialog.Start()
  121. end
  122. function Priestc(NPC, Spawn)
  123. SetStepComplete(Spawn,Priest1,1)
  124. FaceTarget(NPC, Spawn)
  125. Dialog.New(NPC, Spawn)
  126. Dialog.AddDialog("The splinter ... it, it's gone! The nail is whole again! How did you do that? I must show my thanks!")
  127. Dialog.AddVoiceover("voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow008.mp3", 215150336, 479717582)
  128. PlayFlavor(NPC, "", "", "boggle", 0, 0, Spawn)
  129. Dialog.AddOption("You may show your thanks by offering a prayer to the gods. They are the ones who have truly healed you. Good day.")
  130. Dialog.Start()
  131. ApplySpellVisual(NPC,58)
  132. CastSpell(Spawn,53)
  133. end