CaptainLNek.lua 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. --[[
  2. Script Name : SpawnScripts/LongshadowAlley/CaptainLNek.lua
  3. Script Purpose : Captain L`Nek
  4. Script Author : torsten
  5. Script Date : 2022.07.20
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericGuardVoiceOvers.lua")
  9. require "SpawnScripts/Generic/DialogModule"
  10. local TheTruthisoutThere = 5684
  11. local SilencedSpeech = 5685
  12. function spawn(NPC)
  13. ProvidesQuest(NPC, TheTruthisoutThere)
  14. ProvidesQuest(NPC, SilencedSpeech)
  15. SetPlayerProximityFunction(NPC, 9, "InRange", "LeaveRange")
  16. SetTempVariable(NPC, "CalloutTimer", "false")
  17. SetTempVariable(NPC, "CalloutTimer1", "false")
  18. SetTempVariable(NPC, "CalloutTimer2", "false")
  19. SetTempVariable(NPC, "CalloutTimer3", "false")
  20. end
  21. function InRange(NPC, Spawn)
  22. if GetFactionAmount(Spawn,12) <0 then
  23. FaceTarget(NPC, Spawn)
  24. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  25. else
  26. if CanReceiveQuest(Spawn, TheTruthisoutThere) or
  27. HasCompletedQuest(Spawn, TheTruthisoutThere) and
  28. CanReceiveQuest(Spawn,SilencedSpeech) then
  29. if GetTempVariable(NPC, "CalloutTimer")== "false"then
  30. SetTempVariable(NPC, "CalloutTimer", "true")
  31. AddTimer(NPC,10000,"ResetTimer",1,Spawn)
  32. FaceTarget(NPC, Spawn)
  33. if GetTempVariable(NPC, "CalloutTimer1")== "false"then
  34. PlayFlavor(NPC, "voiceover/english/captain_l_nek/fprt_hood05/100_captain_lnek_callout_c7c2fcfb.mp3", "Come closer; I've something to say to you!", "salute_freeport", 1023446507, 848958092, Spawn, 0)
  35. SetTempVariable(NPC, "CalloutTimer1", "true")
  36. elseif GetTempVariable(NPC, "CalloutTimer2")== "false"then
  37. PlayFlavor(NPC, "voiceover/english/captain_l_nek/fprt_hood05/100_captain_lnek_multhail1_ceb19390.mp3", "Hmm ... you are clearly not ready to serve our Militia in any capacity. This is disappointing.", "sniff", 562398108, 1978987267, Spawn, 0)
  38. SetTempVariable(NPC, "CalloutTimer2", "true")
  39. elseif GetTempVariable(NPC, "CalloutTimer3")== "false"then
  40. PlayFlavor(NPC, "voiceover/english/captain_l_nek/fprt_hood05/100_captain_lnek_multhail5_54f94dfc.mp3", "Hmm ... I am mistaken. You are not the one I seek.", "sniff", 3750262963, 2820443341, Spawn, 0)
  41. SetTempVariable(NPC, "CalloutTimer3", "true")
  42. else
  43. SetTempVariable(NPC, "CalloutTimer1", "false")
  44. SetTempVariable(NPC, "CalloutTimer2", "false")
  45. SetTempVariable(NPC, "CalloutTimer3", "false")
  46. PlayFlavor(NPC, "voiceover/english/captain_l_nek/fprt_hood05/100_captain_lnek_multhail6_f7ddb289.mp3", "Ah, yes. You are the one to assist me.", "nod", 3388282438, 3532241672, Spawn, 0)
  47. end
  48. end
  49. end
  50. end
  51. end
  52. function ResetTimer(NPC) -- 7 SECOND PAUSE BETWEEN VOs
  53. SetTempVariable(NPC, "CalloutTimer", "false")
  54. end
  55. function respawn(NPC)
  56. spawn(NPC)
  57. end
  58. function hailed(NPC, Spawn)
  59. if GetFactionAmount(Spawn,12) <0 then
  60. FaceTarget(NPC, Spawn)
  61. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  62. elseif not HasCompletedQuest (Spawn,SilencedSpeech)then
  63. Dialog1(NPC,Spawn)
  64. else
  65. Dialog2(NPC,Spawn)
  66. end
  67. end
  68. function Dialog1(NPC,Spawn)
  69. FaceTarget(NPC, Spawn)
  70. Dialog.New(NPC, Spawn)
  71. Dialog.AddDialog("It would serve you well to consider joining the militia. The militia is where the true power lies within this city.")
  72. PlayFlavor(NPC, "","","agree",0,0, Spawn)
  73. Dialog.AddVoiceover("voiceover/english/captain_l_nek/fprt_hood05/grd_captain_lnek.mp3",730672231,3077726269)
  74. if CanReceiveQuest(Spawn, TheTruthisoutThere) then
  75. Dialog.AddOption("What's so great about the Militia?", "Dialog1a")
  76. elseif GetQuestStep(Spawn, TheTruthisoutThere)==2 then
  77. Dialog.AddOption("I found out the culprit is Kirs G'viz, here in Longshadow Alley.", "Dialog1b")
  78. end
  79. if CanReceiveQuest(Spawn, SilencedSpeech) then
  80. Dialog.AddOption("Have the Militia dealt with the Thexian yet?", "Dialog1c")
  81. elseif GetQuestStep(Spawn, SilencedSpeech)==2 then
  82. Dialog.AddOption("I've found a signet ring on who I believe to be Kirs.", "Dialog2")
  83. end
  84. Dialog.AddOption("Alright! I'm going.")
  85. Dialog.Start()
  86. end
  87. --QUEST 1
  88. function Dialog1a(NPC,Spawn)
  89. FaceTarget(NPC, Spawn)
  90. Dialog.New(NPC, Spawn)
  91. Dialog.AddDialog("It carries the sole burden of peace. You must have noticed how sedition has lately saturated every district of the city. A treasonous faction of bad blood, calling itself the Thexians, has been spreading lies into every street and alley, preaching the resurrection of Neriak upon the bones of Freeport. I trust you can see the villainy in such talk. We clearly need more information about these traitors. If you wish to prove your loyalty to Freeport, you will assist us.")
  92. Dialog.AddVoiceover("voiceover/english/captain_l_nek/fprt_hood05/quests/captainlnek/lnek_x1_initial.mp3",1419069236,794084834)
  93. Dialog.AddOption("I am willing to prove myself!", "OfferQuest1")
  94. Dialog.AddOption("Don't worry. I'll see myself out.")
  95. Dialog.Start()
  96. end
  97. function OfferQuest1(NPC,Spawn)
  98. if CanReceiveQuest(Spawn, TheTruthisoutThere) then
  99. OfferQuest(NPC, Spawn, TheTruthisoutThere)
  100. end
  101. end
  102. function Dialog1b(NPC,Spawn)
  103. FaceTarget(NPC, Spawn)
  104. Dialog.New(NPC, Spawn)
  105. Dialog.AddDialog("Really? Interesting ... I did not foresee it, and yet it makes sense. He incessantly questions us about the Militia, as if intending to join. But I see now he has merely been gathering information to use against us. He will pay for this treachery even if I have to exact the ... penalty ... myself. It will be unpleasant. As for you, there may yet be a promising career for you within our ranks.")
  106. Dialog.AddVoiceover("voiceover/english/captain_l_nek/fprt_hood05/quests/captainlnek/lnek_x1_finish.mp3",3372615479,4263501678)
  107. PlayFlavor(NPC, "","","ponder",0,0, Spawn)
  108. Dialog.AddOption("I look forward to proving my worth.")
  109. Dialog.Start()
  110. SetStepComplete(Spawn, TheTruthisoutThere, 2)
  111. end
  112. --QUEST 2
  113. function Dialog1c(NPC,Spawn)
  114. FaceTarget(NPC, Spawn)
  115. Dialog.New(NPC, Spawn)
  116. Dialog.AddDialog("I regret my hands have been tied in that matter. A passel of Inquisitors is scheduled to arrive, but they could be interrogating G'Viz for weeks. I grow impatient to see our traitor under the blade of justice. Hmm ... of course, if someone else were to take care of the problem behind my back ...")
  117. Dialog.AddVoiceover("voiceover/english/captain_l_nek/fprt_hood05/quests/captainlnek/lnek_x2_initial.mp3",3788373781,4065934543)
  118. Dialog.AddOption("It would be a shame if something happened to this troublemaker...", "OfferQuest2")
  119. Dialog.AddOption("Would you look at that? I must be going.")
  120. Dialog.Start()
  121. end
  122. function OfferQuest2(NPC,Spawn)
  123. if CanReceiveQuest(Spawn, SilencedSpeech) then
  124. OfferQuest(NPC, Spawn, SilencedSpeech)
  125. end
  126. end
  127. function Dialog2(NPC,Spawn)
  128. FaceTarget(NPC, Spawn)
  129. Dialog.New(NPC, Spawn)
  130. Dialog.AddDialog("Hmmm ... I seem to have found a hangnail on my thumb. Eh, who are you? What nonsense are you about? I don't waste my time chattering with the rabble. Inquisitors have arrived to interrogate an important prisoner, and I must inform them of a complication. So, unless you're here to report seditious speech, you had best be on your way, sirrah!")
  131. Dialog.AddVoiceover("voiceover/english/captain_l_nek/fprt_hood05/quests/captainlnek/lnek_x2_finish.mp3",657243154,2443782081)
  132. PlayFlavor(NPC, "","","sniff",0,0, Spawn)
  133. Dialog.AddOption("I see... as you were.", "Dialog2a")
  134. Dialog.Start()
  135. if GetQuestStep(Spawn, SilencedSpeech)==2 then
  136. SetStepComplete(Spawn, SilencedSpeech, 2)
  137. end
  138. end