9
3

hit_them_where_it_hurts.lua 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. --[[
  2. Quest Template
  3. Script Name : Quests/Caves/hit_them_where_it_hurts.lua
  4. Script Purpose : Handles the quest, "Hit Them Where it Hurts"
  5. Script Author : Scatman
  6. Script Date : 2009.10.08
  7. Zone : The Caves
  8. Quest Giver : Consul Bree
  9. Preceded by : A Lack of Information (a_lack_of_information.lua)
  10. Followed by : Elements of a Ritual (elements_of_a_ritual.lua)
  11. --]]
  12. function Init(Quest)
  13. AddQuestStep(Quest, 1, "I need to destroy the forge in the armory.", 1, 100, "Consul Bree has asked for my help in disrupting the gnoll operations here in the Caves. I can help by crippling their ability to craft armor and destroying some of their machine parts.", 12)
  14. AddQuestStep(Quest, 2, "I need to destroy some of the mechanical parts stashed in the Caves.", 5, 100, "Consul Bree has asked for my help in disrupting the gnoll operations here in the Caves. I can help by crippling their ability to craft armor and destroying some of their machine parts.", 1041)
  15. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_DestroyedForge")
  16. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_DestroyedParts")
  17. end
  18. function Accepted(Quest, QuestGiver, Player)
  19. FaceTarget(QuestGiver, Player)
  20. conversation = CreateConversation()
  21. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/consul_bree/qey_adv03_caves/quests/bree/bree_007a.mp3", "", "", 1177533650, 1696169122, Player)
  22. AddConversationOption(conversation, "You're welcome.")
  23. StartConversation(conversation, QuestGiver, Player, "Thank you. The gnolls may not recover from this.")
  24. -- 7 explosives
  25. for i = 1, 6, 1 do
  26. SummonItem(Player, 6052, 1)
  27. end
  28. end
  29. function Declined(Quest, QuestGiver, Player)
  30. end
  31. function Step1_Complete_DestroyedForge(Quest, QuestGiver, Player)
  32. UpdateQuestStepDescription(Quest, 1, "I have destroyed the forge.")
  33. if QuestIsComplete(Player, 224) then
  34. MultipleStepsComplete(Quest, QuestGiver, Player)
  35. end
  36. end
  37. function Step2_Complete_DestroyedParts(Quest, QuestGiver, Player)
  38. UpdateQuestStepDescription(Quest, 2, "I have destroyed some of the mechanical parts stashed in the Caves.")
  39. if QuestIsComplete(Player, 224) then
  40. MultipleStepsComplete(Quest, QuestGiver, Player)
  41. end
  42. end
  43. function MultipleStepsComplete(Quest, QuestGiver, Player)
  44. UpdateQuestTaskGroupDescription(Quest, 1, "I have done as Consul Bree asked.")
  45. AddQuestStepChat(Quest, 3, "I need to return to Consul Bree.", 1, "Now that I have helped Consul Bree I should return to her.", 0, 1970010)
  46. AddQuestStepCompleteAction(Quest, 3, "QuestComplete")
  47. end
  48. function QuestComplete(Quest, QuestGiver, Player)
  49. -- explosives
  50. while HasItem(Player, 6052) do
  51. RemoveItem(Player, 6052)
  52. end
  53. UpdateQuestStepDescription(Quest, 3, "I have spoken with Consul Bree.")
  54. UpdateQuestTaskGroupDescription(Quest, 2, "I have spoken with Consul Bree.")
  55. UpdateQuestDescription(Quest, "I have interrupted work in the armory and destroyed a number of machine components for Bree.")
  56. GiveQuestReward(Quest, Player)
  57. end
  58. function Reload(Quest, QuestGiver, Player, Step)
  59. if Step == 1 then
  60. Step1_Complete_DestroyedForge(Quest, QuestGiver, Player)
  61. elseif Step == 2 then
  62. Step2_Complete_DestroyedParts(Quest, QuestGiver, Player)
  63. end
  64. end