forest_ruins_volunteer.lua 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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,8270016,8270025)
  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,8270014,8270019)
  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,8270002,8270017)
  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,8270020)
  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,8270037,8270015)
  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,8270006)
  32. AddQuestStepCompleteAction(Quest, 1, "Step6Complete")
  33. end
  34. end
  35. function Accepted(Quest, QuestGiver, Player)
  36. FaceTarget(QuestGiver, Player)
  37. conversation = CreateConversation()
  38. PlayFlavor(QuestGiver, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros003.mp3", "", "salute", 827162019, 3003960469,Player)
  39. AddConversationOption(conversation, "You bet.")
  40. StartConversation(conversation, QuestGiver, Player, "Great! Then go and kill more vermin.")
  41. end
  42. function Declined(Quest, QuestGiver, Player)
  43. end
  44. function Step1Complete(Quest, QuestGiver, Player)
  45. UpdateQuestStepDescription(Quest, 1, " I've slain the badgers.")
  46. CheckProgress(Quest, QuestGiver, Player)
  47. end
  48. function Step2Complete(Quest, QuestGiver, Player)
  49. UpdateQuestStepDescription(Quest, 1, "I've slain the turtles.")
  50. CheckProgress(Quest, QuestGiver, Player)
  51. end
  52. function Step3Complete(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 1, "I've slain the snakes.")
  54. CheckProgress(Quest, QuestGiver, Player)
  55. end
  56. function Step4Complete(Quest, QuestGiver, Player)
  57. UpdateQuestStepDescription(Quest, 1, "I've slain the beetles.")
  58. CheckProgress(Quest, QuestGiver, Player)
  59. end
  60. function Step5Complete(Quest, QuestGiver, Player)
  61. UpdateQuestStepDescription(Quest, 1, "I've slain the spiders.")
  62. CheckProgress(Quest, QuestGiver, Player)
  63. end
  64. function Step6Complete(Quest, QuestGiver, Player)
  65. UpdateQuestStepDescription(Quest, 1, "I've slain six centipedes.")
  66. CheckProgress(Quest, QuestGiver, Player)
  67. end
  68. function CheckProgress(Quest, QuestGiver, Player)
  69. if QuestStepIsComplete(Player, 5486, 1) then
  70. UpdateQuestTaskGroupDescription(Quest, 2, "I've slain many of the local vermin in the area, I should report back to the Sergeant.")
  71. AddQuestStepChat(Quest, 2, "I need to report to Sergeant Uthros.", 1, "I should report back to Sergeant at Arms Uthros.", 11, 1960004,8270030)
  72. AddQuestStepCompleteAction(Quest, 2, "QuestComplete")
  73. end
  74. end
  75. function QuestComplete(Quest, QuestGiver, Player)
  76. UpdateQuestStepDescription(Quest, 2, "I've spoken with the Sergeant.")
  77. UpdateQuestTaskGroupDescription(Quest, 2, "I've spoken with the good Sergeant and was given some provisions for my services.")
  78. UpdateQuestDescription(Quest, "I've hunted a fair amount of local creatures; I'm sure Sergeant Uthros is happy for the help.")
  79. GiveQuestReward(Quest, Player)
  80. end
  81. function Reload(Quest, QuestGiver, Player, Step)
  82. local RandomChoice = MakeRandomInt(1, 6)
  83. if Step == 1 then
  84. if RandomChoice == 1 then
  85. Step1Complete(Quest, QuestGiver, Player)
  86. elseif RandomChoice == 2 then
  87. Step2Complete(Quest, QuestGiver, Player)
  88. elseif RandomChoice == 3 then
  89. Step3Complete(Quest, QuestGiver, Player)
  90. elseif RandomChoice == 4 then
  91. Step4Complete(Quest, QuestGiver, Player)
  92. elseif RandomChoice == 5 then
  93. Step5Complete(Quest, QuestGiver, Player)
  94. elseif RandomChoice == 6 then
  95. Step6Complete(Quest, QuestGiver, Player)
  96. end
  97. elseif Step == 2 then
  98. CheckProgress(Quest, QuestGiver, Player)
  99. end
  100. end