Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __INC_METIN_II_COMMON_SERVERCONFIG_H__
- #define __INC_METIN_II_COMMON_SERVERCONFIG_H__
- #include "service.h"
- // Central place for server custom settings, requires recompilation of both game + db
- enum eServerConfig
- {
- MAP_ALLOW_LIMIT = 64, //@@; max maps a single game core may host (alMaps[] size). Raise as needed (tested up to 128).
- MAX_CLIENT_OUTPUT_BUFFER = 4194304, //@@; bytes of unsent data a client socket may pile up before it is dropped (a client that stops reading otherwise grows this without limit). 0 = no cap. P2P/DB links are exempt
- MAX_CONNECTION_PER_IP = 20, //@@; concurrent connections allowed from one IP. 0 = unlimited
- MAX_ACCEPT_PER_IP_PER_SEC = 10, //@@; new connections one IP may open per second. 0 = unlimited
- MAX_ACCEPT_PER_SEC = 200, //@@; new connections the core accepts per second in total. 0 = unlimited
- CHANNEL_STATUS_CACHE_MS = 1000, //@@; anti-flood: replay the last channel-status reply instead of re-querying the DB if a new request arrives within this window. 0 = always query
- #ifdef ENABLE_SERVERSIDE_SECURITY
- HIT_LIMITER_WARRIOR_MS = 250, //@@; min delay between two hits on the SAME target, warrior. 0 = no limit
- HIT_LIMITER_ASSASSIN_MS = 200, //@@; same, assassin
- HIT_LIMITER_SURA_MS = 250, //@@; same, sura
- HIT_LIMITER_SHAMAN_MS = 250, //@@; same, shaman
- HIT_LIMITER_BOW_MS = 550, //@@; same, while a bow is equipped (overrides the job value) - anti BowHack
- HIT_LIMITER_POLY_MS = 450, //@@; same, while polymorphed (overrides the job value, bow still wins)
- HIT_LIMITER_MAX_DISTANCE_DIFF = 60, //@@; max distance a player may have travelled since their last hit before the next one is refused as teleport/WH. 0 = distance check off
- HIT_LIMITER_TELEPORT_WINDOW_MS = 100, //@@; how long after a hit that distance check stays armed (bow uses HIT_LIMITER_BOW_MS instead)
- HIT_LIMITER_VID_MEMORY_MS = 1000, //@@; how long a hit target is remembered. MUST be >= the largest of the limits above
- HIT_LIMITER_MIN_BLOCKED_TO_LOG = 3500, //@@; blocked hits in one session before the player is written to hack_log on logout. 0 = never log
- #endif
- #ifdef ENABLE_MAINTENANCE_SYSTEM
- SERVER_JOIN_LIMIT = 1, //@@; maintenance login gate: 0 = players may log in for the whole countdown (refused only once maintenance actually starts), 1 = also refused during the last SERVER_JOIN_LIMIT_MINUTES minutes
- SERVER_JOIN_LIMIT_MINUTES = 5, //@@; only used when SERVER_JOIN_LIMIT = 1 --- time in minutes before ment. when player can't join anymore
- #endif
- #ifdef ENABLE_MULTI_FARMBLOCK
- FARMBLOCK_MAX_ACCOUNTS = 2, //@@; how many characters from one machine may collect loot at the same time. 0 = nobody
- FARMBLOCK_WARN_COOLDOWN_MS = 30000, //@@; min delay between two "your drop is disabled" popups. Fishing and mining always warn ; this throttles the one fired by hitting a monster. 0 = warn every time (30000 ms = 30 sec)
- FARMBLOCK_CMD_COOLDOWN_MS = 5000, //@@; min delay between two /multifarm toggles from one character. Each accepted toggle pushes a roster to every descriptor on the machine and broadcasts it to every core. 0 = no limit (5000 ms = 5 sec)
- #endif
- #ifdef ENABLE_TARGET_INFO
- TARGET_INFO_COOLDOWN_MS = 1000, //@@; min delay between two target-info requests from the same player. The reply walks every drop table of that mob, so this is what keeps the "?" button from being a free CPU tap. 0 = no limit
- #endif
- #ifdef ENABLE_REGEN_RT
- REGEN_RT_REFRESH = 0, //@@; the scheduled time arrives and the boss is still alive: 0 = leave it (never yanks a boss out of a fight, never two at once), 1 = despawn it and respawn at full HP
- REGEN_RT_SPAWN_AT_BOOT = 1, //@@; 1 = spawn every entry when the core boots, so a restart does not leave a fixed hour boss missing until its next hour. 0 = wait for the schedule
- #endif
- };
- // Gameplay rules: party, skills, guild founding, death and shop penalties
- enum eGamePlaySettings
- {
- MAX_LEVEL = 99, //@@; player level cap (default for gPlayerMaxLevel; the CONFIG token "max_level" still overrides it at runtime). Hard ceiling is 120 - exp_table/aiExpLossPercents are sized PLAYER_EXP_TABLE_MAX+1, raising past that needs new table rows
- MAX_STAT_POINTS = 90, //@@; max points a player may put into ONE stat (st/ht/dx/iq) via /stat
- STAT_POINT_MAX_LEVEL = 90, //@@; last level that still grants stat points (3 per level); levels above it give none. Total granted = STAT_POINT_MAX_LEVEL * 3
- BOX_USE_LIMIT_MS = 0, //@@; min delay between opening two boxes (ITEM_GIFTBOX)
- BUYSELL_LIMIT_MS = 0, //@@; min delay between two NPC shop buy/sell actions
- SKILL_RESET_COOLDOWN_ON_DEATH = 0, //@@; 1 = dying clears every skill cooldown (PvP balance change: a death hands the burst straight back). The server also tells the client, so the two never disagree
- #ifdef ENABLE_TASKBAR_ANTIEXP
- ANTI_EXP_LIMIT_MS = 8000, //@@; min delay between two /anti_exp toggles. Keep it below the client's own 10s cooldown so the client gate is the one players hit and this only catches a patched client. 0 = no server-side limit
- #endif
- NO_DROP_METIN_STONE = 0, //@@; 1 = mobs never roll a metin stone drop
- NO_MOUNT_AT_GUILD_WAR = 1, //@@; 1 = cannot mount on a guild-war map, and entering one dismounts you
- AURA_REQUIRES_WEAPON = 1, //@@; 1 = Sword Aura / Blade end when no weapon is worn (stock), 0 = they stay active with the weapon off
- KEEP_SKILL_AT_WARP = 1, //@@; requires AURA_REQUIRES_WEAPON = 1. 0 = stock, any weapon-slot clear ends the aura (SetWear). 1 = only a manual unequip ends it (CanUnequipNow); systemic weapon changes (e.g. a warp) leave it running
- PARTY_MAX_MEMBER_COUNT = 8, //@@; players allowed in one party. The party exp bonus table still caps at 8 members, extra members give no further bonus
- PARTY_KILL_RENEWAL = 1, //@@; 1 = a mob kill fires the quest party_kill event on every NEARBY party member in their own context. 0 = stock, only the party leader gets it. Changes what existing party-kill quest counters do
- INFINITE_ARROWS = 0, //@@; 1 = arrows are never consumed (one equipped arrow lasts forever)
- SKILL_MASTER_AT_17 = 1, //@@; 1 = a normal skill turns master (M1) the moment it reaches 17, 0 = stock random roll between 17 and 20. Does not touch the master->grand master (30) or grand master->perfect (40) rolls
- SKILL_BOOK_EXP_COST = 20000, //@@; exp a skill book needs to be read (and spends on the grand master path). 0 = books are free, no exp needed and none taken. DEFUALT 20k
- RESTART_HP_FULL = 1, //@@; 1 = respawning ("Restart here" / "Restart in town") gives full HP, 0 = stock 50 HP. Does not touch SP; the guild-war and threeway-war respawn paths already restore both
- DEAD_AUTO_REVIVE_SEC = 180, //@@; seconds a dead player waits before the server revives them in town by itself (dead_event). Also the base the two waits below are measured from
- RESTART_HERE_WAIT_SEC = 10, //@@; seconds before "Restart here" is accepted. Not applied on a test server or on a non-flag guild war map (respawn is instant there)
- RESTART_TOWN_WAIT_SEC = 7, //@@; seconds before "Restart in town" is accepted
- #ifdef ENABLE_RESTART_DIALOG_TIMER
- RESTART_DIALOG_TIMER = 1, //@@; 1 = send the three waits to the client so the restart dialog can grey the buttons and count down. 0 = send zeros, the dialog behaves like stock. Turning it off needs no client rebuild, the packet size is the same either way
- #endif
- WEAPON_DAMAGE_FIXED = 0, //@@; removes the random roll between a weapon's min and max damage. 0 = stock random, 1 = always min (Value 3), 2 = always max (Value 4), 3 = always the average. Applies to melee, bow and skill damage (magic weapons use Value 1/2 for skills). Everything else (attack rating, crit, defense) still varies
- METIN_SOCKET_SUCCESS_PCT = 30, //@@; chance a metin stone attaches instead of breaking. 100 = never breaks
- GUILD_CREATE_PRICE = 200000, //@@; yang taken when a guild is founded (also the amount checked before founding)
- GUILD_CREATE_MIN_LEVEL = 40, //@@; min level to found a guild. 0 = no level requirement
- GUILD_WAR_AUTO_JOIN_MASTER = 1, //@@; 1 = the guild master is warped straight into a guild war instead of being sent the guild_war_join letter. Ordinary members still get the letter
- DISPEL_KEEPS_SPEED_BUFFS = 1, //@@; 1 = the dispel skill (Risipa) no longer strips movement/attack-speed potion buffs. Only that skill is affected - arena entry, GM duels and quests still strip everything
- IGNORE_LOWER_BUFFS = 1, //@@; 1 = casting one of the Sura self-buffs (Hosin/Reflect/Gicheon/Jeongeop/Kwaesok/Jeungryeok) is refused while a stronger one of the same skill is already active, so it can no longer be downgraded by a weaker recast. 0 = stock, always overwrites
- EMPIRE_SHOP_PRICE_PENALTY = 1, //@@; 1 = other-empire NPC shops charge x3 (stock), 0 = same price for everyone
- EMPIRE_DAMAGE_PENALTY = 1, //@@; 1 = stock, a PC deals 10% less damage (7-9% on some maps/locales) while fighting on another empire map. 0 = no penalty, damage is the same everywhere
- MAX_ALIGN_POINTS = 200000, //@@; INTERNAL alignment clamp. The client is sent value/10, so 200000 here = the 20000 you see in game. Death-drop tiers are internal too (120000 = 12000 shown)
- NO_EXP_LOSS_ON_DEATH = 1, //@@; 1 = players never lose experience on death (the Blessing of the Dragon God affect is also left unconsumed), 0 = stock death penalty
- ALLOW_BUFF_REMOVE = 1, //@@; 1 = /remove_buff works, letting a player drop one of their own buff skills. Only skills that produce a buff icon are accepted; poison/stun/slow, chat blocks and premium/mall affects can never be removed. 0 = the command does nothing. Pairs with constinfo.ENABLE_AFFECT_BUFF_REMOVE, which controls the click + tooltip hint client-side
- ALLOW_POLYMORPH_REMOVE = 1, //@@; 1 = /remove_polymorph works, cancelling the player's own polymorph early -- must be same value as constinfo.py
- STOP_RIDING_WHEN_DIE = 1, //@@; 1 = dying dismounts you (stock: StopRiding / clears mount affect+bonus), 0 = keep the horse/mount after death
- NO_DSS_QUALIFICATION = 1, //@@; 1 = every player is treated as Dragon Soul qualified (bypasses the AFFECT_DRAGON_SOUL_QUALIFIED requirement), 0 = stock qualification check
- AUTO_POTION_USE_NEXT = 1, //@@; 1 = when an auto-potion runs out the next one of the same kind (HP or SP) is activated automatically. 0 = stock, the affect just ends
- REFINE_PICKAXE_KEEP_ON_FAIL = 1, //@@; 1 = a failed pickaxe refine keeps the pickaxe and only takes REFINE_TOOL_FAIL_EXP_PENALTY_PCT off its stored exp. 0 = stock, it is replaced by its fail vnum (Value 4)
- REFINE_FISHINGROD_KEEP_ON_FAIL = 1, //@@; same as REFINE_PICKAXE_KEEP_ON_FAIL, for fishing rods
- REFINE_TOOL_FAIL_EXP_PENALTY_PCT = 10, //@@; percent of stored exp a failed refine takes off, used by the two settings above. A refine needs full exp again, so this is what you re-grind
- MAX_STACK_SIZE = 20000, //@@; max items in one stack. MAX 65535
- REMOVE_GOLD_LIMIT = 1, //@@; 1 = raised gold cap (uses constexpr MAX_GOLD below), 0 = classic 2000000000
- };
- constexpr long long MAX_GOLD = REMOVE_GOLD_LIMIT ? 9000000000000LL : 2000000000LL;
- // Ground items: how long a drop lives, who may take it, how far you may reach
- enum eItemDrop
- {
- ITEM_DROP_FLOOR_TIME_USER = 30, //@@; how long an item a player dropped by hand stays on the ground
- ITEM_DROP_FLOOR_TIME_MOB = 60, //@@; how long an item/gold dropped by a mob or metin stays on the ground
- ITEM_DROP_OWNERSHIP_TIME = 40, //@@; how long a mob drop stays reserved to its killer's name
- PICKUP_RANGE_MAX = 300, //@@; pickup rangeon foot
- PICKUP_RANGE_MOUNT_MAX = 500, //@@; pick up range while riding
- PICKUP_RANGE_TOLERANCE = 150, //@@; slack added to both, covers client/server position drift
- ALIGN_DROP_PENALTY = 1, //@@; 1 = dying drops items per the alignment table (stock), 0 = never drop items on death
- ITEM_DROP_LIMIT_MS = 0, //@@; min delay between dropping two items on the ground
- };
- // OX event settings. The map indexes they act on are still hardcoded at the call
- // sites: OX = 113, wedding = 81, guild war = 110/111
- enum eOxSettings
- {
- OX_BLOCK_CHAT = 1, //@@; 1 = players cannot use normal chat on the OX map (GMs unaffected)
- OX_BLOCK_WHISPER = 1, //@@; 1 = players cannot send whispers on the OX map (GMs unaffected)
- OX_BLOCK_ITEM_DROP = 1, //@@; 1 = players cannot drop items on the OX map (GMs unaffected)
- OX_BLOCK_PET = 1, //@@; 1 = pets are not summoned on the OX and wedding maps
- OX_BLOCK_HORSE = 1, //@@; 1 = horses cannot be summoned on the OX and wedding maps
- OX_BLOCK_MOUNT = 1, //@@; 1 = mounts are dismissed on the OX, wedding and guild-war maps
- OX_HIDE_PLAYERS = 1, //@@; 1 = players do not see each other on the OX map (GMs still see everyone)
- OX_BLOCK_SKILL = 1, //@@; 1 = skills cannot be used on the OX map
- OX_MAX_ACCOUNTS_PER_IP = 1, //@@; how many players from one IP may join the OX event. 0 = unlimited, 1 = one account per IP, 2 = two, etc
- };
- #ifdef ENABLE_OPTION_UNSTUCK
- enum eUnstuck
- {
- UNSTUCK_COOLDOWN_SEC = 60, //@@; wait between two successful unstucks. Being told "you are not stuck" costs nothing. GMs bypass it
- UNSTUCK_RANGE = 300, //@@; how far the free tile may be, in cm (300 = 3m). 0 = anywhere on the map. No free tile found = warp to the empire town
- UNSTUCK_COMBAT_BLOCK_MS = 10000, //@@; refuse this long after the player last ATTACKED (that is what GetLastAttackTime measures - not being hit). 0 = no combat check
- UNSTUCK_BLOCK_IN_DUNGEON = 1, //@@; 1 = refuse on private maps (index >= 10000). Set 0 and unstuck there warps to town, since dungeons have no map region to pick a tile from
- };
- #endif
- #endif /* __INC_METIN_II_COMMON_SERVERCONFIG_H__ */
Advertisement
Add Comment
Please, Sign In to add comment