diff --git a/config.lua.dist b/config.lua.dist index f446679911c..3ba98113b19 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -224,8 +224,6 @@ tibiadromeConcoctionTickType = "online" -- "online" | "experience" onlyPremiumAccount = false -- Customs --- NOTE: weatherRain = true, activates weather raining effects --- NOTE: thunderEffect = true, activates thunder effects -- NOTE: stashMoving = true, stow an container inside your stash -- NOTE: depotChest, the non-stackable items will be moved to the selected depot chest(I - XVIII). -- NOTE: autoBank = true, the dropped coins from monsters will be automatically deposited to your bank account. @@ -239,8 +237,6 @@ onlyPremiumAccount = false -- NOTE: toggleReceiveReward = true, will enable players to choose one of reward exercise weapon by command !reward -- NOTE: randomMonsterSpawn = true, will enable monsters from the same spawn to be randomized between them, thus making a variable hunt -- NOTE: enablePlayerPutItemInAmmoSlot = true, will enable players to put any items on ammo slot, more used in custom shopping system -weatherRain = false -thunderEffect = false stashMoving = false depotChest = 4 autoLoot = false diff --git a/data-otservbr-global/scripts/globalevents/customs/rain.lua b/data-otservbr-global/scripts/globalevents/customs/rain.lua deleted file mode 100644 index f2520d880ee..00000000000 --- a/data-otservbr-global/scripts/globalevents/customs/rain.lua +++ /dev/null @@ -1,50 +0,0 @@ -if configManager.getBoolean(configKeys.WEATHER_RAIN) then - local weatherStartup = GlobalEvent("WeatherStartup") - - function weatherStartup.onStartup() - local rain = math.random(100) - if rain > 95 then - Game.setStorageValue("Weather", 1) - else - Game.setStorageValue("Weather", 0) - end - return true - end - - weatherStartup:register() - - local weather = GlobalEvent("Weather") - - function weather.onThink(interval, lastExecution) - local rain = math.random(100) - if rain > 95 then - Game.setStorageValue("Weather", 1) - else - Game.setStorageValue("Weather", 0) - end - return true - end - - weather:interval(200000) -- how often to randomize rain / weather - weather:register() - - local weatherRain = GlobalEvent("WeatherRain") - - function weatherRain.onThink(interval, lastExecution) - if Game.getStorageValue("Weather") == 1 then - local players = Game.getPlayers() - if #players == 0 then - return true - end - local player - for i = 1, #players do - player = players[i] - player:sendWeatherEffect(weatherConfig.groundEffect, weatherConfig.fallEffect, weatherConfig.thunderEffect) - end - end - return true - end - - weatherRain:interval(50) -- less rain = greater value - weatherRain:register() -end diff --git a/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua b/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua index 5323f90cc85..4793055f8a0 100644 --- a/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua +++ b/data-otservbr-global/scripts/world_changes/spawns_npc_by_time.lua @@ -12,15 +12,13 @@ function spawnsNpcByTime.onPeriodChange(period) local spawnNpc = Game.createNpc(npcSpawn.name, npcSpawn.position) if spawnNpc then spawnNpc:setMasterPos(npcSpawn.position) - npcSpawn.position:sendMagicEffect(CONST_ME_TELEPORT) - logger.info("[NPC Spawn] {} has spawned", npcSpawn.name) + spawnNpc:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end elseif npcSpawn.despawnPeriod == period then local despawnNpc = Npc(npcSpawn.name) if despawnNpc then despawnNpc:getPosition():sendMagicEffect(CONST_ME_TELEPORT) despawnNpc:remove() - logger.info("[NPC Despawn] {} has despawned", npcSpawn.name) end end end diff --git a/data/events/scripts/monster.lua b/data/events/scripts/monster.lua index ea991672854..e69de29bb2d 100644 --- a/data/events/scripts/monster.lua +++ b/data/events/scripts/monster.lua @@ -1,19 +0,0 @@ -local function calculateBonus(bonus) - local bonusCount = math.floor(bonus / 100) - local remainder = bonus % 100 - if remainder > 0 then - local probability = math.random(0, 100) - bonusCount = bonusCount + (probability < remainder and 1 or 0) - end - - return bonusCount -end - -local function checkItemType(itemId) - local itemType = ItemType(itemId):getType() - -- Based on enum ItemTypes_t - if (itemType > 0 and itemType < 4) or itemType == 7 or itemType == 8 or itemType == 11 or itemType == 13 or (itemType > 15 and itemType < 22) then - return true - end - return false -end diff --git a/data/events/scripts/scheduler/example.lua b/data/events/scripts/scheduler/example.lua deleted file mode 100644 index d095ed1064f..00000000000 --- a/data/events/scripts/scheduler/example.lua +++ /dev/null @@ -1,25 +0,0 @@ --- [OtServerBr] --- Event scheduler lua scripts, on this file is possible to load any kind --- of global values, create functions or create and register GlobalEvents using the revscript system. --- For example you can load a 'local Example = GlobalEvent("example")' and register it with 'Example:register()', --- adding the 'Example.onStartup()' or 'Example.onThink(interval)' with 'Example:interval(time)'. --- With 'onStartup()' you can load any raid, for example loading a entire map/hunt and the choseen spawns. - --- Examples: --- Loading map: Game.loadMap(DATA_DIRECTORY.. '/world/myMapFolder/myMapFile.otbm') --- Loading spawn: addEvent(function() Game.loadSpawnFile(DATA_DIRECTORY.. '/world/mySpawnFolder/mySpawnFile.xml) end, 30 * 1000) - -local Example_One = GlobalEvent("Example one") -function Example_One.onStartup() - return true -end - -Example_One:register() - -local Example_Two = GlobalEvent("Example two") -function Example_Two.onThink(interval) - return true -end - -Example_Two:interval(10000) -- 10 seconds interval -Example_Two:register() diff --git a/data/global.lua b/data/global.lua index 2d5ffc31cf0..1491987ffad 100644 --- a/data/global.lua +++ b/data/global.lua @@ -56,15 +56,6 @@ AUTH_TYPE = configManager.getString(configKeys.AUTH_TYPE) GLOBAL_CHARM_GUT = 120 -- 20% more chance to get creature products from looting GLOBAL_CHARM_SCAVENGE = 125 -- 25% more chance to get creature products from skinning ---WEATHER -weatherConfig = { - groundEffect = CONST_ME_LOSEENERGY, - fallEffect = CONST_ANI_SMALLICE, - thunderEffect = configManager.getBoolean(configKeys.WEATHER_THUNDER), - minDMG = 1, - maxDMG = 5, -} - -- Event Schedule SCHEDULE_LOOT_RATE = 100 SCHEDULE_EXP_RATE = 100 diff --git a/data/libs/functions/player.lua b/data/libs/functions/player.lua index 810b72c0002..2662db60d11 100644 --- a/data/libs/functions/player.lua +++ b/data/libs/functions/player.lua @@ -316,40 +316,6 @@ function Player.getMarriageDescription(thing) return descr end -function Player.sendWeatherEffect(self, groundEffect, fallEffect, thunderEffect) - local position, random = self:getPosition(), math.random - position.x = position.x + random(-7, 7) - position.y = position.y + random(-5, 5) - local fromPosition = Position(position.x + 1, position.y, position.z) - fromPosition.x = position.x - 7 - fromPosition.y = position.y - 5 - local tile, getGround - for Z = 1, 7 do - fromPosition.z = Z - position.z = Z - tile = Tile(position) - if tile then - -- If there is a tile, stop checking floors - fromPosition:sendDistanceEffect(position, fallEffect) - position:sendMagicEffect(groundEffect, self) - getGround = tile:getGround() - if getGround and ItemType(getGround:getId()):getFluidSource() == 1 then - position:sendMagicEffect(CONST_ME_LOSEENERGY, self) - end - break - end - end - if thunderEffect and tile and not tile:hasFlag(TILESTATE_PROTECTIONZONE) then - if random(2) == 1 then - local topCreature = tile:getTopCreature() - if topCreature and topCreature:isPlayer() and topCreature:getAccountType() < ACCOUNT_TYPE_SENIORTUTOR then - position:sendMagicEffect(CONST_ME_BIGCLOUDS, self) - doTargetCombatHealth(0, self, COMBAT_ENERGYDAMAGE, -weatherConfig.minDMG, -weatherConfig.maxDMG, CONST_ME_NONE) - end - end - end -end - function Player:getFamiliarName() local vocation = FAMILIAR_ID[self:getVocation():getBaseId()] local familiarName diff --git a/src/config/config_enums.hpp b/src/config/config_enums.hpp index a6a3d7c24c0..8c21bdfe1ac 100644 --- a/src/config/config_enums.hpp +++ b/src/config/config_enums.hpp @@ -27,9 +27,9 @@ enum ConfigKey_t : uint16_t { BOOSTED_BOSS_KILL_BONUS, BOOSTED_BOSS_LOOT_BONUS, BOOSTED_BOSS_SLOT, - BOSSTIARY_KILL_MULTIPLIER, BOSS_DEFAULT_TIME_TO_DEFEAT, BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN, + BOSSTIARY_KILL_MULTIPLIER, BUY_AOL_COMMAND_FEE, BUY_BLESS_COMMAND_FEE, CHECK_EXPIRED_MARKET_OFFERS_EACH_MINUTES, @@ -46,8 +46,8 @@ enum ConfigKey_t : uint16_t { DEFAULT_DESPAWNRADIUS, DEFAULT_DESPAWNRANGE, DEFAULT_PRIORITY, - DEPOTCHEST, DEPOT_BOXES, + DEPOTCHEST, DISABLE_LEGACY_RAIDS, DISABLE_MONSTER_ARMOR, DISCORD_SEND_FOOTER, @@ -55,23 +55,22 @@ enum ConfigKey_t : uint16_t { DISCORD_WEBHOOK_URL, EMOTE_SPELLS, ENABLE_PLAYER_PUT_ITEM_IN_AMMO_SLOT, - EXPERIENCE_FROM_PLAYERS, - EXP_FROM_PLAYERS_LEVEL_RANGE, EX_ACTIONS_DELAY_INTERVAL, + EXP_FROM_PLAYERS_LEVEL_RANGE, + EXPERIENCE_FROM_PLAYERS, FAMILIAR_TIME, FORCE_MONSTERTYPE_LOAD, FORGE_AMOUNT_MULTIPLIER, FORGE_BASE_SUCCESS_RATE, FORGE_BONUS_SUCCESS_RATE, - FORGE_FUSION_DUST_COST, FORGE_CONVERGENCE_FUSION_DUST_COST, - FORGE_TRANSFER_DUST_COST, FORGE_CONVERGENCE_TRANSFER_DUST_COST, FORGE_CORE_COST, FORGE_COST_ONE_SLIVER, FORGE_FIENDISH_CREATURES_LIMIT, FORGE_FIENDISH_INTERVAL_TIME, FORGE_FIENDISH_INTERVAL_TYPE, + FORGE_FUSION_DUST_COST, FORGE_INFLUENCED_CREATURES_LIMIT, FORGE_MAX_DUST, FORGE_MAX_ITEM_TIER, @@ -79,6 +78,7 @@ enum ConfigKey_t : uint16_t { FORGE_MIN_SLIVERS, FORGE_SLIVER_AMOUNT, FORGE_TIER_LOSS_REDUCTION, + FORGE_TRANSFER_DUST_COST, FRAG_TIME, FREE_DEPOT_LIMIT, FREE_PREMIUM, @@ -117,12 +117,14 @@ enum ConfigKey_t : uint16_t { LOCATION, LOGIN_PORT, LOGLEVEL, + LOOTPOUCH_MAXLIMIT, LOW_LEVEL_BONUS_EXP, LOYALTY_BONUS_PERCENTAGE_MULTIPLIER, LOYALTY_ENABLED, LOYALTY_POINTS_PER_CREATION_DAY, LOYALTY_POINTS_PER_PREMIUM_DAY_PURCHASED, LOYALTY_POINTS_PER_PREMIUM_DAY_SPENT, + M_CONST, MAINTAIN_MODE_MESSAGE, MAP_AUTHOR, MAP_CUSTOM_AUTHOR, @@ -132,16 +134,16 @@ enum ConfigKey_t : uint16_t { MARKET_OFFER_DURATION, MARKET_PREMIUM, MAX_ALLOWED_ON_A_DUMMY, - MAX_CONTAINER, MAX_CONTAINER_ITEM, + MAX_CONTAINER, MAX_DAMAGE_REFLECTION, MAX_ELEMENTAL_RESISTANCE, MAX_MARKET_OFFERS_AT_A_TIME_PER_PLAYER, MAX_MESSAGEBUFFER, MAX_PACKETS_PER_SECOND, - MAX_PLAYERS, MAX_PLAYERS_OUTSIDE_PZ_PER_ACCOUNT, MAX_PLAYERS_PER_ACCOUNT, + MAX_PLAYERS, MAX_SPEED_ATTACKONFIST, METRICS_ENABLE_OSTREAM, METRICS_ENABLE_PROMETHEUS, @@ -159,7 +161,6 @@ enum ConfigKey_t : uint16_t { MYSQL_PASS, MYSQL_SOCK, MYSQL_USER, - M_CONST, OLD_PROTOCOL, ONE_PLAYER_ON_ACCOUNT, ONLY_INVITED_CAN_MOVE_HOUSE_ITEMS, @@ -174,8 +175,8 @@ enum ConfigKey_t : uint16_t { PARALLELISM, PARTY_AUTO_SHARE_EXPERIENCE, PARTY_LIST_MAX_DISTANCE, - PARTY_SHARE_LOOT_BOOSTS, PARTY_SHARE_LOOT_BOOSTS_DIMINISHING_FACTOR, + PARTY_SHARE_LOOT_BOOSTS, PREMIUM_DEPOT_LIMIT, PREY_BONUS_REROLL_PRICE, PREY_BONUS_TIME, @@ -199,13 +200,13 @@ enum ConfigKey_t : uint16_t { RATE_BOSS_HEALTH, RATE_EXERCISE_TRAINING_SPEED, RATE_EXPERIENCE, - RATE_HEALTH_REGEN, RATE_HEALTH_REGEN_SPEED, + RATE_HEALTH_REGEN, RATE_KILLING_IN_THE_NAME_OF_POINTS, RATE_LOOT, RATE_MAGIC, - RATE_MANA_REGEN, RATE_MANA_REGEN_SPEED, + RATE_MANA_REGEN, RATE_MONSTER_ATTACK, RATE_MONSTER_DEFENSE, RATE_MONSTER_HEALTH, @@ -214,8 +215,8 @@ enum ConfigKey_t : uint16_t { RATE_NPC_HEALTH, RATE_OFFLINE_TRAINING_SPEED, RATE_SKILL, - RATE_SOUL_REGEN, RATE_SOUL_REGEN_SPEED, + RATE_SOUL_REGEN, RATE_SPAWN, RATE_SPELL_COOLDOWN, RATE_USE_STAGES, @@ -244,18 +245,20 @@ enum ConfigKey_t : uint16_t { STAIRHOP_DELAY, STAMINA_GREEN_DELAY, STAMINA_ORANGE_DELAY, - STAMINA_PZ, STAMINA_PZ_GAIN, + STAMINA_PZ, STAMINA_SYSTEM, - STAMINA_TRAINER, STAMINA_TRAINER_DELAY, STAMINA_TRAINER_GAIN, + STAMINA_TRAINER, STASH_ITEMS, STASH_MOVING, - STATUSQUERY_TIMEOUT, STATUS_PORT, + STATUSQUERY_TIMEOUT, STORE_COIN_PACKET, STORE_IMAGES_URL, + STOREINBOX_MAXLIMIT, + T_CONST, TASK_HUNTING_BONUS_REROLL_PRICE, TASK_HUNTING_ENABLED, TASK_HUNTING_FREE_REROLL_TIME, @@ -281,8 +284,8 @@ enum ConfigKey_t : uint16_t { TOGGLE_MAP_CUSTOM, TOGGLE_MOUNT_IN_PZ, TOGGLE_RECEIVE_REWARD, - TOGGLE_SAVE_INTERVAL, TOGGLE_SAVE_INTERVAL_CLEAN_MAP, + TOGGLE_SAVE_INTERVAL, TOGGLE_SERVER_IS_RETRO, TOGGLE_TRAVELS_FREE, TOGGLE_WHEELSYSTEM, @@ -290,7 +293,6 @@ enum ConfigKey_t : uint16_t { TRANSCENDANCE_CHANCE_FORMULA_A, TRANSCENDANCE_CHANCE_FORMULA_B, TRANSCENDANCE_CHANCE_FORMULA_C, - T_CONST, URL, USE_ANY_DATAPACK_FOLDER, VIP_AUTOLOOT_VIP_ONLY, @@ -302,8 +304,6 @@ enum ConfigKey_t : uint16_t { VIP_STAY_ONLINE, VIP_SYSTEM_ENABLED, WARN_UNSAFE_SCRIPTS, - WEATHER_RAIN, - WEATHER_THUNDER, WEEK_KILLS_TO_RED, WHEEL_ATELIER_REVEAL_GREATER_COST, WHEEL_ATELIER_REVEAL_LESSER_COST, @@ -315,6 +315,4 @@ enum ConfigKey_t : uint16_t { WHITE_SKULL_TIME, WORLD_TYPE, XP_DISPLAY_MODE, - STOREINBOX_MAXLIMIT, - LOOTPOUCH_MAXLIMIT, }; diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index ec8ee7a4b82..cdb5948637c 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -124,8 +124,6 @@ bool ConfigManager::load() { loadBoolConfig(L, PUSH_WHEN_ATTACKING, "pushWhenAttacking", false); loadIntConfig(L, MIN_DELAY_BETWEEN_CONDITIONS, "minDelayBetweenConditions", 0); - loadBoolConfig(L, WEATHER_RAIN, "weatherRain", false); - loadBoolConfig(L, WEATHER_THUNDER, "thunderEffect", false); loadBoolConfig(L, TOGGLE_FREE_QUEST, "toggleFreeQuest", true); loadBoolConfig(L, AUTOLOOT, "autoLoot", false); loadBoolConfig(L, AUTOBANK, "autoBank", false);