9
3

a_diplomatic_mission.lua 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. --[[
  2. Script Name : Quests/QueensColony/a_diplomatic_mission.lua
  3. Script Author : Zcoretri
  4. Script Date : 2015.09.05
  5. Script Purpose : Handles the quest "A Diplomatic Mission"
  6. Zone : Queen's Colony
  7. Quest Giver: a Sapswill soothsayer
  8. Preceded by: Doggone It! (doggone_it.lua)
  9. Followed by: None
  10. --]]
  11. local ADiplomaticMission = 166
  12. function Init(Quest)
  13. -- Diplomat's Badge
  14. AddQuestStepChat(Quest, 1, "Greet a musician.", 1, "The Sapswill soothsayer said I need to get the members of their community. Guess it's all part of the diplomatic stuff.", 0, 2530039)
  15. AddQuestStepChat(Quest, 2, "Greet an incapacitated Sapswill.", 1, "The Sapswill soothsayer said I need to get the members of their community. Guess it's all part of the diplomatic stuff.", 0, 2530039)
  16. AddQuestStepChat(Quest, 3, "Greet a seated Sapswill.", 1, "The Sapswill soothsayer said I need to get the members of their community. Guess it's all part of the diplomatic stuff.", 0, 2530036)
  17. AddQuestStepChat(Quest, 4, "Greet an active Sapswill.", 1, "The Sapswill soothsayer said I need to get the members of their community. Guess it's all part of the diplomatic stuff.", 0, 2530039)
  18. AddQuestStepChat(Quest, 5, "Greet a happy Sapswill.", 1, "The Sapswill soothsayer said I need to get the members of their community. Guess it's all part of the diplomatic stuff.", 0, 2530039)
  19. AddQuestStepChat(Quest, 6, "Greet Durg.", 1, "The Sapswill soothsayer said I need to get the members of their community. Guess it's all part of the diplomatic stuff.", 0, 2530035)
  20. AddQuestStepChat(Quest, 7, "Greet Gonk.", 1, "The Sapswill soothsayer said I need to get the members of their community. Guess it's all part of the diplomatic stuff.", 0, 2530034)
  21. AddQuestStepCompleteAction(Quest, 1, "step1_complete_greetedMusician")
  22. AddQuestStepCompleteAction(Quest, 2, "step2_complete_greetedIncapacitated")
  23. AddQuestStepCompleteAction(Quest, 3, "step3_complete_greetedSeated")
  24. AddQuestStepCompleteAction(Quest, 4, "step4_complete_greetedActive")
  25. AddQuestStepCompleteAction(Quest, 5, "step5_complete_greetedHappy")
  26. AddQuestStepCompleteAction(Quest, 6, "step6_complete_greetedDurg")
  27. AddQuestStepCompleteAction(Quest, 7, "step7_complete_greetedGonk")
  28. end
  29. function Accepted(Quest, QuestGiver, Player)
  30. if QuestGiver ~= nil then
  31. if GetDistance(Player, QuestGiver) < 30 then
  32. FaceTarget(QuestGiver, Player)
  33. conversation = CreateConversation()
  34. AddConversationOption(conversation, "To long life!")
  35. StartConversation(conversation, QuestGiver, Player, "To long life, and happy friendships!")
  36. end
  37. end
  38. end
  39. function Declined(Quest, QuestGiver, Player)
  40. end
  41. function step1_complete_greetedMusician(Quest, QuestGiver, Player)
  42. UpdateQuestStepDescription(Quest, 1, "I've greeted a Sapswill musician.")
  43. if QuestIsComplete(Player, ADiplomaticMission) then
  44. multiple_steps_complete(Quest, QuestGiver, Player)
  45. end
  46. end
  47. function step2_complete_greetedIncapacitated(Quest, QuestGiver, Player)
  48. UpdateQuestStepDescription(Quest, 2, "Greeted a passed out Sapswill.")
  49. if QuestIsComplete(Player, ADiplomaticMission) then
  50. multiple_steps_complete(Quest, QuestGiver, Player)
  51. end
  52. end
  53. function step3_complete_greetedSeated(Quest, QuestGiver, Player)
  54. UpdateQuestStepDescription(Quest, 3, "Greeted a leisurely Sapswill.")
  55. if QuestIsComplete(Player, ADiplomaticMission) then
  56. multiple_steps_complete(Quest, QuestGiver, Player)
  57. end
  58. end
  59. function step4_complete_greetedActive(Quest, QuestGiver, Player)
  60. UpdateQuestStepDescription(Quest, 4, "Greeted a frenzied dancer.")
  61. if QuestIsComplete(Player, ADiplomaticMission) then
  62. multiple_steps_complete(Quest, QuestGiver, Player)
  63. end
  64. end
  65. function step5_complete_greetedHappy(Quest, QuestGiver, Player)
  66. UpdateQuestStepDescription(Quest, 5, "Greeted a very happy Sapswill.")
  67. if QuestIsComplete(Player, ADiplomaticMission) then
  68. multiple_steps_complete(Quest, QuestGiver, Player)
  69. end
  70. end
  71. function step6_complete_greetedDurg(Quest, QuestGiver, Player)
  72. UpdateQuestStepDescription(Quest, 6, "I've greeted Durg.")
  73. if QuestIsComplete(Player, ADiplomaticMission) then
  74. multiple_steps_complete(Quest, QuestGiver, Player)
  75. end
  76. end
  77. function step7_complete_greetedGonk(Quest, QuestGiver, Player)
  78. UpdateQuestStepDescription(Quest, 7, "I've greeted Gonk.")
  79. if QuestIsComplete(Player, ADiplomaticMission) then
  80. multiple_steps_complete(Quest, QuestGiver, Player)
  81. end
  82. end
  83. function multiple_steps_complete(Quest, QuestGiver, Player)
  84. UpdateQuestTaskGroupDescription(Quest, 1, "I've greeted as many Sapswills as I could.")
  85. AddQuestStepChat(Quest, 8, "Pay respects to High Chieftain Grexx.", 1, "Now that I've introduced myself to several Sapswill goblins, I should pay my respects to High Chieftain Grexx.", 0, 2530038)
  86. AddQuestStepCompleteAction(Quest, 8, "quest_complete")
  87. end
  88. function quest_complete(Quest, QuestGiver, Player)
  89. UpdateQuestDescription(Quest, "I greeted many of the Sapswills, including their High Chieftan Grexx. They seem like such a harmless bunch; it's hard to imagine that anyone would want to turn them from their simple ways.")
  90. GiveQuestReward(Quest, Player)
  91. end
  92. function Reload(Quest, QuestGiver, Player, Step)
  93. if Step == 1 then
  94. step1_complete_greetedMusician(Quest, QuestGiver, Player)
  95. elseif Step == 2 then
  96. step2_complete_greetedIncapacitated(Quest, QuestGiver, Player)
  97. elseif Step == 3 then
  98. step3_complete_greetedSeated(Quest, QuestGiver, Player)
  99. elseif Step == 4 then
  100. step4_complete_greetedActive(Quest, QuestGiver, Player)
  101. elseif Step == 5 then
  102. step5_complete_greetedHappy(Quest, QuestGiver, Player)
  103. elseif Step == 6 then
  104. step6_complete_greetedDurg(Quest, QuestGiver, Player)
  105. elseif Step == 7 then
  106. step7_complete_greetedGonk(Quest, QuestGiver, Player)
  107. end
  108. end