9
3

the_book_of_the_dead.lua 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. --[[
  2. Quest Template
  3. Script Name : the_book_of_the_dead.lua
  4. Script Purpose : Handles the quest, "The Book of the Dead"
  5. Script Author : Scatman
  6. Script Date : 2009.07.12
  7. Zone : The Graveyard
  8. Quest Giver : Custodian Zaddar Sullissia
  9. Preceded by : Obtaining an Ancient Staff (obtaining_an_ancient_staff.lua)
  10. Followed by : Repairing the Ward (repairing_the_ward.lua)
  11. --]]
  12. function Init(Quest)
  13. AddQuestStepKill(Quest, 1, "I must confront the grave robbers in the Freeport graveyard and hope that one of them has found the Book of the Dead.", 1, 20, "I must find the Book of the Dead within the walls of the Freeport graveyard, starting with the graverobbers.", 2002, 1250093, 1250094, 1250092, 1250096)
  14. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_FoundBook")
  15. end
  16. function Accepted(Quest, QuestGiver, Player)
  17. FaceTarget(QuestGiver, Player)
  18. conversation = CreateConversation()
  19. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/custodian_zaddar_sullissia/fprt_adv02_graveyard/custodian_zaddar079b.mp3", "", "", 2915353095, 1248129975, Player)
  20. AddConversationOption(conversation, "I will return when I have it.")
  21. StartConversation(conversation, QuestGiver, Player, "Excellent. Return to me when you have found it.")
  22. end
  23. function Declined(Quest, QuestGiver, Player)
  24. end
  25. function Step1_Complete_FoundBook(Quest, QuestGiver, Player)
  26. UpdateQuestStepDescription(Quest, 1, "I've obtained the Book of the Dead.")
  27. UpdateQuestTaskGroupDescription(Quest, 1, "I've found the Book of the Dead and must return it to Zaddar.")
  28. -- The Book of the Dead
  29. -- TODO: Display quest reward popup.
  30. if not HasItem(Player, 12141) then
  31. SummonItem(Player, 12141)
  32. end
  33. AddQuestStepChat(Quest, 2, "Take the Book of the Dead to Zaddar.", 1, "I must return this ancient tome to Zaddar quickly.", 0, 1250014)
  34. AddQuestStepCompleteAction(Quest, 2, "QuestComplete")
  35. end
  36. function QuestComplete(Quest, QuestGiver, Player)
  37. -- The Book of the Dead
  38. while HasItem(Player, 12141) do
  39. RemoveItem(Player, 12141)
  40. end
  41. UpdateQuestStepDescription(Quest, 2, "I've given Zaddar the Book of the Dead.")
  42. UpdateQuestTaskGroupDescription(Quest, 2, "I've given the Book of the Dead to Zaddar.")
  43. GiveQuestReward(Quest, Player)
  44. UpdateQuestDescription(Quest, "I've found one of the last known copies of the Book of the Dead and I've returned it to Zaddar as instructed.")
  45. end
  46. function Reload(Quest, QuestGiver, Player, Step)
  47. if Step == 1 then
  48. Step1_Complete_FoundBook(Quest, QuestGiver, Player)
  49. end
  50. end