CharlesArker.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. --[[
  2. Script Name : SpawnScripts/OutpostOverlord/CharlesArker.lua
  3. Script Author : Cynnar, premierio015
  4. Script Date : 2018.10.14 07:10:58, 18.05.2020(UPDATE)
  5. Script Purpose : Offer Quests "In the Name of Prestige", "In the Name of Honor"
  6. Notes : Made some rewrites on "In The Name Of Prestige" dialogues, so now work as intended. Added "In the Name of Honor" dialogues.
  7. --]]
  8. local InTheNameOfPrestige = 489
  9. local InTheNameOfHonor = 490
  10. local TheTunarianPlot = 491
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 10, "InRange")
  13. end
  14. function InRange(NPC, Spawn)
  15. if not HasCompletedQuest(Spawn, InTheNameOfPrestige) then
  16. ProvidesQuest(NPC, InTheNameOfPrestige)
  17. SetInfoFlag(NPC)
  18. SetVisualFlag(NPC)
  19. elseif HasCompletedQuest(Spawn, InTheNameOfPrestige) then
  20. ProvidesQuest(NPC, InTheNameOfHonor)
  21. SetInfoFlag(NPC)
  22. SetVisualFlag(NPC)
  23. elseif HasCompletedQuest(Spawn, InTheNameOfHonor) then
  24. ProvidesQuest(NPC, TheTunarianPlot)
  25. SetInfoFlag(NPC)
  26. SetVisualFlag(NPC)
  27. end
  28. end
  29. function respawn (NPC)
  30. spawn(NPC)
  31. end
  32. function hailed(NPC, Spawn)
  33. FaceTarget(NPC, Spawn)
  34. local conversation = CreateConversation()
  35. if GetQuestStep(Spawn, InTheNameOfPrestige) == 1 then
  36. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker004.mp3", "", "", 1870656524, 1643000002, Spawn)
  37. AddConversationOption(conversation, "I'll see what I can find out.", "dlg_1_5")
  38. StartConversation(conversation, NPC, Spawn, "I appreciate it, " .. GetName(Spawn) .. " Whatever glory comes of this, we'll share in the credit. I'm sure this will more than make up for the work I've done that others have taken credit for.")
  39. elseif not HasQuest(Spawn, InTheNameOfPrestige) and not HasCompletedQuest(Spawn, InTheNameOfPrestige) then
  40. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker001.mp3", "", "nod", 2051119928, 4163051805, Spawn)
  41. AddConversationOption(conversation, "I don't talk to strangers.")
  42. AddConversationOption(conversation, "I'm not a recruit. I volunteered.", "dlg_1_2")
  43. StartConversation(conversation, NPC, Spawn, "You're that new recruit I keep hearing about. " .. GetName(Spawn) .. " , isn't it?")
  44. elseif HasQuest(Spawn, InTheNameOfPrestige) and GetQuestStep(Spawn, InTheNameOfPrestige) <= 8 then
  45. missingpieces(NPC, Spawn)
  46. elseif HasQuest(Spawn, InTheNameOfHonor) and GetQuestStep(Spawn, InTheNameOfHonor) <= 6 then
  47. isdead(NPC, Spawn)
  48. elseif HasCompletedQuest(Spawn, InTheNameOfPrestige) and not HasCompletedQuest(Spawn, TheTunarianPlot) then
  49. dlg_1_6(NPC, Spawn)
  50. end
  51. if HasQuest(Spawn, TheTunarianPlot) and GetQuestStep(Spawn, TheTunarianPlot) == 5 then
  52. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker013.mp3", "", "peer", 1963096274, 3996749562, Spawn)
  53. AddConversationOption(conversation, "Yes, but something about it puzzles me.", "dlg_3_1")
  54. AddConversationOption(conversation, "Huh?")
  55. StartConversation(conversation, NPC, Spawn, "What's that? You found more of the parchment?")
  56. elseif GetQuestStep(Spawn, TheTunarianPlot) == 6 then
  57. dlg_3_1(NPC,Spawn)
  58. end
  59. if HasCompletedQuest(Spawn, TheTunarianPlot) then
  60. choice = math.random (1, 4)
  61. if choice == 1 then
  62. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quest/quest_charles_arker_complete02_d9b903b7.mp3", "Once again, I'm in your debt.", "", 2421222814, 2543907839, Spawn)
  63. elseif choice == 2 then
  64. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quest/quest_charles_arker_complete02_2a10e388.mp3", "Soon I'll be able to return home, with prestige and honor, thanks to your help.", "", 3771023938, 797205485, Spawn)
  65. elseif choice == 3 then
  66. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quest/quest_charles_arker_complete02_6f536069.mp3", "Those wood elf vixens are vile creatures who lure good men to their destruction!", "", 2187772267, 3225973212, Spawn)
  67. else
  68. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quest/quest_charles_arker_complete02_e40ced16.mp3", "I appreciate your help.", "", 1970845095, 134772962, Spawn)
  69. end
  70. end
  71. end
  72. function missingpieces(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. local conversation = CreateConversation()
  75. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker005.mp3", "", "nod", 3781470259, 2263609559)
  76. if GetQuestStep(Spawn, InTheNameOfPrestige) == 8 then
  77. AddConversationOption(conversation, "Yes. This is the message I've managed to put together.", "dlg_1_6")
  78. end
  79. AddConversationOption(conversation, "Not all of them.")
  80. StartConversation(conversation, NPC, Spawn, "Have you found more of the missing pieces?")
  81. end
  82. function dlg_1_2(NPC, Spawn)
  83. FaceTarget(NPC, Spawn)
  84. local conversation = CreateConversation()
  85. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker002.mp3", "", "", 1779982844, 2478664547, Spawn)
  86. AddConversationOption(conversation, "Not really.")
  87. AddConversationOption(conversation, "What kind of help do you need?", "dlg_1_3")
  88. StartConversation(conversation, NPC, Spawn, "Your reputation precedes you -- as will mine, someday soon. When I return to Freeport, my prestige will bring honor to my family. I came here to make a name for myself, but it's been difficult to stand out in the crowd. I have a new assignment and it's puzzling me. Would you help me unravel it?")
  89. end
  90. function dlg_1_3(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. local conversation = CreateConversation()
  93. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker003.mp3", "", "", 435953835, 2242560449, Spawn)
  94. AddConversationOption(conversation, "Certainly.", "questoffer")
  95. StartConversation(conversation, NPC, Spawn, "There's a lot of undercover work here, which means even if you do well, the higher-ups may not know it's you doing the work. Some of my best work was claimed by someone else and I mean to fix that. Not long ago, I intercepted part of a note one of the Tunarian spies was delivering. They've hidden the remaining pieces. We need to get them all back to learn more of what they're doing.")
  96. end
  97. function dlg_1_4(NPC, Spawn)
  98. FaceTarget(NPC, Spawn)
  99. local conversation = CreateConversation()
  100. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker004.mp3", "", "thank", 1870656524, 1643000002, Spawn)
  101. AddConversationOption(conversation, "I'll see what I can find out.", "dlg_1_5")
  102. StartConversation(conversation, NPC, Spawn, "I appreciate it, " .. GetName(Spawn) .. " Whatever glory comes of this, we'll share in the credit. I'm sure this will more than make up for the work I've done that others have taken credit for.")
  103. end
  104. function dlg_1_5(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. SetStepComplete(Spawn, InTheNameOfPrestige, 1)
  107. local conversation = CreateConversation()
  108. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker021.mp3", "", "", 1916109124, 3504506765, Spawn)
  109. AddConversationOption(conversation, "I'll keep that in mind.")
  110. StartConversation(conversation, NPC, Spawn, "A word of warning: be wary of those wood elves. They're more cunning than others may realize.")
  111. end
  112. function dlg_1_6(NPC, Spawn)
  113. FaceTarget(NPC, Spawn)
  114. SetStepComplete(Spawn, InTheNameOfPrestige, 8)
  115. local conversation = CreateConversation()
  116. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker006.mp3", "", "", 2475145114, 3569833047, Spawn)
  117. if HasCompletedQuest(Spawn, InTheNameOfPrestige) and not HasCompletedQuest(Spawn, InTheNameOfHonor) then
  118. AddConversationOption(conversation, "In what way?", "dlg_2_1")
  119. end
  120. AddConversationOption(conversation, "Not at the moment.")
  121. StartConversation(conversation, NPC, Spawn, "The Tunarian note is still incomplete, but this may be enough to advance our prestige, " .. GetName(Spawn) .. ". You know, you're very good at this kind of thing. Tell me, would you be interested in helping me on a more personal level?")
  122. end
  123. function questoffer(NPC, Spawn)
  124. -- Gives a quest after some chat (dlg_1_1>dlg_1_2>dlg_1_3)
  125. FaceTarget(NPC, Spawn)
  126. OfferQuest(NPC, Spawn, InTheNameOfPrestige)
  127. end
  128. -- IN THE NAME OF HONOR
  129. function dlg_2_1(NPC, Spawn)
  130. FaceTarget(NPC, Spawn)
  131. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker007.mp3", "", "nod", 3047126327, 3117887484, Spawn)
  132. local conversation = CreateConversation()
  133. AddConversationOption(conversation, "That's pretty unfortunate.", "dlg_2_2")
  134. StartConversation(conversation, NPC, Spawn, "As you know, I came here to make more of a name for myself. When I return home, my marriage will take place. I've been betrothed since birth to a lady from a good family. The match will elevate my family's status. Unfortunately, my betrothed has the face of a horse.")
  135. end
  136. function dlg_2_2(NPC, Spawn)
  137. FaceTarget(NPC, Spawn)
  138. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker008.mp3", "", "ponder", 103196051, 3322236068, Spawn)
  139. local conversation = CreateConversation()
  140. AddConversationOption(conversation, "What do you need me to do?", "dlg_2_3")
  141. AddConversationOption(conversation, "I'm sorry, but I can't help you.")
  142. StartConversation(conversation, NPC, Spawn, "Also, unfortunately, I've found myself unnaturally attracted to one of those Tunarian spies. A wood elf...she's graceful, beautiful and deadly. Nothing must come of this fancy of mine. I cannot let my reputation be sullied by even the merest hint of a romance with one of their kind.")
  143. end
  144. function dlg_2_3(NPC, Spawn)
  145. FaceTarget(NPC, Spawn)
  146. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker009.mp3", "", "cutthroat", 2534306844, 3795442038, Spawn)
  147. local conversation = CreateConversation()
  148. AddConversationOption(conversation, "I'll take care of her.", "questoffer2")
  149. AddConversationOption(conversation, "I've got something else to take care of first.")
  150. StartConversation(conversation, NPC, Spawn, "Find Laena. Kill her. I'd do it myself, but I fear that seeing her again might weaken my resolve. She could be anywhere on this island. Once she's out of the way, I won't be tempted again and my family's honor will not be stained. For all I know, she was put here specifically to entice men like me to falter.")
  151. end
  152. function isdead(NPC, Spawn)
  153. FaceTarget(NPC, Spawn)
  154. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker010.mp3", "", "nod", 2230888578, 3016454691, Spawn)
  155. local conversation = CreateConversation()
  156. if GetQuestStep(Spawn, InTheNameOfHonor) == 6 then
  157. AddConversationOption(conversation, "Yes. Do you want details?", "dlg_2_4")
  158. end
  159. AddConversationOption(conversation, "I'm still searching for the wench.")
  160. StartConversation(conversation, NPC, Spawn, "Is she...dead?")
  161. end
  162. function dlg_2_4(NPC, Spawn)
  163. FaceTarget(NPC, Spawn)
  164. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker011.mp3", "", "no", 3557914078, 266939946, Spawn)
  165. local conversation = CreateConversation()
  166. AddConversationOption(conversation, "To tell the truth, I don't know how she died. She was dead when I found her.", "dlg_2_5")
  167. StartConversation(conversation, NPC, Spawn, "I don't care for details. I...just want to make sure she died with honor.")
  168. end
  169. function dlg_2_5(NPC, Spawn)
  170. FaceTarget(NPC, Spawn)
  171. SetStepComplete(Spawn, InTheNameOfHonor, 6)
  172. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker012.mp3", "", "ponder", 4109402051, 786259154, Spawn)
  173. local conversation = CreateConversation()
  174. AddConversationOption(conversation, "You're welcome.")
  175. StartConversation(conversation, NPC, Spawn, "I see. I hadn't expected that. The main thing is that Laena will no longer...bother me. I wonder, though...who could've killed her? We may never know...and I can marry my betrothed in peace. Thank you, " .. GetName(Spawn) .. ". ")
  176. end
  177. function questoffer2(NPC, Spawn)
  178. FaceTarget(NPC, Spawn)
  179. OfferQuest(NPC, Spawn, InTheNameOfHonor)
  180. local conversation = CreateConversation()
  181. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker020.mp3", "", "", 3837612635, 962972593, Spawn)
  182. AddConversationOption(conversation, "Easy to you to say.")
  183. StartConversation(conversation, NPC, Spawn, "There's no time like the present.")
  184. end
  185. -- THE TUNARIAN PLOT
  186. function dlg_3_1(NPC, Spawn)
  187. FaceTarget(NPC, Spawn)
  188. SetStepComplete(Spawn, TheTunarianPlot, 5)
  189. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/charles_arker/tutorial_island02_evil_revamp/quests/quest_charles_arker/charles_arker014.mp3", "", "no", 4112615277, 2509927086, Spawn)
  190. local conversation = CreateConversation()
  191. AddConversationOption(conversation, "All right. I'll see you there.")
  192. StartConversation(conversation, NPC, Spawn, "I can't speak of it here. It is very important that we draw no attention to ourselves. Meet me in the Wilderwood. There's a shallow alcove known as ''the Nook'' beyond the trees, along the northern wall.")
  193. end