9
3

finding_the_pages.lua 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. --[[
  2. Script Name : finding_the_pages.lua
  3. Script Purpose : Handles the quest, "Finding the Pages"
  4. Script Author : Scatman
  5. Script Date : 2009.07.11
  6. Zone : The Graveyard
  7. Quest Giver: Custodian Zaddar Sullissia
  8. Preceded by: Paying a Visit (paying_a_visit.lua)
  9. Followed by: Testing the Ward (testing_the_ward.lua)
  10. --]]
  11. function Init(Quest)
  12. AddQuestStepKill(Quest, 1, "I must destroy some of the undead to see if they have any of the pieces of parchment.", 5, 100, "I should search near the ruins of the Tower of Marr. Others pages might have been taken by the local undead. I should also search near the tombs of the fallen Knights of Truth.", 2180, 1250024, 1250028, 1250035, 1250042, 1250080, 1250068, 1250059, 1250021, 1250029, 1250063, 1250057, 1250081, 1250055, 1250043, 1250064, 1250053, 1250036, 1250087, 1250060, 1250041, 1250056, 1250046, 1250052, 1250049, 1250038, 1250091, 1250026, 1250006, 1250016, 1250037, 1250075, 1250012, 1250019, 1250020, 1250017, 1250097, 1250090, 1250079, 1250066, 1250034, 1250031)
  13. AddQuestStepObtainItem(Quest, 2, "I must search the Tower of Marr ruins for one of the pages.", 1, 100, "I should search near the ruins of the Tower of Marr. Others pages might have been taken by the local undead. I should also search near the tombs of the fallen Knights of Truth.", 2180, 2315) -- a tattered piece of paper
  14. AddQuestStepObtainItem(Quest, 3, "I should search beneath the elevated tombs near Zaddar for one of the pages.", 1, 100, "I should search near the ruins of the Tower of Marr. Others pages might have been taken by the local undead. I should also search near the tombs of the fallen Knights of Truth.", 2180, 2315) -- a tattered piece of paper
  15. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_KilledSkeletons")
  16. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_SearchedTower")
  17. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_SearchedTombs")
  18. end
  19. function Accepted(Quest, QuestGiver, Player)
  20. FaceTarget(QuestGiver, Player)
  21. conversation = CreateConversation()
  22. PlayFlavor(QuestGiver, "", "", "thank", 0, 0, Player)
  23. AddConversationOption(conversation, "I shall return.")
  24. StartConversation(conversation, QuestGiver, Player, "Thank you for your help! Please let me know when you have found them.")
  25. end
  26. function Declined(Quest, QuestGiver, Player)
  27. end
  28. function Step1_Complete_KilledSkeletons(Quest, QuestGiver, Player)
  29. UpdateQuestStepDescription(Quest, 1, "I've found one of the seven missing pieces of parchment.")
  30. if QuestIsComplete(Player, 233) then
  31. FoundAllPages(Quest, QuestGiver, Player)
  32. end
  33. end
  34. function Step2_Complete_SearchedTower(Quest, QuestGiver, Player)
  35. UpdateQuestStepDescription(Quest, 2, "I've found one of the seven missing pieces of parchment.")
  36. -- a tattered piece of paper
  37. while HasItem(Player, 2660) do
  38. RemoveItem(Player, 2660)
  39. end
  40. if QuestIsComplete(Player, 233) then
  41. FoundAllPages(Quest, QuestGiver, Player)
  42. end
  43. end
  44. function Step3_Complete_SearchedTombs(Quest, QuestGiver, Player)
  45. UpdateQuestStepDescription(Quest, 3, "I've found one of the seven missing pieces of parchment.")
  46. -- a tattered piece of paper
  47. while HasItem(Player, 2660) do
  48. RemoveItem(Player, 2660)
  49. end
  50. if QuestIsComplete(Player, 233) then
  51. FoundAllPages(Quest, QuestGiver, Player)
  52. end
  53. end
  54. function FoundAllPages(Quest, QuestGiver, Player)
  55. UpdateQuestTaskGroupDescription(Quest, 1, "I should return to Varacus with the pages I found.")
  56. AddQuestStepChat(Quest, 4, "I should return to Varacus and prove that I found the pages.", 1, "Return to Varacus T`Kur and scold him for not looking after the pages.", 0, 1250070)
  57. AddQuestStepCompleteAction(Quest, 4, "Step4_Complete_SpokeToVaracus")
  58. end
  59. function Step4_Complete_SpokeToVaracus(Quest, QuestGiver, Player)
  60. UpdateQuestStepDescription(Quest, 4, "I have returned to Varacus with the pages.")
  61. UpdateQuestTaskGroupDescription(Quest, 2, "Varacus was like putty in my hands, the fool.")
  62. -- Ethernere Ledger
  63. -- TODO: Display quest reward popup
  64. if not HasItem(Player, 6016) then
  65. SummonItem(Player, 6016)
  66. end
  67. AddQuestStepChat(Quest, 5, "I should return to Zaddar with the pages he needs.", 1, "I must return to Zaddar and tell him of my findings.", 0, 1250014)
  68. AddQuestStepCompleteAction(Quest, 5, "QuestComplete")
  69. end
  70. function QuestComplete(Quest, QuestGiver, Player)
  71. -- Ethernere Ledger
  72. while HasItem(Player, 6016) do
  73. RemoveItem(Player, 6016)
  74. end
  75. UpdateQuestStepDescription(Quest, 5, "I've returned to Zaddar and gave him the pieces of parchment.")
  76. UpdateQuestTaskGroupDescription(Quest, 3, "I've returned to Zaddar with the lost documents.")
  77. GiveQuestReward(Quest, Player)
  78. UpdateQuestDescription(Quest, "I was able to track down all seven pieces of parchment and successfully delivered them to Zaddar.")
  79. end
  80. function Reload(Quest, QuestGiver, Player, Step)
  81. if Step == 1 then
  82. Step1_Complete_KilledSkeletons(Quest, QuestGiver, Player)
  83. elseif Step == 2 then
  84. Step2_Complete_SearchedTower(Quest, QuestGiver, Player)
  85. elseif Step == 3 then
  86. Step3_Complete_SearchedTombs(Quest, QuestGiver, Player)
  87. elseif Step == 4 then
  88. Step4_Complete_SpokeToVaracus(Quest, QuestGiver, Player)
  89. end
  90. end