doggone_it.lua 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. --[[
  2. Script Name : Quests/QueensColony/doggone_it.lua
  3. Script Author : Zcoretri
  4. Script Date : 2015.09.05
  5. Script Purpose : Handles the quest "Doggone It!"
  6. Zone : QueensColony
  7. Quest Giver: a lost scout
  8. Preceded by: None
  9. Followed by: A Diplomatic Mission (a_diplomatic_mission.lua)
  10. --]]
  11. local DoggoneIt = 165
  12. function Init(Quest)
  13. -- Torn Scout Pants
  14. AddQuestStepKill(Quest, 1, "I need to clear out the Morak devourers near the Dead Canyon.", 5, 100, "A Qeynosian Scout has asked me to help him rid the Colony of the ferocious hounds known as Moraks.", 1222, 2530015)
  15. AddQuestStepCompleteAction(Quest, 1, "step1_complete_killedMoraks")
  16. end
  17. function Accepted(Quest, QuestGiver, Player)
  18. if QuestGiver ~= nil then
  19. if GetDistance(Player, QuestGiver) < 30 then
  20. FaceTarget(QuestGiver, Player)
  21. conversation = CreateConversation()
  22. AddConversationOption(conversation, "Well Okay.")
  23. StartConversation(conversation, QuestGiver, Player, "If they come back, you know where you'll find me -- up in this tree!")
  24. end
  25. end
  26. end
  27. function Declined(Quest, QuestGiver, Player)
  28. end
  29. function step1_complete_killedMoraks(Quest, QuestGiver, Player)
  30. UpdateQuestStepDescription(Quest, 1, "I've removed the Morak devourer menace.")
  31. AddQuestStepChat(Quest, 2, "I should tell the lost Qeynosian scout to run while he still can!", 1, "A Qeynosian Scout has asked me to help him rid the Colony of the ferocious hounds known as Moraks.", 0, 2530197)
  32. AddQuestStepCompleteAction(Quest, 2, "step2_complete_talkedToScout")
  33. end
  34. function step2_complete_talkedToScout(Quest, QuestGiver, Player)
  35. UpdateQuestStepDescription(Quest, 2, "I've spoken with the Qeynosian scout.")
  36. UpdateQuestTaskGroupDescription(Quest, 1, "I've helped the Qeynosian scout by clearing out the Moraks.")
  37. numMoraks = math.random(4, 6)
  38. AddQuestStepLocation(Quest, 3, "Explore the Abondoned Village.", 80, "The Qeynosian scout is too terrified of the Morak to continue his mission forward and has asked me to do some unofficial scouting.", 0, 200.33, 0.01, -183.14)
  39. AddQuestStepLocation(Quest, 4, "Explore Sapswill Hill.", 80, "The Qeynosian scout is too terrified of the Morak to continue his mission forward and has asked me to do some unofficial scouting.", 0, 148.54, 5.53, -153.11)
  40. AddQuestStepKill(Quest, 5, "Clear away more Moraks.", numMoraks, 100, "The Qeynosian scout is too terrified of the Morak to continue his mission forward and has asked me to do some unofficial scouting.", 1222, 2530015)
  41. AddQuestStepCompleteAction(Quest, 3, "step3_complete_exploredVillage")
  42. AddQuestStepCompleteAction(Quest, 4, "step4_complete_exploredHill")
  43. AddQuestStepCompleteAction(Quest, 5, "step5_complete_killedMoraks")
  44. end
  45. function step3_complete_exploredVillage(Quest, QuestGiver, Player)
  46. UpdateQuestStepDescription(Quest, 3, "Explored the Abandoned Village.")
  47. if QuestIsComplete(Player, DoggoneIt) then
  48. multiple_steps_complete(Quest, QuestGiver, Player)
  49. end
  50. end
  51. function step4_complete_exploredHill(Quest, QuestGiver, Player)
  52. UpdateQuestStepDescription(Quest, 4, "Explored Sapswill Hill.")
  53. if QuestIsComplete(Player, DoggoneIt) then
  54. multiple_steps_complete(Quest, QuestGiver, Player)
  55. end
  56. end
  57. function step5_complete_killedMoraks(Quest, QuestGiver, Player)
  58. UpdateQuestStepDescription(Quest, 5, "Cleared away more Moraks.")
  59. if QuestIsComplete(Player, DoggoneIt) then
  60. multiple_steps_complete(Quest, QuestGiver, Player)
  61. end
  62. end
  63. function multiple_steps_complete(Quest, QuestGiver, Player)
  64. UpdateQuestTaskGroupDescription(Quest, 2, "I've done a bit of scouting ahead and find that this area is teeming with Moraks.")
  65. AddQuestStepChat(Quest, 6, "Tell the lost Qeynosian scout about the abundant Moraks in the area.", 1, "The lost Qeynosian scout will be dismayed when he hears my report.", 0, 2530197)
  66. AddQuestStepCompleteAction(Quest, 6, "step6_complete_talkedToScout")
  67. end
  68. function step6_complete_talkedToScout(Quest, QuestGiver, Player)
  69. UpdateQuestStepDescription(Quest, 6, "I've delivered the bad news to the Qeynosian scout.")
  70. UpdateQuestTaskGroupDescription(Quest, 3, "I've delivered the bad news to the Qeynosian scout.")
  71. AddQuestStepChat(Quest, 7, "This package must be given to the Sapswill soothsayer at the Last Stand.", 1, "As a diplomatic gesture, I need to take this package to the Sapswill soothsayer.", 0, 2530037)
  72. AddQuestStepCompleteAction(Quest, 7, "quest_complete")
  73. end
  74. function quest_complete(Quest, QuestGiver, Player)
  75. UpdateQuestDescription(Quest, "The lost Qeynosian scout will have a difficult time if his work takes him through the Sapswill Village with any frequency; the place is full of Moraks! Though I cleared a path for him, there are many more Moraks. Hopefully, my new friend will be able to overcome his fears and continue scouting on behalf of Qeynos. To further help him, I played diplomat-in-training and visited the Sapswill soothsayer.")
  76. GiveQuestReward(Quest, Player)
  77. end
  78. function Reload(Quest, QuestGiver, Player, Step)
  79. if Step == 1 then
  80. step1_complete_killedMoraks(Quest, QuestGiver, Player)
  81. elseif Step == 2 then
  82. step2_complete_talkedToScout(Quest, QuestGiver, Player)
  83. elseif Step == 3 then
  84. step3_complete_exploredVillage(Quest, QuestGiver, Player)
  85. elseif Step == 4 then
  86. step4_complete_exploredHill(Quest, QuestGiver, Player)
  87. elseif Step == 5 then
  88. step5_complete_killedMoraks(Quest, QuestGiver, Player)
  89. elseif Step == 6 then
  90. step6_complete_talkedToScout(Quest, QuestGiver, Player)
  91. end
  92. end