GavinIronforge.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --[[
  2. Script Name : SpawnScripts/NorthQeynos/GavinIronforge.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.04.23 12:04:36
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Delivery = 5542
  10. function spawn(NPC)
  11. AddTimer(NPC, 5000, "EmoteLoop")
  12. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  13. ProvidesQuest(NPC, Delivery)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC,Spawn)
  19. if GetFactionAmount(Spawn,11) <0 then
  20. FaceTarget(NPC, Spawn)
  21. choice = math.random(1,2)
  22. if choice == 1 then
  23. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  24. elseif choice == 2 then
  25. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  26. end
  27. else
  28. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  29. if math.random(1, 100) <= 90 then
  30. FaceTarget(NPC, Spawn)
  31. PlayFlavor(NPC, "voiceover/english/gavin_ironforge/qey_north/100_son_ironforge_gavin_g4_callout1_a27add9d.mp3", "Who enters? You wish to help me? I am very busy today!", "tapfoot", 66670192, 2616890614, Spawn)
  32. end
  33. else
  34. if math.random(1, 100) <= 70 then
  35. FaceTarget(NPC, Spawn)
  36. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  37. end
  38. end
  39. end
  40. end
  41. function hailed(NPC, Spawn)
  42. FaceTarget(NPC, Spawn)
  43. if GetFactionAmount(Spawn,11) <0 then
  44. choice = math.random(1,2)
  45. if choice == 1 then
  46. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  47. elseif choice == 2 then
  48. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  49. end
  50. else
  51. FaceTarget(NPC, Spawn)
  52. Dialog.New(NPC, Spawn)
  53. Dialog.AddDialog("A hail and well met! Welcome to the Jewel Box. I am Gavin Ironforge, an apprentice in this shop. I help Tara with her duties, but we're unusually busy today.")
  54. Dialog.AddVoiceover("voiceover/english/gavin_ironforge/qey_north/gavinironforge000.mp3", 57706546, 3929365008)
  55. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  56. if not HasQuest(Spawn,Delivery) and not HasCompletedQuest(Spawn, Delivery) then
  57. Dialog.AddOption("What is it that you can't get to today?", "Delivery1")
  58. end
  59. if GetQuestStep(Spawn,Delivery)==2 then
  60. Dialog.AddOption("The Temple of Life was most pleased with Tara's etchings.", "Delivered")
  61. end
  62. Dialog.AddOption("Thank you. I'll browse around. ")
  63. Dialog.Start()
  64. end
  65. end
  66. function Delivery1(NPC,Spawn)
  67. FaceTarget(NPC, Spawn)
  68. Dialog.New(NPC, Spawn)
  69. Dialog.AddDialog("I must send a package to the Temple of Life. The priests are eagerly waiting for it. I could use someone to deliver it for me, if you've any free time. We will both benefit!")
  70. Dialog.AddVoiceover("voiceover/english/gavin_ironforge/qey_north/gavinironforge001.mp3", 3182974274, 1240192562)
  71. Dialog.AddOption("If the priests of Rodcet Nife need a delivery, then they'll get one!", "Delivery2")
  72. Dialog.AddOption("Sounds too important for me. I'll leave it for someone else.")
  73. Dialog.Start()
  74. end
  75. function Delivery2(NPC, Spawn)
  76. FaceTarget(NPC, Spawn)
  77. OfferQuest(NPC, Spawn,Delivery)
  78. end
  79. function Delivered(NPC, Spawn)
  80. FaceTarget(NPC, Spawn)
  81. Dialog.New(NPC, Spawn)
  82. Dialog.AddDialog("You preserve my faith in Qeynos. Qeynosians continue to be the most trustworthy citizens in all of Norrath! Thank you!")
  83. Dialog.AddVoiceover("voiceover/english/gavin_ironforge/qey_north/gavinironforge003.mp3", 1393179376, 3856557471)
  84. PlayFlavor(NPC, "", "", "thank", 0, 0, Spawn)
  85. Dialog.AddOption("And thank you for adding a bit more jingle to my coin pouch!", "FinishQuest")
  86. Dialog.Start()
  87. end
  88. function FinishQuest(NPC, Spawn)
  89. FaceTarget(NPC, Spawn)
  90. SetStepComplete(Spawn,Delivery, 2)
  91. end
  92. function EmoteLoop(NPC)
  93. local emoteChoice = MakeRandomInt(1,3)
  94. if emoteChoice == 1 then
  95. -- ponder
  96. PlayAnimation(NPC, 12030)
  97. AddTimer(NPC, MakeRandomInt(15000,18000), "EmoteLoop")
  98. elseif emoteChoice == 2 then
  99. -- sniff
  100. PlayAnimation(NPC, 12329)
  101. AddTimer(NPC, MakeRandomInt(6000,9000), "EmoteLoop")
  102. else
  103. -- tapfoot
  104. PlayAnimation(NPC, 13056)
  105. AddTimer(NPC, MakeRandomInt(15000,18000), "EmoteLoop")
  106. end
  107. end