9
3

Cinaldar.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. --[[
  2. Script Name : SpawnScripts/Castleview/Cinaldar.lua
  3. Script Purpose : Cinaldar <Guard>
  4. Script Author : Dorbin
  5. Script Date : 2022.01.26
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericGuardVoiceOvers.lua")
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  11. waypoints(NPC)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function InRange(NPC, Spawn)
  17. CheckFaction(NPC, Spawn, "Qeynos")
  18. end
  19. function LeaveRange(NPC, Spawn)
  20. end
  21. function hailed(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. GenericGuardHail(NPC, Spawn)
  24. end
  25. function Action(NPC)
  26. local choice = MakeRandomInt(1, 4)
  27. if choice == 1 then
  28. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn)
  29. elseif choice == 2 then
  30. PlayFlavor(NPC, "", "", "listen", 0, 0, Spawn)
  31. elseif choice == 3 then
  32. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  33. elseif choice == 4 then
  34. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  35. end
  36. end
  37. function waypoints(NPC)
  38. MovementLoopAddLocation(NPC, 730.44, -21.08, -128.86, 2, 1)
  39. MovementLoopAddLocation(NPC, 730.44, -21.08, -128.86, 2, 10,"FaceGuardGarath")
  40. MovementLoopAddLocation(NPC, 730.44, -21.08, -128.86, 2, 1)
  41. MovementLoopAddLocation(NPC, 730.13, -21.14, -130.37, 2, 0)
  42. MovementLoopAddLocation(NPC, 734.83, -21.29, -127.29, 2, 0)
  43. MovementLoopAddLocation(NPC, 746.12, -21.34, -126.72, 2, 0)
  44. MovementLoopAddLocation(NPC, 748.78, -21.27, -129.5, 2, 0)
  45. MovementLoopAddLocation(NPC, 745.63, -21.26, -131.55, 2, 0)
  46. MovementLoopAddLocation(NPC, 737.59, -17.77, -131.91, 2, 0)
  47. MovementLoopAddLocation(NPC, 733.67, -17.74, -133.23, 2, 0)
  48. MovementLoopAddLocation(NPC, 731.06, -17.53, -138.33, 2, 0)
  49. MovementLoopAddLocation(NPC, 731.58, -15.49, -148.83, 2, 2,0)
  50. MovementLoopAddLocation(NPC, 731.58, -15.49, -148.83, 2, math.random(10, 15),"Action")
  51. MovementLoopAddLocation(NPC, 715.45, -16.19, -148.83, 2, 2, 0)
  52. MovementLoopAddLocation(NPC, 715.45, -16.19, -148.83, 2, math.random(10, 15),"Action")
  53. MovementLoopAddLocation(NPC, 711.48, -16.15, -157.12, 2, math.random(5, 10),0)
  54. MovementLoopAddLocation(NPC, 735.42, -15.2, -158.17, 2, 0)
  55. MovementLoopAddLocation(NPC, 736.44, -15.24, -148.46, 2, 2, 0)
  56. MovementLoopAddLocation(NPC, 736.44, -15.24, -148.46, 2, math.random(10, 15),"Action")
  57. MovementLoopAddLocation(NPC, 731.48, -15.42, -143.05, 2, 0)
  58. MovementLoopAddLocation(NPC, 731.35, -17.59, -138.21, 2, 0)
  59. MovementLoopAddLocation(NPC, 733.43, -17.73, -133.08, 2, 0)
  60. MovementLoopAddLocation(NPC, 747.87, -21.25, -131.61, 2, 0)
  61. MovementLoopAddLocation(NPC, 766.74, -20.28, -131.24, 2, 2,0)
  62. MovementLoopAddLocation(NPC, 766.74, -20.28, -131.24, 2, math.random(10, 15),"Action")
  63. MovementLoopAddLocation(NPC, 767.38, -20.49, -133.78, 2, 0)
  64. MovementLoopAddLocation(NPC, 751.87, -21.13, -126.24, 2, 2,0)
  65. MovementLoopAddLocation(NPC, 751.87, -21.13, -126.24, 2, math.random(10, 15),"Action")
  66. MovementLoopAddLocation(NPC, 735.25, -21.34, -126.11, 2, 0)
  67. end
  68. function FaceGuardGarath(NPC) -- Saluting Knight-Captain Garath script
  69. local Garath = GetSpawn(NPC, 2360031)
  70. if Garath ~= nil then
  71. FaceTarget(NPC, Garath)
  72. AddTimer(NPC, 1000, "SaluteGuardGarath")
  73. end
  74. end
  75. function SaluteGuardGarath(NPC)
  76. local Garath = GetSpawn(NPC, 2360031)
  77. if Garath ~= nil then
  78. PlayAnimation(NPC, 12167)
  79. AddTimer(NPC, 1000, "GarathFacesGuardCinaldar")
  80. end
  81. end
  82. function GarathFacesGuardCinaldar(NPC)
  83. local Garath = GetSpawn(NPC, 2360031)
  84. if Garath ~= nil then
  85. FaceTarget(Garath, NPC)
  86. AddTimer(NPC, 500, "GarathSalutesGuardCinaldar")
  87. end
  88. end
  89. function GarathSalutesGuardCinaldar(NPC)
  90. local Garath = GetSpawn(NPC, 2360031)
  91. if Garath ~= nil then
  92. PlayAnimation(Garath, 12167)
  93. end
  94. end