9
3

KnightCaptainGerathalas.lua 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. --[[
  2. Script Name : SpawnScripts/Castleview/Knight-CaptainGerathalas.lua
  3. Script Purpose : Knight-Captain Gerathalas <Qeynos Guard>
  4. Script Author : Dorbin
  5. Script Date : 2022.01.27
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. dofile("SpawnScripts/Generic/GenericVoiceOvers.lua")
  10. local Rats = 5460
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  13. ProvidesQuest(NPC, Rats)
  14. end
  15. function respawn(NPC)
  16. end
  17. function InRange(NPC, Spawn) --Quest Callout
  18. if MakeRandomInt(1, 100) <= 70 then
  19. if GetFactionAmount(Spawn,11)>0 then
  20. if GetLevel(Spawn) <5 then
  21. FaceTarget(NPC, Spawn)
  22. PlayFlavor(NPC, "voiceover/english/knight-captain_gerathalas/qey_village04/100_guard_captain_gerathalas_multhail1_a85f56d8.mp3", "Good day adventurer! I hope you are staying safe on your arduous journey. Please move on. I must'nt bother you with the unpleasant mission at hand.", "attention", 4040681686, 1885342319, Spawn)
  23. elseif not HasCompletedQuest (Spawn, Rats) and not HasQuest (Spawn, Rats) and GetLevel(Spawn) >=5 then
  24. FaceTarget(NPC, Spawn)
  25. PlayFlavor(NPC, "voiceover/english/knight-captain_gerathalas/qey_village04/100_guard_captain_gerathalas_callout_dc14d674.mp3", "Keep an eye out soldiers! The rats are getting into the food stores again! You adventurer. Would you help rid the city of these putrid vermin?","attention", 379444664, 154385468, Spawn)
  26. else
  27. choice = math.random(1,3)
  28. if choice ==1 then
  29. FaceTarget(NPC, Spawn)
  30. PlayFlavor(NPC, "voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas.mp3", "Good day to you, adventurer. I hope you have been keeping yourself safe.", "salute", 3830137539, 3865597694, Spawn)
  31. elseif choice ==2 then
  32. FaceTarget(NPC, Spawn)
  33. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  34. else
  35. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  36. end
  37. end
  38. end
  39. end
  40. end
  41. --[[function dawn(NPC,Spawn) -- Playing with leaving during the night and returning in the day. Faaaaailure.
  42. if not IsNight(GetZone(NPC)) then
  43. SpawnMob(NPC, 2360031)
  44. PlayFlavor(NPC,"","","stretch",0,0)
  45. MoveToLocation(NPC, 729.04, -21.05, -142.38, 2)
  46. MoveToLocation(NPC, 728.217, -20.5, -129.013, 2)
  47. end
  48. function dusk(NPC,Spawn)
  49. --local Awake = GetSpawn(NPC, 2360031)
  50. if IsNight(GetZone(NPC)) then
  51. Say(NPC, "It is night")
  52. PlayFlavor(NPC,"","","yawn",0,0)
  53. PlayAnimation(NPC, 891)
  54. AddTimer(NPC,11000, "GoToSleep")
  55. end
  56. end
  57. function GoToSleep(NPC)
  58. MoveToLocation(NPC, 726.90, -21.1, -139.30, 2)
  59. MoveToLocation(NPC, 729.04, -21.05, -142.38, 2)
  60. AddTimer(NPC,8000, "Sleep")
  61. end
  62. function Sleep(NPC)
  63. Despawn(NPC)
  64. end]]--
  65. function hailed(NPC, Spawn)
  66. if GetLevel(Spawn) <5 then
  67. FaceTarget(NPC, Spawn)
  68. PlayFlavor(NPC, "voiceover/english/knight-captain_gerathalas/qey_village04/100_guard_captain_gerathalas_multhail1_a85f56d8.mp3", "Good day adventurer! I hope you are staying safe on your arduous journey. Please move on. I must'nt bother you with the unpleasant mission at hand.", "attention", 4040681686, 1885342319, Spawn)
  69. else
  70. FaceTarget(NPC, Spawn)
  71. Dialog.New(NPC, Spawn)
  72. Dialog.AddDialog("Good day to you, adventurer. I hope you have been keeping yourself safe.")
  73. Dialog.AddVoiceover("voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas.mp3", 3830137539, 3865597694)
  74. PlayFlavor(NPC, "", "", "attention", 0,0 , Spawn)
  75. if GetQuestStep(Spawn, Rats)==2 then
  76. Dialog.AddOption("I have your tails right here. I told you I could handle it.", "DoneRats")
  77. end
  78. if not HasQuest(Spawn, Rats) and not HasCompletedQuest(Spawn, Rats) then
  79. Dialog.AddOption("Yes, I can take care of myself quite well.", "ICan")
  80. end
  81. Dialog.AddOption("Good day to you too!")
  82. Dialog.Start()
  83. end
  84. end
  85. function ICan(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. Dialog.New(NPC, Spawn)
  88. Dialog.AddDialog("Oh, you can, can you? Some vermin are eating the food supply. Can you handle... an extermination mission?")
  89. Dialog.AddVoiceover("voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas000.mp3",261740052,1158019812)
  90. PlayFlavor(NPC, "", "", "sniff", 0,0 , Spawn)
  91. Dialog.AddOption("I'm not scared of a few little mice. I'll take care of the problem for you.", "QuestStart")
  92. Dialog.AddOption("I'd rather not get my hands THAT dirty. Sorry.")
  93. Dialog.Start()
  94. end
  95. function QuestStart (NPC, Spawn)
  96. FaceTarget(NPC, Spawn)
  97. OfferQuest(NPC, Spawn, Rats)
  98. end
  99. function DoneRats(NPC, Spawn)
  100. SetStepComplete(Spawn, Rats, 2)
  101. FaceTarget(NPC, Spawn)
  102. Dialog.New(NPC, Spawn)
  103. Dialog.AddDialog("Aye, you did! These look like they came off some big vermin. No easy prey for you I see. Here is the piece of armor I promised you. May it help protect you against more dangerous foes.")
  104. Dialog.AddVoiceover("voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas002.mp3",2969029986,2406700241)
  105. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  106. Dialog.AddOption("Thank you. It should come in very handy.")
  107. Dialog.Start()
  108. end