forest_ruins_volunteer.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. --[[
  2. Script Name : Quests/TheForestRuins/forest_ruins_volunteer.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.03.04 04:03:47
  5. Script Purpose :
  6. Zone : TheForestRuins
  7. Quest Giver:
  8. Preceded by: None
  9. Followed by:
  10. --]]
  11. function Init(Quest)
  12. local RandomChoice = MakeRandomInt(1, 6)
  13. SetQuestFeatherColor(Quest, 3)
  14. SetQuestRepeatable(Quest)
  15. if RandomChoice == 1 then
  16. AddQuestStepKill(Quest, 1, "Hunt badgers.", MakeRandomInt(6, 9), 100, "I'm supposed to reduce the local population of vermin here in the Forest Ruins.", 611, 1960017,1960011)
  17. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  18. elseif RandomChoice == 2 then
  19. AddQuestStepKill(Quest, 1, "Hunt turtles.", MakeRandomInt(6, 9), 100, "I'm supposed to reduce the local population of vermin here in the Forest Ruins.", 611, 1960012,1960009)
  20. AddQuestStepCompleteAction(Quest, 1, "Step2Complete")
  21. elseif RandomChoice == 3 then
  22. AddQuestStepKill(Quest, 1, "Hunt snakes.", MakeRandomInt(6, 7), 100, "I'm supposed to reduce the local population of vermin here in the Forest Ruins.", 611, 1960018,1960122)
  23. AddQuestStepCompleteAction(Quest, 1, "Step3Complete")
  24. elseif RandomChoice == 4 then
  25. AddQuestStepKill(Quest, 1, "Hunt beetles.", MakeRandomInt(6, 9), 100, "I'm supposed to reduce the local population of vermin here in the Forest Ruins.", 611, 1960034)
  26. AddQuestStepCompleteAction(Quest, 1, "Step4Complete")
  27. elseif RandomChoice == 5 then
  28. AddQuestStepKill(Quest, 1, "Hunt spiders.", MakeRandomInt(6, 9), 100, "I'm supposed to reduce the local population of vermin here in the Forest Ruins.", 611, 1960022,1960031,1960033,1960082)
  29. AddQuestStepCompleteAction(Quest, 1, "Step5Complete")
  30. elseif RandomChoice == 6 then
  31. AddQuestStepKill(Quest, 1, "Hunt centipedes.", MakeRandomInt(6, 8), 100, "I'm supposed to reduce the local population of vermin here in the Forest Ruins.", 611, 1960026)
  32. AddQuestStepCompleteAction(Quest, 1, "Step6Complete")
  33. end
  34. end
  35. function Accepted(Quest, QuestGiver, Player)
  36. end
  37. function Declined(Quest, QuestGiver, Player)
  38. end
  39. function Step1Complete(Quest, QuestGiver, Player)
  40. UpdateQuestStepDescription(Quest, 1, " I've slain the badgers.")
  41. CheckProgress(Quest, QuestGiver, Player)
  42. end
  43. function Step2Complete(Quest, QuestGiver, Player)
  44. UpdateQuestStepDescription(Quest, 1, "I've slain the turtles.")
  45. CheckProgress(Quest, QuestGiver, Player)
  46. end
  47. function Step3Complete(Quest, QuestGiver, Player)
  48. UpdateQuestStepDescription(Quest, 1, "I've slain the snakes.")
  49. CheckProgress(Quest, QuestGiver, Player)
  50. end
  51. function Step4Complete(Quest, QuestGiver, Player)
  52. UpdateQuestStepDescription(Quest, 1, "I've slain the beetles.")
  53. CheckProgress(Quest, QuestGiver, Player)
  54. end
  55. function Step5Complete(Quest, QuestGiver, Player)
  56. UpdateQuestStepDescription(Quest, 1, "I've slain the spiders.")
  57. CheckProgress(Quest, QuestGiver, Player)
  58. end
  59. function Step6Complete(Quest, QuestGiver, Player)
  60. UpdateQuestStepDescription(Quest, 1, "I've slain six centipedes.")
  61. CheckProgress(Quest, QuestGiver, Player)
  62. end
  63. function CheckProgress(Quest, QuestGiver, Player)
  64. if QuestStepIsComplete(Player, 5486, 1) then
  65. UpdateQuestTaskGroupDescription(Quest, 2, "I've slain many of the local vermin in the area, I should report back to the Sergeant.")
  66. AddQuestStepChat(Quest, 2, "I need to report to Sergeant Uthros.", 1, "I should report back to Sergeant at Arms Uthros.", 11, 1960004)
  67. AddQuestStepCompleteAction(Quest, 2, "QuestComplete")
  68. end
  69. end
  70. function QuestComplete(Quest, QuestGiver, Player)
  71. UpdateQuestStepDescription(Quest, 2, "I've spoken with the Sergeant.")
  72. UpdateQuestTaskGroupDescription(Quest, 2, "I've spoken with the good Sergeant and was given some provisions for my services.")
  73. UpdateQuestDescription(Quest, "I've hunted a fair amount of local creatures; I'm sure Sergeant Uthros is happy for the help.")
  74. GiveQuestReward(Quest, Player)
  75. end
  76. function Reload(Quest, QuestGiver, Player, Step)
  77. local RandomChoice = MakeRandomInt(1, 6)
  78. if Step == 1 then
  79. if RandomChoice == 1 then
  80. Step1Complete(Quest, QuestGiver, Player)
  81. elseif RandomChoice == 2 then
  82. Step2Complete(Quest, QuestGiver, Player)
  83. elseif RandomChoice == 3 then
  84. Step3Complete(Quest, QuestGiver, Player)
  85. elseif RandomChoice == 4 then
  86. Step4Complete(Quest, QuestGiver, Player)
  87. elseif RandomChoice == 5 then
  88. Step5Complete(Quest, QuestGiver, Player)
  89. elseif RandomChoice == 6 then
  90. Step6Complete(Quest, QuestGiver, Player)
  91. end
  92. elseif Step == 2 then
  93. CheckProgress(Quest, QuestGiver, Player)
  94. end
  95. end