GubboChaley.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. --[[
  2. Script Name : SpawnScripts/EnchantedLands/GubboChaley.lua
  3. Script Purpose : Gubbo Chaley
  4. Script Author : Dorbin
  5. Script Date : 2022.05.12
  6. Script Notes : Auto-Generated Conversation from PacketParser Data
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule" -- Required at the start of any dialogue using this setup
  9. local LousyFairies = 117 -- Designates the quest ID for reference later
  10. function spawn(NPC)
  11. ProvidesQuest(NPC, LousyFairies) -- NPC Shows Quest Feather for the ID'd quest.
  12. SetPlayerProximityFunction(NPC, 10, "InRange") -- Setup for NPC Callout alerting player of something within 10 meters (in this case, a quest). New function "InRange" created.
  13. end
  14. function respawn(NPC)
  15. spawn(NPC) -- If NPC dies and respawns this will trigger the spawn function above.
  16. end
  17. function InRange(NPC, Spawn) -- Plays to player if they haven't finished or started the quest
  18. if not HasCompletedQuest(Spawn, LousyFairies) and not HasQuest(Spawn, LousyFairies) then
  19. PlayFlavor(NPC, "voiceover/english/gubbo_chaley/enchanted/halflings/halfling_gubbo_chaley_callout_f7b85d2f.mp3", "Fritz! They killed Fritz! Those lousy fairies killed Fritz!", "", 2757692791, 3745928300, Spawn)
  20. end
  21. end
  22. function hailed(NPC, Spawn) -- Primary Command for all normal dialogue
  23. if not HasCompletedQuest(Spawn, LousyFairies) and not HasQuest(Spawn,LousyFairies) then -- if player has NOT completed nor has the quest - will direct to Dialog1 function
  24. Dialog1(NPC, Spawn)
  25. elseif HasQuest(Spawn,LousyFairies) then -- if player has the quest - directs to Dialog3
  26. Dialog3(NPC, Spawn)
  27. else
  28. Dialog5(NPC, Spawn) -- if player has finished the quest and is not on 2nd step - will driect to Dialog5
  29. end
  30. end
  31. --Starting Quest---------------------------------------- First Hail. ONLY displayed if player hasn't finished and doesn't have the quest
  32. function Dialog1(NPC, Spawn)
  33. FaceTarget(NPC, Spawn) -- Forces NPC to face Spawn (player)
  34. Dialog.New(NPC, Spawn) -- Starts a new dialogue from NPC to player
  35. Dialog.AddDialog("Kill them! I want you to kill those lousy, stinking, yellow fairies! You'll do this for me, right? You'll do this for Fritz! ")
  36. Dialog.AddVoiceover("voiceover/english/gubbo_chaley/enchanted/gubbo_chaley/gubbo_chaley001.mp3", 1577103216, 3792943385)
  37. -- Dialog.Emote("scream")
  38. Dialog.AddOption("Sure.", "Dialog2")
  39. Dialog.AddOption("I don't know Fritz. ")
  40. Dialog.Start()
  41. end
  42. function Dialog2(NPC, Spawn)
  43. OfferQuest(NPC, Spawn, LousyFairies)
  44. end
  45. --Finishing Quest--------------------------------------
  46. function Dialog3(NPC, Spawn)
  47. FaceTarget(NPC, Spawn)
  48. Dialog.New(NPC, Spawn)
  49. Dialog.AddDialog("Uh ... so you killed them fairies, yeah?")
  50. Dialog.AddVoiceover("voiceover/english/gubbo_chaley/enchanted/gubbo_chaley/gubbo_chaley004.mp3", 2878548247, 952555633)
  51. if GetQuestStep(Spawn, LousyFairies)==2 then
  52. Dialog.AddOption("Yes.", "Dialog4") -- if player is on the 2nd step of quest - will direct to Dialog4 function and allow finishing the quest.
  53. end
  54. Dialog.AddOption("Working on it.")
  55. Dialog.Start()
  56. end
  57. function Dialog4(NPC, Spawn)
  58. FaceTarget(NPC, Spawn)
  59. Dialog.New(NPC, Spawn)
  60. Dialog.AddDialog("I'm really sorry about that. Turns out, Fritz was just passed out under the docks. Umm ... why don't you take this, and we'll just pretend we never had this little discussion. ")
  61. Dialog.AddVoiceover("voiceover/english/gubbo_chaley/enchanted/gubbo_chaley/gubbo_chaley005.mp3", 2881662034, 1373874040)
  62. Dialog.AddOption("Right.","QuestDone")
  63. Dialog.Start()
  64. end
  65. function QuestDone(NPC,Spawn)
  66. FaceTarget(NPC, Spawn)
  67. SetStepComplete(Spawn, LousyFairies, 2)
  68. end
  69. --Post Quest-------------------------------------------
  70. function Dialog5(NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. Dialog.New(NPC, Spawn)
  73. Dialog.AddDialog("If you see Fritz, would you tell him I'm looking for him?")
  74. Dialog.AddVoiceover("voiceover/english/gubbo_chaley/enchanted/gubbo_chaley/gubbo_chaley006.mp3", 4082962413, 3474255449)
  75. Dialog.AddOption("Sure.")
  76. Dialog.Start()
  77. end