Skip to content

Commit

Permalink
chore: remove unused custom script
Browse files Browse the repository at this point in the history
Update spawns_npc_by_time.lua

remove
  • Loading branch information
omarcopires committed Feb 20, 2024
1 parent af88e2b commit 0b12048
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 168 deletions.
4 changes: 0 additions & 4 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
50 changes: 0 additions & 50 deletions data-otservbr-global/scripts/globalevents/customs/rain.lua

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 0 additions & 19 deletions data/events/scripts/monster.lua
Original file line number Diff line number Diff line change
@@ -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
25 changes: 0 additions & 25 deletions data/events/scripts/scheduler/example.lua

This file was deleted.

9 changes: 0 additions & 9 deletions data/global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 0 additions & 34 deletions data/libs/functions/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 20 additions & 22 deletions src/config/config_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -46,39 +46,39 @@ enum ConfigKey_t : uint16_t {
DEFAULT_DESPAWNRADIUS,
DEFAULT_DESPAWNRANGE,
DEFAULT_PRIORITY,
DEPOTCHEST,
DEPOT_BOXES,
DEPOTCHEST,
DISABLE_LEGACY_RAIDS,
DISABLE_MONSTER_ARMOR,
DISCORD_SEND_FOOTER,
DISCORD_WEBHOOK_DELAY_MS,
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,
FORGE_MAX_SLIVERS,
FORGE_MIN_SLIVERS,
FORGE_SLIVER_AMOUNT,
FORGE_TIER_LOSS_REDUCTION,
FORGE_TRANSFER_DUST_COST,
FRAG_TIME,
FREE_DEPOT_LIMIT,
FREE_PREMIUM,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -281,16 +284,15 @@ 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,
TRANSCENDANCE_AVATAR_DURATION,
TRANSCENDANCE_CHANCE_FORMULA_A,
TRANSCENDANCE_CHANCE_FORMULA_B,
TRANSCENDANCE_CHANCE_FORMULA_C,
T_CONST,
URL,
USE_ANY_DATAPACK_FOLDER,
VIP_AUTOLOOT_VIP_ONLY,
Expand All @@ -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,
Expand All @@ -315,6 +315,4 @@ enum ConfigKey_t : uint16_t {
WHITE_SKULL_TIME,
WORLD_TYPE,
XP_DISPLAY_MODE,
STOREINBOX_MAXLIMIT,
LOOTPOUCH_MAXLIMIT,
};
2 changes: 0 additions & 2 deletions src/config/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0b12048

Please sign in to comment.