SchmittysSandals.lua 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --[[
  2. Script Name : Quests/ButcherblockMountains/SchmittysSandals
  3. Script Author : jakejp
  4. Script Date : 2018.05.29 10:05:26
  5. Script Purpose :
  6. Zone : ButcherblockMountains
  7. Quest Giver: Schmitty McEricson
  8. Preceded by: None
  9. Followed by:
  10. --]]
  11. require "SpawnScripts/Generic/PlayerHistory"
  12. local SchmittysSandals = 266
  13. function Accepted(Quest, QuestGiver, Player)
  14. FaceTarget(QuestGiver, Player)
  15. conversation = CreateConversation()
  16. AddConversationOption(conversation, "Sounds like a plan! I'll be back soon", "Option6")
  17. StartConversation(conversation, QuestGiver, Player, "Here, let me see that little journal of yours. I'll write down the stuff I'll need and you can go gather it for me. Don't worry, I'll pay your for your time.")
  18. end
  19. function Declined(Quest, QuestGiver, Player)
  20. -- Add dialog here for when the quest is declined
  21. end
  22. function Init(Quest)
  23. AddQuestStepKill(Quest, 1, "Collect several sea slug antennas to use as straps for the sandals.", 4, 100, "Schmitty has given me a list of various animal parts he needs in order to create a new pair of sandals to replace the ones he lost.", 2119, 1080003, 1080181, 1081050)
  24. AddQuestStepKill(Quest, 2, "Bring Schmitty some superb pieces of terratrodder hide.", 3, 100, "Schmitty has given me a list of various animal parts he needs in order to create a new pair of sandals to replace the ones he lost.", 134, 1080061, 1081094)
  25. AddQuestStepKill(Quest, 3, "Collect some sturdy needles from the anemones so Schmitty can fashion them into cleats.", 4, 100, "Schmitty has given me a list of various animal parts he needs in order to create a new pair of sandals to replace the ones he lost.", 112, 1081066, 1080026, 1080060, 1081093)
  26. AddQuestStepCompleteAction(Quest, 1, "SlugKilled")
  27. AddQuestStepCompleteAction(Quest, 2, "TerratrodderKilled")
  28. AddQuestStepCompleteAction(Quest, 3, "AnemoneKilled")
  29. end
  30. function SlugKilled(Quest, QuestGiver, Player)
  31. UpdateQuestStepDescription(Quest, 1, "I've collected several sea slug antennas.")
  32. CheckProgress(Quest, QuestGiver, Player)
  33. end
  34. function TerratrodderKilled(Quest, QuestGiver, Player)
  35. UpdateQuestStepDescription(Quest, 2, "I found some pieces of terratrodder hide.")
  36. CheckProgress(Quest, QuestGiver, Player)
  37. end
  38. function AnemoneKilled(Quest, QuestGiver, Player)
  39. UpdateQuestStepDescription(Quest, 3, "I found a good amount of anemone needles that could be fashioned into cleats.")
  40. CheckProgress(Quest, QuestGiver, Player)
  41. end
  42. function CheckProgress(Quest, QuestGiver, Player)
  43. if QuestStepIsComplete(Player, SchmittysSandals, 1) and QuestStepIsComplete(Player, SchmittysSandals, 2) and QuestStepIsComplete(Player, SchmittysSandals, 3) then
  44. NextStep(Quest, QuestGiver, Player)
  45. end
  46. end
  47. function NextStep(Quest, QuestGiver, Player)
  48. UpdateQuestTaskGroupDescription(Quest, 1, "I have collected the various animal parts Schmitty requested.")
  49. AddQuestStepChat(Quest, 4, "I need to speak with Schmitty.", 1, "I need to return all the items I collected to Schmitty.", 11, 1080049)
  50. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  51. end
  52. function Step4Complete(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 4, "I have spoken with Schmitty")
  54. UpdateQuestTaskGroupDescription(Quest, 2, "I have returned all the items to Schmitty.")
  55. AddQuestStepChat(Quest, 5, "I should give Schmitty a few minutes to make the sandals.", 1, "I need to give Schmitty a few minutes to make the sandals.", 11, 1080049)
  56. AddQuestStepCompleteAction(Quest, 5, "QuestComplete")
  57. local time = os.time()
  58. SetPlayerHistory(Player, HISTORY.BB_SCHMITTYSANDALS_STEP5_WAIT, time)
  59. end
  60. function QuestComplete(Quest, QuestGiver, Player)
  61. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  62. UpdateQuestStepDescription(Quest, 5, "After waiting a bit, Schmitty gave me a new pair of sandals.")
  63. UpdateQuestTaskGroupDescription(Quest, 3, "After waiting for a little while, Schmitty presented me with my new sandals.")
  64. UpdateQuestDescription(Quest, "It seems as though Schmitty never did lose his sandals. Instead they were simply under a pile of sand. As a token of appreciation, Schmitty gave me the sandals he crafted out of the parts I brought back to him.")
  65. GiveQuestReward(Quest, Player)
  66. end
  67. function Reload(Quest, QuestGiver, Player, Step)
  68. if Step == 1 then
  69. SlugKilled(Quest, QuestGiver, Player)
  70. elseif Step == 2 then
  71. TerratrodderKilled(Quest, QuestGiver, Player)
  72. elseif Step == 3 then
  73. AnemoneKilled(Quest, QuestGiver, Player)
  74. elseif Step == 4 then
  75. Step4Complete(Quest, QuestGiver, Player)
  76. elseif Step == 5 then
  77. QuestComplete(Quest, QuestGiver, Player)
  78. end
  79. end