MasterArcherNightbow.lua 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. local arrows = 5521
  9. local deposit = 5523
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC,deposit)
  13. end
  14. function InRange(NPC,Spawn)
  15. -- if not HasCompletedQuest (Spawn, deposit) and not HasQuest (Spawn, deposit) then
  16. if math.random(1, 100) <= 60 then
  17. FaceTarget(NPC, Spawn)
  18. choice = math.random(1,2)
  19. if choice == 1 then
  20. 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)
  21. elseif choice == 2 then
  22. 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)
  23. end
  24. end
  25. end
  26. --end
  27. function hailed(NPC, Spawn)
  28. FaceTarget(NPC, Spawn)
  29. if GetFactionAmount(Spawn,11) <0 then
  30. AddPrimaryEntityCommand(NPC,"hail")
  31. choice = math.random(1,2)
  32. if choice == 1 then
  33. 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)
  34. elseif choice == 2 then
  35. 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)
  36. end
  37. else
  38. PlayFlavor(NPC, "voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow.mp3", "", "hello", 416492633, 699282975, Spawn)
  39. local conversation = CreateConversation()
  40. if HasCompletedQuest(Spawn, arrows) and not HasQuest(Spawn,deposit) and not HasCompletedQuest(Spawn, deposit) then
  41. AddConversationOption(conversation, "How is business?", "Delivery")
  42. end
  43. if GetQuestStep(Spawn,arrows)==1 then
  44. AddConversationOption(conversation, "I'm here to pick up arrows for Patrolman Fanthis.", "Pickup")
  45. end
  46. if GetQuestStep(Spawn,deposit)==2 then
  47. AddConversationOption(conversation, "Here is the recipt for your deposit to the Qeynos Exchange.", "Delivered")
  48. end
  49. AddConversationOption(conversation, "I appreciate it. Thank you.")
  50. StartConversation(conversation, NPC, Spawn, "Welcome to In-Range. If you need help with anything, just let me know.")
  51. end
  52. end
  53. function Pickup(NPC, Spawn)
  54. FaceTarget(NPC, Spawn)
  55. PlayFlavor(NPC, "voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow000.mp3", "", "nod", 2435179288, 2250697055, Spawn)
  56. local conversation = CreateConversation()
  57. AddConversationOption(conversation, "I'll let him know.", "Pickup2")
  58. StartConversation(conversation, NPC, Spawn, "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.")
  59. end
  60. function Pickup2(NPC, Spawn)
  61. FaceTarget(NPC, Spawn)
  62. SetStepComplete(Spawn,arrows, 1)
  63. end
  64. function Delivery(NPC, Spawn)
  65. FaceTarget(NPC, Spawn)
  66. PlayFlavor(NPC, "voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow001.mp3", "", "ponder", 3825875299, 2066482180, Spawn)
  67. local conversation = CreateConversation()
  68. AddConversationOption(conversation, "Sure. I'll head to the Qeynos Exchange for you.", "Delivery2")
  69. AddConversationOption(conversation, "That is too far out of my way. Sorry.")
  70. StartConversation(conversation, NPC, Spawn, "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.")
  71. end
  72. function Delivery2(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. OfferQuest(NPC, Spawn,deposit)
  75. end
  76. function Delivered(NPC, Spawn)
  77. FaceTarget(NPC, Spawn)
  78. PlayFlavor(NPC, "voiceover/english/master_archer_nightbow/qey_elddar/armsdealernightbow003.mp3", "", "thank", 1662759058, 2206697138, Spawn)
  79. local conversation = CreateConversation()
  80. AddConversationOption(conversation, "It was no problem.", "FinishQuest")
  81. StartConversation(conversation, NPC, Spawn, "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.")
  82. end
  83. function FinishQuest(NPC, Spawn)
  84. FaceTarget(NPC, Spawn)
  85. SetStepComplete(Spawn,deposit, 2)
  86. end