GanlaDindlenod.lua 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 :
  7. --]]
  8. local Delivery = 5443
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC, Delivery)
  12. end
  13. function InRange(NPC, Spawn) --Quest Callout
  14. if math.random(1, 100) <= 75 then
  15. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  16. FaceTarget(NPC, Spawn)
  17. 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?", "confuse", 3548248258, 2969193046, Spawn)
  18. else
  19. choice = math.random(1,2)
  20. if choice ==1 then
  21. FaceTarget(NPC, Spawn)
  22. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  23. else
  24. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  25. end
  26. end
  27. end
  28. end
  29. function respawn(NPC)
  30. spawn(NPC)
  31. end
  32. function hailed(NPC, Spawn)
  33. FaceTarget(NPC, Spawn)
  34. conversation = CreateConversation()
  35. PlayFlavor(NPC, "voiceover/english/ganla_dindlenod/qey_village06/ganladindlenod000.mp3", "", "hello", 3896153477, 1476133189, Spawn)
  36. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  37. AddConversationOption(conversation, "I'm actually asking around for work.", "Book")
  38. end
  39. if GetQuestStep (Spawn, Delivery) == 2 then
  40. AddConversationOption(conversation, "I gave Valean your book. He will return it when he is finished.", "Delivered")
  41. end
  42. AddConversationOption(conversation, "Looking around, mostly. Perhaps for some of that merriment you spoke of.")
  43. StartConversation(conversation, NPC, Spawn, "What brings you to the fair vale of Baubbleshire? Seeking a bit of merriment among the stouts?")
  44. end
  45. function Book(NPC, Spawn)
  46. PlayFlavor(NPC, "voiceover/english/ganla_dindlenod/qey_village06/ganladindlenod001.mp3", "", "agree", 1482635271, 2842583444, Spawn)
  47. conversation = CreateConversation()
  48. AddConversationOption(conversation, "Where does it need to go?", "PieBook")
  49. StartConversation(conversation, NPC, Spawn, "I can offer you a task. Recently I procured this book. Possibly the recipe for a rare FRUIT pie!")
  50. end
  51. function PieBook(NPC, Spawn)
  52. PlayFlavor(NPC, "voiceover/english/ganla_dindlenod/qey_village06/ganladindlenod002.mp3", "", "", 3973037194, 3834426438, Spawn)
  53. conversation = CreateConversation()
  54. AddConversationOption(conversation, "I would be happy to deliver your book. I'll take it to Castleview.", "QuestBegin")
  55. AddConversationOption(conversation, "That is a bit out of the way, and I'm enjoying it here so much already. Sorry!")
  56. StartConversation(conversation, NPC, Spawn, "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.")
  57. end
  58. function QuestBegin (NPC, Spawn)
  59. FaceTarget(NPC, Spawn)
  60. OfferQuest(NPC, Spawn, Delivery)
  61. end
  62. function Delivered(NPC, Spawn)
  63. conversation = CreateConversation()
  64. PlayFlavor(NPC, "voiceover/english/ganla_dindlenod/qey_village06/ganladindlenod003.mp3", "", "", 1364619617, 3264445365, Spawn)
  65. AddConversationOption(conversation, "I'm glad I could help.", "Reward")
  66. StartConversation(conversation, NPC, Spawn, "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!")
  67. end
  68. function Reward(NPC, Spawn)
  69. SetStepComplete(Spawn, Delivery, 2)
  70. end