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. 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)
  14. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  15. end
  16. function Accepted(Quest, QuestGiver, Player)
  17. local zone = GetZone(Player)
  18. local NPC1 = GetTempVariable(Player,"spawn1")
  19. local NPC2 = GetTempVariable(Player,"spawn2")
  20. local NPC3 = GetTempVariable(Player,"spawn3")
  21. local NPC4 = GetTempVariable(Player,"spawn4")
  22. local TREE = GetTempVariable(Player,"treespawn")
  23. Despawn(NPC1)
  24. Despawn(NPC2)
  25. Despawn(NPC3)
  26. Despawn(NPC4)
  27. Despawn(TREE)
  28. newspawn1 = SpawnMob(zone, 1960182, true, 1161.29, -21.6585, -741.387, 0)
  29. newspawn2 = SpawnMob(zone, 1960182, true, 1165.24, -21.7587, -738.934, 0)
  30. newspawn3 = SpawnMob(zone, 1960182, true, 1163.75, -21.6419, -744.377, 0)
  31. newspawn4 = SpawnMob(zone, 1960182, true, 1172.83, -22.529, -745.2644, 0)
  32. treespawn = SpawnMob(zone, 1960155, true, 1169.29, -22.0886, -742.247, 0)
  33. SetTempVariable(Player, "spawn1", newspawn1)
  34. SetTempVariable(Player, "spawn2", newspawn2)
  35. SetTempVariable(Player, "spawn3", newspawn3)
  36. SetTempVariable(Player, "spawn4", newspawn4)
  37. SetTempVariable(Player, "treespawn", treespawn)
  38. Say(Player, "Accepted")
  39. -- Add dialog here for when the quest is accepted
  40. end
  41. function NoStepComplete(Quest, QuestGiver, Player)
  42. Say(Player, "Hello No Step Complete")
  43. local zone = GetZone(Spawn)
  44. local NPC1 = GetTempVariable(Player,"spawn1")
  45. local NPC2 = GetTempVariable(Player,"spawn2")
  46. local NPC3 = GetTempVariable(Player,"spawn3")
  47. local NPC4 = GetTempVariable(Player,"spawn4")
  48. local TREE = GetTempVariable(Player,"treespawn")
  49. Despawn(NPC1)
  50. Despawn(NPC2)
  51. Despawn(NPC3)
  52. Despawn(NPC4)
  53. Despawn(TREE)
  54. newspawn1 = SpawnMob(zone, 1960154, true, 1161.29, -21.6585, -741.387, 0)
  55. newspawn2 = SpawnMob(zone, 1960154, true, 1165.24, -21.7587, -738.934, 0)
  56. newspawn3 = SpawnMob(zone, 1960154, true, 1163.75, -21.6419, -744.377, 0)
  57. newspawn4 = SpawnMob(zone, 1960154, true, 1172.83, -22.529, -745.2644, 0)
  58. treespawn = SpawnMob(zone, 1960184, true, 1169.29, -22.0886, -742.247, 0)
  59. SetTempVariable(Player, "spawn1", newspawn1)
  60. SetTempVariable(Player, "spawn2", newspawn2)
  61. SetTempVariable(Player, "spawn3", newspawn3)
  62. SetTempVariable(Player, "spawn4", newspawn4)
  63. SetTempVariable(Player, "treespawn", treespawn)
  64. end
  65. function Declined(Quest, QuestGiver, Player)
  66. -- Add dialog here for when the quest is declined
  67. end
  68. function Deleted(Quest, QuestGiver, Player)
  69. -- Remove any quest specific items here when the quest is deleted
  70. end
  71. function Step1Complete(Quest, QuestGiver, Player)
  72. Say(Player, "Hello Step1 Complete")
  73. UpdateQuestStepDescription(Quest, 1, "I have sprinkled the dust on the plants and revealed a hidden camp.")
  74. AddQuestStepSpell(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, "search book")
  75. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  76. end
  77. function Step2Complete(Quest, QuestGiver, Player)
  78. Say(Player, "Hello Step1 Complete")
  79. UpdateQuestStepDescription(Quest, 2, "I have found a gnollish book within the hidden camp.")
  80. GiveQuestItem(Quest, Player, "You found a gnolish book.", 1826)
  81. 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)
  82. AddQuestStepCompleteAction(Quest, 3, "QuestComplete")
  83. end
  84. function QuestComplete(Quest, QuestGiver, Player)
  85. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  86. local zone = GetZone(Spawn)
  87. local NPC1 = GetTempVariable(Player,"spawn1")
  88. local NPC2 = GetTempVariable(Player,"spawn2")
  89. local NPC3 = GetTempVariable(Player,"spawn3")
  90. local NPC4 = GetTempVariable(Player,"spawn4")
  91. local TREE = GetTempVariable(Player,"treespawn")
  92. Despawn(NPC1)
  93. Despawn(NPC2)
  94. Despawn(NPC3)
  95. Despawn(NPC4)
  96. Despawn(TREE)
  97. newspawn1 = SpawnMob(zone, 1960154, true, 1161.29, -21.6585, -741.387, 0)
  98. newspawn2 = SpawnMob(zone, 1960154, true, 1165.24, -21.7587, -738.934, 0)
  99. newspawn3 = SpawnMob(zone, 1960154, true, 1163.75, -21.6419, -744.377, 0)
  100. newspawn4 = SpawnMob(zone, 1960154, true, 1172.83, -22.529, -745.2644, 0)
  101. treespawn = SpawnMob(zone, 1960184, true, 1169.29, -22.0886, -742.247, 0)
  102. SetTempVariable(Player, "spawn1", newspawn1)
  103. SetTempVariable(Player, "spawn2", newspawn2)
  104. SetTempVariable(Player, "spawn3", newspawn3)
  105. SetTempVariable(Player, "spawn4", newspawn4)
  106. SetTempVariable(Player, "treespawn", treespawn)
  107. UpdateQuestStepDescription(Quest, 3, "I have spoken with Lieutenant Germain.")
  108. UpdateQuestTaskGroupDescription(Quest, 1, "I have discovered a hidden encampment.")
  109. UpdateQuestDescription(Quest, "The powder revealed a hidden camp, in it I found clues that I brought to Lieutenant Germain.")
  110. GiveQuestReward(Quest, Player)
  111. end
  112. function Reload(Quest, QuestGiver, Player, Step)
  113. Say(Player, "Hello Reload ")
  114. if Step == 0 then
  115. Say(Player, "Hello Step 0 ")
  116. NoStepComplete(Quest, QuestGiver, Player)
  117. elseif Step == 1 then
  118. Say(Player, "Hello Step 0 ")
  119. Step1Complete(Quest, QuestGiver, Player)
  120. elseif Step == 2 then
  121. Say(Player, "Hello Step 0 ")
  122. Step2Complete(Quest, QuestGiver, Player)
  123. elseif Step == 3 then
  124. Say(Player, "Hello Step 0 ")
  125. QuestComplete(Quest, QuestGiver, Player)
  126. else
  127. Say(Player, "Hello Step ?")
  128. NoStepComplete(Quest, QuestGiver, Player)
  129. end
  130. end