an_eroded_key.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. --[[
  2. Script Name : Quests/TheCommonlands/an_eroded_key.lua
  3. Script Purpose : Handles the quest, "An Eroded Key"
  4. Script Author : premierio015
  5. Script Date : 02.06.2021
  6. Script Notes : Auto generated with QuestParser.
  7. Zone : Access Quests
  8. Quest Giver : a fallen blackguard
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. function Init(Quest)
  13. AddQuestStepKill(Quest, 1, "I need to kill a Bloodskull messenger", 1, 100, "I need to kill the Bloodskull messenger. He was last seen wandering east of the Val Mar ruins.", 75, 330068)
  14. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  15. end
  16. function Accepted(Quest, QuestGiver, Player)
  17. FaceTarget(QuestGiver, Player)
  18. local conversation = CreateConversation()
  19. AddConversationOption(conversation, "I will do my best")
  20. StartConversation(conversation, QuestGiver, Player, "Kill the Bloodskull messenger and return to me after you have gathered any important information that he was carrying.")
  21. PlayFlavor(NPC, "fallen_blackguard/commonlands/qst_fallen_blackguard003.mp3", "", "threaten", 1636715716, 3439028602, Spawn)
  22. end
  23. function Declined(Quest, QuestGiver, Player)
  24. -- Add dialog here for when the quest is declined
  25. end
  26. function Deleted(Quest, QuestGiver, Player)
  27. -- Remove any quest specific items here when the quest is deleted
  28. end
  29. function Step1Complete(Quest, QuestGiver, Player)
  30. UpdateQuestStepDescription(Quest, 1, "I killed a Bloodskull messenger.")
  31. UpdateQuestTaskGroupDescription(Quest, 1, "I have killed the Bloodskull messenger and discovered a map of different mineral deposits.")
  32. AddQuestStep(Quest, 2, "I must locate the shimmering mineral deposit in the Commonlands around the Bloodskull Valley", 1, 100, "I am searching for a collection of magical mineral deposits.", 1135)
  33. AddQuestStep(Quest, 3, "I must locate the plentiful mineral deposit in the Commonlands around the Bloodskull Valley", 1, 100, "I am searching for a collection of magical mineral deposits.", 1122)
  34. AddQuestStep(Quest, 4, "I must locate the chipped mineral deposit in the Commonlands around the Bloodskull Valley", 1, 100, "I am searching for a collection of magical mineral deposits.", 1136)
  35. AddQuestStep(Quest, 5, "I must locate the glowing mineral deposit in the Commonlands around the Bloodskull Valley", 1, 100, "I am searching for a collection of magical mineral deposits.", 1132)
  36. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  37. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  38. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  39. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  40. end
  41. function Step2Complete(Quest, QuestGiver, Player)
  42. UpdateQuestStepDescription(Quest, 2, "I have collected a piece of ore from the shimmering mineral deposit in the Commonlands.")
  43. CheckProgress(Quest, QuestGiver, Player)
  44. end
  45. function Step3Complete(Quest, QuestGiver, Player)
  46. UpdateQuestStepDescription(Quest, 3, "I have collected a piece of ore from the plentiful mineral deposit in the Commonlands.")
  47. CheckProgress(Quest, QuestGiver, Player)
  48. end
  49. function Step4Complete(Quest, QuestGiver, Player)
  50. UpdateQuestStepDescription(Quest, 4, "I have collected a piece of ore from the chipped mineral deposit in the Commonlands.")
  51. CheckProgress(Quest, QuestGiver, Player)
  52. end
  53. function CheckProgress(Quest, QuestGiver, Player)
  54. if QuestStepIsComplete(Player, 5251, 2) and QuestStepIsComplete(Player, 5251, 3) and QuestStepIsComplete(Player, 5251, 4) and QuestStepIsComplete(Player, 5251, 5) then
  55. UpdateQuestTaskGroupDescription(Quest, 2, "I have collected all the necessary ore from the magical mineral deposits and formed a crystallized key.")
  56. AddQuestStepChat(Quest, 6, "I need to return to the fallen blackguard now. He will be pleased to know I defeated the Bloodskull messenger and discovered what the messenger was looking for.", 1, "I need to return to the fallen blackguard now so that he may know that I retrieved the ore samples.", 1008, 330069)
  57. AddQuestStepCompleteAction(Quest, 6, "QuestComplete")
  58. end
  59. end
  60. function Step5Complete(Quest, QuestGiver, Player)
  61. UpdateQuestStepDescription(Quest, 5, "I have collected a piece of ore from the glowing mineral deposit in the Commonlands.")
  62. CheckProgress(Quest, QuestGiver, Player)
  63. end
  64. function QuestComplete(Quest, QuestGiver, Player)
  65. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  66. UpdateQuestStepDescription(Quest, 6, "I've spoken to the fallen blackguard and fashioned a key that will allow me access to the Bloodskull excavation site.")
  67. UpdateQuestTaskGroupDescription(Quest, 3, "I have spoken to the fallen blackguard.")
  68. UpdateQuestDescription(Quest, "I've completed this quest.")
  69. GiveQuestReward(Quest, Player)
  70. end
  71. function Reload(Quest, QuestGiver, Player, Step)
  72. if Step == 1 then
  73. Step1Complete(Quest, QuestGiver, Player)
  74. elseif Step == 2 then
  75. Step2Complete(Quest, QuestGiver, Player)
  76. elseif Step == 3 then
  77. Step3Complete(Quest, QuestGiver, Player)
  78. elseif Step == 4 then
  79. Step4Complete(Quest, QuestGiver, Player)
  80. elseif Step == 5 then
  81. Step5Complete(Quest, QuestGiver, Player)
  82. elseif Step == 6 then
  83. QuestComplete(Quest, QuestGiver, Player)
  84. end
  85. end