9
3

meeting_with_cayan.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. --[[
  2. Script Name : Quests/StarcrestCommune/meeting_with_cayan.lua
  3. Script Purpose : Handles the quest, "Meeting with Cayan"
  4. Script Author : Scatman
  5. Script Date : 2008.09.21
  6. Zone : Starcrest Commune
  7. Quest Giver: Maareona Ludimintium
  8. Preceded by: None
  9. Followed by: Information Merchants (information_merchants.lua)
  10. --]]
  11. function Init(Quest)
  12. AddQuestStepChat(Quest, 1, "I need to speak with Cayan Sable, he is in a hiding spot that can be reached by climbing the bench behind the northwestern corner of the armor shop.", 1, "I need to find Cayan Sable and get some needed information from him.", 0, 2340017)
  13. AddQuestStepCompleteAction(Quest, 1, "step1_complete_talkedToCayan")
  14. end
  15. function Accepted(Quest, QuestGiver, Player)
  16. if QuestGiver ~= nil then
  17. if GetDistance(Player, QuestGiver) < 30 then
  18. FaceTarget(QuestGiver, Player)
  19. conversation = CreateConversation()
  20. AddConversationOption(conversation, "I will return once I get the information.")
  21. StartConversation(conversation, QuestGiver, Player, "He will ask a favor of you. He doesn't accept payment in a traditional sense, but he will ask something of you. The more friends he has, and the more people for whom he does favors, who who do favors for him, the more information he can provide. So, please, indulge him.")
  22. end
  23. end
  24. end
  25. function Declined(Quest, QuestGiver, Player)
  26. end
  27. function Deleted(Quest, QuestGiver, Player)
  28. end
  29. function step1_complete_talkedToCayan(Quest, QuestGiver, Player)
  30. UpdateQuestStepDescription(Quest, 1, "I have spoken with Cayan Sable.")
  31. UpdateQuestTaskGroupDescription(Quest, 1, "I have spoken with Cayan Sable.")
  32. -- Red Sun Berries
  33. AddQuestStepHarvest(Quest, 2, "In exchange for his help Cayan Sable requires I help him by collecting Red Sun Berries from the bushes that grow around Starcrest Commune.", 10, 100, "I need to find Cayan Sable and get some needed information from him.", 788, 11348)
  34. AddQuestStepCompleteAction(Quest, 2, "step2_complete_obtainedBerries")
  35. end
  36. function step2_complete_obtainedBerries(Quest, QuestGiver, Player)
  37. UpdateQuestStepDescription(Quest, 2, "I have collected the Red Sun Berries.")
  38. UpdateQuestTaskGroupDescription(Quest, 2, "I have collected the Red Sun Berries.")
  39. AddQuestStepChat(Quest, 3, "I must return to Cayan Sable, I can use the bench behind the northwest corner of the armor shop to get to him.", 1, "I need to find Cayan Sable and get some needed information from him.", 0, 2340006)
  40. AddQuestStepCompleteAction(Quest, 3, "step3_complete_talkedToCayan")
  41. end
  42. function step3_complete_talkedToCayan(Quest, QuestGiver, Player)
  43. UpdateQuestDescription(Quest, "I have done a task for Cayan in exchange for certain information. According to him I will get this information from a merchant in Starcrest Commune.")
  44. GiveQuestReward(Quest, Player)
  45. end
  46. function Reload(Quest, QuestGiver, Player, Step)
  47. if Step == 1 then
  48. step1_complete_talkedToCayan(Quest, QuestGiver, Player)
  49. elseif Step == 2 then
  50. step2_complete_obtainedBerries(Quest, QuestGiver, Player)
  51. elseif Step == 3 then
  52. step3_complete_talkedToCayan(Quest, QuestGiver, Player)
  53. end
  54. end