KnightCaptainElgrondeth.lua 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. --[[
  2. Script Name : SpawnScripts/Nettleville/Knight-CaptainElgrondeth.lua
  3. Script Purpose : Knight-Captain Elgrondeth
  4. Script Author : Dorbin
  5. Script Date : 2022.06.19
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC,305)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function hailed(NPC, Spawn)
  17. if GetFactionAmount(Spawn,11)<0 then
  18. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn, 0)
  19. elseif not HasCompletedQuest(Spawn,305) and not HasQuest(Spawn,305) then
  20. Dialog4(NPC, Spawn)
  21. elseif HasQuest(Spawn,305) and GetQuestStep(Spawn,305)==2 then
  22. Dialog5(NPC,Spawn)
  23. elseif HasQuest(Spawn,305) and GetQuestStep(Spawn,305)==4 then
  24. Dialog7(NPC,Spawn)
  25. elseif HasQuest(Spawn,305) and GetQuestStep(Spawn,305)==6 then
  26. Dialog9(NPC,Spawn)
  27. else
  28. PlayFlavor(NPC, "voiceover/english/knight-captain_elgrondeth/qey_village01/100_quest_captain_elgrondeth_questcomplete_55592dd4.mp3", "I appreciate your help. If I can return the favor someday, I shall.", "thanks", 1398230613, 3767711690, Spawn, 0)
  29. end
  30. end
  31. function Dialog1(NPC, Spawn)
  32. FaceTarget(NPC, Spawn)
  33. Dialog.New(NPC, Spawn)
  34. Dialog.AddDialog("First, I need you to investigate the sudden increase of vermin in Antonica. The beasts are eating away at our food stores and must be destroyed. I would send a guard, but we have more reports than my guards can handle. Are you ready to help?")
  35. Dialog.AddVoiceover("voiceover/english/knight-captain_elgrondeth/qey_village01/captainelgrondeth002.mp3", 4148519234, 3732616918)
  36. Dialog.AddOption("I am ready!")
  37. Dialog.Start()
  38. end
  39. function Dialog2(NPC, Spawn)
  40. FaceTarget(NPC, Spawn)
  41. Dialog.New(NPC, Spawn)
  42. Dialog.AddDialog("One of the guards didn't show up for his shift, and I have reports that I need investigated. It's not easy work, but you look up for a challenge. What do you say? You want to help me out with my investigation?")
  43. Dialog.AddVoiceover("voiceover/english/knight-captain_elgrondeth/qey_village01/captainelgrondeth001.mp3", 1567852224, 3144262033)
  44. Dialog.AddOption("I would be glad to help.", "Dialog1")
  45. Dialog.AddOption("Sorry, I can't help right now.")
  46. Dialog.Start()
  47. end
  48. function Dialog1(NPC, Spawn)
  49. FaceTarget(NPC, Spawn)
  50. Dialog.New(NPC, Spawn)
  51. Dialog.AddDialog("First, I need you to investigate the sudden increase of vermin in Antonica. The beasts are eating away at our food stores and must be destroyed. I would send a guard, but we have more reports than my guards can handle. Are you ready to help?")
  52. Dialog.AddVoiceover("voiceover/english/knight-captain_elgrondeth/qey_village01/captainelgrondeth002.mp3", 4148519234, 3732616918)
  53. Dialog.AddOption("I am ready!","StartQuest")
  54. Dialog.Start()
  55. end
  56. function StartQuest(NPC,Spawn)
  57. OfferQuest(NPC,Spawn,305)
  58. FaceTarget(NPC,Spawn)
  59. end
  60. function Dialog4(NPC, Spawn)
  61. FaceTarget(NPC, Spawn)
  62. Dialog.New(NPC, Spawn)
  63. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn, 0)
  64. Dialog.AddDialog("Thank the gods you came along! Just when I need an extra set of hands!")
  65. Dialog.AddVoiceover("voiceover/english/captain_elgrondeth/qey_village01/captainelgrondeth000.mp3", 3582894338, 2709560661)
  66. if GetLevel(Spawn)>=7 then
  67. Dialog.AddOption("What do you mean?", "Dialog2")
  68. end
  69. if GetLevel(Spawn)<7 then
  70. Dialog.AddOption("Err, perhaps when I've seen a bit more action I'll be ready to lend a hand.")
  71. end
  72. Dialog.AddOption("I am a little preoccupied just now.")
  73. Dialog.Start()
  74. end
  75. function Dialog5(NPC, Spawn)
  76. FaceTarget(NPC, Spawn)
  77. Dialog.New(NPC, Spawn)
  78. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn, 0)
  79. Dialog.AddDialog("Well done I must say! You handled that last task nearly as quickly as one of my own guards. Next report is a bit tricky. It's a bit tricky. Are you ready?")
  80. Dialog.AddVoiceover("voiceover/english/captain_elgrondeth/qey_village01/captainelgrondeth004.mp3", 32799599, 1218371432)
  81. Dialog.AddOption("I'm ready! What's next?", "Dialog6")
  82. Dialog.AddOption("I am a little preoccupied just now.")
  83. Dialog.Start()
  84. end
  85. function Dialog6(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. SetStepComplete(Spawn,305, 2)
  88. Dialog.New(NPC, Spawn)
  89. Dialog.AddDialog("More and more people are exploring the local yards. We must protect them from the vicious beasts infesting the area. Brown bear populations have become a particular problem. You must cull the beast's numbers! Again, once you complete this task return to me and I'll see if I need more help.")
  90. Dialog.AddVoiceover("voiceover/english/captain_elgrondeth/qey_village01/captainelgrondeth005.mp3", 2352434236, 2881365274)
  91. Dialog.AddOption("I'll report back once I've taken care of them")
  92. Dialog.AddOption("Bears? Well, alright then.")
  93. Dialog.Start()
  94. end
  95. function Dialog7(NPC, Spawn)
  96. FaceTarget(NPC, Spawn)
  97. Dialog.New(NPC, Spawn)
  98. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn, 0)
  99. Dialog.AddDialog("Truly remarkable! You show incrediable fortitude for someone who has no guard training. I have one final report I need you to handle. Do you have time to complete this final task?")
  100. Dialog.AddVoiceover("voiceover/english/captain_elgrondeth/qey_village01/captainelgrondeth006.mp3", 2945126475, 1397255123)
  101. Dialog.AddOption("Certainly. What is the threat?","Dialog8")
  102. Dialog.AddOption("Another one? I hope it is a real problem.","Dialog8")
  103. Dialog.AddOption("I am a little preoccupied just now.")
  104. Dialog.Start()
  105. end
  106. function Dialog8(NPC, Spawn)
  107. FaceTarget(NPC, Spawn)
  108. SetStepComplete(Spawn,305, 4)
  109. Dialog.New(NPC, Spawn)
  110. Dialog.AddDialog("These reports are very serious. I'm sure you've seen the thicket lizards in your travels and kept your distance. They have slain many adventurers. You must stop the carnage. Put an end to the menace, and I'll see you are rewarded for your help! ")
  111. Dialog.AddVoiceover("voiceover/english/captain_elgrondeth/qey_village01/captainelgrondeth007.mp3", 2396655340, 2104454992)
  112. Dialog.AddOption("I'll report back once they've been dealt with.")
  113. Dialog.AddOption("Lizards it is then!")
  114. Dialog.Start()
  115. end
  116. function Dialog9(NPC, Spawn)
  117. FaceTarget(NPC, Spawn)
  118. Dialog.New(NPC, Spawn)
  119. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn, 0)
  120. Dialog.AddDialog("Thank you very much! I appreciate your help during our time of need. Please, accept this small token as a sign of my appreciation. Good luck to you!")
  121. Dialog.AddVoiceover("voiceover/english/captain_elgrondeth/qey_village01/captainelgrondeth008.mp3", 2945126475, 1397255123)
  122. Dialog.AddOption("Thanks. I'm glad I could help.","FinishQuest")
  123. Dialog.AddOption("Well, at least that was the last one. Take care.","FinishQuest")
  124. Dialog.Start()
  125. end
  126. function FinishQuest(NPC,Spawn)
  127. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn, 0)
  128. SetStepComplete(Spawn,305, 6)
  129. FaceTarget(NPC,Spawn)
  130. end