Skip to content

Commit

Permalink
Update Khimaira spawn pos, draw-in + Hydra draw-in
Browse files Browse the repository at this point in the history
  • Loading branch information
cocosolos committed Dec 27, 2024
1 parent cd3c322 commit c5f5e39
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/globals/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ end
---@param pos1 table
---@param pos2 table
---@return boolean
function utils.sameSide(line, pos1, pos2)
function utils.sameSideOfLine(line, pos1, pos2)
-- Calculate vectors
local v1x, v1y = pos1.x - line[1][1], pos1.z - line[1][2]
local v2x, v2y = pos2.x - line[1][1], pos2.z - line[1][2]
Expand Down
44 changes: 44 additions & 0 deletions scripts/zones/Caedarva_Mire/mobs/Khimaira.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,50 @@
---@type TMobEntity
local entity = {}

entity.onMobSpawn = function(mob)
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
end

entity.onMobRoam = function(mob)
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
end

entity.onMobFight = function(mob, target)
local targetPos = target:getPos()
local drawInPositions =
{
{575.152, -19.639, 413.799, targetPos.rot},
{576.142, -20.050, 407.218, targetPos.rot},
{601.734, -15.784, 407.487, targetPos.rot},
{592.576, -16.434, 399.715, targetPos.rot},
{584.961, -18, 397.781, targetPos.rot},
{592.576, -16.434, 399.715, targetPos.rot},
{582.47, -18, 415.788, targetPos.rot},
{589.504, -16.844, 413.867, targetPos.rot},
{599.341, -16, 398.024, targetPos.rot},
{615.569, -15.528, 398.819, targetPos.rot},
}
local drawInTable =
{
conditions =
{
target:getZPos() > 420,
target:getZPos() < 394,
},
position = utils.randomEntry(drawInPositions),
wait = 3,
}
for _, condition in ipairs(drawInTable.conditions) do
if condition then
mob:setMobMod(xi.mobMod.NO_MOVE, 1)
utils.drawIn(target, drawInTable)
break
else
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
end
end
end

entity.onMobDeath = function(mob, player, optParams)
player:addTitle(xi.title.KHIMAIRA_CARVER)
end
Expand Down
8 changes: 4 additions & 4 deletions scripts/zones/FeiYin/mobs/Capricious_Cassie.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ entity.onMobFight = function(mob, target)
conditions =
{
targetPos.z < 130, -- S hallway
not utils.sameSide(arenaBoundaries[1], targetPos, spawnPos),
not utils.sameSide(arenaBoundaries[2], targetPos, spawnPos),
targetPos.z > 250 and not utils.sameSide(arenaBoundaries[3], targetPos, spawnPos),
not utils.sameSide(arenaBoundaries[4], targetPos, spawnPos),
not utils.sameSideOfLine(arenaBoundaries[1], targetPos, spawnPos),
not utils.sameSideOfLine(arenaBoundaries[2], targetPos, spawnPos),
targetPos.z > 250 and not utils.sameSideOfLine(arenaBoundaries[3], targetPos, spawnPos),
not utils.sameSideOfLine(arenaBoundaries[4], targetPos, spawnPos),
},
position = mob:getPos(),
wait = 3,
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Mount_Zhayolm/mobs/Cerberus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ entity.onMobFight = function(mob, target)
{
target:getZPos() > -70,
target:getXPos() < 310,
not utils.sameSide(arenaBoundaries[1], targetPos, spawnPos),
not utils.sameSideOfLine(arenaBoundaries[1], targetPos, spawnPos),
},
position = utils.randomEntry(drawInPositions),
wait = 2,
Expand Down
36 changes: 36 additions & 0 deletions scripts/zones/Wajaom_Woodlands/mobs/Hydra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,43 @@
---@type TMobEntity
local entity = {}

entity.onMobSpawn = function(mob)
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
end

entity.onMobRoam = function(mob)
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
end

entity.onMobFight = function(mob, target)
local targetPos = target:getPos()
local spawnPos = mob:getSpawnPos()

local drawInPositions =
{
{-279.879, -24, -1.103, targetPos.rot},
{-268.899, -23.5, -11.148, targetPos.rot},
{-279.844, -23.75, -11.462, targetPos.rot},
{-268.952, -23.75, -0.583, targetPos.rot},
}
local drawInTable =
{
conditions =
{
utils.distanceSquared(targetPos, spawnPos) > math.pow(18, 2),
},
position = utils.randomEntry(drawInPositions),
wait = 2,
}
for _, condition in ipairs(drawInTable.conditions) do
if condition then
mob:setMobMod(xi.mobMod.NO_MOVE, 1)
utils.drawIn(target, drawInTable)
break
else
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
end
end
local battletime = mob:getBattleTime()
local headgrow = mob:getLocalVar('headgrow')
local broken = mob:getAnimationSub()
Expand Down
3 changes: 2 additions & 1 deletion sql/mob_spawn_points.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20780,7 +20780,8 @@ INSERT INTO `mob_spawn_points` VALUES (17101193,'Heraldic_Imp','Heraldic Imp',19
INSERT INTO `mob_spawn_points` VALUES (17101194,'Heraldic_Imp','Heraldic Imp',19,623.470,-11.110,499.574,4);
INSERT INTO `mob_spawn_points` VALUES (17101195,'Heraldic_Imp','Heraldic Imp',19,575.710,-18.850,451.476,75);
INSERT INTO `mob_spawn_points` VALUES (17101196,'Heraldic_Imp','Heraldic Imp',19,578.602,-18.818,450.053,77);
INSERT INTO `mob_spawn_points` VALUES (17101197,'Khimaira','Khimaira',59,842.000,-1.000,365.000,127);
-- INSERT INTO `mob_spawn_points` VALUES (17101197,'Khimaira','Khimaira',59,842.000,-1.000,365.000,127); -- old spawn pos
INSERT INTO `mob_spawn_points` VALUES (17101197,'Khimaira','Khimaira',59,603.887,-16.140,414.765,255);
INSERT INTO `mob_spawn_points` VALUES (17101198,'Verdelet','Verdelet',60,417.020,-19.295,-69.990,63);
INSERT INTO `mob_spawn_points` VALUES (17101199,'Tyger','Tyger',61,-766.000,-12.000,632.000,239);
INSERT INTO `mob_spawn_points` VALUES (17101200,'Mahjlaef_the_Paintorn','Mahjlaef the Paintorn',62,695.369,-7.147,527.646,42);
Expand Down

0 comments on commit c5f5e39

Please sign in to comment.