Skip to content

Commit

Permalink
fix: forgotten knowledge quest bosses (#3298)
Browse files Browse the repository at this point in the history
  • Loading branch information
majestyotbr authored Jan 29, 2025
1 parent ede9b6a commit 69e3b15
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 273 deletions.
Original file line number Diff line number Diff line change
@@ -1,52 +1,30 @@
local config = {
bossPosition = Position(33357, 31182, 10),
newPosition = Position(33359, 31186, 10),
soulPosition = Position(33359, 31182, 12),
boss = {
name = "soul of dragonking zyrtarch",
position = Position(33359, 31182, 12),
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(33391, 31178, 10), teleport = Position(33359, 31186, 10) },
{ pos = Position(33391, 31179, 10), teleport = Position(33359, 31186, 10) },
{ pos = Position(33391, 31180, 10), teleport = Position(33359, 31186, 10) },
{ pos = Position(33391, 31181, 10), teleport = Position(33359, 31186, 10) },
{ pos = Position(33391, 31182, 10), teleport = Position(33359, 31186, 10) },
},
monsters = {
{ name = "soulcatcher", pos = Position(33352, 31187, 10) },
{ name = "soulcatcher", pos = Position(33363, 31187, 10) },
{ name = "soulcatcher", pos = Position(33353, 31176, 10) },
{ name = "soulcatcher", pos = Position(33363, 31176, 10) },
{ name = "dragonking zyrtarch", pos = Position(33357, 31182, 10) },
},
specPos = {
from = Position(33348, 31172, 10),
to = Position(33368, 31190, 12),
},
exit = Position(33407, 31172, 10),
}

local monsters = {
{ position = Position(33352, 31187, 10) },
{ position = Position(33363, 31187, 10) },
{ position = Position(33353, 31176, 10) },
{ position = Position(33363, 31176, 10) },
}

local leverZyrtarch = Action()

function leverZyrtarch.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 8911 then
if player:getPosition() ~= Position(33391, 31178, 10) then
item:transform(8912)
return true
end
end
if item.itemid == 8911 then
local playersTable = {}
if player:doCheckBossRoom("Dragonking Zyrtarch", Position(33348, 31172, 10), Position(33368, 31190, 12)) then
for d = 1, #monsters do
Game.createMonster("soulcatcher", monsters[d].position, true, true)
end
Game.createMonster("dragonking zyrtarch", config.bossPosition, true, true)
Game.createMonster("soul of dragonking zyrtarch", config.soulPosition, true, true)
for y = 31178, 31182 do
local playerTile = Tile(Position(33391, y, 10)):getTopCreature()
if playerTile and playerTile:isPlayer() then
playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
playerTile:teleportTo(config.newPosition)
playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
playerTile:setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.DragonkingTimer, os.time() + 20 * 60 * 60)
table.insert(playersTable, playerTile:getId())
end
end
addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, Position(33348, 31172, 10), Position(33368, 31190, 12), Position(33407, 31172, 10))
item:transform(8912)
end
elseif item.itemid == 8912 then
item:transform(8911)
end

return true
end

leverZyrtarch:position(Position(33391, 31177, 10))
leverZyrtarch:register()
local lever = BossLever(config)
lever:position(Position(33391, 31177, 10))
lever:register()
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function leverMeltingFrozenHorror.onUse(player, item, fromPosition, target, toPo
end
end
if item.itemid == 8911 then
if Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.HorrorTimer) >= 1 then
if Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.HorrorKilled) >= 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait a while, recently someone challenge Frozen Horror.")
return true
end
Expand All @@ -43,11 +43,11 @@ function leverMeltingFrozenHorror.onUse(player, item, fromPosition, target, toPo
playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
playerTile:teleportTo(config.newPosition)
playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
playerTile:setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.HorrorTimer, os.stime() + 20 * 60 * 60)
playerTile:setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.HorrorKilled, os.time() + 20 * 60 * 60)
end
end
Game.setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.HorrorTimer, 1)
addEvent(clearForgotten, 30 * 60 * 1000, Position(32264, 31070, 14), Position(32284, 31104, 14), Position(32319, 31091, 14), Storage.Quest.U11_02.ForgottenKnowledge.HorrorTimer)
Game.setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.HorrorKilled, 1)
addEvent(clearForgotten, 30 * 60 * 1000, Position(32264, 31070, 14), Position(32284, 31104, 14), Position(32319, 31091, 14), Storage.Quest.U11_02.ForgottenKnowledge.HorrorKilled)
item:transform(8912)
elseif item.itemid == 8912 then
item:transform(8911)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,28 @@
local config = {
centerRoom = Position(32912, 31599, 14),
bossPosition = Position(32912, 31599, 14),
newPosition = Position(32911, 31603, 14),
boss = {
name = "Lady Tenebris",
position = Position(32912, 31599, 14),
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(32902, 31623, 14), teleport = Position(32911, 31603, 14) },
{ pos = Position(32902, 31624, 14), teleport = Position(32911, 31603, 14) },
{ pos = Position(32902, 31625, 14), teleport = Position(32911, 31603, 14) },
{ pos = Position(32902, 31626, 14), teleport = Position(32911, 31603, 14) },
{ pos = Position(32902, 31627, 14), teleport = Position(32911, 31603, 14) },
},
monsters = {
{ name = "shadow tentacle", pos = Position(32910, 31599, 14) },
{ name = "shadow tentacle", pos = Position(32912, 31597, 14) },
{ name = "shadow tentacle", pos = Position(32914, 31599, 14) },
},
specPos = {
from = Position(32899, 31587, 14),
to = Position(32923, 31612, 14),
},
exit = Position(32902, 31629, 14),
}

local leverLadyTenebris = Action()

function leverLadyTenebris.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 8911 then
if player:getPosition() ~= Position(32902, 31623, 14) then
return true
end
end
if item.itemid == 8911 then
local playersTable = {}
if player:doCheckBossRoom("Lady Tenebris", Position(32902, 31589, 14), Position(32924, 31610, 14)) then
for d = 1, 6 do
Game.createMonster("shadow tentacle", Position(math.random(32909, 32914), math.random(31596, 31601), 14), true, true)
end
Game.createMonster("lady tenebris", config.bossPosition, true, true)
for y = 31623, 31627 do
local playerTile = Tile(Position(32902, y, 14)):getTopCreature()
if playerTile and playerTile:isPlayer() then
playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
playerTile:teleportTo(config.newPosition)
playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
playerTile:setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.LadyTenebrisTimer, os.time() + 20 * 60 * 60)
table.insert(playersTable, playerTile:getId())
end
end
addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, Position(32902, 31589, 14), Position(32924, 31610, 14), Position(32919, 31639, 14))
item:transform(8912)
end
elseif item.itemid == 8912 then
item:transform(8911)
end

return true
end

leverLadyTenebris:position(Position(32902, 31622, 14))
leverLadyTenebris:register()
local lever = BossLever(config)
lever:position(Position(32902, 31622, 14))
lever:register()
Original file line number Diff line number Diff line change
@@ -1,51 +1,29 @@
local config = {
centerRoom = Position(32799, 32832, 14),
bossPosition = Position(32799, 32827, 14),
newPosition = Position(32800, 32831, 14),
boss = {
name = "Lloyd",
position = Position(32799, 32827, 14),
},
requiredLevel = 250,
playerPositions = {
{ pos = Position(32759, 32868, 14), teleport = Position(32800, 32831, 14) },
{ pos = Position(32759, 32869, 14), teleport = Position(32800, 32831, 14) },
{ pos = Position(32759, 32870, 14), teleport = Position(32800, 32831, 14) },
{ pos = Position(32759, 32871, 14), teleport = Position(32800, 32831, 14) },
{ pos = Position(32759, 32872, 14), teleport = Position(32800, 32831, 14) },
},
monsters = {
{ name = "cosmic energy prism a invu", pos = Position(32801, 32827, 14) },
{ name = "cosmic energy prism b invu", pos = Position(32798, 32827, 14) },
{ name = "cosmic energy prism c invu", pos = Position(32803, 32826, 14) },
{ name = "cosmic energy prism d invu", pos = Position(32796, 32826, 14) },
},
specPos = {
from = Position(32785, 32813, 14),
to = Position(32812, 32838, 14),
},
exit = Position(32815, 32873, 13),
}

local monsters = {
{ cosmic = "cosmic energy prism a", pos = Position(32801, 32827, 14) },
{ cosmic = "cosmic energy prism b", pos = Position(32798, 32827, 14) },
{ cosmic = "cosmic energy prism c", pos = Position(32803, 32826, 14) },
{ cosmic = "cosmic energy prism d", pos = Position(32796, 32826, 14) },
}

local leverLloyd = Action()

function leverLloyd.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 8911 then
if player:getPosition() ~= Position(32759, 32868, 14) then
item:transform(8912)
return true
end
end
if item.itemid == 8911 then
local playersTable = {}
if player:doCheckBossRoom(player:getId(), "Lloyd", Position(32785, 32814, 14), Position(32812, 32838, 14)) then
for n = 1, #monsters do
Game.createMonster(monsters[n].cosmic, monsters[n].pos, true, true)
end
Game.createMonster("lloyd", config.bossPosition, true, true)
for y = 32868, 32872 do
local playerTile = Tile(Position(32759, y, 14)):getTopCreature()
if playerTile and playerTile:isPlayer() then
playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
playerTile:teleportTo(config.newPosition)
playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
playerTile:setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.LloydTimer, os.time() + 20 * 60 * 60)
table.insert(playersTable, playerTile:getId())
end
end
addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, Position(32785, 32814, 14), Position(32812, 32838, 14), Position(32815, 32873, 13))
item:transform(8912)
end
elseif item.itemid == 8912 then
item:transform(8911)
end

return true
end

leverLloyd:position(Position(32759, 32867, 14))
leverLloyd:register()
local lever = BossLever(config)
lever:position(Position(32759, 32867, 14))
lever:register()
Original file line number Diff line number Diff line change
@@ -1,51 +1,44 @@
local config = {
{ newPosition = Position(31985, 32851, 14) },
{ pos = Position(31986, 32840, 14), monster = "a shielded astral glyph" },
{ pos = Position(31975, 32856, 15), monster = "bound astral power" },
{ pos = Position(31987, 32839, 14), monster = "the astral source" },
{ pos = Position(31986, 32823, 15), monster = "the distorted astral source" },
{ pos = Position(31989, 32823, 15), monster = "an astral glyph" },
boss = {
name = "The Last Lore Keeper",
position = Position(31987, 32839, 14),
},
timeToFightAgain = ParseDuration("14d") / 1000,
timeToDefeat = ParseDuration("17m") / 1000,
requiredLevel = 250,
playerPositions = {
{ pos = Position(32018, 32844, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32019, 32844, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32020, 32844, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32018, 32845, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32019, 32845, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32020, 32845, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32018, 32846, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32019, 32846, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32020, 32846, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32018, 32847, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32019, 32847, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32020, 32847, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32018, 32848, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32019, 32848, 14), teleport = Position(31984, 32851, 14) },
{ pos = Position(32020, 32848, 14), teleport = Position(31984, 32851, 14) },
},
monsters = {
{ name = "bound astral power", pos = Position(31973, 32840, 15) },
{ name = "bound astral power", pos = Position(31973, 32856, 15) },
{ name = "bound astral power", pos = Position(31989, 32856, 15) },
{ name = "bound astral power", pos = Position(31989, 32840, 15) },
{ name = "a shielded astral glyph", pos = Position(31986, 32840, 14) },
{ name = "the distorted astral source", pos = Position(31986, 32823, 15) },
{ name = "an astral glyph", pos = Position(31989, 32823, 15) },
},
specPos = {
from = Position(31968, 32821, 14),
to = Position(32004, 32865, 15),
},
exit = Position(32035, 32859, 14),
}

local leverLoreKeeper = Action()

function leverLoreKeeper.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 8911 then
if player:getPosition() ~= Position(32019, 32844, 14) then
item:transform(8912)
return true
end
end
if item.itemid == 8911 then
local playersTable = {}
if player:doCheckBossRoom("The Last Lorekeeper", Position(31968, 32821, 14), Position(32004, 32865, 15)) then
for x = 32018, 32020 do
for y = 32844, 32848 do
local playerTile = Tile(Position(x, y, 14)):getTopCreature()
if playerTile and playerTile:isPlayer() then
playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
playerTile:teleportTo(config[1].newPosition)
playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
playerTile:setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.LastLoreTimer, os.time() + 60 * 60 * 14 * 24)
table.insert(playersTable, playerTile:getId())
end
end
end
for b = 2, #config do
Game.createMonster(config[b].monster, config[b].pos, true, true)
end
Game.setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.AstralPowerCounter, 1)
Game.setStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.AstralGlyph, 0)
player:say("The Astral Glyph begins to draw upon bound astral power to expel you from the room!", TALKTYPE_MONSTER_SAY)
addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, Position(31968, 32821, 14), Position(32004, 32865, 15), Position(32035, 32859, 14))
item:transform(8912)
end
elseif item.itemid == 8912 then
item:transform(8911)
end

return true
end

leverLoreKeeper:position(Position(32019, 32843, 14))
leverLoreKeeper:register()
local lever = BossLever(config)
lever:position(Position(32019, 32843, 14))
lever:register()
Loading

0 comments on commit 69e3b15

Please sign in to comment.