aruinsskulker.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. --[[
  2. Script Name : SpawnScripts/Classic_forest/aruinsskulker.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.10.14 07:10:56
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. AddTimer(NPC,math.random (2000,6000),"EmoteLoop")
  10. --ChooseMovement(NPC)
  11. end
  12. function ChooseMovement(NPC)
  13. local route = math.random(1,4)
  14. if route == 1 then
  15. RouteOne(NPC, Spawn)
  16. elseif route == 2 then
  17. RouteTwo(NPC, Spawn)
  18. elseif route == 3 then
  19. RouteThree(NPC, Spawn)
  20. elseif route == 4 then
  21. RouteFour(NPC, Spawn)
  22. end
  23. end
  24. function RouteOne(NPC, Spawn)
  25. local X = GetX(NPC)
  26. local Y = GetY(NPC)
  27. local Z = GetZ(NPC)
  28. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  29. MovementLoopAddLocation(NPC, X + 8, Y, Z, 2,math.random(5,10))
  30. MovementLoopAddLocation(NPC, X + 8, Y, Z + 4, 2, math.random(5,10))
  31. MovementLoopAddLocation(NPC, X + 10, Y, Z, 2, math.random(5,10))
  32. MovementLoopAddLocation(NPC, X + 8, Y, Z + 4, 2, math.random(5,10))
  33. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  34. end
  35. function RouteTwo(NPC, Spawn)
  36. local X = GetX(NPC)
  37. local Y = GetY(NPC)
  38. local Z = GetZ(NPC)
  39. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  40. MovementLoopAddLocation(NPC, X - 8, Y, Z, 2, math.random(5,10))
  41. MovementLoopAddLocation(NPC, X - 8, Y, Z - 4, 2, math.random(5,10))
  42. MovementLoopAddLocation(NPC, X - 10, Y, Z, 2, math.random(5,10))
  43. MovementLoopAddLocation(NPC, X - 8, Y, Z - 4,2, math.random(5,10))
  44. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  45. end
  46. function RouteThree(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(5,10))
  51. MovementLoopAddLocation(NPC, X + 8, Y, Z, 2, math.random(5,10))
  52. MovementLoopAddLocation(NPC, X + 8, Y, Z - 4, 2, math.random(5,10))
  53. MovementLoopAddLocation(NPC, X + 10, Y, Z, 2, math.random(5,10))
  54. MovementLoopAddLocation(NPC, X + 8, Y, Z - 4, 2, math.random(5,10))
  55. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  56. end
  57. function RouteFour(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(5,10))
  62. MovementLoopAddLocation(NPC, X - 8, Y, Z, 2, math.random(5,10))
  63. MovementLoopAddLocation(NPC, X - 8, Y, Z + 4, 2, math.random(5,10))
  64. MovementLoopAddLocation(NPC, X - 10, Y, Z, 2, math.random(5,10))
  65. MovementLoopAddLocation(NPC, X - 8, Y, Z + 4, 2, math.random(5,10))
  66. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  67. end
  68. function respawn(NPC, Spawn)
  69. spawn(NPC)
  70. end
  71. function hailed(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. end
  74. function EmoteLoop(NPC,Spawn)
  75. if IsInCombat(NPC) == false and HasMoved(NPC)==false then
  76. choice = MakeRandomInt(1,12)
  77. if choice == 1 then
  78. PlayFlavor(NPC, "", "", "treaten", 0, 0, Spawn, 0)
  79. elseif choice == 2 then
  80. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn, 0)
  81. elseif choice == 3 then
  82. PlayFlavor(NPC, "", "", "frustrated", 0, 0, Spawn, 0)
  83. elseif choice == 4 then
  84. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn, 0)
  85. elseif choice == 5 then
  86. PlayFlavor(NPC, "", "", "feint", 0, 0, Spawn, 0)
  87. elseif choice == 6 then
  88. PlayFlavor(NPC, "", "", "confused", 0, 0, Spawn, 0)
  89. elseif choice == 7 then
  90. PlayFlavor(NPC, "", "", "taunt", 0, 0, Spawn, 0)
  91. elseif choice == 8 then
  92. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn, 0)
  93. elseif choice == 9 then
  94. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn, 0)
  95. elseif choice == 10 then
  96. PlayFlavor(NPC, "", "", "cackle", 0, 0, Spawn, 0)
  97. elseif choice == 11 then
  98. PlayFlavor(NPC, "", "", "doubletake", 0, 0, Spawn, 0)
  99. elseif choice == 12 then
  100. PlayFlavor(NPC, "", "", "tantrum_short", 0, 0, Spawn, 0)
  101. end
  102. AddTimer(NPC,MakeRandomInt(7000,9000),"EmoteLoop")
  103. else
  104. AddTimer(NPC,MakeRandomInt(10000,11000),"EmoteLoop")
  105. end
  106. end