From 9bed23d6c019364b72f699b3ab124696e0524107 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Sat, 2 Nov 2024 21:02:53 -0300 Subject: [PATCH 01/17] improve: load player town and fix player badge escape string (#3055) Simplified the town assignment logic when loading player data: - If the town ID associated with the player is invalid, the system will first attempt to assign the town "Thais". If "Thais" is unavailable, the player is assigned the first valid town from the list. - This change reduces the chain of conditional checks, making the logic more readable and efficient, while ensuring a player is assigned to a valid town whenever possible. Fix for Escaping Strings in PlayerBadge: - Added proper string escaping using `g_database().escapeString()` in `PlayerBadge::getPlayersInfoByAccount()` to prevent SQL syntax errors when player names contain special characters. - This fix addresses issues with malformed queries that previously resulted in SQL syntax errors. --- .../players/cyclopedia/player_badge.cpp | 3 ++- src/io/functions/iologindata_load_player.cpp | 24 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/creatures/players/cyclopedia/player_badge.cpp b/src/creatures/players/cyclopedia/player_badge.cpp index 0d97747a248..c27e98cb1aa 100644 --- a/src/creatures/players/cyclopedia/player_badge.cpp +++ b/src/creatures/players/cyclopedia/player_badge.cpp @@ -127,7 +127,8 @@ std::vector> PlayerBadge::getPlayersInfoByAccount(const if (!namesList.empty()) { namesList += ", "; } - namesList += fmt::format("'{}'", name); + std::string escapedName = g_database().escapeString(name); + namesList += fmt::format("{}", escapedName); } auto query = fmt::format("SELECT name, level, vocation FROM players WHERE name IN ({})", namesList); diff --git a/src/io/functions/iologindata_load_player.cpp b/src/io/functions/iologindata_load_player.cpp index 02f58bec04b..477572dfbc8 100644 --- a/src/io/functions/iologindata_load_player.cpp +++ b/src/io/functions/iologindata_load_player.cpp @@ -179,10 +179,28 @@ bool IOLoginDataLoad::loadPlayerBasicInfo(const std::shared_ptr &player, player->setOfflineTrainingSkill(skill); const auto &town = g_game().map.towns.getTown(result->getNumber("town_id")); if (!town) { - g_logger().error("Player {} has town id {} which doesn't exist", player->name, result->getNumber("town_id")); - return false; + g_logger().error("Player {} has invalid town id {}. Attempting to set the correct town.", player->name, result->getNumber("town_id")); + + const auto &thaisTown = g_game().map.towns.getTown("Thais"); + if (thaisTown) { + player->town = thaisTown; + g_logger().warn("Assigned town 'Thais' to player {}", player->name); + } else { + for (const auto &[townId, currentTown] : g_game().map.towns.getTowns()) { + if (townId != 0 && currentTown) { + player->town = currentTown; + g_logger().warn("Assigned first valid town {} (id: {}) to player {}", currentTown->getName(), townId, player->name); + } + } + + if (!player->town) { + g_logger().error("Player {} has invalid town id {}. No valid town found to assign.", player->name, result->getNumber("town_id")); + return false; + } + } + } else { + player->town = town; } - player->town = town; const Position &loginPos = player->loginPosition; if (loginPos.x == 0 && loginPos.y == 0 && loginPos.z == 0) { From b82568a619b27e5835ea191e98eb1a169ccf652a Mon Sep 17 00:00:00 2001 From: "Leilani A." <168607226+kaleohanopahala@users.noreply.github.com> Date: Sun, 3 Nov 2024 15:00:47 -0300 Subject: [PATCH 02/17] fix: prevent crash in condition light division (#3053) Fix #3047 Now min light level is always 1, prevent division by zero. --- src/creatures/combat/condition.cpp | 10 +++++++--- src/creatures/combat/condition.hpp | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/creatures/combat/condition.cpp b/src/creatures/combat/condition.cpp index e49a6662991..da90b03f65a 100644 --- a/src/creatures/combat/condition.cpp +++ b/src/creatures/combat/condition.cpp @@ -2540,7 +2540,7 @@ void ConditionLight::addCondition(std::shared_ptr creature, const std: const auto &conditionLight = condition->static_self_cast(); lightInfo.level = conditionLight->lightInfo.level; lightInfo.color = conditionLight->lightInfo.color; - lightChangeInterval = ticks / lightInfo.level; + lightChangeInterval = ticks / std::max(1, lightInfo.level); internalLightTicks = 0; creature->setCreatureLight(lightInfo); g_game().changeLight(creature); @@ -2558,9 +2558,13 @@ bool ConditionLight::setParam(ConditionParam_t param, int32_t value) { } switch (param) { - case CONDITION_PARAM_LIGHT_LEVEL: - lightInfo.level = value; + case CONDITION_PARAM_LIGHT_LEVEL: { + if (value < 1) { + g_logger().warn("[ConditionLight::setParam] Trying to set invalid light value: '{}', defaulting to 1.", value); + } + lightInfo.level = std::max(1, static_cast(value)); return true; + } case CONDITION_PARAM_LIGHT_COLOR: lightInfo.color = value; diff --git a/src/creatures/combat/condition.hpp b/src/creatures/combat/condition.hpp index 1cc798624e3..50d072059a2 100644 --- a/src/creatures/combat/condition.hpp +++ b/src/creatures/combat/condition.hpp @@ -391,7 +391,7 @@ class ConditionLight final : public Condition { bool unserializeProp(ConditionAttr_t attr, PropStream &propStream) override; private: - LightInfo lightInfo; + LightInfo lightInfo { 1, 215 }; uint32_t internalLightTicks = 0; uint32_t lightChangeInterval = 0; }; From 1b4de5d59ff5371c6d933747cb2f119f14a72978 Mon Sep 17 00:00:00 2001 From: murilo09 <78226931+murilo09@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:45:23 -0300 Subject: [PATCH 03/17] fix: remove mystery box duplicated action (#3057) --- data/scripts/actions/items/mystery_box.lua | 13 ------------- src/creatures/monsters/monster.hpp | 1 - 2 files changed, 14 deletions(-) delete mode 100644 data/scripts/actions/items/mystery_box.lua diff --git a/data/scripts/actions/items/mystery_box.lua b/data/scripts/actions/items/mystery_box.lua deleted file mode 100644 index 6afdf3ca464..00000000000 --- a/data/scripts/actions/items/mystery_box.lua +++ /dev/null @@ -1,13 +0,0 @@ -local mysteryBox = Action() - -function mysteryBox.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local items = { 25361, 25360 } - local randomItem = items[math.random(#items)] - player:addItem(randomItem, 1) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - item:remove(1) - return true -end - -mysteryBox:id(26186) -mysteryBox:register() diff --git a/src/creatures/monsters/monster.hpp b/src/creatures/monsters/monster.hpp index c52a2a6de05..ed9a628159f 100644 --- a/src/creatures/monsters/monster.hpp +++ b/src/creatures/monsters/monster.hpp @@ -47,7 +47,6 @@ class Monster final : public Creature { const std::string &getTypeName() const override; const std::string &getNameDescription() const override; void setNameDescription(std::string_view nameDescription); - ; std::string getDescription(int32_t) override; CreatureType_t getType() const override; From 602377f62bbadd123295286dafbd44ed7ebb2b3a Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 5 Nov 2024 23:23:43 -0300 Subject: [PATCH 04/17] improve: optimize experience gain and loss calculations (#2905) Optimized the experience gain and loss calculations in the `onGainExperience` and `onLoseExperience` functions, adjusting the application of bonuses like stamina, VIP, and boosted creatures. This ensures more efficient performance and more accurate handling of player experience management. --- data/events/scripts/player.lua | 97 ++++++++++++---------------------- data/libs/functions/player.lua | 22 ++++++++ 2 files changed, 56 insertions(+), 63 deletions(-) diff --git a/data/events/scripts/player.lua b/data/events/scripts/player.lua index 2efc7d92f75..78653733b58 100644 --- a/data/events/scripts/player.lua +++ b/data/events/scripts/player.lua @@ -535,20 +535,17 @@ function Player:onGainExperience(target, exp, rawExp) self:addCondition(soulCondition) end - -- XP Boost Bonus - useStaminaXpBoost(self) -- Use stamina XP boost (store or daily reward) + -- Apply XP Boost (Store or Daily Reward) + useStaminaXpBoost(self) local xpBoostTimeLeft = self:getXpBoostTime() - local stillHasXpBoost = xpBoostTimeLeft > 0 - local xpBoostPercent = stillHasXpBoost and self:getXpBoostPercent() or 0 - - self:setXpBoostPercent(xpBoostPercent) + local hasXpBoost = xpBoostTimeLeft > 0 + local xpBoostPercent = hasXpBoost and self:getXpBoostPercent() or 0 -- Stamina Bonus local staminaBonusXp = 1 - local isStaminaEnabled = configManager.getBoolean(configKeys.STAMINA_SYSTEM) - useStamina(self, isStaminaEnabled) - if isStaminaEnabled then + if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then + useStamina(self, true) staminaBonusXp = self:getFinalBonusStamina() self:setStaminaXpBoost(staminaBonusXp * 100) end @@ -556,12 +553,12 @@ function Player:onGainExperience(target, exp, rawExp) -- Concoction System useConcoctionTime(self) - -- Boosted creature - if target:getName():lower() == (Game.getBoostedCreature()):lower() then + -- Apply Boosted Creature Bonus + if target:getName():lower() == Game.getBoostedCreature():lower() then exp = exp * 2 end - -- Prey system + -- Prey System if configManager.getBoolean(configKeys.PREY_ENABLED) then local monsterType = target:getType() if monsterType and monsterType:raceId() > 0 then @@ -569,18 +566,20 @@ function Player:onGainExperience(target, exp, rawExp) end end + -- VIP Bonus Experience if configManager.getBoolean(configKeys.VIP_SYSTEM_ENABLED) then local vipBonusExp = configManager.getNumber(configKeys.VIP_BONUS_EXP) if vipBonusExp > 0 and self:isVip() then - vipBonusExp = (vipBonusExp > 100 and 100) or vipBonusExp - exp = exp * (1 + (vipBonusExp / 100)) + exp = exp * (1 + math.min(vipBonusExp, 100) / 100) end end - local lowLevelBonuxExp = self:getFinalLowLevelBonus() - local baseRate = self:getFinalBaseRateExperience() + -- Final Adjustments: Low Level Bonus and Base Rate + local lowLevelBonusExp = self:getFinalLowLevelBonus() + local baseRateExp = self:getFinalBaseRateExperience() - return (exp + (exp * (xpBoostPercent / 100) + (exp * (lowLevelBonuxExp / 100)))) * staminaBonusXp * baseRate + -- Return final experience value + return (exp * (1 + xpBoostPercent / 100 + lowLevelBonusExp / 100)) * staminaBonusXp * baseRateExp end function Player:onLoseExperience(exp) @@ -592,42 +591,35 @@ function Player:onGainSkillTries(skill, tries) if IsRunningGlobalDatapack() and isSkillGrowthLimited(self, skill) then return 0 end + if not APPLY_SKILL_MULTIPLIER then return tries end - -- Event scheduler skill rate - local STAGES_DEFAULT = nil - if configManager.getBoolean(configKeys.RATE_USE_STAGES) then - STAGES_DEFAULT = skillsStages - end - local SKILL_DEFAULT = self:getSkillLevel(skill) - local RATE_DEFAULT = configManager.getNumber(configKeys.RATE_SKILL) + -- Default skill rate settings + local rateSkillStages = configManager.getBoolean(configKeys.RATE_USE_STAGES) and skillsStages or nil + local currentSkillLevel = self:getSkillLevel(skill) + local baseRate = configManager.getNumber(configKeys.RATE_SKILL) + -- Special case for magic level if skill == SKILL_MAGLEVEL then - -- Magic Level - if configManager.getBoolean(configKeys.RATE_USE_STAGES) then - STAGES_DEFAULT = magicLevelStages - end - SKILL_DEFAULT = self:getBaseMagicLevel() - RATE_DEFAULT = configManager.getNumber(configKeys.RATE_MAGIC) + rateSkillStages = configManager.getBoolean(configKeys.RATE_USE_STAGES) and magicLevelStages or nil + currentSkillLevel = self:getBaseMagicLevel() + baseRate = configManager.getNumber(configKeys.RATE_MAGIC) end - local skillOrMagicRate = getRateFromTable(STAGES_DEFAULT, SKILL_DEFAULT, RATE_DEFAULT) + -- Calculate skill rate from stages and schedule + local skillRate = getRateFromTable(rateSkillStages, currentSkillLevel, baseRate) + skillRate = (SCHEDULE_SKILL_RATE ~= 100) and (skillRate * SCHEDULE_SKILL_RATE / 100) or skillRate - if SCHEDULE_SKILL_RATE ~= 100 then - skillOrMagicRate = math.max(0, (skillOrMagicRate * SCHEDULE_SKILL_RATE) / 100) + -- Apply VIP boost if applicable + if configManager.getBoolean(configKeys.VIP_SYSTEM_ENABLED) and self:isVip() then + local vipBonusSkill = math.min(configManager.getNumber(configKeys.VIP_BONUS_SKILL), 100) + skillRate = skillRate + (skillRate * (vipBonusSkill / 100)) end - if configManager.getBoolean(configKeys.VIP_SYSTEM_ENABLED) then - local vipBoost = configManager.getNumber(configKeys.VIP_BONUS_SKILL) - if vipBoost > 0 and self:isVip() then - vipBoost = (vipBoost > 100 and 100) or vipBoost - skillOrMagicRate = skillOrMagicRate + (skillOrMagicRate * (vipBoost / 100)) - end - end - - return tries / 100 * (skillOrMagicRate * 100) + -- Calculate and return the final experience gain + return tries * skillRate end function Player:onCombat(target, item, primaryDamage, primaryType, secondaryDamage, secondaryType) @@ -678,24 +670,3 @@ function Player:onChangeZone(zone) end function Player:onInventoryUpdate(item, slot, equip) end - -function Player:getURL() - local playerLink = string.gsub(self:getName(), "%s+", "+") - local serverURL = configManager.getString(configKeys.URL) - return serverURL .. "/characters/" .. playerLink -end - -function Player:getMarkdownLink() - local vocation = self:vocationAbbrev() - local emoji = ":school_satchel:" - if self:isKnight() then - emoji = ":crossed_swords:" - elseif self:isPaladin() then - emoji = ":bow_and_arrow:" - elseif self:isDruid() then - emoji = ":herb:" - elseif self:isSorcerer() then - emoji = ":crystal_ball:" - end - return "**[" .. self:getName() .. "](" .. self:getURL() .. ")** " .. emoji .. " [_" .. vocation .. "_]" -end diff --git a/data/libs/functions/player.lua b/data/libs/functions/player.lua index a8497b9bef1..3f7c8e17b75 100644 --- a/data/libs/functions/player.lua +++ b/data/libs/functions/player.lua @@ -987,3 +987,25 @@ function Player:canGetReward(rewardId, questName) return true end + +function Player.getURL(self) + local playerName = self:getName():gsub("%s+", "+") + local serverURL = configManager.getString(configKeys.URL) + + return serverURL .. "/characters/" .. playerName +end + +local emojiMap = { + ["knight"] = ":crossed_swords:", + ["paladin"] = ":bow_and_arrow:", + ["druid"] = ":herb:", + ["sorcerer"] = ":crystal_ball:", +} + +function Player.getMarkdownLink(self) + local vocation = self:vocationAbbrev() + local emoji = emojiMap[self:getVocation():getName():lower()] or ":school_satchel:" + local playerURL = self:getURL() + + return string.format("**[%s](%s)** %s [_%s_]", self:getName(), playerURL, emoji, vocation) +end From 3bef03450379b5dd52cc155eb4411f7b7769e3e1 Mon Sep 17 00:00:00 2001 From: Pedro Cruz Date: Wed, 6 Nov 2024 00:47:47 -0300 Subject: [PATCH 05/17] fix: character cyclopedia item inspection imbuements (#3065) This fixes the icons from the character item imbuements inspection cyclopedia. --- src/server/network/protocol/protocolgame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 99c8a960677..b8b67b6335f 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -4089,7 +4089,7 @@ void ProtocolGame::sendCyclopediaCharacterInspection() { continue; } - msg.add(imbuementInfo.imbuement->getID()); + msg.add(imbuementInfo.imbuement->getIconID()); itemImbuements++; } From 4ae6bdfed371ef6be0624f853811d143563f4da7 Mon Sep 17 00:00:00 2001 From: Renato Machado Date: Wed, 6 Nov 2024 23:13:11 -0300 Subject: [PATCH 06/17] style: tryAddEvent to safeCall (#3045) safeCall basically keeps calls safe when they are being executed asynchronously, that is, if the calls inside safeCall are being executed in a thread other than the dispatcher, they will simply be sent to that thread, thus avoiding concurrency. What I just wrote is already being done with tryAddEvent, but it is not a very intuitive name, and it is visually polluted. In the safeCall method, besides being short, you can simply send 'this' as a parameter to the lambda, without having to fear that its execution will be done when the reference no longer exists, because inside safeCall, there is a reference check, if it has already been destroyed, it will simply not be executed. --- src/creatures/creature.cpp | 26 +++++++++++++++++++------- src/creatures/creature.hpp | 3 +++ src/creatures/players/player.cpp | 11 +++-------- src/game/game.cpp | 5 ++--- src/game/scheduling/dispatcher.cpp | 16 ---------------- src/game/scheduling/dispatcher.hpp | 6 ------ src/items/tile.cpp | 14 ++++++++++++++ src/items/tile.hpp | 3 +++ src/map/mapcache.cpp | 14 +++++--------- 9 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/creatures/creature.cpp b/src/creatures/creature.cpp index baf93fb651a..cacb7ba54f6 100644 --- a/src/creatures/creature.cpp +++ b/src/creatures/creature.cpp @@ -270,18 +270,17 @@ void Creature::addEventWalk(bool firstStep) { return; } - g_dispatcher().context().tryAddEvent([ticks, self = getCreature()]() { + safeCall([this, ticks]() { // Take first step right away, but still queue the next if (ticks == 1) { - g_game().checkCreatureWalk(self->getID()); + g_game().checkCreatureWalk(getID()); } - self->eventWalk = g_dispatcher().scheduleEvent( + eventWalk = g_dispatcher().scheduleEvent( static_cast(ticks), - [creatureId = self->getID()] { g_game().checkCreatureWalk(creatureId); }, "Game::checkCreatureWalk" + [creatureId = getID()] { g_game().checkCreatureWalk(creatureId); }, "Game::checkCreatureWalk" ); - }, - "addEventWalk"); + }); } void Creature::stopEventWalk() { @@ -1082,7 +1081,7 @@ void Creature::getPathSearchParams(const std::shared_ptr &, FindPathPa void Creature::goToFollowCreature_async(std::function &&onComplete) { if (!hasAsyncTaskFlag(Pathfinder) && onComplete) { - g_dispatcher().context().addEvent(std::move(onComplete), "goToFollowCreature_async"); + g_dispatcher().addEvent(std::move(onComplete), "goToFollowCreature_async"); } setAsyncTaskFlag(Pathfinder, true); @@ -2002,3 +2001,16 @@ void Creature::sendAsyncTasks() { }, TaskGroup::WalkParallel); } + +void Creature::safeCall(std::function &&action) const { + if (g_dispatcher().context().isAsync()) { + g_dispatcher().addEvent([weak_self = std::weak_ptr(shared_from_this()), action = std::move(action)] { + if (weak_self.lock()) { + action(); + } + }, + g_dispatcher().context().getName()); + } else { + action(); + } +} diff --git a/src/creatures/creature.hpp b/src/creatures/creature.hpp index 46f628188e5..fd3c5bdce5e 100644 --- a/src/creatures/creature.hpp +++ b/src/creatures/creature.hpp @@ -848,6 +848,9 @@ class Creature : virtual public Thing, public SharedObject { virtual void onExecuteAsyncTasks() {}; + // This method maintains safety in asynchronous calls, avoiding competition between threads. + void safeCall(std::function &&action) const; + private: bool canFollowMaster() const; bool isLostSummon(); diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index dfdf467aa97..923b153a99a 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -3783,14 +3783,9 @@ void Player::addInFightTicks(bool pzlock /*= false*/) { updateImbuementTrackerStats(); - // this method can be called asynchronously. - g_dispatcher().context().tryAddEvent([self = std::weak_ptr(getPlayer())] { - if (const auto &player = self.lock()) { - const auto &condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_INFIGHT, g_configManager().getNumber(PZ_LOCKED), 0); - player->addCondition(condition); - } - }, - "Player::addInFightTicks"); + safeCall([this] { + addCondition(Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_INFIGHT, g_configManager().getNumber(PZ_LOCKED), 0)); + }); } void Player::setDailyReward(uint8_t reward) { diff --git a/src/game/game.cpp b/src/game/game.cpp index 49f8bf21d98..6e8a3c0eae5 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -6440,10 +6440,9 @@ void Game::addCreatureCheck(const std::shared_ptr &creature) { creature->inCheckCreaturesVector.store(true); - g_dispatcher().context().tryAddEvent([creature] { + creature->safeCall([this, creature] { checkCreatureLists[uniform_random(0, EVENT_CREATURECOUNT - 1)].emplace_back(creature); - }, - "addCreatureCheck"); + }); } void Game::removeCreatureCheck(const std::shared_ptr &creature) { diff --git a/src/game/scheduling/dispatcher.cpp b/src/game/scheduling/dispatcher.cpp index e716e9867cc..cb27cba23f1 100644 --- a/src/game/scheduling/dispatcher.cpp +++ b/src/game/scheduling/dispatcher.cpp @@ -251,22 +251,6 @@ void Dispatcher::stopEvent(uint64_t eventId) { } } -void DispatcherContext::addEvent(std::function &&f, std::string_view context) const { - g_dispatcher().addEvent(std::move(f), context); -} - -void DispatcherContext::tryAddEvent(std::function &&f, std::string_view context) const { - if (!f) { - return; - } - - if (isAsync()) { - g_dispatcher().addEvent(std::move(f), context); - } else { - f(); - } -} - bool DispatcherContext::isOn() { return OTSYS_TIME() != 0; } diff --git a/src/game/scheduling/dispatcher.hpp b/src/game/scheduling/dispatcher.hpp index 5e84d5d5fc7..d2c6819593c 100644 --- a/src/game/scheduling/dispatcher.hpp +++ b/src/game/scheduling/dispatcher.hpp @@ -55,12 +55,6 @@ struct DispatcherContext { return type; } - // postpone the event - void addEvent(std::function &&f, std::string_view context) const; - - // if the context is async, the event will be postponed, if not, it will be executed immediately. - void tryAddEvent(std::function &&f, std::string_view context) const; - private: void reset() { group = TaskGroup::ThreadPool; diff --git a/src/items/tile.cpp b/src/items/tile.cpp index f15e2bd8a94..4b7cb0fbac3 100644 --- a/src/items/tile.cpp +++ b/src/items/tile.cpp @@ -23,6 +23,7 @@ #include "lua/creature/movement.hpp" #include "map/spectators.hpp" #include "utils/tools.hpp" +#include "game/scheduling/dispatcher.hpp" auto real_nullptr_tile = std::make_shared(0xFFFF, 0xFFFF, 0xFF); const std::shared_ptr &Tile::nullptr_tile = real_nullptr_tile; @@ -1942,3 +1943,16 @@ void Tile::clearZones() { zones.erase(zone); } } + +void Tile::safeCall(std::function &&action) const { + if (g_dispatcher().context().isAsync()) { + g_dispatcher().addEvent([weak_self = std::weak_ptr(shared_from_this()), action = std::move(action)] { + if (weak_self.lock()) { + action(); + } + }, + g_dispatcher().context().getName()); + } else { + action(); + } +} diff --git a/src/items/tile.hpp b/src/items/tile.hpp index 4137b6e115d..ba3834d9914 100644 --- a/src/items/tile.hpp +++ b/src/items/tile.hpp @@ -259,6 +259,9 @@ class Tile : public Cylinder, public SharedObject { } } + // This method maintains safety in asynchronous calls, avoiding competition between threads. + void safeCall(std::function &&action) const; + private: void onAddTileItem(const std::shared_ptr &item); void onUpdateTileItem(const std::shared_ptr &oldItem, const ItemType &oldType, const std::shared_ptr &newItem, const ItemType &newType); diff --git a/src/map/mapcache.cpp b/src/map/mapcache.cpp index 01fd9da63d8..cf2f27c6ee7 100644 --- a/src/map/mapcache.cpp +++ b/src/map/mapcache.cpp @@ -146,15 +146,11 @@ std::shared_ptr MapCache::getOrCreateTileFromCache(const std::shared_ptrsetFlag(static_cast(cachedTile->flags)); - // add zone synchronously - g_dispatcher().context().tryAddEvent( - [tile, pos] { - for (const auto &zone : Zone::getZones(pos)) { - tile->addZone(zone); - } - }, - "Zone::getZones" - ); + tile->safeCall([tile, pos] { + for (const auto &zone : Zone::getZones(pos)) { + tile->addZone(zone); + } + }); floor->setTile(x, y, tile); From e2e57f68c095fdcf29e540ab4b89121a2e68ff11 Mon Sep 17 00:00:00 2001 From: Renato Machado Date: Thu, 7 Nov 2024 15:55:52 -0300 Subject: [PATCH 07/17] improve: safecall (#3072) Added check if creature was removed. --- src/creatures/creature.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/creatures/creature.cpp b/src/creatures/creature.cpp index cacb7ba54f6..f3ad0e5d482 100644 --- a/src/creatures/creature.cpp +++ b/src/creatures/creature.cpp @@ -2004,13 +2004,15 @@ void Creature::sendAsyncTasks() { void Creature::safeCall(std::function &&action) const { if (g_dispatcher().context().isAsync()) { - g_dispatcher().addEvent([weak_self = std::weak_ptr(shared_from_this()), action = std::move(action)] { - if (weak_self.lock()) { - action(); + g_dispatcher().addEvent([weak_self = std::weak_ptr(static_self_cast()), action = std::move(action)] { + if (const auto self = weak_self.lock()) { + if (!self->isInternalRemoved) { + action(); + } } }, g_dispatcher().context().getName()); - } else { + } else if (!isInternalRemoved) { action(); } } From e6c09957771273ec38b3f42135205ed972c791bd Mon Sep 17 00:00:00 2001 From: Renato Machado Date: Thu, 7 Nov 2024 15:56:27 -0300 Subject: [PATCH 08/17] improve: prevent crash in checkCreatures (#3073) Apparently the creature can be destroyed while it is running in checkCreatures, so let's increase the counter to ensure it still exists. Note: It's had a rare crash while doing some testing. --- src/game/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 6e8a3c0eae5..780ce5b7303 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -6456,7 +6456,7 @@ void Game::checkCreatures() { metrics::method_latency measure(__METHOD_NAME__); static size_t index = 0; - std::erase_if(checkCreatureLists[index], [this](const std::shared_ptr &creature) { + std::erase_if(checkCreatureLists[index], [this](const std::shared_ptr creature) { if (creature->creatureCheck && creature->isAlive()) { creature->onThink(EVENT_CREATURE_THINK_INTERVAL); creature->onAttacking(EVENT_CREATURE_THINK_INTERVAL); From ceace165cfaa374700de66628c12bd6bb9f979a5 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 8 Nov 2024 01:44:09 -0300 Subject: [PATCH 09/17] perf: remove unnecessary event callbacks (#3076) Removed Lua callbacks from `MonsterType` of various monsters. These callbacks were empty, which meant the functions were still being "called" by the monsters without performing any action, creating a significant performance bottleneck. Removed the `onHear` event callback, which had a significant impact on the server and was not used anywhere. It executed the `onHear` callback for each spectator, causing an unnecessary overload without any real benefit, especially as we have other methods to check for these events. Additionally, the `monsterOnSpawn` event callback was removed and replaced with `MonsterType::onSpawn`, which is much more efficient since it only needs to be declared in the script for each monster that actually uses it. Finally, the way `setRewardBoss` was handled was improved. Previously, it was executed in an `onSpawn` event callback, but now it is done directly during the parsing of each monster script, marking them as reward bosses at the time of script loading, improving efficiency. --- data-canary/monster/bosses/apocalypse.lua | 14 --- .../monster/bosses/apprentice_sheng.lua | 14 --- data-canary/monster/bosses/bazir.lua | 14 --- data-canary/monster/bosses/black_knight.lua | 14 --- data-canary/monster/bosses/bullwark.lua | 14 --- data-canary/monster/bosses/custodian.lua | 14 --- data-canary/monster/bosses/dharalion.lua | 14 --- data-canary/monster/bosses/shadowpelt.lua | 14 --- .../monster/bosses/alchemist_container.lua | 14 --- .../monster/bosses/antenna.lua | 14 --- .../monster/bosses/apocalypse.lua | 14 --- .../monster/bosses/apprentice_sheng.lua | 14 --- .../monster/bosses/armenius.lua | 14 --- data-otservbr-global/monster/bosses/bazir.lua | 14 --- .../monster/bosses/bibby_bloodbath.lua | 14 --- .../monster/bosses/big_boss_trolliver.lua | 14 --- .../monster/bosses/black_knight.lua | 14 --- .../monster/bosses/brain_head.lua | 14 --- .../monster/bosses/bullwark.lua | 14 --- .../monster/bosses/cerebellum.lua | 14 --- .../monster/bosses/chikhaton.lua | 14 --- .../monster/bosses/clubarc_the_plunderer.lua | 14 --- .../monster/bosses/custodian.lua | 14 --- .../monster/bosses/dharalion.lua | 14 --- .../monster/bosses/diblis_the_fair.lua | 14 --- .../monster/bosses/diseased_bill.lua | 14 --- .../monster/bosses/diseased_dan.lua | 14 --- .../monster/bosses/diseased_fred.lua | 14 --- .../monster/bosses/doctor_marrow.lua | 14 --- .../monster/bosses/ekatrix.lua | 14 --- .../monster/bosses/energized_raging_mage.lua | 14 --- .../monster/bosses/fleshslicer.lua | 14 --- .../monster/bosses/freegoiz.lua | 14 --- .../monster/bosses/gaffir.lua | 14 --- .../monster/bosses/general_murius.lua | 14 --- .../monster/bosses/glitterscale.lua | 14 --- .../monster/bosses/grandfather_tridian.lua | 14 --- .../monster/bosses/gravelord_oshuran.lua | 14 --- data-otservbr-global/monster/bosses/groam.lua | 14 --- .../monster/bosses/guard_captain_quaid.lua | 14 --- .../monster/bosses/hairman_the_huge.lua | 14 --- data-otservbr-global/monster/bosses/heoni.lua | 14 --- .../monster/bosses/incredibly_old_witch.lua | 14 --- .../monster/bosses/infernatil.lua | 14 --- .../monster/bosses/koshei_the_deathless.lua | 14 --- .../monster/bosses/kraknaknork's_demon.lua | 14 --- .../monster/bosses/kraknaknork.lua | 10 -- .../monster/bosses/kroazur.lua | 14 --- data-otservbr-global/monster/bosses/lisa.lua | 14 --- .../monster/bosses/mad_mage.lua | 14 --- .../monster/bosses/mad_technomancer.lua | 14 --- .../monster/bosses/morik_the_gladiator.lua | 14 --- .../monster/bosses/morshabaal.lua | 6 - .../monster/bosses/munster.lua | 14 --- .../monster/bosses/pythius_the_rotten.lua | 14 --- .../monster/bosses/raging_mage.lua | 14 --- .../monster/bosses/raxias.lua | 14 --- .../monster/bosses/renegade_orc.lua | 14 --- .../monster/bosses/rukor_zad.lua | 14 --- .../bosses/smuggler_baron_silvertoe.lua | 14 --- .../monster/bosses/spider_queen.lua | 14 --- .../monster/bosses/splasher.lua | 14 --- .../monster/bosses/teleskor.lua | 14 --- .../monster/bosses/the_abomination.lua | 14 --- .../monster/bosses/the_astral_source.lua | 14 --- .../monster/bosses/the_blightfather.lua | 14 --- .../monster/bosses/the_book_of_death.lua | 14 --- .../monster/bosses/the_brainstealer.lua | 14 --- .../monster/bosses/the_collector.lua | 14 --- .../monster/bosses/the_evil_eye.lua | 14 --- .../monster/bosses/the_first_dragon.lua | 14 --- .../monster/bosses/the_frog_prince.lua | 14 --- .../monster/bosses/the_monster.lua | 14 --- .../monster/bosses/verminor.lua | 14 --- data-otservbr-global/monster/bosses/visco.lua | 14 --- .../monster/bosses/warlord_ruzad.lua | 14 --- .../monster/bosses/weakened_demon.lua | 10 -- .../monster/bosses/weakened_shlorg.lua | 14 --- .../monster/bosses/williwasp.lua | 14 --- .../monster/bosses/yaga_the_crone.lua | 14 --- .../monster/bosses/zarabustor.lua | 14 --- .../monster/bosses/zavarash.lua | 14 --- .../monster/bosses/zevelon_duskbringer.lua | 14 --- .../monster/bosses/zoralurk.lua | 14 --- .../monster/bosses/zushuka.lua | 14 --- .../constructs/iron_servant_replica.lua | 23 ++++ .../event_creatures/the_mutated_pumpkin.lua | 14 --- .../monster/humans/cobra_assassin.lua | 4 + .../monster/humans/cobra_scout.lua | 4 + .../monster/humans/cobra_vizier.lua | 4 + .../ratmiral_blackwhiskers.lua | 6 - .../a_pirates_tail_quest/tentuglys_head.lua | 6 - .../megasylvan_yselda.lua | 6 - .../ancient_feud/katex_blood_tongue.lua | 6 - .../quests/ancient_feud/srezz_yellow_eyes.lua | 6 - .../quests/ancient_feud/utua_stone_sting.lua | 6 - .../ancient_feud/yirkas_blue_scales.lua | 6 - .../bosses/essence_of_malice.lua | 14 --- .../cults_of_tibia/bosses/ravenous_hunger.lua | 14 --- .../cults_of_tibia/bosses/the_false_god.lua | 14 --- .../cults_of_tibia/bosses/the_sandking.lua | 14 --- .../bosses/the_souldespoiler.lua | 14 --- .../bosses/the_source_of_corruption.lua | 14 --- .../bosses/the_unarmored_voidborn.lua | 14 --- .../bosses/the_baron_from_below.lua | 14 --- .../bosses/the_count_of_the_core.lua | 14 --- .../bosses/the_duke_of_the_depths.lua | 14 --- .../feaster_of_souls/irgix_the_flimsy.lua | 14 --- .../feaster_of_souls/the_dread_maiden.lua | 14 --- .../feaster_of_souls/the_fear_feaster.lua | 14 --- .../quests/feaster_of_souls/the_pale_worm.lua | 14 --- .../quests/feaster_of_souls/the_unwelcome.lua | 14 --- .../quests/feaster_of_souls/unaz_the_mean.lua | 14 --- .../feaster_of_souls/vok_the_freakish.lua | 14 --- .../bosses/ferumbras_mortal_shell.lua | 14 --- .../ferumbras_ascension/bosses/mazoran.lua | 14 --- .../ferumbras_ascension/bosses/plagirath.lua | 14 --- .../ferumbras_ascension/bosses/ragiaz.lua | 14 --- .../ferumbras_ascension/bosses/razzagorn.lua | 14 --- .../ferumbras_ascension/bosses/shulgrax.lua | 14 --- .../ferumbras_ascension/bosses/tarbaz.lua | 14 --- .../ferumbras_ascension/bosses/zamulosh.lua | 14 --- .../bosses/lady_tenebris.lua | 14 --- .../forgotten_knowledge/bosses/lloyd.lua | 14 --- .../bosses/melting_frozen_horror.lua | 14 --- .../bosses/soul_of_dragonking_zyrtarch.lua | 14 --- .../bosses/the_blazing_time_guardian.lua | 14 --- .../bosses/the_enraged_thorn_knight.lua | 14 --- .../bosses/the_freezing_time_guardian.lua | 14 --- .../bosses/the_last_lore_keeper.lua | 14 --- .../bosses/the_time_guardian.lua | 14 --- .../grave_danger/bosses/count_vlarkorth.lua | 14 --- .../quests/grave_danger/bosses/duke_krule.lua | 14 --- .../quests/grave_danger/bosses/earl_osam.lua | 14 --- .../quests/grave_danger/bosses/king_zelos.lua | 14 --- .../grave_danger/bosses/lord_azaram.lua | 14 --- .../grave_danger/bosses/scarlett_etzel.lua | 14 --- .../quests/grave_danger/bosses/sir_baeloc.lua | 14 --- .../heart_of_destruction/aftershock.lua | 14 --- .../quests/heart_of_destruction/anomaly.lua | 14 --- .../heart_of_destruction/charged_anomaly.lua | 14 --- .../charging_outburst.lua | 14 --- .../heart_of_destruction/eradicator.lua | 14 --- .../heart_of_destruction/eradicator2.lua | 14 --- .../quests/heart_of_destruction/foreshock.lua | 14 --- .../quests/heart_of_destruction/outburst.lua | 14 --- .../heart_of_destruction/realityquake.lua | 14 --- .../quests/heart_of_destruction/rupture.lua | 14 --- .../heart_of_destruction/world_devourer.lua | 14 --- .../quests/hero_of_rathleton/deep_terror.lua | 14 --- .../hero_of_rathleton/professor_maxxen.lua | 14 --- .../monster/quests/kilmaresh/bragrumol.lua | 14 --- .../monster/quests/kilmaresh/mozradek.lua | 14 --- .../kilmaresh/urmahlullu_the_weakened.lua | 14 --- .../monster/quests/kilmaresh/xogixath.lua | 14 --- .../monster/quests/liquid_black/jaul.lua | 14 --- .../monster/quests/liquid_black/obujos.lua | 14 --- .../monster/quests/liquid_black/tanjis.lua | 14 --- .../quests/marapur/timira_the_many-headed.lua | 6 - .../primal_ordeal_quest/magma_bubble.lua | 14 --- .../primal_ordeal_quest/plunder_patriarch.lua | 14 --- .../primal_ordeal_quest/the_primal_menace.lua | 10 -- .../monster/quests/roshamuul/gaz'haragoth.lua | 14 --- .../monster/quests/roshamuul/omrafir.lua | 14 --- .../quests/roshamuul/prince_drazzak.lua | 14 --- .../soul_war/goshnar's_megalomania_blue.lua | 6 - .../soul_war/goshnar's_megalomania_green.lua | 6 - .../quests/soul_war/goshnars_cruelty.lua | 14 --- .../quests/soul_war/goshnars_greed.lua | 4 - .../quests/soul_war/goshnars_hatred.lua | 16 --- .../quests/soul_war/goshnars_malice.lua | 12 -- .../quests/soul_war/goshnars_spite.lua | 14 --- .../quests/the_curse_spreads/black_vixen.lua | 14 --- .../quests/the_curse_spreads/bloodback.lua | 14 --- .../quests/the_curse_spreads/darkfang.lua | 14 --- .../quests/the_curse_spreads/feroxa5.lua | 14 --- .../quests/the_curse_spreads/shadowpelt.lua | 14 --- .../quests/the_curse_spreads/sharpclaw.lua | 14 --- .../the_dream_courts/bosses/alptramun.lua | 14 --- .../the_dream_courts/bosses/faceless_bane.lua | 19 --- .../bosses/izcandar_the_banished.lua | 14 --- .../bosses/malofur_mangrinder.lua | 14 --- .../the_dream_courts/bosses/maxxenius.lua | 14 --- .../the_dream_courts/bosses/plagueroot.lua | 14 --- .../bosses/the_nightmare_beast.lua | 14 --- .../bosses/ancient_lion_knight.lua | 6 - .../quests/the_order_of_lion/bosses/drume.lua | 6 - .../the_order_of_lion/lion_commander.lua | 15 --- .../the_order_of_lion/usurper_commander.lua | 16 --- .../the_secret_library/bosses/brokul.lua | 14 --- .../the_secret_library/bosses/ghulosh.lua | 14 --- .../the_secret_library/bosses/gorzindel.lua | 14 --- .../bosses/grand_canon_dominus.lua | 14 --- .../bosses/grand_chaplain_gaunder.lua | 14 --- .../bosses/grand_commander_soeren.lua | 14 --- .../bosses/grand_master_oberon.lua | 14 --- .../bosses/preceptor_lazare.lua | 14 --- .../bosses/thawing_dragon_lord.lua | 14 --- .../bosses/the_scourge_of_oblivion.lua | 14 --- .../quests/the_secret_library/lokathmor.lua | 14 --- .../quests/the_secret_library/mazzinor.lua | 14 --- .../monster/raids/chayenne.lua | 14 --- .../monster/raids/chizzoron_the_distorter.lua | 14 --- .../monster/raids/ferumbras.lua | 14 --- .../monster/raids/furyosa.lua | 14 --- .../monster/raids/ghazbaran.lua | 14 --- .../monster/raids/glooth_bomb.lua | 14 --- .../monster/raids/hirintror.lua | 14 --- .../monster/raids/mawhawk.lua | 14 --- .../monster/raids/morgaroth.lua | 14 --- .../monster/raids/ocyakao.lua | 14 --- .../monster/raids/orshabaal.lua | 14 --- .../monster/raids/the_pale_count.lua | 14 --- .../monster/raids/the_welter.lua | 14 --- data-otservbr-global/monster/raids/tyrn.lua | 14 --- .../monster/raids/white_pale.lua | 14 --- .../monster/raids/zulazza_the_corruptor.lua | 14 --- data-otservbr-global/monster/undeads/ahau.lua | 14 --- .../scripts/lib/monster_functions.lua | 8 ++ .../iron_servant_transformation.lua | 31 ----- .../startup/tables/writeable.lua | 4 - data/scripts/actions/items/cobra_flask.lua | 16 --- data/scripts/eventcallbacks/README.md | 19 +-- .../eventcallbacks/creature/on_hear.lua | 5 - .../eventcallbacks/monster/on_spawn.lua | 27 ---- data/scripts/lib/register_monster_type.lua | 3 + .../convert_monsters_callbacks.py | 116 ++++++++++++++++++ .../monsters/spawns/spawn_monster.cpp | 2 - src/creatures/npcs/spawns/spawn_npc.cpp | 3 - src/creatures/players/player.cpp | 4 - src/game/game.cpp | 4 - src/lua/callbacks/callbacks_definitions.hpp | 4 - src/lua/callbacks/event_callback.cpp | 84 ------------- src/lua/callbacks/event_callback.hpp | 5 - src/lua/creature/events.cpp | 110 ----------------- src/lua/creature/events.hpp | 10 -- .../functions/core/game/game_functions.cpp | 2 - src/lua/scripts/luascript.cpp | 4 + 238 files changed, 168 insertions(+), 3206 deletions(-) create mode 100644 data-otservbr-global/scripts/lib/monster_functions.lua delete mode 100644 data-otservbr-global/scripts/world_changes/iron_servant_transformation.lua delete mode 100644 data/scripts/eventcallbacks/creature/on_hear.lua delete mode 100644 data/scripts/eventcallbacks/monster/on_spawn.lua create mode 100644 docs/python-scripts/convert_monsters_callbacks.py diff --git a/data-canary/monster/bosses/apocalypse.lua b/data-canary/monster/bosses/apocalypse.lua index fba0ab1613a..47957c3ceab 100644 --- a/data-canary/monster/bosses/apocalypse.lua +++ b/data-canary/monster/bosses/apocalypse.lua @@ -143,18 +143,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-canary/monster/bosses/apprentice_sheng.lua b/data-canary/monster/bosses/apprentice_sheng.lua index 5e16a274500..07eeb42917a 100644 --- a/data-canary/monster/bosses/apprentice_sheng.lua +++ b/data-canary/monster/bosses/apprentice_sheng.lua @@ -117,18 +117,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-canary/monster/bosses/bazir.lua b/data-canary/monster/bosses/bazir.lua index 6c4a6eeccb5..353c392a3b0 100644 --- a/data-canary/monster/bosses/bazir.lua +++ b/data-canary/monster/bosses/bazir.lua @@ -179,18 +179,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-canary/monster/bosses/black_knight.lua b/data-canary/monster/bosses/black_knight.lua index 1ca457b449e..fd9ff673ab4 100644 --- a/data-canary/monster/bosses/black_knight.lua +++ b/data-canary/monster/bosses/black_knight.lua @@ -126,18 +126,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-canary/monster/bosses/bullwark.lua b/data-canary/monster/bosses/bullwark.lua index 7674d1dec01..1aa7974cfa0 100644 --- a/data-canary/monster/bosses/bullwark.lua +++ b/data-canary/monster/bosses/bullwark.lua @@ -124,18 +124,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-canary/monster/bosses/custodian.lua b/data-canary/monster/bosses/custodian.lua index 21b9721d6a8..cf2d0c1fdf4 100644 --- a/data-canary/monster/bosses/custodian.lua +++ b/data-canary/monster/bosses/custodian.lua @@ -102,18 +102,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-canary/monster/bosses/dharalion.lua b/data-canary/monster/bosses/dharalion.lua index 3f86d4a5269..3d3cb689684 100644 --- a/data-canary/monster/bosses/dharalion.lua +++ b/data-canary/monster/bosses/dharalion.lua @@ -132,18 +132,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-canary/monster/bosses/shadowpelt.lua b/data-canary/monster/bosses/shadowpelt.lua index 16fb1e60256..dcae734c0d3 100644 --- a/data-canary/monster/bosses/shadowpelt.lua +++ b/data-canary/monster/bosses/shadowpelt.lua @@ -135,18 +135,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/alchemist_container.lua b/data-otservbr-global/monster/bosses/alchemist_container.lua index 62905d5975e..5a15740a4f3 100644 --- a/data-otservbr-global/monster/bosses/alchemist_container.lua +++ b/data-otservbr-global/monster/bosses/alchemist_container.lua @@ -79,18 +79,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/antenna.lua b/data-otservbr-global/monster/bosses/antenna.lua index f1a165177cc..127d9fe77bf 100644 --- a/data-otservbr-global/monster/bosses/antenna.lua +++ b/data-otservbr-global/monster/bosses/antenna.lua @@ -79,18 +79,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/apocalypse.lua b/data-otservbr-global/monster/bosses/apocalypse.lua index 3e60fe75e34..422ebf84059 100644 --- a/data-otservbr-global/monster/bosses/apocalypse.lua +++ b/data-otservbr-global/monster/bosses/apocalypse.lua @@ -144,18 +144,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/apprentice_sheng.lua b/data-otservbr-global/monster/bosses/apprentice_sheng.lua index f0c6feacd95..b5d326f94a2 100644 --- a/data-otservbr-global/monster/bosses/apprentice_sheng.lua +++ b/data-otservbr-global/monster/bosses/apprentice_sheng.lua @@ -118,18 +118,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/armenius.lua b/data-otservbr-global/monster/bosses/armenius.lua index ffe6c7b412e..b80f2ff3b06 100644 --- a/data-otservbr-global/monster/bosses/armenius.lua +++ b/data-otservbr-global/monster/bosses/armenius.lua @@ -102,18 +102,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/bazir.lua b/data-otservbr-global/monster/bosses/bazir.lua index e9abbed723c..f9aa138933b 100644 --- a/data-otservbr-global/monster/bosses/bazir.lua +++ b/data-otservbr-global/monster/bosses/bazir.lua @@ -180,18 +180,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/bibby_bloodbath.lua b/data-otservbr-global/monster/bosses/bibby_bloodbath.lua index 8c1b09af2b5..d16b2f287d9 100644 --- a/data-otservbr-global/monster/bosses/bibby_bloodbath.lua +++ b/data-otservbr-global/monster/bosses/bibby_bloodbath.lua @@ -122,18 +122,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/big_boss_trolliver.lua b/data-otservbr-global/monster/bosses/big_boss_trolliver.lua index 24bc4ef5250..187b8e05d92 100644 --- a/data-otservbr-global/monster/bosses/big_boss_trolliver.lua +++ b/data-otservbr-global/monster/bosses/big_boss_trolliver.lua @@ -116,18 +116,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/black_knight.lua b/data-otservbr-global/monster/bosses/black_knight.lua index 2905e1a7814..359ef3e2d5b 100644 --- a/data-otservbr-global/monster/bosses/black_knight.lua +++ b/data-otservbr-global/monster/bosses/black_knight.lua @@ -131,18 +131,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/brain_head.lua b/data-otservbr-global/monster/bosses/brain_head.lua index c67524c5411..0c8b59b4a4a 100644 --- a/data-otservbr-global/monster/bosses/brain_head.lua +++ b/data-otservbr-global/monster/bosses/brain_head.lua @@ -102,18 +102,4 @@ monster.voices = { { text = "My lich-knights will conquer this world for me!", yell = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/bullwark.lua b/data-otservbr-global/monster/bosses/bullwark.lua index 2bc9ff91f02..2ae627598c9 100644 --- a/data-otservbr-global/monster/bosses/bullwark.lua +++ b/data-otservbr-global/monster/bosses/bullwark.lua @@ -127,18 +127,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/cerebellum.lua b/data-otservbr-global/monster/bosses/cerebellum.lua index b83fcec8615..5ca05351efb 100644 --- a/data-otservbr-global/monster/bosses/cerebellum.lua +++ b/data-otservbr-global/monster/bosses/cerebellum.lua @@ -77,18 +77,4 @@ monster.voices = { { text = "My lich-knights will conquer this world for me!", yell = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/chikhaton.lua b/data-otservbr-global/monster/bosses/chikhaton.lua index 53a430621ca..63b5629431c 100644 --- a/data-otservbr-global/monster/bosses/chikhaton.lua +++ b/data-otservbr-global/monster/bosses/chikhaton.lua @@ -102,18 +102,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/clubarc_the_plunderer.lua b/data-otservbr-global/monster/bosses/clubarc_the_plunderer.lua index aa10611af90..d2e7ca6c29f 100644 --- a/data-otservbr-global/monster/bosses/clubarc_the_plunderer.lua +++ b/data-otservbr-global/monster/bosses/clubarc_the_plunderer.lua @@ -108,18 +108,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/custodian.lua b/data-otservbr-global/monster/bosses/custodian.lua index d004ab5c3df..2a2e414d3d9 100644 --- a/data-otservbr-global/monster/bosses/custodian.lua +++ b/data-otservbr-global/monster/bosses/custodian.lua @@ -113,18 +113,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/dharalion.lua b/data-otservbr-global/monster/bosses/dharalion.lua index 3233e57448b..9268919df94 100644 --- a/data-otservbr-global/monster/bosses/dharalion.lua +++ b/data-otservbr-global/monster/bosses/dharalion.lua @@ -133,18 +133,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/diblis_the_fair.lua b/data-otservbr-global/monster/bosses/diblis_the_fair.lua index 531dc6c2818..585fb0eff0a 100644 --- a/data-otservbr-global/monster/bosses/diblis_the_fair.lua +++ b/data-otservbr-global/monster/bosses/diblis_the_fair.lua @@ -123,18 +123,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/diseased_bill.lua b/data-otservbr-global/monster/bosses/diseased_bill.lua index 42df3b5c771..bc6babe9171 100644 --- a/data-otservbr-global/monster/bosses/diseased_bill.lua +++ b/data-otservbr-global/monster/bosses/diseased_bill.lua @@ -114,18 +114,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/diseased_dan.lua b/data-otservbr-global/monster/bosses/diseased_dan.lua index c44f9bc9702..f3b0de85388 100644 --- a/data-otservbr-global/monster/bosses/diseased_dan.lua +++ b/data-otservbr-global/monster/bosses/diseased_dan.lua @@ -114,18 +114,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/diseased_fred.lua b/data-otservbr-global/monster/bosses/diseased_fred.lua index 59304042e5c..41994a777ea 100644 --- a/data-otservbr-global/monster/bosses/diseased_fred.lua +++ b/data-otservbr-global/monster/bosses/diseased_fred.lua @@ -114,18 +114,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/doctor_marrow.lua b/data-otservbr-global/monster/bosses/doctor_marrow.lua index cccdd2e4d57..cd694d83b62 100644 --- a/data-otservbr-global/monster/bosses/doctor_marrow.lua +++ b/data-otservbr-global/monster/bosses/doctor_marrow.lua @@ -98,18 +98,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/ekatrix.lua b/data-otservbr-global/monster/bosses/ekatrix.lua index 99c7fc0f603..42500ee134f 100644 --- a/data-otservbr-global/monster/bosses/ekatrix.lua +++ b/data-otservbr-global/monster/bosses/ekatrix.lua @@ -111,18 +111,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/energized_raging_mage.lua b/data-otservbr-global/monster/bosses/energized_raging_mage.lua index 0d3aea8aaf0..643ea7428a3 100644 --- a/data-otservbr-global/monster/bosses/energized_raging_mage.lua +++ b/data-otservbr-global/monster/bosses/energized_raging_mage.lua @@ -115,18 +115,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/fleshslicer.lua b/data-otservbr-global/monster/bosses/fleshslicer.lua index 53aafc0fd31..7308101c0d4 100644 --- a/data-otservbr-global/monster/bosses/fleshslicer.lua +++ b/data-otservbr-global/monster/bosses/fleshslicer.lua @@ -99,18 +99,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/freegoiz.lua b/data-otservbr-global/monster/bosses/freegoiz.lua index eee6234add3..8f2ad6839b3 100644 --- a/data-otservbr-global/monster/bosses/freegoiz.lua +++ b/data-otservbr-global/monster/bosses/freegoiz.lua @@ -167,18 +167,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/gaffir.lua b/data-otservbr-global/monster/bosses/gaffir.lua index a3e2feb16a6..a51115cb094 100644 --- a/data-otservbr-global/monster/bosses/gaffir.lua +++ b/data-otservbr-global/monster/bosses/gaffir.lua @@ -141,18 +141,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/general_murius.lua b/data-otservbr-global/monster/bosses/general_murius.lua index 4c761e0b89f..f3cf1837f0f 100644 --- a/data-otservbr-global/monster/bosses/general_murius.lua +++ b/data-otservbr-global/monster/bosses/general_murius.lua @@ -129,18 +129,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/glitterscale.lua b/data-otservbr-global/monster/bosses/glitterscale.lua index 0705a895176..c14fae7f785 100644 --- a/data-otservbr-global/monster/bosses/glitterscale.lua +++ b/data-otservbr-global/monster/bosses/glitterscale.lua @@ -101,18 +101,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/grandfather_tridian.lua b/data-otservbr-global/monster/bosses/grandfather_tridian.lua index 6c2f0e9f188..3d58c8d768d 100644 --- a/data-otservbr-global/monster/bosses/grandfather_tridian.lua +++ b/data-otservbr-global/monster/bosses/grandfather_tridian.lua @@ -124,18 +124,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/gravelord_oshuran.lua b/data-otservbr-global/monster/bosses/gravelord_oshuran.lua index 442c014dcbb..53ed2381c4f 100644 --- a/data-otservbr-global/monster/bosses/gravelord_oshuran.lua +++ b/data-otservbr-global/monster/bosses/gravelord_oshuran.lua @@ -121,18 +121,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/groam.lua b/data-otservbr-global/monster/bosses/groam.lua index e010d50e708..8e9e56a2c5f 100644 --- a/data-otservbr-global/monster/bosses/groam.lua +++ b/data-otservbr-global/monster/bosses/groam.lua @@ -109,18 +109,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/guard_captain_quaid.lua b/data-otservbr-global/monster/bosses/guard_captain_quaid.lua index 479757ca620..85507170974 100644 --- a/data-otservbr-global/monster/bosses/guard_captain_quaid.lua +++ b/data-otservbr-global/monster/bosses/guard_captain_quaid.lua @@ -126,18 +126,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/hairman_the_huge.lua b/data-otservbr-global/monster/bosses/hairman_the_huge.lua index 735c1b3b263..5b0aa24de1d 100644 --- a/data-otservbr-global/monster/bosses/hairman_the_huge.lua +++ b/data-otservbr-global/monster/bosses/hairman_the_huge.lua @@ -107,18 +107,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/heoni.lua b/data-otservbr-global/monster/bosses/heoni.lua index b5e9cfdcfd3..9f099de756d 100644 --- a/data-otservbr-global/monster/bosses/heoni.lua +++ b/data-otservbr-global/monster/bosses/heoni.lua @@ -105,18 +105,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/incredibly_old_witch.lua b/data-otservbr-global/monster/bosses/incredibly_old_witch.lua index 8680042f7ca..4cd69a5fef2 100644 --- a/data-otservbr-global/monster/bosses/incredibly_old_witch.lua +++ b/data-otservbr-global/monster/bosses/incredibly_old_witch.lua @@ -104,18 +104,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/infernatil.lua b/data-otservbr-global/monster/bosses/infernatil.lua index c7ca8c53050..0a493c91177 100644 --- a/data-otservbr-global/monster/bosses/infernatil.lua +++ b/data-otservbr-global/monster/bosses/infernatil.lua @@ -176,18 +176,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/koshei_the_deathless.lua b/data-otservbr-global/monster/bosses/koshei_the_deathless.lua index e0b1c5e1ecc..ff6cc6e8654 100644 --- a/data-otservbr-global/monster/bosses/koshei_the_deathless.lua +++ b/data-otservbr-global/monster/bosses/koshei_the_deathless.lua @@ -116,18 +116,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/kraknaknork's_demon.lua b/data-otservbr-global/monster/bosses/kraknaknork's_demon.lua index 8902bd9e527..a1579035a6f 100644 --- a/data-otservbr-global/monster/bosses/kraknaknork's_demon.lua +++ b/data-otservbr-global/monster/bosses/kraknaknork's_demon.lua @@ -97,18 +97,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/kraknaknork.lua b/data-otservbr-global/monster/bosses/kraknaknork.lua index 2bb4eb32b4a..c639a0c8bfd 100644 --- a/data-otservbr-global/monster/bosses/kraknaknork.lua +++ b/data-otservbr-global/monster/bosses/kraknaknork.lua @@ -112,14 +112,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/kroazur.lua b/data-otservbr-global/monster/bosses/kroazur.lua index 1664c14347a..ea38b19db8f 100644 --- a/data-otservbr-global/monster/bosses/kroazur.lua +++ b/data-otservbr-global/monster/bosses/kroazur.lua @@ -127,18 +127,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/lisa.lua b/data-otservbr-global/monster/bosses/lisa.lua index 7cbff8d7d49..2890e8d692a 100644 --- a/data-otservbr-global/monster/bosses/lisa.lua +++ b/data-otservbr-global/monster/bosses/lisa.lua @@ -130,18 +130,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/mad_mage.lua b/data-otservbr-global/monster/bosses/mad_mage.lua index 2ff8144d310..307f26a9aa0 100644 --- a/data-otservbr-global/monster/bosses/mad_mage.lua +++ b/data-otservbr-global/monster/bosses/mad_mage.lua @@ -133,18 +133,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/mad_technomancer.lua b/data-otservbr-global/monster/bosses/mad_technomancer.lua index 7d72216b88a..0a329a858a6 100644 --- a/data-otservbr-global/monster/bosses/mad_technomancer.lua +++ b/data-otservbr-global/monster/bosses/mad_technomancer.lua @@ -104,18 +104,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/morik_the_gladiator.lua b/data-otservbr-global/monster/bosses/morik_the_gladiator.lua index 5a8a012ca84..670294b12e8 100644 --- a/data-otservbr-global/monster/bosses/morik_the_gladiator.lua +++ b/data-otservbr-global/monster/bosses/morik_the_gladiator.lua @@ -109,18 +109,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/morshabaal.lua b/data-otservbr-global/monster/bosses/morshabaal.lua index 4273977e2eb..363c103cad2 100644 --- a/data-otservbr-global/monster/bosses/morshabaal.lua +++ b/data-otservbr-global/monster/bosses/morshabaal.lua @@ -145,10 +145,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/munster.lua b/data-otservbr-global/monster/bosses/munster.lua index daeeac7655e..21c2761d0f8 100644 --- a/data-otservbr-global/monster/bosses/munster.lua +++ b/data-otservbr-global/monster/bosses/munster.lua @@ -109,18 +109,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/pythius_the_rotten.lua b/data-otservbr-global/monster/bosses/pythius_the_rotten.lua index 80f694af6bc..742285c193f 100644 --- a/data-otservbr-global/monster/bosses/pythius_the_rotten.lua +++ b/data-otservbr-global/monster/bosses/pythius_the_rotten.lua @@ -116,18 +116,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/raging_mage.lua b/data-otservbr-global/monster/bosses/raging_mage.lua index 5fd30131b8a..84e0232f37f 100644 --- a/data-otservbr-global/monster/bosses/raging_mage.lua +++ b/data-otservbr-global/monster/bosses/raging_mage.lua @@ -138,18 +138,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/raxias.lua b/data-otservbr-global/monster/bosses/raxias.lua index ea62576f52d..3f0f7cf1ce6 100644 --- a/data-otservbr-global/monster/bosses/raxias.lua +++ b/data-otservbr-global/monster/bosses/raxias.lua @@ -103,18 +103,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/renegade_orc.lua b/data-otservbr-global/monster/bosses/renegade_orc.lua index 53f075751ae..157b75d352a 100644 --- a/data-otservbr-global/monster/bosses/renegade_orc.lua +++ b/data-otservbr-global/monster/bosses/renegade_orc.lua @@ -115,18 +115,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/rukor_zad.lua b/data-otservbr-global/monster/bosses/rukor_zad.lua index 361365745b5..bbcf1706943 100644 --- a/data-otservbr-global/monster/bosses/rukor_zad.lua +++ b/data-otservbr-global/monster/bosses/rukor_zad.lua @@ -116,18 +116,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/smuggler_baron_silvertoe.lua b/data-otservbr-global/monster/bosses/smuggler_baron_silvertoe.lua index b59d09d2387..c35cc2dcf40 100644 --- a/data-otservbr-global/monster/bosses/smuggler_baron_silvertoe.lua +++ b/data-otservbr-global/monster/bosses/smuggler_baron_silvertoe.lua @@ -116,18 +116,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/spider_queen.lua b/data-otservbr-global/monster/bosses/spider_queen.lua index 1f2b018f26c..88a0aa939c1 100644 --- a/data-otservbr-global/monster/bosses/spider_queen.lua +++ b/data-otservbr-global/monster/bosses/spider_queen.lua @@ -94,18 +94,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/splasher.lua b/data-otservbr-global/monster/bosses/splasher.lua index 426d3be3c26..825f56607db 100644 --- a/data-otservbr-global/monster/bosses/splasher.lua +++ b/data-otservbr-global/monster/bosses/splasher.lua @@ -110,18 +110,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/teleskor.lua b/data-otservbr-global/monster/bosses/teleskor.lua index 0c27b032658..e5941477479 100644 --- a/data-otservbr-global/monster/bosses/teleskor.lua +++ b/data-otservbr-global/monster/bosses/teleskor.lua @@ -104,18 +104,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_abomination.lua b/data-otservbr-global/monster/bosses/the_abomination.lua index e6ba0b1ae06..0249b2453ae 100644 --- a/data-otservbr-global/monster/bosses/the_abomination.lua +++ b/data-otservbr-global/monster/bosses/the_abomination.lua @@ -125,18 +125,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_astral_source.lua b/data-otservbr-global/monster/bosses/the_astral_source.lua index abc46bfc1d4..008da5078b5 100644 --- a/data-otservbr-global/monster/bosses/the_astral_source.lua +++ b/data-otservbr-global/monster/bosses/the_astral_source.lua @@ -96,18 +96,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_blightfather.lua b/data-otservbr-global/monster/bosses/the_blightfather.lua index 1cb8c870901..7e1c0515e87 100644 --- a/data-otservbr-global/monster/bosses/the_blightfather.lua +++ b/data-otservbr-global/monster/bosses/the_blightfather.lua @@ -108,18 +108,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_book_of_death.lua b/data-otservbr-global/monster/bosses/the_book_of_death.lua index 4f2d3288447..53d37c08795 100644 --- a/data-otservbr-global/monster/bosses/the_book_of_death.lua +++ b/data-otservbr-global/monster/bosses/the_book_of_death.lua @@ -100,18 +100,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_brainstealer.lua b/data-otservbr-global/monster/bosses/the_brainstealer.lua index 57a4beba537..78d783d4618 100644 --- a/data-otservbr-global/monster/bosses/the_brainstealer.lua +++ b/data-otservbr-global/monster/bosses/the_brainstealer.lua @@ -129,18 +129,4 @@ monster.voices = { { text = "My lich-knights will conquer this world for me!", yell = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_collector.lua b/data-otservbr-global/monster/bosses/the_collector.lua index b3fa70f85c6..5fd5a4a6336 100644 --- a/data-otservbr-global/monster/bosses/the_collector.lua +++ b/data-otservbr-global/monster/bosses/the_collector.lua @@ -98,18 +98,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_evil_eye.lua b/data-otservbr-global/monster/bosses/the_evil_eye.lua index f712959cdd7..b3be845c629 100644 --- a/data-otservbr-global/monster/bosses/the_evil_eye.lua +++ b/data-otservbr-global/monster/bosses/the_evil_eye.lua @@ -123,18 +123,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_first_dragon.lua b/data-otservbr-global/monster/bosses/the_first_dragon.lua index 34294280dd1..921f8394622 100644 --- a/data-otservbr-global/monster/bosses/the_first_dragon.lua +++ b/data-otservbr-global/monster/bosses/the_first_dragon.lua @@ -108,18 +108,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_frog_prince.lua b/data-otservbr-global/monster/bosses/the_frog_prince.lua index d90c6c78b2e..745757dc621 100644 --- a/data-otservbr-global/monster/bosses/the_frog_prince.lua +++ b/data-otservbr-global/monster/bosses/the_frog_prince.lua @@ -102,18 +102,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/the_monster.lua b/data-otservbr-global/monster/bosses/the_monster.lua index c7f84935b20..368bff98af0 100644 --- a/data-otservbr-global/monster/bosses/the_monster.lua +++ b/data-otservbr-global/monster/bosses/the_monster.lua @@ -116,18 +116,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/verminor.lua b/data-otservbr-global/monster/bosses/verminor.lua index 1712cccab2e..43b4c194257 100644 --- a/data-otservbr-global/monster/bosses/verminor.lua +++ b/data-otservbr-global/monster/bosses/verminor.lua @@ -166,18 +166,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/visco.lua b/data-otservbr-global/monster/bosses/visco.lua index 96223ee28c0..d78729aeaf6 100644 --- a/data-otservbr-global/monster/bosses/visco.lua +++ b/data-otservbr-global/monster/bosses/visco.lua @@ -124,18 +124,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/warlord_ruzad.lua b/data-otservbr-global/monster/bosses/warlord_ruzad.lua index b66a9c3284b..1970e2d47f6 100644 --- a/data-otservbr-global/monster/bosses/warlord_ruzad.lua +++ b/data-otservbr-global/monster/bosses/warlord_ruzad.lua @@ -124,18 +124,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/weakened_demon.lua b/data-otservbr-global/monster/bosses/weakened_demon.lua index 7daf2f5dfb2..936849b379f 100644 --- a/data-otservbr-global/monster/bosses/weakened_demon.lua +++ b/data-otservbr-global/monster/bosses/weakened_demon.lua @@ -95,14 +95,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/weakened_shlorg.lua b/data-otservbr-global/monster/bosses/weakened_shlorg.lua index 615bd45f158..3734d602406 100644 --- a/data-otservbr-global/monster/bosses/weakened_shlorg.lua +++ b/data-otservbr-global/monster/bosses/weakened_shlorg.lua @@ -122,18 +122,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/williwasp.lua b/data-otservbr-global/monster/bosses/williwasp.lua index 64a90d09de1..93868eba760 100644 --- a/data-otservbr-global/monster/bosses/williwasp.lua +++ b/data-otservbr-global/monster/bosses/williwasp.lua @@ -104,18 +104,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/yaga_the_crone.lua b/data-otservbr-global/monster/bosses/yaga_the_crone.lua index 4987d01b4c2..5f47c5c907c 100644 --- a/data-otservbr-global/monster/bosses/yaga_the_crone.lua +++ b/data-otservbr-global/monster/bosses/yaga_the_crone.lua @@ -120,18 +120,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/zarabustor.lua b/data-otservbr-global/monster/bosses/zarabustor.lua index 8bb36a5e904..fbe771c51b9 100644 --- a/data-otservbr-global/monster/bosses/zarabustor.lua +++ b/data-otservbr-global/monster/bosses/zarabustor.lua @@ -128,18 +128,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/zavarash.lua b/data-otservbr-global/monster/bosses/zavarash.lua index a3f41dc6d04..3fd5b60c1e4 100644 --- a/data-otservbr-global/monster/bosses/zavarash.lua +++ b/data-otservbr-global/monster/bosses/zavarash.lua @@ -136,18 +136,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/zevelon_duskbringer.lua b/data-otservbr-global/monster/bosses/zevelon_duskbringer.lua index 7dd4739741e..836ecdf37c2 100644 --- a/data-otservbr-global/monster/bosses/zevelon_duskbringer.lua +++ b/data-otservbr-global/monster/bosses/zevelon_duskbringer.lua @@ -124,18 +124,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/zoralurk.lua b/data-otservbr-global/monster/bosses/zoralurk.lua index e8095a70f68..6afc231f0d9 100644 --- a/data-otservbr-global/monster/bosses/zoralurk.lua +++ b/data-otservbr-global/monster/bosses/zoralurk.lua @@ -125,18 +125,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/zushuka.lua b/data-otservbr-global/monster/bosses/zushuka.lua index 2491261be7b..6e5c027d4c4 100644 --- a/data-otservbr-global/monster/bosses/zushuka.lua +++ b/data-otservbr-global/monster/bosses/zushuka.lua @@ -145,18 +145,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/constructs/iron_servant_replica.lua b/data-otservbr-global/monster/constructs/iron_servant_replica.lua index 4ff09899972..a0fa2c74c74 100644 --- a/data-otservbr-global/monster/constructs/iron_servant_replica.lua +++ b/data-otservbr-global/monster/constructs/iron_servant_replica.lua @@ -113,4 +113,27 @@ monster.immunities = { { type = "bleed", condition = false }, } +mType.onSpawn = function(monster) + local chance = math.random(100) + if Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.MechanismDiamond) >= 1 and Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.MechanismGolden) >= 1 then + if chance > 30 then + local monsterType = math.random(2) == 1 and "diamond servant replica" or "golden servant replica" + Game.createMonster(monsterType, monster:getPosition(), false, true) + monster:remove() + end + return + end + + if Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.MechanismDiamond) >= 1 and chance > 30 then + Game.createMonster("diamond servant replica", monster:getPosition(), false, true) + monster:remove() + return + end + + if Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.MechanismGolden) >= 1 and chance > 30 then + Game.createMonster("golden servant replica", monster:getPosition(), false, true) + monster:remove() + end +end + mType:register(monster) diff --git a/data-otservbr-global/monster/event_creatures/the_mutated_pumpkin.lua b/data-otservbr-global/monster/event_creatures/the_mutated_pumpkin.lua index 5e219736804..4abdfe16340 100644 --- a/data-otservbr-global/monster/event_creatures/the_mutated_pumpkin.lua +++ b/data-otservbr-global/monster/event_creatures/the_mutated_pumpkin.lua @@ -130,18 +130,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/humans/cobra_assassin.lua b/data-otservbr-global/monster/humans/cobra_assassin.lua index a2206a77ad5..90a753a9c33 100644 --- a/data-otservbr-global/monster/humans/cobra_assassin.lua +++ b/data-otservbr-global/monster/humans/cobra_assassin.lua @@ -121,4 +121,8 @@ monster.immunities = { { type = "bleed", condition = false }, } +mType.onSpawn = function(monster) + self:handleCobraOnSpawn() +end + mType:register(monster) diff --git a/data-otservbr-global/monster/humans/cobra_scout.lua b/data-otservbr-global/monster/humans/cobra_scout.lua index 7aded2b24ec..f127abc81ee 100644 --- a/data-otservbr-global/monster/humans/cobra_scout.lua +++ b/data-otservbr-global/monster/humans/cobra_scout.lua @@ -126,4 +126,8 @@ monster.immunities = { { type = "bleed", condition = false }, } +mType.onSpawn = function(monster) + self:handleCobraOnSpawn() +end + mType:register(monster) diff --git a/data-otservbr-global/monster/humans/cobra_vizier.lua b/data-otservbr-global/monster/humans/cobra_vizier.lua index c6052ab7829..47ccb6b58c4 100644 --- a/data-otservbr-global/monster/humans/cobra_vizier.lua +++ b/data-otservbr-global/monster/humans/cobra_vizier.lua @@ -129,4 +129,8 @@ monster.immunities = { { type = "bleed", condition = false }, } +mType.onSpawn = function(monster) + self:handleCobraOnSpawn() +end + mType:register(monster) diff --git a/data-otservbr-global/monster/quests/a_pirates_tail_quest/ratmiral_blackwhiskers.lua b/data-otservbr-global/monster/quests/a_pirates_tail_quest/ratmiral_blackwhiskers.lua index d399413ed93..03a093b3afb 100644 --- a/data-otservbr-global/monster/quests/a_pirates_tail_quest/ratmiral_blackwhiskers.lua +++ b/data-otservbr-global/monster/quests/a_pirates_tail_quest/ratmiral_blackwhiskers.lua @@ -141,10 +141,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/a_pirates_tail_quest/tentuglys_head.lua b/data-otservbr-global/monster/quests/a_pirates_tail_quest/tentuglys_head.lua index 07fef10a1fd..2fe0c2d05ce 100644 --- a/data-otservbr-global/monster/quests/a_pirates_tail_quest/tentuglys_head.lua +++ b/data-otservbr-global/monster/quests/a_pirates_tail_quest/tentuglys_head.lua @@ -121,10 +121,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/adventures_of_galthen/megasylvan_yselda.lua b/data-otservbr-global/monster/quests/adventures_of_galthen/megasylvan_yselda.lua index 606427d8afe..d3343d38d23 100644 --- a/data-otservbr-global/monster/quests/adventures_of_galthen/megasylvan_yselda.lua +++ b/data-otservbr-global/monster/quests/adventures_of_galthen/megasylvan_yselda.lua @@ -128,10 +128,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ancient_feud/katex_blood_tongue.lua b/data-otservbr-global/monster/quests/ancient_feud/katex_blood_tongue.lua index b6806adbed6..5c7ff8775e3 100644 --- a/data-otservbr-global/monster/quests/ancient_feud/katex_blood_tongue.lua +++ b/data-otservbr-global/monster/quests/ancient_feud/katex_blood_tongue.lua @@ -134,10 +134,4 @@ monster.immunities = { { type = "bleed", condition = true }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ancient_feud/srezz_yellow_eyes.lua b/data-otservbr-global/monster/quests/ancient_feud/srezz_yellow_eyes.lua index 3c849c72aa3..5246bf87bc4 100644 --- a/data-otservbr-global/monster/quests/ancient_feud/srezz_yellow_eyes.lua +++ b/data-otservbr-global/monster/quests/ancient_feud/srezz_yellow_eyes.lua @@ -128,10 +128,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ancient_feud/utua_stone_sting.lua b/data-otservbr-global/monster/quests/ancient_feud/utua_stone_sting.lua index 511c78787aa..06562f10883 100644 --- a/data-otservbr-global/monster/quests/ancient_feud/utua_stone_sting.lua +++ b/data-otservbr-global/monster/quests/ancient_feud/utua_stone_sting.lua @@ -131,10 +131,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ancient_feud/yirkas_blue_scales.lua b/data-otservbr-global/monster/quests/ancient_feud/yirkas_blue_scales.lua index e469fa36986..1b170cb7447 100644 --- a/data-otservbr-global/monster/quests/ancient_feud/yirkas_blue_scales.lua +++ b/data-otservbr-global/monster/quests/ancient_feud/yirkas_blue_scales.lua @@ -129,10 +129,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua index 26aceb32010..c1cd61949aa 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua @@ -130,18 +130,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/ravenous_hunger.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/ravenous_hunger.lua index e3eef7671c6..cf456f603fb 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/ravenous_hunger.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/ravenous_hunger.lua @@ -145,18 +145,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_false_god.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_false_god.lua index a1ec678bdf0..fc7fc63b2ad 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_false_god.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_false_god.lua @@ -139,18 +139,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_sandking.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_sandking.lua index 3e0914007db..ecddb810da0 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_sandking.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_sandking.lua @@ -144,18 +144,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_souldespoiler.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_souldespoiler.lua index 976fe5fe317..b6d08409ec8 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_souldespoiler.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_souldespoiler.lua @@ -155,18 +155,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_source_of_corruption.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_source_of_corruption.lua index 83f14ead593..3361299d9a9 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_source_of_corruption.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_source_of_corruption.lua @@ -117,18 +117,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_unarmored_voidborn.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_unarmored_voidborn.lua index 04df78685ac..42fc6498721 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_unarmored_voidborn.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_unarmored_voidborn.lua @@ -136,18 +136,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_baron_from_below.lua b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_baron_from_below.lua index a381c3b07d6..1a666a75342 100644 --- a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_baron_from_below.lua +++ b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_baron_from_below.lua @@ -151,18 +151,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua index 17cb6520d29..60769958a14 100644 --- a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua +++ b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua @@ -152,18 +152,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua index 99053b93882..29f3d1d3e40 100644 --- a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua +++ b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua @@ -152,18 +152,4 @@ monster.heals = { { type = COMBAT_FIREDAMAGE, percent = 100 }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/irgix_the_flimsy.lua b/data-otservbr-global/monster/quests/feaster_of_souls/irgix_the_flimsy.lua index 307f1b27380..1d2507cb3e5 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/irgix_the_flimsy.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/irgix_the_flimsy.lua @@ -113,18 +113,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/the_dread_maiden.lua b/data-otservbr-global/monster/quests/feaster_of_souls/the_dread_maiden.lua index 83308c9c2fc..9fbbf66ce16 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/the_dread_maiden.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/the_dread_maiden.lua @@ -133,18 +133,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/the_fear_feaster.lua b/data-otservbr-global/monster/quests/feaster_of_souls/the_fear_feaster.lua index 85a6444085b..dda3018993c 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/the_fear_feaster.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/the_fear_feaster.lua @@ -136,18 +136,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/the_pale_worm.lua b/data-otservbr-global/monster/quests/feaster_of_souls/the_pale_worm.lua index ab309d2f583..6c816a7ee52 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/the_pale_worm.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/the_pale_worm.lua @@ -144,18 +144,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua b/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua index e4abf230b1d..a3a283b0a7f 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua @@ -138,18 +138,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/unaz_the_mean.lua b/data-otservbr-global/monster/quests/feaster_of_souls/unaz_the_mean.lua index fb871252bea..52582834231 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/unaz_the_mean.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/unaz_the_mean.lua @@ -113,18 +113,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/vok_the_freakish.lua b/data-otservbr-global/monster/quests/feaster_of_souls/vok_the_freakish.lua index 4efff07d202..7de35d1b9d1 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/vok_the_freakish.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/vok_the_freakish.lua @@ -111,18 +111,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ferumbras_mortal_shell.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ferumbras_mortal_shell.lua index 7ad855bc88a..a7c9f071385 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ferumbras_mortal_shell.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ferumbras_mortal_shell.lua @@ -186,18 +186,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/mazoran.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/mazoran.lua index 3f32bac95d4..8213e9a4d51 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/mazoran.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/mazoran.lua @@ -141,18 +141,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/plagirath.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/plagirath.lua index 364b4f864a8..b8fff3b3006 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/plagirath.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/plagirath.lua @@ -141,18 +141,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ragiaz.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ragiaz.lua index df016edfd84..856dbf02d2b 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ragiaz.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ragiaz.lua @@ -144,18 +144,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/razzagorn.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/razzagorn.lua index 066e22237c0..f95b0b69093 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/razzagorn.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/razzagorn.lua @@ -158,18 +158,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/shulgrax.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/shulgrax.lua index 72c908104af..1eef0866ceb 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/shulgrax.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/shulgrax.lua @@ -153,18 +153,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/tarbaz.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/tarbaz.lua index 30b99353cdf..7cb57a1040d 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/tarbaz.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/tarbaz.lua @@ -143,18 +143,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh.lua index 03fa92d3394..41e8b074228 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh.lua @@ -143,18 +143,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lady_tenebris.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lady_tenebris.lua index 17d68ca6994..c4228eefe54 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lady_tenebris.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lady_tenebris.lua @@ -149,18 +149,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lloyd.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lloyd.lua index 5d5f729e749..1f73944519a 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lloyd.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lloyd.lua @@ -146,18 +146,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/melting_frozen_horror.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/melting_frozen_horror.lua index 6fa44fff690..5f50a0c3e22 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/melting_frozen_horror.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/melting_frozen_horror.lua @@ -138,18 +138,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/soul_of_dragonking_zyrtarch.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/soul_of_dragonking_zyrtarch.lua index 2def55d9283..c45a1fc4ef0 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/soul_of_dragonking_zyrtarch.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/soul_of_dragonking_zyrtarch.lua @@ -147,18 +147,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_blazing_time_guardian.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_blazing_time_guardian.lua index fef77ab81cf..e13c2f7fd22 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_blazing_time_guardian.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_blazing_time_guardian.lua @@ -131,18 +131,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_enraged_thorn_knight.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_enraged_thorn_knight.lua index c664a5e21d2..ab868b6f58c 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_enraged_thorn_knight.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_enraged_thorn_knight.lua @@ -152,18 +152,4 @@ monster.heals = { { type = COMBAT_DEATHDAMAGE, percent = 100 }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_freezing_time_guardian.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_freezing_time_guardian.lua index 8fcbd1ddbab..b3f64c4331a 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_freezing_time_guardian.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_freezing_time_guardian.lua @@ -132,18 +132,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_last_lore_keeper.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_last_lore_keeper.lua index f1d96fe25bc..30dd34b9766 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_last_lore_keeper.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_last_lore_keeper.lua @@ -164,18 +164,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_time_guardian.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_time_guardian.lua index 7bf8e0c82ad..902c9a28950 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_time_guardian.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_time_guardian.lua @@ -150,18 +150,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua index ced550fbc84..f2de105033d 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua @@ -142,18 +142,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua index 518eda46ac2..851867e0161 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua @@ -135,18 +135,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua index c996116a336..930a744f326 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua @@ -138,18 +138,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua index cafd09f34a7..b723715c55d 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua @@ -122,18 +122,4 @@ monster.voices = { { text = "My lich-knights will conquer this world for me!", yell = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua index 8507c3a0c1c..188f11c9dc6 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua @@ -138,18 +138,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua index 6673313045f..9dcb6503d38 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua @@ -146,18 +146,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua index 042ce32e981..957ad10e5ff 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua @@ -136,18 +136,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/aftershock.lua b/data-otservbr-global/monster/quests/heart_of_destruction/aftershock.lua index 04c1b3a2589..8f14e9d3fb1 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/aftershock.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/aftershock.lua @@ -106,18 +106,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/anomaly.lua b/data-otservbr-global/monster/quests/heart_of_destruction/anomaly.lua index 2d6c0e44405..6350b49a3c6 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/anomaly.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/anomaly.lua @@ -145,18 +145,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/charged_anomaly.lua b/data-otservbr-global/monster/quests/heart_of_destruction/charged_anomaly.lua index 075c308d7df..aa3f5589fc5 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/charged_anomaly.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/charged_anomaly.lua @@ -103,18 +103,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/charging_outburst.lua b/data-otservbr-global/monster/quests/heart_of_destruction/charging_outburst.lua index 273ab8f579e..d765d016a8a 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/charging_outburst.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/charging_outburst.lua @@ -103,18 +103,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/eradicator.lua b/data-otservbr-global/monster/quests/heart_of_destruction/eradicator.lua index d81c9b4faf1..e7eb2443a4d 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/eradicator.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/eradicator.lua @@ -137,18 +137,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/eradicator2.lua b/data-otservbr-global/monster/quests/heart_of_destruction/eradicator2.lua index 14b92badfbe..0c8dba87dac 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/eradicator2.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/eradicator2.lua @@ -136,18 +136,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/foreshock.lua b/data-otservbr-global/monster/quests/heart_of_destruction/foreshock.lua index 99f5be41e19..7e1f3fc214a 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/foreshock.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/foreshock.lua @@ -106,18 +106,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/outburst.lua b/data-otservbr-global/monster/quests/heart_of_destruction/outburst.lua index c40159545ed..e0efdb42d16 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/outburst.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/outburst.lua @@ -128,18 +128,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/realityquake.lua b/data-otservbr-global/monster/quests/heart_of_destruction/realityquake.lua index c9d7601584f..3870524d5a9 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/realityquake.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/realityquake.lua @@ -127,18 +127,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/rupture.lua b/data-otservbr-global/monster/quests/heart_of_destruction/rupture.lua index 5d68108bba4..672bd5ecc0c 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/rupture.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/rupture.lua @@ -131,18 +131,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/heart_of_destruction/world_devourer.lua b/data-otservbr-global/monster/quests/heart_of_destruction/world_devourer.lua index c8e7198a2e1..6bf55bf348d 100644 --- a/data-otservbr-global/monster/quests/heart_of_destruction/world_devourer.lua +++ b/data-otservbr-global/monster/quests/heart_of_destruction/world_devourer.lua @@ -135,18 +135,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/hero_of_rathleton/deep_terror.lua b/data-otservbr-global/monster/quests/hero_of_rathleton/deep_terror.lua index debd09c9bb9..aaa7f1936af 100644 --- a/data-otservbr-global/monster/quests/hero_of_rathleton/deep_terror.lua +++ b/data-otservbr-global/monster/quests/hero_of_rathleton/deep_terror.lua @@ -109,18 +109,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/hero_of_rathleton/professor_maxxen.lua b/data-otservbr-global/monster/quests/hero_of_rathleton/professor_maxxen.lua index 947a56a0187..4085e5eab86 100644 --- a/data-otservbr-global/monster/quests/hero_of_rathleton/professor_maxxen.lua +++ b/data-otservbr-global/monster/quests/hero_of_rathleton/professor_maxxen.lua @@ -127,18 +127,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/kilmaresh/bragrumol.lua b/data-otservbr-global/monster/quests/kilmaresh/bragrumol.lua index bb7ef950744..125a017735b 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/bragrumol.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/bragrumol.lua @@ -117,18 +117,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/kilmaresh/mozradek.lua b/data-otservbr-global/monster/quests/kilmaresh/mozradek.lua index 8602923a08b..da498edede4 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/mozradek.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/mozradek.lua @@ -111,18 +111,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_weakened.lua b/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_weakened.lua index 96a8dd39081..1060d49b26f 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_weakened.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_weakened.lua @@ -147,18 +147,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/kilmaresh/xogixath.lua b/data-otservbr-global/monster/quests/kilmaresh/xogixath.lua index 3c77465e1ab..70dc531f5ce 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/xogixath.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/xogixath.lua @@ -117,18 +117,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/liquid_black/jaul.lua b/data-otservbr-global/monster/quests/liquid_black/jaul.lua index 965bbacb14c..7802788a73e 100644 --- a/data-otservbr-global/monster/quests/liquid_black/jaul.lua +++ b/data-otservbr-global/monster/quests/liquid_black/jaul.lua @@ -123,18 +123,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/liquid_black/obujos.lua b/data-otservbr-global/monster/quests/liquid_black/obujos.lua index 1f32fd54f1c..5e732cdcbd0 100644 --- a/data-otservbr-global/monster/quests/liquid_black/obujos.lua +++ b/data-otservbr-global/monster/quests/liquid_black/obujos.lua @@ -115,18 +115,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/liquid_black/tanjis.lua b/data-otservbr-global/monster/quests/liquid_black/tanjis.lua index 586af950be3..f726e36fe55 100644 --- a/data-otservbr-global/monster/quests/liquid_black/tanjis.lua +++ b/data-otservbr-global/monster/quests/liquid_black/tanjis.lua @@ -118,18 +118,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/marapur/timira_the_many-headed.lua b/data-otservbr-global/monster/quests/marapur/timira_the_many-headed.lua index 43d0a1502c3..09ed0f19be8 100644 --- a/data-otservbr-global/monster/quests/marapur/timira_the_many-headed.lua +++ b/data-otservbr-global/monster/quests/marapur/timira_the_many-headed.lua @@ -125,10 +125,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/primal_ordeal_quest/magma_bubble.lua b/data-otservbr-global/monster/quests/primal_ordeal_quest/magma_bubble.lua index 8f3bf7f6166..9607bf8310c 100644 --- a/data-otservbr-global/monster/quests/primal_ordeal_quest/magma_bubble.lua +++ b/data-otservbr-global/monster/quests/primal_ordeal_quest/magma_bubble.lua @@ -133,18 +133,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/primal_ordeal_quest/plunder_patriarch.lua b/data-otservbr-global/monster/quests/primal_ordeal_quest/plunder_patriarch.lua index 25d7c224f09..42fbf1fcdd9 100644 --- a/data-otservbr-global/monster/quests/primal_ordeal_quest/plunder_patriarch.lua +++ b/data-otservbr-global/monster/quests/primal_ordeal_quest/plunder_patriarch.lua @@ -127,18 +127,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/primal_ordeal_quest/the_primal_menace.lua b/data-otservbr-global/monster/quests/primal_ordeal_quest/the_primal_menace.lua index 7ad43b016c9..b0ba0ae8686 100644 --- a/data-otservbr-global/monster/quests/primal_ordeal_quest/the_primal_menace.lua +++ b/data-otservbr-global/monster/quests/primal_ordeal_quest/the_primal_menace.lua @@ -162,16 +162,6 @@ local function initialize(monster) end -- Functions for the fight -mType.onAppear = function(monster, creature) - if monster:getId() == creature:getId() then - initialize(monster) - end - - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - local function getHazardPoints(monster) local hazard = Hazard.getByName("hazard.gnomprona-gardens") if not hazard then diff --git a/data-otservbr-global/monster/quests/roshamuul/gaz'haragoth.lua b/data-otservbr-global/monster/quests/roshamuul/gaz'haragoth.lua index 0e6d5695d33..6dce4e10838 100644 --- a/data-otservbr-global/monster/quests/roshamuul/gaz'haragoth.lua +++ b/data-otservbr-global/monster/quests/roshamuul/gaz'haragoth.lua @@ -179,18 +179,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/roshamuul/omrafir.lua b/data-otservbr-global/monster/quests/roshamuul/omrafir.lua index e3f09b27dd0..03254912b71 100644 --- a/data-otservbr-global/monster/quests/roshamuul/omrafir.lua +++ b/data-otservbr-global/monster/quests/roshamuul/omrafir.lua @@ -148,18 +148,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/roshamuul/prince_drazzak.lua b/data-otservbr-global/monster/quests/roshamuul/prince_drazzak.lua index f969d02e6aa..d2a65e59fea 100644 --- a/data-otservbr-global/monster/quests/roshamuul/prince_drazzak.lua +++ b/data-otservbr-global/monster/quests/roshamuul/prince_drazzak.lua @@ -126,18 +126,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/soul_war/goshnar's_megalomania_blue.lua b/data-otservbr-global/monster/quests/soul_war/goshnar's_megalomania_blue.lua index cfd0f53f7fa..cf81168aa00 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnar's_megalomania_blue.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnar's_megalomania_blue.lua @@ -127,12 +127,6 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - local intervalBetweenExecutions = 10000 local zone = Zone.getByName("boss.goshnar's-megalomania-purple") diff --git a/data-otservbr-global/monster/quests/soul_war/goshnar's_megalomania_green.lua b/data-otservbr-global/monster/quests/soul_war/goshnar's_megalomania_green.lua index 8e8effb5e08..787ab94b662 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnar's_megalomania_green.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnar's_megalomania_green.lua @@ -138,12 +138,6 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - local intervalBetweenExecutions = 10000 local zone = Zone.getByName("boss.goshnar's-megalomania-purple") diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_cruelty.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_cruelty.lua index 3f1cb2c4421..468e6a312e4 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_cruelty.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_cruelty.lua @@ -144,16 +144,6 @@ mType.onThink = function(monster, interval) end end -mType.onAppear = function(monster, creature) end - -mType.onSpawn = function(monsterCallback) - if monsterCallback:getType():isRewardBoss() then - monsterCallback:setReward(true) - end - - firstTime = 0 -end - mType.onDisappear = function(monster, creature) if creature:getName() == "Goshnar's Cruelty" then local eyeCreature = Creature("A Greedy Eye") @@ -163,8 +153,4 @@ mType.onDisappear = function(monster, creature) end end -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua index 16d995988a5..e17e581212e 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua @@ -185,8 +185,4 @@ mType.onDisappear = function(monster, creature) end end -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_hatred.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_hatred.lua index f218e0b7e9f..cc6652eb9d9 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_hatred.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_hatred.lua @@ -133,18 +133,6 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) end - -mType.onSpawn = function(monster) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end - - monster:resetHatredDamageMultiplier() -end - mType.onDisappear = function(monster, creature) if creature:getName() == "Goshnar's Hatred" then for _, monsterName in pairs(SoulWarQuest.burningHatredMonsters) do @@ -156,8 +144,4 @@ mType.onDisappear = function(monster, creature) end end -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_malice.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_malice.lua index c4598e9bbe0..1cda5185bbe 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_malice.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_malice.lua @@ -147,16 +147,4 @@ mType.onThink = function(monster, interval) end end -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_spite.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_spite.lua index 7501e466f54..1daedf2a191 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_spite.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_spite.lua @@ -133,18 +133,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_curse_spreads/black_vixen.lua b/data-otservbr-global/monster/quests/the_curse_spreads/black_vixen.lua index 214b8c6f2ce..6f7f41694fe 100644 --- a/data-otservbr-global/monster/quests/the_curse_spreads/black_vixen.lua +++ b/data-otservbr-global/monster/quests/the_curse_spreads/black_vixen.lua @@ -138,18 +138,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_curse_spreads/bloodback.lua b/data-otservbr-global/monster/quests/the_curse_spreads/bloodback.lua index 3b9dd8e0eea..5423c6e2e9e 100644 --- a/data-otservbr-global/monster/quests/the_curse_spreads/bloodback.lua +++ b/data-otservbr-global/monster/quests/the_curse_spreads/bloodback.lua @@ -131,18 +131,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_curse_spreads/darkfang.lua b/data-otservbr-global/monster/quests/the_curse_spreads/darkfang.lua index 5506350848b..70b6c25bb1e 100644 --- a/data-otservbr-global/monster/quests/the_curse_spreads/darkfang.lua +++ b/data-otservbr-global/monster/quests/the_curse_spreads/darkfang.lua @@ -134,18 +134,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_curse_spreads/feroxa5.lua b/data-otservbr-global/monster/quests/the_curse_spreads/feroxa5.lua index 39fed1dc78c..57ccdba515a 100644 --- a/data-otservbr-global/monster/quests/the_curse_spreads/feroxa5.lua +++ b/data-otservbr-global/monster/quests/the_curse_spreads/feroxa5.lua @@ -118,18 +118,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_curse_spreads/shadowpelt.lua b/data-otservbr-global/monster/quests/the_curse_spreads/shadowpelt.lua index 2b195487dfd..1e28879cd9c 100644 --- a/data-otservbr-global/monster/quests/the_curse_spreads/shadowpelt.lua +++ b/data-otservbr-global/monster/quests/the_curse_spreads/shadowpelt.lua @@ -134,18 +134,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_curse_spreads/sharpclaw.lua b/data-otservbr-global/monster/quests/the_curse_spreads/sharpclaw.lua index 50ad689b7c7..08f757afcfc 100644 --- a/data-otservbr-global/monster/quests/the_curse_spreads/sharpclaw.lua +++ b/data-otservbr-global/monster/quests/the_curse_spreads/sharpclaw.lua @@ -133,18 +133,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) 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 46b5cf6c91d..af8b385ddb2 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 @@ -150,18 +150,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua index 868fe08e756..f129a99f00a 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua @@ -145,23 +145,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - -- reset global storage state to default / ensure sqm's reset for the next team - Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths, -1) - Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, -1) - Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 1) - monster:registerEvent("facelessBaneImmunity") - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua index 9c693024899..88688c4fffc 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua @@ -152,18 +152,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua index 2bd63f042be..651ee8cb59b 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua @@ -145,18 +145,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua index 8db50108f56..a54257df723 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua @@ -152,18 +152,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) 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 d62affd19a4..3d5675c4486 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 @@ -178,18 +178,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua index d0520193aad..3937edcd2d4 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua @@ -154,18 +154,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_order_of_lion/bosses/ancient_lion_knight.lua b/data-otservbr-global/monster/quests/the_order_of_lion/bosses/ancient_lion_knight.lua index aba0cc866b4..3f5ad2a3cd7 100644 --- a/data-otservbr-global/monster/quests/the_order_of_lion/bosses/ancient_lion_knight.lua +++ b/data-otservbr-global/monster/quests/the_order_of_lion/bosses/ancient_lion_knight.lua @@ -131,10 +131,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_order_of_lion/bosses/drume.lua b/data-otservbr-global/monster/quests/the_order_of_lion/bosses/drume.lua index 9d86b77cd48..34d15a0a248 100644 --- a/data-otservbr-global/monster/quests/the_order_of_lion/bosses/drume.lua +++ b/data-otservbr-global/monster/quests/the_order_of_lion/bosses/drume.lua @@ -161,10 +161,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_order_of_lion/lion_commander.lua b/data-otservbr-global/monster/quests/the_order_of_lion/lion_commander.lua index f409fca3c4b..378bbc0e1a5 100644 --- a/data-otservbr-global/monster/quests/the_order_of_lion/lion_commander.lua +++ b/data-otservbr-global/monster/quests/the_order_of_lion/lion_commander.lua @@ -111,19 +111,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster ~= creature then - return true - end - for i = 1, 5 do - local sum = Game.createMonster(monster:getType():getSummonList()[math.random(1, #monster:getType():getSummonList())].name, monster:getPosition(), true) - if sum then - monster:setSummon(sum) - sum:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - sum:setStorageValue(Storage.TheOrderOfTheLion.Drume.Commander, 1) - end - end - monster:setStorageValue(Storage.TheOrderOfTheLion.Drume.Commander, 1) -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_order_of_lion/usurper_commander.lua b/data-otservbr-global/monster/quests/the_order_of_lion/usurper_commander.lua index fd31fa62806..f46ff987e92 100644 --- a/data-otservbr-global/monster/quests/the_order_of_lion/usurper_commander.lua +++ b/data-otservbr-global/monster/quests/the_order_of_lion/usurper_commander.lua @@ -112,20 +112,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onAppear = function(monster, creature) - if monster ~= creature then - return true - end - local sum - for i = 1, 5 do - sum = Game.createMonster(monster:getType():getSummonList()[math.random(1, #monster:getType():getSummonList())].name, monster:getPosition(), true) - if sum then - monster:setSummon(sum) - sum:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - sum:setStorageValue(Storage.TheOrderOfTheLion.Drume.Commander, 1) - end - end - monster:setStorageValue(Storage.TheOrderOfTheLion.Drume.Commander, 1) -end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/brokul.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/brokul.lua index ffe52519e85..f05a8adae85 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/brokul.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/brokul.lua @@ -129,18 +129,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/ghulosh.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/ghulosh.lua index f9d04e40db4..60717045935 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/ghulosh.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/ghulosh.lua @@ -137,18 +137,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/gorzindel.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/gorzindel.lua index 4d549175bab..7a31d798d9a 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/gorzindel.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/gorzindel.lua @@ -143,18 +143,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_canon_dominus.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_canon_dominus.lua index 23390f0145f..453c3be3389 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_canon_dominus.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_canon_dominus.lua @@ -119,18 +119,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_chaplain_gaunder.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_chaplain_gaunder.lua index 57589cb7b17..f27050df438 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_chaplain_gaunder.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_chaplain_gaunder.lua @@ -126,18 +126,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_commander_soeren.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_commander_soeren.lua index 685b1f10f07..bb01cf3c515 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_commander_soeren.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_commander_soeren.lua @@ -118,18 +118,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_master_oberon.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_master_oberon.lua index c57bf0815ae..5de851ac4c1 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_master_oberon.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/grand_master_oberon.lua @@ -131,20 +131,6 @@ mType.onThink = function(monster, interval) end end -mType.onAppear = function(monster, creature) - if monster:getId() == creature:getId() then - monster:setStorageValue(GrandMasterOberonConfig.Storage.Asking, 1) - monster:setStorageValue(GrandMasterOberonConfig.Storage.Life, 1) - end - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - mType.onSay = function(monster, creature, type, message) if type ~= TALKTYPE_SAY then return false diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/preceptor_lazare.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/preceptor_lazare.lua index c9db8d4446c..f5477192be6 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/preceptor_lazare.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/preceptor_lazare.lua @@ -130,18 +130,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/thawing_dragon_lord.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/thawing_dragon_lord.lua index fa175a85a2b..ad7e340ffb2 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/thawing_dragon_lord.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/thawing_dragon_lord.lua @@ -105,18 +105,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua index 491b946adba..2d0e1069f30 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua @@ -183,18 +183,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua b/data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua index 699f0550d52..7df23258767 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua @@ -140,18 +140,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua b/data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua index f482dfe4b9e..f93e6785563 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua @@ -129,18 +129,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/chayenne.lua b/data-otservbr-global/monster/raids/chayenne.lua index 0f8f64d9686..2ab96a01c2d 100644 --- a/data-otservbr-global/monster/raids/chayenne.lua +++ b/data-otservbr-global/monster/raids/chayenne.lua @@ -105,18 +105,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/chizzoron_the_distorter.lua b/data-otservbr-global/monster/raids/chizzoron_the_distorter.lua index 7fbc5d3cd71..3569332eaf2 100644 --- a/data-otservbr-global/monster/raids/chizzoron_the_distorter.lua +++ b/data-otservbr-global/monster/raids/chizzoron_the_distorter.lua @@ -123,18 +123,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/ferumbras.lua b/data-otservbr-global/monster/raids/ferumbras.lua index c3dfea647ea..f49eb8075ab 100644 --- a/data-otservbr-global/monster/raids/ferumbras.lua +++ b/data-otservbr-global/monster/raids/ferumbras.lua @@ -168,18 +168,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/furyosa.lua b/data-otservbr-global/monster/raids/furyosa.lua index acbf9711298..bc4ffdc3477 100644 --- a/data-otservbr-global/monster/raids/furyosa.lua +++ b/data-otservbr-global/monster/raids/furyosa.lua @@ -133,18 +133,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/ghazbaran.lua b/data-otservbr-global/monster/raids/ghazbaran.lua index 5f57655679f..f014e06e82a 100644 --- a/data-otservbr-global/monster/raids/ghazbaran.lua +++ b/data-otservbr-global/monster/raids/ghazbaran.lua @@ -164,18 +164,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/glooth_bomb.lua b/data-otservbr-global/monster/raids/glooth_bomb.lua index b1973e7b8ec..a69c59a3c6c 100644 --- a/data-otservbr-global/monster/raids/glooth_bomb.lua +++ b/data-otservbr-global/monster/raids/glooth_bomb.lua @@ -114,18 +114,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/hirintror.lua b/data-otservbr-global/monster/raids/hirintror.lua index 12a4d20d183..aa3ac63011d 100644 --- a/data-otservbr-global/monster/raids/hirintror.lua +++ b/data-otservbr-global/monster/raids/hirintror.lua @@ -125,18 +125,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/mawhawk.lua b/data-otservbr-global/monster/raids/mawhawk.lua index f00407ca304..697638fdda4 100644 --- a/data-otservbr-global/monster/raids/mawhawk.lua +++ b/data-otservbr-global/monster/raids/mawhawk.lua @@ -121,18 +121,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/morgaroth.lua b/data-otservbr-global/monster/raids/morgaroth.lua index 2e965cc99ec..02a65453da4 100644 --- a/data-otservbr-global/monster/raids/morgaroth.lua +++ b/data-otservbr-global/monster/raids/morgaroth.lua @@ -178,18 +178,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/ocyakao.lua b/data-otservbr-global/monster/raids/ocyakao.lua index 2e036c0837b..5321a0b59ff 100644 --- a/data-otservbr-global/monster/raids/ocyakao.lua +++ b/data-otservbr-global/monster/raids/ocyakao.lua @@ -116,18 +116,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/orshabaal.lua b/data-otservbr-global/monster/raids/orshabaal.lua index 7d7ef6052df..2054c1e2a3b 100644 --- a/data-otservbr-global/monster/raids/orshabaal.lua +++ b/data-otservbr-global/monster/raids/orshabaal.lua @@ -167,18 +167,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/the_pale_count.lua b/data-otservbr-global/monster/raids/the_pale_count.lua index 31a40bcfff2..29f1cf6b043 100644 --- a/data-otservbr-global/monster/raids/the_pale_count.lua +++ b/data-otservbr-global/monster/raids/the_pale_count.lua @@ -144,18 +144,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/the_welter.lua b/data-otservbr-global/monster/raids/the_welter.lua index addb7008d75..7e2f2c3ed8f 100644 --- a/data-otservbr-global/monster/raids/the_welter.lua +++ b/data-otservbr-global/monster/raids/the_welter.lua @@ -137,18 +137,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/tyrn.lua b/data-otservbr-global/monster/raids/tyrn.lua index 0c19ac9944f..158a4e93833 100644 --- a/data-otservbr-global/monster/raids/tyrn.lua +++ b/data-otservbr-global/monster/raids/tyrn.lua @@ -131,18 +131,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/white_pale.lua b/data-otservbr-global/monster/raids/white_pale.lua index 06b6dcab4f3..17d093fb5bf 100644 --- a/data-otservbr-global/monster/raids/white_pale.lua +++ b/data-otservbr-global/monster/raids/white_pale.lua @@ -116,18 +116,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/raids/zulazza_the_corruptor.lua b/data-otservbr-global/monster/raids/zulazza_the_corruptor.lua index b7d14d9c966..0c2212c2a45 100644 --- a/data-otservbr-global/monster/raids/zulazza_the_corruptor.lua +++ b/data-otservbr-global/monster/raids/zulazza_the_corruptor.lua @@ -132,18 +132,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/monster/undeads/ahau.lua b/data-otservbr-global/monster/undeads/ahau.lua index 9d7f0f17c9c..ce5704769a9 100644 --- a/data-otservbr-global/monster/undeads/ahau.lua +++ b/data-otservbr-global/monster/undeads/ahau.lua @@ -130,18 +130,4 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - monster:setReward(true) - end -end - -mType.onDisappear = function(monster, creature) end - -mType.onMove = function(monster, creature, fromPosition, toPosition) end - -mType.onSay = function(monster, creature, type, message) end - mType:register(monster) diff --git a/data-otservbr-global/scripts/lib/monster_functions.lua b/data-otservbr-global/scripts/lib/monster_functions.lua new file mode 100644 index 00000000000..cdb56c5e177 --- /dev/null +++ b/data-otservbr-global/scripts/lib/monster_functions.lua @@ -0,0 +1,8 @@ +function Monster:handleCobraOnSpawn() + if Game.getStorageValue(Global.Storage.CobraFlask) >= os.time() then + monster:setHealth(monster:getMaxHealth() * 0.75) + monster:getPosition():sendMagicEffect(CONST_ME_GREEN_RINGS) + else + Game.setStorageValue(Global.Storage.CobraFlask, -1) + end +end diff --git a/data-otservbr-global/scripts/world_changes/iron_servant_transformation.lua b/data-otservbr-global/scripts/world_changes/iron_servant_transformation.lua deleted file mode 100644 index e62cd23c876..00000000000 --- a/data-otservbr-global/scripts/world_changes/iron_servant_transformation.lua +++ /dev/null @@ -1,31 +0,0 @@ -local ironServantTransformation = EventCallback("IronServantTransformationOnSpawn") - -ironServantTransformation.monsterOnSpawn = function(monster, position) - if monster:getName():lower() ~= "iron servant replica" then - return - end - - local chance = math.random(100) - if Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.MechanismDiamond) >= 1 and Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.MechanismGolden) >= 1 then - if chance > 30 then - local monsterType = math.random(2) == 1 and "diamond servant replica" or "golden servant replica" - Game.createMonster(monsterType, monster:getPosition(), false, true) - monster:remove() - end - return - end - - if Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.MechanismDiamond) >= 1 and chance > 30 then - Game.createMonster("diamond servant replica", monster:getPosition(), false, true) - monster:remove() - return - end - - if Game.getStorageValue(Storage.Quest.U11_02.ForgottenKnowledge.MechanismGolden) >= 1 and chance > 30 then - Game.createMonster("golden servant replica", monster:getPosition(), false, true) - monster:remove() - end - return true -end - -ironServantTransformation:register() diff --git a/data-otservbr-global/startup/tables/writeable.lua b/data-otservbr-global/startup/tables/writeable.lua index 226fe46c3b7..538fccdf72a 100644 --- a/data-otservbr-global/startup/tables/writeable.lua +++ b/data-otservbr-global/startup/tables/writeable.lua @@ -132,7 +132,6 @@ Nobody knows where the elder gods came from, or whether they had always existed Uman Zathroth regarded Fardos's undertakings thoughtfully. Uman was sagacious and held awesome magical powers. Most importantly, however, he was driven by an insatiable hunger for knowledge and enlightenment. In his essence he resembled Fardos, but where Fardos worked openly and logically, Uman's domain was the realm of mystery. Still, he shared Fardos's interest in creation, whereas his dark half Zathroth was essentially corruptive. Zathroth was a vain god who was painfully aware that his own creative powers were poor. Because of this he looked at Fardos's work of creation with jealousy, and from the very beginning he was determined to prevent or at least corrupt it in any way he could. Fardos, who did not suspect this, asked him for assistance because he had accepted the fact that he could not achieve creation on his own, but of course Zathroth denied. Uman, however, agreed to help. And from that he and Fardos worked together on the great project that was creation. - Unfortunately, their combined efforts were hardly more successful. Just like before, everything Fardos and Uman created was swallowed by the void as soon as it came into existence, and the two gods sadly saw their creation run through their fingers like water through a sieve. On the other hand, Zathroth, who had been watching their efforts with suspicion, rejoiced. He ridiculed their efforts. However, his glee changed into surprise and anger when he found that something strange happened, something which perhaps Uman and Fardos did not expect themselves. To this day, nobody knows precisely what it was that caused it. Perhaps the power that had been spent lured another entity out of the void, or it might be that it simply awoke another divine entity from its slumber. Some even claim that in some mysterious way the power that had been spent by Uman and Fardos actually created a new entity. Whatever the truth may be, a new goddess stepped out of the void like a new-born mermaid from her shell. The amazed elder gods watched her divine beauty in awed admiration, for everything in her was perfect harmony. They agreed to call her Tibiasula. Zathroth, however, stood by and fumed with silent hate. But cunning as he was, he hid his resentment well and feigned to share the joy of the other elder gods. ]], }, @@ -147,7 +146,6 @@ Zathroth watched the progress of creation with wrath and disgust. If he had had As he grew up, Brog was pained by the fire burning inside him, until one day when it grew unbearable he summoned all his magical powers and released as much of the painful flame into the world as he could. The searing fire mixed with his rage, and from it rose Garsharak, the very first dragon, who later sired a whole race of intelligent, giant lizards, a race that would eventually bring terror and chaos into Tibia. Brog watched the terrible creature he had created rather accidentally, and he rejoiced when he saw just how fierce and powerful it was. Though he was rather stupid he, too, had the gift to create life, which in an act of vanity he next used to create the cyclopes in his own image. - Zathroth watched Brog's experiments with great interest. So far he had not held his son in high esteem, but here was something for which he himself admittedly had little talent for. Since he did not understand the laws of life himself he knew that Brog's gift could prove to be a great asset. He called his son to him and told him to go on with his experiments, urging him to create something more terrifying and destructive than cyclopes. Even though these giants were ferocious and strong, they were not quite as destructive as he wanted them to be. In fact, due to their love of mining and smithing the cyclopes were a creative rather than a destructive race. Worse, they were not propagating fast enough to make them a real threat to creation. For this reason Brog went on to create trolls and goblins, races that were weaker than the cyclopes, but propagated much faster. However, his undisputed masterpiece were the orcs, a race of fearsome, single-minded warriors who lived only to expand and conquer. Soon they had spread all over Tibia, and they were the scourge of all that was alive. ]], }, @@ -723,7 +721,6 @@ Thoughts and Notations on the Noble Craft of Potion-Making, by Grandsieur Haruva The Gods gave their gifts freely, but bestowed them not on all creatures alike. Some ancient creatures were possessed of a far-reaching will to conquer and subdue all others through their thoughts alone, while the newer beings could weave magic in defense or had strength and swiftness to defend and escape the wiles laid out to ensnare them. Some animals and plants, simple though they may seem to us, yet are deadly poisonous in order to ward off their hunter. - But only the more intelligent beings - and of those, only a select few - possess the art of making powerful concoctions that enhance their faculties. The humble woodman or wanderer will never be able to fulfil the complex rites, or even grasp the concept, of the trimagical umbralistic principle of the equinox formula that is crucial to the craft of magical potions. But still, they can drink, and appreciate, the brews we make to keep a warrior's body alive in a fight, the mage's mana when drained, the paladin's spirit when they need to gather holy force. ... (you lose interest and close the book) @@ -742,7 +739,6 @@ The cyclops ... ... hid the ancient amulet beneath the sand, before ...should have listened to ... Must hide... paper, hope an adventurer will... - ... amulet will be washed ashore if not found... To any adventurer friend: ... shovel... beach... .. dig there. ... take it to Morris, maybe he ... decipher the engravings. diff --git a/data/scripts/actions/items/cobra_flask.lua b/data/scripts/actions/items/cobra_flask.lua index c36d42983c5..0556373afae 100644 --- a/data/scripts/actions/items/cobra_flask.lua +++ b/data/scripts/actions/items/cobra_flask.lua @@ -1,19 +1,3 @@ -local applyCobraFlaskEffectOnMonsterSpawn = EventCallback("CobraFlaskEffectOnMonsterSpawn") - -applyCobraFlaskEffectOnMonsterSpawn.monsterOnSpawn = function(monster, position) - if table.contains({ "cobra scout", "cobra vizier", "cobra assassin" }, monster:getName():lower()) then - if Game.getStorageValue(Global.Storage.CobraFlask) >= os.time() then - monster:setHealth(monster:getMaxHealth() * 0.75) - monster:getPosition():sendMagicEffect(CONST_ME_GREEN_RINGS) - else - Game.setStorageValue(Global.Storage.CobraFlask, -1) - end - end - return true -end - -applyCobraFlaskEffectOnMonsterSpawn:register() - local cobraFlask = Action() function cobraFlask.onUse(player, item, fromPosition, target, toPosition, isHotkey) diff --git a/data/scripts/eventcallbacks/README.md b/data/scripts/eventcallbacks/README.md index 6e0bacfcd6e..bbcee5de3c4 100644 --- a/data/scripts/eventcallbacks/README.md +++ b/data/scripts/eventcallbacks/README.md @@ -16,7 +16,6 @@ Event callbacks are available for several categories of game entities, such as ` - `(bool)` `creatureOnChangeOutfit` - `(ReturnValue)` `creatureOnAreaCombat` - `(ReturnValue)` `creatureOnTargetCombat` -- `(void)` `creatureOnHear` - `(void)` `creatureOnDrainHealth` - `(void)` `creatureOnCombat` - `(bool)` `partyOnJoin` @@ -51,8 +50,6 @@ Event callbacks are available for several categories of game entities, such as ` - `(void)` `playerOnWalk` - `(void)` `monsterOnDropLoot` - `(void)` `monsterPostDropLoot` -- `(void)` `monsterOnSpawn` -- `(void)` `npcOnSpawn` ## Event Callback Usage @@ -102,20 +99,8 @@ callback:register() ```lua local callback = EventCallback("UniqueCallbackName") -function callback.monsterOnSpawn(monster, position) - -- custom behavior when a monster spawns -end - -callback:register() -``` - -### Npc Callback - -```lua -local callback = EventCallback("UniqueCallbackName") - -function callback.npcOnSpawn(npc, position) - -- custom behavior when a npc spawns +function callback.monsterOnDropLoot(monster, corpse) + logger.info("Monster {} has corpse {}", monster:getName(), corpse:getName()); end callback:register() diff --git a/data/scripts/eventcallbacks/creature/on_hear.lua b/data/scripts/eventcallbacks/creature/on_hear.lua deleted file mode 100644 index 2954c81c8fb..00000000000 --- a/data/scripts/eventcallbacks/creature/on_hear.lua +++ /dev/null @@ -1,5 +0,0 @@ -local callback = EventCallback("CreatureOnHearBaseEvent") - -function callback.creatureOnHear(creature, speaker, words, type) end - -callback:register() diff --git a/data/scripts/eventcallbacks/monster/on_spawn.lua b/data/scripts/eventcallbacks/monster/on_spawn.lua deleted file mode 100644 index 5a490a8edac..00000000000 --- a/data/scripts/eventcallbacks/monster/on_spawn.lua +++ /dev/null @@ -1,27 +0,0 @@ -local callback = EventCallback("MonsterOnSpawnBase") - -function callback.monsterOnSpawn(monster, position) - if not monster then - return - end - - HazardMonster.onSpawn(monster, position) - - if monster:getType():isRewardBoss() then - monster:setReward(true) - end - - if not monster:getType():canSpawn(position) then - monster:remove() - else - local spec = Game.getSpectators(position, false, false) - for _, creatureId in pairs(spec) do - local monster = Monster(creatureId) - if monster and not monster:getType():canSpawn(position) then - monster:remove() - end - end - end -end - -callback:register() diff --git a/data/scripts/lib/register_monster_type.lua b/data/scripts/lib/register_monster_type.lua index cfb0a6bfaaa..ed5de6421d9 100644 --- a/data/scripts/lib/register_monster_type.lua +++ b/data/scripts/lib/register_monster_type.lua @@ -194,6 +194,9 @@ registerMonsterType.flags = function(mtype, mask) end if mask.flags.rewardBoss then mtype:isRewardBoss(mask.flags.rewardBoss) + mtype.onSpawn = function(monster) + monster:setRewardBoss() + end end if mask.flags.familiar then mtype:familiar(mask.flags.familiar) diff --git a/docs/python-scripts/convert_monsters_callbacks.py b/docs/python-scripts/convert_monsters_callbacks.py new file mode 100644 index 00000000000..140b2562df0 --- /dev/null +++ b/docs/python-scripts/convert_monsters_callbacks.py @@ -0,0 +1,116 @@ +""" +Script for processing Lua files in a project. + +This script is designed to modify `.lua` files in the root directory of the project and all of its subdirectories. +The following modifications are made to each `.lua` file: +1. Remove empty callback functions. +2. Remove the 'onAppear' callback function entirely, including its corresponding `end`. +3. Clean up unnecessary blank lines resulting from the removal of callback functions. + +Usage: +1. Save this script in the `docs/python-scripts` directory of your project. +2. Open a terminal and navigate to the `docs/python-scripts` directory: + cd path/to/your/project/docs/python-scripts +3. Run the script using Python: + python convert_monsters_callbacks.py + +Prerequisites: +- Ensure Python 3 is installed. +- Make sure you have read and write permissions for all `.lua` files in the project directory. + +Output: +- The script will print the root directory being processed. +- At the end, it will output the number of files that were modified. + +Example: +Root path: /path/to/your/project +Script completed. Modified 5 file(s). +""" + +import re +import os + +def get_root_path(): + """Get the root path of the project (two levels above the current script directory).""" + return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) + +def process_lua_code(code): + """Process the Lua code: remove specific callbacks and clean up empty lines. + + Args: + code (str): The Lua code to be processed. + + Returns: + str: The modified Lua code. + """ + # Remove specific callbacks including 'onAppear' and empty callbacks + code = re.sub(r'\n?mType\.onAppear = function\(.*?\)\n(.*?)\nend\n?', '', code, flags=re.DOTALL) + code = re.sub(r'\n?mType\.\w+ = function\(.*?\) end\n?', '', code) + + # Remove extra blank lines created by the removal of callbacks + code = re.sub(r'\n{3,}', '\n\n', code) # Limit multiple blank lines to just two + + return code + +def process_lua_file(file_path): + """Process a single Lua file by applying the required modifications. + + Args: + file_path (str): The path to the Lua file to be processed. + + Returns: + bool: True if the file was modified and saved, False otherwise. + """ + try: + with open(file_path, 'r', encoding='utf-8') as file: + code = file.read() + except Exception as e: + print(f"Error reading file {file_path}: {e}") + return False + + original_code = code + modified_code = process_lua_code(code) + + if modified_code != original_code: + try: + with open(file_path, 'w', encoding='utf-8') as file: + file.write(modified_code) + return True + except Exception as e: + print(f"Error writing file {file_path}: {e}") + return False + +def process_all_lua_files(root_path): + """Process all Lua files in the root path and its subdirectories. + + Args: + root_path (str): The root directory in which to search for Lua files. + + Returns: + int: The count of modified Lua files. + """ + modified_files_count = 0 + + for dirpath, _, filenames in os.walk(root_path): + for filename in filenames: + if filename.endswith(".lua"): + file_path = os.path.join(dirpath, filename) + if process_lua_file(file_path): + modified_files_count += 1 + + return modified_files_count + +def main(): + """Main function to run the script. + + This function determines the root path of the project, processes all Lua files + found in the root path and subdirectories, and prints the number of files modified. + """ + root_path = get_root_path() + print(f"Root path: {root_path}") + + modified_files_count = process_all_lua_files(root_path) + print(f"Script completed. Modified {modified_files_count} file(s).") + +if __name__ == "__main__": + main() diff --git a/src/creatures/monsters/spawns/spawn_monster.cpp b/src/creatures/monsters/spawns/spawn_monster.cpp index 7d7bbc84e34..3a915d737b2 100644 --- a/src/creatures/monsters/spawns/spawn_monster.cpp +++ b/src/creatures/monsters/spawns/spawn_monster.cpp @@ -232,9 +232,7 @@ bool SpawnMonster::spawnMonster(uint32_t spawnMonsterId, spawnBlock_t &sb, const spawnedMonsterMap[spawnMonsterId] = monster; sb.lastSpawn = OTSYS_TIME(); - g_events().eventMonsterOnSpawn(monster, sb.pos); monster->onSpawn(); - g_callbacks().executeCallback(EventCallback_t::monsterOnSpawn, &EventCallback::monsterOnSpawn, monster, sb.pos); return true; } diff --git a/src/creatures/npcs/spawns/spawn_npc.cpp b/src/creatures/npcs/spawns/spawn_npc.cpp index bf3b6a1bc65..404f6ce588e 100644 --- a/src/creatures/npcs/spawns/spawn_npc.cpp +++ b/src/creatures/npcs/spawns/spawn_npc.cpp @@ -202,9 +202,6 @@ bool SpawnNpc::spawnNpc(uint32_t spawnId, const std::shared_ptr &npcTyp spawnedNpcMap.insert(spawned_pair(spawnId, npc)); spawnNpcMap[spawnId].lastSpawnNpc = OTSYS_TIME(); - - g_events().eventNpcOnSpawn(npc, pos); - g_callbacks().executeCallback(EventCallback_t::npcOnSpawn, &EventCallback::npcOnSpawn, npc, pos); return true; } diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 923b153a99a..fcf83ccdecb 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -8713,10 +8713,6 @@ bool Player::saySpell(SpeakClasses type, const std::string &text, bool isGhostMo } tmpPlayer->onCreatureSay(static_self_cast(), type, text); - if (static_self_cast() != tmpPlayer) { - g_events().eventCreatureOnHear(tmpPlayer, getPlayer(), text, type); - g_callbacks().executeCallback(EventCallback_t::creatureOnHear, &EventCallback::creatureOnHear, tmpPlayer, getPlayer(), text, type); - } } return true; } diff --git a/src/game/game.cpp b/src/game/game.cpp index 780ce5b7303..140a6d8e62f 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -6397,10 +6397,6 @@ bool Game::internalCreatureSay(const std::shared_ptr &creature, SpeakC // event method for (const auto &spectator : spectators) { spectator->onCreatureSay(creature, type, text); - if (creature != spectator) { - g_events().eventCreatureOnHear(spectator, creature, text, type); - g_callbacks().executeCallback(EventCallback_t::creatureOnHear, &EventCallback::creatureOnHear, spectator, creature, text, type); - } } return true; } diff --git a/src/lua/callbacks/callbacks_definitions.hpp b/src/lua/callbacks/callbacks_definitions.hpp index 6c19cc809c9..faea6b2d1e2 100644 --- a/src/lua/callbacks/callbacks_definitions.hpp +++ b/src/lua/callbacks/callbacks_definitions.hpp @@ -23,7 +23,6 @@ enum class EventCallback_t : uint16_t { creatureOnChangeOutfit, creatureOnAreaCombat, creatureOnTargetCombat, - creatureOnHear, creatureOnDrainHealth, creatureOnCombat, // Party @@ -62,9 +61,6 @@ enum class EventCallback_t : uint16_t { // Monster monsterOnDropLoot, monsterPostDropLoot, - monsterOnSpawn, - // Npc - npcOnSpawn, // Zone zoneBeforeCreatureEnter, zoneBeforeCreatureLeave, diff --git a/src/lua/callbacks/event_callback.cpp b/src/lua/callbacks/event_callback.cpp index 3d95543f1b9..1675cdef440 100644 --- a/src/lua/callbacks/event_callback.cpp +++ b/src/lua/callbacks/event_callback.cpp @@ -154,33 +154,6 @@ ReturnValue EventCallback::creatureOnTargetCombat(const std::shared_ptr &creature, const std::shared_ptr &speaker, const std::string &words, SpeakClasses type) const { - if (!LuaScriptInterface::reserveScriptEnv()) { - g_logger().error("[EventCallback::creatureOnHear - " - "Creature {} speaker {}] " - "Call stack overflow. Too many lua script calls being nested.", - creature->getName(), speaker->getName()); - return; - } - - ScriptEnvironment* scriptEnvironment = LuaScriptInterface::getScriptEnv(); - scriptEnvironment->setScriptId(getScriptId(), getScriptInterface()); - - lua_State* L = getScriptInterface()->getLuaState(); - getScriptInterface()->pushFunction(getScriptId()); - - LuaScriptInterface::pushUserdata(L, creature); - LuaScriptInterface::setCreatureMetatable(L, -1, creature); - - LuaScriptInterface::pushUserdata(L, speaker); - LuaScriptInterface::setCreatureMetatable(L, -1, speaker); - - LuaScriptInterface::pushString(L, words); - lua_pushnumber(L, type); - - getScriptInterface()->callVoidFunction(4); -} - void EventCallback::creatureOnDrainHealth(const std::shared_ptr &creature, const std::shared_ptr &attacker, CombatType_t &typePrimary, int32_t &damagePrimary, CombatType_t &typeSecondary, int32_t &damageSecondary, TextColor_t &colorPrimary, TextColor_t &colorSecondary) const { if (!LuaScriptInterface::reserveScriptEnv()) { g_logger().error("[EventCallback::creatureOnDrainHealth - " @@ -1162,63 +1135,6 @@ void EventCallback::monsterPostDropLoot(const std::shared_ptr &monster, return getScriptInterface()->callVoidFunction(2); } -void EventCallback::monsterOnSpawn(const std::shared_ptr &monster, const Position &position) const { - if (!LuaScriptInterface::reserveScriptEnv()) { - g_logger().error("{} - " - "Position {}" - ". Call stack overflow. Too many lua script calls being nested.", - __FUNCTION__, position.toString()); - return; - } - - ScriptEnvironment* scriptEnvironment = LuaScriptInterface::getScriptEnv(); - scriptEnvironment->setScriptId(getScriptId(), getScriptInterface()); - - lua_State* L = getScriptInterface()->getLuaState(); - getScriptInterface()->pushFunction(getScriptId()); - - LuaScriptInterface::pushUserdata(L, monster); - LuaScriptInterface::setMetatable(L, -1, "Monster"); - LuaScriptInterface::pushPosition(L, position); - - if (LuaScriptInterface::protectedCall(L, 2, 1) != 0) { - LuaScriptInterface::reportError(nullptr, LuaScriptInterface::popString(L)); - } else { - lua_pop(L, 1); - } - - LuaScriptInterface::resetScriptEnv(); -} - -// Npc -void EventCallback::npcOnSpawn(const std::shared_ptr &npc, const Position &position) const { - if (!LuaScriptInterface::reserveScriptEnv()) { - g_logger().error("{} - " - "Position {}" - ". Call stack overflow. Too many lua script calls being nested.", - __FUNCTION__, position.toString()); - return; - } - - ScriptEnvironment* scriptEnvironment = LuaScriptInterface::getScriptEnv(); - scriptEnvironment->setScriptId(getScriptId(), getScriptInterface()); - - lua_State* L = getScriptInterface()->getLuaState(); - getScriptInterface()->pushFunction(getScriptId()); - - LuaScriptInterface::pushUserdata(L, npc); - LuaScriptInterface::setMetatable(L, -1, "Npc"); - LuaScriptInterface::pushPosition(L, position); - - if (LuaScriptInterface::protectedCall(L, 2, 1) != 0) { - LuaScriptInterface::reportError(nullptr, LuaScriptInterface::popString(L)); - } else { - lua_pop(L, 1); - } - - LuaScriptInterface::resetScriptEnv(); -} - bool EventCallback::zoneBeforeCreatureEnter(const std::shared_ptr &zone, const std::shared_ptr &creature) const { if (!LuaScriptInterface::reserveScriptEnv()) { g_logger().error("[EventCallback::zoneBeforeCreatureEnter - " diff --git a/src/lua/callbacks/event_callback.hpp b/src/lua/callbacks/event_callback.hpp index fb0eb760a20..514c7feafff 100644 --- a/src/lua/callbacks/event_callback.hpp +++ b/src/lua/callbacks/event_callback.hpp @@ -96,7 +96,6 @@ class EventCallback final : public Script { bool creatureOnChangeOutfit(const std::shared_ptr &creature, const Outfit_t &outfit) const; ReturnValue creatureOnAreaCombat(const std::shared_ptr &creature, const std::shared_ptr &tile, bool aggressive) const; ReturnValue creatureOnTargetCombat(const std::shared_ptr &creature, const std::shared_ptr &target) const; - void creatureOnHear(const std::shared_ptr &creature, const std::shared_ptr &speaker, const std::string &words, SpeakClasses type) const; void creatureOnDrainHealth(const std::shared_ptr &creature, const std::shared_ptr &attacker, CombatType_t &typePrimary, int32_t &damagePrimary, CombatType_t &typeSecondary, int32_t &damageSecondary, TextColor_t &colorPrimary, TextColor_t &colorSecondary) const; void creatureOnCombat(std::shared_ptr attacker, std::shared_ptr target, CombatDamage &damage) const; @@ -137,10 +136,6 @@ class EventCallback final : public Script { // Monster void monsterOnDropLoot(const std::shared_ptr &monster, const std::shared_ptr &corpse) const; void monsterPostDropLoot(const std::shared_ptr &monster, const std::shared_ptr &corpse) const; - void monsterOnSpawn(const std::shared_ptr &monster, const Position &position) const; - - // Npc - void npcOnSpawn(const std::shared_ptr &npc, const Position &position) const; // Zone bool zoneBeforeCreatureEnter(const std::shared_ptr &zone, const std::shared_ptr &creature) const; diff --git a/src/lua/creature/events.cpp b/src/lua/creature/events.cpp index 57a8ff45d31..9e03858107b 100644 --- a/src/lua/creature/events.cpp +++ b/src/lua/creature/events.cpp @@ -62,8 +62,6 @@ bool Events::loadFromXml() { info.creatureOnAreaCombat = event; } else if (methodName == "onTargetCombat") { info.creatureOnTargetCombat = event; - } else if (methodName == "onHear") { - info.creatureOnHear = event; } else if (methodName == "onDrainHealth") { info.creatureOnDrainHealth = event; } else { @@ -136,17 +134,9 @@ bool Events::loadFromXml() { } else if (className == "Monster") { if (methodName == "onDropLoot") { info.monsterOnDropLoot = event; - } else if (methodName == "onSpawn") { - info.monsterOnSpawn = event; } else { g_logger().warn("{} - Unknown monster method: {}", __FUNCTION__, methodName); } - } else if (className == "Npc") { - if (methodName == "onSpawn") { - info.monsterOnSpawn = event; - } else { - g_logger().warn("{} - Unknown npc method: {}", __FUNCTION__, methodName); - } } else { g_logger().warn("{} - Unknown class: {}", __FUNCTION__, className); } @@ -154,74 +144,6 @@ bool Events::loadFromXml() { return true; } -// Monster -void Events::eventMonsterOnSpawn(const std::shared_ptr &monster, const Position &position) { - // Monster:onSpawn(position) or Monster.onSpawn(self, position) - if (info.monsterOnSpawn == -1) { - return; - } - - if (!LuaScriptInterface::reserveScriptEnv()) { - g_logger().error("{} - " - "Position {}" - ". Call stack overflow. Too many lua script calls being nested.", - __FUNCTION__, position.toString()); - return; - } - - ScriptEnvironment* env = LuaScriptInterface::getScriptEnv(); - env->setScriptId(info.monsterOnSpawn, &scriptInterface); - - lua_State* L = scriptInterface.getLuaState(); - scriptInterface.pushFunction(info.monsterOnSpawn); - - LuaScriptInterface::pushUserdata(L, monster); - LuaScriptInterface::setMetatable(L, -1, "Monster"); - LuaScriptInterface::pushPosition(L, position); - - if (LuaScriptInterface::protectedCall(L, 2, 1) != 0) { - LuaScriptInterface::reportError(nullptr, LuaScriptInterface::popString(L)); - } else { - lua_pop(L, 1); - } - - LuaScriptInterface::resetScriptEnv(); -} - -// Npc -void Events::eventNpcOnSpawn(const std::shared_ptr &npc, const Position &position) { - // Npc:onSpawn(position) or Npc.onSpawn(self, position) - if (info.npcOnSpawn == -1) { - return; - } - - if (!LuaScriptInterface::reserveScriptEnv()) { - g_logger().error("{} - " - "Position {}" - ". Call stack overflow. Too many lua script calls being nested.", - __FUNCTION__, position.toString()); - return; - } - - ScriptEnvironment* env = LuaScriptInterface::getScriptEnv(); - env->setScriptId(info.npcOnSpawn, &scriptInterface); - - lua_State* L = scriptInterface.getLuaState(); - scriptInterface.pushFunction(info.npcOnSpawn); - - LuaScriptInterface::pushUserdata(L, npc); - LuaScriptInterface::setMetatable(L, -1, "Npc"); - LuaScriptInterface::pushPosition(L, position); - - if (LuaScriptInterface::protectedCall(L, 2, 1) != 0) { - LuaScriptInterface::reportError(nullptr, LuaScriptInterface::popString(L)); - } else { - lua_pop(L, 1); - } - - LuaScriptInterface::resetScriptEnv(); -} - Events &Events::getInstance() { return inject(); } @@ -342,38 +264,6 @@ ReturnValue Events::eventCreatureOnTargetCombat(const std::shared_ptr return returnValue; } -void Events::eventCreatureOnHear(const std::shared_ptr &creature, const std::shared_ptr &speaker, const std::string &words, SpeakClasses type) { - // Creature:onHear(speaker, words, type) - if (info.creatureOnHear == -1) { - return; - } - - if (!LuaScriptInterface::reserveScriptEnv()) { - g_logger().error("[Events::eventCreatureOnHear - " - "Creature {} speaker {}] " - "Call stack overflow. Too many lua script calls being nested.", - creature->getName(), speaker->getName()); - return; - } - - ScriptEnvironment* env = LuaScriptInterface::getScriptEnv(); - env->setScriptId(info.creatureOnHear, &scriptInterface); - - lua_State* L = scriptInterface.getLuaState(); - scriptInterface.pushFunction(info.creatureOnHear); - - LuaScriptInterface::pushUserdata(L, creature); - LuaScriptInterface::setCreatureMetatable(L, -1, creature); - - LuaScriptInterface::pushUserdata(L, speaker); - LuaScriptInterface::setCreatureMetatable(L, -1, speaker); - - LuaScriptInterface::pushString(L, words); - lua_pushnumber(L, type); - - scriptInterface.callVoidFunction(4); -} - void Events::eventCreatureOnDrainHealth(const std::shared_ptr &creature, const std::shared_ptr &attacker, CombatType_t &typePrimary, int32_t &damagePrimary, CombatType_t &typeSecondary, int32_t &damageSecondary, TextColor_t &colorPrimary, TextColor_t &colorSecondary) { if (info.creatureOnDrainHealth == -1) { return; diff --git a/src/lua/creature/events.hpp b/src/lua/creature/events.hpp index a74cbaf3ccf..59d6b2f20d0 100644 --- a/src/lua/creature/events.hpp +++ b/src/lua/creature/events.hpp @@ -41,7 +41,6 @@ class Events { int32_t creatureOnChangeOutfit = -1; int32_t creatureOnAreaCombat = -1; int32_t creatureOnTargetCombat = -1; - int32_t creatureOnHear = -1; int32_t creatureOnDrainHealth = -1; // Party @@ -78,10 +77,6 @@ class Events { // Monster int32_t monsterOnDropLoot = -1; - int32_t monsterOnSpawn = -1; - - // Npc - int32_t npcOnSpawn = -1; }; public: @@ -99,7 +94,6 @@ class Events { bool eventCreatureOnChangeOutfit(const std::shared_ptr &creature, const Outfit_t &outfit); ReturnValue eventCreatureOnAreaCombat(const std::shared_ptr &creature, const std::shared_ptr &tile, bool aggressive); ReturnValue eventCreatureOnTargetCombat(const std::shared_ptr &creature, const std::shared_ptr &target); - void eventCreatureOnHear(const std::shared_ptr &creature, const std::shared_ptr &speaker, const std::string &words, SpeakClasses type); void eventCreatureOnDrainHealth(const std::shared_ptr &creature, const std::shared_ptr &attacker, CombatType_t &typePrimary, int32_t &damagePrimary, CombatType_t &typeSecondary, int32_t &damageSecondary, TextColor_t &colorPrimary, TextColor_t &colorSecondary); // Party @@ -135,10 +129,6 @@ class Events { // Monster void eventMonsterOnDropLoot(const std::shared_ptr &monster, const std::shared_ptr &corpse); - void eventMonsterOnSpawn(const std::shared_ptr &monster, const Position &position); - - // Monster - void eventNpcOnSpawn(const std::shared_ptr &npc, const Position &position); private: LuaScriptInterface scriptInterface; diff --git a/src/lua/functions/core/game/game_functions.cpp b/src/lua/functions/core/game/game_functions.cpp index 16133833bbc..f1445b628b6 100644 --- a/src/lua/functions/core/game/game_functions.cpp +++ b/src/lua/functions/core/game/game_functions.cpp @@ -444,8 +444,6 @@ int GameFunctions::luaGameCreateMonster(lua_State* L) { const bool extended = getBoolean(L, 3, false); const bool force = getBoolean(L, 4, false); if (g_game().placeCreature(monster, position, extended, force)) { - g_events().eventMonsterOnSpawn(monster, position); - g_callbacks().executeCallback(EventCallback_t::monsterOnSpawn, &EventCallback::monsterOnSpawn, monster, position); monster->onSpawn(); const auto &mtype = monster->getMonsterType(); if (mtype && mtype->info.raceid > 0 && mtype->info.bosstiaryRace == BosstiaryRarity_t::RARITY_ARCHFOE) { diff --git a/src/lua/scripts/luascript.cpp b/src/lua/scripts/luascript.cpp index aa1b6011886..44c2c92b477 100644 --- a/src/lua/scripts/luascript.cpp +++ b/src/lua/scripts/luascript.cpp @@ -237,6 +237,7 @@ bool LuaScriptInterface::closeState() { } std::string LuaScriptInterface::getMetricsScope() const { +#ifdef FEATURE_METRICS metrics::method_latency measure(__METHOD_NAME__); int32_t scriptId; int32_t callbackId; @@ -261,6 +262,9 @@ std::string LuaScriptInterface::getMetricsScope() const { } return fmt::format("{}:{}", name, timerEvent ? "timer" : ""); +#else + return {}; +#endif } bool LuaScriptInterface::callFunction(int params) const { From 59a24c3902631f05ef13a7dc1efd2f627910c350 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 8 Nov 2024 10:49:04 -0300 Subject: [PATCH 10/17] improve: add check to boosted boss name empty (#3081) Checks if the boosted boss name is empty --- src/server/network/protocol/protocolgame.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index b8b67b6335f..abb2316905d 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -8857,7 +8857,11 @@ void ProtocolGame::parseSendBosstiarySlots() { uint32_t boostedBossId = g_ioBosstiary().getBoostedBossId(); // Sanity checks - std::string boostedBossName = g_ioBosstiary().getBoostedBossName(); + const std::string &boostedBossName = g_ioBosstiary().getBoostedBossName(); + if (boostedBossName.empty()) { + g_logger().error("[{}] The boosted boss name is empty", __FUNCTION__); + return; + } const auto mTypeBoosted = g_monsters().getMonsterType(boostedBossName); auto boostedBossRace = mTypeBoosted ? mTypeBoosted->info.bosstiaryRace : BosstiaryRarity_t::BOSS_INVALID; auto isValidBoostedBoss = boostedBossId == 0 || (boostedBossRace >= BosstiaryRarity_t::RARITY_BANE && boostedBossRace <= BosstiaryRarity_t::RARITY_NEMESIS); From da856d746e2af55bce8eeb3455c89678a9273ff3 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 8 Nov 2024 10:49:59 -0300 Subject: [PATCH 11/17] improve: lower boss name on boss lever system (#3070) This ensures the integrity of the name during searches. If a name is added with a different capitalization than the monster's actual name, it can lead to conflicts, preventing the onDeath code from executing properly. --- data/libs/functions/boss_lever.lua | 2 +- data/scripts/creaturescripts/monster/boss_lever_death.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/libs/functions/boss_lever.lua b/data/libs/functions/boss_lever.lua index da3b81d3704..3d430394f2a 100644 --- a/data/libs/functions/boss_lever.lua +++ b/data/libs/functions/boss_lever.lua @@ -56,7 +56,7 @@ setmetatable(BossLever, { error("BossLever: boss is required") end return setmetatable({ - name = boss.name, + name = boss.name:lower(), encounter = config.encounter, bossPosition = boss.position, timeToFightAgain = config.timeToFightAgain or configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN), diff --git a/data/scripts/creaturescripts/monster/boss_lever_death.lua b/data/scripts/creaturescripts/monster/boss_lever_death.lua index 4e035271623..35a86a97e92 100644 --- a/data/scripts/creaturescripts/monster/boss_lever_death.lua +++ b/data/scripts/creaturescripts/monster/boss_lever_death.lua @@ -13,7 +13,7 @@ function onBossDeath.onDeath(creature) return true end - local bossLever = BossLever[name] + local bossLever = BossLever[name:lower()] if not bossLever then return true end From dd746c851d8436a816a145089f28adc61f64f39e Mon Sep 17 00:00:00 2001 From: Paulo Henrique Lisboa Date: Fri, 8 Nov 2024 11:09:59 -0300 Subject: [PATCH 12/17] fix: review quests version 11 (#3049) Fixing the PR #2938 levers and related parts. Since the original code was quite extensive, perhaps some mechanics that should have been done when pulling the lever were removed. --- .../scripts/actions/bosses_levers/brokul.lua | 23 -- .../bosses_levers/grand_master_oberon.lua | 22 -- .../actions_ferumbras_lever.lua | 144 ++++++------- .../ferumbras_ascension/actions_rat_lever.lua | 70 ++---- .../actions_the_shatterer_lever.lua | 69 ++---- .../quests/the_first_dragon/actions_lever.lua | 202 ++++-------------- .../liquid_death/actions_brokulLever.lua | 137 +++--------- .../actions_oberonLever.lua | 63 +++--- .../movements_bossEntrance.lua | 2 +- data-otservbr-global/startup/tables/lever.lua | 22 -- data/libs/functions/boss_lever.lua | 34 ++- data/libs/functions/lever.lua | 21 ++ 12 files changed, 230 insertions(+), 579 deletions(-) delete mode 100644 data-otservbr-global/scripts/actions/bosses_levers/brokul.lua delete mode 100644 data-otservbr-global/scripts/actions/bosses_levers/grand_master_oberon.lua diff --git a/data-otservbr-global/scripts/actions/bosses_levers/brokul.lua b/data-otservbr-global/scripts/actions/bosses_levers/brokul.lua deleted file mode 100644 index 2cdded463af..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/brokul.lua +++ /dev/null @@ -1,23 +0,0 @@ -local config = { - boss = { - name = "Brokul", - position = Position(33483, 31434, 15), - }, - requiredLevel = 150, - playerPositions = { - { pos = Position(33522, 31465, 15), teleport = Position(33483, 31445, 15), effect = CONST_ME_TELEPORT }, - { pos = Position(33520, 31465, 15), teleport = Position(33483, 31445, 15), effect = CONST_ME_TELEPORT }, - { pos = Position(33521, 31465, 15), teleport = Position(33483, 31445, 15), effect = CONST_ME_TELEPORT }, - { pos = Position(33523, 31465, 15), teleport = Position(33483, 31445, 15), effect = CONST_ME_TELEPORT }, - { pos = Position(33524, 31465, 15), teleport = Position(33483, 31445, 15), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33469, 31430, 15), - to = Position(33497, 31453, 15), - }, - exit = Position(33522, 31468, 15), -} - -local lever = BossLever(config) -lever:aid(34000) -lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/grand_master_oberon.lua b/data-otservbr-global/scripts/actions/bosses_levers/grand_master_oberon.lua deleted file mode 100644 index e7a1a104d52..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/grand_master_oberon.lua +++ /dev/null @@ -1,22 +0,0 @@ -local config = { - boss = { - name = "Grand Master Oberon", - position = Position(33364, 31317, 9), - }, - playerPositions = { - { pos = Position(33362, 31344, 9), teleport = Position(33364, 31322, 9) }, - { pos = Position(33363, 31344, 9), teleport = Position(33364, 31322, 9) }, - { pos = Position(33364, 31344, 9), teleport = Position(33364, 31322, 9) }, - { pos = Position(33365, 31344, 9), teleport = Position(33364, 31322, 9) }, - { pos = Position(33366, 31344, 9), teleport = Position(33364, 31322, 9) }, - }, - specPos = { - from = Position(33357, 31312, 9), - to = Position(33371, 31324, 9), - }, - exit = Position(33364, 31341, 9), -} - -local lever = BossLever(config) -lever:aid(57605) -lever:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_lever.lua index 7828b7d935e..bd4e2b171fe 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_lever.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_lever.lua @@ -1,91 +1,69 @@ -local crystals = { - [1] = { crystalPosition = Position(33390, 31468, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal1 }, - [2] = { crystalPosition = Position(33394, 31468, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal2 }, - [3] = { crystalPosition = Position(33397, 31471, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal3 }, - [4] = { crystalPosition = Position(33397, 31475, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal4 }, - [5] = { crystalPosition = Position(33394, 31478, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal5 }, - [6] = { crystalPosition = Position(33390, 31478, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal6 }, - [7] = { crystalPosition = Position(33387, 31475, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal7 }, - [8] = { crystalPosition = Position(33387, 31471, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal8 }, -} - local config = { - centerRoom = Position(33392, 31473, 14), - BossPosition = Position(33392, 31473, 14), + boss = { + name = "Ascending Ferumbras", + position = Position(33392, 31473, 14), + }, + timeToFightAgain = 60 * 60 * 20 * 24, playerPositions = { - Position(33269, 31477, 14), - Position(33269, 31478, 14), - Position(33269, 31479, 14), - Position(33269, 31480, 14), - Position(33269, 31481, 14), - Position(33270, 31477, 14), - Position(33270, 31478, 14), - Position(33270, 31479, 14), - Position(33270, 31480, 14), - Position(33270, 31481, 14), - Position(33271, 31477, 14), - Position(33271, 31478, 14), - Position(33271, 31479, 14), - Position(33271, 31480, 14), - Position(33271, 31481, 14), + { pos = Position(33270, 31477, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33269, 31477, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33269, 31478, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33269, 31479, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33269, 31480, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33269, 31481, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33270, 31478, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33270, 31479, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33270, 31480, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33270, 31481, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33271, 31477, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33271, 31478, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33271, 31479, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33271, 31480, 14), teleport = Position(33392, 31479, 14) }, + { pos = Position(33271, 31481, 14), teleport = Position(33392, 31479, 14) }, }, - newPosition = Position(33392, 31479, 14), -} - -local leverFerumbras = Action() - -function leverFerumbras.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local playersTable = {} - if item.itemid == 8911 then - if player:getPosition() ~= Position(33270, 31477, 14) then - item:transform(8912) - return true - end - end - if item.itemid == 8911 then - if player:doCheckBossRoom("Ascending Ferumbras", Position(33379, 31460, 14), Position(33405, 31485, 14)) then - Game.createMonster("Ascending Ferumbras", config.BossPosition, true, true) - for b = 1, 10 do - local xrand = math.random(-10, 10) - local yrand = math.random(-10, 10) - local position = Position(33392 + xrand, 31473 + yrand, 14) - if Game.createMonster("rift invader", position) then - end - end - for x = 33269, 33271 do - for y = 31477, 31481 do - local playerTile = Tile(Position(x, 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.U10_90.FerumbrasAscension.FerumbrasTimer, os.time() + 60 * 60 * 20 * 24) - table.insert(playersTable, playerTile:getId()) - end - end - end - Game.setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Crystals.AllCrystals, 0) - Game.setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FerumbrasEssence, 0) - for _, crystal in pairs(crystals) do - local pos = crystal.crystalPosition - local stg = crystal.globalStorage - local sqm = Tile(pos) - if sqm then - local item = sqm:getItemById(14961) - if item then - item:transform(14955) - end + specPos = { + from = Position(33379, 31460, 14), + to = Position(33405, 31485, 14), + }, + exit = Position(33319, 32318, 13), + monsters = { + { name = "rift invader", pos = Position(33385, 31466, 14) }, + { name = "rift invader", pos = Position(33396, 31466, 14) }, + { name = "rift invader", pos = Position(33392, 31480, 14) }, + { name = "rift invader", pos = Position(33392, 31468, 14) }, + { name = "rift invader", pos = Position(33385, 31473, 14) }, + { name = "rift invader", pos = Position(33398, 31478, 14) }, + { name = "rift invader", pos = Position(33384, 31478, 14) }, + { name = "rift invader", pos = Position(33390, 31463, 14) }, + { name = "rift invader", pos = Position(33400, 31473, 14) }, + { name = "rift invader", pos = Position(33400, 31465, 14) }, + }, + onUseExtra = function(player) + local crystals = { + [1] = { crystalPosition = Position(33390, 31468, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal1 }, + [2] = { crystalPosition = Position(33394, 31468, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal2 }, + [3] = { crystalPosition = Position(33397, 31471, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal3 }, + [4] = { crystalPosition = Position(33397, 31475, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal4 }, + [5] = { crystalPosition = Position(33394, 31478, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal5 }, + [6] = { crystalPosition = Position(33390, 31478, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal6 }, + [7] = { crystalPosition = Position(33387, 31475, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal7 }, + [8] = { crystalPosition = Position(33387, 31471, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal8 }, + } + Game.setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Crystals.AllCrystals, 0) + Game.setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FerumbrasEssence, 0) + for _, crystal in pairs(crystals) do + local tile = Tile(crystal.crystalPosition) + if tile then + local item = tile:getItemById(14961) + if item then + item:transform(14955) end - Game.setStorageValue(stg, 0) end - addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, Position(33379, 31460, 14), Position(33405, 31485, 14), Position(33319, 32318, 13)) - item:transform(8912) + Game.setStorageValue(crystal.globalStorage, 0) end - elseif item.itemid == 8912 then - item:transform(8911) - end - return true -end + end, +} -leverFerumbras:uid(1021) +local leverFerumbras = BossLever(config) +leverFerumbras:position(Position(33270, 31476, 14)) leverFerumbras:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_rat_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_rat_lever.lua index e9592b71585..97cb6fef4f9 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_rat_lever.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_rat_lever.lua @@ -1,57 +1,23 @@ local config = { - centerRoom = Position(33215, 31456, 12), - BossPosition = Position(33220, 31460, 12), + boss = { + name = "The Lord of the Lice", + position = Position(33220, 31460, 12), + }, + timeToFightAgain = 2 * 24 * 60 * 60, playerPositions = { - Position(33197, 31475, 11), - Position(33198, 31475, 11), - Position(33199, 31475, 11), - Position(33200, 31475, 11), - Position(33201, 31475, 11), + { pos = Position(33201, 31475, 11), teleport = Position(33215, 31470, 12) }, + { pos = Position(33197, 31475, 11), teleport = Position(33215, 31470, 12) }, + { pos = Position(33198, 31475, 11), teleport = Position(33215, 31470, 12) }, + { pos = Position(33199, 31475, 11), teleport = Position(33215, 31470, 12) }, + { pos = Position(33200, 31475, 11), teleport = Position(33215, 31470, 12) }, + }, + specPos = { + from = Position(33187, 31429, 12), + to = Position(33242, 31487, 12), }, - newPosition = Position(33215, 31470, 12), + exit = Position(33319, 32318, 13), } -local ferumbrasAscendantRatLever = Action() - -function ferumbrasAscendantRatLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if item.itemid == 8911 then - if player:getPosition() ~= Position(33201, 31475, 11) then - item:transform(8912) - return true - end - end - - if item.itemid == 8911 then - local playersTable = {} - if player:doCheckBossRoom("The Lord of the Lice", Position(33187, 31429, 12), Position(33242, 31487, 12)) then - local specs, spec = Game.getSpectators(config.centerRoom, false, false, 30, 30, 30, 30) - for i = 1, #specs do - spec = specs[i] - if spec:isPlayer() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting with The Lord of The Lice.") - return true - end - end - Game.createMonster("the lord of the lice", config.BossPosition, true, true) - for x = 33197, 33201 do - local playerTile = Tile(Position(x, 31475, 11)):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.U10_90.FerumbrasAscension.TheLordOfTheLiceTimer, os.time() + 60 * 60 * 2 * 24) - table.insert(playersTable, playerTile:getId()) - end - end - addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, Position(33187, 31429, 12), Position(33242, 31487, 12), Position(33319, 32318, 13)) - item:transform(8912) - end - elseif item.itemid == 8912 then - item:transform(8911) - end - - return true -end - -ferumbrasAscendantRatLever:uid(1030) -ferumbrasAscendantRatLever:register() +local leverLordOfTheLice = BossLever(config) +leverLordOfTheLice:position(Position(33202, 31475, 11)) +leverLordOfTheLice:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_lever.lua index 9e061a2f4a4..6782d30c024 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_lever.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_lever.lua @@ -1,56 +1,23 @@ local config = { - centerRoom = Position(33406, 32418, 14), - BossPosition = Position(33406, 32418, 14), + boss = { + name = "The Shatterer", + position = Position(33406, 32418, 14), + }, + timeToFightAgain = 2 * 24 * 60 * 60, playerPositions = { - Position(33403, 32465, 13), - Position(33404, 32465, 13), - Position(33405, 32465, 13), - Position(33406, 32465, 13), - Position(33407, 32465, 13), + { pos = Position(33403, 32465, 13), teleport = Position(33398, 32414, 14) }, + { pos = Position(33404, 32465, 13), teleport = Position(33398, 32414, 14) }, + { pos = Position(33405, 32465, 13), teleport = Position(33398, 32414, 14) }, + { pos = Position(33406, 32465, 13), teleport = Position(33398, 32414, 14) }, + { pos = Position(33407, 32465, 13), teleport = Position(33398, 32414, 14) }, + }, + specPos = { + from = Position(33377, 32390, 14), + to = Position(33446, 32447, 14), }, - newPosition = Position(33398, 32414, 14), + exit = Position(33319, 32318, 13), } -local ferumbrasAscendantTheShattererLever = Action() - -function ferumbrasAscendantTheShattererLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if item.itemid == 8912 then - if player:getPosition() ~= Position(33403, 32465, 13) then - item:transform(8911) - return true - end - end - if item.itemid == 8912 then - local playersTable = {} - if player:doCheckBossRoom("The Shatterer", Position(33377, 32390, 14), Position(33446, 32447, 14)) then - local specs, spec = Game.getSpectators(config.centerRoom, false, false, 30, 30, 30, 30) - for i = 1, #specs do - spec = specs[i] - if spec:isPlayer() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting with The Shatterer.") - return true - end - end - Game.createMonster("The Shatterer", config.BossPosition, true, true) - for x = 33403, 33407 do - local playerTile = Tile(Position(x, 32465, 13)):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.U10_90.FerumbrasAscension.TheShattererTimer, os.time() + 60 * 60 * 2 * 24) - table.insert(playersTable, playerTile:getId()) - end - end - addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, Position(33377, 32390, 14), Position(33446, 32447, 14), Position(33319, 32318, 13)) - item:transform(8911) - end - elseif item.itemid == 8911 then - item:transform(8912) - end - - return true -end - -ferumbrasAscendantTheShattererLever:uid(1029) -ferumbrasAscendantTheShattererLever:register() +local leverShatterer = BossLever(config) +leverShatterer:position(Position(33402, 32465, 13)) +leverShatterer:register() diff --git a/data-otservbr-global/scripts/quests/the_first_dragon/actions_lever.lua b/data-otservbr-global/scripts/quests/the_first_dragon/actions_lever.lua index 698ada382b2..ff4c20ff88d 100644 --- a/data-otservbr-global/scripts/quests/the_first_dragon/actions_lever.lua +++ b/data-otservbr-global/scripts/quests/the_first_dragon/actions_lever.lua @@ -1,168 +1,50 @@ -local lever = Action() - local config = { - centerRoom = { x = 33616, y = 31022, z = 14 }, - range = 10, - storage = Storage.Quest.U11_02.TheFirstDragon.FirstDragonTimer, - monsterPosition = { - { position = Position(33574, 31013, 14) }, - { position = Position(33592, 31013, 14) }, - { position = Position(33583, 31022, 14) }, - { position = Position(33574, 31031, 14) }, - { position = Position(33592, 31031, 14) }, + boss = { + name = "spirit of fertility", + position = Position(33625, 31021, 14), }, + timeToFightAgain = 20 * 60 * 60, playerPositions = { - Position(33582, 30993, 14), - Position(33583, 30993, 14), - Position(33584, 30993, 14), - Position(33582, 30994, 14), - Position(33583, 30994, 14), - Position(33584, 30994, 14), - Position(33582, 30995, 14), - Position(33583, 30995, 14), - Position(33584, 30995, 14), - Position(33582, 30996, 14), - Position(33583, 30996, 14), - Position(33584, 30996, 14), - Position(33582, 30997, 14), - Position(33583, 30997, 14), - Position(33584, 30997, 14), - }, - toPosition1 = Position(33574, 31017, 14), - roomTile1 = { - { fromPosition = Position(33582, 30993, 14) }, - { fromPosition = Position(33583, 30993, 14) }, - { fromPosition = Position(33584, 30993, 14) }, - }, - toPosition2 = Position(33592, 31017, 14), - roomTile2 = { - { fromPosition = Position(33582, 30994, 14) }, - { fromPosition = Position(33583, 30994, 14) }, - { fromPosition = Position(33584, 30994, 14) }, - }, - toPosition3 = Position(33592, 31035, 14), - roomTile3 = { - { fromPosition = Position(33582, 30995, 14) }, - { fromPosition = Position(33583, 30995, 14) }, - { fromPosition = Position(33584, 30995, 14) }, - }, - toPosition4 = Position(33574, 31035, 14), - roomTile4 = { - { fromPosition = Position(33582, 30996, 14) }, - { fromPosition = Position(33583, 30996, 14) }, - { fromPosition = Position(33584, 30996, 14) }, - }, - toPosition5 = Position(33583, 31026, 14), - roomTile5 = { - { fromPosition = Position(33582, 30997, 14) }, - { fromPosition = Position(33583, 30997, 14) }, - { fromPosition = Position(33584, 30997, 14) }, - }, - clearArea = { + { pos = Position(33583, 30993, 14), teleport = Position(33592, 31017, 14) }, + { pos = Position(33582, 30993, 14), teleport = Position(33574, 31017, 14) }, + { pos = Position(33584, 30993, 14), teleport = Position(33592, 31035, 14) }, + { pos = Position(33582, 30994, 14), teleport = Position(33574, 31035, 14) }, + { pos = Position(33583, 30994, 14), teleport = Position(33583, 31026, 14) }, + { pos = Position(33584, 30994, 14), teleport = Position(33574, 31017, 14) }, + { pos = Position(33582, 30995, 14), teleport = Position(33592, 31017, 14) }, + { pos = Position(33583, 30995, 14), teleport = Position(33592, 31035, 14) }, + { pos = Position(33584, 30995, 14), teleport = Position(33574, 31035, 14) }, + { pos = Position(33582, 30996, 14), teleport = Position(33583, 31026, 14) }, + { pos = Position(33583, 30996, 14), teleport = Position(33574, 31017, 14) }, + { pos = Position(33584, 30996, 14), teleport = Position(33592, 31017, 14) }, + { pos = Position(33582, 30997, 14), teleport = Position(33592, 31035, 14) }, + { pos = Position(33583, 30997, 14), teleport = Position(33574, 31035, 14) }, + { pos = Position(33584, 30997, 14), teleport = Position(33583, 31026, 14) }, + }, + specPos = { from = Position(33566, 31006, 14), to = Position(33626, 31032, 14), }, -} - -local function clearMonstersInArea(fromPos, toPos) - for z = fromPos.z, toPos.z do - for y = fromPos.y, toPos.y do - for x = fromPos.x, toPos.x do - local tile = Tile(Position(x, y, z)) - if tile then - local creature = tile:getTopCreature() - if creature and creature:isMonster() then - creature:remove() - end - end - end - end - end -end - -local function isRoomOccupied(fromPos, toPos) - for z = fromPos.z, toPos.z do - for y = fromPos.y, toPos.y do - for x = fromPos.x, toPos.x do - local tile = Tile(Position(x, y, z)) - if tile then - local creature = tile:getTopCreature() - if creature and creature:isPlayer() then - return true - end - end - end + monsters = { + { name = "fallen challenger", pos = Position(33592, 31013, 14) }, + { name = "fallen challenger", pos = Position(33583, 31022, 14) }, + { name = "fallen challenger", pos = Position(33574, 31013, 14) }, + { name = "fallen challenger", pos = Position(33574, 31031, 14) }, + { name = "fallen challenger", pos = Position(33592, 31031, 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + }, + exit = Position(33597, 30994, 14), + onUseExtra = function(creature) + if creature and creature:isPlayer() then + creature:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.SomewhatBeatable, 0) end - end - return false -end - -function lever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if item.itemid == 8911 then - for i = 1, #config.playerPositions do - local creature = Tile(config.playerPositions[i]):getTopCreature() - if not creature then - item:transform(8912) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need 15 players to fight with this boss.") - return true - end - end - end - - if item.itemid == 8911 then - if isRoomOccupied(config.clearArea.from, config.clearArea.to) then - player:say("Someone is fighting against the boss! You need to wait awhile.", TALKTYPE_MONSTER_SAY) - return true - else - clearMonstersInArea(config.clearArea.from, config.clearArea.to) - end - - for d = 1, 5 do - Game.createMonster("unbeatable dragon", Position(math.random(33610, 33622), math.random(31016, 31030), 14), true, true) - end - for b = 1, #config.monsterPosition do - Game.createMonster("fallen challenger", config.monsterPosition[b].position, true, true) - end - - for i = 1, #config.playerPositions do - local creature = Tile(config.playerPositions[i]):getTopCreature() - if creature then - for i = 1, #config.roomTile1 do - local toRoom1 = Tile(config.roomTile1[i].fromPosition):getTopCreature() - if toRoom1 then - toRoom1:teleportTo(config.toPosition1) - end - local toRoom2 = Tile(config.roomTile2[i].fromPosition):getTopCreature() - if toRoom2 then - toRoom2:teleportTo(config.toPosition2) - end - local toRoom3 = Tile(config.roomTile3[i].fromPosition):getTopCreature() - if toRoom3 then - toRoom3:teleportTo(config.toPosition3) - end - local toRoom4 = Tile(config.roomTile4[i].fromPosition):getTopCreature() - if toRoom4 then - toRoom4:teleportTo(config.toPosition4) - end - local toRoom5 = Tile(config.roomTile5[i].fromPosition):getTopCreature() - if toRoom5 then - toRoom5:teleportTo(config.toPosition5) - end - end - creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(config.storage, os.time() + 20 * 3600) - creature:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.SomewhatBeatable, 0) - end - end - - addEvent(clearRoom, 60 * 60 * 1000, Position(33583, 31022, 14), 50, 50, config.storage) - Game.createMonster("spirit of fertility", Position(33625, 31021, 14), true, true) - item:transform(8912) - elseif item.itemid == 8912 then - item:transform(8911) - end - return true -end + end, +} -lever:uid(30003) -lever:register() +local leverFirstDragon = BossLever(config) +leverFirstDragon:position(Position(33583, 30992, 14)) +leverFirstDragon:register() diff --git a/data-otservbr-global/scripts/quests/the_secret_library_quest/liquid_death/actions_brokulLever.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/liquid_death/actions_brokulLever.lua index 2cab34c6e48..89c8ac4c479 100644 --- a/data-otservbr-global/scripts/quests/the_secret_library_quest/liquid_death/actions_brokulLever.lua +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/liquid_death/actions_brokulLever.lua @@ -1,113 +1,32 @@ -local transform = { - [2772] = 2773, - [2773] = 2772, -} - -local leverInfo = { - [1] = { - bossName = "Brokul", - bossPosition = Position(33483, 31437, 15), - leverPosition = Position(33522, 31464, 15), - pushPosition = Position(33522, 31465, 15), - leverFromPos = Position(33520, 31465, 15), - leverToPos = Position(33524, 31465, 15), - storageTimer = Storage.Quest.U11_80.TheSecretLibrary.LiquidDeath.BrokulTimer, - teleportTo = Position(33484, 31446, 15), - globalTimer = Storage.Quest.U11_80.TheSecretLibrary.LiquidDeath.BrokulTimerGlobal, - roomFromPosition = Position(33472, 31427, 15), - roomToPosition = Position(33496, 31450, 15), - exitPosition = Position(33528, 31464, 14), +local config = { + boss = { + name = "Brokul", + position = Position(33483, 31437, 15), }, -} - -local function clearBossRoom(fromPos, toPos) - local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) - for _, spec in pairs(spectators) do - if not spec:isPlayer() then - spec:remove() - end - end -end - -local function isBossInRoom(fromPos, toPos, bossName) - local hasBoss = false - local hasPlayers = false - local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) - - for _, spec in pairs(spectators) do - if spec:isPlayer() then - hasPlayers = true - elseif spec:isMonster() and spec:getName():lower() == bossName:lower() then - hasBoss = true - end - end - - return hasBoss, hasPlayers -end - -local actions_liquid_brokulLever = Action() - -function actions_liquid_brokulLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not player then - return true - end - - local playersTable = {} - local iPos = item:getPosition() - local pPos = player:getPosition() - - if item.itemid == 2772 then - for i = 1, #leverInfo do - if iPos == leverInfo[i].leverPosition then - local leverTable = leverInfo[i] - if pPos == leverTable.pushPosition then - local hasBoss, hasPlayers = isBossInRoom(leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.bossName) - - if hasPlayers then - player:sendCancelMessage("The room is already occupied by other players.") - return true - elseif hasBoss then - clearBossRoom(leverTable.roomFromPosition, leverTable.roomToPosition) - end - - local playerCount = 0 - for i = leverTable.leverFromPos.x, leverTable.leverToPos.x do - local newPos = Position(i, leverTable.leverFromPos.y, leverTable.leverFromPos.z) - local creature = Tile(newPos):getTopCreature() - if creature and creature:isPlayer() then - if creature:getStorageValue(Storage.Quest.U11_80.TheSecretLibrary.LiquidDeath.Questline) >= 6 then - playerCount = playerCount + 1 - table.insert(playersTable, creature:getId()) - else - creature:sendCancelMessage("You are not qualified to face the boss.") - end - end - end - - if playerCount < 5 then - player:sendCancelMessage("You need 5 qualified players for this challenge.") - return true - end - - for _, playerId in ipairs(playersTable) do - local creature = Creature(playerId) - if creature then - creature:setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.LiquidDeath.BrokulTimer, os.time() + 20 * 60 * 60) - creature:teleportTo(leverTable.teleportTo, true) - creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - end - end - - local monster = Game.createMonster(leverTable.bossName, leverTable.bossPosition) - addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.exitPosition) - end + timeToFightAgain = 20 * 60 * 60, + minPlayers = 5, + playerPositions = { + { pos = Position(33522, 31465, 15), teleport = Position(33484, 31446, 15) }, + { pos = Position(33520, 31465, 15), teleport = Position(33484, 31446, 15) }, + { pos = Position(33521, 31465, 15), teleport = Position(33484, 31446, 15) }, + { pos = Position(33523, 31465, 15), teleport = Position(33484, 31446, 15) }, + { pos = Position(33524, 31465, 15), teleport = Position(33484, 31446, 15) }, + }, + specPos = { + from = Position(33472, 31427, 15), + to = Position(33496, 31450, 15), + }, + exit = Position(33528, 31464, 14), + onUseExtra = function(creature, infoPositions) + if creature and creature:isPlayer() then + if creature:getStorageValue(Storage.Quest.U11_80.TheSecretLibrary.LiquidDeath.Questline) >= 6 then + return true end + return false end - end - - item:transform(transform[item.itemid]) - return true -end + end, +} -actions_liquid_brokulLever:aid(4901) -actions_liquid_brokulLever:register() +local leverBrokul = BossLever(config) +leverBrokul:aid(34000) +leverBrokul:register() diff --git a/data-otservbr-global/scripts/quests/the_secret_library_quest/the_order_of_the_falcon/actions_oberonLever.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/the_order_of_the_falcon/actions_oberonLever.lua index c6e6841f714..e736be79de5 100644 --- a/data-otservbr-global/scripts/quests/the_secret_library_quest/the_order_of_the_falcon/actions_oberonLever.lua +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/the_order_of_the_falcon/actions_oberonLever.lua @@ -1,39 +1,26 @@ -local actions_falcon_oberon_lever = Action() +local config = { + boss = { + name = "Grand Master Oberon", + createFunction = function() + Game.createMonster("Grand Master Oberon", Position(33365, 31318, 9), true, true):setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.OberonHeal, 0) + return true + end, + }, + timeToFightAgain = 20 * 60 * 60, + playerPositions = { + { pos = Position(33364, 31344, 9), teleport = Position(33364, 31322, 9) }, + { pos = Position(33362, 31344, 9), teleport = Position(33364, 31322, 9) }, + { pos = Position(33363, 31344, 9), teleport = Position(33364, 31322, 9) }, + { pos = Position(33365, 31344, 9), teleport = Position(33364, 31322, 9) }, + { pos = Position(33366, 31344, 9), teleport = Position(33364, 31322, 9) }, + }, + specPos = { + from = Position(33356, 31311, 9), + to = Position(33376, 31328, 9), + }, + exit = Position(33297, 31285, 9), +} -function actions_falcon_oberon_lever.onUse(player, item, fromPosition, itemEx, toPosition) - local bossName = "Grand Master Oberon" - local playersTable = {} - local fromPosition_ = Position(33356, 31311, 9) - local toPosition_ = Position(33376, 31328, 9) - local exitPosition = Position(33297, 31285, 9) - - if item:getId() == 2772 then - if doCheckBossRoom(player:getId(), bossName, fromPosition_, toPosition_) then - for i = 33362, 33366, 1 do - local newpos = Position(i, 31344, 9) - local nplayer = Tile(newpos):getTopCreature() - if nplayer and nplayer:isPlayer() then - nplayer:teleportTo(Position(33364, 31322, 9), true) - nplayer:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - table.insert(playersTable, nplayer:getId()) - nplayer:setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.OberonTimer, os.time() + 20 * 60 * 60) - end - end - local oberon = Game.createMonster("Grand Master Oberon", Position(33365, 31318, 9)) - if oberon then - oberon:setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.OberonHeal, 0) - end - Game.setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.OberonSay, -1) - Game.createNpc("Oberon's Spite", Position(33361, 31320, 9)) - Game.createNpc("Oberon's Ire", Position(33367, 31320, 9)) - Game.createNpc("Oberon's Bile", Position(33361, 31316, 9)) - Game.createNpc("Oberon's Hate", Position(33367, 31316, 9)) - addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, fromPosition_, toPosition_, exitPosition) - end - end - - return true -end - -actions_falcon_oberon_lever:aid(4922) -actions_falcon_oberon_lever:register() +local leverOberon = BossLever(config) +leverOberon:aid(57605) +leverOberon:register() diff --git a/data-otservbr-global/scripts/quests/the_secret_library_quest/the_order_of_the_falcon/movements_bossEntrance.lua b/data-otservbr-global/scripts/quests/the_secret_library_quest/the_order_of_the_falcon/movements_bossEntrance.lua index 0f000b94e7c..f6068da667b 100644 --- a/data-otservbr-global/scripts/quests/the_secret_library_quest/the_order_of_the_falcon/movements_bossEntrance.lua +++ b/data-otservbr-global/scripts/quests/the_secret_library_quest/the_order_of_the_falcon/movements_bossEntrance.lua @@ -36,7 +36,7 @@ function movements_falcon_bossEntrance.onStepIn(creature, item, position, fromPo if isInArray(blockedPositions, position) then return true else - if creature:getStorageValue(Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.OberonTimer) <= os.time() then + if creature:canFightBoss("Grand Master Oberon") then creature:teleportTo(Position(33363, 31341, 9), true) else creature:teleportTo(fromPosition, true) diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index e7db97ab859..ab887209866 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -16,12 +16,6 @@ LeverAction = { }, }, -- The Secret Library Quest - [4901] = { - itemId = 2772, - itemPos = { - { x = 33522, y = 31464, z = 15 }, - }, - }, [4906] = { itemId = false, itemPos = { @@ -29,12 +23,6 @@ LeverAction = { { x = 33218, y = 32096, z = 10 }, }, }, - [4922] = { - itemId = 2772, - itemPos = { - { x = 33364, y = 31343, z = 9 }, - }, - }, -- Cults of Tibia Quest [5500] = { itemId = 8911, @@ -315,10 +303,6 @@ LeverUnique = { itemPos = { x = 33172, y = 31896, z = 8 }, }, -- Ferumbras' Ascension Quest - [1021] = { - itemId = 8911, - itemPos = { x = 33270, y = 31476, z = 14 }, - }, [1022] = { itemId = 8911, itemPos = { x = 33229, y = 31499, z = 13 }, @@ -547,12 +531,6 @@ LeverUnique = { itemId = 2773, itemPos = { x = 33582, y = 31844, z = 10 }, }, - -- The first dragon quest lever - -- Path: data\scripts\actions\quests\first_dragon\lever.lua - [30003] = { - itemId = 8911, - itemPos = { x = 33583, y = 30992, z = 14 }, - }, -- Thais lighthouse quest -- Path: data\scripts\quests\thais_lighthouse\action-lever.lua [30004] = { diff --git a/data/libs/functions/boss_lever.lua b/data/libs/functions/boss_lever.lua index 3d430394f2a..40bc8e0b4b0 100644 --- a/data/libs/functions/boss_lever.lua +++ b/data/libs/functions/boss_lever.lua @@ -4,6 +4,7 @@ ---@field private createBoss function ---@field private timeToFightAgain number ---@field private timeToDefeat number +---@field private minPlayers number ---@field private timeAfterKill number ---@field private requiredLevel number ---@field private disabled boolean @@ -29,6 +30,7 @@ local config = { } requiredLevel = 250, timeToFightAgain = 10 * 60 * 60, -- In seconds + minPlayers = 4, playerPositions = { { pos = Position(33638, 32562, 13), teleport = Position(33617, 32567, 13) }, { pos = Position(33639, 32562, 13), teleport = Position(33617, 32567, 13) }, @@ -40,7 +42,7 @@ local config = { from = Position(33607, 32553, 13), to = Position(33627, 32570, 13) }, - onUseExtra = function(player) + onUseExtra = function(player, infoPositions) player:teleportTo(Position(33618, 32523, 15)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end, @@ -65,6 +67,7 @@ setmetatable(BossLever, { requiredLevel = config.requiredLevel or 0, createBoss = boss.createFunction, disabled = config.disabled, + minPlayers = config.minPlayers or 1, playerPositions = config.playerPositions, onUseExtra = config.onUseExtra or function() end, exitTeleporter = config.exitTeleporter, @@ -146,22 +149,10 @@ end function BossLever:onUse(player) local monsterName = MonsterType(self.name):getName() local isParticipant = false - local players = {} - - for i = 1, #self.playerPositions do - local pos = self.playerPositions[i].pos - local creature = Tile(pos):getTopCreature() - - if not creature or not creature:isPlayer() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need " .. #self.playerPositions .. " players to challenge " .. self.name .. ".") - return true - end - - if pos == player:getPosition() then + for _, v in ipairs(self.playerPositions) do + if Position(v.pos) == player:getPosition() then isParticipant = true end - - table.insert(players, creature) end if not isParticipant then return false @@ -194,8 +185,8 @@ function BossLever:onUse(player) return false end + local infoPositions = lever:getInfoPositions() if creature:getGroup():getId() < GROUP_TYPE_GOD and isAccountNormal and self:lastEncounterTime(creature) > os.time() then - local infoPositions = lever:getInfoPositions() for _, posInfo in pairs(infoPositions) do local currentPlayer = posInfo.creature if currentPlayer then @@ -218,11 +209,18 @@ function BossLever:onUse(player) return false end - self.onUseExtra(creature) - return true + return self.onUseExtra(creature, infoPositions) ~= false end) lever:checkPositions() + if #lever:getPlayers() < self.minPlayers then + lever:executeOnPlayers(function(creature) + local message = string.format("You need %d qualified players for this challenge.", self.minPlayers) + creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, message) + creature:getPosition():sendMagicEffect(CONST_ME_POFF) + end) + return false + end if lever:checkConditions() then zone:removeMonsters() for _, monster in pairs(self.monsters) do diff --git a/data/libs/functions/lever.lua b/data/libs/functions/lever.lua index 54e6e5c4915..39802af49d2 100644 --- a/data/libs/functions/lever.lua +++ b/data/libs/functions/lever.lua @@ -5,6 +5,7 @@ setmetatable(Lever, { local lever_data = { positions = {}, info_positions = nil, + players = {}, condition = function() return true end, @@ -51,6 +52,19 @@ function Lever.getInfoPositions(self) return self.info_positions end +---@return table +function Lever.getPlayers(self) + return self.players +end + +---@param player Player +---@return nil +function Lever.addPlayer(self, player) + if player and player:isPlayer() then + table.insert(self.players, player) + end +end + --[[ lever:setCondition(function(creature)) @@ -109,6 +123,7 @@ function Lever:checkPositions() local ground = tile:getGround() local actionID = ground:getActionId() local uniqueID = ground:getUniqueId() + self:addPlayer(creature) table.insert(array, { tile = tile, creature = creature, @@ -140,6 +155,12 @@ function Lever.checkConditions(self) -- It will check the conditions defined in return true end +function Lever.executeOnPlayers(self, func) + for _, player in pairs(self:getPlayers()) do + func(player) + end +end + ---@return nil function Lever.teleportPlayers(self) -- It will teleport all players to the positions defined in setPositions() local info = self:getInfoPositions() From 56463171b32b8313266054b7814cbc44c6c1eaf5 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Lisboa Date: Fri, 8 Nov 2024 12:11:40 -0300 Subject: [PATCH 13/17] fix: object variable renamed (#3082) fixed the cobras console error, the problem was being caused because of the object name handleCobraOnSpawn --- data-otservbr-global/monster/humans/cobra_assassin.lua | 2 +- data-otservbr-global/monster/humans/cobra_scout.lua | 2 +- data-otservbr-global/monster/humans/cobra_vizier.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data-otservbr-global/monster/humans/cobra_assassin.lua b/data-otservbr-global/monster/humans/cobra_assassin.lua index 90a753a9c33..fa834503e56 100644 --- a/data-otservbr-global/monster/humans/cobra_assassin.lua +++ b/data-otservbr-global/monster/humans/cobra_assassin.lua @@ -122,7 +122,7 @@ monster.immunities = { } mType.onSpawn = function(monster) - self:handleCobraOnSpawn() + monster:handleCobraOnSpawn() end mType:register(monster) diff --git a/data-otservbr-global/monster/humans/cobra_scout.lua b/data-otservbr-global/monster/humans/cobra_scout.lua index f127abc81ee..6fc3e893497 100644 --- a/data-otservbr-global/monster/humans/cobra_scout.lua +++ b/data-otservbr-global/monster/humans/cobra_scout.lua @@ -127,7 +127,7 @@ monster.immunities = { } mType.onSpawn = function(monster) - self:handleCobraOnSpawn() + monster:handleCobraOnSpawn() end mType:register(monster) diff --git a/data-otservbr-global/monster/humans/cobra_vizier.lua b/data-otservbr-global/monster/humans/cobra_vizier.lua index 47ccb6b58c4..934b015842a 100644 --- a/data-otservbr-global/monster/humans/cobra_vizier.lua +++ b/data-otservbr-global/monster/humans/cobra_vizier.lua @@ -130,7 +130,7 @@ monster.immunities = { } mType.onSpawn = function(monster) - self:handleCobraOnSpawn() + monster:handleCobraOnSpawn() end mType:register(monster) From 0b30b4843df7cd3fc5f072ea18433dc0924228fe Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Sat, 9 Nov 2024 16:04:59 -0300 Subject: [PATCH 14/17] fix: creature teleport with dispatcher walk event (#3066) Resolves bug implemented after: #2933 --- src/game/game.cpp | 4 +--- src/game/movement/teleport.cpp | 8 ++++---- src/map/map.cpp | 7 +++++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 140a6d8e62f..af8c56c1d75 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -2907,9 +2907,7 @@ ReturnValue Game::internalTeleport(const std::shared_ptr &thing, const Po return ret; } - g_dispatcher().addWalkEvent([=] { - g_game().map.moveCreature(creature, toTile, !pushMove); - }); + map.moveCreature(creature, toTile, !pushMove); return RETURNVALUE_NOERROR; } else if (const auto &item = thing->getItem()) { diff --git a/src/game/movement/teleport.cpp b/src/game/movement/teleport.cpp index 935ec443617..368bcf6e476 100644 --- a/src/game/movement/teleport.cpp +++ b/src/game/movement/teleport.cpp @@ -93,11 +93,11 @@ void Teleport::addThing(int32_t, const std::shared_ptr &thing) { g_game().internalCreatureTurn(creature, origPos.x > destPos.x ? DIRECTION_WEST : DIRECTION_EAST); g_dispatcher().addWalkEvent([=] { g_game().map.moveCreature(creature, destTile); + if (effect != CONST_ME_NONE) { + g_game().addMagicEffect(origPos, effect); + g_game().addMagicEffect(destTile->getPosition(), effect); + } }); - if (effect != CONST_ME_NONE) { - g_game().addMagicEffect(origPos, effect); - g_game().addMagicEffect(destTile->getPosition(), effect); - } } else if (const auto &item = thing->getItem()) { if (effect != CONST_ME_NONE) { g_game().addMagicEffect(destTile->getPosition(), effect); diff --git a/src/map/map.cpp b/src/map/map.cpp index 768ba959dce..12770ad8b34 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -442,6 +442,13 @@ void Map::moveCreature(const std::shared_ptr &creature, const std::sha } else { events(); } + + if (forceTeleport) { + if (const auto &player = creature->getPlayer()) { + player->sendMagicEffect(oldPos, CONST_ME_TELEPORT); + player->sendMagicEffect(newPos, CONST_ME_TELEPORT); + } + } } bool Map::canThrowObjectTo(const Position &fromPos, const Position &toPos, const SightLines_t lineOfSight /*= SightLine_CheckSightLine*/, const int32_t rangex /*= Map::maxClientViewportX*/, const int32_t rangey /*= Map::maxClientViewportY*/) { From 030f3c368ee0db92616fc5a25f6abcd5cc2273cd Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Sat, 9 Nov 2024 19:36:40 -0300 Subject: [PATCH 15/17] feat: add new "soul cores" market category (#3092) New category from 13.40 Uses with: https://github.com/Arch-Mina/Assets-Editor/pull/36 --- src/items/items_definitions.hpp | 53 +++++++++++++++++---------------- src/protobuf/appearances.proto | 1 + 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/items/items_definitions.hpp b/src/items/items_definitions.hpp index 19d7f30b942..9b6990c0cb7 100644 --- a/src/items/items_definitions.hpp +++ b/src/items/items_definitions.hpp @@ -140,34 +140,35 @@ enum ItemGroup_t { enum ItemTypes_t { ITEM_TYPE_NONE, - // Odered to make the cast from protobuf::itemCategory to ItemTypes_t easier. + // Ordered to make the cast from protobuf::itemCategory to ItemTypes_t easier. // Do not edit it from Start-End // Start - ITEM_TYPE_ARMOR, - ITEM_TYPE_AMULET, - ITEM_TYPE_BOOTS, - ITEM_TYPE_CONTAINER, - ITEM_TYPE_DECORATION, - ITEM_TYPE_FOOD, - ITEM_TYPE_HELMET, - ITEM_TYPE_LEGS, - ITEM_TYPE_OTHER, - ITEM_TYPE_POTION, - ITEM_TYPE_RING, - ITEM_TYPE_RUNE, - ITEM_TYPE_SHIELD, - ITEM_TYPE_TOOLS, - ITEM_TYPE_VALUABLE, - ITEM_TYPE_AMMO, - ITEM_TYPE_AXE, - ITEM_TYPE_CLUB, - ITEM_TYPE_DISTANCE, - ITEM_TYPE_SWORD, - ITEM_TYPE_WAND, - ITEM_TYPE_PREMIUMSCROLL, - ITEM_TYPE_TIBIACOIN, - ITEM_TYPE_CREATUREPRODUCT, - ITEM_TYPE_QUIVER, + ITEM_TYPE_ARMOR = 1, + ITEM_TYPE_AMULET = 2, + ITEM_TYPE_BOOTS = 3, + ITEM_TYPE_CONTAINER = 4, + ITEM_TYPE_DECORATION = 5, + ITEM_TYPE_FOOD = 6, + ITEM_TYPE_HELMET = 7, + ITEM_TYPE_LEGS = 8, + ITEM_TYPE_OTHER = 9, + ITEM_TYPE_POTION = 10, + ITEM_TYPE_RING = 11, + ITEM_TYPE_RUNE = 12, + ITEM_TYPE_SHIELD = 13, + ITEM_TYPE_TOOLS = 14, + ITEM_TYPE_VALUABLE = 15, + ITEM_TYPE_AMMO = 16, + ITEM_TYPE_AXE = 17, + ITEM_TYPE_CLUB = 18, + ITEM_TYPE_DISTANCE = 19, + ITEM_TYPE_SWORD = 20, + ITEM_TYPE_WAND = 21, + ITEM_TYPE_PREMIUMSCROLL = 22, + ITEM_TYPE_TIBIACOIN = 23, + ITEM_TYPE_CREATUREPRODUCT = 24, + ITEM_TYPE_QUIVER = 25, + ITEM_TYPE_SOULCORES = 26, // End ITEM_TYPE_DEPOT, diff --git a/src/protobuf/appearances.proto b/src/protobuf/appearances.proto index ed924febfc4..1ca8defac0c 100644 --- a/src/protobuf/appearances.proto +++ b/src/protobuf/appearances.proto @@ -42,6 +42,7 @@ enum ITEM_CATEGORY { ITEM_CATEGORY_TIBIA_COINS = 23; ITEM_CATEGORY_CREATURE_PRODUCTS = 24; ITEM_CATEGORY_QUIVER = 25; + ITEM_CATEGORY_SOULCORES = 26; } enum PLAYER_PROFESSION { From 4367cd13abe430de72fdf0c075921a27368d311f Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Sat, 9 Nov 2024 19:52:12 -0300 Subject: [PATCH 16/17] improve: fix circular dependencies on iologindata.hpp (#3093) --- src/creatures/players/player.cpp | 5 +++-- src/creatures/players/vip/player_vip.cpp | 1 + src/game/scheduling/save_manager.cpp | 1 + src/io/functions/iologindata_load_player.cpp | 3 +++ src/io/functions/iologindata_load_player.hpp | 4 ++++ src/io/functions/iologindata_save_player.cpp | 1 + src/io/functions/iologindata_save_player.hpp | 1 + src/io/iologindata.cpp | 3 +++ src/io/iologindata.hpp | 11 +++++++---- src/io/iomarket.cpp | 1 + src/items/bed.cpp | 1 + .../functions/creatures/player/player_functions.cpp | 1 + src/lua/functions/map/house_functions.cpp | 1 + src/map/house/house.cpp | 1 + src/server/network/protocol/protocolgame.cpp | 1 + 15 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index fcf83ccdecb..0b54f3f0bac 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -9,6 +9,7 @@ #include "creatures/players/player.hpp" +#include "account/account.hpp" #include "config/configmanager.hpp" #include "core.hpp" #include "creatures/appearance/mounts/mounts.hpp" @@ -1773,8 +1774,8 @@ std::shared_ptr Player::getDepotLocker(uint32_t depotId) { depotLocker->internalAddThing(marketItem); depotLocker->internalAddThing(inbox); if (createSupplyStash) { - const auto &supplyStash = Item::CreateItem(ITEM_SUPPLY_STASH); - depotLocker->internalAddThing(supplyStash); + const auto &supplyStashPtr = Item::CreateItem(ITEM_SUPPLY_STASH); + depotLocker->internalAddThing(supplyStashPtr); } const auto &depotChest = Item::CreateItemAsContainer(ITEM_DEPOT, static_cast(g_configManager().getNumber(DEPOT_BOXES))); for (uint32_t i = g_configManager().getNumber(DEPOT_BOXES); i > 0; i--) { diff --git a/src/creatures/players/vip/player_vip.cpp b/src/creatures/players/vip/player_vip.cpp index 195480ca5fd..8a64aebcf85 100644 --- a/src/creatures/players/vip/player_vip.cpp +++ b/src/creatures/players/vip/player_vip.cpp @@ -9,6 +9,7 @@ #include "creatures/players/vip/player_vip.hpp" +#include "account/account.hpp" #include "creatures/players/grouping/groups.hpp" #include "creatures/players/player.hpp" #include "io/iologindata.hpp" diff --git a/src/game/scheduling/save_manager.cpp b/src/game/scheduling/save_manager.cpp index 9cccc4052a7..45cd9392194 100644 --- a/src/game/scheduling/save_manager.cpp +++ b/src/game/scheduling/save_manager.cpp @@ -16,6 +16,7 @@ #include "io/iologindata.hpp" #include "kv/kv.hpp" #include "lib/di/container.hpp" +#include "creatures/players/player.hpp" SaveManager::SaveManager(ThreadPool &threadPool, KVStore &kvStore, Logger &logger, Game &game) : threadPool(threadPool), kv(kvStore), logger(logger), game(game) { } diff --git a/src/io/functions/iologindata_load_player.cpp b/src/io/functions/iologindata_load_player.cpp index 477572dfbc8..7cb08a7b9a6 100644 --- a/src/io/functions/iologindata_load_player.cpp +++ b/src/io/functions/iologindata_load_player.cpp @@ -9,8 +9,10 @@ #include "io/functions/iologindata_load_player.hpp" +#include "account/account.hpp" #include "config/configmanager.hpp" #include "creatures/combat/condition.hpp" +#include "database/database.hpp" #include "creatures/monsters/monsters.hpp" #include "creatures/players/achievement/player_achievement.hpp" #include "creatures/players/cyclopedia/player_badge.hpp" @@ -29,6 +31,7 @@ #include "items/containers/inbox/inbox.hpp" #include "items/containers/rewards/reward.hpp" #include "items/containers/rewards/rewardchest.hpp" +#include "creatures/players/player.hpp" #include "utils/tools.hpp" void IOLoginDataLoad::loadItems(ItemsMap &itemsMap, const DBResult_ptr &result, const std::shared_ptr &player) { diff --git a/src/io/functions/iologindata_load_player.hpp b/src/io/functions/iologindata_load_player.hpp index 2d1a4305cf3..ca05bdcb1b8 100644 --- a/src/io/functions/iologindata_load_player.hpp +++ b/src/io/functions/iologindata_load_player.hpp @@ -11,6 +11,10 @@ #include "io/iologindata.hpp" +class Player; +class DBResult; +using DBResult_ptr = std::shared_ptr; + class IOLoginDataLoad : public IOLoginData { public: static bool loadPlayerBasicInfo(const std::shared_ptr &player, const DBResult_ptr &result); diff --git a/src/io/functions/iologindata_save_player.cpp b/src/io/functions/iologindata_save_player.cpp index b38e6e2b84c..613fdac1cb0 100644 --- a/src/io/functions/iologindata_save_player.cpp +++ b/src/io/functions/iologindata_save_player.cpp @@ -17,6 +17,7 @@ #include "items/containers/depot/depotchest.hpp" #include "items/containers/inbox/inbox.hpp" #include "items/containers/rewards/reward.hpp" +#include "creatures/players/player.hpp" bool IOLoginDataSave::saveItems(const std::shared_ptr &player, const ItemBlockList &itemList, DBInsert &query_insert, PropWriteStream &propWriteStream) { if (!player) { diff --git a/src/io/functions/iologindata_save_player.hpp b/src/io/functions/iologindata_save_player.hpp index abafc2c186a..1f871a3b5db 100644 --- a/src/io/functions/iologindata_save_player.hpp +++ b/src/io/functions/iologindata_save_player.hpp @@ -12,6 +12,7 @@ #include "io/iologindata.hpp" class PropWriteStream; +class DBInsert; class IOLoginDataSave : public IOLoginData { public: diff --git a/src/io/iologindata.cpp b/src/io/iologindata.cpp index 0249d70a517..c0a6a13f363 100644 --- a/src/io/iologindata.cpp +++ b/src/io/iologindata.cpp @@ -9,12 +9,15 @@ #include "io/iologindata.hpp" +#include "account/account.hpp" #include "config/configmanager.hpp" +#include "database/database.hpp" #include "io/functions/iologindata_load_player.hpp" #include "io/functions/iologindata_save_player.hpp" #include "game/game.hpp" #include "creatures/monsters/monster.hpp" #include "creatures/players/wheel/player_wheel.hpp" +#include "creatures/players/player.hpp" #include "lib/metrics/metrics.hpp" #include "enums/account_type.hpp" #include "enums/account_errors.hpp" diff --git a/src/io/iologindata.hpp b/src/io/iologindata.hpp index 29eac0c812f..d379031cd55 100644 --- a/src/io/iologindata.hpp +++ b/src/io/iologindata.hpp @@ -9,9 +9,12 @@ #pragma once -#include "account/account.hpp" -#include "creatures/players/player.hpp" -#include "database/database.hpp" +class Player; +class Item; +class DBResult; + +struct VIPEntry; +struct VIPGroupEntry; using ItemBlockList = std::list>>; @@ -21,7 +24,7 @@ class IOLoginData { static uint8_t getAccountType(uint32_t accountId); static bool loadPlayerById(const std::shared_ptr &player, uint32_t id, bool disableIrrelevantInfo = true); static bool loadPlayerByName(const std::shared_ptr &player, const std::string &name, bool disableIrrelevantInfo = true); - static bool loadPlayer(const std::shared_ptr &player, const DBResult_ptr &result, bool disableIrrelevantInfo = false); + static bool loadPlayer(const std::shared_ptr &player, const std::shared_ptr &result, bool disableIrrelevantInfo = false); static bool savePlayer(const std::shared_ptr &player); static uint32_t getGuidByName(const std::string &name); static bool getGuidByNameEx(uint32_t &guid, bool &specialVip, std::string &name); diff --git a/src/io/iomarket.cpp b/src/io/iomarket.cpp index 3332ffab1c3..ff2f9595d46 100644 --- a/src/io/iomarket.cpp +++ b/src/io/iomarket.cpp @@ -16,6 +16,7 @@ #include "game/scheduling/save_manager.hpp" #include "io/iologindata.hpp" #include "items/containers/inbox/inbox.hpp" +#include "creatures/players/player.hpp" uint8_t IOMarket::getTierFromDatabaseTable(const std::string &string) { auto tier = static_cast(std::atoi(string.c_str())); diff --git a/src/items/bed.cpp b/src/items/bed.cpp index 25e95318e74..527f052e2d0 100644 --- a/src/items/bed.cpp +++ b/src/items/bed.cpp @@ -16,6 +16,7 @@ #include "game/scheduling/save_manager.hpp" #include "io/iologindata.hpp" #include "server/network/protocol/protocolgame.hpp" +#include "creatures/players/player.hpp" BedItem::BedItem(uint16_t id) : Item(id) { diff --git a/src/lua/functions/creatures/player/player_functions.cpp b/src/lua/functions/creatures/player/player_functions.cpp index c4c2faa8cee..7ef2be62ca4 100644 --- a/src/lua/functions/creatures/player/player_functions.cpp +++ b/src/lua/functions/creatures/player/player_functions.cpp @@ -9,6 +9,7 @@ #include "lua/functions/creatures/player/player_functions.hpp" +#include "account/account.hpp" #include "creatures/appearance/mounts/mounts.hpp" #include "creatures/combat/spells.hpp" #include "creatures/creature.hpp" diff --git a/src/lua/functions/map/house_functions.cpp b/src/lua/functions/map/house_functions.cpp index 708b9233a3a..52ca752587b 100644 --- a/src/lua/functions/map/house_functions.cpp +++ b/src/lua/functions/map/house_functions.cpp @@ -15,6 +15,7 @@ #include "game/movement/position.hpp" #include "io/iologindata.hpp" #include "map/house/house.hpp" +#include "creatures/players/player.hpp" int HouseFunctions::luaHouseCreate(lua_State* L) { // House(id) diff --git a/src/map/house/house.cpp b/src/map/house/house.cpp index 334144cfbd1..f519e9a46c8 100644 --- a/src/map/house/house.cpp +++ b/src/map/house/house.cpp @@ -18,6 +18,7 @@ #include "items/containers/inbox/inbox.hpp" #include "lib/metrics/metrics.hpp" #include "utils/pugicast.hpp" +#include "creatures/players/player.hpp" House::House(uint32_t houseId) : id(houseId) { } diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index abb2316905d..15b435087bd 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -9,6 +9,7 @@ #include "server/network/protocol/protocolgame.hpp" +#include "account/account.hpp" #include "config/configmanager.hpp" #include "core.hpp" #include "creatures/appearance/mounts/mounts.hpp" From d13c4453994336e24bdb20e6ea4a5873a088af9f Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Sat, 9 Nov 2024 20:01:38 -0300 Subject: [PATCH 17/17] improve: fix circular dependencies on weapons.hpp (#3094) --- src/creatures/combat/combat.cpp | 1 + src/items/weapons/weapons.cpp | 2 +- src/items/weapons/weapons.hpp | 1 - src/lua/functions/core/game/game_functions.cpp | 1 + src/lua/functions/core/game/global_functions.cpp | 1 + src/lua/functions/creatures/combat/combat_functions.cpp | 1 + 6 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index a63f42093db..6dcd0f229b3 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -27,6 +27,7 @@ #include "lua/callbacks/events_callbacks.hpp" #include "lua/creature/events.hpp" #include "map/spectators.hpp" +#include "creatures/players/player.hpp" int32_t Combat::getLevelFormula(const std::shared_ptr &player, const std::shared_ptr &wheelSpell, const CombatDamage &damage) const { if (!player) { diff --git a/src/items/weapons/weapons.cpp b/src/items/weapons/weapons.cpp index 81e59f6a739..f27732f3b59 100644 --- a/src/items/weapons/weapons.cpp +++ b/src/items/weapons/weapons.cpp @@ -13,8 +13,8 @@ #include "creatures/combat/combat.hpp" #include "game/game.hpp" #include "lua/creature/events.hpp" - #include "lua/global/lua_variant.hpp" +#include "creatures/players/player.hpp" Weapons::Weapons() = default; Weapons::~Weapons() = default; diff --git a/src/items/weapons/weapons.hpp b/src/items/weapons/weapons.hpp index bbe15e12a7d..c31813d09e0 100644 --- a/src/items/weapons/weapons.hpp +++ b/src/items/weapons/weapons.hpp @@ -10,7 +10,6 @@ #pragma once #include "lua/scripts/luascript.hpp" -#include "creatures/players/player.hpp" #include "lua/scripts/scripts.hpp" #include "creatures/combat/combat.hpp" #include "utils/utils_definitions.hpp" diff --git a/src/lua/functions/core/game/game_functions.cpp b/src/lua/functions/core/game/game_functions.cpp index f1445b628b6..f1226d2e22c 100644 --- a/src/lua/functions/core/game/game_functions.cpp +++ b/src/lua/functions/core/game/game_functions.cpp @@ -28,6 +28,7 @@ #include "lua/functions/events/event_callback_functions.hpp" #include "lua/scripts/lua_environment.hpp" #include "map/spectators.hpp" +#include "creatures/players/player.hpp" // Game int GameFunctions::luaGameCreateMonsterType(lua_State* L) { diff --git a/src/lua/functions/core/game/global_functions.cpp b/src/lua/functions/core/game/global_functions.cpp index 14d87e5afb2..6befdc5eb67 100644 --- a/src/lua/functions/core/game/global_functions.cpp +++ b/src/lua/functions/core/game/global_functions.cpp @@ -22,6 +22,7 @@ #include "lua/scripts/lua_environment.hpp" #include "lua/scripts/script_environment.hpp" #include "server/network/protocol/protocolstatus.hpp" +#include "creatures/players/player.hpp" void GlobalFunctions::init(lua_State* L) { lua_register(L, "addEvent", GlobalFunctions::luaAddEvent); diff --git a/src/lua/functions/creatures/combat/combat_functions.cpp b/src/lua/functions/creatures/combat/combat_functions.cpp index 27d3a76ef04..e07bce7a7f0 100644 --- a/src/lua/functions/creatures/combat/combat_functions.cpp +++ b/src/lua/functions/creatures/combat/combat_functions.cpp @@ -14,6 +14,7 @@ #include "game/game.hpp" #include "lua/global/lua_variant.hpp" #include "lua/scripts/lua_environment.hpp" +#include "creatures/players/player.hpp" int CombatFunctions::luaCombatCreate(lua_State* L) { // Combat()