KaldinDeeppockets.lua 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. --[[
  2. Script Name : SpawnScripts/TheBaubbleshire/KaldinDeeppockets.lua
  3. Script Purpose : Kaldin Deeppockets <General Goods>
  4. Script Author : Dorbin
  5. Script Date : 2022.01.09
  6. Script Notes : Updated Dialog Module 2022.08.22 Dorbin
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Delivery = 5444
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, Delivery)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function LeaveRange(NPC, Spawn)
  18. end
  19. function spawn(NPC)
  20. SetPlayerProximityFunction(NPC, 5, "InRange", "LeaveRange")
  21. ProvidesQuest(NPC, Delivery)
  22. end
  23. function InRange(NPC, Spawn) --Quest Callout Flavor
  24. if math.random(1, 100) <= 75 then
  25. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) and GetFactionAmount(Spawn,11) >0 then
  26. choice = math.random(1,2)
  27. if choice ==1 then
  28. PlayFlavor(NPC, "", "", "frustrated", 0, 0, Spawn)
  29. else
  30. PlayFlavor(NPC, "", "", "grumble", 0, 0, Spawn)
  31. end
  32. else
  33. if GetFactionAmount(Spawn,11) >0 then
  34. FaceTarget(NPC, Spawn)
  35. if choice ==1 then
  36. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  37. else
  38. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  39. end
  40. end
  41. end
  42. end
  43. end
  44. function hailed(NPC, Spawn)
  45. FaceTarget(NPC, Spawn)
  46. if GetFactionAmount(Spawn,11) <0 then
  47. PlayFlavor(NPC, "", "", "heckno", 0, 0, Spawn)
  48. else
  49. if CanReceiveQuest(Spawn, Delivery) then
  50. FaceTarget(NPC, Spawn)
  51. Dialog.New(NPC, Spawn)
  52. Dialog.AddDialog("What's all this madness?! Are Deeppockets working for someone else? What's become of us!? Enough of my woes. What's your order? Be quick with it.")
  53. Dialog.AddVoiceover("voiceover/english/barkeep_kaldin_deeppockets/qey_village06/barkeepdeeppockets000.mp3", 107874926, 2254072034)
  54. PlayFlavor(NPC, "", "", "frustrated", 0, 0, Spawn)
  55. Dialog.AddOption("I'm actually looking for work.", "Job1")
  56. Dialog.AddOption("Actually, I'll speak to Bregun about a drink. Thanks.")
  57. Dialog.Start()
  58. elseif not HasCompletedQuest (Spawn, Delivery) and HasQuest (Spawn, Delivery) then
  59. FaceTarget(NPC, Spawn)
  60. Dialog.New(NPC, Spawn)
  61. Dialog.AddDialog("Did Coppershot appreciate our latest batch?")
  62. Dialog.AddVoiceover("voiceover/english/voice_emotes/greetings/greetings_3_1006.mp3", 0, 0)
  63. PlayFlavor(NPC, "","","hello",0,0,Spawn)
  64. Dialog.AddOption("I delievered the lager to Coppershot. He wanted me to give you this old stein.", "Delivered")
  65. Dialog.AddOptionRequirement(REQ_QUEST_ON_STEP, Delivery , 2)
  66. Dialog.AddOption("I'm still heading to Graystone Yard. I'll be back.")
  67. Dialog.AddOptionRequirement(REQ_QUEST_ON_STEP, Delivery , 1)
  68. Dialog.Start()
  69. else
  70. choice = math.random(1,2)
  71. if choice == 1 then
  72. PlayFlavor(NPC, "voiceover/english/barkeep_kaldin_deeppockets/qey_village06/100_barkeep_deeppockets_multhail1_b497dcb7.mp3", "My name is Deeppockets. Pleased to meet you, I am! Perhaps we'll talk again some day!", "", 3221951518, 4136363260, Spawn)
  73. elseif choice == 2 then
  74. PlayFlavor(NPC, "voiceover/english/barkeep_kaldin_deeppockets/qey_village06/100_barkeep_deeppockets_callout_d2d77b95.mp3", "Come over and meet one of the most famous brewmasters in Qeynos!", "", 2446853968, 3962612908, Spawn)
  75. end
  76. end
  77. end
  78. end
  79. function respawn(NPC)
  80. spawn(NPC)
  81. end
  82. function Job1(NPC, Spawn)
  83. FaceTarget(NPC, Spawn)
  84. Dialog.New(NPC, Spawn)
  85. Dialog.AddDialog("Its no shame to be out of work in these tough times. Keep your chin up, friend. In fact, if you're looking to make some coin, I could use your help right now!")
  86. Dialog.AddVoiceover("voiceover/english/barkeep_kaldin_deeppockets/qey_village06/barkeepdeeppockets001.mp3", 635967568, 2169058204)
  87. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  88. Dialog.AddOption("I'll take any job you have.", "Job2")
  89. Dialog.AddOption("Actually, I'll speak to Bregun about a drink. Thanks.")
  90. Dialog.Start()
  91. end
  92. function Job2(NPC, Spawn)
  93. FaceTarget(NPC, Spawn)
  94. Dialog.New(NPC, Spawn)
  95. Dialog.AddDialog("That's the spirit! See this jug of Lendel's Grand Lager? I need someone to deliever it to bartender Coppershot at the Frozen Tundra Tavern in Graystone Yard. Would you take it to him?")
  96. Dialog.AddVoiceover("voiceover/english/barkeep_kaldin_deeppockets/qey_village06/barkeepdeeppockets002.mp3", 273979806, 1884621205)
  97. PlayFlavor(NPC, "", "", "happy", 0, 0, Spawn)
  98. Dialog.AddOption("Sure, sounds like as good of a job as any.", "QuestBegin", "QuestBegin")
  99. Dialog.AddOption("Actually, I'll speak to Bregun about a drink. Thanks.")
  100. Dialog.Start()
  101. end
  102. function QuestBegin (NPC, Spawn)
  103. FaceTarget(NPC, Spawn)
  104. OfferQuest(NPC, Spawn, Delivery)
  105. end
  106. function Delivered(NPC, Spawn)
  107. FaceTarget(NPC, Spawn)
  108. Dialog.New(NPC, Spawn)
  109. Dialog.AddDialog("A stein from the Fool's Gold Tavern?! This is rare, indeed! That ancient tavern disappeared long ago! Oh, this cheers my heart! Here, please accept this coin I promised to you.")
  110. Dialog.AddVoiceover("voiceover/english/barkeep_kaldin_deeppockets/qey_village06/barkeepdeeppockets003.mp3", 1808434879, 1588622317)
  111. PlayFlavor(NPC, "", "", "boggle", 0, 0, Spawn)
  112. Dialog.AddOption("Enjoy the stein! Glad I could help.", "Reward")
  113. Dialog.Start()
  114. end
  115. function Reward(NPC, Spawn)
  116. SetStepComplete(Spawn, Delivery, 2)
  117. end