diff --git a/data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/lokathmor.lua similarity index 100% rename from data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua rename to data-otservbr-global/monster/quests/the_secret_library/bosses/lokathmor.lua diff --git a/data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/mazzinor.lua similarity index 100% rename from data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua rename to data-otservbr-global/monster/quests/the_secret_library/bosses/mazzinor.lua diff --git a/data-otservbr-global/scripts/actions/bosses_levers/gorzindel.lua b/data-otservbr-global/scripts/actions/bosses_levers/gorzindel.lua deleted file mode 100644 index 2cfe4ffb399..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/gorzindel.lua +++ /dev/null @@ -1,23 +0,0 @@ -local config = { - boss = { - name = "Gorzindel", - position = Position(32687, 32715, 10), - }, - requiredLevel = 250, - playerPositions = { - { pos = Position(32747, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, - { pos = Position(32748, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, - { pos = Position(32749, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, - { pos = Position(32750, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, - { pos = Position(32751, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(32680, 32711, 10), - to = Position(32695, 32726, 10), - }, - exit = Position(32660, 32734, 12), -} - -local lever = BossLever(config) -lever:position({ x = 32746, y = 32749, z = 10 }) -lever:register() diff --git a/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_bossesLever.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_bossesLever.lua deleted file mode 100644 index 6f579ea8e07..00000000000 --- a/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_bossesLever.lua +++ /dev/null @@ -1,167 +0,0 @@ -local mazzinorSummons = { - name = "Wild Knowledge", - eventName = "mazzinorDeath", - middlePosition = Position(32724, 32720, 10), - timing = 25, - positions = { - [1] = Position(32719, 32718, 10), - [2] = Position(32723, 32719, 10), - [3] = Position(32728, 32718, 10), - [4] = Position(32724, 32724, 10), - }, -} - -local ghuloshSummons = { - name = "Bone Jaw", - eventName = "", - middlePosition = Position(32756, 32721, 10), - timing = 25, - positions = { - [1] = Position(32755, 32721, 10), - }, -} - -local gorzindelSummons = { - name = "Mean Minion", - name2 = "Malicious Minion", - eventName = "", - middlePosition = Position(32687, 32719, 10), - timing = 25, - positions = { - [1] = Position(32687, 32717, 10), - }, - positions2 = { - [1] = Position(32687, 32720, 10), - }, - tomesPosition = { - [1] = { name = "stolen knowledge of armor", position = Position(32687, 32707, 10) }, - [2] = { name = "stolen knowledge of summoning", position = Position(32698, 32715, 10) }, - [3] = { name = "stolen knowledge of lifesteal", position = Position(32693, 32729, 10) }, - [4] = { name = "stolen knowledge of spells", position = Position(32681, 32729, 10) }, - [5] = { name = "stolen knowledge of healing", position = Position(32676, 32715, 10) }, - }, -} - -local lokathmorSummons = { - name = "Knowledge Raider", - eventName = "", - middlePosition = Position(32751, 32689, 10), - timing = 25, - positions = { - [1] = Position(32747, 32684, 10), - [2] = Position(32755, 32684, 10), - [3] = Position(32755, 32694, 10), - [4] = Position(32747, 32694, 10), - }, -} - -local bossNames = { "mazzinor", "supercharged mazzinor", "lokathmor", "ghulosh", "ghuloshz' deathgaze", "gorzindel", "stolen tome of portals" } - -local function spawnSummons(k, monsterName, eventName, timing, positionTable, middlePosition, isGorzindel) - local spectators = Game.getSpectators(middlePosition, false, false, 12, 12, 12, 12) - local hasPlayer = false - - for _, c in pairs(spectators) do - if c and c:isPlayer() then - hasPlayer = true - end - end - - if isGorzindel then - local hasTome = false - for _, c in pairs(spectators) do - for i = 1, #gorzindelSummons.tomesPosition do - if c and (c:getName():lower() == gorzindelSummons.tomesPosition[i].name) then - hasTome = true - end - end - end - if not hasTome then - return false - end - end - if hasPlayer then - if k <= 4 then - for i = 1, #positionTable do - local sqm = positionTable[i] - if sqm then - sqm:sendMagicEffect(CONST_ME_TELEPORT) - end - end - k = k + 1 - addEvent(spawnSummons, 2 * 1000, k, monsterName, eventName, timing, positionTable, middlePosition, isGorzindel) - else - for i = 1, #positionTable do - local monster = Game.createMonster(monsterName, positionTable[i]) - if monster then - monster:registerEvent(eventName) - end - end - addEvent(function() - spawnSummons(1, monsterName, eventName, timing, positionTable, middlePosition, isGorzindel) - end, timing * 1000) - end - end -end - -local leverInfo = { - [1] = { bossName = "Mazzinor", storage = Storage.Quest.U11_80.TheSecretLibrary.Library.MazzinorTimer, exit = Position(32616, 32532, 13), position = Position(32720, 32773, 10), type = "x", bossPosition = Position(32724, 32720, 10), teleportTo = Position(32724, 32726, 10), fromPosition = Position(32715, 32712, 10), toPosition = Position(32733, 32729, 10) }, - [2] = { bossName = "Lokathmor", storage = Storage.Quest.U11_80.TheSecretLibrary.Library.LokathmorTimer, exit = Position(32467, 32654, 12), position = Position(32720, 32749, 10), type = "x", bossPosition = Position(32751, 32689, 10), teleportTo = Position(32750, 32694, 10), fromPosition = Position(32741, 32680, 10), toPosition = Position(32759, 32697, 10) }, - [3] = { bossName = "Ghulosh", storage = Storage.Quest.U11_80.TheSecretLibrary.Library.GhuloshTimer, exit = Position(32659, 32713, 13), position = Position(32746, 32773, 10), type = "x", bossPosition = Position(32756, 32721, 10), teleportTo = Position(32755, 32727, 10), fromPosition = Position(32745, 32711, 10), toPosition = Position(32768, 32730, 10) }, - [4] = { bossName = "Gorzindel", storage = Storage.Quest.U11_80.TheSecretLibrary.Library.GorzindelTimer, exit = Position(32660, 32734, 12), position = Position(32746, 32749, 10), type = "x", bossPosition = Position(32685, 32717, 10), teleportTo = Position(32687, 32724, 10), fromPosition = Position(32671, 32703, 10), toPosition = Position(32702, 32734, 10) }, -} - -local actions_library_bossesLever = Action() - -function actions_library_bossesLever.onUse(player, item, fromPosition, itemEx, toPosition) - local playersTable = {} - - for _, lever in pairs(leverInfo) do - if toPosition == lever.position then - if player:doCheckBossRoom(lever.bossName, lever.fromPosition, lever.toPosition) then - if lever.type == "x" then - local startPos = lever.position.x + 1 - for x = startPos, startPos + 4 do - local sqm = Tile(Position(x, lever.position.y, lever.position.z)) - if sqm then - local c = sqm:getTopCreature() - if c and c:isPlayer() then - table.insert(playersTable, c:getId()) - c:teleportTo(lever.teleportTo) - c:setStorageValue(lever.storage, os.time() + 20 * 60 * 60) - end - end - end - end - - local monster = Game.createMonster(lever.bossName, lever.bossPosition) - - if monster then - if lever.bossName:lower() == "mazzinor" then - addEvent(spawnSummons, 4 * 1000, 1, mazzinorSummons.name, mazzinorSummons.eventName, mazzinorSummons.timing, mazzinorSummons.positions, mazzinorSummons.middlePosition, false) - elseif lever.bossName:lower() == "lokathmor" then - addEvent(spawnSummons, 4 * 1000, 1, lokathmorSummons.name, lokathmorSummons.eventName, lokathmorSummons.timing, lokathmorSummons.positions, lokathmorSummons.middlePosition, false) - elseif lever.bossName:lower() == "ghulosh" then - addEvent(spawnSummons, 4 * 1000, 1, ghuloshSummons.name, ghuloshSummons.eventName, ghuloshSummons.timing, ghuloshSummons.positions, ghuloshSummons.middlePosition, false) - local book = Game.createMonster("The Book of Death", Position(32755, 32716, 10)) - Game.setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.Library.Ghulosh, 1) - elseif lever.bossName:lower() == "gorzindel" then - addEvent(spawnSummons, 4 * 1000, 1, gorzindelSummons.name, gorzindelSummons.eventName, gorzindelSummons.timing, gorzindelSummons.positions, gorzindelSummons.middlePosition, true) - addEvent(spawnSummons, 4 * 1000, 1, gorzindelSummons.name2, gorzindelSummons.eventName, gorzindelSummons.timing, gorzindelSummons.positions2, gorzindelSummons.middlePosition, true) - local tome = Game.createMonster("Stolen Tome of Portals", Position(32688, 32715, 10)) - for _, k in pairs(gorzindelSummons.tomesPosition) do - local monster = Game.createMonster(k.name, k.position) - local minion = Game.createMonster("Malicious Minion", k.position) - end - end - end - addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, lever.fromPosition, lever.toPosition, lever.exit) - end - end - end - - return true -end - -actions_library_bossesLever:aid(4950) -actions_library_bossesLever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/ghulosh.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_ghulosh.lua similarity index 86% rename from data-otservbr-global/scripts/actions/bosses_levers/ghulosh.lua rename to data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_ghulosh.lua index 48fb4c17818..4f618c76d7b 100644 --- a/data-otservbr-global/scripts/actions/bosses_levers/ghulosh.lua +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_ghulosh.lua @@ -11,6 +11,9 @@ local config = { { pos = Position(32750, 32773, 10), teleport = Position(32757, 32727, 10), effect = CONST_ME_TELEPORT }, { pos = Position(32751, 32773, 10), teleport = Position(32757, 32727, 10), effect = CONST_ME_TELEPORT }, }, + monsters = { + { name = "the book of death", pos = Position(32756, 32718, 10) }, + }, specPos = { from = Position(32748, 32713, 10), to = Position(32763, 32729, 10), @@ -19,5 +22,5 @@ local config = { } local lever = BossLever(config) -lever:position({ x = 32746, y = 32773, z = 10 }) +lever:position(Position(32746, 32773, 10)) lever:register() diff --git a/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_gorzindel.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_gorzindel.lua new file mode 100644 index 00000000000..8ab1e568feb --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_gorzindel.lua @@ -0,0 +1,38 @@ +local config = { + boss = { + name = "Gorzindel", + position = Position(32687, 32715, 10), + }, + requiredLevel = 250, + playerPositions = { + { pos = Position(32747, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, + { pos = Position(32748, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, + { pos = Position(32749, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, + { pos = Position(32750, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, + { pos = Position(32751, 32749, 10), teleport = Position(32686, 32721, 10), effect = CONST_ME_TELEPORT }, + }, + monsters = { + { name = "mean minion", pos = Position(32687, 32717, 10) }, + { name = "malicious minion", pos = Position(32687, 32720, 10) }, + { name = "malicious minion", pos = Position(32687, 32708, 10) }, + { name = "malicious minion", pos = Position(32698, 32716, 10) }, + { name = "malicious minion", pos = Position(32693, 32730, 10) }, + { name = "malicious minion", pos = Position(32681, 32730, 10) }, + { name = "malicious minion", pos = Position(32676, 32716, 10) }, + { name = "stolen knowledge of armor", pos = Position(32687, 32707, 10) }, + { name = "stolen knowledge of summoning", pos = Position(32698, 32715, 10) }, + { name = "stolen knowledge of lifesteal", pos = Position(32693, 32729, 10) }, + { name = "stolen knowledge of spells", pos = Position(32681, 32729, 10) }, + { name = "stolen knowledge of healing", pos = Position(32676, 32715, 10) }, + { name = "stolen tome of portals", pos = Position(32688, 32715, 10) }, + }, + specPos = { + from = Position(32680, 32711, 10), + to = Position(32695, 32726, 10), + }, + exit = Position(32660, 32734, 12), +} + +local lever = BossLever(config) +lever:position(Position(32746, 32749, 10)) +lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/lokathmor.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_lokathmor.lua similarity index 72% rename from data-otservbr-global/scripts/actions/bosses_levers/lokathmor.lua rename to data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_lokathmor.lua index 5a56c186ee9..3855eb515ee 100644 --- a/data-otservbr-global/scripts/actions/bosses_levers/lokathmor.lua +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_lokathmor.lua @@ -11,6 +11,12 @@ local config = { { pos = Position(32724, 32749, 10), teleport = Position(32751, 32685, 10), effect = CONST_ME_TELEPORT }, { pos = Position(32725, 32749, 10), teleport = Position(32751, 32685, 10), effect = CONST_ME_TELEPORT }, }, + monsters = { + { name = "knowledge raider", pos = Position(32747, 32684, 10) }, + { name = "knowledge raider", pos = Position(32755, 32684, 10) }, + { name = "knowledge raider", pos = Position(32755, 32694, 10) }, + { name = "knowledge raider", pos = Position(32747, 32694, 10) }, + }, specPos = { from = Position(32742, 32681, 10), to = Position(32758, 32696, 10), @@ -19,5 +25,5 @@ local config = { } local lever = BossLever(config) -lever:position({ x = 32720, y = 32749, z = 10 }) +lever:position(Position(32720, 32749, 10)) lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/mazzinor.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_mazzinor.lua similarity index 72% rename from data-otservbr-global/scripts/actions/bosses_levers/mazzinor.lua rename to data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_mazzinor.lua index 2472b5634ac..765c04ea08a 100644 --- a/data-otservbr-global/scripts/actions/bosses_levers/mazzinor.lua +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_mazzinor.lua @@ -11,6 +11,12 @@ local config = { { pos = Position(32724, 32773, 10), teleport = Position(32726, 32726, 10), effect = CONST_ME_TELEPORT }, { pos = Position(32725, 32773, 10), teleport = Position(32726, 32726, 10), effect = CONST_ME_TELEPORT }, }, + monsters = { + { name = "wild knowledge", pos = Position(32719, 32718, 10) }, + { name = "wild knowledge", pos = Position(32723, 32719, 10) }, + { name = "wild knowledge", pos = Position(32728, 32718, 10) }, + { name = "wild knowledge", pos = Position(32724, 32724, 10) }, + }, specPos = { from = Position(32716, 32713, 10), to = Position(32732, 32728, 10), @@ -19,5 +25,5 @@ local config = { } local lever = BossLever(config) -lever:position({ x = 32720, y = 32773, z = 10 }) +lever:position(Position(32720, 32773, 10)) lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/the_scourge_of_oblivion.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_the_scourge_of_oblivion.lua similarity index 96% rename from data-otservbr-global/scripts/actions/bosses_levers/the_scourge_of_oblivion.lua rename to data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_the_scourge_of_oblivion.lua index f7373fbe49b..2e4a9b19df6 100644 --- a/data-otservbr-global/scripts/actions/bosses_levers/the_scourge_of_oblivion.lua +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/library_area/actions_the_scourge_of_oblivion.lua @@ -24,5 +24,5 @@ local config = { } local lever = BossLever(config) -lever:position({ x = 32675, y = 32743, z = 11 }) +lever:position(Position(32675, 32743, 11)) lever:register()