9
3

aputridbrigand.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. --[[
  2. Script Name : SpawnScripts/Cache/aputridbrigand.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.12.05 04:12:55
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. function spawn(NPC, Spawn)
  10. combatModule(NPC, Spawn)
  11. waypoints(NPC)
  12. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  13. SetTempVariable(NPC, "OnGuard", "true")
  14. end
  15. function InRange(NPC,Spawn)
  16. if GetTempVariable(NPC,"OnGuard")=="true" and not IsInCombat(NPC) and GetY(Spawn) <=2 then
  17. FaceTarget(NPC,Spawn)
  18. SetTempVariable(NPC, "OnGuard", "false")
  19. AddTimer(NPC,2500,"Checking",1,Spawn)
  20. AddTimer(NPC,5000,"Checking",1,Spawn)
  21. AddTimer(NPC,8000,"Checking",1,Spawn)
  22. AddTimer(NPC,10000,"ResetGuard",1,Spawn)
  23. AddTimer(NPC,9000,"ResetGuardEmote",1,Spawn)
  24. choice = MakeRandomInt(1,3)
  25. if choice ==1 then
  26. PlayFlavor(NPC, "", "What was that?", "peer", 0, 0, Spawn, 0)
  27. elseif choice ==2 then
  28. PlayFlavor(NPC, "", "", "doubletake", 0, 0, Spawn, 0)
  29. SendMessage(Spawn,"The brigand heard something.")
  30. elseif choice ==3 then
  31. PlayFlavor(NPC, "", "Hmm?", "stare", 0, 0, Spawn, 0)
  32. end
  33. end
  34. end
  35. function LeaveRange(NPC,Spawn)
  36. if GetTempVariable(NPC,"OnGuard")=="false" then
  37. SetTempVariable(NPC, "OnGuard", "true")
  38. end
  39. end
  40. function Checking(NPC,Spawn)
  41. if GetDistance(NPC,Spawn) <=8 and HasMoved(Spawn) and GetY(Spawn) <=2 then
  42. Attack(NPC,Spawn)
  43. end
  44. end
  45. function respawn(NPC)
  46. spawn(NPC)
  47. end
  48. function aggro(NPC,Spawn)
  49. choice = MakeRandomInt(1,3)
  50. if choice ==1 then
  51. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_aggro_gm_583690dc.mp3", "Summon help! We have invaders!", "", 3340212225, 279643307, Spawn, 0)
  52. elseif choice ==2 then
  53. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_aggro_gm_a203c9ec.mp3", "Prepare to face your doom, meddler.", "", 1496819882, 365167432, Spawn, 0)
  54. elseif choice ==3 then
  55. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_aggro_gm_a30c4f9d.mp3", "To arms!", "", 1238020980, 748146443, Spawn, 0)
  56. end
  57. end
  58. function waypoints(NPC)
  59. if GetSpawnLocationID(NPC)== 133781197 then
  60. MovementLoopAddLocation(NPC, 14.67, -0.24, 11.21, 2, 4)
  61. MovementLoopAddLocation(NPC, 8.17, -0.25, 6.32, 2, 0)
  62. MovementLoopAddLocation(NPC, 1.14, -0.24, 0.73, 2, 0)
  63. MovementLoopAddLocation(NPC, -1.36, -0.24, -1.61, 2, 4)
  64. MovementLoopAddLocation(NPC, 4.94, -0.25, 3.33, 2, 0)
  65. MovementLoopAddLocation(NPC, 14.08, -0.24, 1.97, 2, 4)
  66. MovementLoopAddLocation(NPC, 16.66, -0.24, 4.09, 2, 0)
  67. MovementLoopAddLocation(NPC, 18.32, -0.24, 5.45, 2, 2)
  68. MovementLoopAddLocation(NPC, 13.93, -0.25, 1.65, 2, 0)
  69. MovementLoopAddLocation(NPC, 9.06, -0.25, 3.94, 2, 0)
  70. MovementLoopAddLocation(NPC, 8.13, -0.25, 7.29, 2, 0)
  71. end
  72. end