Riizade/config file (#520)
* added POJO + yaml file * made config members public * switched to yaml * modified files to use YamlConfig over ServerConstants * removed constants from ServerConstants * removed unused imports * removed unused import * removed world ini * removed now unused .ini files * fixed docker-launch.sh * added jackson dependency JARs * fixed errors * removed unused server config values, added world defaults * don't use env variables for docker * fixed package imports/specifiers for js files
This commit is contained in:
committed by
Ronan Lana
parent
e169971384
commit
181573dc74
@@ -6,4 +6,4 @@ WORKDIR /mnt
|
||||
COPY ./ ./
|
||||
RUN sh ./posix-compile.sh
|
||||
EXPOSE 8484 7575 7576 7577
|
||||
CMD exec tini -- sh ./docker-launch.sh
|
||||
CMD exec tini -- sh ./posix-launch.sh
|
||||
458
config.yaml
Normal file
458
config.yaml
Normal file
@@ -0,0 +1,458 @@
|
||||
#World Name: (0 "Scania", 1 "Bera", 2 "Broa", 3 "Windia", 4 "Khaini", 5 "Bellocan", 6 "Mardia", 7 "Kradia", 8 "Yellonde", 9 "Demethos", 10 "Galicia", 11 "El Nido", 12 "Zenith", 13 "Arcenia", 14 "Kastia", 15 "Judis", 16 "Plana", 17 "Kalluna", 18 "Stius", 19 "Croa", 20 "Medere")
|
||||
#Flag types: (0 = nothing, 1 = event, 2 = new, 3 = hot)
|
||||
#Recommended to use only up to 15 worlds
|
||||
worlds:
|
||||
#Properties for Scania 0
|
||||
- flag: 0
|
||||
server_message: Welcome to Scania!
|
||||
event_message: Scania!
|
||||
why_am_i_recommended: Welcome to Scania!
|
||||
channels: 3
|
||||
exp_rate: 10
|
||||
meso_rate: 10
|
||||
drop_rate: 10
|
||||
boss_drop_rate: 10 #NOTE: Boss drop rate OVERRIDES common drop rate, for bosses-only.
|
||||
quest_rate: 5 #Multiplier for Exp & Meso gains when completing a quest. Only available when USE_QUEST_RATE is true. Stacks with server Exp & Meso rates.
|
||||
fishing_rate: 10 #Multiplier for success likelihood on meso thrown during fishing.
|
||||
travel_rate: 10 #Means of transportation rides/departs using 1/N of the default time.
|
||||
|
||||
#Properties for Bera 1
|
||||
- flag: 0
|
||||
server_message: Welcome to Bera!
|
||||
event_message: Bera!
|
||||
why_am_i_recommended: Welcome to Bera!
|
||||
channels: 3
|
||||
|
||||
#Properties for Broa 2
|
||||
- flag: 0
|
||||
server_message: Welcome to Broa!
|
||||
event_message: Broa!
|
||||
why_am_i_recommended: Welcome to Broa!
|
||||
channels: 3
|
||||
|
||||
#Properties for Windia 3
|
||||
- flag: 0
|
||||
server_message: Welcome to Windia!
|
||||
event_message: Windia!
|
||||
why_am_i_recommended: Welcome to Windia!
|
||||
channels: 3
|
||||
|
||||
#Properties for Khaini 4
|
||||
- flag: 0
|
||||
server_message: Welcome to Khaini!
|
||||
event_message: Khaini!
|
||||
why_am_i_recommended: Welcome to Khaini!
|
||||
channels: 3
|
||||
|
||||
#Properties for Bellocan 5
|
||||
- flag: 0
|
||||
server_message: Welcome to Bellocan!
|
||||
event_message: Bellocan!
|
||||
why_am_i_recommended: Welcome to Bellocan!
|
||||
channels: 3
|
||||
|
||||
#Properties for Mardia 6
|
||||
- flag: 0
|
||||
server_message: Welcome to Mardia!
|
||||
event_message: Mardia!
|
||||
why_am_i_recommended: Welcome to Mardia!
|
||||
channels: 3
|
||||
|
||||
#Properties for Kradia 7
|
||||
- flag: 0
|
||||
server_message: Welcome to Kradia!
|
||||
event_message: Kradia!
|
||||
why_am_i_recommended: Welcome to Kradia!
|
||||
channels: 3
|
||||
|
||||
#Properties for Yellonde 8
|
||||
- flag: 0
|
||||
server_message: Welcome to Yellonde!
|
||||
event_message: Yellonde!
|
||||
why_am_i_recommended: Welcome to Yellonde!
|
||||
channels: 3
|
||||
|
||||
#Properties for Demethos 9
|
||||
- flag: 0
|
||||
server_message: Welcome to Demethos!
|
||||
event_message: Demethos!
|
||||
why_am_i_recommended: Welcome to Demethos!
|
||||
channels: 3
|
||||
|
||||
#Properties for Galicia 10
|
||||
- flag: 0
|
||||
server_message: Welcome to Galicia!
|
||||
event_message: Galicia!
|
||||
why_am_i_recommended: Welcome to Galicia!
|
||||
channels: 3
|
||||
|
||||
#Properties for El Nido 11
|
||||
- flag: 0
|
||||
server_message: Welcome to El Nido!
|
||||
event_message: El Nido!
|
||||
why_am_i_recommended: Welcome to El Nido!
|
||||
channels: 3
|
||||
|
||||
#Properties for Zenith 12
|
||||
- flag: 0
|
||||
server_message: Welcome to Zenith!
|
||||
event_message: Zenith!
|
||||
why_am_i_recommended: Welcome to Zenith!
|
||||
channels: 3
|
||||
|
||||
#Properties for Arcenia 13
|
||||
- flag: 0
|
||||
server_message: Welcome to Arcenia!
|
||||
event_message: Arcenia!
|
||||
why_am_i_recommended: Welcome to Arcenia!
|
||||
channels: 3
|
||||
|
||||
#Properties for Kastia 14
|
||||
- flag: 0
|
||||
server_message: Welcome to Kastia!
|
||||
event_message: Kastia!
|
||||
why_am_i_recommended: Welcome to Kastia!
|
||||
channels: 3
|
||||
|
||||
#Properties for Judis 15
|
||||
- flag: 0
|
||||
server_message: Welcome to Judis!
|
||||
event_message: Judis!
|
||||
why_am_i_recommended: Welcome to Judis!
|
||||
channels: 3
|
||||
|
||||
#Properties for Plana 16
|
||||
- flag: 0
|
||||
server_message: Welcome to Plana!
|
||||
event_message: Plana!
|
||||
why_am_i_recommended: Welcome to Plana!
|
||||
channels: 3
|
||||
|
||||
#Properties for Kalluna 17
|
||||
- flag: 0
|
||||
server_message: Welcome to Kalluna!
|
||||
event_message: Kalluna!
|
||||
why_am_i_recommended: Welcome to Kalluna!
|
||||
channels: 3
|
||||
|
||||
#Properties for Stius 18
|
||||
- flag: 0
|
||||
server_message: Welcome to Stius!
|
||||
event_message: Stius!
|
||||
why_am_i_recommended: Welcome to Stius!
|
||||
channels: 3
|
||||
|
||||
#Properties for Croa 19
|
||||
- flag: 0
|
||||
server_message: Welcome to Croa!
|
||||
event_message: Croa!
|
||||
why_am_i_recommended: Welcome to Croa!
|
||||
channels: 3
|
||||
|
||||
#Properties for Medere 20
|
||||
- flag: 0
|
||||
server_message: Welcome to Medere!
|
||||
event_message: Medere!
|
||||
why_am_i_recommended: Welcome to Medere!
|
||||
channels: 3
|
||||
|
||||
|
||||
server:
|
||||
#Thread Tracker Configuration
|
||||
USE_THREAD_TRACKER: true #[SEVERE] This deadlock auditing thing will bloat the memory as fast as the time frame one takes to lose track of a raindrop on a tempesting day. Only for debugging purposes.
|
||||
|
||||
#Database Configuration
|
||||
DB_URL: ""
|
||||
DB_USER: ""
|
||||
DB_PASS: ""
|
||||
DB_CONNECTION_POOL: true #Installs a connection pool to hub DB connections. Set false to default.
|
||||
|
||||
#Login Configuration
|
||||
WLDLIST_SIZE: 21 #Max possible worlds on the server.
|
||||
CHANNEL_SIZE: 20 #Max possible channels per world (which is 20, based on the channel list on login phase).
|
||||
CHANNEL_LOAD: 100 #Max players per channel (limit actually used to calculate the World server capacity).
|
||||
CHANNEL_LOCKS: 20 #Total number of structure management locks each channel has.
|
||||
|
||||
RESPAWN_INTERVAL: 10000 #10 seconds, 10000.
|
||||
PURGING_INTERVAL: 300000 #5 minutes, 300000.
|
||||
RANKING_INTERVAL: 3600000 #60 minutes, 3600000.
|
||||
COUPON_INTERVAL: 3600000 #60 minutes, 3600000.
|
||||
UPDATE_INTERVAL: 777 #Dictates the frequency on which the "centralized server time" is updated.
|
||||
|
||||
ENABLE_PIC: false #Pick true/false to enable or disable Pic. Delete character requires PIC available.
|
||||
ENABLE_PIN: false #Pick true/false to enable or disable Pin.
|
||||
|
||||
BYPASS_PIC_EXPIRATION: 20 #Enables PIC bypass, which will remain active for that account by that client machine for N minutes. Set 0 to disable.
|
||||
BYPASS_PIN_EXPIRATION: 15 #Enables PIN bypass, which will remain active for that account by that client machine for N minutes. Set 0 to disable.
|
||||
|
||||
AUTOMATIC_REGISTER: true #Automatically register players when they login with a nonexistent username.
|
||||
BCRYPT_MIGRATION: true #Performs a migration from old SHA-1 and SHA-512 password to bcrypt.
|
||||
COLLECTIVE_CHARSLOT: false #Available character slots are contabilized globally rather than per world server.
|
||||
DETERRED_MULTICLIENT: false #Enables detection of multi-client and suspicious remote IP on the login system.
|
||||
#Besides blocking logging in with several client sessions on the same machine, this also blocks suspicious login attempts for players that tries to login on an account using several diferent remote addresses.
|
||||
|
||||
#Multiclient Coordinator Configuration
|
||||
MAX_ALLOWED_ACCOUNT_HWID: 4 #Allows up to N concurrent HWID's for an account. HWID's remains linked to an account longer the more times it's used to login.
|
||||
MAX_ACCOUNT_LOGIN_ATTEMPT: 15 #After N tries on an account, login on that account gets disabled for a short period.
|
||||
LOGIN_ATTEMPT_DURATION: 120 #Period in seconds the login attempt remains registered on the system.
|
||||
|
||||
#Ip Configuration
|
||||
HOST: 127.0.0.1
|
||||
LOCALSERVER: true
|
||||
GMSERVER: false
|
||||
|
||||
#Other configuration
|
||||
SHUTDOWNHOOK: true
|
||||
|
||||
#Server Flags
|
||||
USE_CUSTOM_KEYSET: true #Enables auto-setup of the HeavenMS's custom keybindings when creating characters.
|
||||
USE_DEBUG: false #Will enable some text prints on the client, oriented for debugging purposes.
|
||||
USE_DEBUG_SHOW_INFO_EQPEXP: false #Prints on the cmd all equip exp gain info.
|
||||
USE_DEBUG_SHOW_RCVD_PACKET: false #Prints on the cmd all received packet ids.
|
||||
USE_DEBUG_SHOW_RCVD_MVLIFE: false #Prints on the cmd all received move life content.
|
||||
USE_DEBUG_SHOW_PACKET: false
|
||||
USE_SUPPLY_RATE_COUPONS: true #Allows rate coupons to be sold through the Cash Shop.
|
||||
USE_IP_VALIDATION: true #Enables IP checking when logging in.
|
||||
|
||||
USE_MAXRANGE: true #Will send and receive packets from all events on a map, rather than those of only view range.
|
||||
USE_MAXRANGE_ECHO_OF_HERO: true
|
||||
USE_MTS: false
|
||||
USE_CPQ: true #Renders the CPQ available or not.
|
||||
USE_AUTOHIDE_GM: false #When enabled, GMs are automatically hidden when joining. Thanks to Steven Deblois (steven1152).
|
||||
USE_BUYBACK_SYSTEM: true #Enables the HeavenMS-builtin buyback system, to be used by dead players when clicking the MTS button.
|
||||
USE_FIXED_RATIO_HPMP_UPDATE: true #Enables the HeavenMS-builtin HPMP update based on the current pool to max pool ratio.
|
||||
USE_FAMILY_SYSTEM: true
|
||||
USE_DUEY: true
|
||||
USE_RANDOMIZE_HPMP_GAIN: true #Enables randomizing on MaxHP/MaxMP gains and INT accounting for the MaxMP gain on level up.
|
||||
USE_STORAGE_ITEM_SORT: true #Enables storage "Arrange Items" feature.
|
||||
USE_ITEM_SORT: true #Enables inventory "Item Sort/Merge" feature.
|
||||
USE_ITEM_SORT_BY_NAME: false #Item sorting based on name rather than id.
|
||||
USE_PARTY_FOR_STARTERS: true #Players level 10 or below can create/invite other players on the given level range.
|
||||
USE_AUTOASSIGN_STARTERS_AP: false #Beginners level 10 or below have their AP autoassigned (they can't choose to levelup a stat). Set true ONLY if the localhost doesn't support AP assigning for beginners level 10 or below.
|
||||
USE_AUTOASSIGN_SECONDARY_CAP: true #Prevents AP autoassign from spending on secondary stats after the player class' cap (defined on the autoassign handler) has been reached.
|
||||
USE_STARTING_AP_4: true #Use early-GMS 4/4/4/4 starting stats. To overcome AP shortage, this gives 4AP/5AP at 1st/2nd job advancements.
|
||||
USE_AUTOBAN: false #Commands the server to detect infractors automatically.
|
||||
USE_AUTOBAN_LOG: true #Log autoban related messages. Still logs even with USE_AUTOBAN disabled.
|
||||
USE_AUTOSAVE: true #Enables server autosaving feature (saves characters to DB each 1 hour).
|
||||
USE_SERVER_AUTOASSIGNER: true #HeavenMS-builtin autoassigner, uses algorithm based on distributing AP accordingly with required secondary stat on equipments.
|
||||
USE_REFRESH_RANK_MOVE: true
|
||||
USE_ENFORCE_ADMIN_ACCOUNT: false #Forces accounts having GM characters to be treated as a "GM account" by the client (localhost). Some of the GM account perks is the ability to FLY, but unable to TRADE.
|
||||
USE_ENFORCE_NOVICE_EXPRATE: false #Hardsets experience rate 1x for beginners level 10 or under. Ideal for roaming on novice areas without caring too much about losing some stats.
|
||||
USE_ENFORCE_HPMP_SWAP: false #Forces players to reuse stats (via AP Resetting) located on HP/MP pool only inside the HP/MP stats.
|
||||
USE_ENFORCE_MOB_LEVEL_RANGE: true #Players N levels below the killed mob will gain no experience from defeating it.
|
||||
USE_ENFORCE_JOB_LEVEL_RANGE: false #Caps the player level on the minimum required to advance their current jobs.
|
||||
USE_ENFORCE_JOB_SP_RANGE: false #Caps the player SP level on the total obtainable by their current jobs. After changing jobs, missing SP will be retrieved.
|
||||
USE_ENFORCE_ITEM_SUGGESTION: false #Forces the Owl of Minerva and the Cash Shop to always display the defined item array instead of those featured by the players.
|
||||
USE_ENFORCE_UNMERCHABLE_CASH: true #Forces players to not sell CASH items via merchants, drops of it disappears.
|
||||
USE_ENFORCE_UNMERCHABLE_PET: true #Forces players to not sell pets via merchants, drops of it disappears. (since non-named pets gets dirty name and other possible DB-related issues)
|
||||
USE_ENFORCE_MERCHANT_SAVE: true #Forces automatic DB save on merchant owners, at every item movement on shop.
|
||||
USE_ENFORCE_MDOOR_POSITION: false #Forces mystic door to be spawned near spawnpoints.
|
||||
USE_SPAWN_CLEAN_MDOOR: false #Makes mystic doors to be spawned without deploy animation. This clears disconnecting issues that may happen when trying to cancel doors a couple seconds after deployment.
|
||||
USE_SPAWN_LOOT_ON_ANIMATION: false #Makes loot appear some time after the mob has been killed (following the mob death animation, instead of instantly).
|
||||
USE_SPAWN_RELEVANT_LOOT: true #Forces to only spawn loots that are collectable by the player or any of their party members.
|
||||
USE_ERASE_PERMIT_ON_OPENSHOP: true #Forces "shop permit" item to be consumed when player deploy his/her player shop.
|
||||
USE_ERASE_UNTRADEABLE_DROP: true #Forces flagged untradeable items to disappear when dropped.
|
||||
USE_ERASE_PET_ON_EXPIRATION: false #Forces pets to be removed from inventory when expire time comes, rather than converting it to a doll.
|
||||
USE_BUFF_MOST_SIGNIFICANT: true #When applying buffs, the player will stick with the highest stat boost among the listed, rather than overwriting stats.
|
||||
USE_BUFF_EVERLASTING: false #Every applied buff on players holds expiration time so high it'd be considered permanent. Suggestion thanks to Vcoc.
|
||||
USE_MULTIPLE_SAME_EQUIP_DROP: true #Enables multiple drops by mobs of the same equipment, number of possible drops based on the quantities provided at the drop data.
|
||||
USE_BANISHABLE_TOWN_SCROLL: true #Enables town scrolls to act as if it's a "player banish", rendering the antibanish scroll effect available.
|
||||
USE_ENABLE_FULL_RESPAWN: true #At respawn task, always respawn missing mobs when they're available. Spawn count doesn't depend on how many players are currently there.
|
||||
USE_ENABLE_CHAT_LOG: false #Write in-game chat to log
|
||||
USE_REBIRTH_SYSTEM: false #Flag to enable/disable rebirth system
|
||||
USE_MAP_OWNERSHIP_SYSTEM: true #Flag to enable/disable map ownership system
|
||||
USE_FISHING_SYSTEM: true #Flag to enable/disable custom fishing system
|
||||
USE_NPCS_SCRIPTABLE: true #Flag to enable/disable serverside predefined script NPCs.
|
||||
|
||||
#Events/PQs Configuration
|
||||
USE_OLD_GMS_STYLED_PQ_NPCS: true #Enables PQ NPCs with similar behaviour to old GMS style, that skips info about the PQs and immediately tries to register the party in.
|
||||
USE_ENABLE_SOLO_EXPEDITIONS: true #Enables start expeditions with any number of players. This will also bypass all the Zakum prequest.
|
||||
USE_ENABLE_DAILY_EXPEDITIONS: false #Enables daily entry limitations in expeditions.
|
||||
USE_ENABLE_RECALL_EVENT: false #Enables a disconnected player to reaccess the last event instance they were in before logging out. Recall only works if the event isn't cleared or disposed yet. Suggestion thanks to Alisson (Goukken).
|
||||
|
||||
#Announcement Configuration
|
||||
USE_ANNOUNCE_SHOPITEMSOLD: false #Automatic message sent to owner when an item from the Player Shop or Hired Merchant is sold.
|
||||
USE_ANNOUNCE_CHANGEJOB: false #Automatic message sent to acquantainces when changing jobs.
|
||||
|
||||
#Cash Shop Configuration
|
||||
USE_JOINT_CASHSHOP_INVENTORY: true #Enables usage of a same cash shop inventory for explorers, cygnus and legends. Items from exclusive cash shop inventories won't show up on the shared inventory, though.
|
||||
USE_CLEAR_OUTDATED_COUPONS: true #Enables deletion of older code coupon registry from the DB, freeing so-long irrelevant data.
|
||||
ALLOW_CASHSHOP_NAME_CHANGE: true #Allows players to buy name changes in the cash shop.
|
||||
ALLOW_CASHSHOP_WORLD_TRANSFER: true #Allows players to buy world transfers in the cash shop.
|
||||
|
||||
#Maker Configuration
|
||||
USE_MAKER_PERMISSIVE_ATKUP: true #Allows players to use attack-based strengthening gems on non-weapon items.
|
||||
USE_MAKER_FEE_HEURISTICS: true #Apply compiled values for stimulants and reagents into the Maker fee calculations (max error revolves around 50k mesos). Set false to use basic constant values instead (results are never higher than requested by the client-side).
|
||||
|
||||
#Custom Configuration
|
||||
USE_ENABLE_CUSTOM_NPC_SCRIPT: true #Enables usage of custom HeavenMS NPC scripts (Agent E, Coco, etc). Will not disable Abdula (it's actually useful for the gameplay) or quests.
|
||||
USE_STARTER_MERGE: false #Allows any players to use the Equipment Merge custom mechanic (as opposed to the high-level, Maker lv3 requisites).
|
||||
|
||||
#Commands Configuration
|
||||
BLOCK_GENERATE_CASH_ITEM: false #Prevents creation of cash items with the item/drop command.
|
||||
USE_WHOLE_SERVER_RANKING: false #Enables a ranking pool made from every character registered on the server for the "ranks" command, instead of separated by worlds.
|
||||
|
||||
EQUIP_EXP_RATE: 1.0 #Rate for equipment exp gain, grows linearly. Set 1.0 for default (about 100~200 same-level range mobs killed to pass equip from level 1 to 2).
|
||||
PQ_BONUS_EXP_RATE: 0.5 #Rate for the PQ exp reward.
|
||||
|
||||
EXP_SPLIT_LEVEL_INTERVAL: 5 #Non-contributing players must be within N level between the mob to receive EXP.
|
||||
EXP_SPLIT_LEECH_INTERVAL: 5 #Non-contributing players must be within N level between any contributing party member to receive EXP.
|
||||
EXP_SPLIT_MVP_MOD: 0.2
|
||||
EXP_SPLIT_COMMON_MOD: 0.8
|
||||
PARTY_BONUS_EXP_RATE: 1.0 #Rate for the party exp bonus reward.
|
||||
|
||||
#Miscellaneous Configuration
|
||||
TIMEZONE: GMT-3
|
||||
USE_DISPLAY_NUMBERS_WITH_COMMA: true #Enforce comma on displayed strings (use this when USE_UNITPRICE_WITH_COMMA is active and you still want to display comma-separated values).
|
||||
USE_UNITPRICE_WITH_COMMA: true #Set this accordingly with the layout of the unitPrices on Item.wz XML's, whether it's using commas or dots to represent fractions.
|
||||
MAX_MONITORED_BUFFSTATS: 5 #Limits accounting for "dormant" buff effects, that should take place when stronger stat buffs expires.
|
||||
MAX_AP: 32767 #Max AP allotted on the auto-assigner.
|
||||
MAX_EVENT_LEVELS: 8 #Event has different levels of rewarding system.
|
||||
BLOCK_NPC_RACE_CONDT: 500 # (0.5 * 1000) Time the player client must wait before reopening a conversation with an NPC.
|
||||
PET_LOOT_UPON_ATTACK: 700 # (0.7 * 1000) Time the pet must wait before trying to pick items up.
|
||||
TOT_MOB_QUEST_REQUIREMENT: 77 #Overwrites old 999-mobs requirement for the ToT questline with new requirement value, set 0 for default.
|
||||
MOB_REACTOR_REFRESH_TIME: 30000 # (30 * 1000) Overwrites refresh time for those reactors oriented to inflict damage to bosses (Ice Queen, Riche), set 0 for default.
|
||||
PARTY_SEARCH_REENTRY_LIMIT: 10 #Max amount of times a party leader is allowed to persist on the Party Search before entry expiration (thus needing to manually restart the Party Search to be able to search for members).
|
||||
NAME_CHANGE_COOLDOWN: 2592000000 # (30*24*60*60*1000) Cooldown for name changes, default (GMS) is 30 days.
|
||||
WORLD_TRANSFER_COOLDOWN: 2592000000 # (30*24*60*60*1000) Cooldown for world tranfers, default is same as name change (30 days).
|
||||
INSTANT_NAME_CHANGE: false #Whether or not to wait for server restart to apply name changes. Does on reconnect otherwise (requires queries on every login).
|
||||
|
||||
#Dangling Items/Locks Configuration
|
||||
ITEM_EXPIRE_TIME: 180000 # (3 * 60 * 1000) Time before items start disappearing. Recommended to be set up to 3 minutes.
|
||||
KITE_EXPIRE_TIME: 3600000 # (60 * 60 * 1000) Time before kites (cash item) disappears.
|
||||
ITEM_MONITOR_TIME: 300000 # (5 * 60 * 1000) Interval between item monitoring tasks on maps, which checks for dangling (null) item objects on the map item history.
|
||||
LOCK_MONITOR_TIME: 30000 # (30 * 1000) Waiting time for a lock to be released. If it reaches timeout, a critical server deadlock has made present.
|
||||
|
||||
#Map Monitor Configuration
|
||||
ITEM_EXPIRE_CHECK: 10000 # (10 * 10000) Interval between item expiring tasks on maps, which checks and makes disappear expired items.
|
||||
ITEM_LIMIT_ON_MAP: 200 #Max number of items allowed on a map.
|
||||
MAP_VISITED_SIZE: 5 #Max length for last mapids visited by a player. This is used to recover and update drops on these maps accordingly with player actions.
|
||||
MAP_DAMAGE_OVERTIME_INTERVAL: 5000 #Interval in milliseconds between map environment damage (e.g. El Nath and Aqua Road surrondings).
|
||||
|
||||
#Channel Mob Disease Monitor Configuration
|
||||
MOB_STATUS_MONITOR_PROC: 200 #Frequency in milliseconds between each proc on the mob disease monitor schedule.
|
||||
MOB_STATUS_MONITOR_LIFE: 84 #Idle proc count the mob disease monitor is allowed to be there before closing it due to inactivity.
|
||||
MOB_STATUS_AGGRO_PERSISTENCE: 2 #Idle proc count on aggro update for a mob to keep following the current controller, given him/her is the leading damage dealer.
|
||||
MOB_STATUS_AGGRO_INTERVAL: 5000 #Interval in milliseconds between aggro logistics update.
|
||||
|
||||
#Some Gameplay Enhancing Configurations
|
||||
#Scroll Configuration
|
||||
USE_PERFECT_GM_SCROLL: true #Scrolls from GMs never uses up slots nor fails.
|
||||
USE_PERFECT_SCROLLING: true #Scrolls doesn't use slots upon failure.
|
||||
USE_ENHANCED_CHSCROLL: true #Equips even more powerful with chaos upgrade.
|
||||
USE_ENHANCED_CRAFTING: true #Apply chaos scroll on every equip crafted.
|
||||
USE_ENHANCED_CLNSLATE: true #Clean slates can be applied to recover successfully used slots as well.
|
||||
SCROLL_CHANCE_RATE: 10 #Number of rolls for success on a scroll, set 1 for default.
|
||||
CHSCROLL_STAT_RATE: 3 #Number of rolls of stat upgrade on a successfully applied chaos scroll, set 1 for default.
|
||||
CHSCROLL_STAT_RANGE: 6 #Stat upgrade range (-N, N) on chaos scrolls.
|
||||
|
||||
#Beginner Skills Configuration
|
||||
USE_ULTRA_NIMBLE_FEET: true #Massive speed & jump upgrade.
|
||||
USE_ULTRA_RECOVERY: true #Massive recovery amounts overtime.
|
||||
USE_ULTRA_THREE_SNAILS: true #Massive damage on shell toss.
|
||||
|
||||
#Other Skills Configuration
|
||||
USE_FULL_ARAN_SKILLSET: false #Enables starter availability to all Aran job skills. Suggestion thanks to Masterrulax.
|
||||
USE_FAST_REUSE_HERO_WILL: true #Greatly reduce cooldown on Hero's Will.
|
||||
USE_ANTI_IMMUNITY_CRASH: true #Crash skills additionally removes the mob's invincibility buffs. Suggestion thanks to Celestial.
|
||||
USE_UNDISPEL_HOLY_SHIELD: true #Holy shield buff also prevents players from suffering dispel from mobs.
|
||||
USE_FULL_HOLY_SYMBOL: true #Holy symbol doesn't require EXP sharers to work in full.
|
||||
|
||||
#Character Configuration
|
||||
USE_ADD_SLOTS_BY_LEVEL: true #Slots are added each 20 levels.
|
||||
USE_ADD_RATES_BY_LEVEL: true #Rates are added each 20 levels.
|
||||
USE_STACK_COUPON_RATES: false #Multiple coupons effects builds up together.
|
||||
USE_PERFECT_PITCH: true #For lvl 30 or above, each lvlup grants player 1 perfect pitch.
|
||||
|
||||
#Quest Configuration
|
||||
USE_QUEST_RATE: false #Exp/Meso gained by quests uses fixed server exp/meso rate times quest rate as multiplier, instead of player rates.
|
||||
|
||||
#Quest Points Configuration
|
||||
QUEST_POINT_REPEATABLE_INTERVAL: 24 #Minimum interval between repeatable quest completions for quest points to be awarded.
|
||||
QUEST_POINT_REQUIREMENT: 16 #Exchange factor between N quest points to +1 fame, set 0 to disable the entire quest point mechanism.
|
||||
QUEST_POINT_PER_QUEST_COMPLETE: 4 #Each completed quest awards N quest points, set 0 to disable.
|
||||
QUEST_POINT_PER_EVENT_CLEAR: 1 #Each completed event instance awards N quest points, set 0 to disable.
|
||||
|
||||
#Guild Configuration
|
||||
CREATE_GUILD_MIN_PARTNERS: 6 #Minimum number of members on Guild Headquarters to establish a new guild.
|
||||
CREATE_GUILD_COST: 1500000
|
||||
CHANGE_EMBLEM_COST: 5000000
|
||||
EXPAND_GUILD_BASE_COST: 500000
|
||||
EXPAND_GUILD_TIER_COST: 1000000
|
||||
EXPAND_GUILD_MAX_COST: 5000000
|
||||
|
||||
#Family Configuration
|
||||
FAMILY_REP_PER_KILL: 4 #Amount of rep gained per monster kill.
|
||||
FAMILY_REP_PER_BOSS_KILL: 20 #Amount of rep gained per boss kill.
|
||||
FAMILY_REP_PER_LEVELUP: 200 #Amount of rep gained upon leveling up.
|
||||
FAMILY_MAX_GENERATIONS: 1000 #Maximum depth of family tree. (Distance from leader to farthest junior)
|
||||
|
||||
#Equipment Configuration
|
||||
USE_EQUIPMNT_LVLUP_SLOTS: true #Equips can upgrade slots at level up.
|
||||
USE_EQUIPMNT_LVLUP_POWER: true #Enable more powerful stat upgrades at equip level up.
|
||||
USE_EQUIPMNT_LVLUP_CASH: true #Enable equip leveling up on cash equipments as well.
|
||||
USE_SPIKES_AVOID_BANISH: true #Shoes equipped with spikes prevents mobs from banishing wearer.
|
||||
MAX_EQUIPMNT_LVLUP_STAT_UP: 10000 #Max stat upgrade an equipment can have on a levelup.
|
||||
MAX_EQUIPMNT_STAT: 32767 #Max stat on an equipment by leveling up.
|
||||
USE_EQUIPMNT_LVLUP: 7 #All equips lvlup at max level of N, set 1 to disable.
|
||||
|
||||
#Map-Chair Configuration
|
||||
USE_CHAIR_EXTRAHEAL: true #Enable map chairs to further recover player's HP and MP (player must have the Chair Mastery skill).
|
||||
CHAIR_EXTRA_HEAL_MULTIPLIER: 10 #Due to only being able to be send up-to-255 heal values, values being actually updated is the one displayed times this.
|
||||
CHAIR_EXTRA_HEAL_MAX_DELAY: 21 #Players are expected to recover fully after using this skill for N seconds.
|
||||
|
||||
#Player NPC Configuration
|
||||
PLAYERNPC_INITIAL_X: 262 #Map frame width for putting PlayerNPCs.
|
||||
PLAYERNPC_INITIAL_Y: 262 #Map frame height for putting PlayerNPCs.
|
||||
PLAYERNPC_AREA_X: 320 #Initial width gap between PlayerNPCs.
|
||||
PLAYERNPC_AREA_Y: 160 #Initial height gap between PlayerNPCs.
|
||||
PLAYERNPC_AREA_STEPS: 4 #Max number of times gap is shortened to comport PlayerNPCs.
|
||||
PLAYERNPC_ORGANIZE_AREA: true #Automatically rearranges PlayerNPCs on the map if there is no space set the new NPC. Current distance gap between NPCs is decreased to solve this issue.
|
||||
PLAYERNPC_AUTODEPLOY: true #Makes PlayerNPC automatically deployed on the Hall of Fame at the instant one reaches max level. If false, eligible players must talk to 1st job instructor to deploy a NPC.
|
||||
|
||||
#Pet Auto-Pot Configuration
|
||||
USE_COMPULSORY_AUTOPOT: true #Pets will consume as many potions as needed to fulfill the AUTOHP/MP ratio threshold.
|
||||
USE_EQUIPS_ON_AUTOPOT: true #Player MaxHP and MaxMP check values on autopot handler will be updated by the HP/MP bonuses on equipped items.
|
||||
PET_AUTOHP_RATIO: 0.99 #Will automatically consume potions until given ratio of the MaxHP/MaxMP is reached.
|
||||
PET_AUTOMP_RATIO: 0.99
|
||||
|
||||
#Pet & Mount Configuration
|
||||
PET_EXHAUST_COUNT: 3 #Number of proc counts (1 per minute) on the exhaust schedule for fullness.
|
||||
MOUNT_EXHAUST_COUNT: 1 #Number of proc counts (1 per minute) on the exhaust schedule for tiredness.
|
||||
|
||||
#Pet Hunger Configuration
|
||||
PETS_NEVER_HUNGRY: false #If true, pets and mounts will never grow hungry.
|
||||
GM_PETS_NEVER_HUNGRY: true #If true, pets and mounts owned by GMs will never grow hungry.
|
||||
|
||||
#Event Configuration
|
||||
EVENT_MAX_GUILD_QUEUE: 10 #Max number of guilds in queue for GPQ.
|
||||
EVENT_LOBBY_DELAY: 10 #Cooldown duration in seconds before reopening an event lobby.
|
||||
|
||||
#Dojo Configuration
|
||||
USE_FAST_DOJO_UPGRADE: true #Reduced Dojo training points amount required for a belt upgrade.
|
||||
USE_DEADLY_DOJO: false #Should bosses really use 1HP,1MP attacks in dojo?
|
||||
DOJO_ENERGY_ATK: 100 #Dojo energy gain when deal attack
|
||||
DOJO_ENERGY_DMG: 20 #Dojo energy gain when recv attack
|
||||
|
||||
#Wedding Configuration
|
||||
WEDDING_RESERVATION_DELAY: 3 #Minimum idle slots before processing a wedding reservation.
|
||||
WEDDING_RESERVATION_TIMEOUT: 10 #Limit time in minutes for the couple to show up before cancelling the wedding reservation.
|
||||
WEDDING_RESERVATION_INTERVAL: 60 #Time between wedding starts in minutes.
|
||||
WEDDING_BLESS_EXP: 30000 #Exp gained per bless count.
|
||||
WEDDING_GIFT_LIMIT: 1 #Max number of gifts per person to same wishlist on marriage instances.
|
||||
WEDDING_BLESSER_SHOWFX: true #Pops bubble sprite effect on players blessing the couple. Setting this false shows the blessing effect on the couple instead.
|
||||
|
||||
#Buyback Configuration
|
||||
USE_BUYBACK_WITH_MESOS: true #Enables usage of either mesos or NX for the buyback fee.
|
||||
BUYBACK_FEE: 77.70 #Sets the base amount needed to buyback (level 30 or under will use the base value).
|
||||
BUYBACK_LEVEL_STACK_FEE: 85.47 #Sets the level-stacking portion of the amount needed to buyback (fee will sum up linearly until level 120, when it reaches the peak).
|
||||
BUYBACK_MESO_MULTIPLIER: 1000 #Sets a multiplier for the fee when using meso as the charge unit.
|
||||
BUYBACK_RETURN_MINUTES: 1 #Sets the maximum amount of time the player can wait before decide to buyback.
|
||||
BUYBACK_COOLDOWN_MINUTES: 7 #Sets the time the player must wait before using buyback again.
|
||||
|
||||
# Login timeout by shavit
|
||||
TIMEOUT_DURATION: 3600000 # Kicks clients who don't send any packet to the game server in due time (in millisseconds).
|
||||
|
||||
#Event End Timestamp
|
||||
EVENT_END_TIMESTAMP: 1428897600000
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
HOST=127.0.0.1
|
||||
URL=jdbc:mysql://localhost:3306/heavenms
|
||||
DB_USER=root
|
||||
DB_PASS=
|
||||
SHUTDOWNHOOK=true
|
||||
BIN
cores/jackson-annotations-2.9.9.jar
Normal file
BIN
cores/jackson-annotations-2.9.9.jar
Normal file
Binary file not shown.
BIN
cores/jackson-core-2.9.9.jar
Normal file
BIN
cores/jackson-core-2.9.9.jar
Normal file
Binary file not shown.
BIN
cores/jackson-databind-2.9.9.3.jar
Normal file
BIN
cores/jackson-databind-2.9.9.3.jar
Normal file
Binary file not shown.
BIN
cores/jackson-dataformat-yaml-2.9.9.jar
Normal file
BIN
cores/jackson-dataformat-yaml-2.9.9.jar
Normal file
Binary file not shown.
BIN
cores/snakeyaml-1.25.jar
Normal file
BIN
cores/snakeyaml-1.25.jar
Normal file
Binary file not shown.
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sed -i "s/HOST=.*/HOST=${HOST}/" configuration.ini
|
||||
sed -i "s|URL=.*|URL=${URL}|" configuration.ini
|
||||
sed -i "s/DB_USER=.*/DB_USER=${DB_USER}/" configuration.ini
|
||||
sed -i "s/DB_PASS=.*/DB_PASS=${DB_PASS}/" configuration.ini
|
||||
|
||||
exec sh ./posix-launch.sh
|
||||
0
linux-compile.sh
Normal file → Executable file
0
linux-compile.sh
Normal file → Executable file
@@ -142,7 +142,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
|
||||
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -114,7 +114,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
|
||||
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -115,7 +115,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
|
||||
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -114,7 +114,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
|
||||
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -113,7 +113,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
|
||||
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -30,8 +30,8 @@ var feeMultiplier = 7.0;
|
||||
function start() {
|
||||
status = -1;
|
||||
|
||||
if (!Packages.constants.ServerConstants.USE_CPQ) {
|
||||
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (!Packages.config.YamlConfig.config.server.USE_CPQ) {
|
||||
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
status = 0;
|
||||
action(1, 0, 4);
|
||||
} else {
|
||||
@@ -221,9 +221,9 @@ function action(mode, type, selection) {
|
||||
}
|
||||
} else {
|
||||
var party = cm.getParty().getMembers();
|
||||
if ((selection >= 0 && selection <= 3) && party.size() < (Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
|
||||
if ((selection >= 0 && selection <= 3) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
|
||||
cm.sendOk("You need at least 2 players to participate in the battle!");
|
||||
} else if ((selection >= 4 && selection <= 5) && party.size() < (Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
|
||||
} else if ((selection >= 4 && selection <= 5) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
|
||||
cm.sendOk("You need at least 3 players to participate in the battle!");
|
||||
} else {
|
||||
cm.cpqLobby(selection);
|
||||
@@ -236,7 +236,7 @@ function action(mode, type, selection) {
|
||||
} else {
|
||||
if (status == 0) {
|
||||
var talk = "What would you like to do? If you have never participate in the Monster Carnival, you will need to know a few things before participating! \r\n#b#L0# Go to the Monster Carnival 1.#l \r\n#L3# Go to the Monster Carnival 2.#l \r\n#L1# Learn about the Monster Carnival.#l\r\n#L2# Trade #t4001129#.#l";
|
||||
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
talk += "\r\n#L4# ... Can I just refine my ores?#l";
|
||||
}
|
||||
cm.sendSimple(talk);
|
||||
|
||||
@@ -29,8 +29,8 @@ var feeMultiplier = 7.0;
|
||||
function start() {
|
||||
status = -1;
|
||||
|
||||
if (!Packages.constants.ServerConstants.USE_CPQ) {
|
||||
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (!Packages.config.YamlConfig.config.server.USE_CPQ) {
|
||||
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
status = 0;
|
||||
action(1, 0, 4);
|
||||
} else {
|
||||
@@ -220,9 +220,9 @@ function action(mode, type, selection) {
|
||||
}
|
||||
} else {
|
||||
var party = cm.getParty().getMembers();
|
||||
if ((selection >= 0 && selection <= 3) && party.size() < (Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
|
||||
if ((selection >= 0 && selection <= 3) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
|
||||
cm.sendOk("You need at least 2 players to participate in the battle!");
|
||||
} else if ((selection >= 4 && selection <= 5) && party.size() < (Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
|
||||
} else if ((selection >= 4 && selection <= 5) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
|
||||
cm.sendOk("You need at least 3 players to participate in the battle!");
|
||||
} else {
|
||||
cm.cpqLobby(selection);
|
||||
@@ -235,7 +235,7 @@ function action(mode, type, selection) {
|
||||
} else {
|
||||
if (status == 0) {
|
||||
var talk = "What would you like to do? If you have never participate in the Monster Carnival, you will need to know a few things before participating! \r\n#b#L0# Go to the Monster Carnival 1.#l \r\n#L3# Go to the Monster Carnival 2.#l \r\n#L1# Learn about the Monster Carnival.#l\r\n#L2# Trade #t4001129#.#l";
|
||||
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
talk += "\r\n#L4# ... Can I just refine my ores?#l";
|
||||
}
|
||||
cm.sendSimple(talk);
|
||||
|
||||
@@ -29,8 +29,8 @@ var feeMultiplier = 7.0;
|
||||
function start() {
|
||||
status = -1;
|
||||
|
||||
if (!Packages.constants.ServerConstants.USE_CPQ) {
|
||||
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (!Packages.config.YamlConfig.config.server.USE_CPQ) {
|
||||
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
status = 0;
|
||||
action(1, 0, 4);
|
||||
} else {
|
||||
@@ -235,7 +235,7 @@ function action(mode, type, selection) {
|
||||
} else {
|
||||
if (status == 0) {
|
||||
var talk = "What would you like to do? If you have never participate in the Monster Carnival, you will need to know a few things before participating! \r\n#b#L0# Go to the Monster Carnival 1.#l \r\n#L3# Go to the Monster Carnival 2.#l \r\n#L1# Learn about the Monster Carnival.#l\r\n#L2# Trade #t4001129#.#l";
|
||||
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
talk += "\r\n#L4# ... Can I just refine my ores?#l";
|
||||
}
|
||||
cm.sendSimple(talk);
|
||||
|
||||
@@ -77,9 +77,9 @@ function action(mode, type, selection) {
|
||||
}
|
||||
} else {
|
||||
var party = cm.getParty().getMembers();
|
||||
if ((selection === 0 || selection === 1 ) && party.size() < (Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
|
||||
if ((selection === 0 || selection === 1 ) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
|
||||
cm.sendOk("You need at least 2 players to participate in the battle!");
|
||||
} else if ((selection === 2 ) && party.size() < (Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
|
||||
} else if ((selection === 2 ) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
|
||||
cm.sendOk("You need at least 3 players to participate in the battle!");
|
||||
} else {
|
||||
cm.cpqLobby2(selection);
|
||||
|
||||
@@ -39,7 +39,7 @@ function action(mode, type, selection) {
|
||||
status--;
|
||||
|
||||
if(status == 0) {
|
||||
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
cm.openShopNPC(2082014);
|
||||
} else if (cm.isQuestStarted(3749)) {
|
||||
cm.sendOk("We've already located the enemy's ultimate weapon! Follow along the ship's bow area ahead and you will find my sister #b#p2082013##k. Report to her for futher instructions on the mission.");
|
||||
|
||||
@@ -45,7 +45,7 @@ function action(mode, type, selection) {
|
||||
if (status == 0) {
|
||||
if(cm.haveItem(4001086)) {
|
||||
cm.sendYesNo("Do you want to access #b#m240050400##k right now?");
|
||||
} else if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS) {
|
||||
} else if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS) {
|
||||
if(canBypassHTPQ()) {
|
||||
cm.sendYesNo("Do you want to access #b#m240050400##k right now?");
|
||||
} else {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* @Map(s): Dojo Hall
|
||||
*/
|
||||
|
||||
importPackage(Packages.constants);
|
||||
importPackage(Packages.config);
|
||||
|
||||
var disabled = false;
|
||||
var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004);
|
||||
@@ -44,7 +44,7 @@ function start() {
|
||||
return;
|
||||
}
|
||||
|
||||
belt_points = ServerConstants.USE_FAST_DOJO_UPGRADE ? Array(10, 90, 200, 460, 850) : Array(200, 1800, 4000, 9200, 17000);
|
||||
belt_points = YamlConfig.config.server.USE_FAST_DOJO_UPGRADE ? Array(10, 90, 200, 460, 850) : Array(200, 1800, 4000, 9200, 17000);
|
||||
|
||||
belt_on_inventory = new Array();
|
||||
for (var i = 0; i < belts.length; i++) {
|
||||
|
||||
@@ -51,7 +51,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
|
||||
if (status == 0) {
|
||||
if (!Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
cm.sendOk("Hi, I'm #b#p" + cm.getNpc() + "##k.");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
@@ -39,7 +39,7 @@ var equip;
|
||||
var maxEqp = 0;
|
||||
|
||||
function start() {
|
||||
if (!Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
cm.sendOk("Hi, I'm #b#p" + cm.getNpc() + "##k.");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
importPackage(Packages.client.processor);
|
||||
importPackage(Packages.constants);
|
||||
importPackage(Packages.config);
|
||||
|
||||
var status;
|
||||
var mergeFee = 50000;
|
||||
@@ -50,7 +50,7 @@ function action(mode, type, selection) {
|
||||
status--;
|
||||
|
||||
if(status == 0) {
|
||||
if (!Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
cm.sendOk("The medal ranking system is currently unavailable...");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -59,7 +59,7 @@ function action(mode, type, selection) {
|
||||
var levelLimit = !cm.getPlayer().isCygnus() ? 160 : 110;
|
||||
var selStr = "The medal ranking system is currently unavailable... Therefore, I am providing the #bEquipment Merge#k service! ";
|
||||
|
||||
if (!ServerConstants.USE_STARTER_MERGE && (cm.getPlayer().getLevel() < levelLimit || MakerProcessor.getMakerSkillLevel(cm.getPlayer()) < 3)) {
|
||||
if (!YamlConfig.config.server.USE_STARTER_MERGE && (cm.getPlayer().getLevel() < levelLimit || MakerProcessor.getMakerSkillLevel(cm.getPlayer()) < 3)) {
|
||||
selStr += "However, you must have #rMaker level 3#k and at least #rlevel 110#k (Cygnus Knight), #rlevel 160#k (other classes) and a fund of #r" + cm.numberWithCommas(mergeFee) + " mesos#k to use the service.";
|
||||
cm.sendOk(selStr);
|
||||
cm.dispose();
|
||||
|
||||
@@ -42,7 +42,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
|
||||
if (status == 0) {
|
||||
if (!Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
cm.sendOk("The medal ranking system is currently unavailable...");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
if (!Packages.constants.ServerConstants.USE_REBIRTH_SYSTEM) {
|
||||
if (!Packages.config.YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
|
||||
cm.sendOk("... I came from distant planes to assist the fight against the #rBlack Magician#k. Right now I search my master, have you seen him?");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Marriage NPC
|
||||
*/
|
||||
|
||||
importPackage(Packages.constants);
|
||||
importPackage(Packages.config);
|
||||
importPackage(Packages.net.server.channel.handlers);
|
||||
importPackage(Packages.tools);
|
||||
importPackage(Packages.tools.packets);
|
||||
@@ -32,7 +32,7 @@ var eim;
|
||||
var weddingEventName = "WeddingCathedral";
|
||||
var cathedralWedding = true;
|
||||
var weddingIndoors;
|
||||
var weddingBlessingExp = ServerConstants.WEDDING_BLESS_EXP;
|
||||
var weddingBlessingExp = YamlConfig.config.server.WEDDING_BLESS_EXP;
|
||||
|
||||
function isWeddingIndoors(mapid) {
|
||||
return mapid >= 680000100 && mapid <= 680000500;
|
||||
@@ -304,7 +304,7 @@ function action(mode, type, selection) {
|
||||
if (state == 0) { // give player blessings
|
||||
eim.gridInsert(cm.getPlayer(), 1);
|
||||
|
||||
if (ServerConstants.WEDDING_BLESSER_SHOWFX) {
|
||||
if (YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) {
|
||||
var target = cm.getPlayer();
|
||||
target.announce(MaplePacketCreator.showSpecialEffect(9));
|
||||
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Marriage NPC
|
||||
*/
|
||||
|
||||
importPackage(Packages.constants);
|
||||
importPackage(Packages.config);
|
||||
importPackage(Packages.net.server.channel.handlers);
|
||||
importPackage(Packages.tools);
|
||||
importPackage(Packages.tools.packets);
|
||||
@@ -32,7 +32,7 @@ var eim;
|
||||
var weddingEventName = "WeddingChapel";
|
||||
var cathedralWedding = false;
|
||||
var weddingIndoors;
|
||||
var weddingBlessingExp = ServerConstants.WEDDING_BLESS_EXP;
|
||||
var weddingBlessingExp = YamlConfig.config.server.WEDDING_BLESS_EXP;
|
||||
|
||||
function detectPlayerItemid(player) {
|
||||
for (var x = 4031357; x <= 4031364; x++) {
|
||||
@@ -174,7 +174,7 @@ function action(mode, type, selection) {
|
||||
if(state == 0) { // give player blessings
|
||||
eim.gridInsert(cm.getPlayer(), 1);
|
||||
|
||||
if(ServerConstants.WEDDING_BLESSER_SHOWFX) {
|
||||
if(YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) {
|
||||
var target = cm.getPlayer();
|
||||
target.announce(MaplePacketCreator.showSpecialEffect(9));
|
||||
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
function start() {
|
||||
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
cm.openShopNPC(9201101);
|
||||
} else {
|
||||
//cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city.");
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
importPackage(Packages.client);
|
||||
importPackage(Packages.constants);
|
||||
importPackage(Packages.config);
|
||||
|
||||
status = -1;
|
||||
|
||||
@@ -48,7 +48,7 @@ function start(mode, type, selection) {
|
||||
qm.changeJobById(2100);
|
||||
qm.resetStats();
|
||||
|
||||
if (ServerConstants.USE_FULL_ARAN_SKILLSET) {
|
||||
if (YamlConfig.config.server.USE_FULL_ARAN_SKILLSET) {
|
||||
qm.teachSkill(21000000, 0, 10, -1); //combo ability
|
||||
qm.teachSkill(21001003, 0, 20, -1); //polearm booster
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
importPackage(Packages.client);
|
||||
importPackage(Packages.constants);
|
||||
importPackage(Packages.config);
|
||||
|
||||
var status = -1;
|
||||
|
||||
@@ -66,7 +66,7 @@ function end(mode, type, selection) {
|
||||
qm.gainItem(1142130, true);
|
||||
qm.changeJobById(2110);
|
||||
|
||||
if (ServerConstants.USE_FULL_ARAN_SKILLSET) {
|
||||
if (YamlConfig.config.server.USE_FULL_ARAN_SKILLSET) {
|
||||
qm.teachSkill(21100000, 0, 20, -1); //polearm mastery
|
||||
qm.teachSkill(21100002, 0, 30, -1); //final charge
|
||||
qm.teachSkill(21100004, 0, 20, -1); //combo smash
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
importPackage(Packages.client);
|
||||
importPackage(Packages.constants);
|
||||
importPackage(Packages.config);
|
||||
|
||||
var status = -1;
|
||||
|
||||
@@ -51,7 +51,7 @@ function end(mode, type, selection) {
|
||||
qm.gainItem(1142131, true);
|
||||
qm.changeJobById(2111);
|
||||
|
||||
if (ServerConstants.USE_FULL_ARAN_SKILLSET) {
|
||||
if (YamlConfig.config.server.USE_FULL_ARAN_SKILLSET) {
|
||||
qm.teachSkill(21110002, 0, 20, -1); //full swing
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package client;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.GameConstants;
|
||||
import constants.ServerConstants;
|
||||
import java.util.Arrays;
|
||||
@@ -635,19 +636,19 @@ public abstract class AbstractMapleCharacterObject extends AbstractAnimatedMaple
|
||||
}
|
||||
|
||||
int newStr = str + deltaStr, newDex = dex + deltaDex, newInt = int_ + deltaInt, newLuk = luk + deltaLuk;
|
||||
if (newStr < 4 && deltaStr != Short.MIN_VALUE || newStr > ServerConstants.MAX_AP) {
|
||||
if (newStr < 4 && deltaStr != Short.MIN_VALUE || newStr > YamlConfig.config.server.MAX_AP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (newDex < 4 && deltaDex != Short.MIN_VALUE || newDex > ServerConstants.MAX_AP) {
|
||||
if (newDex < 4 && deltaDex != Short.MIN_VALUE || newDex > YamlConfig.config.server.MAX_AP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (newInt < 4 && deltaInt != Short.MIN_VALUE || newInt > ServerConstants.MAX_AP) {
|
||||
if (newInt < 4 && deltaInt != Short.MIN_VALUE || newInt > YamlConfig.config.server.MAX_AP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (newLuk < 4 && deltaLuk != Short.MIN_VALUE || newLuk > ServerConstants.MAX_AP) {
|
||||
if (newLuk < 4 && deltaLuk != Short.MIN_VALUE || newLuk > YamlConfig.config.server.MAX_AP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import config.YamlConfig;
|
||||
import net.server.PlayerBuffValueHolder;
|
||||
import net.server.PlayerCoolDownValueHolder;
|
||||
import net.server.Server;
|
||||
@@ -462,7 +463,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
int[] selectedType;
|
||||
int[] selectedAction;
|
||||
|
||||
if(ServerConstants.USE_CUSTOM_KEYSET) {
|
||||
if(YamlConfig.config.server.USE_CUSTOM_KEYSET) {
|
||||
selectedKey = GameConstants.getCustomKey(true);
|
||||
selectedType = GameConstants.getCustomType(true);
|
||||
selectedAction = GameConstants.getCustomAction(true);
|
||||
@@ -1169,7 +1170,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
spGain += 2;
|
||||
}
|
||||
|
||||
if (ServerConstants.USE_ENFORCE_JOB_SP_RANGE) {
|
||||
if (YamlConfig.config.server.USE_ENFORCE_JOB_SP_RANGE) {
|
||||
spGain = getChangedJobSp(newJob);
|
||||
}
|
||||
}
|
||||
@@ -1183,12 +1184,12 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
if (this.isCygnus()) {
|
||||
gainAp(7, true);
|
||||
} else {
|
||||
if (ServerConstants.USE_STARTING_AP_4 || newJob.getId() % 10 >= 1) {
|
||||
if (YamlConfig.config.server.USE_STARTING_AP_4 || newJob.getId() % 10 >= 1) {
|
||||
gainAp(5, true);
|
||||
}
|
||||
}
|
||||
} else { // thanks Periwinks for noticing an AP shortage from lower levels
|
||||
if (ServerConstants.USE_STARTING_AP_4 && newJob.getId() % 1000 >= 1) {
|
||||
if (YamlConfig.config.server.USE_STARTING_AP_4 && newJob.getId() % 1000 >= 1) {
|
||||
gainAp(4, true);
|
||||
}
|
||||
}
|
||||
@@ -1278,7 +1279,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
createDragon();
|
||||
}
|
||||
|
||||
if (ServerConstants.USE_ANNOUNCE_CHANGEJOB) {
|
||||
if (YamlConfig.config.server.USE_ANNOUNCE_CHANGEJOB) {
|
||||
if (!this.isGM()) {
|
||||
broadcastAcquaintances(6, "[" + GameConstants.ordinal(GameConstants.getJobBranch(newJob)) + " Job] " + name + " has just become a " + GameConstants.getJobName(this.job.getId()) + "."); // thanks Vcoc for noticing job name appearing in uppercase here
|
||||
}
|
||||
@@ -1379,7 +1380,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public void changeMapBanish(int mapid, String portal, String msg) {
|
||||
if(ServerConstants.USE_SPIKES_AVOID_BANISH) {
|
||||
if(YamlConfig.config.server.USE_SPIKES_AVOID_BANISH) {
|
||||
for(Item it: this.getInventory(MapleInventoryType.EQUIPPED).list()) {
|
||||
if((it.getFlag() & ItemConstants.SPIKES) == ItemConstants.SPIKES) {
|
||||
return;
|
||||
@@ -1733,7 +1734,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
int idx = getVisitedMapIndex(map);
|
||||
|
||||
if(idx == -1) {
|
||||
if(lastVisitedMaps.size() == ServerConstants.MAP_VISITED_SIZE) {
|
||||
if(lastVisitedMaps.size() == YamlConfig.config.server.MAP_VISITED_SIZE) {
|
||||
lastVisitedMaps.remove(0);
|
||||
}
|
||||
} else {
|
||||
@@ -2468,10 +2469,10 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
|
||||
private static Pair<Integer, Pair<Integer, Integer>> getChairTaskIntervalRate(int maxhp, int maxmp) {
|
||||
float toHeal = Math.max(maxhp, maxmp);
|
||||
float maxDuration = ServerConstants.CHAIR_EXTRA_HEAL_MAX_DELAY * 1000;
|
||||
float maxDuration = YamlConfig.config.server.CHAIR_EXTRA_HEAL_MAX_DELAY * 1000;
|
||||
|
||||
int rate = 0;
|
||||
int minRegen = 1, maxRegen = (256 * ServerConstants.CHAIR_EXTRA_HEAL_MULTIPLIER) - 1, midRegen = 1;
|
||||
int minRegen = 1, maxRegen = (256 * YamlConfig.config.server.CHAIR_EXTRA_HEAL_MULTIPLIER) - 1, midRegen = 1;
|
||||
while (minRegen < maxRegen) {
|
||||
midRegen = (int) ((minRegen + maxRegen) * 0.94);
|
||||
|
||||
@@ -2553,7 +2554,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
final int healMP = localchairmp;
|
||||
|
||||
if(MapleCharacter.this.getHp() < localmaxhp) {
|
||||
byte recHP = (byte) (healHP / ServerConstants.CHAIR_EXTRA_HEAL_MULTIPLIER);
|
||||
byte recHP = (byte) (healHP / YamlConfig.config.server.CHAIR_EXTRA_HEAL_MULTIPLIER);
|
||||
|
||||
client.announce(MaplePacketCreator.showOwnRecovery(recHP));
|
||||
getMap().broadcastMessage(MapleCharacter.this, MaplePacketCreator.showRecovery(id, recHP), false);
|
||||
@@ -2625,7 +2626,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public void dispel() {
|
||||
if(!(ServerConstants.USE_UNDISPEL_HOLY_SHIELD && this.hasActiveBuff(Bishop.HOLY_SHIELD))) {
|
||||
if(!(YamlConfig.config.server.USE_UNDISPEL_HOLY_SHIELD && this.hasActiveBuff(Bishop.HOLY_SHIELD))) {
|
||||
List<MapleBuffStatValueHolder> mbsvhList = getAllStatups();
|
||||
for (MapleBuffStatValueHolder mbsvh : mbsvhList) {
|
||||
if (mbsvh.effect.isSkill()) {
|
||||
@@ -2860,7 +2861,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
public void run() {
|
||||
doHurtHp();
|
||||
}
|
||||
}, ServerConstants.MAP_DAMAGE_OVERTIME_INTERVAL, ServerConstants.MAP_DAMAGE_OVERTIME_INTERVAL - lastHpTask);
|
||||
}, YamlConfig.config.server.MAP_DAMAGE_OVERTIME_INTERVAL, YamlConfig.config.server.MAP_DAMAGE_OVERTIME_INTERVAL - lastHpTask);
|
||||
}
|
||||
|
||||
public void resetHpDecreaseTask() {
|
||||
@@ -2869,7 +2870,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
long lastHpTask = Server.getInstance().getCurrentTime() - lastHpDec;
|
||||
startHpDecreaseTask((lastHpTask > ServerConstants.MAP_DAMAGE_OVERTIME_INTERVAL) ? ServerConstants.MAP_DAMAGE_OVERTIME_INTERVAL : lastHpTask);
|
||||
startHpDecreaseTask((lastHpTask > YamlConfig.config.server.MAP_DAMAGE_OVERTIME_INTERVAL) ? YamlConfig.config.server.MAP_DAMAGE_OVERTIME_INTERVAL : lastHpTask);
|
||||
}
|
||||
|
||||
public void dropMessage(String message) {
|
||||
@@ -4090,7 +4091,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
for(Entry<MapleBuffStat, Byte> it : stats.entrySet()) {
|
||||
boolean uniqueBuff = isSingletonStatup(it.getKey());
|
||||
|
||||
if(it.getValue() >= (!uniqueBuff ? ServerConstants.MAX_MONITORED_BUFFSTATS : 1) && effectStatups.contains(it.getKey())) {
|
||||
if(it.getValue() >= (!uniqueBuff ? YamlConfig.config.server.MAX_MONITORED_BUFFSTATS : 1) && effectStatups.contains(it.getKey())) {
|
||||
MapleBuffStatValueHolder mbsvh = minStatBuffs.get(it.getKey());
|
||||
|
||||
Map<MapleBuffStat, MapleBuffStatValueHolder> lpbe = buffEffects.get(mbsvh.effect.getBuffSourceId());
|
||||
@@ -4514,7 +4515,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}, buffInterval, buffInterval);
|
||||
}
|
||||
} else if (effect.isRecovery()) {
|
||||
int healInterval = (ServerConstants.USE_ULTRA_RECOVERY) ? 2000 : 5000;
|
||||
int healInterval = (YamlConfig.config.server.USE_ULTRA_RECOVERY) ? 2000 : 5000;
|
||||
final byte heal = (byte) effect.getX();
|
||||
|
||||
chrLock.lock();
|
||||
@@ -4583,7 +4584,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
boolean active = effect.isActive(this);
|
||||
if(ServerConstants.USE_BUFF_MOST_SIGNIFICANT) {
|
||||
if(YamlConfig.config.server.USE_BUFF_MOST_SIGNIFICANT) {
|
||||
toDeploy = new LinkedHashMap<>();
|
||||
Map<Integer, Pair<MapleStatEffect, Long>> retrievedEffects = new LinkedHashMap<>();
|
||||
Set<MapleBuffStat> retrievedStats = new LinkedHashSet<>();
|
||||
@@ -4663,7 +4664,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public boolean unregisterChairBuff() {
|
||||
if (!ServerConstants.USE_CHAIR_EXTRAHEAL) {
|
||||
if (!YamlConfig.config.server.USE_CHAIR_EXTRAHEAL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4678,7 +4679,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public boolean registerChairBuff() {
|
||||
if (!ServerConstants.USE_CHAIR_EXTRAHEAL) {
|
||||
if (!YamlConfig.config.server.USE_CHAIR_EXTRAHEAL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4954,7 +4955,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public boolean hasNoviceExpRate() {
|
||||
return ServerConstants.USE_ENFORCE_NOVICE_EXPRATE && isBeginnerJob() && level < 11;
|
||||
return YamlConfig.config.server.USE_ENFORCE_NOVICE_EXPRATE && isBeginnerJob() && level < 11;
|
||||
}
|
||||
|
||||
public int getExpRate() {
|
||||
@@ -5334,7 +5335,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
if(!ServerConstants.USE_ENFORCE_JOB_LEVEL_RANGE || isGmJob()) {
|
||||
if(!YamlConfig.config.server.USE_ENFORCE_JOB_LEVEL_RANGE || isGmJob()) {
|
||||
return getMaxClassLevel();
|
||||
}
|
||||
|
||||
@@ -6171,7 +6172,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
private long getNextBuybackTime() {
|
||||
return lastBuyback + ServerConstants.BUYBACK_COOLDOWN_MINUTES * 60 * 1000;
|
||||
return lastBuyback + YamlConfig.config.server.BUYBACK_COOLDOWN_MINUTES * 60 * 1000;
|
||||
}
|
||||
|
||||
private boolean isBuybackInvincible() {
|
||||
@@ -6179,30 +6180,30 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
private int getBuybackFee() {
|
||||
float fee = ServerConstants.BUYBACK_FEE;
|
||||
float fee = YamlConfig.config.server.BUYBACK_FEE;
|
||||
int grade = Math.min(Math.max(level, 30), 120) - 30;
|
||||
|
||||
fee += (grade * ServerConstants.BUYBACK_LEVEL_STACK_FEE);
|
||||
if (ServerConstants.USE_BUYBACK_WITH_MESOS) {
|
||||
fee *= ServerConstants.BUYBACK_MESO_MULTIPLIER;
|
||||
fee += (grade * YamlConfig.config.server.BUYBACK_LEVEL_STACK_FEE);
|
||||
if (YamlConfig.config.server.USE_BUYBACK_WITH_MESOS) {
|
||||
fee *= YamlConfig.config.server.BUYBACK_MESO_MULTIPLIER;
|
||||
}
|
||||
|
||||
return (int) Math.floor(fee);
|
||||
}
|
||||
|
||||
public void showBuybackInfo() {
|
||||
String s = "#eBUYBACK STATUS#n\r\n\r\nCurrent buyback fee: #b" + getBuybackFee() + " " + (ServerConstants.USE_BUYBACK_WITH_MESOS ? "mesos" : "NX") + "#k\r\n\r\n";
|
||||
String s = "#eBUYBACK STATUS#n\r\n\r\nCurrent buyback fee: #b" + getBuybackFee() + " " + (YamlConfig.config.server.USE_BUYBACK_WITH_MESOS ? "mesos" : "NX") + "#k\r\n\r\n";
|
||||
|
||||
long timeNow = Server.getInstance().getCurrentTime();
|
||||
boolean avail = true;
|
||||
if (!isAlive()) {
|
||||
long timeLapsed = timeNow - lastDeathtime;
|
||||
long timeRemaining = ServerConstants.BUYBACK_RETURN_MINUTES * 60 * 1000 - (timeLapsed + Math.max(0, getNextBuybackTime() - timeNow));
|
||||
long timeRemaining = YamlConfig.config.server.BUYBACK_RETURN_MINUTES * 60 * 1000 - (timeLapsed + Math.max(0, getNextBuybackTime() - timeNow));
|
||||
if (timeRemaining < 1) {
|
||||
s += "Buyback #e#rUNAVAILABLE#k#n";
|
||||
avail = false;
|
||||
} else {
|
||||
s += "Buyback countdown: #e#b" + getTimeRemaining(ServerConstants.BUYBACK_RETURN_MINUTES * 60 * 1000 - timeLapsed) + "#k#n";
|
||||
s += "Buyback countdown: #e#b" + getTimeRemaining(YamlConfig.config.server.BUYBACK_RETURN_MINUTES * 60 * 1000 - timeLapsed) + "#k#n";
|
||||
}
|
||||
s += "\r\n";
|
||||
}
|
||||
@@ -6225,7 +6226,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
public boolean couldBuyback() { // Ronan's buyback system
|
||||
long timeNow = Server.getInstance().getCurrentTime();
|
||||
|
||||
if (timeNow - lastDeathtime > ServerConstants.BUYBACK_RETURN_MINUTES * 60 * 1000) {
|
||||
if (timeNow - lastDeathtime > YamlConfig.config.server.BUYBACK_RETURN_MINUTES * 60 * 1000) {
|
||||
this.dropMessage(5, "The period of time to decide has expired, therefore you are unable to buyback.");
|
||||
return false;
|
||||
}
|
||||
@@ -6237,7 +6238,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean usingMesos = ServerConstants.USE_BUYBACK_WITH_MESOS;
|
||||
boolean usingMesos = YamlConfig.config.server.USE_BUYBACK_WITH_MESOS;
|
||||
int fee = getBuybackFee();
|
||||
|
||||
if (!canBuyback(fee, usingMesos)) {
|
||||
@@ -6309,7 +6310,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public boolean attemptCatchFish(int baitLevel) {
|
||||
return ServerConstants.USE_FISHING_SYSTEM && GameConstants.isFishingArea(mapid) && this.getPosition().getY() > 0 && ItemConstants.isFishingChair(chair.get()) && this.getWorldServer().registerFisherPlayer(this, baitLevel);
|
||||
return YamlConfig.config.server.USE_FISHING_SYSTEM && GameConstants.isFishingArea(mapid) && this.getPosition().getY() > 0 && ItemConstants.isFishingChair(chair.get()) && this.getWorldServer().registerFisherPlayer(this, baitLevel);
|
||||
}
|
||||
|
||||
public void leaveMap() {
|
||||
@@ -6395,7 +6396,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
int spGain = 3;
|
||||
if (ServerConstants.USE_ENFORCE_JOB_SP_RANGE && !GameConstants.hasSPTable(job)) {
|
||||
if (YamlConfig.config.server.USE_ENFORCE_JOB_SP_RANGE && !GameConstants.hasSPTable(job)) {
|
||||
spGain = getSpGain(spGain, job);
|
||||
}
|
||||
|
||||
@@ -6411,7 +6412,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
int improvingMaxMPLevel = 0;
|
||||
|
||||
boolean isBeginner = isBeginnerJob();
|
||||
if (ServerConstants.USE_AUTOASSIGN_STARTERS_AP && isBeginner && level < 11) {
|
||||
if (YamlConfig.config.server.USE_AUTOASSIGN_STARTERS_AP && isBeginner && level < 11) {
|
||||
effLock.lock();
|
||||
statWlock.lock();
|
||||
try {
|
||||
@@ -6488,7 +6489,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
addmp += improvingMaxMP.getEffect(improvingMaxMPLevel).getX();
|
||||
}
|
||||
|
||||
if (ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (getJobStyle() == MapleJob.MAGICIAN) {
|
||||
addmp += localint_ / 20;
|
||||
} else {
|
||||
@@ -6512,7 +6513,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
int maxClassLevel = getMaxClassLevel();
|
||||
if (level == maxClassLevel) {
|
||||
if (!this.isGM()) {
|
||||
if (ServerConstants.PLAYERNPC_AUTODEPLOY) {
|
||||
if (YamlConfig.config.server.PLAYERNPC_AUTODEPLOY) {
|
||||
ThreadManager.getInstance().newTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -6564,7 +6565,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
if (level % 20 == 0) {
|
||||
if (ServerConstants.USE_ADD_SLOTS_BY_LEVEL == true) {
|
||||
if (YamlConfig.config.server.USE_ADD_SLOTS_BY_LEVEL == true) {
|
||||
if (!isGM()) {
|
||||
for (byte i = 1; i < 5; i++) {
|
||||
gainSlots(i, 4, true);
|
||||
@@ -6573,14 +6574,14 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
this.yellowMessage("You reached level " + level + ". Congratulations! As a token of your success, your inventory has been expanded a little bit.");
|
||||
}
|
||||
}
|
||||
if (ServerConstants.USE_ADD_RATES_BY_LEVEL == true) { //For the rate upgrade
|
||||
if (YamlConfig.config.server.USE_ADD_RATES_BY_LEVEL == true) { //For the rate upgrade
|
||||
revertLastPlayerRates();
|
||||
setPlayerRates();
|
||||
this.yellowMessage("You managed to get level " + level + "! Getting experience and items seems a little easier now, huh?");
|
||||
}
|
||||
}
|
||||
|
||||
if (ServerConstants.USE_PERFECT_PITCH && level >= 30) {
|
||||
if (YamlConfig.config.server.USE_PERFECT_PITCH && level >= 30) {
|
||||
//milestones?
|
||||
if (MapleInventoryManipulator.checkSpace(client, 4310000, (short) 1, "")) {
|
||||
MapleInventoryManipulator.addById(client, 4310000, (short) 1, "", -1);
|
||||
@@ -6603,7 +6604,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
|
||||
MapleFamilyEntry familyEntry = getFamilyEntry();
|
||||
if(familyEntry != null) {
|
||||
familyEntry.giveReputationToSenior(ServerConstants.FAMILY_REP_PER_LEVELUP, true);
|
||||
familyEntry.giveReputationToSenior(YamlConfig.config.server.FAMILY_REP_PER_LEVELUP, true);
|
||||
MapleFamilyEntry senior = familyEntry.getSenior();
|
||||
if(senior != null) { //only send the message to direct senior
|
||||
MapleCharacter seniorChr = senior.getChr();
|
||||
@@ -6833,7 +6834,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
private List<Integer> activateCouponsEffects() {
|
||||
List<Integer> toCommitEffect = new LinkedList<>();
|
||||
|
||||
if(ServerConstants.USE_STACK_COUPON_RATES) {
|
||||
if(YamlConfig.config.server.USE_STACK_COUPON_RATES) {
|
||||
for(Entry<Integer,Integer> coupon: activeCoupons.entrySet()) {
|
||||
int couponId = coupon.getKey();
|
||||
int couponQty = coupon.getValue();
|
||||
@@ -7908,7 +7909,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
|
||||
reapplyLocalStats();
|
||||
|
||||
if (ServerConstants.USE_FIXED_RATIO_HPMP_UPDATE) {
|
||||
if (YamlConfig.config.server.USE_FIXED_RATIO_HPMP_UPDATE) {
|
||||
if (localmaxhp != oldlocalmaxhp) {
|
||||
Pair<MapleStat, Integer> hpUpdate;
|
||||
|
||||
@@ -8049,7 +8050,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public synchronized void resetStats() {
|
||||
if(!ServerConstants.USE_AUTOASSIGN_STARTERS_AP) {
|
||||
if(!YamlConfig.config.server.USE_AUTOASSIGN_STARTERS_AP) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8298,7 +8299,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
int[] selectedType;
|
||||
int[] selectedAction;
|
||||
|
||||
if(ServerConstants.USE_CUSTOM_KEYSET) {
|
||||
if(YamlConfig.config.server.USE_CUSTOM_KEYSET) {
|
||||
selectedKey = GameConstants.getCustomKey(true);
|
||||
selectedType = GameConstants.getCustomType(true);
|
||||
selectedAction = GameConstants.getCustomAction(true);
|
||||
@@ -8366,7 +8367,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public void saveCharToDB() {
|
||||
if(ServerConstants.USE_AUTOSAVE) {
|
||||
if(YamlConfig.config.server.USE_AUTOSAVE) {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -9858,7 +9859,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public void awardQuestPoint(int awardedPoints) {
|
||||
if (ServerConstants.QUEST_POINT_REQUIREMENT < 1 || awardedPoints < 1) {
|
||||
if (YamlConfig.config.server.QUEST_POINT_REQUIREMENT < 1 || awardedPoints < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9866,8 +9867,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
synchronized (quests) {
|
||||
quest_fame += awardedPoints;
|
||||
|
||||
delta = quest_fame / ServerConstants.QUEST_POINT_REQUIREMENT;
|
||||
quest_fame %= ServerConstants.QUEST_POINT_REQUIREMENT;
|
||||
delta = quest_fame / YamlConfig.config.server.QUEST_POINT_REQUIREMENT;
|
||||
quest_fame %= YamlConfig.config.server.QUEST_POINT_REQUIREMENT;
|
||||
}
|
||||
|
||||
if(delta > 0) {
|
||||
@@ -9936,7 +9937,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
MapleQuest mquest = quest.getQuest();
|
||||
short questid = mquest.getId();
|
||||
if (!mquest.isSameDayRepeatable() && !MapleQuest.isExploitableQuest(questid)) {
|
||||
awardQuestPoint(ServerConstants.QUEST_POINT_PER_QUEST_COMPLETE);
|
||||
awardQuestPoint(YamlConfig.config.server.QUEST_POINT_PER_QUEST_COMPLETE);
|
||||
}
|
||||
quest.setCompleted(quest.getCompleted() + 1); // count quest completed Jayd's idea
|
||||
|
||||
@@ -10394,7 +10395,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
|
||||
private Collection<Item> getUpgradeableEquipList() {
|
||||
Collection<Item> fullList = getInventory(MapleInventoryType.EQUIPPED).list();
|
||||
if (ServerConstants.USE_EQUIPMNT_LVLUP_CASH) {
|
||||
if (YamlConfig.config.server.USE_EQUIPMNT_LVLUP_CASH) {
|
||||
return fullList;
|
||||
}
|
||||
|
||||
@@ -10660,7 +10661,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
while(rs.next()) {
|
||||
Timestamp completedTimestamp = rs.getTimestamp("completionTime");
|
||||
if(completedTimestamp == null) return false; //pending
|
||||
else if(completedTimestamp.getTime() + ServerConstants.NAME_CHANGE_COOLDOWN > currentTimeMillis) return false;
|
||||
else if(completedTimestamp.getTime() + YamlConfig.config.server.NAME_CHANGE_COOLDOWN > currentTimeMillis) return false;
|
||||
}
|
||||
} catch(SQLException e) {
|
||||
e.printStackTrace();
|
||||
@@ -10886,7 +10887,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public static String checkWorldTransferEligibility(Connection con, int characterId, int oldWorld, int newWorld) {
|
||||
if(!ServerConstants.ALLOW_CASHSHOP_WORLD_TRANSFER) return "World transfers disabled.";
|
||||
if(!YamlConfig.config.server.ALLOW_CASHSHOP_WORLD_TRANSFER) return "World transfers disabled.";
|
||||
int accountId = -1;
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT accountid, level, guildid, guildrank, partnerId, familyId FROM characters WHERE id = ?")) {
|
||||
ps.setInt(1, characterId);
|
||||
@@ -10936,7 +10937,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
while(rs.next()) {
|
||||
Timestamp completedTimestamp = rs.getTimestamp("completionTime");
|
||||
if(completedTimestamp == null) return false; //pending
|
||||
else if(completedTimestamp.getTime() + ServerConstants.WORLD_TRANSFER_COOLDOWN > currentTimeMillis) return false;
|
||||
else if(completedTimestamp.getTime() + YamlConfig.config.server.WORLD_TRANSFER_COOLDOWN > currentTimeMillis) return false;
|
||||
}
|
||||
} catch(SQLException e) {
|
||||
e.printStackTrace();
|
||||
@@ -10990,7 +10991,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
try (PreparedStatement ps = con.prepareStatement("UPDATE characters SET world = ?, meso = ?, guildid = ?, guildrank = ? WHERE id = ?")) {
|
||||
ps.setInt(1, newWorld);
|
||||
ps.setInt(2, Math.min(mesos, 1000000)); //might want a limit in ServerConstants for this
|
||||
ps.setInt(2, Math.min(mesos, 1000000)); //might want a limit in YamlConfig.config.server.for this
|
||||
ps.setInt(3, 0);
|
||||
ps.setInt(4, 5);
|
||||
ps.setInt(5, characterId);
|
||||
@@ -11071,7 +11072,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public void setReborns(int value) {
|
||||
if (!ServerConstants.USE_REBIRTH_SYSTEM) {
|
||||
if (!YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
|
||||
yellowMessage("Rebirth system is not enabled!");
|
||||
throw new NotEnabledException();
|
||||
}
|
||||
@@ -11096,7 +11097,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public int getReborns() {
|
||||
if (!ServerConstants.USE_REBIRTH_SYSTEM) {
|
||||
if (!YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
|
||||
yellowMessage("Rebirth system is not enabled!");
|
||||
throw new NotEnabledException();
|
||||
}
|
||||
@@ -11119,7 +11120,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public void executeReborn() {
|
||||
if (!ServerConstants.USE_REBIRTH_SYSTEM) {
|
||||
if (!YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
|
||||
yellowMessage("Rebirth system is not enabled!");
|
||||
throw new NotEnabledException();
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import java.util.Set;
|
||||
import java.util.concurrent.Semaphore;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
|
||||
import config.YamlConfig;
|
||||
import jdk.nashorn.api.scripting.NashornScriptEngine;
|
||||
import tools.*;
|
||||
|
||||
@@ -489,7 +490,7 @@ public class MapleClient {
|
||||
}
|
||||
|
||||
public boolean checkPin(String other) {
|
||||
if (!(ServerConstants.ENABLE_PIN && !canBypassPin())) {
|
||||
if (!(YamlConfig.config.server.ENABLE_PIN && !canBypassPin())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -526,7 +527,7 @@ public class MapleClient {
|
||||
}
|
||||
|
||||
public boolean checkPic(String other) {
|
||||
if (!(ServerConstants.ENABLE_PIC && !canBypassPic())) {
|
||||
if (!(YamlConfig.config.server.ENABLE_PIC && !canBypassPic())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -592,7 +593,7 @@ public class MapleClient {
|
||||
loginok = (tos == 0) ? 23 : 0;
|
||||
} else if (pwd.equals(passhash) || checkHash(passhash, "SHA-1", pwd) || checkHash(passhash, "SHA-512", pwd)) {
|
||||
// thanks GabrielSin for detecting some no-bcrypt inconsistencies here
|
||||
loginok = (tos == 0) ? (!ServerConstants.BCRYPT_MIGRATION ? 23 : -23) : (!ServerConstants.BCRYPT_MIGRATION ? 0 : -10); // migrate to bcrypt
|
||||
loginok = (tos == 0) ? (!YamlConfig.config.server.BCRYPT_MIGRATION ? 23 : -23) : (!YamlConfig.config.server.BCRYPT_MIGRATION ? 0 : -10); // migrate to bcrypt
|
||||
} else {
|
||||
loggedIn = false;
|
||||
loginok = 4;
|
||||
@@ -1036,7 +1037,7 @@ public class MapleClient {
|
||||
player.saveCharToDB(true);
|
||||
|
||||
player.logOff();
|
||||
if(ServerConstants.INSTANT_NAME_CHANGE) player.doPendingNameChange();
|
||||
if(YamlConfig.config.server.INSTANT_NAME_CHANGE) player.doPendingNameChange();
|
||||
clear();
|
||||
} else {
|
||||
getChannelServer().removePlayer(player);
|
||||
|
||||
@@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package client.autoban;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.server.Server;
|
||||
import tools.FilePrinter;
|
||||
@@ -84,19 +85,19 @@ public enum AutobanFactory {
|
||||
}
|
||||
|
||||
public void alert(MapleCharacter chr, String reason) {
|
||||
if(ServerConstants.USE_AUTOBAN == true) {
|
||||
if(YamlConfig.config.server.USE_AUTOBAN == true) {
|
||||
if (chr != null && MapleLogger.ignored.contains(chr.getId())){
|
||||
return;
|
||||
}
|
||||
Server.getInstance().broadcastGMMessage((chr != null ? chr.getWorld() : 0), MaplePacketCreator.sendYellowTip((chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason));
|
||||
}
|
||||
if (ServerConstants.USE_AUTOBAN_LOG) {
|
||||
if (YamlConfig.config.server.USE_AUTOBAN_LOG) {
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, (chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason);
|
||||
}
|
||||
}
|
||||
|
||||
public void autoban(MapleCharacter chr, String value) {
|
||||
if(ServerConstants.USE_AUTOBAN == true) {
|
||||
if(YamlConfig.config.server.USE_AUTOBAN == true) {
|
||||
chr.autoban("Autobanned for (" + this.name() + ": " + value + ")");
|
||||
//chr.sendPolice("You will be disconnected for (" + this.name() + ": " + value + ")");
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
package client.autoban;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -33,7 +34,7 @@ public class AutobanManager {
|
||||
}
|
||||
|
||||
public void addPoint(AutobanFactory fac, String reason) {
|
||||
if (ServerConstants.USE_AUTOBAN) {
|
||||
if (YamlConfig.config.server.USE_AUTOBAN) {
|
||||
if (chr.isGM() || chr.isBanned()){
|
||||
return;
|
||||
}
|
||||
@@ -57,7 +58,7 @@ public class AutobanManager {
|
||||
//chr.sendPolice("You have been blocked by #bMooplePolice for the HACK reason#k.");
|
||||
}
|
||||
}
|
||||
if (ServerConstants.USE_AUTOBAN_LOG) {
|
||||
if (YamlConfig.config.server.USE_AUTOBAN_LOG) {
|
||||
// Lets log every single point too.
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, MapleCharacter.makeMapleReadable(chr.getName()) + " caused " + fac.name() + " " + reason);
|
||||
}
|
||||
@@ -114,7 +115,7 @@ public class AutobanManager {
|
||||
if (this.timestamp[type] == time) {
|
||||
this.timestampcounter[type]++;
|
||||
if (this.timestampcounter[type] >= times) {
|
||||
if (ServerConstants.USE_AUTOBAN) {
|
||||
if (YamlConfig.config.server.USE_AUTOBAN) {
|
||||
chr.getClient().disconnect(false, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ package client.command.commands.gm0;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class DropLimitCommand extends Command {
|
||||
@@ -35,10 +36,10 @@ public class DropLimitCommand extends Command {
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
int dropCount = c.getPlayer().getMap().getDroppedItemCount();
|
||||
if(((float) dropCount) / ServerConstants.ITEM_LIMIT_ON_MAP < 0.75f) {
|
||||
c.getPlayer().showHint("Current drop count: #b" + dropCount + "#k / #e" + ServerConstants.ITEM_LIMIT_ON_MAP + "#n", 300);
|
||||
if(((float) dropCount) / YamlConfig.config.server.ITEM_LIMIT_ON_MAP < 0.75f) {
|
||||
c.getPlayer().showHint("Current drop count: #b" + dropCount + "#k / #e" + YamlConfig.config.server.ITEM_LIMIT_ON_MAP + "#n", 300);
|
||||
} else {
|
||||
c.getPlayer().showHint("Current drop count: #r" + dropCount + "#k / #e" + ServerConstants.ITEM_LIMIT_ON_MAP + "#n", 300);
|
||||
c.getPlayer().showHint("Current drop count: #r" + dropCount + "#k / #e" + YamlConfig.config.server.ITEM_LIMIT_ON_MAP + "#n", 300);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm0;
|
||||
import client.command.Command;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import server.maps.MapleMap;
|
||||
|
||||
@@ -40,7 +41,7 @@ public class MapOwnerClaimCommand extends Command {
|
||||
try {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
|
||||
if (ServerConstants.USE_MAP_OWNERSHIP_SYSTEM) {
|
||||
if (YamlConfig.config.server.USE_MAP_OWNERSHIP_SYSTEM) {
|
||||
if (chr.getEventInstance() == null) {
|
||||
MapleMap ownedMap = chr.getOwnedMap(); // thanks Conrad for suggesting not unlease a map as soon as player exits it
|
||||
if (ownedMap != null) {
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm0;
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class RatesCommand extends Command {
|
||||
@@ -43,7 +44,7 @@ public class RatesCommand extends Command {
|
||||
showMsg_ += "MESO Rate: #e#b" + player.getMesoRate() + "x#k#n" + "\r\n";
|
||||
showMsg_ += "DROP Rate: #e#b" + player.getDropRate() + "x#k#n" + "\r\n";
|
||||
showMsg_ += "BOSS DROP Rate: #e#b" + player.getBossDropRate() + "x#k#n" + "\r\n";
|
||||
if(ServerConstants.USE_QUEST_RATE) showMsg_ += "QUEST Rate: #e#b" + c.getWorldServer().getQuestRate() + "x#k#n" + "\r\n";
|
||||
if(YamlConfig.config.server.USE_QUEST_RATE) showMsg_ += "QUEST Rate: #e#b" + c.getWorldServer().getQuestRate() + "x#k#n" + "\r\n";
|
||||
|
||||
player.showHint(showMsg_, 300);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm0;
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class ShowRatesCommand extends Command {
|
||||
@@ -60,7 +61,7 @@ public class ShowRatesCommand extends Command {
|
||||
if(player.getCouponDropRate() != 1) showMsg += "Coupon DROP Rate: #k" + player.getCouponDropRate() + "x#k" + "\r\n";
|
||||
showMsg += "BOSS DROP Rate: #e#b" + player.getBossDropRate() + "x#k#n" + "\r\n";
|
||||
|
||||
if(ServerConstants.USE_QUEST_RATE) {
|
||||
if(YamlConfig.config.server.USE_QUEST_RATE) {
|
||||
showMsg += "\r\n" + "#eQUEST RATE#n" + "\r\n";
|
||||
showMsg += "World QUEST Rate: #e#b" + c.getWorldServer().getQuestRate() + "x#k#n" + "\r\n";
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm0;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class StatDexCommand extends Command {
|
||||
@@ -47,10 +48,10 @@ public class StatDexCommand extends Command {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
amount = Math.min(remainingAp, ServerConstants.MAX_AP - player.getDex());
|
||||
amount = Math.min(remainingAp, YamlConfig.config.server.MAX_AP - player.getDex());
|
||||
}
|
||||
if (!player.assignDex(Math.max(amount, 0))) {
|
||||
player.dropMessage("Please make sure your AP is not over " + ServerConstants.MAX_AP + " and you have enough to distribute.");
|
||||
player.dropMessage("Please make sure your AP is not over " + YamlConfig.config.server.MAX_AP + " and you have enough to distribute.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm0;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class StatIntCommand extends Command {
|
||||
@@ -47,10 +48,10 @@ public class StatIntCommand extends Command {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
amount = Math.min(remainingAp, ServerConstants.MAX_AP - player.getInt());
|
||||
amount = Math.min(remainingAp, YamlConfig.config.server.MAX_AP - player.getInt());
|
||||
}
|
||||
if (!player.assignInt(Math.max(amount, 0))) {
|
||||
player.dropMessage("Please make sure your AP is not over " + ServerConstants.MAX_AP + " and you have enough to distribute.");
|
||||
player.dropMessage("Please make sure your AP is not over " + YamlConfig.config.server.MAX_AP + " and you have enough to distribute.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm0;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class StatLukCommand extends Command {
|
||||
@@ -47,10 +48,10 @@ public class StatLukCommand extends Command {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
amount = Math.min(remainingAp, ServerConstants.MAX_AP - player.getLuk());
|
||||
amount = Math.min(remainingAp, YamlConfig.config.server.MAX_AP - player.getLuk());
|
||||
}
|
||||
if (!player.assignLuk(Math.max(amount, 0))) {
|
||||
player.dropMessage("Please make sure your AP is not over " + ServerConstants.MAX_AP + " and you have enough to distribute.");
|
||||
player.dropMessage("Please make sure your AP is not over " + YamlConfig.config.server.MAX_AP + " and you have enough to distribute.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm0;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class StatStrCommand extends Command {
|
||||
@@ -46,11 +47,11 @@ public class StatStrCommand extends Command {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
amount = Math.min(remainingAp, ServerConstants.MAX_AP - player.getStr());
|
||||
amount = Math.min(remainingAp, YamlConfig.config.server.MAX_AP - player.getStr());
|
||||
}
|
||||
|
||||
if (!player.assignStr(Math.max(amount, 0))) {
|
||||
player.dropMessage("Please make sure your AP is not over " + ServerConstants.MAX_AP + " and you have enough to distribute.");
|
||||
player.dropMessage("Please make sure your AP is not over " + YamlConfig.config.server.MAX_AP + " and you have enough to distribute.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm2;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class ApCommand extends Command {
|
||||
@@ -44,7 +45,7 @@ public class ApCommand extends Command {
|
||||
if (params.length < 2) {
|
||||
int newAp = Integer.parseInt(params[0]);
|
||||
if (newAp < 0) newAp = 0;
|
||||
else if (newAp > ServerConstants.MAX_AP) newAp = ServerConstants.MAX_AP;
|
||||
else if (newAp > YamlConfig.config.server.MAX_AP) newAp = YamlConfig.config.server.MAX_AP;
|
||||
|
||||
player.changeRemainingAp(newAp, false);
|
||||
} else {
|
||||
@@ -52,7 +53,7 @@ public class ApCommand extends Command {
|
||||
if (victim != null) {
|
||||
int newAp = Integer.parseInt(params[1]);
|
||||
if (newAp < 0) newAp = 0;
|
||||
else if (newAp > ServerConstants.MAX_AP) newAp = ServerConstants.MAX_AP;
|
||||
else if (newAp > YamlConfig.config.server.MAX_AP) newAp = YamlConfig.config.server.MAX_AP;
|
||||
|
||||
victim.changeRemainingAp(newAp, false);
|
||||
} else {
|
||||
|
||||
@@ -28,6 +28,7 @@ import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -57,7 +58,7 @@ public class ItemCommand extends Command {
|
||||
short quantity = 1;
|
||||
if(params.length >= 2) quantity = Short.parseShort(params[1]);
|
||||
|
||||
if (ServerConstants.BLOCK_GENERATE_CASH_ITEM && ii.isCash(itemId)) {
|
||||
if (YamlConfig.config.server.BLOCK_GENERATE_CASH_ITEM && ii.isCash(itemId)) {
|
||||
player.yellowMessage("You cannot create a cash item with this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import client.MapleCharacter;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.MaplePet;
|
||||
import config.YamlConfig;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -58,7 +59,7 @@ public class ItemDropCommand extends Command {
|
||||
short quantity = 1;
|
||||
if(params.length >= 2) quantity = Short.parseShort(params[1]);
|
||||
|
||||
if (ServerConstants.BLOCK_GENERATE_CASH_ITEM && ii.isCash(itemId)) {
|
||||
if (YamlConfig.config.server.BLOCK_GENERATE_CASH_ITEM && ii.isCash(itemId)) {
|
||||
player.yellowMessage("You cannot create a cash item with this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm2;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class LevelCommand extends Command {
|
||||
@@ -45,7 +46,7 @@ public class LevelCommand extends Command {
|
||||
player.setLevel(Math.min(Integer.parseInt(params[0]), player.getMaxClassLevel()) - 1);
|
||||
|
||||
player.resetPlayerRates();
|
||||
if (ServerConstants.USE_ADD_RATES_BY_LEVEL) player.setPlayerRates();
|
||||
if (YamlConfig.config.server.USE_ADD_RATES_BY_LEVEL) player.setPlayerRates();
|
||||
player.setWorldRates();
|
||||
|
||||
player.levelUp(false);
|
||||
|
||||
@@ -27,6 +27,7 @@ import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class MaxStatCommand extends Command {
|
||||
@@ -40,7 +41,7 @@ public class MaxStatCommand extends Command {
|
||||
player.loseExp(player.getExp(), false, false);
|
||||
player.setLevel(255);
|
||||
player.resetPlayerRates();
|
||||
if (ServerConstants.USE_ADD_RATES_BY_LEVEL) player.setPlayerRates();
|
||||
if (YamlConfig.config.server.USE_ADD_RATES_BY_LEVEL) player.setPlayerRates();
|
||||
player.setWorldRates();
|
||||
player.updateStrDexIntLuk(Short.MAX_VALUE);
|
||||
player.setFame(13337);
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm2;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class SpCommand extends Command {
|
||||
@@ -44,7 +45,7 @@ public class SpCommand extends Command {
|
||||
if (params.length == 1) {
|
||||
int newSp = Integer.parseInt(params[0]);
|
||||
if (newSp < 0) newSp = 0;
|
||||
else if (newSp > ServerConstants.MAX_AP) newSp = ServerConstants.MAX_AP;
|
||||
else if (newSp > YamlConfig.config.server.MAX_AP) newSp = YamlConfig.config.server.MAX_AP;
|
||||
|
||||
player.updateRemainingSp(newSp);
|
||||
} else {
|
||||
@@ -52,7 +53,7 @@ public class SpCommand extends Command {
|
||||
if (victim != null) {
|
||||
int newSp = Integer.parseInt(params[1]);
|
||||
if (newSp < 0) newSp = 0;
|
||||
else if (newSp > ServerConstants.MAX_AP) newSp = ServerConstants.MAX_AP;
|
||||
else if (newSp > YamlConfig.config.server.MAX_AP) newSp = YamlConfig.config.server.MAX_AP;
|
||||
|
||||
victim.updateRemainingSp(newSp);
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ package client.command.commands.gm5;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class SetCommand extends Command {
|
||||
@@ -35,7 +36,7 @@ public class SetCommand extends Command {
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
for (int i = 0; i < params.length; i++) {
|
||||
ServerConstants.DEBUG_VALUES[i] = Integer.parseInt(params[i]);
|
||||
YamlConfig.config.server.DEBUG_VALUES[i] = Integer.parseInt(params[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ package client.command.commands.gm5;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class ShowMoveLifeCommand extends Command {
|
||||
@@ -34,6 +35,6 @@ public class ShowMoveLifeCommand extends Command {
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
ServerConstants.USE_DEBUG_SHOW_RCVD_MVLIFE = !ServerConstants.USE_DEBUG_SHOW_RCVD_MVLIFE;
|
||||
YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_MVLIFE = !YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_MVLIFE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ package client.command.commands.gm5;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class ShowPacketsCommand extends Command {
|
||||
@@ -34,6 +35,6 @@ public class ShowPacketsCommand extends Command {
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
ServerConstants.USE_DEBUG_SHOW_RCVD_PACKET = !ServerConstants.USE_DEBUG_SHOW_RCVD_PACKET;
|
||||
YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_PACKET = !YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_PACKET;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ package client.command.commands.gm6;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class SupplyRateCouponCommand extends Command {
|
||||
@@ -37,7 +38,7 @@ public class SupplyRateCouponCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
ServerConstants.USE_SUPPLY_RATE_COUPONS = params[0].compareToIgnoreCase("no") != 0;
|
||||
player.dropMessage(5, "Rate coupons are now " + (ServerConstants.USE_SUPPLY_RATE_COUPONS ? "enabled" : "disabled") + " for purchase at the Cash Shop.");
|
||||
YamlConfig.config.server.USE_SUPPLY_RATE_COUPONS = params[0].compareToIgnoreCase("no") != 0;
|
||||
player.dropMessage(5, "Rate coupons are now " + (YamlConfig.config.server.USE_SUPPLY_RATE_COUPONS ? "enabled" : "disabled") + " for purchase at the Cash Shop.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import client.MapleSkinColor;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.server.Server;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -38,7 +39,7 @@ import tools.MaplePacketCreator;
|
||||
public abstract class CharacterFactory {
|
||||
|
||||
protected synchronized static int createNewCharacter(MapleClient c, String name, int face, int hair, int skin, int gender, CharacterFactoryRecipe recipe) {
|
||||
if (ServerConstants.COLLECTIVE_CHARSLOT ? c.getAvailableCharacterSlots() <= 0 : c.getAvailableCharacterWorldSlots() <= 0) {
|
||||
if (YamlConfig.config.server.COLLECTIVE_CHARSLOT ? c.getAvailableCharacterSlots() <= 0 : c.getAvailableCharacterWorldSlots() <= 0) {
|
||||
return -3;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import client.MapleJob;
|
||||
import client.Skill;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -56,8 +57,8 @@ public class CharacterFactoryRecipe {
|
||||
this.shoes = shoes;
|
||||
this.weapon = weapon;
|
||||
|
||||
if (!ServerConstants.USE_STARTING_AP_4) {
|
||||
if (ServerConstants.USE_AUTOASSIGN_STARTERS_AP) {
|
||||
if (!YamlConfig.config.server.USE_STARTING_AP_4) {
|
||||
if (YamlConfig.config.server.USE_AUTOASSIGN_STARTERS_AP) {
|
||||
str = 12;
|
||||
dex = 5;
|
||||
} else {
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package client.inventory;
|
||||
|
||||
import client.MapleClient;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import constants.ExpTable;
|
||||
import constants.ItemConstants;
|
||||
@@ -279,7 +280,7 @@ public class Equip extends Item {
|
||||
private static int getStatModifier(boolean isAttribute) {
|
||||
// each set of stat points grants a chance for a bonus stat point upgrade at equip level up.
|
||||
|
||||
if(ServerConstants.USE_EQUIPMNT_LVLUP_POWER) {
|
||||
if(YamlConfig.config.server.USE_EQUIPMNT_LVLUP_POWER) {
|
||||
if(isAttribute) return 2;
|
||||
else return 4;
|
||||
}
|
||||
@@ -290,7 +291,7 @@ public class Equip extends Item {
|
||||
}
|
||||
|
||||
private static int randomizeStatUpgrade(int top) {
|
||||
int limit = Math.min(top, ServerConstants.MAX_EQUIPMNT_LVLUP_STAT_UP);
|
||||
int limit = Math.min(top, YamlConfig.config.server.MAX_EQUIPMNT_LVLUP_STAT_UP);
|
||||
|
||||
int poolCount = (limit * (limit + 1) / 2) + limit;
|
||||
int rnd = Randomizer.rand(0, poolCount);
|
||||
@@ -383,7 +384,7 @@ public class Equip extends Item {
|
||||
public Pair<String, Pair<Boolean, Boolean>> gainStats(List<Pair<StatUpgrade, Integer>> stats) {
|
||||
boolean gotSlot = false, gotVicious = false;
|
||||
String lvupStr = "";
|
||||
Integer statUp, maxStat = ServerConstants.MAX_EQUIPMNT_STAT;
|
||||
Integer statUp, maxStat = YamlConfig.config.server.MAX_EQUIPMNT_STAT;
|
||||
for (Pair<StatUpgrade, Integer> stat : stats) {
|
||||
switch (stat.getLeft()) {
|
||||
case incDEX:
|
||||
@@ -483,7 +484,7 @@ public class Equip extends Item {
|
||||
}
|
||||
|
||||
if(!stats.isEmpty()) {
|
||||
if(ServerConstants.USE_EQUIPMNT_LVLUP_SLOTS) {
|
||||
if(YamlConfig.config.server.USE_EQUIPMNT_LVLUP_SLOTS) {
|
||||
if(vicious > 0) getUnitSlotUpgrade(stats, StatUpgrade.incVicious);
|
||||
getUnitSlotUpgrade(stats, StatUpgrade.incSlot);
|
||||
}
|
||||
@@ -491,7 +492,7 @@ public class Equip extends Item {
|
||||
isUpgradeable = false;
|
||||
|
||||
improveDefaultStats(stats);
|
||||
if(ServerConstants.USE_EQUIPMNT_LVLUP_SLOTS) {
|
||||
if(YamlConfig.config.server.USE_EQUIPMNT_LVLUP_SLOTS) {
|
||||
if(vicious > 0) getUnitSlotUpgrade(stats, StatUpgrade.incVicious);
|
||||
getUnitSlotUpgrade(stats, StatUpgrade.incSlot);
|
||||
}
|
||||
@@ -499,7 +500,7 @@ public class Equip extends Item {
|
||||
if(isUpgradeable) {
|
||||
while(stats.isEmpty()) {
|
||||
improveDefaultStats(stats);
|
||||
if(ServerConstants.USE_EQUIPMNT_LVLUP_SLOTS) {
|
||||
if(YamlConfig.config.server.USE_EQUIPMNT_LVLUP_SLOTS) {
|
||||
if(vicious > 0) getUnitSlotUpgrade(stats, StatUpgrade.incVicious);
|
||||
getUnitSlotUpgrade(stats, StatUpgrade.incSlot);
|
||||
}
|
||||
@@ -563,14 +564,14 @@ public class Equip extends Item {
|
||||
return;
|
||||
}
|
||||
|
||||
int equipMaxLevel = Math.min(30, Math.max(ii.getEquipLevel(this.getItemId(), true), ServerConstants.USE_EQUIPMNT_LVLUP));
|
||||
int equipMaxLevel = Math.min(30, Math.max(ii.getEquipLevel(this.getItemId(), true), YamlConfig.config.server.USE_EQUIPMNT_LVLUP));
|
||||
if (itemLevel >= equipMaxLevel) {
|
||||
return;
|
||||
}
|
||||
|
||||
int reqLevel = ii.getEquipLevelReq(this.getItemId());
|
||||
|
||||
float masteryModifier = (float)(ServerConstants.EQUIP_EXP_RATE * ExpTable.getExpNeededForLevel(1)) / (float)normalizedMasteryExp(reqLevel);
|
||||
float masteryModifier = (float)(YamlConfig.config.server.EQUIP_EXP_RATE * ExpTable.getExpNeededForLevel(1)) / (float)normalizedMasteryExp(reqLevel);
|
||||
float elementModifier = (isElemental) ? 0.85f : 0.6f;
|
||||
|
||||
float baseExpGain = gain * elementModifier * masteryModifier;
|
||||
@@ -578,7 +579,7 @@ public class Equip extends Item {
|
||||
itemExp += baseExpGain;
|
||||
int expNeeded = ExpTable.getEquipExpNeededForLevel(itemLevel);
|
||||
|
||||
if(ServerConstants.USE_DEBUG_SHOW_INFO_EQPEXP) System.out.println("'" + ii.getName(this.getItemId()) + "' -> EXP Gain: " + gain + " Mastery: " + masteryModifier + " Base gain: " + baseExpGain + " exp: " + itemExp + " / " + expNeeded + ", Kills TNL: " + expNeeded / (baseExpGain / c.getPlayer().getExpRate()));
|
||||
if(YamlConfig.config.server.USE_DEBUG_SHOW_INFO_EQPEXP) System.out.println("'" + ii.getName(this.getItemId()) + "' -> EXP Gain: " + gain + " Mastery: " + masteryModifier + " Base gain: " + baseExpGain + " exp: " + itemExp + " / " + expNeeded + ", Kills TNL: " + expNeeded / (baseExpGain / c.getPlayer().getExpRate()));
|
||||
|
||||
if (itemExp >= expNeeded) {
|
||||
while(itemExp >= expNeeded) {
|
||||
@@ -595,7 +596,7 @@ public class Equip extends Item {
|
||||
}
|
||||
|
||||
c.getPlayer().forceUpdateItem(this);
|
||||
//if(ServerConstants.USE_DEBUG) c.getPlayer().dropMessage("'" + ii.getName(this.getItemId()) + "': " + itemExp + " / " + expNeeded);
|
||||
//if(YamlConfig.config.server.USE_DEBUG) c.getPlayer().dropMessage("'" + ii.getName(this.getItemId()) + "': " + itemExp + " / " + expNeeded);
|
||||
}
|
||||
|
||||
private boolean reachedMaxLevel() {
|
||||
@@ -605,7 +606,7 @@ public class Equip extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
return itemLevel >= ServerConstants.USE_EQUIPMNT_LVLUP;
|
||||
return itemLevel >= YamlConfig.config.server.USE_EQUIPMNT_LVLUP;
|
||||
}
|
||||
|
||||
public String showEquipFeatures(MapleClient c) {
|
||||
|
||||
@@ -31,6 +31,7 @@ import client.inventory.MapleInventoryType;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.ModifyInventory;
|
||||
import client.newyear.NewYearCardRecord;
|
||||
import config.YamlConfig;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
|
||||
@@ -689,9 +690,9 @@ public class MapleInventoryManipulator {
|
||||
if (ii.isDropRestricted(it.getItemId())) {
|
||||
return true;
|
||||
} else if (ii.isCash(it.getItemId())) {
|
||||
if (ServerConstants.USE_ENFORCE_UNMERCHABLE_CASH) { // thanks Ari for noticing cash drops not available server-side
|
||||
if (YamlConfig.config.server.USE_ENFORCE_UNMERCHABLE_CASH) { // thanks Ari for noticing cash drops not available server-side
|
||||
return true;
|
||||
} else if (ItemConstants.isPet(it.getItemId()) && ServerConstants.USE_ENFORCE_UNMERCHABLE_PET) {
|
||||
} else if (ItemConstants.isPet(it.getItemId()) && YamlConfig.config.server.USE_ENFORCE_UNMERCHABLE_PET) {
|
||||
return true;
|
||||
}
|
||||
} else if (isDroppedItemRestricted(it)) {
|
||||
@@ -802,7 +803,7 @@ public class MapleInventoryManipulator {
|
||||
}
|
||||
|
||||
private static boolean isDroppedItemRestricted(Item it) {
|
||||
return ServerConstants.USE_ERASE_UNTRADEABLE_DROP && it.isUntradeable();
|
||||
return YamlConfig.config.server.USE_ERASE_UNTRADEABLE_DROP && it.isUntradeable();
|
||||
}
|
||||
|
||||
public static boolean isSandboxItem(Item it) {
|
||||
|
||||
@@ -33,6 +33,7 @@ import client.autoban.AutobanFactory;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import constants.skills.BlazeWizard;
|
||||
import constants.skills.Brawler;
|
||||
@@ -70,7 +71,7 @@ public class AssignAPProcessor {
|
||||
int remainingAp = chr.getRemainingAp();
|
||||
slea.skip(8);
|
||||
|
||||
if(ServerConstants.USE_SERVER_AUTOASSIGNER) {
|
||||
if(YamlConfig.config.server.USE_SERVER_AUTOASSIGNER) {
|
||||
// --------- Ronan Lana's AUTOASSIGNER ---------
|
||||
// This method excels for assigning APs in such a way to cover all equipments AP requirements.
|
||||
byte opt = slea.readByte(); // useful for pirate autoassigning
|
||||
@@ -135,7 +136,7 @@ public class AssignAPProcessor {
|
||||
luk = scStat;
|
||||
str = 0; dex = 0;
|
||||
|
||||
if(ServerConstants.USE_AUTOASSIGN_SECONDARY_CAP && luk + chr.getLuk() > CAP) {
|
||||
if(YamlConfig.config.server.USE_AUTOASSIGN_SECONDARY_CAP && luk + chr.getLuk() > CAP) {
|
||||
temp = luk + chr.getLuk() - CAP;
|
||||
scStat -= temp;
|
||||
prStat += temp;
|
||||
@@ -161,7 +162,7 @@ public class AssignAPProcessor {
|
||||
str = scStat;
|
||||
int_ = 0; luk = 0;
|
||||
|
||||
if(ServerConstants.USE_AUTOASSIGN_SECONDARY_CAP && str + chr.getStr() > CAP) {
|
||||
if(YamlConfig.config.server.USE_AUTOASSIGN_SECONDARY_CAP && str + chr.getStr() > CAP) {
|
||||
temp = str + chr.getStr() - CAP;
|
||||
scStat -= temp;
|
||||
prStat += temp;
|
||||
@@ -187,7 +188,7 @@ public class AssignAPProcessor {
|
||||
str = scStat;
|
||||
int_ = 0; luk = 0;
|
||||
|
||||
if(ServerConstants.USE_AUTOASSIGN_SECONDARY_CAP && str + chr.getStr() > CAP) {
|
||||
if(YamlConfig.config.server.USE_AUTOASSIGN_SECONDARY_CAP && str + chr.getStr() > CAP) {
|
||||
temp = str + chr.getStr() - CAP;
|
||||
scStat -= temp;
|
||||
prStat += temp;
|
||||
@@ -241,12 +242,12 @@ public class AssignAPProcessor {
|
||||
str = trStat;
|
||||
int_ = 0;
|
||||
|
||||
if(ServerConstants.USE_AUTOASSIGN_SECONDARY_CAP && dex + chr.getDex() > CAP) {
|
||||
if(YamlConfig.config.server.USE_AUTOASSIGN_SECONDARY_CAP && dex + chr.getDex() > CAP) {
|
||||
temp = dex + chr.getDex() - CAP;
|
||||
scStat -= temp;
|
||||
prStat += temp;
|
||||
}
|
||||
if(ServerConstants.USE_AUTOASSIGN_SECONDARY_CAP && str + chr.getStr() > CAP) {
|
||||
if(YamlConfig.config.server.USE_AUTOASSIGN_SECONDARY_CAP && str + chr.getStr() > CAP) {
|
||||
temp = str + chr.getStr() - CAP;
|
||||
trStat -= temp;
|
||||
prStat += temp;
|
||||
@@ -313,7 +314,7 @@ public class AssignAPProcessor {
|
||||
dex = scStat;
|
||||
int_ = 0; luk = 0;
|
||||
|
||||
if(ServerConstants.USE_AUTOASSIGN_SECONDARY_CAP && dex + chr.getDex() > CAP) {
|
||||
if(YamlConfig.config.server.USE_AUTOASSIGN_SECONDARY_CAP && dex + chr.getDex() > CAP) {
|
||||
temp = dex + chr.getDex() - CAP;
|
||||
scStat -= temp;
|
||||
prStat += temp;
|
||||
@@ -387,44 +388,44 @@ public class AssignAPProcessor {
|
||||
int newVal = 0;
|
||||
if (type.equals(MapleStat.STR)) {
|
||||
newVal = statUpdate[0] + gain;
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
statGain[0] += (gain - (newVal - ServerConstants.MAX_AP));
|
||||
statUpdate[0] = ServerConstants.MAX_AP;
|
||||
if (newVal > YamlConfig.config.server.MAX_AP) {
|
||||
statGain[0] += (gain - (newVal - YamlConfig.config.server.MAX_AP));
|
||||
statUpdate[0] = YamlConfig.config.server.MAX_AP;
|
||||
} else {
|
||||
statGain[0] += gain;
|
||||
statUpdate[0] = newVal;
|
||||
}
|
||||
} else if (type.equals(MapleStat.INT)) {
|
||||
newVal = statUpdate[3] + gain;
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
statGain[3] += (gain - (newVal - ServerConstants.MAX_AP));
|
||||
statUpdate[3] = ServerConstants.MAX_AP;
|
||||
if (newVal > YamlConfig.config.server.MAX_AP) {
|
||||
statGain[3] += (gain - (newVal - YamlConfig.config.server.MAX_AP));
|
||||
statUpdate[3] = YamlConfig.config.server.MAX_AP;
|
||||
} else {
|
||||
statGain[3] += gain;
|
||||
statUpdate[3] = newVal;
|
||||
}
|
||||
} else if (type.equals(MapleStat.LUK)) {
|
||||
newVal = statUpdate[2] + gain;
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
statGain[2] += (gain - (newVal - ServerConstants.MAX_AP));
|
||||
statUpdate[2] = ServerConstants.MAX_AP;
|
||||
if (newVal > YamlConfig.config.server.MAX_AP) {
|
||||
statGain[2] += (gain - (newVal - YamlConfig.config.server.MAX_AP));
|
||||
statUpdate[2] = YamlConfig.config.server.MAX_AP;
|
||||
} else {
|
||||
statGain[2] += gain;
|
||||
statUpdate[2] = newVal;
|
||||
}
|
||||
} else if (type.equals(MapleStat.DEX)) {
|
||||
newVal = statUpdate[1] + gain;
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
statGain[1] += (gain - (newVal - ServerConstants.MAX_AP));
|
||||
statUpdate[1] = ServerConstants.MAX_AP;
|
||||
if (newVal > YamlConfig.config.server.MAX_AP) {
|
||||
statGain[1] += (gain - (newVal - YamlConfig.config.server.MAX_AP));
|
||||
statUpdate[1] = YamlConfig.config.server.MAX_AP;
|
||||
} else {
|
||||
statGain[1] += gain;
|
||||
statUpdate[1] = newVal;
|
||||
}
|
||||
}
|
||||
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
return newVal - ServerConstants.MAX_AP;
|
||||
if (newVal > YamlConfig.config.server.MAX_AP) {
|
||||
return newVal - YamlConfig.config.server.MAX_AP;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -489,7 +490,7 @@ public class AssignAPProcessor {
|
||||
}
|
||||
break;
|
||||
case 2048: // HP
|
||||
if(ServerConstants.USE_ENFORCE_HPMP_SWAP) {
|
||||
if(YamlConfig.config.server.USE_ENFORCE_HPMP_SWAP) {
|
||||
if (APTo != 8192) {
|
||||
player.message("You can only swap HP ability points to MP.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
@@ -514,13 +515,13 @@ public class AssignAPProcessor {
|
||||
int curHp = player.getHp();
|
||||
int hplose = -takeHp(player.getJob());
|
||||
player.assignHP(hplose, -1);
|
||||
if (!ServerConstants.USE_FIXED_RATIO_HPMP_UPDATE) {
|
||||
if (!YamlConfig.config.server.USE_FIXED_RATIO_HPMP_UPDATE) {
|
||||
player.updateHp(Math.max(1, curHp + hplose));
|
||||
}
|
||||
|
||||
break;
|
||||
case 8192: // MP
|
||||
if(ServerConstants.USE_ENFORCE_HPMP_SWAP) {
|
||||
if(YamlConfig.config.server.USE_ENFORCE_HPMP_SWAP) {
|
||||
if (APTo != 2048) {
|
||||
player.message("You can only swap MP ability points to HP.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
@@ -558,7 +559,7 @@ public class AssignAPProcessor {
|
||||
int curMp = player.getMp();
|
||||
int mplose = -takeMp(job);
|
||||
player.assignMP(mplose, -1);
|
||||
if (!ServerConstants.USE_FIXED_RATIO_HPMP_UPDATE) {
|
||||
if (!YamlConfig.config.server.USE_FIXED_RATIO_HPMP_UPDATE) {
|
||||
player.updateMp(Math.max(0, curMp + mplose));
|
||||
}
|
||||
break;
|
||||
@@ -647,7 +648,7 @@ public class AssignAPProcessor {
|
||||
MaxHP += increaseHP.getEffect(sLvl).getY();
|
||||
}
|
||||
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 20;
|
||||
} else {
|
||||
@@ -657,7 +658,7 @@ public class AssignAPProcessor {
|
||||
MaxHP += 20;
|
||||
}
|
||||
} else if(job.isA(MapleJob.ARAN1)) {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 20;
|
||||
} else {
|
||||
@@ -667,7 +668,7 @@ public class AssignAPProcessor {
|
||||
MaxHP += 28;
|
||||
}
|
||||
} else if (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.BLAZEWIZARD1)) {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 6;
|
||||
} else {
|
||||
@@ -677,7 +678,7 @@ public class AssignAPProcessor {
|
||||
MaxHP += 6;
|
||||
}
|
||||
} else if (job.isA(MapleJob.THIEF) || job.isA(MapleJob.NIGHTWALKER1)) {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 16;
|
||||
} else {
|
||||
@@ -687,7 +688,7 @@ public class AssignAPProcessor {
|
||||
MaxHP += 16;
|
||||
}
|
||||
} else if(job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.WINDARCHER1)) {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 16;
|
||||
} else {
|
||||
@@ -705,7 +706,7 @@ public class AssignAPProcessor {
|
||||
MaxHP += increaseHP.getEffect(sLvl).getY();
|
||||
}
|
||||
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 18;
|
||||
} else {
|
||||
@@ -717,7 +718,7 @@ public class AssignAPProcessor {
|
||||
} else if (usedAPReset) {
|
||||
MaxHP += 8;
|
||||
} else {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
MaxHP += Randomizer.rand(8, 12);
|
||||
} else {
|
||||
MaxHP += 10;
|
||||
@@ -732,7 +733,7 @@ public class AssignAPProcessor {
|
||||
int MaxMP = 0;
|
||||
|
||||
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1) || job.isA(MapleJob.ARAN1)) {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(2, 4) + (player.getInt() / 10));
|
||||
} else {
|
||||
@@ -750,7 +751,7 @@ public class AssignAPProcessor {
|
||||
MaxMP += increaseMP.getEffect(sLvl).getY();
|
||||
}
|
||||
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(12, 16) + (player.getInt() / 20));
|
||||
} else {
|
||||
@@ -760,7 +761,7 @@ public class AssignAPProcessor {
|
||||
MaxMP += 18;
|
||||
}
|
||||
} else if (job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.WINDARCHER1)) {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(6, 8) + (player.getInt() / 10));
|
||||
} else {
|
||||
@@ -770,7 +771,7 @@ public class AssignAPProcessor {
|
||||
MaxMP += 10;
|
||||
}
|
||||
} else if(job.isA(MapleJob.THIEF) || job.isA(MapleJob.NIGHTWALKER1)) {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(6, 8) + (player.getInt() / 10));
|
||||
} else {
|
||||
@@ -780,7 +781,7 @@ public class AssignAPProcessor {
|
||||
MaxMP += 10;
|
||||
}
|
||||
} else if (job.isA(MapleJob.PIRATE) || job.isA(MapleJob.THUNDERBREAKER1)) {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(7, 9) + (player.getInt() / 10));
|
||||
} else {
|
||||
@@ -790,7 +791,7 @@ public class AssignAPProcessor {
|
||||
MaxMP += 14;
|
||||
}
|
||||
} else {
|
||||
if(ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(4, 6) + (player.getInt() / 10));
|
||||
} else {
|
||||
|
||||
@@ -32,6 +32,7 @@ import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.MapleKarmaManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
import java.sql.Connection;
|
||||
@@ -501,7 +502,7 @@ public class DueyProcessor {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
long timeNow = System.currentTimeMillis();
|
||||
if(timeNow - c.getPlayer().getNpcCooldown() < ServerConstants.BLOCK_NPC_RACE_CONDT) {
|
||||
if(timeNow - c.getPlayer().getNpcCooldown() < YamlConfig.config.server.BLOCK_NPC_RACE_CONDT) {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import client.MapleCharacter;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import config.YamlConfig;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
@@ -238,7 +239,7 @@ public class MakerProcessor {
|
||||
Map<Integer, Integer> reagentType = new LinkedHashMap<>();
|
||||
List<Integer> toRemove = new LinkedList<>();
|
||||
|
||||
boolean isWeapon = ItemConstants.isWeapon(toCreate) || ServerConstants.USE_MAKER_PERMISSIVE_ATKUP; // thanks Vcoc for finding a case where a weapon wouldn't be counted as such due to a bounding on isWeapon
|
||||
boolean isWeapon = ItemConstants.isWeapon(toCreate) || YamlConfig.config.server.USE_MAKER_PERMISSIVE_ATKUP; // thanks Vcoc for finding a case where a weapon wouldn't be counted as such due to a bounding on isWeapon
|
||||
|
||||
for(Map.Entry<Integer, Short> r : reagentids.entrySet()) {
|
||||
int curRid = r.getKey();
|
||||
@@ -371,8 +372,8 @@ public class MakerProcessor {
|
||||
Equip eqp = (Equip)item;
|
||||
if(ItemConstants.isAccessory(item.getItemId()) && eqp.getUpgradeSlots() <= 0) eqp.setUpgradeSlots(3);
|
||||
|
||||
if(ServerConstants.USE_ENHANCED_CRAFTING == true) {
|
||||
if(!(c.getPlayer().isGM() && ServerConstants.USE_PERFECT_GM_SCROLL)) {
|
||||
if(YamlConfig.config.server.USE_ENHANCED_CRAFTING == true) {
|
||||
if(!(c.getPlayer().isGM() && YamlConfig.config.server.USE_PERFECT_GM_SCROLL)) {
|
||||
eqp.setUpgradeSlots((byte)(eqp.getUpgradeSlots() + 1));
|
||||
}
|
||||
item = MapleItemInformationProvider.getInstance().scrollEquipWithId(eqp, 2049100, true, 2049100, c.getPlayer().isGM());
|
||||
|
||||
@@ -27,6 +27,7 @@ import client.inventory.Item;
|
||||
import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import java.util.List;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -125,13 +126,13 @@ public class PetAutopotProcessor {
|
||||
incMp = stat.getMp();
|
||||
if(incMp <= 0 && hasMpGain) incMp = Math.ceil(maxMp * stat.getMpRate());
|
||||
|
||||
if (ServerConstants.USE_COMPULSORY_AUTOPOT) {
|
||||
if (YamlConfig.config.server.USE_COMPULSORY_AUTOPOT) {
|
||||
if (hasHpGain) {
|
||||
qtyCount = (int) Math.ceil(((ServerConstants.PET_AUTOHP_RATIO * maxHp) - curHp) / incHp);
|
||||
qtyCount = (int) Math.ceil(((YamlConfig.config.server.PET_AUTOHP_RATIO * maxHp) - curHp) / incHp);
|
||||
}
|
||||
|
||||
if (hasMpGain) {
|
||||
qtyCount = Math.max(qtyCount, (int) Math.ceil(((ServerConstants.PET_AUTOMP_RATIO * maxMp) - curMp) / incMp));
|
||||
qtyCount = Math.max(qtyCount, (int) Math.ceil(((YamlConfig.config.server.PET_AUTOMP_RATIO * maxMp) - curMp) / incMp));
|
||||
}
|
||||
} else {
|
||||
qtyCount = 1; // non-compulsory autopot concept thanks to marcuswoon
|
||||
|
||||
@@ -28,6 +28,7 @@ import client.inventory.Item;
|
||||
import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleKarmaManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
@@ -167,7 +168,7 @@ public class StorageProcessor {
|
||||
storage.sendStored(c, ItemConstants.getInventoryType(itemId));
|
||||
}
|
||||
} else if (mode == 6) { // arrange items
|
||||
if(ServerConstants.USE_STORAGE_ITEM_SORT) storage.arrangeItems(c);
|
||||
if(YamlConfig.config.server.USE_STORAGE_ITEM_SORT) storage.arrangeItems(c);
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
} else if (mode == 7) { // meso
|
||||
int meso = slea.readInt();
|
||||
|
||||
305
src/config/ServerConfig.java
Normal file
305
src/config/ServerConfig.java
Normal file
@@ -0,0 +1,305 @@
|
||||
package config;
|
||||
|
||||
public class ServerConfig {
|
||||
//Thread Tracker Configuration
|
||||
public boolean USE_THREAD_TRACKER;
|
||||
|
||||
//Database Configuration
|
||||
public String DB_URL;
|
||||
public String DB_USER;
|
||||
public String DB_PASS;
|
||||
public boolean DB_CONNECTION_POOL;
|
||||
|
||||
//Login Configuration
|
||||
public int WLDLIST_SIZE;
|
||||
public int CHANNEL_SIZE;
|
||||
public int CHANNEL_LOAD;
|
||||
public int CHANNEL_LOCKS;
|
||||
|
||||
public long RESPAWN_INTERVAL;
|
||||
public long PURGING_INTERVAL;
|
||||
public long RANKING_INTERVAL;
|
||||
public long COUPON_INTERVAL;
|
||||
public long UPDATE_INTERVAL;
|
||||
|
||||
public boolean ENABLE_PIC;
|
||||
public boolean ENABLE_PIN;
|
||||
|
||||
public int BYPASS_PIC_EXPIRATION;
|
||||
public int BYPASS_PIN_EXPIRATION;
|
||||
|
||||
public boolean AUTOMATIC_REGISTER;
|
||||
public boolean BCRYPT_MIGRATION;
|
||||
public boolean COLLECTIVE_CHARSLOT;
|
||||
public boolean DETERRED_MULTICLIENT;
|
||||
|
||||
//Besides blocking logging in with several client sessions on the same machine, this also blocks suspicious login attempts for players that tries to login on an account using several diferent remote addresses.
|
||||
|
||||
//Multiclient Coordinator Configuration
|
||||
public int MAX_ALLOWED_ACCOUNT_HWID;
|
||||
public int MAX_ACCOUNT_LOGIN_ATTEMPT;
|
||||
public int LOGIN_ATTEMPT_DURATION;
|
||||
|
||||
//Ip Configuration
|
||||
public String HOST;
|
||||
public boolean LOCALSERVER;
|
||||
public boolean GMSERVER;
|
||||
|
||||
//Other configuration
|
||||
public boolean SHUTDOWNHOOK;
|
||||
|
||||
//Server Flags
|
||||
public boolean USE_CUSTOM_KEYSET;
|
||||
public boolean USE_DEBUG;
|
||||
public boolean USE_DEBUG_SHOW_INFO_EQPEXP;
|
||||
public boolean USE_DEBUG_SHOW_RCVD_PACKET;
|
||||
public boolean USE_DEBUG_SHOW_RCVD_MVLIFE;
|
||||
public boolean USE_DEBUG_SHOW_PACKET;
|
||||
public boolean USE_SUPPLY_RATE_COUPONS;
|
||||
public boolean USE_IP_VALIDATION;
|
||||
|
||||
public boolean USE_MAXRANGE;
|
||||
public boolean USE_MAXRANGE_ECHO_OF_HERO;
|
||||
public boolean USE_MTS;
|
||||
public boolean USE_CPQ;
|
||||
public boolean USE_AUTOHIDE_GM;
|
||||
public boolean USE_BUYBACK_SYSTEM;
|
||||
public boolean USE_FIXED_RATIO_HPMP_UPDATE;
|
||||
public boolean USE_FAMILY_SYSTEM;
|
||||
public boolean USE_DUEY;
|
||||
public boolean USE_RANDOMIZE_HPMP_GAIN;
|
||||
public boolean USE_STORAGE_ITEM_SORT;
|
||||
public boolean USE_ITEM_SORT;
|
||||
public boolean USE_ITEM_SORT_BY_NAME;
|
||||
public boolean USE_PARTY_FOR_STARTERS;
|
||||
public boolean USE_AUTOASSIGN_STARTERS_AP;
|
||||
public boolean USE_AUTOASSIGN_SECONDARY_CAP;
|
||||
public boolean USE_STARTING_AP_4;
|
||||
public boolean USE_AUTOBAN;
|
||||
public boolean USE_AUTOBAN_LOG;
|
||||
public boolean USE_AUTOSAVE;
|
||||
public boolean USE_SERVER_AUTOASSIGNER;
|
||||
public boolean USE_REFRESH_RANK_MOVE;
|
||||
public boolean USE_ENFORCE_ADMIN_ACCOUNT;
|
||||
public boolean USE_ENFORCE_NOVICE_EXPRATE;
|
||||
public boolean USE_ENFORCE_HPMP_SWAP;
|
||||
public boolean USE_ENFORCE_MOB_LEVEL_RANGE;
|
||||
public boolean USE_ENFORCE_JOB_LEVEL_RANGE;
|
||||
public boolean USE_ENFORCE_JOB_SP_RANGE;
|
||||
public boolean USE_ENFORCE_ITEM_SUGGESTION;
|
||||
public boolean USE_ENFORCE_UNMERCHABLE_CASH;
|
||||
public boolean USE_ENFORCE_UNMERCHABLE_PET;
|
||||
public boolean USE_ENFORCE_MERCHANT_SAVE;
|
||||
public boolean USE_ENFORCE_MDOOR_POSITION;
|
||||
public boolean USE_SPAWN_CLEAN_MDOOR;
|
||||
public boolean USE_SPAWN_LOOT_ON_ANIMATION;
|
||||
public boolean USE_SPAWN_RELEVANT_LOOT;
|
||||
public boolean USE_ERASE_PERMIT_ON_OPENSHOP;
|
||||
public boolean USE_ERASE_UNTRADEABLE_DROP;
|
||||
public boolean USE_ERASE_PET_ON_EXPIRATION;
|
||||
public boolean USE_BUFF_MOST_SIGNIFICANT;
|
||||
public boolean USE_BUFF_EVERLASTING;
|
||||
public boolean USE_MULTIPLE_SAME_EQUIP_DROP;
|
||||
public boolean USE_BANISHABLE_TOWN_SCROLL;
|
||||
public boolean USE_ENABLE_FULL_RESPAWN;
|
||||
public boolean USE_ENABLE_CHAT_LOG;
|
||||
public boolean USE_REBIRTH_SYSTEM;
|
||||
public boolean USE_MAP_OWNERSHIP_SYSTEM;
|
||||
public boolean USE_FISHING_SYSTEM;
|
||||
public boolean USE_NPCS_SCRIPTABLE;
|
||||
|
||||
//Events/PQs Configuration
|
||||
public boolean USE_OLD_GMS_STYLED_PQ_NPCS;
|
||||
public boolean USE_ENABLE_SOLO_EXPEDITIONS;
|
||||
public boolean USE_ENABLE_DAILY_EXPEDITIONS;
|
||||
public boolean USE_ENABLE_RECALL_EVENT;
|
||||
|
||||
//Announcement Configuration
|
||||
public boolean USE_ANNOUNCE_SHOPITEMSOLD;
|
||||
public boolean USE_ANNOUNCE_CHANGEJOB;
|
||||
|
||||
//Cash Shop Configuration
|
||||
public boolean USE_JOINT_CASHSHOP_INVENTORY;
|
||||
public boolean USE_CLEAR_OUTDATED_COUPONS;
|
||||
public boolean ALLOW_CASHSHOP_NAME_CHANGE;
|
||||
public boolean ALLOW_CASHSHOP_WORLD_TRANSFER;//Allows players to buy world transfers in the cash shop.
|
||||
|
||||
//Maker Configuration
|
||||
public boolean USE_MAKER_PERMISSIVE_ATKUP;
|
||||
public boolean USE_MAKER_FEE_HEURISTICS;
|
||||
|
||||
//Custom Configuration
|
||||
public boolean USE_ENABLE_CUSTOM_NPC_SCRIPT;
|
||||
public boolean USE_STARTER_MERGE;
|
||||
|
||||
//Commands Configuration
|
||||
public boolean BLOCK_GENERATE_CASH_ITEM;
|
||||
public boolean USE_WHOLE_SERVER_RANKING;
|
||||
|
||||
public double EQUIP_EXP_RATE;
|
||||
public double PQ_BONUS_EXP_RATE;
|
||||
|
||||
public byte EXP_SPLIT_LEVEL_INTERVAL;
|
||||
public byte EXP_SPLIT_LEECH_INTERVAL;
|
||||
public float EXP_SPLIT_MVP_MOD;
|
||||
public float EXP_SPLIT_COMMON_MOD;
|
||||
public float PARTY_BONUS_EXP_RATE;
|
||||
|
||||
//Miscellaneous Configuration
|
||||
public String TIMEZONE;
|
||||
public boolean USE_DISPLAY_NUMBERS_WITH_COMMA;
|
||||
public boolean USE_UNITPRICE_WITH_COMMA;
|
||||
public byte MAX_MONITORED_BUFFSTATS;
|
||||
public int MAX_AP;
|
||||
public int MAX_EVENT_LEVELS;
|
||||
public long BLOCK_NPC_RACE_CONDT;
|
||||
public long PET_LOOT_UPON_ATTACK;
|
||||
public int TOT_MOB_QUEST_REQUIREMENT;
|
||||
public int MOB_REACTOR_REFRESH_TIME;
|
||||
public int PARTY_SEARCH_REENTRY_LIMIT;
|
||||
public long NAME_CHANGE_COOLDOWN;
|
||||
public long WORLD_TRANSFER_COOLDOWN=NAME_CHANGE_COOLDOWN;//Cooldown for world tranfers, default is same as name change (30 days).
|
||||
public boolean INSTANT_NAME_CHANGE;
|
||||
|
||||
//Dangling Items/Locks Configuration
|
||||
public int ITEM_EXPIRE_TIME ;
|
||||
public int KITE_EXPIRE_TIME ;
|
||||
public int ITEM_MONITOR_TIME;
|
||||
public int LOCK_MONITOR_TIME;
|
||||
|
||||
//Map Monitor Configuration
|
||||
public int ITEM_EXPIRE_CHECK;
|
||||
public int ITEM_LIMIT_ON_MAP;
|
||||
public int MAP_VISITED_SIZE;
|
||||
public int MAP_DAMAGE_OVERTIME_INTERVAL;
|
||||
|
||||
//Channel Mob Disease Monitor Configuration
|
||||
public int MOB_STATUS_MONITOR_PROC;
|
||||
public int MOB_STATUS_MONITOR_LIFE;
|
||||
public int MOB_STATUS_AGGRO_PERSISTENCE;
|
||||
public int MOB_STATUS_AGGRO_INTERVAL;
|
||||
|
||||
//Some Gameplay Enhancing Configurations
|
||||
//Scroll Configuration
|
||||
public boolean USE_PERFECT_GM_SCROLL;
|
||||
public boolean USE_PERFECT_SCROLLING;
|
||||
public boolean USE_ENHANCED_CHSCROLL;
|
||||
public boolean USE_ENHANCED_CRAFTING;
|
||||
public boolean USE_ENHANCED_CLNSLATE;
|
||||
public int SCROLL_CHANCE_RATE;
|
||||
public int CHSCROLL_STAT_RATE;
|
||||
public int CHSCROLL_STAT_RANGE;
|
||||
|
||||
//Beginner Skills Configuration
|
||||
public boolean USE_ULTRA_NIMBLE_FEET;
|
||||
public boolean USE_ULTRA_RECOVERY;
|
||||
public boolean USE_ULTRA_THREE_SNAILS;
|
||||
|
||||
//Other Skills Configuration
|
||||
public boolean USE_FULL_ARAN_SKILLSET;
|
||||
public boolean USE_FAST_REUSE_HERO_WILL;
|
||||
public boolean USE_ANTI_IMMUNITY_CRASH;
|
||||
public boolean USE_UNDISPEL_HOLY_SHIELD;
|
||||
public boolean USE_FULL_HOLY_SYMBOL;
|
||||
|
||||
//Character Configuration
|
||||
public boolean USE_ADD_SLOTS_BY_LEVEL;
|
||||
public boolean USE_ADD_RATES_BY_LEVEL;
|
||||
public boolean USE_STACK_COUPON_RATES;
|
||||
public boolean USE_PERFECT_PITCH;
|
||||
|
||||
//Quest Configuration
|
||||
public boolean USE_QUEST_RATE;
|
||||
|
||||
//Quest Points Configuration
|
||||
public int QUEST_POINT_REPEATABLE_INTERVAL;
|
||||
public int QUEST_POINT_REQUIREMENT;
|
||||
public int QUEST_POINT_PER_QUEST_COMPLETE;
|
||||
public int QUEST_POINT_PER_EVENT_CLEAR;
|
||||
|
||||
//Guild Configuration
|
||||
public int CREATE_GUILD_MIN_PARTNERS;
|
||||
public int CREATE_GUILD_COST;
|
||||
public int CHANGE_EMBLEM_COST;
|
||||
public int EXPAND_GUILD_BASE_COST;
|
||||
public int EXPAND_GUILD_TIER_COST;
|
||||
public int EXPAND_GUILD_MAX_COST;
|
||||
|
||||
//Family Configuration
|
||||
public int FAMILY_REP_PER_KILL;
|
||||
public int FAMILY_REP_PER_BOSS_KILL;
|
||||
public int FAMILY_REP_PER_LEVELUP;
|
||||
public int FAMILY_MAX_GENERATIONS;
|
||||
|
||||
//Equipment Configuration
|
||||
public boolean USE_EQUIPMNT_LVLUP_SLOTS;
|
||||
public boolean USE_EQUIPMNT_LVLUP_POWER;
|
||||
public boolean USE_EQUIPMNT_LVLUP_CASH;
|
||||
public boolean USE_SPIKES_AVOID_BANISH;
|
||||
public int MAX_EQUIPMNT_LVLUP_STAT_UP;
|
||||
public int MAX_EQUIPMNT_STAT;
|
||||
public int USE_EQUIPMNT_LVLUP;
|
||||
|
||||
//Map-Chair Configuration
|
||||
public boolean USE_CHAIR_EXTRAHEAL;
|
||||
public byte CHAIR_EXTRA_HEAL_MULTIPLIER;
|
||||
public int CHAIR_EXTRA_HEAL_MAX_DELAY;
|
||||
|
||||
//Player NPC Configuration
|
||||
public int PLAYERNPC_INITIAL_X;
|
||||
public int PLAYERNPC_INITIAL_Y;
|
||||
public int PLAYERNPC_AREA_X;
|
||||
public int PLAYERNPC_AREA_Y;
|
||||
public int PLAYERNPC_AREA_STEPS;
|
||||
public boolean PLAYERNPC_ORGANIZE_AREA;
|
||||
public boolean PLAYERNPC_AUTODEPLOY;
|
||||
|
||||
//Pet Auto-Pot Configuration
|
||||
public boolean USE_COMPULSORY_AUTOPOT;
|
||||
public boolean USE_EQUIPS_ON_AUTOPOT;
|
||||
public double PET_AUTOHP_RATIO;
|
||||
public double PET_AUTOMP_RATIO;
|
||||
|
||||
//Pet & Mount Configuration
|
||||
public byte PET_EXHAUST_COUNT;
|
||||
public byte MOUNT_EXHAUST_COUNT;
|
||||
|
||||
//Pet Hunger Configuration
|
||||
public boolean PETS_NEVER_HUNGRY;
|
||||
public boolean GM_PETS_NEVER_HUNGRY;
|
||||
|
||||
//Event Configuration
|
||||
public int EVENT_MAX_GUILD_QUEUE;
|
||||
public long EVENT_LOBBY_DELAY;
|
||||
|
||||
//Dojo Configuration
|
||||
public boolean USE_FAST_DOJO_UPGRADE;
|
||||
public boolean USE_DEADLY_DOJO;
|
||||
public int DOJO_ENERGY_ATK;
|
||||
public int DOJO_ENERGY_DMG;
|
||||
|
||||
//Wedding Configuration
|
||||
public int WEDDING_RESERVATION_DELAY;
|
||||
public int WEDDING_RESERVATION_TIMEOUT;
|
||||
public int WEDDING_RESERVATION_INTERVAL;
|
||||
public int WEDDING_BLESS_EXP;
|
||||
public int WEDDING_GIFT_LIMIT;
|
||||
public boolean WEDDING_BLESSER_SHOWFX;
|
||||
|
||||
//Buyback Configuration
|
||||
public boolean USE_BUYBACK_WITH_MESOS;
|
||||
public float BUYBACK_FEE;
|
||||
public float BUYBACK_LEVEL_STACK_FEE;
|
||||
public int BUYBACK_MESO_MULTIPLIER;
|
||||
public int BUYBACK_RETURN_MINUTES;
|
||||
public int BUYBACK_COOLDOWN_MINUTES;
|
||||
|
||||
// Login timeout by shavit
|
||||
public long TIMEOUT_DURATION;
|
||||
|
||||
//Event End Timestamp
|
||||
public long EVENT_END_TIMESTAMP;
|
||||
|
||||
//Debug Variables
|
||||
public int DEBUG_VALUES[];
|
||||
}
|
||||
16
src/config/WorldConfig.java
Normal file
16
src/config/WorldConfig.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package config;
|
||||
|
||||
public class WorldConfig {
|
||||
public int flag = 0;
|
||||
public String server_message = "Welcome!";
|
||||
public String event_message = "";
|
||||
public String why_am_i_recommended = "";
|
||||
public int channels = 1;
|
||||
public int exp_rate = 1;
|
||||
public int meso_rate = 1;
|
||||
public int drop_rate = 1;
|
||||
public int boss_drop_rate = 1;
|
||||
public int quest_rate = 1;
|
||||
public int travel_rate = 1;
|
||||
public int fishing_rate = 1;
|
||||
}
|
||||
30
src/config/YamlConfig.java
Normal file
30
src/config/YamlConfig.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class YamlConfig {
|
||||
|
||||
public static final YamlConfig config = fromFile("config.yaml");
|
||||
public List<WorldConfig> worlds;
|
||||
public ServerConfig server;
|
||||
|
||||
public static YamlConfig fromFile(String filename) {
|
||||
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
|
||||
try {
|
||||
return mapper.readValue(new File(filename), YamlConfig.class);
|
||||
} catch (FileNotFoundException e) {
|
||||
String message = "Could not read config file " + filename + ": " + e.getMessage();
|
||||
throw new RuntimeException(message);
|
||||
} catch (IOException e) {
|
||||
String message = "Could not successfully parse config file " + filename + ": " + e.getMessage();
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import client.MapleJob;
|
||||
import config.YamlConfig;
|
||||
import constants.skills.Aran;
|
||||
import java.io.File;
|
||||
import java.text.DecimalFormat;
|
||||
@@ -40,7 +41,7 @@ public class GameConstants {
|
||||
private static final int[] jobUpgradeSpUp = {0, 1, 2, 3, 6};
|
||||
private final static Map<Integer, String> jobNames = new HashMap<>();
|
||||
private final static NumberFormat nfFormatter = new DecimalFormat("#,###,###,###");
|
||||
private final static NumberFormat nfParser = NumberFormat.getInstance(ServerConstants.USE_UNITPRICE_WITH_COMMA ? Locale.FRANCE : Locale.UK);
|
||||
private final static NumberFormat nfParser = NumberFormat.getInstance(YamlConfig.config.server.USE_UNITPRICE_WITH_COMMA ? Locale.FRANCE : Locale.UK);
|
||||
|
||||
public static final MapleDisease[] CPQ_DISEASES = {MapleDisease.SLOW, MapleDisease.SEDUCE, MapleDisease.STUN, MapleDisease.POISON,
|
||||
MapleDisease.SEAL, MapleDisease.DARKNESS, MapleDisease.WEAKEN, MapleDisease.CURSE};
|
||||
@@ -666,7 +667,7 @@ public class GameConstants {
|
||||
}
|
||||
|
||||
public synchronized static String numberWithCommas(int i) {
|
||||
if(!ServerConstants.USE_DISPLAY_NUMBERS_WITH_COMMA) {
|
||||
if(!YamlConfig.config.server.USE_DISPLAY_NUMBERS_WITH_COMMA) {
|
||||
return nfFormatter.format(i); // will display number on whatever locale is currently assigned on NumberFormat
|
||||
} else {
|
||||
return NumberFormat.getNumberInstance(Locale.UK).format(i);
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
package constants;
|
||||
|
||||
import client.inventory.MapleInventoryType;
|
||||
import config.YamlConfig;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.HashMap;
|
||||
@@ -107,7 +109,7 @@ public final class ItemConstants {
|
||||
}
|
||||
|
||||
public static boolean isExpirablePet(int itemId) {
|
||||
return ServerConstants.USE_ERASE_PET_ON_EXPIRATION || itemId == 5000054;
|
||||
return YamlConfig.config.server.USE_ERASE_PET_ON_EXPIRATION || itemId == 5000054;
|
||||
}
|
||||
|
||||
public static boolean isPermanentItem(int itemId) {
|
||||
|
||||
@@ -1,347 +1,15 @@
|
||||
package constants;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
public class ServerConstants {
|
||||
//Thread Tracker Configuration
|
||||
public static final boolean USE_THREAD_TRACKER = true; //[SEVERE] This deadlock auditing thing will bloat the memory as fast as the time frame one takes to lose track of a raindrop on a tempesting day. Only for debugging purposes.
|
||||
|
||||
//Database Configuration
|
||||
public static String DB_URL = "";
|
||||
public static String DB_USER = "";
|
||||
public static String DB_PASS = "";
|
||||
public static final boolean DB_CONNECTION_POOL = true; //Installs a connection pool to hub DB connections. Set false to default.
|
||||
|
||||
//Server Version
|
||||
public static short VERSION = 83;
|
||||
|
||||
//Login Configuration
|
||||
public static final int WLDLIST_SIZE = 21; //Max possible worlds on the server.
|
||||
public static final int CHANNEL_SIZE = 20; //Max possible channels per world (which is 20, based on the channel list on login phase).
|
||||
public static final int CHANNEL_LOAD = 100; //Max players per channel (limit actually used to calculate the World server capacity).
|
||||
public static final int CHANNEL_LOCKS = 20; //Total number of structure management locks each channel has.
|
||||
|
||||
public static final long RESPAWN_INTERVAL = 10 * 1000; //10 seconds, 10000.
|
||||
public static final long PURGING_INTERVAL = 5 * 60 * 1000;
|
||||
public static final long RANKING_INTERVAL = 60 * 60 * 1000; //60 minutes, 3600000.
|
||||
public static final long COUPON_INTERVAL = 60 * 60 * 1000; //60 minutes, 3600000.
|
||||
public static final long UPDATE_INTERVAL = 777; //Dictates the frequency on which the "centralized server time" is updated.
|
||||
|
||||
public static final boolean ENABLE_PIC = false; //Pick true/false to enable or disable Pic. Delete character requires PIC available.
|
||||
public static final boolean ENABLE_PIN = false; //Pick true/false to enable or disable Pin.
|
||||
|
||||
public static final int BYPASS_PIC_EXPIRATION = 20; //Enables PIC bypass, which will remain active for that account by that client machine for N minutes. Set 0 to disable.
|
||||
public static final int BYPASS_PIN_EXPIRATION = 15; //Enables PIN bypass, which will remain active for that account by that client machine for N minutes. Set 0 to disable.
|
||||
|
||||
public static final boolean AUTOMATIC_REGISTER = true; //Automatically register players when they login with a nonexistent username.
|
||||
public static final boolean BCRYPT_MIGRATION = true; //Performs a migration from old SHA-1 and SHA-512 password to bcrypt.
|
||||
public static final boolean COLLECTIVE_CHARSLOT = false; //Available character slots are contabilized globally rather than per world server.
|
||||
public static final boolean DETERRED_MULTICLIENT = false; //Enables detection of multi-client and suspicious remote IP on the login system.
|
||||
|
||||
//Besides blocking logging in with several client sessions on the same machine, this also blocks suspicious login attempts for players that tries to login on an account using several diferent remote addresses.
|
||||
|
||||
//Multiclient Coordinator Configuration
|
||||
public static final int MAX_ALLOWED_ACCOUNT_HWID = 4; //Allows up to N concurrent HWID's for an account. HWID's remains linked to an account longer the more times it's used to login.
|
||||
public static final int MAX_ACCOUNT_LOGIN_ATTEMPT = 15; //After N tries on an account, login on that account gets disabled for a short period.
|
||||
public static final int LOGIN_ATTEMPT_DURATION = 120; //Period in seconds the login attempt remains registered on the system.
|
||||
|
||||
//Ip Configuration
|
||||
public static String HOST;
|
||||
public static boolean LOCALSERVER;
|
||||
|
||||
//Other Configuration
|
||||
public static final boolean JAVA_8 = getJavaVersion() >= 8;
|
||||
public static boolean SHUTDOWNHOOK;
|
||||
|
||||
//Server Flags
|
||||
public static final boolean USE_CUSTOM_KEYSET = true; //Enables auto-setup of the HeavenMS's custom keybindings when creating characters.
|
||||
public static final boolean USE_DEBUG = false; //Will enable some text prints on the client, oriented for debugging purposes.
|
||||
public static final boolean USE_DEBUG_SHOW_INFO_EQPEXP = false; //Prints on the cmd all equip exp gain info.
|
||||
public static boolean USE_DEBUG_SHOW_RCVD_PACKET = false; //Prints on the cmd all received packet ids.
|
||||
public static boolean USE_DEBUG_SHOW_RCVD_MVLIFE = false; //Prints on the cmd all received move life content.
|
||||
public static final boolean USE_DEBUG_SHOW_PACKET = false;
|
||||
public static boolean USE_SUPPLY_RATE_COUPONS = true; //Allows rate coupons to be sold through the Cash Shop.
|
||||
public static final boolean USE_IP_VALIDATION = true; //Enables IP checking when logging in.
|
||||
|
||||
public static final boolean USE_MAXRANGE = true; //Will send and receive packets from all events on a map, rather than those of only view range.
|
||||
public static final boolean USE_MAXRANGE_ECHO_OF_HERO = true;
|
||||
public static final boolean USE_MTS = false;
|
||||
public static final boolean USE_CPQ = true; //Renders the CPQ available or not.
|
||||
public static final boolean USE_AUTOHIDE_GM = false; //When enabled, GMs are automatically hidden when joining. Thanks to Steven Deblois (steven1152).
|
||||
public static final boolean USE_BUYBACK_SYSTEM = true; //Enables the HeavenMS-builtin buyback system, to be used by dead players when clicking the MTS button.
|
||||
public static final boolean USE_FIXED_RATIO_HPMP_UPDATE = true; //Enables the HeavenMS-builtin HPMP update based on the current pool to max pool ratio.
|
||||
public static final boolean USE_FAMILY_SYSTEM = true;
|
||||
public static final boolean USE_DUEY = true;
|
||||
public static final boolean USE_RANDOMIZE_HPMP_GAIN = true; //Enables randomizing on MaxHP/MaxMP gains and INT accounting for the MaxMP gain on level up.
|
||||
public static final boolean USE_STORAGE_ITEM_SORT = true; //Enables storage "Arrange Items" feature.
|
||||
public static final boolean USE_ITEM_SORT = true; //Enables inventory "Item Sort/Merge" feature.
|
||||
public static final boolean USE_ITEM_SORT_BY_NAME = false; //Item sorting based on name rather than id.
|
||||
public static final boolean USE_PARTY_FOR_STARTERS = true; //Players level 10 or below can create/invite other players on the given level range.
|
||||
public static final boolean USE_AUTOASSIGN_STARTERS_AP = false; //Beginners level 10 or below have their AP autoassigned (they can't choose to levelup a stat). Set true ONLY if the localhost doesn't support AP assigning for beginners level 10 or below.
|
||||
public static final boolean USE_AUTOASSIGN_SECONDARY_CAP = true;//Prevents AP autoassign from spending on secondary stats after the player class' cap (defined on the autoassign handler) has been reached.
|
||||
public static final boolean USE_STARTING_AP_4 = true; //Use early-GMS 4/4/4/4 starting stats. To overcome AP shortage, this gives 4AP/5AP at 1st/2nd job advancements.
|
||||
public static final boolean USE_AUTOBAN = false; //Commands the server to detect infractors automatically.
|
||||
public static final boolean USE_AUTOBAN_LOG = true; //Log autoban related messages. Still logs even with USE_AUTOBAN disabled.
|
||||
public static final boolean USE_AUTOSAVE = true; //Enables server autosaving feature (saves characters to DB each 1 hour).
|
||||
public static final boolean USE_SERVER_AUTOASSIGNER = true; //HeavenMS-builtin autoassigner, uses algorithm based on distributing AP accordingly with required secondary stat on equipments.
|
||||
public static final boolean USE_REFRESH_RANK_MOVE = true;
|
||||
public static final boolean USE_ENFORCE_ADMIN_ACCOUNT = false; //Forces accounts having GM characters to be treated as a "GM account" by the client (localhost). Some of the GM account perks is the ability to FLY, but unable to TRADE.
|
||||
public static final boolean USE_ENFORCE_NOVICE_EXPRATE = false; //Hardsets experience rate 1x for beginners level 10 or under. Ideal for roaming on novice areas without caring too much about losing some stats.
|
||||
public static final boolean USE_ENFORCE_HPMP_SWAP = false; //Forces players to reuse stats (via AP Resetting) located on HP/MP pool only inside the HP/MP stats.
|
||||
public static final boolean USE_ENFORCE_MOB_LEVEL_RANGE = true; //Players N levels below the killed mob will gain no experience from defeating it.
|
||||
public static final boolean USE_ENFORCE_JOB_LEVEL_RANGE = false;//Caps the player level on the minimum required to advance their current jobs.
|
||||
public static final boolean USE_ENFORCE_JOB_SP_RANGE = false; //Caps the player SP level on the total obtainable by their current jobs. After changing jobs, missing SP will be retrieved.
|
||||
public static final boolean USE_ENFORCE_ITEM_SUGGESTION = false;//Forces the Owl of Minerva and the Cash Shop to always display the defined item array instead of those featured by the players.
|
||||
public static final boolean USE_ENFORCE_UNMERCHABLE_CASH = true;//Forces players to not sell CASH items via merchants, drops of it disappears.
|
||||
public static final boolean USE_ENFORCE_UNMERCHABLE_PET = true; //Forces players to not sell pets via merchants, drops of it disappears. (since non-named pets gets dirty name and other possible DB-related issues)
|
||||
public static final boolean USE_ENFORCE_MERCHANT_SAVE = true; //Forces automatic DB save on merchant owners, at every item movement on shop.
|
||||
public static final boolean USE_ENFORCE_MDOOR_POSITION = false; //Forces mystic door to be spawned near spawnpoints.
|
||||
public static final boolean USE_SPAWN_CLEAN_MDOOR = false; //Makes mystic doors to be spawned without deploy animation. This clears disconnecting issues that may happen when trying to cancel doors a couple seconds after deployment.
|
||||
public static final boolean USE_SPAWN_LOOT_ON_ANIMATION = false;//Makes loot appear some time after the mob has been killed (following the mob death animation, instead of instantly).
|
||||
public static final boolean USE_SPAWN_RELEVANT_LOOT = true; //Forces to only spawn loots that are collectable by the player or any of their party members.
|
||||
public static final boolean USE_ERASE_PERMIT_ON_OPENSHOP = true;//Forces "shop permit" item to be consumed when player deploy his/her player shop.
|
||||
public static final boolean USE_ERASE_UNTRADEABLE_DROP = true; //Forces flagged untradeable items to disappear when dropped.
|
||||
public static final boolean USE_ERASE_PET_ON_EXPIRATION = false;//Forces pets to be removed from inventory when expire time comes, rather than converting it to a doll.
|
||||
public static final boolean USE_BUFF_MOST_SIGNIFICANT = true; //When applying buffs, the player will stick with the highest stat boost among the listed, rather than overwriting stats.
|
||||
public static final boolean USE_BUFF_EVERLASTING = false; //Every applied buff on players holds expiration time so high it'd be considered permanent. Suggestion thanks to Vcoc.
|
||||
public static final boolean USE_MULTIPLE_SAME_EQUIP_DROP = true;//Enables multiple drops by mobs of the same equipment, number of possible drops based on the quantities provided at the drop data.
|
||||
public static final boolean USE_BANISHABLE_TOWN_SCROLL = true; //Enables town scrolls to act as if it's a "player banish", rendering the antibanish scroll effect available.
|
||||
public static final boolean USE_ENABLE_FULL_RESPAWN = true; //At respawn task, always respawn missing mobs when they're available. Spawn count doesn't depend on how many players are currently there.
|
||||
public static final boolean USE_ENABLE_CHAT_LOG = false; //Write in-game chat to log
|
||||
public static final boolean USE_REBIRTH_SYSTEM = false; //Flag to enable/disable rebirth system
|
||||
public static final boolean USE_MAP_OWNERSHIP_SYSTEM = true; //Flag to enable/disable map ownership system
|
||||
public static final boolean USE_FISHING_SYSTEM = true; //Flag to enable/disable custom fishing system
|
||||
public static final boolean USE_NPCS_SCRIPTABLE = true; //Flag to enable/disable serverside predefined script NPCs.
|
||||
|
||||
//Events/PQs Configuration
|
||||
public static final boolean USE_OLD_GMS_STYLED_PQ_NPCS = true; //Enables PQ NPCs with similar behaviour to old GMS style, that skips info about the PQs and immediately tries to register the party in.
|
||||
public static final boolean USE_ENABLE_SOLO_EXPEDITIONS = true; //Enables start expeditions with any number of players. This will also bypass all the Zakum prequest.
|
||||
public static final boolean USE_ENABLE_DAILY_EXPEDITIONS = false;//Enables daily entry limitations in expeditions.
|
||||
public static final boolean USE_ENABLE_RECALL_EVENT = false; //Enables a disconnected player to reaccess the last event instance they were in before logging out. Recall only works if the event isn't cleared or disposed yet. Suggestion thanks to Alisson (Goukken).
|
||||
|
||||
//Announcement Configuration
|
||||
public static final boolean USE_ANNOUNCE_SHOPITEMSOLD = false; //Automatic message sent to owner when an item from the Player Shop or Hired Merchant is sold.
|
||||
public static final boolean USE_ANNOUNCE_CHANGEJOB = false; //Automatic message sent to acquantainces when changing jobs.
|
||||
|
||||
//Cash Shop Configuration
|
||||
public static final boolean USE_JOINT_CASHSHOP_INVENTORY = true;//Enables usage of a same cash shop inventory for explorers, cygnus and legends. Items from exclusive cash shop inventories won't show up on the shared inventory, though.
|
||||
public static final boolean USE_CLEAR_OUTDATED_COUPONS = true; //Enables deletion of older code coupon registry from the DB, freeing so-long irrelevant data.
|
||||
public static final boolean ALLOW_CASHSHOP_NAME_CHANGE = true; //Allows players to buy name changes in the cash shop.
|
||||
public static final boolean ALLOW_CASHSHOP_WORLD_TRANSFER =true;//Allows players to buy world transfers in the cash shop.
|
||||
|
||||
//Maker Configuration
|
||||
public static final boolean USE_MAKER_PERMISSIVE_ATKUP = true; //Allows players to use attack-based strengthening gems on non-weapon items.
|
||||
public static final boolean USE_MAKER_FEE_HEURISTICS = true; //Apply compiled values for stimulants and reagents into the Maker fee calculations (max error revolves around 50k mesos). Set false to use basic constant values instead (results are never higher than requested by the client-side).
|
||||
|
||||
//Custom Configuration
|
||||
public static final boolean USE_ENABLE_CUSTOM_NPC_SCRIPT = true;//Enables usage of custom HeavenMS NPC scripts (Agent E, Coco, etc). Will not disable Abdula (it's actually useful for the gameplay) or quests.
|
||||
public static final boolean USE_STARTER_MERGE = false; //Allows any players to use the Equipment Merge custom mechanic (as opposed to the high-level, Maker lv3 requisites).
|
||||
|
||||
//Commands Configuration
|
||||
public static final boolean BLOCK_GENERATE_CASH_ITEM = false; //Prevents creation of cash items with the item/drop command.
|
||||
public static final boolean USE_WHOLE_SERVER_RANKING = false; //Enables a ranking pool made from every character registered on the server for the "ranks" command, instead of separated by worlds.
|
||||
|
||||
//Server Rates And Experience
|
||||
public static final int EXP_RATE = 10; //NOTE: World-specific rates within "world.ini" OVERRIDES the default rates from here.
|
||||
public static final int MESO_RATE = 10;
|
||||
public static final int DROP_RATE = 10;
|
||||
public static final int BOSS_DROP_RATE = 10; //NOTE: Boss drop rate OVERRIDES common drop rate, for bosses-only.
|
||||
public static final int QUEST_RATE = 5; //Multiplier for Exp & Meso gains when completing a quest. Only available when USE_QUEST_RATE is true. Stacks with server Exp & Meso rates.
|
||||
public static final int FISHING_RATE = 10; //Multiplier for success likelihood on meso thrown during fishing.
|
||||
public static final int TRAVEL_RATE = 10; //Means of transportation rides/departs using 1/N of the default time.
|
||||
|
||||
public static final double EQUIP_EXP_RATE = 1.0; //Rate for equipment exp gain, grows linearly. Set 1.0 for default (about 100~200 same-level range mobs killed to pass equip from level 1 to 2).
|
||||
public static final double PQ_BONUS_EXP_RATE = 0.5; //Rate for the PQ exp reward.
|
||||
|
||||
public static final byte EXP_SPLIT_LEVEL_INTERVAL = 5; //Non-contributing players must be within N level between the mob to receive EXP.
|
||||
public static final byte EXP_SPLIT_LEECH_INTERVAL = 5; //Non-contributing players must be within N level between any contributing party member to receive EXP.
|
||||
public static final float EXP_SPLIT_MVP_MOD = 0.2f;
|
||||
public static final float EXP_SPLIT_COMMON_MOD = 0.8f;
|
||||
public static final float PARTY_BONUS_EXP_RATE = 1.0f; //Rate for the party exp bonus reward.
|
||||
|
||||
//Miscellaneous Configuration
|
||||
public static String TIMEZONE = "GMT-3";
|
||||
public static boolean USE_DISPLAY_NUMBERS_WITH_COMMA = true; //Enforce comma on displayed strings (use this when USE_UNITPRICE_WITH_COMMA is active and you still want to display comma-separated values).
|
||||
public static boolean USE_UNITPRICE_WITH_COMMA = true; //Set this accordingly with the layout of the unitPrices on Item.wz XML's, whether it's using commas or dots to represent fractions.
|
||||
public static final byte MAX_MONITORED_BUFFSTATS = 5; //Limits accounting for "dormant" buff effects, that should take place when stronger stat buffs expires.
|
||||
public static final int MAX_AP = 32767; //Max AP allotted on the auto-assigner.
|
||||
public static final int MAX_EVENT_LEVELS = 8; //Event has different levels of rewarding system.
|
||||
public static final long BLOCK_NPC_RACE_CONDT = (long)(0.5 * 1000); //Time the player client must wait before reopening a conversation with an NPC.
|
||||
public static final long PET_LOOT_UPON_ATTACK = (long)(0.7 * 1000); //Time the pet must wait before trying to pick items up.
|
||||
public static final int TOT_MOB_QUEST_REQUIREMENT = 77; //Overwrites old 999-mobs requirement for the ToT questline with new requirement value, set 0 for default.
|
||||
public static final int MOB_REACTOR_REFRESH_TIME = 30 * 1000; //Overwrites refresh time for those reactors oriented to inflict damage to bosses (Ice Queen, Riche), set 0 for default.
|
||||
public static final int PARTY_SEARCH_REENTRY_LIMIT = 10; //Max amount of times a party leader is allowed to persist on the Party Search before entry expiration (thus needing to manually restart the Party Search to be able to search for members).
|
||||
public static final int NAME_CHANGE_COOLDOWN = 30*24*60*60*1000; //Cooldown for name changes, default (GMS) is 30 days.
|
||||
public static final int WORLD_TRANSFER_COOLDOWN=NAME_CHANGE_COOLDOWN;//Cooldown for world tranfers, default is same as name change (30 days).
|
||||
public static final boolean INSTANT_NAME_CHANGE = false; //Whether or not to wait for server restart to apply name changes. Does on reconnect otherwise (requires queries on every login).
|
||||
|
||||
//Dangling Items/Locks Configuration
|
||||
public static final int ITEM_EXPIRE_TIME = 3 * 60 * 1000; //Time before items start disappearing. Recommended to be set up to 3 minutes.
|
||||
public static final int KITE_EXPIRE_TIME = 60 * 60 * 1000; //Time before kites (cash item) disappears.
|
||||
public static final int ITEM_MONITOR_TIME = 5 * 60 * 1000; //Interval between item monitoring tasks on maps, which checks for dangling (null) item objects on the map item history.
|
||||
public static final int LOCK_MONITOR_TIME = 30 * 1000; //Waiting time for a lock to be released. If it reaches timeout, a critical server deadlock has made present.
|
||||
|
||||
//Map Monitor Configuration
|
||||
public static final int ITEM_EXPIRE_CHECK = 10 * 1000; //Interval between item expiring tasks on maps, which checks and makes disappear expired items.
|
||||
public static final int ITEM_LIMIT_ON_MAP = 200; //Max number of items allowed on a map.
|
||||
public static final int MAP_VISITED_SIZE = 5; //Max length for last mapids visited by a player. This is used to recover and update drops on these maps accordingly with player actions.
|
||||
public static final int MAP_DAMAGE_OVERTIME_INTERVAL = 5000;//Interval in milliseconds between map environment damage (e.g. El Nath and Aqua Road surrondings).
|
||||
|
||||
//Channel Mob Disease Monitor Configuration
|
||||
public static final int MOB_STATUS_MONITOR_PROC = 200; //Frequency in milliseconds between each proc on the mob disease monitor schedule.
|
||||
public static final int MOB_STATUS_MONITOR_LIFE = 84; //Idle proc count the mob disease monitor is allowed to be there before closing it due to inactivity.
|
||||
public static final int MOB_STATUS_AGGRO_PERSISTENCE = 2; //Idle proc count on aggro update for a mob to keep following the current controller, given him/her is the leading damage dealer.
|
||||
public static final int MOB_STATUS_AGGRO_INTERVAL = 5000; //Interval in milliseconds between aggro logistics update.
|
||||
|
||||
//Some Gameplay Enhancing Configurations
|
||||
//Scroll Configuration
|
||||
public static final boolean USE_PERFECT_GM_SCROLL = true; //Scrolls from GMs never uses up slots nor fails.
|
||||
public static final boolean USE_PERFECT_SCROLLING = true; //Scrolls doesn't use slots upon failure.
|
||||
public static final boolean USE_ENHANCED_CHSCROLL = true; //Equips even more powerful with chaos upgrade.
|
||||
public static final boolean USE_ENHANCED_CRAFTING = true; //Apply chaos scroll on every equip crafted.
|
||||
public static final boolean USE_ENHANCED_CLNSLATE = true; //Clean slates can be applied to recover successfully used slots as well.
|
||||
public static final int SCROLL_CHANCE_RATE = 10; //Number of rolls for success on a scroll, set 1 for default.
|
||||
public static final int CHSCROLL_STAT_RATE = 3; //Number of rolls of stat upgrade on a successfully applied chaos scroll, set 1 for default.
|
||||
public static final int CHSCROLL_STAT_RANGE = 6; //Stat upgrade range (-N, N) on chaos scrolls.
|
||||
|
||||
//Beginner Skills Configuration
|
||||
public static final boolean USE_ULTRA_NIMBLE_FEET = true; //Massive speed & jump upgrade.
|
||||
public static final boolean USE_ULTRA_RECOVERY = true; //Massive recovery amounts overtime.
|
||||
public static final boolean USE_ULTRA_THREE_SNAILS = true; //Massive damage on shell toss.
|
||||
|
||||
//Other Skills Configuration
|
||||
public static final boolean USE_FULL_ARAN_SKILLSET = false; //Enables starter availability to all Aran job skills. Suggestion thanks to Masterrulax.
|
||||
public static final boolean USE_FAST_REUSE_HERO_WILL = true;//Greatly reduce cooldown on Hero's Will.
|
||||
public static final boolean USE_ANTI_IMMUNITY_CRASH = true; //Crash skills additionally removes the mob's invincibility buffs. Suggestion thanks to Celestial.
|
||||
public static final boolean USE_UNDISPEL_HOLY_SHIELD = true;//Holy shield buff also prevents players from suffering dispel from mobs.
|
||||
public static final boolean USE_FULL_HOLY_SYMBOL = true; //Holy symbol doesn't require EXP sharers to work in full.
|
||||
|
||||
//Character Configuration
|
||||
public static final boolean USE_ADD_SLOTS_BY_LEVEL = true; //Slots are added each 20 levels.
|
||||
public static final boolean USE_ADD_RATES_BY_LEVEL = true; //Rates are added each 20 levels.
|
||||
public static final boolean USE_STACK_COUPON_RATES = false; //Multiple coupons effects builds up together.
|
||||
public static final boolean USE_PERFECT_PITCH = true; //For lvl 30 or above, each lvlup grants player 1 perfect pitch.
|
||||
|
||||
//Quest Configuration
|
||||
public static final boolean USE_QUEST_RATE = false; //Exp/Meso gained by quests uses fixed server exp/meso rate times quest rate as multiplier, instead of player rates.
|
||||
|
||||
//Quest Points Configuration
|
||||
public static final int QUEST_POINT_REPEATABLE_INTERVAL = 24;//Minimum interval between repeatable quest completions for quest points to be awarded.
|
||||
public static final int QUEST_POINT_REQUIREMENT = 16; //Exchange factor between N quest points to +1 fame, set 0 to disable the entire quest point mechanism.
|
||||
public static final int QUEST_POINT_PER_QUEST_COMPLETE = 4; //Each completed quest awards N quest points, set 0 to disable.
|
||||
public static final int QUEST_POINT_PER_EVENT_CLEAR = 1; //Each completed event instance awards N quest points, set 0 to disable.
|
||||
|
||||
//Guild Configuration
|
||||
public static final int CREATE_GUILD_MIN_PARTNERS = 6; //Minimum number of members on Guild Headquarters to establish a new guild.
|
||||
public static final int CREATE_GUILD_COST = 1500000;
|
||||
public static final int CHANGE_EMBLEM_COST = 5000000;
|
||||
public static final int EXPAND_GUILD_BASE_COST = 500000;
|
||||
public static final int EXPAND_GUILD_TIER_COST = 1000000;
|
||||
public static final int EXPAND_GUILD_MAX_COST = 5000000;
|
||||
|
||||
//Family Configuration
|
||||
public static final int FAMILY_REP_PER_KILL = 4; //Amount of rep gained per monster kill.
|
||||
public static final int FAMILY_REP_PER_BOSS_KILL = 20; //Amount of rep gained per boss kill.
|
||||
public static final int FAMILY_REP_PER_LEVELUP = 200; //Amount of rep gained upon leveling up.
|
||||
public static final int FAMILY_MAX_GENERATIONS = 1000; //Maximum depth of family tree. (Distance from leader to farthest junior)
|
||||
|
||||
//Equipment Configuration
|
||||
public static final boolean USE_EQUIPMNT_LVLUP_SLOTS = true;//Equips can upgrade slots at level up.
|
||||
public static final boolean USE_EQUIPMNT_LVLUP_POWER = true;//Enable more powerful stat upgrades at equip level up.
|
||||
public static final boolean USE_EQUIPMNT_LVLUP_CASH = true; //Enable equip leveling up on cash equipments as well.
|
||||
public static final boolean USE_SPIKES_AVOID_BANISH = true; //Shoes equipped with spikes prevents mobs from banishing wearer.
|
||||
public static final int MAX_EQUIPMNT_LVLUP_STAT_UP = 10000; //Max stat upgrade an equipment can have on a levelup.
|
||||
public static final int MAX_EQUIPMNT_STAT = 32767; //Max stat on an equipment by leveling up.
|
||||
public static final int USE_EQUIPMNT_LVLUP = 7; //All equips lvlup at max level of N, set 1 to disable.
|
||||
|
||||
//Map-Chair Configuration
|
||||
public static final boolean USE_CHAIR_EXTRAHEAL = true; //Enable map chairs to further recover player's HP and MP (player must have the Chair Mastery skill).
|
||||
public static final byte CHAIR_EXTRA_HEAL_MULTIPLIER = 10; //Due to only being able to be send up-to-255 heal values, values being actually updated is the one displayed times this.
|
||||
public static final int CHAIR_EXTRA_HEAL_MAX_DELAY = 21; //Players are expected to recover fully after using this skill for N seconds.
|
||||
|
||||
//Player NPC Configuration
|
||||
public static final int PLAYERNPC_INITIAL_X = 262; //Map frame width for putting PlayerNPCs.
|
||||
public static final int PLAYERNPC_INITIAL_Y = 262; //Map frame height for putting PlayerNPCs.
|
||||
public static final int PLAYERNPC_AREA_X = 320; //Initial width gap between PlayerNPCs.
|
||||
public static final int PLAYERNPC_AREA_Y = 160; //Initial height gap between PlayerNPCs.
|
||||
public static final int PLAYERNPC_AREA_STEPS = 4; //Max number of times gap is shortened to comport PlayerNPCs.
|
||||
public static final boolean PLAYERNPC_ORGANIZE_AREA = true; //Automatically rearranges PlayerNPCs on the map if there is no space set the new NPC. Current distance gap between NPCs is decreased to solve this issue.
|
||||
public static final boolean PLAYERNPC_AUTODEPLOY = true; //Makes PlayerNPC automatically deployed on the Hall of Fame at the instant one reaches max level. If false, eligible players must talk to 1st job instructor to deploy a NPC.
|
||||
|
||||
//Pet Auto-Pot Configuration
|
||||
public static final boolean USE_COMPULSORY_AUTOPOT = true; //Pets will consume as many potions as needed to fulfill the AUTOHP/MP ratio threshold.
|
||||
public static final boolean USE_EQUIPS_ON_AUTOPOT = true; //Player MaxHP and MaxMP check values on autopot handler will be updated by the HP/MP bonuses on equipped items.
|
||||
public static final double PET_AUTOHP_RATIO = 0.99; //Will automatically consume potions until given ratio of the MaxHP/MaxMP is reached.
|
||||
public static final double PET_AUTOMP_RATIO = 0.99;
|
||||
|
||||
//Pet & Mount Configuration
|
||||
public static final byte PET_EXHAUST_COUNT = 3; //Number of proc counts (1 per minute) on the exhaust schedule for fullness.
|
||||
public static final byte MOUNT_EXHAUST_COUNT = 1; //Number of proc counts (1 per minute) on the exhaust schedule for tiredness.
|
||||
|
||||
//Pet Hunger Configuration
|
||||
public static final boolean PETS_NEVER_HUNGRY = false; //If true, pets and mounts will never grow hungry.
|
||||
public static final boolean GM_PETS_NEVER_HUNGRY = true; //If true, pets and mounts owned by GMs will never grow hungry.
|
||||
|
||||
//Event Configuration
|
||||
public static final int EVENT_MAX_GUILD_QUEUE = 10; //Max number of guilds in queue for GPQ.
|
||||
public static final long EVENT_LOBBY_DELAY = 10; //Cooldown duration in seconds before reopening an event lobby.
|
||||
|
||||
//Dojo Configuration
|
||||
public static final boolean USE_FAST_DOJO_UPGRADE = true; //Reduced Dojo training points amount required for a belt upgrade.
|
||||
public static final boolean USE_DEADLY_DOJO = false; //Should bosses really use 1HP,1MP attacks in dojo?
|
||||
public static final int DOJO_ENERGY_ATK = 100; //Dojo energy gain when deal attack
|
||||
public static final int DOJO_ENERGY_DMG = 20; //Dojo energy gain when recv attack
|
||||
|
||||
//Wedding Configuration
|
||||
public static final int WEDDING_RESERVATION_DELAY = 3; //Minimum idle slots before processing a wedding reservation.
|
||||
public static final int WEDDING_RESERVATION_TIMEOUT = 10; //Limit time in minutes for the couple to show up before cancelling the wedding reservation.
|
||||
public static final int WEDDING_RESERVATION_INTERVAL = 60; //Time between wedding starts in minutes.
|
||||
public static final int WEDDING_BLESS_EXP = 30000; //Exp gained per bless count.
|
||||
public static final int WEDDING_GIFT_LIMIT = 1; //Max number of gifts per person to same wishlist on marriage instances.
|
||||
public static final boolean WEDDING_BLESSER_SHOWFX = true; //Pops bubble sprite effect on players blessing the couple. Setting this false shows the blessing effect on the couple instead.
|
||||
|
||||
//Buyback Configuration
|
||||
public static final boolean USE_BUYBACK_WITH_MESOS = true; //Enables usage of either mesos or NX for the buyback fee.
|
||||
public static final float BUYBACK_FEE = 77.70f; //Sets the base amount needed to buyback (level 30 or under will use the base value).
|
||||
public static final float BUYBACK_LEVEL_STACK_FEE = 85.47f; //Sets the level-stacking portion of the amount needed to buyback (fee will sum up linearly until level 120, when it reaches the peak).
|
||||
public static final int BUYBACK_MESO_MULTIPLIER = 1000; //Sets a multiplier for the fee when using meso as the charge unit.
|
||||
public static final int BUYBACK_RETURN_MINUTES = 1; //Sets the maximum amount of time the player can wait before decide to buyback.
|
||||
public static final int BUYBACK_COOLDOWN_MINUTES = 7; //Sets the time the player must wait before using buyback again.
|
||||
|
||||
// Login timeout by shavit
|
||||
public static long TIMEOUT_DURATION = 3600000L; // Kicks clients who don't send any packet to the game server in due time (in millisseconds).
|
||||
|
||||
//Event End Timestamp
|
||||
public static final long EVENT_END_TIMESTAMP = 1428897600000L;
|
||||
//Java Configuration
|
||||
public static final boolean JAVA_8 = getJavaVersion() >= 8; //Max amount of times a party leader is allowed to persist on the Party Search before entry expiration (thus needing to manually restart the Party Search to be able to search for members).
|
||||
|
||||
//Debug Variables
|
||||
public static int DEBUG_VALUES[] = new int[10]; // Field designed for packet testing purposes
|
||||
|
||||
//Properties
|
||||
static {
|
||||
Properties p = new Properties();
|
||||
try {
|
||||
p.load(new FileInputStream("configuration.ini"));
|
||||
|
||||
//Server Host
|
||||
ServerConstants.HOST = p.getProperty("HOST");
|
||||
ServerConstants.LOCALSERVER = ServerConstants.HOST.startsWith("127.") || ServerConstants.HOST.startsWith("localhost");
|
||||
|
||||
//Sql Database
|
||||
ServerConstants.DB_URL = p.getProperty("URL");
|
||||
ServerConstants.DB_USER = p.getProperty("DB_USER");
|
||||
ServerConstants.DB_PASS = p.getProperty("DB_PASS");
|
||||
|
||||
// shutdownhook
|
||||
ServerConstants.SHUTDOWNHOOK = p.getProperty("SHUTDOWNHOOK").equalsIgnoreCase("true");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("Failed to load configuration.ini.");
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
// https://github.com/openstreetmap/josm/blob/a3a6e8a6b657cf4c5b4c64ea14d6e87be6280d65/src/org/openstreetmap/josm/tools/Utils.java#L1566-L1585
|
||||
/**
|
||||
* Returns the Java version as an int value.
|
||||
|
||||
@@ -28,6 +28,8 @@ import java.util.HashSet;
|
||||
import java.util.Calendar;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import config.ServerConfig;
|
||||
import config.YamlConfig;
|
||||
import org.apache.mina.core.service.IoHandlerAdapter;
|
||||
import org.apache.mina.core.session.IdleStatus;
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
@@ -188,7 +190,7 @@ public class MapleServerHandler extends IoHandlerAdapter {
|
||||
short packetId = slea.readShort();
|
||||
MapleClient client = (MapleClient) session.getAttribute(MapleClient.CLIENT_KEY);
|
||||
|
||||
if(ServerConstants.USE_DEBUG_SHOW_RCVD_PACKET && !ignoredDebugRecvPackets.contains(packetId)) System.out.println("Received packet id " + packetId);
|
||||
if(YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_PACKET && !ignoredDebugRecvPackets.contains(packetId)) System.out.println("Received packet id " + packetId);
|
||||
final MaplePacketHandler packetHandler = processor.getHandler(packetId);
|
||||
if (packetHandler != null && packetHandler.validateState(client)) {
|
||||
try {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package net.mina;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import client.MapleClient;
|
||||
import constants.OpcodeConstants;
|
||||
@@ -75,7 +76,7 @@ public class MaplePacketDecoder extends CumulativeProtocolDecoder {
|
||||
rcvdCrypto.crypt(decryptedPacket);
|
||||
MapleCustomEncryption.decryptData(decryptedPacket);
|
||||
out.write(decryptedPacket);
|
||||
if (ServerConstants.USE_DEBUG_SHOW_PACKET){ // packet traffic log: Atoot's idea, applied using auto-identation thanks to lrenex
|
||||
if (YamlConfig.config.server.USE_DEBUG_SHOW_PACKET){ // packet traffic log: Atoot's idea, applied using auto-identation thanks to lrenex
|
||||
int packetLen = decryptedPacket.length;
|
||||
int pHeader = readFirstShort(decryptedPacket);
|
||||
String pHeaderStr = Integer.toHexString(pHeader).toUpperCase();
|
||||
|
||||
@@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package net.mina;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import client.MapleClient;
|
||||
import constants.OpcodeConstants;
|
||||
@@ -46,7 +47,7 @@ public class MaplePacketEncoder implements ProtocolEncoder {
|
||||
try {
|
||||
final MapleAESOFB send_crypto = client.getSendCrypto();
|
||||
final byte[] input = (byte[]) message;
|
||||
if (ServerConstants.USE_DEBUG_SHOW_PACKET) {
|
||||
if (YamlConfig.config.server.USE_DEBUG_SHOW_PACKET) {
|
||||
int packetLen = input.length;
|
||||
int pHeader = readFirstShort(input);
|
||||
String pHeaderStr = Integer.toHexString(pHeader).toUpperCase();
|
||||
|
||||
@@ -46,6 +46,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
|
||||
import config.YamlConfig;
|
||||
import net.server.audit.ThreadTracker;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.MonitoredReentrantReadWriteLock;
|
||||
@@ -170,7 +171,7 @@ public class Server {
|
||||
}
|
||||
|
||||
public void updateCurrentTime() {
|
||||
serverCurrentTime = currentTime.addAndGet(ServerConstants.UPDATE_INTERVAL);
|
||||
serverCurrentTime = currentTime.addAndGet(YamlConfig.config.server.UPDATE_INTERVAL);
|
||||
}
|
||||
|
||||
public long forceUpdateCurrentTime() {
|
||||
@@ -342,18 +343,13 @@ public class Server {
|
||||
if(worldChannels == null) return -3;
|
||||
|
||||
int channelid = worldChannels.size();
|
||||
if(channelid >= ServerConstants.CHANNEL_SIZE) return -2;
|
||||
|
||||
Properties p = loadWorldINI();
|
||||
if(p == null) {
|
||||
return -1;
|
||||
}
|
||||
if(channelid >= YamlConfig.config.server.CHANNEL_SIZE) return -2;
|
||||
|
||||
channelid++;
|
||||
World world = this.getWorld(worldid);
|
||||
Channel channel = new Channel(worldid, channelid, getCurrentTime());
|
||||
|
||||
channel.setServerMessage(p.getProperty("whyamirecommended" + worldid));
|
||||
channel.setServerMessage(YamlConfig.config.worlds.get(worldid).why_am_i_recommended);
|
||||
|
||||
world.addChannel(channel);
|
||||
worldChannels.put(channelid, channel.getIP());
|
||||
@@ -365,10 +361,7 @@ public class Server {
|
||||
}
|
||||
|
||||
public int addWorld() {
|
||||
Properties p = loadWorldINI();
|
||||
if(p == null) return -2;
|
||||
|
||||
int newWorld = initWorld(p);
|
||||
int newWorld = initWorld();
|
||||
if(newWorld > -1) {
|
||||
installWorldPlayerRanking(newWorld);
|
||||
|
||||
@@ -388,40 +381,40 @@ public class Server {
|
||||
return newWorld;
|
||||
}
|
||||
|
||||
private static int getWorldProperty(Properties p, String property, int wid, int defaultValue) {
|
||||
String content = p.getProperty(property + wid);
|
||||
return content != null ? Integer.parseInt(content) : defaultValue;
|
||||
}
|
||||
|
||||
private int initWorld(Properties p) {
|
||||
private int initWorld() {
|
||||
wldWLock.lock();
|
||||
try {
|
||||
int i = worlds.size();
|
||||
|
||||
if(i >= ServerConstants.WLDLIST_SIZE) {
|
||||
if(i >= YamlConfig.config.server.WLDLIST_SIZE) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
System.out.println("Starting world " + i);
|
||||
int exprate = getWorldProperty(p, "exprate", i, ServerConstants.EXP_RATE);
|
||||
int mesorate = getWorldProperty(p, "mesorate", i, ServerConstants.MESO_RATE);
|
||||
int droprate = getWorldProperty(p, "droprate", i, ServerConstants.DROP_RATE);
|
||||
int bossdroprate = getWorldProperty(p, "bossdroprate", i, ServerConstants.BOSS_DROP_RATE);
|
||||
int questrate = getWorldProperty(p, "questrate", i, ServerConstants.QUEST_RATE);
|
||||
int travelrate = getWorldProperty(p, "travelrate", i, ServerConstants.TRAVEL_RATE);
|
||||
int fishingrate = getWorldProperty(p, "fishrate", i, ServerConstants.FISHING_RATE);
|
||||
|
||||
int exprate = YamlConfig.config.worlds.get(i).exp_rate;
|
||||
int mesorate = YamlConfig.config.worlds.get(i).meso_rate;
|
||||
int droprate = YamlConfig.config.worlds.get(i).drop_rate;
|
||||
int bossdroprate = YamlConfig.config.worlds.get(i).boss_drop_rate;
|
||||
int questrate = YamlConfig.config.worlds.get(i).quest_rate;
|
||||
int travelrate = YamlConfig.config.worlds.get(i).travel_rate;
|
||||
int fishingrate = YamlConfig.config.worlds.get(i).fishing_rate;
|
||||
|
||||
int flag = YamlConfig.config.worlds.get(i).flag;
|
||||
String event_message = YamlConfig.config.worlds.get(i).event_message;
|
||||
String why_am_i_recommended = YamlConfig.config.worlds.get(i).why_am_i_recommended;
|
||||
|
||||
World world = new World(i,
|
||||
Integer.parseInt(p.getProperty("flag" + i)),
|
||||
p.getProperty("eventmessage" + i),
|
||||
flag,
|
||||
event_message,
|
||||
exprate, droprate, bossdroprate, mesorate, questrate, travelrate, fishingrate);
|
||||
|
||||
worldRecommendedList.add(new Pair<>(i, p.getProperty("whyamirecommended" + i)));
|
||||
worldRecommendedList.add(new Pair<>(i, why_am_i_recommended));
|
||||
worlds.add(world);
|
||||
|
||||
Map<Integer, String> channelInfo = new HashMap<>();
|
||||
long bootTime = getCurrentTime();
|
||||
for (int j = 1; j <= Integer.parseInt(p.getProperty("channels" + i)); j++) {
|
||||
for (int j = 1; j <= YamlConfig.config.worlds.get(i).channels; j++) {
|
||||
int channelid = j;
|
||||
Channel channel = new Channel(i, channelid, bootTime);
|
||||
|
||||
@@ -431,7 +424,7 @@ public class Server {
|
||||
|
||||
channels.add(i, channelInfo);
|
||||
|
||||
world.setServerMessage(p.getProperty("servermessage" + i));
|
||||
world.setServerMessage(YamlConfig.config.worlds.get(i).server_message);
|
||||
System.out.println("Finished loading world " + i + "\r\n");
|
||||
|
||||
return i;
|
||||
@@ -511,18 +504,6 @@ public class Server {
|
||||
}
|
||||
}
|
||||
|
||||
public static Properties loadWorldINI() {
|
||||
Properties p = new Properties();
|
||||
try {
|
||||
p.load(new FileInputStream("world.ini"));
|
||||
return p;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("[SEVERE] Could not find/open 'world.ini'.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static long getTimeLeftForNextHour() {
|
||||
Calendar nextHour = Calendar.getInstance();
|
||||
nextHour.add(Calendar.HOUR, 1);
|
||||
@@ -547,7 +528,7 @@ public class Server {
|
||||
}
|
||||
|
||||
public static void cleanNxcodeCoupons(Connection con) throws SQLException {
|
||||
if (!ServerConstants.USE_CLEAR_OUTDATED_COUPONS) return;
|
||||
if (!YamlConfig.config.server.USE_CLEAR_OUTDATED_COUPONS) return;
|
||||
|
||||
long timeClear = System.currentTimeMillis() - 14 * 24 * 60 * 60 * 1000;
|
||||
|
||||
@@ -705,7 +686,7 @@ public class Server {
|
||||
public List<Pair<String, Integer>> getWorldPlayerRanking(int worldid) {
|
||||
wldRLock.lock();
|
||||
try {
|
||||
return new ArrayList<>(playerRanking.get(!ServerConstants.USE_WHOLE_SERVER_RANKING ? worldid : 0));
|
||||
return new ArrayList<>(playerRanking.get(!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING ? worldid : 0));
|
||||
} finally {
|
||||
wldRLock.unlock();
|
||||
}
|
||||
@@ -716,7 +697,7 @@ public class Server {
|
||||
if(!ranking.isEmpty()) {
|
||||
wldWLock.lock();
|
||||
try {
|
||||
if (!ServerConstants.USE_WHOLE_SERVER_RANKING) {
|
||||
if (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
||||
for(int i = playerRanking.size(); i <= worldid; i++) {
|
||||
playerRanking.add(new ArrayList<Pair<String, Integer>>(0));
|
||||
}
|
||||
@@ -732,7 +713,7 @@ public class Server {
|
||||
}
|
||||
|
||||
private void removeWorldPlayerRanking() {
|
||||
if (!ServerConstants.USE_WHOLE_SERVER_RANKING) {
|
||||
if (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
||||
wldWLock.lock();
|
||||
try {
|
||||
if(playerRanking.size() < this.getWorldsSize()) {
|
||||
@@ -760,7 +741,7 @@ public class Server {
|
||||
if(!rankUpdates.isEmpty()) {
|
||||
wldWLock.lock();
|
||||
try {
|
||||
if (!ServerConstants.USE_WHOLE_SERVER_RANKING) {
|
||||
if (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
||||
for(int i = playerRanking.size(); i <= rankUpdates.get(rankUpdates.size() - 1).getLeft(); i++) {
|
||||
playerRanking.add(new ArrayList<Pair<String, Integer>>(0));
|
||||
}
|
||||
@@ -778,7 +759,7 @@ public class Server {
|
||||
}
|
||||
|
||||
private void initWorldPlayerRanking() {
|
||||
if (ServerConstants.USE_WHOLE_SERVER_RANKING) {
|
||||
if (YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
||||
playerRanking.add(new ArrayList<Pair<String, Integer>>(0));
|
||||
}
|
||||
updateWorldPlayerRanking();
|
||||
@@ -795,7 +776,7 @@ public class Server {
|
||||
con = DatabaseConnection.getConnection();
|
||||
|
||||
String worldQuery;
|
||||
if (!ServerConstants.USE_WHOLE_SERVER_RANKING) {
|
||||
if (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
||||
if(worldid >= 0) {
|
||||
worldQuery = (" AND `characters`.`world` = " + worldid);
|
||||
} else {
|
||||
@@ -805,10 +786,10 @@ public class Server {
|
||||
worldQuery = (" AND `characters`.`world` >= 0 AND `characters`.`world` <= " + Math.abs(worldid));
|
||||
}
|
||||
|
||||
ps = con.prepareStatement("SELECT `characters`.`name`, `characters`.`level`, `characters`.`world` FROM `characters` LEFT JOIN accounts ON accounts.id = characters.accountid WHERE `characters`.`gm` < 2 AND `accounts`.`banned` = '0'" + worldQuery + " ORDER BY " + (!ServerConstants.USE_WHOLE_SERVER_RANKING ? "world, " : "") + "level DESC, exp DESC, lastExpGainTime ASC LIMIT 50");
|
||||
ps = con.prepareStatement("SELECT `characters`.`name`, `characters`.`level`, `characters`.`world` FROM `characters` LEFT JOIN accounts ON accounts.id = characters.accountid WHERE `characters`.`gm` < 2 AND `accounts`.`banned` = '0'" + worldQuery + " ORDER BY " + (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING ? "world, " : "") + "level DESC, exp DESC, lastExpGainTime ASC LIMIT 50");
|
||||
rs = ps.executeQuery();
|
||||
|
||||
if (!ServerConstants.USE_WHOLE_SERVER_RANKING) {
|
||||
if (!YamlConfig.config.server.USE_WHOLE_SERVER_RANKING) {
|
||||
int currentWorld = -1;
|
||||
while(rs.next()) {
|
||||
int rsWorld = rs.getInt("world");
|
||||
@@ -854,17 +835,12 @@ public class Server {
|
||||
}
|
||||
|
||||
public void init() {
|
||||
Properties p = loadWorldINI();
|
||||
if(p == null) {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
System.out.println("HeavenMS v" + ServerConstants.VERSION + " starting up.\r\n");
|
||||
|
||||
if(ServerConstants.SHUTDOWNHOOK)
|
||||
if(YamlConfig.config.server.SHUTDOWNHOOK)
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(shutdown(false)));
|
||||
|
||||
TimeZone.setDefault(TimeZone.getTimeZone(ServerConstants.TIMEZONE));
|
||||
TimeZone.setDefault(TimeZone.getTimeZone(YamlConfig.config.server.TIMEZONE));
|
||||
|
||||
Connection c = null;
|
||||
try {
|
||||
@@ -897,21 +873,21 @@ public class Server {
|
||||
ThreadManager.getInstance().start();
|
||||
TimerManager tMan = TimerManager.getInstance();
|
||||
tMan.start();
|
||||
tMan.register(tMan.purge(), ServerConstants.PURGING_INTERVAL);//Purging ftw...
|
||||
tMan.register(tMan.purge(), YamlConfig.config.server.PURGING_INTERVAL);//Purging ftw...
|
||||
disconnectIdlesOnLoginTask();
|
||||
|
||||
long timeLeft = getTimeLeftForNextHour();
|
||||
tMan.register(new CharacterDiseaseWorker(), ServerConstants.UPDATE_INTERVAL, ServerConstants.UPDATE_INTERVAL);
|
||||
tMan.register(new CharacterDiseaseWorker(), YamlConfig.config.server.UPDATE_INTERVAL, YamlConfig.config.server.UPDATE_INTERVAL);
|
||||
tMan.register(new ReleaseLockWorker(), 2 * 60 * 1000, 2 * 60 * 1000);
|
||||
tMan.register(new CouponWorker(), ServerConstants.COUPON_INTERVAL, timeLeft);
|
||||
tMan.register(new CouponWorker(), YamlConfig.config.server.COUPON_INTERVAL, timeLeft);
|
||||
tMan.register(new RankingCommandWorker(), 5 * 60 * 1000, 5 * 60 * 1000);
|
||||
tMan.register(new RankingLoginWorker(), ServerConstants.RANKING_INTERVAL, timeLeft);
|
||||
tMan.register(new RankingLoginWorker(), YamlConfig.config.server.RANKING_INTERVAL, timeLeft);
|
||||
tMan.register(new LoginCoordinatorWorker(), 60 * 60 * 1000, timeLeft);
|
||||
tMan.register(new EventRecallCoordinatorWorker(), 60 * 60 * 1000, timeLeft);
|
||||
tMan.register(new LoginStorageWorker(), 2 * 60 * 1000, 2 * 60 * 1000);
|
||||
tMan.register(new DueyFredrickWorker(), 60 * 60 * 1000, timeLeft);
|
||||
tMan.register(new InvitationWorker(), 30 * 1000, 30 * 1000);
|
||||
tMan.register(new RespawnWorker(), ServerConstants.RESPAWN_INTERVAL, ServerConstants.RESPAWN_INTERVAL);
|
||||
tMan.register(new RespawnWorker(), YamlConfig.config.server.RESPAWN_INTERVAL, YamlConfig.config.server.RESPAWN_INTERVAL);
|
||||
|
||||
timeLeft = getTimeLeftForNextDay();
|
||||
MapleExpeditionBossLog.resetBossLogTable();
|
||||
@@ -932,13 +908,13 @@ public class Server {
|
||||
|
||||
NewYearCardRecord.startPendingNewYearCardRequests();
|
||||
|
||||
if(ServerConstants.USE_THREAD_TRACKER) ThreadTracker.getInstance().registerThreadTrackerTask();
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) ThreadTracker.getInstance().registerThreadTrackerTask();
|
||||
|
||||
try {
|
||||
Integer worldCount = Math.min(GameConstants.WORLD_NAMES.length, Integer.parseInt(p.getProperty("worlds")));
|
||||
Integer worldCount = Math.min(GameConstants.WORLD_NAMES.length, YamlConfig.config.worlds.size());
|
||||
|
||||
for (int i = 0; i < worldCount; i++) {
|
||||
initWorld(p);
|
||||
initWorld();
|
||||
}
|
||||
initWorldPlayerRanking();
|
||||
|
||||
@@ -952,7 +928,7 @@ public class Server {
|
||||
|
||||
System.out.println();
|
||||
|
||||
if(ServerConstants.USE_FAMILY_SYSTEM) {
|
||||
if(YamlConfig.config.server.USE_FAMILY_SYSTEM) {
|
||||
timeToTake = System.currentTimeMillis();
|
||||
MapleFamily.loadAllFamilies();
|
||||
System.out.println("Families loaded in " + ((System.currentTimeMillis() - timeToTake) / 1000.0) + " seconds\r\n");
|
||||
@@ -1767,7 +1743,7 @@ public class Server {
|
||||
}
|
||||
|
||||
public boolean validateCharacteridInTransition(IoSession session, int charId) {
|
||||
if (!ServerConstants.USE_IP_VALIDATION) {
|
||||
if (!YamlConfig.config.server.USE_IP_VALIDATION) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1783,7 +1759,7 @@ public class Server {
|
||||
}
|
||||
|
||||
public Integer freeCharacteridInTransition(IoSession session) {
|
||||
if (!ServerConstants.USE_IP_VALIDATION) {
|
||||
if (!YamlConfig.config.server.USE_IP_VALIDATION) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1798,7 +1774,7 @@ public class Server {
|
||||
}
|
||||
|
||||
public boolean hasCharacteridInTransition(IoSession session) {
|
||||
if (!ServerConstants.USE_IP_VALIDATION) {
|
||||
if (!YamlConfig.config.server.USE_IP_VALIDATION) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1905,7 +1881,7 @@ public class Server {
|
||||
|
||||
List<Channel> allChannels = getAllChannels();
|
||||
|
||||
if(ServerConstants.USE_THREAD_TRACKER) ThreadTracker.getInstance().cancelThreadTrackerTask();
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) ThreadTracker.getInstance().cancelThreadTrackerTask();
|
||||
|
||||
for (Channel ch : allChannels) {
|
||||
while (!ch.finishedShutdown()) {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package net.server.audit.locks.active;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -59,7 +60,7 @@ public class TrackerReadLock extends ReentrantReadWriteLock.ReadLock implements
|
||||
|
||||
@Override
|
||||
public void lock() {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||
if(deadlockedState != null) {
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||
dateFormat.setTimeZone(TimeZone.getDefault());
|
||||
@@ -77,7 +78,7 @@ public class TrackerReadLock extends ReentrantReadWriteLock.ReadLock implements
|
||||
|
||||
@Override
|
||||
public void unlock() {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||
unregisterLocking();
|
||||
}
|
||||
|
||||
@@ -87,7 +88,7 @@ public class TrackerReadLock extends ReentrantReadWriteLock.ReadLock implements
|
||||
@Override
|
||||
public boolean tryLock() {
|
||||
if(super.tryLock()) {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||
if(deadlockedState != null) {
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState));
|
||||
ThreadTracker.getInstance().accessThreadTracker(true, true, id, hashcode);
|
||||
@@ -114,7 +115,7 @@ public class TrackerReadLock extends ReentrantReadWriteLock.ReadLock implements
|
||||
public void run() {
|
||||
issueDeadlock(t);
|
||||
}
|
||||
}, ServerConstants.LOCK_MONITOR_TIME);
|
||||
}, YamlConfig.config.server.LOCK_MONITOR_TIME);
|
||||
}
|
||||
} finally {
|
||||
state.unlock();
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -61,7 +63,7 @@ public class TrackerReentrantLock extends ReentrantLock implements MonitoredReen
|
||||
|
||||
@Override
|
||||
public void lock() {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||
if(deadlockedState != null) {
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||
dateFormat.setTimeZone(TimeZone.getDefault());
|
||||
@@ -79,7 +81,7 @@ public class TrackerReentrantLock extends ReentrantLock implements MonitoredReen
|
||||
|
||||
@Override
|
||||
public void unlock() {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||
unregisterLocking();
|
||||
}
|
||||
|
||||
@@ -89,7 +91,7 @@ public class TrackerReentrantLock extends ReentrantLock implements MonitoredReen
|
||||
@Override
|
||||
public boolean tryLock() {
|
||||
if(super.tryLock()) {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||
if(deadlockedState != null) {
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState));
|
||||
ThreadTracker.getInstance().accessThreadTracker(true, true, id, hashcode);
|
||||
@@ -116,7 +118,7 @@ public class TrackerReentrantLock extends ReentrantLock implements MonitoredReen
|
||||
public void run() {
|
||||
issueDeadlock(t);
|
||||
}
|
||||
}, ServerConstants.LOCK_MONITOR_TIME);
|
||||
}, YamlConfig.config.server.LOCK_MONITOR_TIME);
|
||||
}
|
||||
} finally {
|
||||
state.unlock();
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package net.server.audit.locks.active;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -57,7 +58,7 @@ public class TrackerWriteLock extends ReentrantReadWriteLock.WriteLock implement
|
||||
|
||||
@Override
|
||||
public void lock() {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||
if(deadlockedState != null) {
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||
dateFormat.setTimeZone(TimeZone.getDefault());
|
||||
@@ -75,7 +76,7 @@ public class TrackerWriteLock extends ReentrantReadWriteLock.WriteLock implement
|
||||
|
||||
@Override
|
||||
public void unlock() {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||
unregisterLocking();
|
||||
}
|
||||
|
||||
@@ -85,7 +86,7 @@ public class TrackerWriteLock extends ReentrantReadWriteLock.WriteLock implement
|
||||
@Override
|
||||
public boolean tryLock() {
|
||||
if(super.tryLock()) {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(YamlConfig.config.server.USE_THREAD_TRACKER) {
|
||||
if(deadlockedState != null) {
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState));
|
||||
ThreadTracker.getInstance().accessThreadTracker(true, true, id, hashcode);
|
||||
@@ -112,7 +113,7 @@ public class TrackerWriteLock extends ReentrantReadWriteLock.WriteLock implement
|
||||
public void run() {
|
||||
issueDeadlock(t);
|
||||
}
|
||||
}, ServerConstants.LOCK_MONITOR_TIME);
|
||||
}, YamlConfig.config.server.LOCK_MONITOR_TIME);
|
||||
}
|
||||
} finally {
|
||||
state.unlock();
|
||||
|
||||
@@ -37,6 +37,8 @@ import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
|
||||
import config.YamlConfig;
|
||||
import net.server.audit.LockCollector;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.MonitoredReentrantLock;
|
||||
@@ -88,13 +90,13 @@ public final class Channel {
|
||||
private String ip, serverMessage;
|
||||
private MapleMapManager mapManager;
|
||||
private EventScriptManager eventSM;
|
||||
private MobStatusScheduler mobStatusSchedulers[] = new MobStatusScheduler[ServerConstants.CHANNEL_LOCKS];
|
||||
private MobAnimationScheduler mobAnimationSchedulers[] = new MobAnimationScheduler[ServerConstants.CHANNEL_LOCKS];
|
||||
private MobClearSkillScheduler mobClearSkillSchedulers[] = new MobClearSkillScheduler[ServerConstants.CHANNEL_LOCKS];
|
||||
private MobMistScheduler mobMistSchedulers[] = new MobMistScheduler[ServerConstants.CHANNEL_LOCKS];
|
||||
private FaceExpressionScheduler faceExpressionSchedulers[] = new FaceExpressionScheduler[ServerConstants.CHANNEL_LOCKS];
|
||||
private EventScheduler eventSchedulers[] = new EventScheduler[ServerConstants.CHANNEL_LOCKS];
|
||||
private OverallScheduler channelSchedulers[] = new OverallScheduler[ServerConstants.CHANNEL_LOCKS];
|
||||
private MobStatusScheduler mobStatusSchedulers[] = new MobStatusScheduler[YamlConfig.config.server.CHANNEL_LOCKS];
|
||||
private MobAnimationScheduler mobAnimationSchedulers[] = new MobAnimationScheduler[YamlConfig.config.server.CHANNEL_LOCKS];
|
||||
private MobClearSkillScheduler mobClearSkillSchedulers[] = new MobClearSkillScheduler[YamlConfig.config.server.CHANNEL_LOCKS];
|
||||
private MobMistScheduler mobMistSchedulers[] = new MobMistScheduler[YamlConfig.config.server.CHANNEL_LOCKS];
|
||||
private FaceExpressionScheduler faceExpressionSchedulers[] = new FaceExpressionScheduler[YamlConfig.config.server.CHANNEL_LOCKS];
|
||||
private EventScheduler eventSchedulers[] = new EventScheduler[YamlConfig.config.server.CHANNEL_LOCKS];
|
||||
private OverallScheduler channelSchedulers[] = new OverallScheduler[YamlConfig.config.server.CHANNEL_LOCKS];
|
||||
private Map<Integer, MapleHiredMerchant> hiredMerchants = new HashMap<>();
|
||||
private final Map<Integer, Integer> storedVars = new HashMap<>();
|
||||
private Set<Integer> playersAway = new HashSet<>();
|
||||
@@ -129,7 +131,7 @@ public final class Channel {
|
||||
private ReadLock merchRlock = merchantLock.readLock();
|
||||
private WriteLock merchWlock = merchantLock.writeLock();
|
||||
|
||||
private MonitoredReentrantLock faceLock[] = new MonitoredReentrantLock[ServerConstants.CHANNEL_LOCKS];
|
||||
private MonitoredReentrantLock faceLock[] = new MonitoredReentrantLock[YamlConfig.config.server.CHANNEL_LOCKS];
|
||||
|
||||
private MonitoredReentrantLock lock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHANNEL, true);
|
||||
|
||||
@@ -143,7 +145,7 @@ public final class Channel {
|
||||
eventSM = new EventScriptManager(this, getEvents());
|
||||
port = 7575 + this.channel - 1;
|
||||
port += (world * 100);
|
||||
ip = ServerConstants.HOST + ":" + port;
|
||||
ip = YamlConfig.config.server.HOST + ":" + port;
|
||||
IoBuffer.setUseDirectBuffer(false);
|
||||
IoBuffer.setAllocator(new SimpleBufferAllocator());
|
||||
acceptor = new NioSocketAcceptor();
|
||||
@@ -166,7 +168,7 @@ public final class Channel {
|
||||
dojoTask[i] = null;
|
||||
}
|
||||
|
||||
for(int i = 0; i < ServerConstants.CHANNEL_LOCKS; i++) {
|
||||
for(int i = 0; i < YamlConfig.config.server.CHANNEL_LOCKS; i++) {
|
||||
faceLock[i] = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHANNEL_FACEEXPRS, true);
|
||||
|
||||
mobStatusSchedulers[i] = new MobStatusScheduler();
|
||||
@@ -228,7 +230,7 @@ public final class Channel {
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < ServerConstants.CHANNEL_LOCKS; i++) {
|
||||
for(int i = 0; i < YamlConfig.config.server.CHANNEL_LOCKS; i++) {
|
||||
if(mobStatusSchedulers[i] != null) {
|
||||
mobStatusSchedulers[i].dispose();
|
||||
mobStatusSchedulers[i] = null;
|
||||
@@ -278,7 +280,7 @@ public final class Channel {
|
||||
}
|
||||
|
||||
private void emptyLocks() {
|
||||
for(int i = 0; i < ServerConstants.CHANNEL_LOCKS; i++) {
|
||||
for(int i = 0; i < YamlConfig.config.server.CHANNEL_LOCKS; i++) {
|
||||
faceLock[i] = faceLock[i].dispose();
|
||||
}
|
||||
|
||||
@@ -335,7 +337,7 @@ public final class Channel {
|
||||
}
|
||||
|
||||
public int getChannelCapacity() {
|
||||
return (int)(Math.ceil(((float) players.getAllCharacters().size() / ServerConstants.CHANNEL_LOAD) * 800));
|
||||
return (int)(Math.ceil(((float) players.getAllCharacters().size() / YamlConfig.config.server.CHANNEL_LOAD) * 800));
|
||||
}
|
||||
|
||||
public void broadcastPacket(final byte[] data) {
|
||||
@@ -786,7 +788,7 @@ public final class Channel {
|
||||
try {
|
||||
List<Integer> weddingReservationQueue = (cathedral ? cathedralReservationQueue : chapelReservationQueue);
|
||||
|
||||
int delay = ServerConstants.WEDDING_RESERVATION_DELAY - 1 - weddingReservationQueue.size();
|
||||
int delay = YamlConfig.config.server.WEDDING_RESERVATION_DELAY - 1 - weddingReservationQueue.size();
|
||||
for(int i = 0; i < delay; i++) {
|
||||
weddingReservationQueue.add(null); // push empty slots to fill the waiting time
|
||||
}
|
||||
@@ -869,7 +871,7 @@ public final class Channel {
|
||||
public void run() {
|
||||
closeOngoingWedding(cathedral);
|
||||
}
|
||||
}, ServerConstants.WEDDING_RESERVATION_TIMEOUT * 60 * 1000);
|
||||
}, YamlConfig.config.server.WEDDING_RESERVATION_TIMEOUT * 60 * 1000);
|
||||
|
||||
if(cathedral) {
|
||||
cathedralReservationTask = weddingTask;
|
||||
@@ -933,7 +935,7 @@ public final class Channel {
|
||||
}
|
||||
|
||||
public static long getRelativeWeddingTicketExpireTime(int resSlot) {
|
||||
return (resSlot * ServerConstants.WEDDING_RESERVATION_INTERVAL * 60 * 1000);
|
||||
return (resSlot * YamlConfig.config.server.WEDDING_RESERVATION_INTERVAL * 60 * 1000);
|
||||
}
|
||||
|
||||
public String getWeddingReservationTimeLeft(Integer weddingId) {
|
||||
@@ -959,7 +961,7 @@ public final class Channel {
|
||||
return venue + " - RIGHT NOW";
|
||||
}
|
||||
|
||||
return venue + " - " + getTimeLeft(ongoingStartTime + (resStatus * ServerConstants.WEDDING_RESERVATION_INTERVAL * 60 * 1000)) + " from now";
|
||||
return venue + " - " + getTimeLeft(ongoingStartTime + (resStatus * YamlConfig.config.server.WEDDING_RESERVATION_INTERVAL * 60 * 1000)) + " from now";
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
@@ -1019,7 +1021,7 @@ public final class Channel {
|
||||
}
|
||||
|
||||
private static int getChannelSchedulerIndex(int mapid) {
|
||||
int section = 1000000000 / ServerConstants.CHANNEL_LOCKS;
|
||||
int section = 1000000000 / YamlConfig.config.server.CHANNEL_LOCKS;
|
||||
return mapid / section;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import config.YamlConfig;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import server.MapleStatEffect;
|
||||
import server.TimerManager;
|
||||
@@ -462,7 +463,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
|
||||
|
||||
int threeSnailsId = player.getJobType() * 10000000 + 1000;
|
||||
if(attack.skill == threeSnailsId) {
|
||||
if(ServerConstants.USE_ULTRA_THREE_SNAILS) {
|
||||
if(YamlConfig.config.server.USE_ULTRA_THREE_SNAILS) {
|
||||
int skillLv = player.getSkillLevel(threeSnailsId);
|
||||
|
||||
if(skillLv > 0) {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
import java.sql.Connection;
|
||||
@@ -50,7 +51,7 @@ public final class AcceptFamilyHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
if(!ServerConstants.USE_FAMILY_SYSTEM) {
|
||||
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) {
|
||||
return;
|
||||
}
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
@@ -79,7 +80,7 @@ public final class AcceptFamilyHandler extends AbstractMaplePacketHandler {
|
||||
MapleFamilyEntry targetEntry = chr.getFamilyEntry();
|
||||
MapleFamily targetFamily = targetEntry.getFamily();
|
||||
if(targetFamily.getLeader() != targetEntry) return;
|
||||
if(inviter.getFamily().getTotalGenerations() + targetFamily.getTotalGenerations() <= ServerConstants.FAMILY_MAX_GENERATIONS) {
|
||||
if(inviter.getFamily().getTotalGenerations() + targetFamily.getTotalGenerations() <= YamlConfig.config.server.FAMILY_MAX_GENERATIONS) {
|
||||
targetEntry.join(inviter.getFamilyEntry());
|
||||
} else {
|
||||
inviter.announce(MaplePacketCreator.sendFamilyMessage(76, 0));
|
||||
@@ -88,7 +89,7 @@ public final class AcceptFamilyHandler extends AbstractMaplePacketHandler {
|
||||
}
|
||||
}
|
||||
} else { // create new family
|
||||
if(chr.getFamily() != null && inviter.getFamily() != null && chr.getFamily().getTotalGenerations() + inviter.getFamily().getTotalGenerations() >= ServerConstants.FAMILY_MAX_GENERATIONS) {
|
||||
if(chr.getFamily() != null && inviter.getFamily() != null && chr.getFamily().getTotalGenerations() + inviter.getFamily().getTotalGenerations() >= YamlConfig.config.server.FAMILY_MAX_GENERATIONS) {
|
||||
inviter.announce(MaplePacketCreator.sendFamilyMessage(76, 0));
|
||||
chr.announce(MaplePacketCreator.sendFamilyMessage(76, 0));
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.MapleClient;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import tools.LogHelper;
|
||||
@@ -25,19 +26,19 @@ public class AdminChatHandler extends AbstractMaplePacketHandler {
|
||||
switch (mode) {
|
||||
case 0:// /alertall, /noticeall, /slideall
|
||||
c.getWorldServer().broadcastPacket(packet);
|
||||
if (ServerConstants.USE_ENABLE_CHAT_LOG) {
|
||||
if (YamlConfig.config.server.USE_ENABLE_CHAT_LOG) {
|
||||
LogHelper.logChat(c, "Alert All", message);
|
||||
}
|
||||
break;
|
||||
case 1:// /alertch, /noticech, /slidech
|
||||
c.getChannelServer().broadcastPacket(packet);
|
||||
if (ServerConstants.USE_ENABLE_CHAT_LOG) {
|
||||
if (YamlConfig.config.server.USE_ENABLE_CHAT_LOG) {
|
||||
LogHelper.logChat(c, "Alert Ch", message);
|
||||
}
|
||||
break;
|
||||
case 2:// /alertm /alertmap, /noticem /noticemap, /slidem /slidemap
|
||||
c.getPlayer().getMap().broadcastMessage(packet);
|
||||
if (ServerConstants.USE_ENABLE_CHAT_LOG) {
|
||||
if (YamlConfig.config.server.USE_ENABLE_CHAT_LOG) {
|
||||
LogHelper.logChat(c, "Alert Map", message);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -28,6 +28,7 @@ import client.inventory.Equip;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import config.YamlConfig;
|
||||
import constants.ItemConstants;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Calendar;
|
||||
@@ -76,7 +77,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
if (ItemConstants.isCashStore(cItem.getItemId()) && chr.getLevel() < 16) {
|
||||
c.enableCSActions();
|
||||
return;
|
||||
} else if (ItemConstants.isRateCoupon(cItem.getItemId()) && !ServerConstants.USE_SUPPLY_RATE_COUPONS) {
|
||||
} else if (ItemConstants.isRateCoupon(cItem.getItemId()) && !YamlConfig.config.server.USE_SUPPLY_RATE_COUPONS) {
|
||||
chr.dropMessage(1, "Rate coupons are currently unavailable to purchase.");
|
||||
c.enableCSActions();
|
||||
return;
|
||||
@@ -376,7 +377,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
c.enableCSActions();
|
||||
return;
|
||||
}
|
||||
if(cItem.getSN() == 50600000 && ServerConstants.ALLOW_CASHSHOP_NAME_CHANGE) {
|
||||
if(cItem.getSN() == 50600000 && YamlConfig.config.server.ALLOW_CASHSHOP_NAME_CHANGE) {
|
||||
slea.readMapleAsciiString(); //old name
|
||||
String newName = slea.readMapleAsciiString();
|
||||
if(!MapleCharacter.canCreateChar(newName) || chr.getLevel() < 10) { //(longest ban duration isn't tracked currently)
|
||||
@@ -405,7 +406,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
c.enableCSActions();
|
||||
return;
|
||||
}
|
||||
if(cItem.getSN() == 50600001 && ServerConstants.ALLOW_CASHSHOP_WORLD_TRANSFER) {
|
||||
if(cItem.getSN() == 50600001 && YamlConfig.config.server.ALLOW_CASHSHOP_WORLD_TRANSFER) {
|
||||
int newWorldSelection = slea.readInt();
|
||||
|
||||
int worldTransferError = chr.checkWorldTransferEligibility();
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import config.YamlConfig;
|
||||
import server.MapleStatEffect;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
@@ -70,7 +71,7 @@ public final class CloseRangeDamageHandler extends AbstractDealDamageHandler {
|
||||
if (chr.getDojoEnergy() < 10000 && (attack.skill == 1009 || attack.skill == 10001009 || attack.skill == 20001009)) // PE hacking or maybe just lagging
|
||||
return;
|
||||
if (chr.getMap().isDojoMap() && attack.numAttacked > 0) {
|
||||
chr.setDojoEnergy(chr.getDojoEnergy() + ServerConstants.DOJO_ENERGY_ATK);
|
||||
chr.setDojoEnergy(chr.getDojoEnergy() + YamlConfig.config.server.DOJO_ENERGY_ATK);
|
||||
c.announce(MaplePacketCreator.getEnergy("energy", chr.getDojoEnergy()));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ package net.server.channel.handlers;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.processor.DueyProcessor;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
|
||||
import net.AbstractMaplePacketHandler;
|
||||
@@ -33,7 +34,7 @@ public final class DueyHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
if (!ServerConstants.USE_DUEY){
|
||||
if (!YamlConfig.config.server.USE_DUEY){
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
@@ -49,11 +50,11 @@ public final class EnterMTSHandler extends AbstractMaplePacketHandler {
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
|
||||
if(!chr.isAlive() && ServerConstants.USE_BUYBACK_SYSTEM) {
|
||||
if(!chr.isAlive() && YamlConfig.config.server.USE_BUYBACK_SYSTEM) {
|
||||
BuybackProcessor.processBuyback(c);
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
} else {
|
||||
if (!ServerConstants.USE_MTS) {
|
||||
if (!YamlConfig.config.server.USE_MTS) {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
@@ -38,7 +39,7 @@ import tools.data.input.SeekableLittleEndianAccessor;
|
||||
public final class FamilyAddHandler extends AbstractMaplePacketHandler {
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
if(!ServerConstants.USE_FAMILY_SYSTEM) {
|
||||
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) {
|
||||
return;
|
||||
}
|
||||
String toAdd = slea.readMapleAsciiString();
|
||||
@@ -58,7 +59,7 @@ public final class FamilyAddHandler extends AbstractMaplePacketHandler {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
} else if(MapleInviteCoordinator.hasInvite(InviteType.FAMILY, addChr.getId())) {
|
||||
c.announce(MaplePacketCreator.sendFamilyMessage(73, 0));
|
||||
} else if(chr.getFamily() != null && addChr.getFamily() != null && addChr.getFamily().getTotalGenerations() + chr.getFamily().getTotalGenerations() > ServerConstants.FAMILY_MAX_GENERATIONS) {
|
||||
} else if(chr.getFamily() != null && addChr.getFamily() != null && addChr.getFamily().getTotalGenerations() + chr.getFamily().getTotalGenerations() > YamlConfig.config.server.FAMILY_MAX_GENERATIONS) {
|
||||
c.announce(MaplePacketCreator.sendFamilyMessage(76, 0));
|
||||
} else {
|
||||
MapleInviteCoordinator.createInvite(InviteType.FAMILY, chr, addChr, addChr.getId());
|
||||
|
||||
@@ -22,6 +22,7 @@ package net.server.channel.handlers;
|
||||
import client.MapleClient;
|
||||
import client.MapleFamily;
|
||||
import client.MapleFamilyEntry;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import tools.MaplePacketCreator;
|
||||
@@ -31,7 +32,7 @@ public class FamilySeparateHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
@Override
|
||||
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
if(!ServerConstants.USE_FAMILY_SYSTEM) return;
|
||||
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) return;
|
||||
MapleFamily oldFamily = c.getPlayer().getFamily();
|
||||
if(oldFamily == null) return;
|
||||
MapleFamilyEntry forkOn = null;
|
||||
|
||||
@@ -4,6 +4,7 @@ import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.MapleFamilyEntitlement;
|
||||
import client.MapleFamilyEntry;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import net.server.coordinator.MapleInviteCoordinator;
|
||||
@@ -18,7 +19,7 @@ public class FamilySummonResponseHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
@Override
|
||||
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
if(!ServerConstants.USE_FAMILY_SYSTEM) return;
|
||||
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) return;
|
||||
slea.readMapleAsciiString(); //family name
|
||||
boolean accept = slea.readByte() != 0;
|
||||
MapleInviteResult inviteResult = MapleInviteCoordinator.answerInvite(InviteType.FAMILY_SUMMON, c.getPlayer().getId(), c.getPlayer(), accept);
|
||||
|
||||
@@ -25,6 +25,7 @@ import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.MapleFamilyEntitlement;
|
||||
import client.MapleFamilyEntry;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import net.server.coordinator.MapleInviteCoordinator;
|
||||
@@ -42,7 +43,7 @@ import tools.data.input.SeekableLittleEndianAccessor;
|
||||
public final class FamilyUseHandler extends AbstractMaplePacketHandler {
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
if(!ServerConstants.USE_FAMILY_SYSTEM) {
|
||||
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) {
|
||||
return;
|
||||
}
|
||||
MapleFamilyEntitlement type = MapleFamilyEntitlement.values()[slea.readInt()];
|
||||
|
||||
@@ -25,6 +25,7 @@ import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.command.CommandsExecutor;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import tools.FilePrinter;
|
||||
@@ -59,12 +60,12 @@ public final class GeneralChatHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
if (!chr.isHidden()) {
|
||||
chr.getMap().broadcastMessage(MaplePacketCreator.getChatText(chr.getId(), s, chr.getWhiteChat(), show));
|
||||
if (ServerConstants.USE_ENABLE_CHAT_LOG) {
|
||||
if (YamlConfig.config.server.USE_ENABLE_CHAT_LOG) {
|
||||
LogHelper.logChat(c, "General", s);
|
||||
}
|
||||
} else {
|
||||
chr.getMap().broadcastGMMessage(MaplePacketCreator.getChatText(chr.getId(), s, chr.getWhiteChat(), show));
|
||||
if (ServerConstants.USE_ENABLE_CHAT_LOG) {
|
||||
if (YamlConfig.config.server.USE_ENABLE_CHAT_LOG) {
|
||||
LogHelper.logChat(c, "GM General", s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import config.YamlConfig;
|
||||
import net.server.guild.MapleGuildResponse;
|
||||
import net.server.guild.MapleGuild;
|
||||
import constants.GameConstants;
|
||||
@@ -65,8 +66,8 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
||||
mc.dropMessage(1, "You cannot create a new Guild while in one.");
|
||||
return;
|
||||
}
|
||||
if (mc.getMeso() < ServerConstants.CREATE_GUILD_COST) {
|
||||
mc.dropMessage(1, "You do not have " + GameConstants.numberWithCommas(ServerConstants.CREATE_GUILD_COST) + " mesos to create a Guild.");
|
||||
if (mc.getMeso() < YamlConfig.config.server.CREATE_GUILD_COST) {
|
||||
mc.dropMessage(1, "You do not have " + GameConstants.numberWithCommas(YamlConfig.config.server.CREATE_GUILD_COST) + " mesos to create a Guild.");
|
||||
return;
|
||||
}
|
||||
String guildName = slea.readMapleAsciiString();
|
||||
@@ -76,8 +77,8 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
||||
}
|
||||
|
||||
Set<MapleCharacter> eligibleMembers = new HashSet<>(MapleGuild.getEligiblePlayersForGuild(mc));
|
||||
if (eligibleMembers.size() < ServerConstants.CREATE_GUILD_MIN_PARTNERS) {
|
||||
if (mc.getMap().getAllPlayers().size() < ServerConstants.CREATE_GUILD_MIN_PARTNERS) {
|
||||
if (eligibleMembers.size() < YamlConfig.config.server.CREATE_GUILD_MIN_PARTNERS) {
|
||||
if (mc.getMap().getAllPlayers().size() < YamlConfig.config.server.CREATE_GUILD_MIN_PARTNERS) {
|
||||
// thanks NovaStory for noticing message in need of smoother info
|
||||
mc.dropMessage(1, "Your Guild doesn't have enough cofounders present here and therefore cannot be created at this time.");
|
||||
} else {
|
||||
@@ -211,8 +212,8 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
||||
System.out.println("[Hack] " + mc.getName() + " tried to change guild emblem without being the guild leader.");
|
||||
return;
|
||||
}
|
||||
if (mc.getMeso() < ServerConstants.CHANGE_EMBLEM_COST) {
|
||||
c.announce(MaplePacketCreator.serverNotice(1, "You do not have " + GameConstants.numberWithCommas(ServerConstants.CHANGE_EMBLEM_COST) + " mesos to change the Guild emblem."));
|
||||
if (mc.getMeso() < YamlConfig.config.server.CHANGE_EMBLEM_COST) {
|
||||
c.announce(MaplePacketCreator.serverNotice(1, "You do not have " + GameConstants.numberWithCommas(YamlConfig.config.server.CHANGE_EMBLEM_COST) + " mesos to change the Guild emblem."));
|
||||
return;
|
||||
}
|
||||
short bg = slea.readShort();
|
||||
@@ -226,7 +227,7 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.getGuildAlliances(alliance, c.getWorld()), -1, -1);
|
||||
}
|
||||
|
||||
mc.gainMeso(-ServerConstants.CHANGE_EMBLEM_COST, true, false, true);
|
||||
mc.gainMeso(-YamlConfig.config.server.CHANGE_EMBLEM_COST, true, false, true);
|
||||
mc.getGuild().broadcastNameChanged();
|
||||
mc.getGuild().broadcastEmblemChanged();
|
||||
break;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
@@ -42,7 +43,7 @@ public final class InventoryMergeHandler extends AbstractMaplePacketHandler {
|
||||
slea.readInt();
|
||||
chr.getAutobanManager().setTimestamp(2, Server.getInstance().getCurrentTimestamp(), 4);
|
||||
|
||||
if(!ServerConstants.USE_ITEM_SORT) {
|
||||
if(!YamlConfig.config.server.USE_ITEM_SORT) {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ package net.server.channel.handlers;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import config.YamlConfig;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
@@ -265,7 +266,7 @@ public final class InventorySortHandler extends AbstractMaplePacketHandler {
|
||||
slea.readInt();
|
||||
chr.getAutobanManager().setTimestamp(3, Server.getInstance().getCurrentTimestamp(), 4);
|
||||
|
||||
if(!ServerConstants.USE_ITEM_SORT) {
|
||||
if(!YamlConfig.config.server.USE_ITEM_SORT) {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
@@ -295,7 +296,7 @@ public final class InventorySortHandler extends AbstractMaplePacketHandler {
|
||||
}
|
||||
|
||||
int invTypeCriteria = (MapleInventoryType.getByType(invType) == MapleInventoryType.EQUIP) ? 3 : 1;
|
||||
int sortCriteria = (ServerConstants.USE_ITEM_SORT_BY_NAME == true) ? 2 : 0;
|
||||
int sortCriteria = (YamlConfig.config.server.USE_ITEM_SORT_BY_NAME == true) ? 2 : 0;
|
||||
PairedQuicksort pq = new PairedQuicksort(itemarray, sortCriteria, invTypeCriteria);
|
||||
|
||||
for (Item item : itemarray) {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import config.YamlConfig;
|
||||
import server.MapleStatEffect;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
@@ -58,7 +59,7 @@ public final class MagicDamageHandler extends AbstractDealDamageHandler {
|
||||
}
|
||||
|
||||
if (chr.getMap().isDojoMap() && attack.numAttacked > 0) {
|
||||
chr.setDojoEnergy(chr.getDojoEnergy() + + ServerConstants.DOJO_ENERGY_ATK);
|
||||
chr.setDojoEnergy(chr.getDojoEnergy() + + YamlConfig.config.server.DOJO_ENERGY_ATK);
|
||||
c.announce(MaplePacketCreator.getEnergy("energy", chr.getDojoEnergy()));
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ import client.MapleClient;
|
||||
import java.awt.Point;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import server.life.MapleMonster;
|
||||
import server.life.MapleMonsterInformationProvider;
|
||||
@@ -156,7 +158,7 @@ public final class MoveLifeHandler extends AbstractMovementPacketHandler {
|
||||
}
|
||||
|
||||
if (movementDataLength > 0) {
|
||||
if (ServerConstants.USE_DEBUG_SHOW_RCVD_MVLIFE) {
|
||||
if (YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_MVLIFE) {
|
||||
System.out.println((isSkill ? "SKILL " : (isAttack ? "ATTCK " : " ")) + "castPos: " + castPos + " rawAct: " + rawActivity + " opt: " + pOption + " skillID: " + useSkillId + " skillLV: " + useSkillLevel + " " + "allowSkill: " + nextMovementCouldBeSkill + " mobMp: " + mobMp);
|
||||
}
|
||||
slea.seek(movementDataStart);
|
||||
|
||||
@@ -24,6 +24,7 @@ package net.server.channel.handlers;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.autoban.AutobanFactory;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import net.server.Server;
|
||||
@@ -57,24 +58,24 @@ public final class MultiChatHandler extends AbstractMaplePacketHandler {
|
||||
World world = c.getWorldServer();
|
||||
if (type == 0) {
|
||||
world.buddyChat(recipients, player.getId(), player.getName(), chattext);
|
||||
if (ServerConstants.USE_ENABLE_CHAT_LOG) {
|
||||
if (YamlConfig.config.server.USE_ENABLE_CHAT_LOG) {
|
||||
LogHelper.logChat(c, "Buddy", chattext);
|
||||
}
|
||||
} else if (type == 1 && player.getParty() != null) {
|
||||
world.partyChat(player.getParty(), chattext, player.getName());
|
||||
if (ServerConstants.USE_ENABLE_CHAT_LOG) {
|
||||
if (YamlConfig.config.server.USE_ENABLE_CHAT_LOG) {
|
||||
LogHelper.logChat(c, "Party", chattext);
|
||||
}
|
||||
} else if (type == 2 && player.getGuildId() > 0) {
|
||||
Server.getInstance().guildChat(player.getGuildId(), player.getName(), player.getId(), chattext);
|
||||
if (ServerConstants.USE_ENABLE_CHAT_LOG) {
|
||||
if (YamlConfig.config.server.USE_ENABLE_CHAT_LOG) {
|
||||
LogHelper.logChat(c, "Guild", chattext);
|
||||
}
|
||||
} else if (type == 3 && player.getGuild() != null) {
|
||||
int allianceId = player.getGuild().getAllianceId();
|
||||
if (allianceId > 0) {
|
||||
Server.getInstance().allianceMessage(allianceId, MaplePacketCreator.multiChat(player.getName(), chattext, 3), player.getId(), -1);
|
||||
if (ServerConstants.USE_ENABLE_CHAT_LOG) {
|
||||
if (YamlConfig.config.server.USE_ENABLE_CHAT_LOG) {
|
||||
LogHelper.logChat(c, "Ally", chattext);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ package net.server.channel.handlers;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.processor.DueyProcessor;
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import scripting.npc.NPCScriptManager;
|
||||
@@ -41,7 +42,7 @@ public final class NPCTalkHandler extends AbstractMaplePacketHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if(currentServerTime() - c.getPlayer().getNpcCooldown() < ServerConstants.BLOCK_NPC_RACE_CONDT) {
|
||||
if(currentServerTime() - c.getPlayer().getNpcCooldown() < YamlConfig.config.server.BLOCK_NPC_RACE_CONDT) {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
@@ -50,7 +51,7 @@ public final class NPCTalkHandler extends AbstractMaplePacketHandler {
|
||||
MapleMapObject obj = c.getPlayer().getMap().getMapObject(oid);
|
||||
if (obj instanceof MapleNPC) {
|
||||
MapleNPC npc = (MapleNPC) obj;
|
||||
if(ServerConstants.USE_DEBUG == true) c.getPlayer().dropMessage(5, "Talking to NPC " + npc.getId());
|
||||
if(YamlConfig.config.server.USE_DEBUG == true) c.getPlayer().dropMessage(5, "Talking to NPC " + npc.getId());
|
||||
|
||||
if (npc.getId() == 9010009) { //is duey
|
||||
DueyProcessor.dueySendTalk(c, false);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
@@ -33,7 +34,7 @@ import tools.data.input.SeekableLittleEndianAccessor;
|
||||
public final class OpenFamilyHandler extends AbstractMaplePacketHandler {
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
if(!ServerConstants.USE_FAMILY_SYSTEM) return;
|
||||
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) return;
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
c.announce(MaplePacketCreator.getFamilyInfo(chr.getFamilyEntry()));
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.ServerConstants;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
@@ -33,7 +34,7 @@ import tools.data.input.SeekableLittleEndianAccessor;
|
||||
public final class OpenFamilyPedigreeHandler extends AbstractMaplePacketHandler {
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
if(!ServerConstants.USE_FAMILY_SYSTEM) return;
|
||||
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) return;
|
||||
MapleCharacter target = c.getChannelServer().getPlayerStorage().getCharacterByName(slea.readMapleAsciiString());
|
||||
if(target != null && target.getFamily() != null) {
|
||||
c.announce(MaplePacketCreator.showPedigree(target.getFamilyEntry()));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user