9
3

destroying_the_foundation.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. --[[
  2. Script Name : Quests/Caves/destroying_the_foundation.lua
  3. Script Purpose : Handles the quest, "Destroying the Foundation"
  4. Script Author : Scatman
  5. Script Date : 2009.10.18
  6. Zone : The Caves
  7. Quest Giver: Emma Torque
  8. Preceded by: An Explosive Idea (an_explosive_idea.lua)
  9. Followed by: None
  10. --]]
  11. function Init(Quest)
  12. AddQuestStep(Quest, 1, "I need to destroy the digging machine 'DDBD-2830-A'.", 1, 100, "Emma Torque needs me to destroy the two machines being used by the gnolls to dig through the caves and to kill the Freeportian gnome responsible for bringing them here.", 0, 3276)
  13. AddQuestStep(Quest, 2, "I need to destroy the digging machine 'DDBD-2830-B'.", 1, 100, "Emma Torque needs me to destroy the two machines being used by the gnolls to dig through the caves and to kill the Freeportian gnome responsible for bringing them here.", 0, 3276)
  14. AddQuestStepKill(Quest, 3, "I need to kill Fulkoir Haggleton. He will probably appear among the Rockpaw gnolls once I've destroyed his machines.", 1, 100, "Emma Torque needs me to destroy the two machines being used by the gnolls to dig through the caves and to kill the Freeportian gnome responsible for bringing them here.", 2466, 1970071)
  15. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_MachineA")
  16. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_MachineB")
  17. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_KilledFulkoir")
  18. end
  19. function Accepted(Quest, QuestGiver, Player)
  20. FaceTarget(QuestGiver, Player)
  21. conversation = CreateConversation()
  22. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/emma_torque/qey_adv03_caves/quests/emma/emma_009.mp3", "", "", 2928866225, 3555660986, Player)
  23. AddConversationOption(conversation, "Thanks.")
  24. StartConversation(conversation, QuestGiver, Player, "Good. The machines are likely a couple of levels up from this one. I'm sure I'll hear the explosions from here. I do hope you enjoy yourself, hah hah!")
  25. end
  26. function Declined(Quest, QuestGiver, Player)
  27. end
  28. function Step1_Complete_MachineA(Quest, QuestGiver, Player)
  29. UpdateQuestStepDescription(Quest, 1, "I have placed explosives on the digging machine 'DDBD-2830-A'.")
  30. if QuestIsComplete(Player, 227) then
  31. MultipleStepsComplete(Quest, QuestGiver, Player)
  32. end
  33. end
  34. function Step2_Complete_MachineB(Quest, QuestGiver, Player)
  35. UpdateQuestStepDescription(Quest, 2, "I have placed explosives on the digging machine 'DDBD-2830-B'.")
  36. if QuestIsComplete(Player, 227) then
  37. MultipleStepsComplete(Quest, QuestGiver, Player)
  38. end
  39. end
  40. function Step3_Complete_KilledFulkoir(Quest, QuestGiver, Player)
  41. UpdateQuestStepDescription(Quest, 3, "I have killed Fulkoir Haggleton.")
  42. if QuestIsComplete(Player, 227) then
  43. MultipleStepsComplete(Quest, QuestGiver, Player)
  44. end
  45. end
  46. function MultipleStepsComplete(Quest, QuestGiver, Player)
  47. UpdateQuestTaskGroupDescription(Quest, 1, "I have destroyed all of the machines and killed Fulkoir.")
  48. AddQuestStepChat(Quest, 4, "I need to return to Emma Torque.", 1, "Now that I have done what she needed I should return to Emma Torque.", 0, 1970012)
  49. AddQuestStepCompleteAction(Quest, 4, "QuestComplete")
  50. end
  51. function QuestComplete(Quest, QuestGiver, Player)
  52. UpdateQuestStepDescription(Quest, 4, "I have spoken with Emma Torque.")
  53. UpdateQuestTaskGroupDescription(Quest, 2, "I have spoken with Emma Torque.")
  54. UpdateQuestDescription(Quest, "I have destroyed the gnoll's digging machines and killed the gnome responsible for providing them with this technology.")
  55. GiveQuestReward(Quest, Player)
  56. end
  57. function Reload(Quest, QuestGiver, Player, Step)
  58. if Step == 1 then
  59. Step1_Complete_MachineA(Quest, QuestGiver, Player)
  60. elseif Step == 2 then
  61. Step2_Complete_MachineB(Quest, QuestGiver, Player)
  62. elseif Step == 3 then
  63. Step3_Complete_KilledFulkoir(Quest, QuestGiver, Player)
  64. end
  65. end