9
3

GanlaDindlenod.lua 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/GanlaDindlenod.lua
  3. Script Purpose : Ganla Dindlenod
  4. Script Author : Dorbin
  5. Script Date : 2022.01.20
  6. Script Notes : Upated using Dialog Module & faction check - 2022.08.20 Dorbin
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Delivery = 5443
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, Delivery)
  13. end
  14. function InRange(NPC, Spawn) --Quest Callout
  15. if GetFactionAmount(Spawn,11) <0 then -- Faction Check
  16. choice = math.random(1,2)
  17. if choice ==1 then
  18. FaceTarget(NPC, Spawn)
  19. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  20. else
  21. FaceTarget(NPC, Spawn)
  22. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  23. end
  24. else
  25. if math.random(1, 100) <= 85 then
  26. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then -- Quest Check
  27. FaceTarget(NPC, Spawn)
  28. PlayFlavor(NPC, "voiceover/english/ganla_dindlenod/qey_village06/100_ganla_dindlenod_callout_4ce3dea4.mp3", "Oh, if only I could make heads or tails of this book. It must be a a recipe for a fine elven pie! Oh, hello traveler! Could you spare a moment?", "confused", 3548248258, 2969193046, Spawn)
  29. else -- POST Quest greeting
  30. choice = math.random(1,2)
  31. if choice ==1 then
  32. FaceTarget(NPC, Spawn)
  33. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  34. else
  35. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  36. end
  37. end
  38. end
  39. end
  40. end
  41. function respawn(NPC)
  42. spawn(NPC)
  43. end
  44. function hailed(NPC, Spawn)
  45. if GetFactionAmount(Spawn,11) <0 then -- Faction Check
  46. choice = math.random(1,2)
  47. if choice ==1 then
  48. FaceTarget(NPC, Spawn)
  49. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  50. else
  51. FaceTarget(NPC, Spawn)
  52. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  53. end
  54. else
  55. FaceTarget(NPC, Spawn)
  56. Dialog.New(NPC, Spawn)
  57. Dialog.AddDialog("What brings you to the fair vale of Baubbleshire? Seeking a bit of merriment among the stouts?")
  58. Dialog.AddVoiceover("voiceover/english/ganla_dindlenod/qey_village06/ganladindlenod000.mp3", 3896153477, 1476133189)
  59. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  60. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  61. Dialog.AddOption("I'm actually asking around for work.", "Book")
  62. end
  63. if GetQuestStep (Spawn, Delivery) == 1 then
  64. Dialog.AddOption("Oh right, I was on my way to Castleview to deliver this book for you. Goodbye!")
  65. end
  66. if GetQuestStep (Spawn, Delivery) == 2 then
  67. Dialog.AddOption("I gave Valean your book. He will return it when he is finished.", "Delivered")
  68. end
  69. Dialog.AddOption("Looking around, mostly. Perhaps for some of that merriment you spoke of.")
  70. Dialog.Start()
  71. end
  72. end
  73. function Book(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. Dialog.New(NPC, Spawn)
  76. Dialog.AddDialog("I can offer you a task. Recently, I procured this book. I believe it is valuable, possibly a recipe for rare fruit pie!")
  77. Dialog.AddVoiceover("voiceover/english/ganla_dindlenod/qey_village06/ganladindlenod001.mp3", 1482635271, 2842583444)
  78. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  79. Dialog.AddOption("Well now I am interested! Where does it need to go?", "PieBook")
  80. Dialog.AddOption("I mispoke. I actually must be going.")
  81. Dialog.Start()
  82. end
  83. function PieBook(NPC, Spawn)
  84. FaceTarget(NPC, Spawn)
  85. Dialog.New(NPC, Spawn)
  86. Dialog.AddDialog("It appears the tattered journal is written in some form of elven-gibberish. You must deliver the book to Innkeeper Valean in Castleview Hamlet. He may be able to decipher the writing.")
  87. Dialog.AddVoiceover("voiceover/english/ganla_dindlenod/qey_village06/ganladindlenod002.mp3", 3973037194, 3834426438)
  88. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  89. Dialog.AddOption("I would be happy to deliver your book. I'll take it to Castleview.", "QuestBegin")
  90. Dialog.AddOption("That is a bit out of the way, and I'm enjoying it here so much already. Sorry!")
  91. Dialog.Start()
  92. end
  93. function QuestBegin (NPC, Spawn)
  94. FaceTarget(NPC, Spawn)
  95. OfferQuest(NPC, Spawn, Delivery)
  96. end
  97. function Delivered(NPC, Spawn)
  98. FaceTarget(NPC, Spawn)
  99. SetStepComplete(Spawn, Delivery, 2)
  100. Dialog.New(NPC, Spawn)
  101. Dialog.AddDialog("Valean is a good man! It was safer giving him the book instead of Yanari. She'd take it and never give it back! She thinks she's the keeper of ALL elven knowledge! Hah! Good day and thank you for your service friend!")
  102. Dialog.AddVoiceover("voiceover/english/ganla_dindlenod/qey_village06/ganladindlenod003.mp3", 1364619617, 3264445365)
  103. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  104. Dialog.AddOption("I'm glad I could help.")
  105. Dialog.Start()
  106. end