required_components.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. --[[
  2. Script Name : Quests/Nettleville/required_components.lua
  3. Script Purpose : Handles the quest, "Required Components"
  4. Script Author : Scatman
  5. Script Date : 2008.09.23
  6. Zone : Nettleville
  7. Quest Giver: Laharn Rahai
  8. Preceded by: Curious Findings (curious_findings.lua)
  9. Followed by: Unfortunate Mistakes (unfortunate_mistakes.lua)
  10. --]]
  11. -- Item ID's
  12. local REACTIVE_KESMITH = 11298
  13. local LITSUTH_BAG = 9088
  14. local SELKIE_MUSHROOM = 12074
  15. -- Quest ID's
  16. local REQUIRED_COMPONENTS = 302
  17. function Init(Quest)
  18. AddQuestStepObtainItem(Quest, 1, "I need to buy Reactive Kesmith. Laharn says that Alchemist Garion Dunam in the scribe shop will sell some.", 1, 100, "I need to acquire Reactive Kesmith some moss scrapings and a Litsuth Bag.", 10, REACTIVE_KESMITH)
  19. AddQuestStepObtainItem(Quest, 2, "I need to buy a Litsuth bag. Laharn says that I can get one from Tailor Ehuraa Rotherham on the west side of Nettleville.", 1, 100, "I need to acquire Reactive Kesmith some moss scrapings and a Litsuth Bag.", 179, LITSUTH_BAG)
  20. AddQuestStepObtainItem(Quest, 3, "I need to collect some Selki Mushrooms. Laharn says they can be found in the ferryway near the Mariner's Bell in western Nettleville.", 4, 100, "I need to acquire Reactive Kesmith some moss scrapings and a Litsuth Bag.", 821, SELKIE_MUSHROOM)
  21. AddQuestStepCompleteAction(Quest, 1, "step1_complete_gotReactive")
  22. AddQuestStepCompleteAction(Quest, 2, "step2_complete_gotBag")
  23. AddQuestStepCompleteAction(Quest, 3, "step3_complete_gotMushrooms")
  24. end
  25. function Accepted(Quest, QuestGiver, Player)
  26. FaceTarget(QuestGiver, Player)
  27. conversation = CreateConversation()
  28. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/spiritist_laharn_rahai/qey_village01/quests/laharn_rahai/laharn_rahai007a.mp3", "", "", 2216928573, 1758019339, Player)
  29. AddConversationOption(conversation, "All right.")
  30. StartConversation(conversation, QuestGiver, Player, "I will prepare the rest of what is necessary.")
  31. end
  32. function Declined(Quest, QuestGiver, Player)
  33. end
  34. function Deleted(Quest, QuestGiver, Player)
  35. end
  36. function step1_complete_gotReactive(Quest, QuestGiver, Player)
  37. UpdateQuestStepDescription(Quest, 1, "I bought the Reactive Kesmith.")
  38. if QuestIsComplete(Player, REQUIRED_COMPONENTS) then
  39. GotAllItems(Quest, QuestGiver, Player)
  40. end
  41. end
  42. function step2_complete_gotBag(Quest, QuestGiver, Player)
  43. UpdateQuestStepDescription(Quest, 2, "I bought a Litsuth Bag.")
  44. if QuestIsComplete(Player, REQUIRED_COMPONENTS) then
  45. GotAllItems(Quest, QuestGiver, Player)
  46. end
  47. end
  48. function step3_complete_gotMushrooms(Quest, QuestGiver, Player)
  49. UpdateQuestStepDescription(Quest, 3, "I have collected some Selki Mushrooms.")
  50. if QuestIsComplete(Player, REQUIRED_COMPONENTS) then
  51. GotAllItems(Quest, QuestGiver, Player)
  52. end
  53. end
  54. function GotAllItems(Quest, QuestGiver, Player)
  55. UpdateQuestTaskGroupDescription(Quest, 1, "I have acquired the needed reagants.")
  56. AddQuestStepChat(Quest, 4, "I need to return to Laharn, near the armor shop.", 1, "I need to bring these reagants to Laharn and discover what the unknown substance is for Lakosha.", 0, 2330049)
  57. AddQuestStepCompleteAction(Quest, 4, "step4_complete_talkedToLaharn")
  58. end
  59. function step4_complete_talkedToLaharn(Quest, QuestGiver, Player)
  60. UpdateQuestStepDescription(Quest, 4, "I have spoken with Laharn.")
  61. AddQuestStepChat(Quest, 5, "I need to speak with Lakosha, on the west side of Nettleville.", 1, "I need to bring these reagants to Laharn and discover what the unknown substance is for Lakosha.", 0, 2330053)
  62. AddQuestStepCompleteAction(Quest, 5, "Quest_Complete")
  63. end
  64. function Quest_Complete(Quest, QuestGiver, Player)
  65. -- Reactive Kesmith
  66. while HasItem(Player, REACTIVE_KESMITH, 1) do
  67. RemoveItem(Player, REACTIVE_KESMITH)
  68. end
  69. -- Litsuth bag
  70. while HasItem(Player, LITSUTH_BAG, 1) do
  71. RemoveItem(Player, LITSUTH_BAG)
  72. end
  73. -- Selki Mushrooms
  74. while HasItem(Player, SELKIE_MUSHROOM, 1) do
  75. RemoveItem(Player, SELKIE_MUSHROOM)
  76. end
  77. UpdateQuestStepDescription(Quest, 5, "I have spoken with Lakosha.")
  78. UpdateQuestTaskGroupDescription(Quest, 2, "I have delivered the reagents and discovered what the unknown substance is.")
  79. UpdateQuestDescription(Quest, "After I collect all of Laharn's needed components he performed his test. It turns out someone seems to be performing the Pa'Rok ceremony, in which one mourns for the dead. Unfortunately, according to Laharn, there are other compounds in the soil that may corrupt the ceremony.")
  80. GiveQuestReward(Quest, Player)
  81. end
  82. function Reload(Quest, QuestGiver, Player, Step)
  83. if Step == 1 then
  84. step1_complete_gotReactive(Quest, QuestGiver, Player)
  85. elseif Step == 2 then
  86. step2_complete_gotBag(Quest, QuestGiver, Player)
  87. elseif Step == 3 then
  88. step3_complete_gotMushrooms(Quest, QuestGiver, Player)
  89. elseif Step == 4 then
  90. step4_complete_talkedToLaharn(Quest, QuestGiver, Player)
  91. end
  92. end