forest_ruins_volunteer.lua 5.1 KB

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