--[[ Script Name : SpawnScripts/Antonica/Stoneclaw.lua Script Author : LordPazuzu Script Date : 2023.02.08 01:02:01 Script Purpose : : --]] function spawn(NPC) dmgMod = GetStr(NPC)/10 SetInfoStructUInt(NPC, "override_primary_weapon", 1) SetInfoStructUInt(NPC, "primary_weapon_damage_low", math.floor(65 + dmgMod)) SetInfoStructUInt(NPC, "primary_weapon_damage_high", math.floor(105 + dmgMod)) 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(5,10)) MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X + 7, Y, Z + 7, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X + 14, Y, Z, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X + 7, Y, Z + 4, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10), "ChooseMovement") 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(5,10)) MovementLoopAddLocation(NPC, X - 7, Y, Z, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X - 7, Y, Z - 7, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X - 14, Y, Z+7, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X - 7, Y, Z - 4, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(5,10), "ChooseMovement") 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(5,10)) MovementLoopAddLocation(NPC, X + 7, Y, Z, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X + 7, Y, Z - 4, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X + 14, Y, Z+12, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X + 7, Y, Z - 4, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10), "ChooseMovement") 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(5,10)) MovementLoopAddLocation(NPC, X - 7, Y, Z+14, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X - 7, Y, Z + 4, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X - 14, Y, Z -14, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X - 7, Y, Z + 4, 2, math.random(5,10)) MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10), "ChooseMovement") end function respawn(NPC, Spawn) spawn(NPC) end function hailed(NPC, Spawn) FaceTarget(NPC, Spawn) end