KnightCaptainGerathalas.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. dofile("SpawnScripts/Generic/GenericVoiceOvers.lua")
  9. local Rats = 5460
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, Rats)
  13. end
  14. function respawn(NPC)
  15. end
  16. function InRange(NPC, Spawn) --Quest Callout
  17. if math.random(1, 100) <= 60 then
  18. if GetLevel(Spawn) <5 then
  19. FaceTarget(NPC, Spawn)
  20. 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)
  21. elseif not HasCompletedQuest (Spawn, Rats) and not HasQuest (Spawn, Rats) and GetLevel(Spawn) >=5 then
  22. FaceTarget(NPC, Spawn)
  23. 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)
  24. else
  25. choice = math.random(1,3)
  26. if choice ==1 then
  27. FaceTarget(NPC, Spawn)
  28. 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)
  29. elseif choice ==2 then
  30. FaceTarget(NPC, Spawn)
  31. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  32. else
  33. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  34. end
  35. end
  36. end
  37. end
  38. --[[function dawn(NPC,Spawn) -- Playing with leaving during the night and returning in the day. Faaaaailure.
  39. if not IsNight(GetZone(NPC)) then
  40. SpawnMob(NPC, 2360031)
  41. PlayFlavor(NPC,"","","stretch",0,0)
  42. MoveToLocation(NPC, 729.04, -21.05, -142.38, 2)
  43. MoveToLocation(NPC, 728.217, -20.5, -129.013, 2)
  44. end
  45. function dusk(NPC,Spawn)
  46. --local Awake = GetSpawn(NPC, 2360031)
  47. if IsNight(GetZone(NPC)) then
  48. Say(NPC, "It is night")
  49. PlayFlavor(NPC,"","","yawn",0,0)
  50. PlayAnimation(NPC, 891)
  51. AddTimer(NPC,11000, "GoToSleep")
  52. end
  53. end
  54. function GoToSleep(NPC)
  55. MoveToLocation(NPC, 726.90, -21.1, -139.30, 2)
  56. MoveToLocation(NPC, 729.04, -21.05, -142.38, 2)
  57. AddTimer(NPC,8000, "Sleep")
  58. end
  59. function Sleep(NPC)
  60. Despawn(NPC)
  61. end]]--
  62. function hailed(NPC, Spawn)
  63. if GetLevel(Spawn) <5 then
  64. FaceTarget(NPC, Spawn)
  65. 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)
  66. else
  67. FaceTarget(NPC, Spawn)
  68. PlayFlavor(NPC, "voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas.mp3", "", "", 3830137539, 3865597694, Spawn)
  69. conversation = CreateConversation()
  70. if GetQuestStep(Spawn, Rats)==2 then
  71. AddConversationOption(conversation, "I've reduced the number of putrid vermin in the catacombs.", "DoneRats")
  72. end
  73. if not HasQuest(Spawn, Rats) and not HasCompletedQuest(Spawn, Rats) then
  74. AddConversationOption(conversation, "I can provide assistance if needed.", "ICan")
  75. end
  76. AddConversationOption(conversation, "Good day to you too!")
  77. StartConversation(conversation, NPC, Spawn, "Good day to you, adventurer. I hope you have been keeping yourself safe.")
  78. end
  79. end
  80. function ICan(NPC, Spawn)
  81. FaceTarget(NPC, Spawn)
  82. conversation = CreateConversation()
  83. AddConversationOption(conversation, "I can deal with whatever you need exterminating.", "Exterminate")
  84. AddConversationOption(conversation, "I'd rather not get my hands dirty. Sorry.")
  85. StartConversation(conversation, NPC, Spawn, "Oh, you can, can you? Some vermin are eating the food supply. Can you handle... an extermination mission?")
  86. PlayFlavor(NPC, "voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas000.mp3", "", "ponder", 261740052,1158019812 , Spawn)
  87. end
  88. function Exterminate(NPC, Spawn)
  89. FaceTarget(NPC, Spawn)
  90. conversation = CreateConversation()
  91. AddConversationOption(conversation, "I'll deal with them.", "QuestStart")
  92. AddConversationOption(conversation, "In the catacombs? I'll stay up here thank you very much!")
  93. StartConversation(conversation, NPC, Spawn, "Good, good! The vermin live in the catacombs. Bring me back some of those putrid rat's tails and I'll reward you with a piece of armor.")
  94. PlayFlavor(NPC, "voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas001.mp3", "", "agree", 1809197225,35106101 , Spawn)
  95. end
  96. function QuestStart (NPC, Spawn)
  97. FaceTarget(NPC, Spawn)
  98. OfferQuest(NPC, Spawn, Rats)
  99. end
  100. function DoneRats(NPC, Spawn)
  101. FaceTarget(NPC, Spawn)
  102. conversation = CreateConversation()
  103. AddConversationOption(conversation, "Thank you.", "QuestDone")
  104. StartConversation(conversation, NPC, Spawn, "Ah, you did. These look like they came off some big vermin. No easy pray for you, I see. Here is the piece of armor I promised you. May it protect you against a more dangerous foe.")
  105. PlayFlavor(NPC, "voiceover/english/knight-captain_gerathalas/qey_village04/captaingerathalas002.mp3", "", "agree", 2969029986,2406700241 , Spawn)
  106. end
  107. function QuestDone(NPC, Spawn)
  108. SetStepComplete(Spawn, Rats, 2)
  109. end