9
3

amenacingraiderHUMAN.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. --[[
  2. Script Name : SpawnScripts/SunkenCity_Classic/amenacingraiderHUMAN.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.11.02 08:11:58
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. dofile"SpawnScripts/Generic/MonsterCallouts/BaseHuman1.lua"
  10. function spawn(NPC, Spawn)
  11. combatModule(NPC, Spawn)
  12. Appearance(NPC)
  13. local Level = GetLevel(NPC)
  14. local level1 = 7
  15. local level2 = 8
  16. local difficulty1 = 6
  17. local hp1 = 200
  18. local power1 = 90
  19. local difficulty2 = 6
  20. local hp2 = 240
  21. local power2 = 100
  22. if Level == level1 then
  23. SpawnSet(NPC, "difficulty", difficulty1)
  24. SpawnSet(NPC, "hp", hp1)
  25. SpawnSet(NPC, "power", power1)
  26. elseif Level == level2
  27. then
  28. SpawnSet(NPC, "difficulty", difficulty2)
  29. SpawnSet(NPC, "hp", hp2)
  30. SpawnSet(NPC, "power", power2)
  31. end
  32. ChooseMovement(NPC)
  33. end
  34. function ChooseMovement(NPC)
  35. local route = math.random(1,4)
  36. if route == 1 then
  37. RouteOne(NPC, Spawn)
  38. elseif route == 2 then
  39. RouteTwo(NPC, Spawn)
  40. elseif route == 3 then
  41. RouteThree(NPC, Spawn)
  42. elseif route == 4 then
  43. RouteFour(NPC, Spawn)
  44. end
  45. end
  46. function RouteOne(NPC, Spawn)
  47. local X = GetX(NPC)
  48. local Y = GetY(NPC)
  49. local Z = GetZ(NPC)
  50. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,12))
  51. MovementLoopAddLocation(NPC, X + 5, Y, Z, 2,math.random(7,12))
  52. MovementLoopAddLocation(NPC, X , Y, Z + 5, 2, math.random(7,12))
  53. MovementLoopAddLocation(NPC, X + 5, Y, Z -5, 2, math.random(7,12))
  54. MovementLoopAddLocation(NPC, X + 5, Y, Z + 3, 2, math.random(7,12))
  55. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,12), "ChooseMovement")
  56. end
  57. function RouteTwo(NPC, Spawn)
  58. local X = GetX(NPC)
  59. local Y = GetY(NPC)
  60. local Z = GetZ(NPC)
  61. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,12))
  62. MovementLoopAddLocation(NPC, X - 5, Y, Z, 2, math.random(7,12))
  63. MovementLoopAddLocation(NPC, X, Y, Z - 5, 2, math.random(7,12))
  64. MovementLoopAddLocation(NPC, X - 5, Y, Z -2, 2, math.random(7,12))
  65. MovementLoopAddLocation(NPC, X , Y, Z - 3, 2, math.random(7,12))
  66. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,12), "ChooseMovement")
  67. end
  68. function RouteThree(NPC, Spawn)
  69. local X = GetX(NPC)
  70. local Y = GetY(NPC)
  71. local Z = GetZ(NPC)
  72. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,12))
  73. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(7,12))
  74. MovementLoopAddLocation(NPC, X -5, Y, Z - 2, 2, math.random(7,12))
  75. MovementLoopAddLocation(NPC, X + 5, Y, Z -4, 2, math.random(7,12))
  76. MovementLoopAddLocation(NPC, X + 5, Y, Z - 5, 2, math.random(7,12))
  77. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,12), "ChooseMovement")
  78. end
  79. function RouteFour(NPC, Spawn)
  80. local X = GetX(NPC)
  81. local Y = GetY(NPC)
  82. local Z = GetZ(NPC)
  83. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,12))
  84. MovementLoopAddLocation(NPC, X - 4, Y, Z -5, 2, math.random(7,12))
  85. MovementLoopAddLocation(NPC, X - 5, Y, Z + 4, 2, math.random(7,12))
  86. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(7,12))
  87. MovementLoopAddLocation(NPC, X - 5, Y, Z + 3, 2, math.random(7,12))
  88. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,12), "ChooseMovement")
  89. end
  90. function respawn(NPC, Spawn)
  91. spawn(NPC)
  92. end
  93. function hailed(NPC, Spawn)
  94. FaceTarget(NPC, Spawn)
  95. end
  96. function Appearance(NPC)
  97. if GetGender(NPC)==2 then
  98. SpawnSet(NPC,"model_type",132)
  99. else
  100. SpawnSet(NPC,"model_type",134)
  101. end
  102. end