diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua index 0c7854e6f19..ecc656ee04e 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua @@ -22,7 +22,7 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", - "facelessHealth" + "facelessHealth", } monster.changeTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua index 70ca4634314..47604fd9c8a 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua @@ -22,7 +22,7 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", - "facelessHealth" + "facelessHealth", } monster.changeTarget = { diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua index c0c12ca9db9..b7e6bd0725c 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua @@ -23,36 +23,36 @@ local config = { to = Position(33433, 31449, 13), }, onUseExtra = function(player) - addEvent(function() - local baeloc = Creature("Sir Baeloc") - local nictros = Creature("Sir Nictros") + addEvent(function() + local baeloc = Creature("Sir Baeloc") + local nictros = Creature("Sir Nictros") - if baeloc then - baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!") - addEvent(function() - local nictros = Creature("Sir Nictros") - if nictros then - nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!") - end - end, 6 * 1000) - end + if baeloc then + baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!") + addEvent(function() + local nictros = Creature("Sir Nictros") + if nictros then + nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!") + end + end, 6 * 1000) + end - addEvent(function() - local baeloc = Creature("Sir Baeloc") - local nictros = Creature("Sir Nictros") - if baeloc then - baeloc:say("Oh, man! You always get the fun!") - if nictros then - nictros:teleportTo(Position(33426, 31437, 13)) - nictros:setMoveLocked(false) - end - end - end, 12 * 1000) - end, 4 * 1000) + addEvent(function() + local baeloc = Creature("Sir Baeloc") + local nictros = Creature("Sir Nictros") + if baeloc then + baeloc:say("Oh, man! You always get the fun!") + if nictros then + nictros:teleportTo(Position(33426, 31437, 13)) + nictros:setMoveLocked(false) + end + end + end, 12 * 1000) + end, 4 * 1000) end, exit = Position(33290, 32474, 9), } local lever = BossLever(config) lever:position(Position(33423, 31413, 13)) -lever:register() \ No newline at end of file +lever:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua index 18d54f3986e..283547db05e 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua @@ -1,25 +1,25 @@ local config = { - boss = { - name = "Duke Krule", - createFunction = function() - local boss = Game.createMonster("Duke Krule", Position(33456, 31473, 13), true, true) - boss:setStorageValue(1, os.time()) - return boss - end, - }, - requiredLevel = 250, - playerPositions = { - { pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33447, 31464, 13), - to = Position(33464, 31481, 13), - }, - exit = Position(32347, 32167, 12), + boss = { + name = "Duke Krule", + createFunction = function() + local boss = Game.createMonster("Duke Krule", Position(33456, 31473, 13), true, true) + boss:setStorageValue(1, os.time()) + return boss + end, + }, + requiredLevel = 250, + playerPositions = { + { pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33447, 31464, 13), + to = Position(33464, 31481, 13), + }, + exit = Position(32347, 32167, 12), } local duke_water = Combat() @@ -27,13 +27,13 @@ duke_water:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO) duke_water:setArea(createCombatArea(AREA_CIRCLE3X3)) function onTargetTile(cid, pos) - local tile = Tile(pos) - local target = tile:getTopCreature() - if tile then - if target and target:isPlayer() and target:getOutfit().lookType == 49 then - doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000) - end - end + local tile = Tile(pos) + local target = tile:getTopCreature() + if tile then + if target and target:isPlayer() and target:getOutfit().lookType == 49 then + doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000) + end + end end duke_water:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") @@ -43,63 +43,63 @@ duke_fire:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) duke_fire:setArea(createCombatArea(AREA_CIRCLE3X3)) function onTargetTile(cid, pos) - local tile = Tile(pos) - local target = tile:getTopCreature() - if tile then - if target and target:isPlayer() and target:getOutfit().lookType == 286 then - doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000) - end - end + local tile = Tile(pos) + local target = tile:getTopCreature() + if tile then + if target and target:isPlayer() and target:getOutfit().lookType == 286 then + doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000) + end + end end duke_fire:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") config.onUseExtra = function() - local config = { - centerRoom = Position(33456, 31472, 13), - x = 10, - y = 10, - transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD, - } - local function hitArea(creature) - local player = Player(creature) + local config = { + centerRoom = Position(33456, 31472, 13), + x = 10, + y = 10, + transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD, + } + local function hitArea(creature) + local player = Player(creature) - if player then - if player:getStorageValue(config.transformCD) <= os.time() then - if player:getOutfit().lookType == 49 then - local var = { type = 1, number = creature } - duke_fire:execute(player, var) - player:setStorageValue(config.transformCD, os.time() + 3) - addEvent(hitArea, 3 * 1000, creature) - elseif player:getOutfit().lookType == 286 then - local var = { type = 1, number = creature } - duke_water:execute(player, var) - player:setStorageValue(config.transformCD, os.time() + 3) - addEvent(hitArea, 3 * 1000, creature) - end - end - end + if player then + if player:getStorageValue(config.transformCD) <= os.time() then + if player:getOutfit().lookType == 49 then + local var = { type = 1, number = creature } + duke_fire:execute(player, var) + player:setStorageValue(config.transformCD, os.time() + 3) + addEvent(hitArea, 3 * 1000, creature) + elseif player:getOutfit().lookType == 286 then + local var = { type = 1, number = creature } + duke_water:execute(player, var) + player:setStorageValue(config.transformCD, os.time() + 3) + addEvent(hitArea, 3 * 1000, creature) + end + end + end - return true - end + return true + end - local function transformPlayers(id) - local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) - local form = { 49, 286 } - local boss = Creature("Duke Krule") + local function transformPlayers(id) + local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + local form = { 49, 286 } + local boss = Creature("Duke Krule") - if boss and boss:getStorageValue(1) == id then - if #spectators > 0 then - for _, player in pairs(spectators) do - doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000) - addEvent(hitArea, 3 * 1000, player:getId()) - end - addEvent(transformPlayers, 36 * 1000, id) - end - end - return true - end - addEvent(transformPlayers, 30 * 1000, os.time()) + if boss and boss:getStorageValue(1) == id then + if #spectators > 0 then + for _, player in pairs(spectators) do + doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000) + addEvent(hitArea, 3 * 1000, player:getId()) + end + addEvent(transformPlayers, 36 * 1000, id) + end + end + return true + end + addEvent(transformPlayers, 30 * 1000, os.time()) end local lever = BossLever(config) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua index 9efb945b2f9..e659f384c12 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua @@ -1,6 +1,6 @@ local config = { boss = { - name = "", + name = "", position = Position(32208, 32048, 14), }, requiredLevel = 250, @@ -14,53 +14,53 @@ local config = { { pos = Position(32208, 32025, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, }, monsters = { - ["Maxxenius"] = { - { name = "Generator", pos = Position(32205, 32048, 14) }, - { name = "Generator", pos = Position(32210, 32045, 14) }, - { name = "Generator", pos = Position(32210, 32051, 14) }, - }, - ["Alptramun"] = { - { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, - { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, - }, - ["Izcandar The Banished"] = { - { name = "the heat of summer", pos = Position(32204, 32053, 14), delay = 15 * 1000 }, - { name = "the heat of summer", pos = Position(32201, 32047, 14), delay = 15 * 1000 }, - { name = "the heat of summer", pos = Position(32204, 32043, 14), delay = 15 * 1000 }, - { name = "the cold of winter", pos = Position(32211, 32042, 14), delay = 15 * 1000 }, - { name = "the cold of winter", pos = Position(32214, 32048, 14), delay = 15 * 1000 }, - { name = "the cold of winter", pos = Position(32210, 32053, 14), delay = 15 * 1000 }, - }, - ["Plagueroot"] = { - { name = "plant attendant", pos = Position(32204, 32047, 14), delay = 15 * 1000 }, - { name = "plant attendant", pos = Position(32212, 32043, 14), delay = 15 * 1000 }, - { name = "plant attendant", pos = Position(32212, 32050, 14), delay = 15 * 1000 }, - }, - ["Malofur Mangrinder"] = { - { name = "whirling blades", pos = Position(32200, 32046, 14) }, - { name = "whirling blades", pos = Position(32200, 32050, 14) }, - { name = "whirling blades", pos = Position(32202, 32049, 14) }, - { name = "whirling blades", pos = Position(32202, 32051, 14) }, - { name = "whirling blades", pos = Position(32205, 32043, 14) }, - { name = "whirling blades", pos = Position(32200, 32050, 14) }, - { name = "whirling blades", pos = Position(32205, 32048, 14) }, - { name = "whirling blades", pos = Position(32205, 32055, 14) }, - { name = "whirling blades", pos = Position(32206, 32051, 14) }, - { name = "whirling blades", pos = Position(32206, 32040, 14) }, - { name = "whirling blades", pos = Position(32207, 32043, 14) }, - { name = "whirling blades", pos = Position(32207, 32048, 14) }, - { name = "whirling blades", pos = Position(32208, 32051, 14) }, - { name = "whirling blades", pos = Position(32209, 32048, 14) }, - { name = "whirling blades", pos = Position(32209, 32055, 14) }, - { name = "whirling blades", pos = Position(32210, 32051, 14) }, - { name = "whirling blades", pos = Position(32211, 32042, 14) }, - { name = "whirling blades", pos = Position(32211, 32044, 14) }, - { name = "whirling blades", pos = Position(32211, 32046, 14) }, - { name = "whirling blades", pos = Position(32214, 32043, 14) }, - { name = "whirling blades", pos = Position(32214, 32049, 14) }, - { name = "whirling blades", pos = Position(32213, 32052, 14) } - } - }, + ["Maxxenius"] = { + { name = "Generator", pos = Position(32205, 32048, 14) }, + { name = "Generator", pos = Position(32210, 32045, 14) }, + { name = "Generator", pos = Position(32210, 32051, 14) }, + }, + ["Alptramun"] = { + { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, + { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, + }, + ["Izcandar The Banished"] = { + { name = "the heat of summer", pos = Position(32204, 32053, 14), delay = 15 * 1000 }, + { name = "the heat of summer", pos = Position(32201, 32047, 14), delay = 15 * 1000 }, + { name = "the heat of summer", pos = Position(32204, 32043, 14), delay = 15 * 1000 }, + { name = "the cold of winter", pos = Position(32211, 32042, 14), delay = 15 * 1000 }, + { name = "the cold of winter", pos = Position(32214, 32048, 14), delay = 15 * 1000 }, + { name = "the cold of winter", pos = Position(32210, 32053, 14), delay = 15 * 1000 }, + }, + ["Plagueroot"] = { + { name = "plant attendant", pos = Position(32204, 32047, 14), delay = 15 * 1000 }, + { name = "plant attendant", pos = Position(32212, 32043, 14), delay = 15 * 1000 }, + { name = "plant attendant", pos = Position(32212, 32050, 14), delay = 15 * 1000 }, + }, + ["Malofur Mangrinder"] = { + { name = "whirling blades", pos = Position(32200, 32046, 14) }, + { name = "whirling blades", pos = Position(32200, 32050, 14) }, + { name = "whirling blades", pos = Position(32202, 32049, 14) }, + { name = "whirling blades", pos = Position(32202, 32051, 14) }, + { name = "whirling blades", pos = Position(32205, 32043, 14) }, + { name = "whirling blades", pos = Position(32200, 32050, 14) }, + { name = "whirling blades", pos = Position(32205, 32048, 14) }, + { name = "whirling blades", pos = Position(32205, 32055, 14) }, + { name = "whirling blades", pos = Position(32206, 32051, 14) }, + { name = "whirling blades", pos = Position(32206, 32040, 14) }, + { name = "whirling blades", pos = Position(32207, 32043, 14) }, + { name = "whirling blades", pos = Position(32207, 32048, 14) }, + { name = "whirling blades", pos = Position(32208, 32051, 14) }, + { name = "whirling blades", pos = Position(32209, 32048, 14) }, + { name = "whirling blades", pos = Position(32209, 32055, 14) }, + { name = "whirling blades", pos = Position(32210, 32051, 14) }, + { name = "whirling blades", pos = Position(32211, 32042, 14) }, + { name = "whirling blades", pos = Position(32211, 32044, 14) }, + { name = "whirling blades", pos = Position(32211, 32046, 14) }, + { name = "whirling blades", pos = Position(32214, 32043, 14) }, + { name = "whirling blades", pos = Position(32214, 32049, 14) }, + { name = "whirling blades", pos = Position(32213, 32052, 14) }, + }, + }, bossPosition = Position(32207, 32051, 14), specPos = { from = Position(32199, 32039, 14), @@ -70,30 +70,30 @@ local config = { } local function configureLever() - local bossDate = { - ["Monday"] = "Plagueroot", - ["Tuesday"] = "Malofur Mangrinder", - ["Wednesday"] = "Maxxenius", - ["Thursday"] = "Alptramun", - ["Friday"] = "Izcandar The Banished", - ["Saturday"] = "Maxxenius", - ["Sunday"] = "Alptramun", - } - local bossName = bossDate[os.date("%A")] - config.boss.name = bossName - config.monsters = config.monsters[bossName] - if bossName == "Maxxenius" then - config.onUseExtra = function() - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) - end - elseif bossName == "Izcandar The Banished" then - config.onUseExtra = function() - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0) - end - end + local bossDate = { + ["Monday"] = "Plagueroot", + ["Tuesday"] = "Malofur Mangrinder", + ["Wednesday"] = "Maxxenius", + ["Thursday"] = "Alptramun", + ["Friday"] = "Izcandar The Banished", + ["Saturday"] = "Maxxenius", + ["Sunday"] = "Alptramun", + } + local bossName = bossDate[os.date("%A")] + config.boss.name = bossName + config.monsters = config.monsters[bossName] + if bossName == "Maxxenius" then + config.onUseExtra = function() + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) + end + elseif bossName == "Izcandar The Banished" then + config.onUseExtra = function() + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0) + end + end end configureLever() local dreamCourtsLever = BossLever(config) dreamCourtsLever:position({ x = 32208, y = 32020, z = 13 }) -dreamCourtsLever:register() \ No newline at end of file +dreamCourtsLever:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua index 43814ea808a..75dcc91bbb9 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua @@ -21,4 +21,4 @@ local config = { local lever = BossLever(config) lever:uid(1039) -lever:register() \ No newline at end of file +lever:register() diff --git a/data/libs/functions/boss_lever.lua b/data/libs/functions/boss_lever.lua index 92901d66f4f..1d1318dc690 100644 --- a/data/libs/functions/boss_lever.lua +++ b/data/libs/functions/boss_lever.lua @@ -240,12 +240,12 @@ function BossLever:onUse(player) monster:registerEvent("BossLeverOnDeath") end for _, monster in pairs(self.monsters) do - if monster.delay then - addEvent(Game.createMonster, monster.delay, monster.name, monster.pos, true, true) - else - Game.createMonster(monster.name, monster.pos, true, true) - end - end + if monster.delay then + addEvent(Game.createMonster, monster.delay, monster.name, monster.pos, true, true) + else + Game.createMonster(monster.name, monster.pos, true, true) + end + end lever:teleportPlayers() if self.encounter then local encounter = Encounter(self.encounter)