adocileslitherer.lua 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. --[[
  2. Script Name : SpawnScripts/Darklight/adocileslitherer.lua
  3. Script Author : fearfx
  4. Script Date : 2017.01.21 10:01:20
  5. Script Purpose :
  6. :
  7. --]]
  8. local InfantileIngredients = 157
  9. local DarkLightZone = 034
  10. function spawn(NPC)
  11. choice = math.random(1, 4)
  12. if choice == 1 then
  13. clockwise1(NPC)
  14. elseif choice == 2 then
  15. clockwise2(NPC)
  16. elseif choice == 3 then
  17. counter_clockwise1(NPC)
  18. elseif choice == 4 then
  19. counter_clockwise2(NPC)
  20. end
  21. end
  22. function respawn(NPC)
  23. spawn(NPC)
  24. end
  25. function clockwise1(NPC)
  26. x = GetX(NPC)
  27. y = GetY(NPC)
  28. z = GetZ(NPC)
  29. MovementLoopAddLocation(NPC, x + 7 , y, z - 8 , 1, math.random(5, 15))
  30. MovementLoopAddLocation(NPC, x - 5 , y, z - 10, 1, math.random(5, 15))
  31. MovementLoopAddLocation(NPC, x - 10, y, z + 9 , 1, math.random(5, 15))
  32. MovementLoopAddLocation(NPC, x + 5 , y, z + 8 , 1, math.random(5, 15))
  33. end
  34. function clockwise2(NPC)
  35. x = GetX(NPC)
  36. y = GetY(NPC)
  37. z = GetZ(NPC)
  38. MovementLoopAddLocation(NPC, x + 2 , y, z - 8 , 1, math.random(5, 15))
  39. MovementLoopAddLocation(NPC, x - 7 , y, z - 5 , 1, math.random(5, 15))
  40. MovementLoopAddLocation(NPC, x , y, z + 6 , 1, math.random(5, 15))
  41. MovementLoopAddLocation(NPC, x + 9 , y, z + 1 , 1, math.random(5, 15))
  42. end
  43. function counter_clockwise1(NPC)
  44. x = GetX(NPC)
  45. y = GetY(NPC)
  46. z = GetZ(NPC)
  47. MovementLoopAddLocation(NPC, x - 7 , y, z + 8 , 1, math.random(5, 15))
  48. MovementLoopAddLocation(NPC, x + 5 , y, z + 10, 1, math.random(5, 15))
  49. MovementLoopAddLocation(NPC, x + 10, y, z - 9 , 1, math.random(5, 15))
  50. MovementLoopAddLocation(NPC, x - 5 , y, z - 8 , 1, math.random(5, 15))
  51. end
  52. function counter_clockwise2(NPC)
  53. x = GetX(NPC)
  54. y = GetY(NPC)
  55. z = GetZ(NPC)
  56. MovementLoopAddLocation(NPC, x - 2 , y, z + 8 , 1, math.random(5, 15))
  57. MovementLoopAddLocation(NPC, x + 7 , y, z + 5 , 1, math.random(5, 15))
  58. MovementLoopAddLocation(NPC, x , y, z - 6 , 1, math.random(5, 15))
  59. MovementLoopAddLocation(NPC, x - 9 , y, z - 1 , 1, math.random(5, 15))
  60. end
  61. function respawn(NPC)
  62. spawn(NPC)
  63. end
  64. function death(NPC, Spawn)
  65. if HasQuest(Spawn, InfantileIngredients) and GetQuestStep(Spawn, InfantileIngredients) == 1 then
  66. zone = GetZone(NPC)
  67. local spawnAmount = math.random(1, 3)
  68. x = GetX(NPC)
  69. y = GetY(NPC)
  70. z = GetZ(NPC)
  71. heading = GetHeading(NPC)
  72. while spawnAmount ~= 0 do
  73. newSpawn = SpawnMob(zone, 341286, 1, x + math.random(-1, 1), y+ math.random(-1, 1), z+ math.random(-1, 1), heading+ math.random(-1, 1))
  74. if newSpawn ~= nil then
  75. AddSpawnAccess(newSpawn, Spawn)
  76. end
  77. spawnAmount = spawnAmount - 1
  78. end
  79. end
  80. end