9
3

DigginDiggs.lua 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/DigginDiggs.lua
  3. Script Purpose : Diggin Diggs <Armor and Shields>
  4. Script Author : Dorbin
  5. Script Date : Reconstructed 2022.01.20
  6. Script Notes : Using Dialog Module 2022.08.20
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. -- Quest ID's
  10. local BADGER_PELTS_FOR_DIGGS = 332 -- was 58
  11. local FarSeas_Fifty = 236
  12. local FarSeas_SixtyThree = 237
  13. function spawn(NPC)
  14. ProvidesQuest(NPC, BADGER_PELTS_FOR_DIGGS)
  15. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  16. SetInfoStructString(NPC, "action_state", "metalworking_idle")
  17. end
  18. function respawn(NPC)
  19. spawn(NPC)
  20. end
  21. function InRange(NPC, Spawn)
  22. if GetFactionAmount(Spawn,11) >0 then
  23. if not HasCompletedQuest(Spawn, BADGER_PELTS_FOR_DIGGS) then
  24. if math.random(0, 100) <= 75 then
  25. PlayFlavor(NPC, "voiceover/english/merchant_diggin_diggs/qey_village06/100_merchant_diggin_diggs_callout_5e1e6098.mp3", "Hear ye, hear ye! Digg's Trading Company seeks part-time hunters! Heavy coin handed out!", "", 2413237497, 889891316, Spawn)
  26. end
  27. else
  28. end
  29. end
  30. end
  31. function hailed(NPC, Spawn)
  32. if GetFactionAmount(Spawn,11) <0 then
  33. FaceTarget(NPC, Spawn)
  34. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  35. else
  36. FaceTarget(NPC, Spawn)
  37. Dialog.New(NPC, Spawn)
  38. Dialog.AddDialog("You're looking a might shabby there. You could use some fine armor from Diggs' inventory. I carry only the finest quality and sell at outrageously low, low prices! I live for the community.")
  39. Dialog.AddVoiceover("voiceover/english/merchant_diggin_diggs/qey_village06/merchantdiggindiggs000.mp3", 96188472, 2463646265)
  40. if GetQuestStep(Spawn, FarSeas_SixtyThree) == 4 or GetQuestStep(Spawn, FarSeas_Fifty) == 4 then
  41. Dialog.AddOption("I believed I've finished your requisition order.", "FarseasDone")
  42. end
  43. Dialog.AddOption("I don't need a sales pitch. Got any work?", "GotAnyWork")
  44. Dialog.AddOptionRequirement(REQ_QUEST_DOESNT_HAVE_QUEST, BADGER_PELTS_FOR_DIGGS)
  45. Dialog.AddOptionRequirement(REQ_QUEST_NOT_HAS_COMPLETED_QUEST, BADGER_PELTS_FOR_DIGGS)
  46. Dialog.AddOption("Here is your bundle of badget pelts.", "BundleOfPelts")
  47. Dialog.AddOptionRequirement(REQ_QUEST_ON_STEP, BADGER_PELTS_FOR_DIGGS , 2)
  48. Dialog.AddOption("Oh right, I'm still looking for those pelts!")
  49. Dialog.AddOptionRequirement(REQ_QUEST_HAS_QUEST, BADGER_PELTS_FOR_DIGGS)
  50. Dialog.AddOptionRequirement(REQ_QUEST_BEFORE_STEP, BADGER_PELTS_FOR_DIGGS, 2)
  51. Dialog.AddOption("Sorry. Just passing by.")
  52. Dialog.Start()
  53. end
  54. end
  55. function GotAnyWork(NPC, Spawn)
  56. FaceTarget(NPC, Spawn)
  57. Dialog.New(NPC, Spawn)
  58. Dialog.AddDialog("So, you're a worker with no task, eh? If you're itchin' to fill your pockets with heavy coin, then I have a task for you. Are you interested in hunting?")
  59. Dialog.AddVoiceover("voiceover/english/merchant_diggin_diggs/qey_village06/merchantdiggindiggs001.mp3", 4059634840, 1440996220)
  60. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  61. Dialog.AddOption("I'm interested.", "OfferQuest1")
  62. Dialog.AddOption("I don't have time to hunt.")
  63. Dialog.Start()
  64. end
  65. function OfferQuest1(NPC, Spawn)
  66. FaceTarget(NPC, Spawn)
  67. OfferQuest(NPC, Spawn, BADGER_PELTS_FOR_DIGGS)
  68. end
  69. function BundleOfPelts(NPC, Spawn)
  70. SetStepComplete(Spawn, BADGER_PELTS_FOR_DIGGS, 2)
  71. FaceTarget(NPC, Spawn)
  72. Dialog.New(NPC, Spawn)
  73. Dialog.AddDialog("Fine work ... fine work! I must tell you, I just paid my merchant taxes. 'Fraid the coin ain't as heavy as I promised. Sorry, taxes you know? I speak the truth!")
  74. Dialog.AddVoiceover("voiceover/english/merchant_diggin_diggs/qey_village06/merchantdiggindiggs003.mp3", 2263319370, 3568007530)
  75. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  76. Dialog.AddOption("I guess this is better than nothing.")
  77. Dialog.Start()
  78. end
  79. function FarseasDone(NPC, Spawn)
  80. if GetQuestStep(Spawn, FarSeas_Fifty) == 4 then
  81. SetStepComplete(Spawn, FarSeas_Fifty, 4)
  82. end
  83. if GetQuestStep(Spawn, FarSeas_SixtyThree) == 4 then
  84. SetStepComplete(Spawn, FarSeas_SixtyThree, 4)
  85. end
  86. FaceTarget(NPC, Spawn)
  87. Dialog.New(NPC, Spawn)
  88. Dialog.AddDialog("Grand work! A bit late, but grand none-the-less. These items will soon become fine garments and armor, Diggs Armor. Thank you, huntsman! Here is the payment for your labor.")
  89. Dialog.AddVoiceover("voiceover/english/merchant_diggin_diggs/qey_village06/merchantdiggindiggs004.mp3", 1093156454, 3294248254)
  90. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  91. Dialog.AddOption("I'm glad I could help.")
  92. Dialog.Start()
  93. end
  94. function Dialog8(NPC, Spawn)
  95. FaceTarget(NPC, Spawn)
  96. Dialog.New(NPC, Spawn)
  97. Dialog.AddDialog("Try to make them high quality pelts!")
  98. Dialog.AddOption("Ok.")
  99. Dialog.Start()
  100. end