CaptainTyreth.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. --[[
  2. Script Name : CaptainTyreth.lua
  3. Script Purpose : Captain Tyreth
  4. Script Author : vo1d
  5. Script Date : 10/12/2019
  6. Modified Date : 20.05.2020
  7. Modified by : premierio015
  8. Modified Notes : Now have all dialogues.
  9. --]]
  10. local EvilGoblinTent1 = 2780125
  11. local EvilGoblinTent2 = 2780124
  12. local EvilGoblinTent3 = 2780123
  13. -- Quest ID's
  14. local TheFinalAssault = 367
  15. function spawn(NPC)
  16. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  17. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  18. AddSpawnAccess(NPC, NPC)
  19. end
  20. function respawn(NPC)
  21. spawn(NPC)
  22. end
  23. function InRange(NPC, Spawn)
  24. end
  25. function LeaveRange(NPC, Spawn)
  26. end
  27. function SpawnAccess(NPC, Spawn)
  28. if HasCompletedQuest(Spawn, TheFinalAssault) or GetQuestStep(Spawn, TheFinalAssault) == 2 then
  29. AddSpawnAccess(GetSpawn(NPC, EvilGoblinTent1), Spawn)
  30. AddSpawnAccess(GetSpawn(NPC, EvilGoblinTent2), Spawn)
  31. AddSpawnAccess(GetSpawn(NPC, EvilGoblinTent3), Spawn)
  32. else
  33. AddSpawnAccess(NPC, Spawn)
  34. end
  35. end
  36. function hailed(NPC, Spawn)
  37. if HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 1 then
  38. FaceTarget(NPC, Spawn)
  39. Conversation = CreateConversation()
  40. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth001.mp3", "", "cheer", 3280197482, 1135652426, Spawn)
  41. AddConversationOption(Conversation, "That's me.", "dlg_2")
  42. AddConversationOption(Conversation, "I need to be leaving.")
  43. StartConversation(Conversation, NPC, Spawn, "Hahaha! The attack has begun and the enemy shall fall! You must be " .. GetName(Spawn) .. ", here to take part in the festivities.")
  44. elseif HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 2 then
  45. FaceTarget(NPC, Spawn)
  46. Conversation = CreateConversation()
  47. AddConversationOption(Conversation, "I lost my torch!", "LostTorch")
  48. AddConversationOption(Conversation, "Goodbye.")
  49. StartConversation(Conversation, NPC, Spawn, "Burn any of their tents nearby. The island must be taken, and the time is now. There are tents here in the Valley of Discipline, and some east near Fisher Falls.")
  50. elseif HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 3 then
  51. FaceTarget(NPC, Spawn)
  52. Conversation = CreateConversation()
  53. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth005.mp3", "", "nod", 923930455, 1610949700, Spawn)
  54. AddConversationOption(Conversation, "I'm ready!", "dlg_4")
  55. AddConversationOption(Conversation, "Not yet.")
  56. StartConversation(Conversation, NPC, Spawn, "The rising smoke reveals your courage, but are you ready to finish what we have started?")
  57. elseif HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 4 then
  58. dlg_4(NPC, Spawn)
  59. elseif HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 5 then
  60. FaceTarget(NPC, Spawn)
  61. Conversation = CreateConversation()
  62. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth008.mp3", "", "", 3914904954, 1520768804, Spawn)
  63. AddConversationOption(Conversation, "How did you know about the key?", "dlg_5")
  64. AddConversationOption(Conversation, "I need to be leaving.")
  65. StartConversation(Conversation, NPC, Spawn, "So, Adrium is dead. I take it you found the key?")
  66. elseif HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 6 then
  67. FaceTarget(NPC, Spawn)
  68. Conversation = CreateConversation()
  69. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth014.mp3", "", "", 3703486693, 661668972, Spawn)
  70. AddConversationOption(Conversation, "Okay, I'm heading to the cave.")
  71. AddConversationOption(Conversation, "I lost my torch!", "LostTorch")
  72. StartConversation(Conversation, NPC, Spawn, "The cave is just north of Adrium's tree house, through some fallen boulders. Head inside and take out the Circle of Elders.")
  73. end
  74. end
  75. function dlg_2(NPC, Spawn)
  76. FaceTarget(NPC, Spawn)
  77. Conversation = CreateConversation()
  78. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth002.mp3", "", "nod", 3182304037, 930301833, Spawn)
  79. AddConversationOption(Conversation, "What must I do?", "dlg_3")
  80. StartConversation(Conversation, NPC, Spawn, "Ah, you were the one who coerced these sentries out of the area before the attack. Nicely done! It is time to complete our domination. The Militia are advancing and beginning to clear the area. It is time to strike, quickly!")
  81. end
  82. function dlg_3(NPC, Spawn)
  83. FaceTarget(NPC, Spawn)
  84. Conversation = CreateConversation()
  85. SummonItem(Spawn, 48997, 1)
  86. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth003.mp3", "", "", 3312554119, 4055641204, Spawn)
  87. AddConversationOption(Conversation, "I'll burn the tents of the Qeynosians.")
  88. StartConversation(Conversation, NPC, Spawn, "Take this torch. Work your way in and set fire to two of the nearby tents. Others have begun the razing as well. If another's flame fails, make sure you finish the job. This island will soon be ours!")
  89. SetStepComplete(Spawn, TheFinalAssault, 1)
  90. end
  91. function dlg_4(NPC, Spawn)
  92. SetStepComplete(Spawn, TheFinalAssault, 3)
  93. FaceTarget(NPC, Spawn)
  94. Conversation = CreateConversation()
  95. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth006.mp3", "", "", 4062545694, 2647153674, Spawn)
  96. AddConversationOption(Conversation, "I will head to the tree house.")
  97. StartConversation(Conversation, NPC, Spawn, "We believe that the leader of these elves waits atop a tree house, located through the archway to the east. It is certain that the flames have been spotted, so we need to act quickly. You must travel to the top of this tree house and finish the battle.")
  98. end
  99. function dlg_5(NPC, Spawn)
  100. FaceTarget(NPC, Spawn)
  101. Conversation = CreateConversation()
  102. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth009.mp3", "", "laugh", 3808552828, 1984603379, Spawn)
  103. AddConversationOption(Conversation, "Wait, our goal isn't to take the island?", "dlg_6")
  104. StartConversation(Conversation, NPC, Spawn, "You still have much to learn "..GetName(Spawn)..", but I'll let you in on a little secret. Sometimes things are best left unsaid until they reveal themselves. We have been watching your every move, and you have proven quite worthy of our true goal.")
  105. end
  106. function dlg_6(NPC, Spawn)
  107. FaceTarget(NPC, Spawn)
  108. Conversation = CreateConversation()
  109. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth010.mp3", "", "", 4076128835, 186998807, Spawn)
  110. AddConversationOption(Conversation, "So I've been used?", "dlg_7")
  111. StartConversation(Conversation, NPC, Spawn, "Of course it is, but there is something more. You know that mine that you took the samples from? The samples were packed with precious lapis lazuli, more so than any other source near Freeport.")
  112. end
  113. function dlg_7(NPC, Spawn)
  114. FaceTarget(NPC, Spawn)
  115. Conversation = CreateConversation()
  116. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth011.mp3", "", "nod", 3132321879, 2651058046, Spawn)
  117. AddConversationOption(Conversation, "What must I do?", "dlg_8")
  118. StartConversation(Conversation, NPC, Spawn, "No "..GetName(Spawn)..", you've been training. Training for the final confrontation you are about to take part in. You think Tayil couldn't have just done this all herself? Prove to us you are ready to become an esteemed citizen of Freeport and share in the wealth.")
  119. end
  120. function dlg_8(NPC, Spawn)
  121. FaceTarget(NPC, Spawn)
  122. Conversation = CreateConversation()
  123. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth012.mp3", "", "", 4033964775, 2680329984, Spawn)
  124. AddConversationOption(Conversation, "And what about the loot you spoke of?", "dlg_9")
  125. StartConversation(Conversation, NPC, Spawn, "We've been ''questioning'' some captives and had scouts follow the Tunarian haulers from the mine to a cave near the back of Adrium's tree house. We believe that this cave holds the true leaders of the elves, known as the Circle of Elders.")
  126. end
  127. function dlg_9(NPC, Spawn)
  128. SetStepComplete(Spawn, TheFinalAssault, 5)
  129. FaceTarget(NPC, Spawn)
  130. Conversation = CreateConversation()
  131. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth013.mp3", "", "laugh", 3051361848, 2529619741, Spawn)
  132. AddConversationOption(Conversation, "Consider it done.")
  133. StartConversation(Conversation, NPC, Spawn, "Ha ha, good form! You sound like a Freeport citizen already! The loot should be in the cave. Nothing has left the island for months, we've had it completely surrounded. Head in there and take care of the elders.")
  134. end
  135. function LostTorch(NPC, Spawn)
  136. if HasQuest(Spawn, TheFinalAssault) then
  137. if HasItem(Spawn, 48997, 1) then
  138. FaceTarget(NPC, Spawn)
  139. Conversation = CreateConversation()
  140. AddConversationOption(Conversation, "Doh")
  141. StartConversation(Conversation, NPC, Spawn, "You already have a torch.")
  142. else
  143. SummonItem(Spawn, 48997, 1)
  144. end
  145. end
  146. end