9
3

forgottenguardian.lua 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/forgottenguardian.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.02.26 05:02:19
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. local Level = GetLevel(NPC)
  10. local level1 =9
  11. local level2 = 10
  12. local difficulty1 = 6
  13. local hp1 = 275
  14. local power1 = 110
  15. local difficulty2 = 6
  16. local hp2 = 370
  17. local power2 = 130
  18. if Level == level1 then
  19. SpawnSet(NPC, "difficulty", difficulty1)
  20. SpawnSet(NPC, "hp", hp1)
  21. SpawnSet(NPC, "power", power1)
  22. elseif Level == level2
  23. then
  24. SpawnSet(NPC, "difficulty", difficulty2)
  25. SpawnSet(NPC, "hp", hp2)
  26. SpawnSet(NPC, "power", power2)
  27. end
  28. ChooseMovement(NPC)
  29. end
  30. function ChooseMovement(NPC)
  31. -- if not GetSpawnLocationID(NPC,423685) and not GetSpawnLocationID(NPC,133772746) and not GetSpawnLocationID (NPC,133772747) and not GetSpawnLocationID (NP, 133772748) then
  32. local route = math.random(1,4)
  33. if route == 1 then
  34. RouteOne(NPC, Spawn)
  35. elseif route == 2 then
  36. RouteTwo(NPC, Spawn)
  37. elseif route == 3 then
  38. RouteThree(NPC, Spawn)
  39. elseif route == 4 then
  40. RouteFour(NPC, Spawn)
  41. end
  42. end
  43. --end
  44. function RouteOne(NPC, Spawn)
  45. local X = GetX(NPC)
  46. local Y = GetY(NPC)
  47. local Z = GetZ(NPC)
  48. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  49. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
  50. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
  51. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
  52. MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
  53. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  54. end
  55. function RouteTwo(NPC, Spawn)
  56. local X = GetX(NPC)
  57. local Y = GetY(NPC)
  58. local Z = GetZ(NPC)
  59. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  60. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
  61. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
  62. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
  63. MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
  64. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(20,45))
  65. end
  66. function RouteThree(NPC, Spawn)
  67. local X = GetX(NPC)
  68. local Y = GetY(NPC)
  69. local Z = GetZ(NPC)
  70. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  71. MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
  72. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
  73. MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
  74. MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
  75. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  76. end
  77. function RouteFour(NPC, Spawn)
  78. local X = GetX(NPC)
  79. local Y = GetY(NPC)
  80. local Z = GetZ(NPC)
  81. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
  82. MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
  83. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
  84. MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
  85. MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
  86. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
  87. end
  88. function respawn(NPC, Spawn)
  89. spawn(NPC)
  90. end
  91. function hailed(NPC, Spawn)
  92. end