Ambushed.lua 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. --[[
  2. Script Name : Ambushed.lua
  3. Script Purpose : Handles the quest, "Ambushed"
  4. Script Author : Shatou
  5. Script Date : 1/8/2020
  6. Script Notes :
  7. Zone : Peat Bog
  8. Quest Giver : Lieutenant Dawson
  9. Preceded by : Mysterious Machine
  10. Followed by : On The Move
  11. --]]
  12. local LIEUTENANT_DAWSON_ID = 1980012
  13. local ENTITY_COMMAND_INSPECT = 61
  14. local AMBUSHED_QUEST_ID = 509
  15. function Init(Quest)
  16. AddQuestStepSpell(Quest, 1, "I need to investigate the ambush site west of Two Logs Pond, which is south of the sewer grate.", 1, 100, "Lieutenant Dawson has asked me to investigate three ambush sites.", 11, ENTITY_COMMAND_INSPECT)
  17. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  18. AddQuestStepSpell(Quest, 2, "I need to investigate the ambush site in the north eastern corner of the area east of Two Logs Pond.", 1, 100, "Lieutenant Dawson has asked me to investigate three ambush sites.", 11, ENTITY_COMMAND_INSPECT)
  19. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  20. AddQuestStepSpell(Quest, 3, "I need to investigate the ambush site in the south end of the area east of Two Logs Pond.", 1, 100, "Lieutenant Dawson has asked me to investigate three ambush sites.", 11, ENTITY_COMMAND_INSPECT)
  21. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  22. end
  23. function CheckProgress(Quest, QuestGiver, Player)
  24. if QuestStepIsComplete(Player, AMBUSHED_QUEST_ID, 1) and QuestStepIsComplete(Player, AMBUSHED_QUEST_ID, 2) and QuestStepIsComplete(Player, AMBUSHED_QUEST_ID, 3) then
  25. UpdateQuestTaskGroupDescription(Quest, 1, "I have investigated all three ambush sites.")
  26. AddQuestStepChat(Quest, 4, "I need to return to Lieutenant Dawson.", 1, "I need to tell Lieutenant Dawson of what I found at one of the ambush sites.", 11, LIEUTENANT_DAWSON_ID)
  27. AddQuestStepCompleteAction(Quest, 4, "QuestComplete")
  28. end
  29. end
  30. function Step1Complete(Quest, QuestGiver, Player)
  31. UpdateQuestStepDescription(Quest, 1, "I have investigated the ambush site near Two Logs Pond.")
  32. CheckProgress(Quest, QuestGiver, Player)
  33. end
  34. function Step2Complete(Quest, QuestGiver, Player)
  35. UpdateQuestStepDescription(Quest, 2, "I have investigated the ambush site in the area east of Two Logs Pond.")
  36. if not HasItem(Player,1820 )then
  37. GiveQuestItem(Quest, Player,"You found a severed gnoll paw amongst the equipment on the ground.",1820)
  38. end
  39. CheckProgress(Quest, QuestGiver, Player)
  40. end
  41. function Step3Complete(Quest, QuestGiver, Player)
  42. UpdateQuestStepDescription(Quest, 3, "I have investigated the ambush site in the southern end of the area east of Two Logs Pond.")
  43. CheckProgress(Quest, QuestGiver, Player)
  44. end
  45. function QuestComplete(Quest, QuestGiver, Player)
  46. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  47. UpdateQuestStepDescription(Quest, 4, "I have spoken with Lieutenant Dawson.")
  48. UpdateQuestTaskGroupDescription(Quest, 2, "I have spoken with Lieutenant Dawson.")
  49. UpdateQuestDescription(Quest, "I found evidence of gnolls at one of the ambush sites.")
  50. GiveQuestReward(Quest, Player)
  51. end
  52. function Reload(Quest, QuestGiver, Player, Step)
  53. if Step == 1 then
  54. Step1Complete(Quest, QuestGiver, Player)
  55. elseif Step == 2 then
  56. Step2Complete(Quest, QuestGiver, Player)
  57. elseif Step == 3 then
  58. Step3Complete(Quest, QuestGiver, Player)
  59. elseif Step == 4 then
  60. QuestComplete(Quest, QuestGiver, Player)
  61. end
  62. end
  63. function Accepted(Quest, QuestGiver, Player)
  64. -- Add dialog here for when the quest is accepted
  65. end
  66. function Declined(Quest, QuestGiver, Player)
  67. -- Add dialog here for when the quest is declined
  68. end