9
3

KnightCaptainGerathalas.lua 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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/AdvancementGaze.lua")
  10. dofile("SpawnScripts/Generic/GenericVoiceOvers.lua")
  11. local Rats = 5460
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 9, "InRange", "LeaveRange")
  14. ProvidesQuest(NPC, Rats)
  15. end
  16. function respawn(NPC)
  17. end
  18. function InRange(NPC, Spawn) --Quest Callout
  19. if GetFactionAmount(Spawn,11)>=5000 then
  20. if GetLevel(Spawn) ==8 or GetLevel(Spawn)==9 then
  21. ClassCheck(NPC,Spawn)
  22. end
  23. end
  24. if MakeRandomInt(1, 100) <= 70 then
  25. if GetFactionAmount(Spawn,11)>0 then
  26. if GetLevel(Spawn) <5 then
  27. FaceTarget(NPC, Spawn)
  28. 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)
  29. elseif not HasCompletedQuest (Spawn, Rats) and not HasQuest (Spawn, Rats) and GetLevel(Spawn) >=5 then
  30. FaceTarget(NPC, Spawn)
  31. 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)
  32. else
  33. choice = math.random(1,3)
  34. if choice ==1 then
  35. FaceTarget(NPC, Spawn)
  36. 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)
  37. elseif choice ==2 then
  38. FaceTarget(NPC, Spawn)
  39. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  40. else
  41. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  42. end
  43. end
  44. end
  45. end
  46. end
  47. --[[function dawn(NPC,Spawn) -- Playing with leaving during the night and returning in the day. Faaaaailure.
  48. if not IsNight(GetZone(NPC)) then
  49. SpawnMob(NPC, 2360031)
  50. PlayFlavor(NPC,"","","stretch",0,0)
  51. MoveToLocation(NPC, 729.04, -21.05, -142.38, 2)
  52. MoveToLocation(NPC, 728.217, -20.5, -129.013, 2)
  53. end
  54. function dusk(NPC,Spawn)
  55. --local Awake = GetSpawn(NPC, 2360031)
  56. if IsNight(GetZone(NPC)) then
  57. Say(NPC, "It is night")
  58. PlayFlavor(NPC,"","","yawn",0,0)
  59. PlayAnimation(NPC, 891)
  60. AddTimer(NPC,11000, "GoToSleep")
  61. end
  62. end
  63. function GoToSleep(NPC)
  64. MoveToLocation(NPC, 726.90, -21.1, -139.30, 2)
  65. MoveToLocation(NPC, 729.04, -21.05, -142.38, 2)
  66. AddTimer(NPC,8000, "Sleep")
  67. end
  68. function Sleep(NPC)
  69. Despawn(NPC)
  70. end]]--
  71. function hailed(NPC, Spawn)
  72. if GetLevel(Spawn) <5 then
  73. FaceTarget(NPC, Spawn)
  74. 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)
  75. else
  76. FaceTarget(NPC, Spawn)
  77. Dialog.New(NPC, Spawn)
  78. Dialog.AddDialog("Good day to you, adventurer. I hope you have been keeping yourself safe.")
  79. Dialog.AddVoiceover("voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas.mp3", 3830137539, 3865597694)
  80. PlayFlavor(NPC, "", "", "attention", 0,0 , Spawn)
  81. if GetQuestStep(Spawn, Rats)==2 then
  82. Dialog.AddOption("I have your tails right here. I told you I could handle it.", "DoneRats")
  83. end
  84. if not HasQuest(Spawn, Rats) and not HasCompletedQuest(Spawn, Rats) then
  85. Dialog.AddOption("Yes, I can take care of myself quite well.", "ICan")
  86. end
  87. Dialog.AddOption("Good day to you too!")
  88. Dialog.Start()
  89. end
  90. end
  91. function ICan(NPC, Spawn)
  92. FaceTarget(NPC, Spawn)
  93. Dialog.New(NPC, Spawn)
  94. Dialog.AddDialog("Oh, you can, can you? Some vermin are eating the food supply. Can you handle... an extermination mission?")
  95. Dialog.AddVoiceover("voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas000.mp3",261740052,1158019812)
  96. PlayFlavor(NPC, "", "", "sniff", 0,0 , Spawn)
  97. Dialog.AddOption("I'm not scared of a few little mice. I'll take care of the problem for you.", "QuestStart")
  98. Dialog.AddOption("I'd rather not get my hands THAT dirty. Sorry.")
  99. Dialog.Start()
  100. end
  101. function QuestStart (NPC, Spawn)
  102. FaceTarget(NPC, Spawn)
  103. OfferQuest(NPC, Spawn, Rats)
  104. end
  105. function DoneRats(NPC, Spawn)
  106. SetStepComplete(Spawn, Rats, 2)
  107. FaceTarget(NPC, Spawn)
  108. Dialog.New(NPC, Spawn)
  109. 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.")
  110. Dialog.AddVoiceover("voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas002.mp3",2969029986,2406700241)
  111. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  112. Dialog.AddOption("Thank you. It should come in very handy.")
  113. Dialog.Start()
  114. end