9
3

Barrik.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/Barrik.lua
  3. Script Purpose : Barrik <Weaponsmith>
  4. Script Author : Dorbin
  5. Script Date : 07.03.2022
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 9, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC,5603)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function InRange(NPC, Spawn)
  17. if GetFactionAmount(Spawn,11)<0 then
  18. FaceTarget(NPC, Spawn)
  19. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  20. else
  21. if HasCompletedQuest(Spawn,5603)then
  22. local chance = math.random(0, 100)
  23. if chance <= 50 then
  24. FaceTarget(NPC, Spawn)
  25. PlayFlavor(NPC, "voiceover/english/armsdealer_barrik/qey_village02/100_armsdealer_barrik_multhail1_53e2d8b4.mp3", "Hello there! Will you be needin' a new sword today? I forge the best blades this side of the Tranquil Sea... Bested only by the Ironforge smiths. I've no work for you today, perhaps come back another day.", "hello", 1545023828, 4159512414, Spawn)
  26. end
  27. elseif not HasQuest(Spawn, 5603) and not HasCompletedQuest(Spawn,5603)then
  28. local chance = math.random(0, 100)
  29. if chance <= 80 then
  30. FaceTarget(NPC, Spawn)
  31. PlayFlavor(NPC, "voiceover/english/armsdealer_barrik/qey_village02/100_armsdealer_barrik_callout_e540a2a3.mp3", "Ahh. I'm done with this dagger. And I must say, it looks superb! I must let her know it's done!... Hello traveler! Looking to make some coin?", "brandish", 3456524991, 2748253693, Spawn)
  32. end
  33. end
  34. end
  35. end
  36. function hailed(NPC, Spawn)
  37. FaceTarget(NPC, Spawn)
  38. if GetFactionAmount(Spawn,11)<0 then
  39. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  40. else
  41. Dialog1(NPC, Spawn)
  42. end
  43. end
  44. function Dialog1(NPC, Spawn)
  45. FaceTarget(NPC, Spawn)
  46. Dialog.New(NPC, Spawn)
  47. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  48. Dialog.AddDialog("Hello there! You look like you could use some adventuring tools! Step right up and take a look around.")
  49. Dialog.AddVoiceover("voiceover/english/armsdealer_barrik/qey_village02/armsdealerbarrik000.mp3", 530392014, 3123921025)
  50. if not HasCompletedQuest (Spawn, 5603) and not HasQuest (Spawn, 5603) then
  51. Dialog.AddOption("I'm looking for work. Anything around your shop I can help with?","Dialog2")
  52. end
  53. if GetQuestStep (Spawn, 5603)==2 then
  54. Dialog.AddOption("I delievered the message to Elliasenka. She was quite rude about it!","Delivered")
  55. end
  56. if GetQuestStep (Spawn, 243)==1 then
  57. Dialog.AddOption("Farnsbey is busy and sent me to pick up the new axe he ordered. Here is the coin for it.","Pickup")
  58. end
  59. Dialog.AddOption("I will. Thank you.")
  60. Dialog.Start()
  61. end
  62. function Dialog2(NPC, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. Dialog.New(NPC, Spawn)
  65. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  66. Dialog.AddDialog("Aye, I do! As a matter of fact, I just finished a special order for one of the erudite ladies in Starcrest! If you can deliver her the message that her dagger is ready, I'll add some coin to your purse.")
  67. Dialog.AddVoiceover("voiceover/english/armsdealer_barrik/qey_village02/armsdealerbarrik001.mp3", 1910272247, 405632050)
  68. Dialog.AddOption("I could always use some extra coin.", "QuestBegin")
  69. Dialog.AddOption("Hmm. Perhaps you can find someone else to deliver your message.")
  70. Dialog.Start()
  71. end
  72. function QuestBegin (NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. OfferQuest(NPC, Spawn, 5603)
  75. end
  76. function Delivered(NPC, Spawn)
  77. FaceTarget(NPC, Spawn)
  78. Dialog.New(NPC, Spawn)
  79. SetStepComplete(Spawn, 5603, 2)
  80. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  81. Dialog.AddDialog("Aye, she was rude when she ordered the blade! Heh. It will be a real treat if she graces my shop with her presence again. Anyway, here's the coin I promised you.")
  82. Dialog.AddVoiceover("voiceover/english/armsdealer_barrik/qey_village02/armsdealerbarrik003.mp3", 3828124252, 308902726)
  83. if GetQuestStep (Spawn, 243)==1 then
  84. Dialog.AddOption("Oh, Farnsbey asked me to pick the axe he ordered if it is ready.","Pickup")
  85. end
  86. Dialog.AddOption("Excellent. Thank you.")
  87. Dialog.Start()
  88. end
  89. function Pickup(NPC, Spawn)
  90. FaceTarget(NPC, Spawn)
  91. Dialog.New(NPC, Spawn)
  92. SetStepComplete(Spawn, 243, 1)
  93. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  94. Dialog.AddDialog("Oh I remember Farnsbey. Yes, yes, I've got his axe over here. There ya be. This sack of money feels about right for the cost! Wish him well for me.")
  95. Dialog.AddVoiceover("voiceover/english/armsdealer_barrik/qey_village02/armsdealerbarrik004.mp3", 142083537, 3739068448)
  96. Dialog.AddOption("I will. Thank you.")
  97. Dialog.Start()
  98. end