ArmsdealerFroptub.lua 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. --[[
  2. Script Name : SpawnScripts/Castleview/ArmsdealerFroptub.lua
  3. Script Purpose : Armsdealer Froptub <Weaponsmith>
  4. Script Author : Dorbin
  5. Script Date : 2022.01.26
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. dofile("SpawnScripts/Generic/GenericWeaponsmithVoiceOvers.lua")
  10. local SwordPickup = 5455
  11. local EtchingTool = 5457
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  14. ProvidesQuest(NPC, EtchingTool)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange(NPC, Spawn)
  20. if not HasCompletedQuest (Spawn, EtchingTool) and not HasQuest (Spawn, EtchingTool) then
  21. if MakeRandomInt(1, 100) <= 70 and GetFactionAmount(Spawn,11) >0 then
  22. local choice = math.random(1,2)
  23. if choice == 1 then
  24. FaceTarget(NPC,Spawn)
  25. PlayFlavor(NPC, "voiceover/english/armsdealer_froptub/qey_village04/100_armsdealer_froptub_multhail1_14614e12.mp3", "Graciously accept my pardon for I am a quite the bit busy. Mayhaps I couldst speak with thee anon?", "beckon", 1509622466, 1792291092, Spawn)
  26. elseif choice == 2 then
  27. FaceTarget(NPC,Spawn)
  28. PlayFlavor(NPC, "voiceover/english/armsdealer_froptub/qey_village04/100_armsdealer_froptub_callout_4ecd2c86.mp3","Wherefore art that apprentice of mine?", "frustrated", 4063074411, 1155187226, Spawn)
  29. end
  30. end
  31. else
  32. if MakeRandomInt(1, 100) <= 70 then
  33. GenericWeaponsmithHail(NPC, Spawn, "good")
  34. end
  35. end
  36. end
  37. function hailed(NPC, Spawn)
  38. if GetFactionAmount(Spawn,11) <0 then
  39. FactionChecking(NPC, Spawn, faction)
  40. else
  41. FaceTarget(NPC, Spawn)
  42. Dialog.New(NPC, Spawn)
  43. Dialog.AddDialog("Welcome to my shop adventurer! My orders seem to be backing up, but I can help you out if you are looking to make a quick purchase!")
  44. Dialog.AddVoiceover("voiceover/english/armsdealer_froptub/qey_village04/armsdealerfroptub.mp3", 293364037, 660411644)
  45. PlayFlavor(NPC, "", "", "happy", 0, 0, Spawn)
  46. if GetQuestStep(Spawn, SwordPickup) == 1 then
  47. Dialog.AddOption("I'm here to see about the sword for Aadalian.", "OrderUp")
  48. end
  49. if not HasCompletedQuest (Spawn, EtchingTool) and not HasQuest (Spawn, EtchingTool) then
  50. Dialog.AddOption("Why are your orders backing up?", "Frustrated")
  51. end
  52. if GetQuestStep (Spawn, EtchingTool)==2 then
  53. Dialog.AddOption("I have your etching tool. Your apprentice seemed to have dozed off.'.", "Delivery3")
  54. end
  55. Dialog.AddOption("I'm just browsing. Thank you.")
  56. Dialog.Start()
  57. end
  58. end
  59. function OrderUp(NPC, Spawn)
  60. FaceTarget(NPC, Spawn)
  61. Dialog.New(NPC, Spawn)
  62. Dialog.AddDialog("Froooaak! Yes, I etched the mark he wished into the blade. I'm not much for ornamental marks. I prefer leaving the weapons I make in their pure form -- one that calls to mind that the weapon is only an extension of the wielder's ability.")
  63. Dialog.AddVoiceover("voiceover/english/armsdealer_froptub/qey_village04/armsdealerfroptub004.mp3",1054889156, 2742619000)
  64. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  65. Dialog.AddOption("Understandable. May I take the sword to him?", "Delivery")
  66. Dialog.Start()
  67. end
  68. function Delivery(NPC, Spawn)
  69. SetStepComplete(Spawn, SwordPickup, 1)
  70. FaceTarget(NPC, Spawn)
  71. Dialog.New(NPC, Spawn)
  72. Dialog.AddDialog("I don't see why not. Here it is ... I hope he is pleased with the work. Though I understand the elven smiths are surpassed by none in this craft; he did come to me. I can only assume that he specifically wanted my craftsmanship. ")
  73. Dialog.AddVoiceover("voiceover/english/armsdealer_froptub/qey_village04/armsdealerfroptub005.mp3",2831616586, 2870409180)
  74. PlayFlavor(NPC, "", "", "shrug", 0,0 , Spawn)
  75. Dialog.AddOption("I am certain it will be fine.")
  76. Dialog.Start()
  77. end
  78. function Frustrated(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. Dialog.AddDialog("Alack! The high elves within this village all wisheth special symbols etched into their blades. The problem is I broketh mine etching tool from overuse and mine lazy apprentice, Boggi, hath not returned with mine new tool. If thou hath time, couldst thou findeth him and tell him to get back here right away?")
  82. Dialog.AddVoiceover("voiceover/english/armsdealer_froptub/qey_village04/armsdealerfroptub000.mp3",3893983417, 1741346046)
  83. PlayFlavor(NPC, "", "", "pout", 0,0 , Spawn)
  84. Dialog.AddOption("I`m not too busy at the moment. I`ll see if I can find him for you.", "Boggi")
  85. Dialog.AddOption("Best of luck with all that.")
  86. Dialog.Start()
  87. end
  88. function Delivery3(NPC, Spawn)
  89. SetStepComplete(Spawn,EtchingTool , 2)
  90. FaceTarget(NPC, Spawn)
  91. Dialog.New(NPC, Spawn)
  92. Dialog.AddDialog("Great! Now I canst complete these orders. Prithee, accept these meager coins in payment for thine effort.")
  93. Dialog.AddVoiceover("voiceover/english/armsdealer_froptub/qey_village04/armsdealerfroptub002.mp3",3509055396, 574937181)
  94. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  95. Dialog.AddOption("Thank you for the payment. If I ever need a new weapon I know where to come.")
  96. Dialog.Start()
  97. end
  98. function Boggi(NPC, Spawn, Quest)
  99. FaceTarget(NPC, Spawn)
  100. OfferQuest(NPC, Spawn, EtchingTool)
  101. end
  102. function Delivery2(NPC, Spawn)
  103. SetStepComplete(Spawn, SwordPickup, 1)
  104. end
  105. function Completed(NPC, Spawn)
  106. SetStepComplete(Spawn,EtchingTool , 2)
  107. PlayFlavor(NPC, "voiceover/english/armsdealer_froptub/qey_village04/armsdealerfroptub003.mp3", "Tis good having people such as thou in Qeynos. Thou help'th make this city great.", "thank", 3747286321, 1439596688, Spawn)
  108. end