Skip to content

Commit

Permalink
fix: lloyd and thorn knight boss fights (#1775)
Browse files Browse the repository at this point in the history
  • Loading branch information
luan authored Nov 4, 2023
1 parent 20cd0ff commit c43753e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ monster.flags = {
hostile = true,
convinceable = false,
pushable = false,
rewardBoss = true,
rewardBoss = false,
illusionable = false,
canPushItems = true,
canPushCreatures = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ monster.flags = {
hostile = true,
convinceable = false,
pushable = false,
rewardBoss = true,
rewardBoss = false,
illusionable = false,
canPushItems = true,
canPushCreatures = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function forgottenKnowledgeThorn.onUse(player, item, fromPosition, target, toPos
return true
end
lever:teleportPlayers()
lever:setCooldownAllPlayers(config.bossName, os.time() + config.timeToFightAgain * 3600)
lever:setCooldownAllPlayers("The Enraged Thorn Knight", os.time() + config.timeToFightAgain * 3600)
addEvent(function()
local old_players = lever:getInfoPositions()
spec:clearCreaturesCache()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ local config = {
{ bossPosition = Position(32975, 31664, 13), bossName = "The Freezing Time Guardian" },
{ bossPosition = Position(32980, 31664, 13), bossName = "The Blazing Time Guardian" },
},
monsters = {
{ cosmic = "cosmic energy prism a invu", pos = Position(32801, 32827, 14) },
{ cosmic = "cosmic energy prism b invu", pos = Position(32798, 32827, 14) },
{ cosmic = "cosmic energy prism c invu", pos = Position(32803, 32826, 14) },
{ cosmic = "cosmic energy prism d invu", pos = Position(32796, 32826, 14) },
},
specPos = {
from = Position(32967, 31654, 13),
to = Position(32989, 31677, 14),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,26 @@ local function revertLloyd(prismId)
local lloydTile = Tile(Position(32799, 32826, 14))
if lloydTile then
local lloyd = lloydTile:getTopCreature()
lloyd:teleportTo(Position(32799, 32829, 14))
lloyd:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
if lloyd then
lloyd:teleportTo(Position(32799, 32829, 14))
lloyd:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
end

local tile = Tile(monsters[prismId].pos)
if tile then
local creature = tile:getTopCreature()
if creature then
creature:remove()
local creatures = tile:getCreatures()
for _, creature in ipairs(creatures) do
if creature:isMonster() then
creature:remove()
end
end
Game.createMonster(monsters[prismId].cosmicInvu, Position(monsters[prismId].pos), true, true)
end
end

local lloydPrepareDeath = CreatureEvent("LloydPrepareDeath")
function lloydPrepareDeath.onPrepareDeath(creature, lastHitKiller, mostDamageKiller)
local targetMonster = creature:getMonster()
if not creature or not targetMonster then
return true
end

local prismCount = 1
for m = 1, #monsters do
local cosmic = Tile(Position(monsters[m].pos)):getTopCreature()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ deathEvent:register()

local serverstartup = GlobalEvent("KillingInTheNameOfMonsterDeathStartup")
function serverstartup.onStartup()
logger.info("[KillingInTheNameOfMonsterDeathStartup] registering monsters")
local monsters = Set({}, { insensitive = true })
for _, task in pairs(tasks.GrizzlyAdams) do
monsters = monsters:union(task.creatures)
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/reward_chest/boss_death.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function bossDeath.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUn
-- Make sure it is a boss
if monsterType and monsterType:isRewardBoss() then
if not corpse.isContainer or not corpse:isContainer() then
if corpse.getId() then
if corpse.getId then
logger.warn("[bossDeath.onDeath] Corpse (id: {}, name: {}) for reward boss {} is not a container.", corpse:getId(), corpse:getName(), creature:getName())
else
logger.warn("[bossDeath.onDeath] Error to get corpseId from boss: {}", creature:getName())
Expand Down

0 comments on commit c43753e

Please sign in to comment.