9
3

finding_the_pages.lua 5.3 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. Scripts Notes : 21.05.2020 by premierio015: MISSING ITEMS IN DB NEEDED FOR FURTHER QUEST STEP COMPLETION
  7. Zone : The Graveyard
  8. Quest Giver: Custodian Zaddar Sullissia
  9. Preceded by: Paying a Visit (paying_a_visit.lua)
  10. Followed by: Testing the Ward (testing_the_ward.lua)
  11. --]]
  12. function Init(Quest)
  13. 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)
  14. 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
  15. 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
  16. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_KilledSkeletons")
  17. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_SearchedTower")
  18. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_SearchedTombs")
  19. end
  20. function Accepted(Quest, QuestGiver, Player)
  21. FaceTarget(QuestGiver, Player)
  22. conversation = CreateConversation()
  23. PlayFlavor(QuestGiver, "", "", "thank", 0, 0, Player)
  24. AddConversationOption(conversation, "I shall return.")
  25. StartConversation(conversation, QuestGiver, Player, "Thank you for your help! Please let me know when you have found them.")
  26. end
  27. function Declined(Quest, QuestGiver, Player)
  28. end
  29. function Step1_Complete_KilledSkeletons(Quest, QuestGiver, Player)
  30. UpdateQuestStepDescription(Quest, 1, "I've found one of the seven missing pieces of parchment.")
  31. if QuestIsComplete(Player, 233) then
  32. FoundAllPages(Quest, QuestGiver, Player)
  33. end
  34. end
  35. function Step2_Complete_SearchedTower(Quest, QuestGiver, Player)
  36. UpdateQuestStepDescription(Quest, 2, "I've found one of the seven missing pieces of parchment.")
  37. -- a tattered piece of paper
  38. while HasItem(Player, 2660) do
  39. RemoveItem(Player, 2660)
  40. end
  41. if QuestIsComplete(Player, 233) then
  42. FoundAllPages(Quest, QuestGiver, Player)
  43. end
  44. end
  45. function Step3_Complete_SearchedTombs(Quest, QuestGiver, Player)
  46. UpdateQuestStepDescription(Quest, 3, "I've found one of the seven missing pieces of parchment.")
  47. -- a tattered piece of paper
  48. while HasItem(Player, 2660) do
  49. RemoveItem(Player, 2660)
  50. end
  51. if QuestIsComplete(Player, 233) then
  52. FoundAllPages(Quest, QuestGiver, Player)
  53. end
  54. end
  55. function FoundAllPages(Quest, QuestGiver, Player)
  56. UpdateQuestTaskGroupDescription(Quest, 1, "I should return to Varacus with the pages I found.")
  57. 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)
  58. AddQuestStepCompleteAction(Quest, 4, "Step4_Complete_SpokeToVaracus")
  59. end
  60. function Step4_Complete_SpokeToVaracus(Quest, QuestGiver, Player)
  61. UpdateQuestStepDescription(Quest, 4, "I have returned to Varacus with the pages.")
  62. UpdateQuestTaskGroupDescription(Quest, 2, "Varacus was like putty in my hands, the fool.")
  63. -- Ethernere Ledger
  64. -- TODO: Display quest reward popup
  65. if not HasItem(Player, 6016) then
  66. SummonItem(Player, 6016)
  67. end
  68. 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)
  69. AddQuestStepCompleteAction(Quest, 5, "QuestComplete")
  70. end
  71. function QuestComplete(Quest, QuestGiver, Player)
  72. -- Ethernere Ledger
  73. while HasItem(Player, 6016) do
  74. RemoveItem(Player, 6016)
  75. end
  76. UpdateQuestStepDescription(Quest, 5, "I've returned to Zaddar and gave him the pieces of parchment.")
  77. UpdateQuestTaskGroupDescription(Quest, 3, "I've returned to Zaddar with the lost documents.")
  78. GiveQuestReward(Quest, Player)
  79. UpdateQuestDescription(Quest, "I was able to track down all seven pieces of parchment and successfully delivered them to Zaddar.")
  80. end
  81. function Reload(Quest, QuestGiver, Player, Step)
  82. if Step == 1 then
  83. Step1_Complete_KilledSkeletons(Quest, QuestGiver, Player)
  84. elseif Step == 2 then
  85. Step2_Complete_SearchedTower(Quest, QuestGiver, Player)
  86. elseif Step == 3 then
  87. Step3_Complete_SearchedTombs(Quest, QuestGiver, Player)
  88. elseif Step == 4 then
  89. Step4_Complete_SpokeToVaracus(Quest, QuestGiver, Player)
  90. end
  91. end