9
3

ambushed.lua 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. --[[
  2. Script Name : Quests/PeatBog/ambushed.lua
  3. Script Purpose : Handles the quest, "Ambushed"
  4. Script Author : Scatman
  5. Script Date : 2009.05.10
  6. Zone : The Peat Bog
  7. Quest Giver: Lieutenant Dawson
  8. Preceded by: Mysterious Machine (mysterious_machine.lua)
  9. Followed by: On the Move (on_the_move.lua)
  10. --]]
  11. function Init(Quest)
  12. AddQuestStep(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.", 0)
  13. AddQuestStep(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.", 0)
  14. AddQuestStep(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.", 0)
  15. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_Site1")
  16. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_Site2")
  17. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_Site3")
  18. end
  19. function Accepted(Quest, QuestGiver, Player)
  20. FaceTarget(QuestGiver, Player)
  21. conversation = CreateConversation()
  22. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson011a.mp3", "", "", 3239354610, 1196418998, Player)
  23. AddConversationOption(conversation, "You're welcome, and thank you.")
  24. StartConversation(conversation, QuestGiver, Player, "Thank you for your help, be safe.")
  25. end
  26. function Declined(Quest, QuestGiver, Player)
  27. end
  28. function Step1_Complete_Site1(Quest, QuestGiver, Player)
  29. UpdateQuestStepDescription(Quest, 1, "I have investigated the ambush site near Two Logs Pond.")
  30. if QuestIsComplete(Player, 217) then
  31. Multiple_Steps_Complete(Quest, QuestGiver, Player)
  32. end
  33. end
  34. function Step2_Complete_Site2(Quest, QuestGiver, Player)
  35. UpdateQuestStepDescription(Quest, 2, "I have investigated the ambush site in the area east of Two Logs Pond.")
  36. if QuestIsComplete(Player, 217) then
  37. Multiple_Steps_Complete(Quest, QuestGiver, Player)
  38. end
  39. end
  40. function Step3_Complete_Site3(Quest, QuestGiver, Player)
  41. UpdateQuestStepDescription(Quest, 3, "I have investigated the ambush site in the southern end of the area east of Two Logs Pond.")
  42. if QuestIsComplete(Player, 217) then
  43. Multiple_Steps_Complete(Quest, QuestGiver, Player)
  44. end
  45. end
  46. function Multiple_Steps_Complete(Quest, QuestGiver, Player)
  47. UpdateQuestTaskGroupDescription(Quest, 1, "I have investigated all three ambush sites.")
  48. -- a gnoll paw
  49. if not HasItem(Player, 1711) then
  50. SummonItem(Player, 1711)
  51. SendMessage(Player, "You receieve [a gnoll paw].", "yellow")
  52. end
  53. 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.", 0, 1980022)
  54. AddQuestStepCompleteAction(Quest, 4, "QuestComplete")
  55. end
  56. function QuestComplete(Quest, QuestGiver, Player)
  57. -- a gnoll paw
  58. while HasItem(Player, 1711) do
  59. RemoveItem(Player, 1711)
  60. end
  61. UpdateQuestDescription(Quest, "I found evidence of gnolls at one of the ambush sites.")
  62. GiveQuestReward(Quest, Player)
  63. end
  64. function Reload(Quest, QuestGiver, Player, Step)
  65. if Step == 1 then
  66. Step1_Complete_Site1(Quest, QuestGiver, Player)
  67. elseif Step == 2 then
  68. Step2_Complete_Site2(Quest, QuestGiver, Player)
  69. elseif Step == 3 then
  70. Step3_Complete_Site3(Quest, QuestGiver, Player)
  71. end
  72. end