eq2emu-content/SpawnScripts/ForestRuins/Stoneshell.lua
2024-10-26 11:37:28 +00:00

99 lines
No EOL
3.1 KiB
Lua
Executable file

--[[
Script Name : SpawnScriptsForestRuins/Stoneshell.lua
Script Author : LordPazuzu 123
Script Date : 2022.06.09 11:06:12
Script Purpose :
:
--]]
function spawn(NPC)
local Level = GetLevel(NPC)
local level1 =6
local level2 = 7
local difficulty1 = 5
local hp1 = 70
local power1 = 45
local difficulty2 = 5
local hp2 = 125
local power2 = 55
if Level == level1 then
SpawnSet(NPC, "difficulty", difficulty1)
SpawnSet(NPC, "hp", hp1)
SpawnSet(NPC, "power", power1)
elseif Level == level2
then
SpawnSet(NPC, "difficulty", difficulty2)
SpawnSet(NPC, "hp", hp2)
SpawnSet(NPC, "power", power2)
end
ChooseMovement(NPC)
end
function ChooseMovement(NPC)
local route = math.random(1,4)
if route == 1 then
RouteOne(NPC, Spawn)
elseif route == 2 then
RouteTwo(NPC, Spawn)
elseif route == 3 then
RouteThree(NPC, Spawn)
elseif route == 4 then
RouteFour(NPC, Spawn)
end
end
function RouteOne(NPC, Spawn)
local X = GetX(NPC)
local Y = GetY(NPC)
local Z = GetZ(NPC)
MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X + 4, Y, Z + 4, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
end
function RouteTwo(NPC, Spawn)
local X = GetX(NPC)
local Y = GetY(NPC)
local Z = GetZ(NPC)
MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X - 4, Y, Z - 4, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(20,45))
end
function RouteThree(NPC, Spawn)
local X = GetX(NPC)
local Y = GetY(NPC)
local Z = GetZ(NPC)
MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
MovementLoopAddLocation(NPC, X + 4, Y, Z, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X + 4, Y, Z - 4, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
end
function RouteFour(NPC, Spawn)
local X = GetX(NPC)
local Y = GetY(NPC)
local Z = GetZ(NPC)
MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(2,10))
MovementLoopAddLocation(NPC, X - 4, Y, Z, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X - 4, Y, Z + 4, 2, math.random(20,45))
MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(20,45))
end
function respawn(NPC, Spawn)
spawn(NPC)
end
function hailed(NPC, Spawn)
FaceTarget(NPC, Spawn)
end