Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lloyd and thorn knight boss fights #1775

Merged
merged 8 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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