doggone_it.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. PlayAnimation(NPC, 12236)
  23. AddConversationOption(conversation, "Well Okay.")
  24. StartConversation(conversation, QuestGiver, Player, "If they come back, you know where you'll find me -- up in this tree!")
  25. end
  26. end
  27. end
  28. function Declined(Quest, QuestGiver, Player)
  29. end
  30. function step1_complete_killedMoraks(Quest, QuestGiver, Player)
  31. UpdateQuestStepDescription(Quest, 1, "I've removed the Morak devourer menace.")
  32. 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)
  33. AddQuestStepCompleteAction(Quest, 2, "step2_complete_talkedToScout")
  34. end
  35. function step2_complete_talkedToScout(Quest, QuestGiver, Player)
  36. UpdateQuestStepDescription(Quest, 2, "I've spoken with the Qeynosian scout.")
  37. UpdateQuestTaskGroupDescription(Quest, 1, "I've helped the Qeynosian scout by clearing out the Moraks.")
  38. numMoraks = math.random(4, 6)
  39. 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)
  40. 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)
  41. 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)
  42. AddQuestStepCompleteAction(Quest, 3, "step3_complete_exploredVillage")
  43. AddQuestStepCompleteAction(Quest, 4, "step4_complete_exploredHill")
  44. AddQuestStepCompleteAction(Quest, 5, "step5_complete_killedMoraks")
  45. end
  46. function step3_complete_exploredVillage(Quest, QuestGiver, Player)
  47. UpdateQuestStepDescription(Quest, 3, "Explored the Abandoned Village.")
  48. if QuestIsComplete(Player, DoggoneIt) then
  49. multiple_steps_complete(Quest, QuestGiver, Player)
  50. end
  51. end
  52. function step4_complete_exploredHill(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 4, "Explored Sapswill Hill.")
  54. if QuestIsComplete(Player, DoggoneIt) then
  55. multiple_steps_complete(Quest, QuestGiver, Player)
  56. end
  57. end
  58. function step5_complete_killedMoraks(Quest, QuestGiver, Player)
  59. UpdateQuestStepDescription(Quest, 5, "Cleared away more Moraks.")
  60. if QuestIsComplete(Player, DoggoneIt) then
  61. multiple_steps_complete(Quest, QuestGiver, Player)
  62. end
  63. end
  64. function multiple_steps_complete(Quest, QuestGiver, Player)
  65. UpdateQuestTaskGroupDescription(Quest, 2, "I've done a bit of scouting ahead and find that this area is teeming with Moraks.")
  66. 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)
  67. AddQuestStepCompleteAction(Quest, 6, "step6_complete_talkedToScout")
  68. end
  69. function step6_complete_talkedToScout(Quest, QuestGiver, Player)
  70. UpdateQuestStepDescription(Quest, 6, "I've delivered the bad news to the Qeynosian scout.")
  71. UpdateQuestTaskGroupDescription(Quest, 3, "I've delivered the bad news to the Qeynosian scout.")
  72. 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)
  73. AddQuestStepCompleteAction(Quest, 7, "quest_complete")
  74. end
  75. function quest_complete(Quest, QuestGiver, Player)
  76. 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.")
  77. GiveQuestReward(Quest, Player)
  78. end
  79. function Reload(Quest, QuestGiver, Player, Step)
  80. if Step == 1 then
  81. step1_complete_killedMoraks(Quest, QuestGiver, Player)
  82. elseif Step == 2 then
  83. step2_complete_talkedToScout(Quest, QuestGiver, Player)
  84. elseif Step == 3 then
  85. step3_complete_exploredVillage(Quest, QuestGiver, Player)
  86. elseif Step == 4 then
  87. step4_complete_exploredHill(Quest, QuestGiver, Player)
  88. elseif Step == 5 then
  89. step5_complete_killedMoraks(Quest, QuestGiver, Player)
  90. elseif Step == 6 then
  91. step6_complete_talkedToScout(Quest, QuestGiver, Player)
  92. elseif Step == 7 then
  93. quest_complete(Quest, QuestGiver, Player)
  94. end
  95. end