ReturningToTheDisturbance.lua 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. --[[
  2. Script Name : returning_to_the_disturbance.lua
  3. Script Purpose : Handles the quest, "Returning to the Disturbance"
  4. Script Author : Ememjr
  5. Script Date : 5/17/2020
  6. Script Notes :
  7. Zone : Forest Ruins
  8. Quest Giver :
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. function Init(Quest)
  13. Say(Player, "Hello Init")
  14. AddQuestStep(Quest, 1, "I need to return to the strange plants west of the northern end of the ruins and sprinkle some of the dust that Poko made on them.", 1, 100, "I need to return to the strange plants and sprinkle Poko's powder on them to see if they're hiding something.", 11)
  15. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  16. end
  17. function Accepted(Quest, QuestGiver, Player)
  18. Say(Player, "Hello Accepted")
  19. local zone = GetZone(Player)
  20. local NPC1 = GetTempVariable(Player,"spawn1")
  21. local NPC2 = GetTempVariable(Player,"spawn2")
  22. local NPC3 = GetTempVariable(Player,"spawn3")
  23. local NPC4 = GetTempVariable(Player,"spawn4")
  24. local TREE = GetTempVariable(Player,"treespawn")
  25. Despawn(NPC1)
  26. Despawn(NPC2)
  27. Despawn(NPC3)
  28. Despawn(NPC4)
  29. Despawn(TREE)
  30. newspawn1 = SpawnMob(zone, 1960182, true, 1161.29, -21.6585, -741.387, 0)
  31. newspawn2 = SpawnMob(zone, 1960182, true, 1165.24, -21.7587, -738.934, 0)
  32. newspawn3 = SpawnMob(zone, 1960182, true, 1163.75, -21.6419, -744.377, 0)
  33. newspawn4 = SpawnMob(zone, 1960182, true, 1172.83, -22.529, -745.2644, 0)
  34. treespawn = SpawnMob(zone, 1960155, true, 1169.29, -22.0886, -742.247, 0)
  35. SetTempVariable(Player, "spawn1", newspawn1)
  36. SetTempVariable(Player, "spawn2", newspawn2)
  37. SetTempVariable(Player, "spawn3", newspawn3)
  38. SetTempVariable(Player, "spawn4", newspawn4)
  39. SetTempVariable(Player, "treespawn", treespawn)
  40. Say(Player, "Accepted")
  41. -- Add dialog here for when the quest is accepted
  42. end
  43. function NoStepComplete(Quest, QuestGiver, Player)
  44. Say(Player, "Hello No Step Complete")
  45. local zone = GetZone(Spawn)
  46. local NPC1 = GetTempVariable(Player,"spawn1")
  47. local NPC2 = GetTempVariable(Player,"spawn2")
  48. local NPC3 = GetTempVariable(Player,"spawn3")
  49. local NPC4 = GetTempVariable(Player,"spawn4")
  50. local TREE = GetTempVariable(Player,"treespawn")
  51. Despawn(NPC1)
  52. Despawn(NPC2)
  53. Despawn(NPC3)
  54. Despawn(NPC4)
  55. Despawn(TREE)
  56. newspawn1 = SpawnMob(zone, 1960154, true, 1161.29, -21.6585, -741.387, 0)
  57. newspawn2 = SpawnMob(zone, 1960154, true, 1165.24, -21.7587, -738.934, 0)
  58. newspawn3 = SpawnMob(zone, 1960154, true, 1163.75, -21.6419, -744.377, 0)
  59. newspawn4 = SpawnMob(zone, 1960154, true, 1172.83, -22.529, -745.2644, 0)
  60. treespawn = SpawnMob(zone, 1960184, true, 1169.29, -22.0886, -742.247, 0)
  61. SetTempVariable(Player, "spawn1", newspawn1)
  62. SetTempVariable(Player, "spawn2", newspawn2)
  63. SetTempVariable(Player, "spawn3", newspawn3)
  64. SetTempVariable(Player, "spawn4", newspawn4)
  65. SetTempVariable(Player, "treespawn", treespawn)
  66. end
  67. function Declined(Quest, QuestGiver, Player)
  68. -- Add dialog here for when the quest is declined
  69. end
  70. function Deleted(Quest, QuestGiver, Player)
  71. -- Remove any quest specific items here when the quest is deleted
  72. end
  73. function Step1Complete(Quest, QuestGiver, Player)
  74. Say(Player, "Hello Step1 Complete")
  75. UpdateQuestStepDescription(Quest, 1, "I have sprinkled the dust on the plants and revealed a hidden camp.")
  76. AddQuestStep(Quest, 2, "I need to search the camp for any items that would be useful for Germain's investigation.", 1, 100, "I need to return to the strange plants and sprinkle Poko's powder on them to see if they're hiding something.", 11)
  77. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  78. end
  79. function Step2Complete(Quest, QuestGiver, Player)
  80. Say(Player, "Hello Step1 Complete")
  81. UpdateQuestStepDescription(Quest, 2, "I have found a gnollish book within the hidden camp.")
  82. AddQuestStepChat(Quest, 3, "I need to bring what I found to Lieutenant Germain.", 1, "I need to return to the strange plants and sprinkle Poko's powder on them to see if they're hiding something.", 11, 1960005)
  83. AddQuestStepCompleteAction(Quest, 3, "QuestComplete")
  84. end
  85. function QuestComplete(Quest, QuestGiver, Player)
  86. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  87. local zone = GetZone(Spawn)
  88. local NPC1 = GetTempVariable(Player,"spawn1")
  89. local NPC2 = GetTempVariable(Player,"spawn2")
  90. local NPC3 = GetTempVariable(Player,"spawn3")
  91. local NPC4 = GetTempVariable(Player,"spawn4")
  92. local TREE = GetTempVariable(Player,"treespawn")
  93. Despawn(NPC1)
  94. Despawn(NPC2)
  95. Despawn(NPC3)
  96. Despawn(NPC4)
  97. Despawn(TREE)
  98. newspawn1 = SpawnMob(zone, 1960154, true, 1161.29, -21.6585, -741.387, 0)
  99. newspawn2 = SpawnMob(zone, 1960154, true, 1165.24, -21.7587, -738.934, 0)
  100. newspawn3 = SpawnMob(zone, 1960154, true, 1163.75, -21.6419, -744.377, 0)
  101. newspawn4 = SpawnMob(zone, 1960154, true, 1172.83, -22.529, -745.2644, 0)
  102. treespawn = SpawnMob(zone, 1960184, true, 1169.29, -22.0886, -742.247, 0)
  103. SetTempVariable(Player, "spawn1", newspawn1)
  104. SetTempVariable(Player, "spawn2", newspawn2)
  105. SetTempVariable(Player, "spawn3", newspawn3)
  106. SetTempVariable(Player, "spawn4", newspawn4)
  107. SetTempVariable(Player, "treespawn", treespawn)
  108. UpdateQuestStepDescription(Quest, 3, "I have spoken with Lieutenant Germain.")
  109. UpdateQuestTaskGroupDescription(Quest, 1, "I have discovered a hidden encampment.")
  110. UpdateQuestDescription(Quest, "The powder revealed a hidden camp, in it I found clues that I brought to Lieutenant Germain.")
  111. GiveQuestReward(Quest, Player)
  112. end
  113. function Reload(Quest, QuestGiver, Player, Step)
  114. Say(Player, "Hello Reload ")
  115. if Step == 0 then
  116. Say(Player, "Hello Step 0 ")
  117. NoStepComplete(Quest, QuestGiver, Player)
  118. elseif Step == 1 then
  119. Say(Player, "Hello Step 0 ")
  120. Step1Complete(Quest, QuestGiver, Player)
  121. elseif Step == 2 then
  122. Say(Player, "Hello Step 0 ")
  123. Step2Complete(Quest, QuestGiver, Player)
  124. elseif Step == 3 then
  125. Say(Player, "Hello Step 0 ")
  126. QuestComplete(Quest, QuestGiver, Player)
  127. else
  128. Say(Player, "Hello Step ?")
  129. NoStepComplete(Quest, QuestGiver, Player)
  130. end
  131. end