GavinIronforge.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. local Delivery = 5542
  9. function spawn(NPC)
  10. AddTimer(NPC, 5000, "EmoteLoop")
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, Delivery)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function InRange(NPC,Spawn)
  18. if GetFactionAmount(Spawn,11) <0 then
  19. FaceTarget(NPC, Spawn)
  20. choice = math.random(1,2)
  21. if choice == 1 then
  22. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  23. elseif choice == 2 then
  24. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  25. end
  26. else
  27. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  28. if math.random(1, 100) <= 90 then
  29. FaceTarget(NPC, Spawn)
  30. 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)
  31. end
  32. else
  33. if math.random(1, 100) <= 70 then
  34. FaceTarget(NPC, Spawn)
  35. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  36. end
  37. end
  38. end
  39. end
  40. function hailed(NPC, Spawn)
  41. FaceTarget(NPC, Spawn)
  42. if GetFactionAmount(Spawn,11) <0 then
  43. choice = math.random(1,2)
  44. if choice == 1 then
  45. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  46. elseif choice == 2 then
  47. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  48. end
  49. else
  50. PlayFlavor(NPC, "voiceover/english/gavin_ironforge/qey_north/gavinironforge000.mp3", "", "hello", 57706546, 3929365008, Spawn)
  51. local conversation = CreateConversation()
  52. if not HasQuest(Spawn,Delivery) and not HasCompletedQuest(Spawn, Delivery) then
  53. AddConversationOption(conversation, "Is there anything you need doing?", "Delivery1")
  54. end
  55. if GetQuestStep(Spawn,Delivery)==2 then
  56. AddConversationOption(conversation, "Rowena seemed quite pleased with your craftsmanship.", "Delivered")
  57. end
  58. AddConversationOption(conversation, "Just browsing your wares.")
  59. StartConversation(conversation, NPC, Spawn, "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.")
  60. end
  61. end
  62. function Delivery1(NPC,Spawn)
  63. FaceTarget(NPC, Spawn)
  64. PlayFlavor(NPC, "voiceover/english/gavin_ironforge/qey_north/gavinironforge001.mp3", "", "", 3182974274, 1240192562, Spawn)
  65. local conversation = CreateConversation()
  66. AddConversationOption(conversation, "Sure thing. What needs delivering?", "Delivery2")
  67. AddConversationOption(conversation, "Sounds too important for me. I'll leave it for someone else.")
  68. StartConversation(conversation, NPC, Spawn, "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 have any free time. We will both benefit.")
  69. end
  70. function Delivery2(NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. OfferQuest(NPC, Spawn,Delivery)
  73. end
  74. function Delivered(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. PlayFlavor(NPC, "voiceover/english/gavin_ironforge/qey_north/gavinironforge003.mp3", "", "thanks", 1393179376, 3856557471, Spawn)
  77. local conversation = CreateConversation()
  78. AddConversationOption(conversation, "Think nothing of it.", "FinishQuest")
  79. StartConversation(conversation, NPC, Spawn, "You preserve my faith in Qeynos! Qeynos citizens continue to be the most trustworthy citizens in all of Norrath.")
  80. end
  81. function FinishQuest(NPC, Spawn)
  82. FaceTarget(NPC, Spawn)
  83. SetStepComplete(Spawn,Delivery, 2)
  84. end
  85. function EmoteLoop(NPC)
  86. local emoteChoice = MakeRandomInt(1,3)
  87. if emoteChoice == 1 then
  88. -- ponder
  89. PlayAnimation(NPC, 12030)
  90. AddTimer(NPC, MakeRandomInt(15000,18000), "EmoteLoop")
  91. elseif emoteChoice == 2 then
  92. -- sniff
  93. PlayAnimation(NPC, 12329)
  94. AddTimer(NPC, MakeRandomInt(6000,9000), "EmoteLoop")
  95. else
  96. -- tapfoot
  97. PlayAnimation(NPC, 13056)
  98. AddTimer(NPC, MakeRandomInt(15000,18000), "EmoteLoop")
  99. end
  100. end