2
0

Config.java 145 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package net.sf.l2j;
  16. import java.io.File;
  17. import java.io.FileInputStream;
  18. import java.io.FileOutputStream;
  19. import java.io.InputStream;
  20. import java.io.OutputStream;
  21. import java.math.BigInteger;
  22. import java.util.ArrayList;
  23. import java.util.List;
  24. import java.util.Map;
  25. import java.util.Properties;
  26. import java.util.logging.Logger;
  27. import javolution.util.FastList;
  28. import javolution.util.FastMap;
  29. /**
  30. * This class contains global server configuration.<br>
  31. * It has static final fields initialized from configuration files.<br>
  32. * It's initialized at the very begin of startup, and later JIT will optimize
  33. * away debug/unused code.
  34. *
  35. * @author mkizub
  36. */
  37. public final class Config
  38. {
  39. protected static final Logger _log = Logger.getLogger(Config.class.getName());
  40. /******************************************************************************************************************************************************/
  41. /** L2J Property File Definitions Start Here**/
  42. /******************************************************************************************************************************************************/
  43. /** Properties file for Character Configurations */
  44. public static final String CHARACTER_CONFIG_FILE = "./config/Character.properties";
  45. /** Properties file for Dynamic Extensions*/
  46. public static final String EXTENSIONS_CONFIG_FILE = "./config/extensions.properties";
  47. /** Properties file for Feature Extensions*/
  48. public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
  49. /** Properties file for Fortress Siege */
  50. public static final String FORTSIEGE_CONFIGURATION_FILE = "./config/fortsiege.properties";
  51. /** Properties file for General Configurations */
  52. public static final String GENERAL_CONFIG_FILE = "./config/General.properties";
  53. /** Text file containing hexadecimal value of server ID */
  54. public static final String HEXID_FILE = "./config/hexid.txt";
  55. /** Properties file for the ID factory */
  56. public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
  57. /** Properties file for l2j server version configurations */
  58. public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
  59. /** Properties file for l2j datapack version configurations */
  60. public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
  61. /** Properties file for the L2J Mod Confirugrations */
  62. public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
  63. /** Properties file for login server configurations */
  64. public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
  65. /** Properties file for NPC Configurations */
  66. public static final String NPC_CONFIG_FILE = "./config/NPC.properties";
  67. /** Properties file for PVP Configurations */
  68. public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
  69. /** Properties file for rates Configurations */
  70. public static final String RATES_CONFIG_FILE = "./config/rates.properties";
  71. /** Properties file for game server (connection and ingame) configurations */
  72. public static final String CONFIGURATION_FILE = "./config/server.properties";
  73. /** Properties file for siege Configurations */
  74. public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
  75. /** Properties file for telnet configuration */
  76. public static final String TELNET_FILE = "./config/telnet.properties";
  77. /******************************************************************************************************************************************************/
  78. /** L2J Property File Definitions End Here**/
  79. /******************************************************************************************************************************************************/
  80. /******************************************************************************************************************************************************/
  81. /** L2J Variable Definitions Start Here**/
  82. /******************************************************************************************************************************************************/
  83. /** ************************************************** **/
  84. /** Character Settings -Begin **/
  85. /** ************************************************** **/
  86. public static int MASTERACCESS_LEVEL;
  87. public static int MASTERACCESS_NAME_COLOR;
  88. public static int MASTERACCESS_TITLE_COLOR;
  89. public static boolean ALT_GAME_DELEVEL;
  90. public static double ALT_WEIGHT_LIMIT;
  91. public static int RUN_SPD_BOOST;
  92. public static int DEATH_PENALTY_CHANCE;
  93. public static double RESPAWN_RESTORE_CP;
  94. public static double RESPAWN_RESTORE_HP;
  95. public static double RESPAWN_RESTORE_MP;
  96. public static boolean ALT_GAME_TIREDNESS;
  97. public static boolean ENABLE_MODIFY_SKILL_DURATION;
  98. public static Map<Integer, Integer> SKILL_DURATION_LIST;
  99. public static boolean ENABLE_MODIFY_SKILL_REUSE;
  100. public static Map<Integer, Integer> SKILL_REUSE_LIST;
  101. public static boolean AUTO_LEARN_SKILLS;
  102. public static boolean AUTO_LOOT_HERBS;
  103. public static byte BUFFS_MAX_AMOUNT;
  104. public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
  105. public static boolean ALT_GAME_CANCEL_BOW;
  106. public static boolean ALT_GAME_CANCEL_CAST;
  107. public static boolean EFFECT_CANCELING;
  108. public static boolean ALT_GAME_MAGICFAILURES;
  109. public static int PLAYER_FAKEDEATH_UP_PROTECTION;
  110. public static boolean STORE_SKILL_COOLTIME;
  111. public static boolean ALT_GAME_SHIELD_BLOCKS;
  112. public static int ALT_PERFECT_SHLD_BLOCK;
  113. public static boolean ALLOW_CLASS_MASTERS;
  114. public static boolean LIFE_CRYSTAL_NEEDED;
  115. public static boolean SP_BOOK_NEEDED;
  116. public static boolean ES_SP_BOOK_NEEDED;
  117. public static boolean ALT_GAME_SKILL_LEARN;
  118. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  119. public static int MAX_RUN_SPEED;
  120. public static int MAX_PCRIT_RATE;
  121. public static int MAX_MCRIT_RATE;
  122. public static byte MAX_SUBCLASS;
  123. public static int MAX_PVTSTORESELL_SLOTS_DWARF;
  124. public static int MAX_PVTSTORESELL_SLOTS_OTHER;
  125. public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
  126. public static int MAX_PVTSTOREBUY_SLOTS_OTHER;
  127. public static int INVENTORY_MAXIMUM_NO_DWARF;
  128. public static int INVENTORY_MAXIMUM_DWARF;
  129. public static int INVENTORY_MAXIMUM_GM;
  130. public static int WAREHOUSE_SLOTS_DWARF;
  131. public static int WAREHOUSE_SLOTS_NO_DWARF;
  132. public static int WAREHOUSE_SLOTS_CLAN;
  133. public static int FREIGHT_SLOTS;
  134. public static boolean CASTLE_SHIELD;
  135. public static boolean CLANHALL_SHIELD;
  136. public static boolean APELLA_ARMORS;
  137. public static boolean OATH_ARMORS;
  138. public static boolean CASTLE_CROWN;
  139. public static boolean CASTLE_CIRCLETS;
  140. public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
  141. public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
  142. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
  143. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
  144. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
  145. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
  146. public static boolean IS_CRAFTING_ENABLED;
  147. public static int DWARF_RECIPE_LIMIT;
  148. public static int COMMON_RECIPE_LIMIT;
  149. public static boolean ALT_GAME_CREATION;
  150. public static double ALT_GAME_CREATION_SPEED;
  151. public static double ALT_GAME_CREATION_XP_RATE;
  152. public static double ALT_GAME_CREATION_SP_RATE;
  153. public static boolean ALT_BLACKSMITH_USE_RECIPES;
  154. public static int ALT_CLAN_JOIN_DAYS;
  155. public static int ALT_CLAN_CREATE_DAYS;
  156. public static int ALT_CLAN_DISSOLVE_DAYS;
  157. public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
  158. public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
  159. public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
  160. public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
  161. public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
  162. public static int ALT_CLAN_MEMBERS_FOR_WAR;
  163. public static boolean ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE;
  164. public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
  165. public static boolean REMOVE_CASTLE_CIRCLETS;
  166. public static int ALT_PARTY_RANGE;
  167. public static int ALT_PARTY_RANGE2;
  168. public static int STARTING_ADENA;
  169. public static boolean AUTO_LOOT;
  170. public static int UNSTUCK_INTERVAL;
  171. public static int PLAYER_SPAWN_PROTECTION;
  172. public static boolean RESPAWN_RANDOM_ENABLED;
  173. public static int RESPAWN_RANDOM_MAX_OFFSET;
  174. public static boolean PETITIONING_ALLOWED;
  175. public static int MAX_PETITIONS_PER_PLAYER;
  176. public static int MAX_PETITIONS_PENDING;
  177. public static boolean ALT_GAME_FREIGHTS;
  178. public static int ALT_GAME_FREIGHT_PRICE;
  179. public static boolean ALT_GAME_FREE_TELEPORT;
  180. public static boolean ALT_RECOMMEND;
  181. public static int DELETE_DAYS;
  182. public static float ALT_GAME_EXPONENT_XP;
  183. public static float ALT_GAME_EXPONENT_SP;
  184. public static String PARTY_XP_CUTOFF_METHOD;
  185. public static double PARTY_XP_CUTOFF_PERCENT;
  186. public static int PARTY_XP_CUTOFF_LEVEL;
  187. /** ************************************************** **/
  188. /** Character Settings -End **/
  189. /** ************************************************** **/
  190. /** ************************************************** **/
  191. /** ClanHall Settings -Begin **/
  192. /** ************************************************** **/
  193. public static long CH_TELE_FEE_RATIO;
  194. public static int CH_TELE1_FEE;
  195. public static int CH_TELE2_FEE;
  196. public static long CH_ITEM_FEE_RATIO;
  197. public static int CH_ITEM1_FEE;
  198. public static int CH_ITEM2_FEE;
  199. public static int CH_ITEM3_FEE;
  200. public static long CH_MPREG_FEE_RATIO;
  201. public static int CH_MPREG1_FEE;
  202. public static int CH_MPREG2_FEE;
  203. public static int CH_MPREG3_FEE;
  204. public static int CH_MPREG4_FEE;
  205. public static int CH_MPREG5_FEE;
  206. public static long CH_HPREG_FEE_RATIO;
  207. public static int CH_HPREG1_FEE;
  208. public static int CH_HPREG2_FEE;
  209. public static int CH_HPREG3_FEE;
  210. public static int CH_HPREG4_FEE;
  211. public static int CH_HPREG5_FEE;
  212. public static int CH_HPREG6_FEE;
  213. public static int CH_HPREG7_FEE;
  214. public static int CH_HPREG8_FEE;
  215. public static int CH_HPREG9_FEE;
  216. public static int CH_HPREG10_FEE;
  217. public static int CH_HPREG11_FEE;
  218. public static int CH_HPREG12_FEE;
  219. public static int CH_HPREG13_FEE;
  220. public static long CH_EXPREG_FEE_RATIO;
  221. public static int CH_EXPREG1_FEE;
  222. public static int CH_EXPREG2_FEE;
  223. public static int CH_EXPREG3_FEE;
  224. public static int CH_EXPREG4_FEE;
  225. public static int CH_EXPREG5_FEE;
  226. public static int CH_EXPREG6_FEE;
  227. public static int CH_EXPREG7_FEE;
  228. public static long CH_SUPPORT_FEE_RATIO;
  229. public static int CH_SUPPORT1_FEE;
  230. public static int CH_SUPPORT2_FEE;
  231. public static int CH_SUPPORT3_FEE;
  232. public static int CH_SUPPORT4_FEE;
  233. public static int CH_SUPPORT5_FEE;
  234. public static int CH_SUPPORT6_FEE;
  235. public static int CH_SUPPORT7_FEE;
  236. public static int CH_SUPPORT8_FEE;
  237. public static long CH_CURTAIN_FEE_RATIO;
  238. public static int CH_CURTAIN1_FEE;
  239. public static int CH_CURTAIN2_FEE;
  240. public static long CH_FRONT_FEE_RATIO;
  241. public static int CH_FRONT1_FEE;
  242. public static int CH_FRONT2_FEE;
  243. /** ************************************************** **/
  244. /** ClanHall Settings -End **/
  245. /** ************************************************** **/
  246. /** ************************************************** **/
  247. /** Castle Settings -Begin **/
  248. /** ************************************************** **/
  249. public static long CS_TELE_FEE_RATIO;
  250. public static int CS_TELE1_FEE;
  251. public static int CS_TELE2_FEE;
  252. public static long CS_MPREG_FEE_RATIO;
  253. public static int CS_MPREG1_FEE;
  254. public static int CS_MPREG2_FEE;
  255. public static int CS_MPREG3_FEE;
  256. public static int CS_MPREG4_FEE;
  257. public static long CS_HPREG_FEE_RATIO;
  258. public static int CS_HPREG1_FEE;
  259. public static int CS_HPREG2_FEE;
  260. public static int CS_HPREG3_FEE;
  261. public static int CS_HPREG4_FEE;
  262. public static int CS_HPREG5_FEE;
  263. public static long CS_EXPREG_FEE_RATIO;
  264. public static int CS_EXPREG1_FEE;
  265. public static int CS_EXPREG2_FEE;
  266. public static int CS_EXPREG3_FEE;
  267. public static int CS_EXPREG4_FEE;
  268. public static long CS_SUPPORT_FEE_RATIO;
  269. public static int CS_SUPPORT1_FEE;
  270. public static int CS_SUPPORT2_FEE;
  271. public static int CS_SUPPORT3_FEE;
  272. public static int CS_SUPPORT4_FEE;
  273. /** ************************************************** **/
  274. /** Castlel Settings -End **/
  275. /** ************************************************** **/
  276. /** ************************************************** **/
  277. /** Feature Settings -Begin **/
  278. /** ************************************************** **/
  279. // TODO: Fill this area up!
  280. /** ************************************************** **/
  281. /** Feature Settings -End **/
  282. /** ************************************************** **/
  283. /** ************************************************** **/
  284. /** General Settings -Begin **/
  285. /** ************************************************** **/
  286. public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
  287. public static boolean SERVER_LIST_BRACKET;
  288. public static boolean SERVER_LIST_CLOCK;
  289. public static boolean SERVER_GMONLY;
  290. public static boolean GM_HERO_AURA;
  291. public static boolean GM_STARTUP_INVULNERABLE;
  292. public static boolean GM_STARTUP_INVISIBLE;
  293. public static boolean GM_STARTUP_SILENCE;
  294. public static boolean GM_STARTUP_AUTO_LIST;
  295. public static String GM_ADMIN_MENU_STYLE;
  296. public static boolean BYPASS_VALIDATION;
  297. public static boolean GAMEGUARD_ENFORCE;
  298. public static boolean GAMEGUARD_PROHIBITACTION;
  299. public static boolean LOG_CHAT;
  300. public static boolean LOG_ITEMS;
  301. public static boolean GMAUDIT;
  302. public static boolean DEBUG;
  303. public static boolean ASSERT;
  304. public static boolean DEVELOPER;
  305. public static boolean ACCEPT_GEOEDITOR_CONN;
  306. public static boolean TEST_SERVER;
  307. public static boolean ALT_DEV_NO_QUESTS;
  308. public static boolean ALT_DEV_NO_SPAWNS;
  309. public static boolean SERVER_LIST_TESTSERVER;
  310. public static int THREAD_P_EFFECTS;
  311. public static int THREAD_P_GENERAL;
  312. public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  313. public static int IO_PACKET_THREAD_CORE_SIZE;
  314. public static int GENERAL_THREAD_CORE_SIZE;
  315. public static int AI_MAX_THREAD;
  316. public static int PACKET_LIFETIME;
  317. public static int FLOODPROTECTOR_INITIALSIZE;
  318. public static boolean ALLOW_DISCARDITEM;
  319. public static int AUTODESTROY_ITEM_AFTER;
  320. public static int HERB_AUTO_DESTROY_TIME;
  321. public static String PROTECTED_ITEMS;
  322. public static List<Integer> LIST_PROTECTED_ITEMS = new FastList<Integer>();
  323. public static int CHAR_STORE_INTERVAL;
  324. public static boolean LAZY_ITEMS_UPDATE;
  325. public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
  326. public static boolean DESTROY_DROPPED_PLAYER_ITEM;
  327. public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
  328. public static boolean SAVE_DROPPED_ITEM;
  329. public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
  330. public static int SAVE_DROPPED_ITEM_INTERVAL;
  331. public static boolean CLEAR_DROPPED_ITEM_TABLE;
  332. public static boolean AUTODELETE_INVALID_QUEST_DATA;
  333. public static boolean PRECISE_DROP_CALCULATION;
  334. public static boolean MULTIPLE_ITEM_DROP;
  335. public static boolean FORCE_INVENTORY_UPDATE;
  336. public static boolean LAZY_CACHE;
  337. public static int MIN_NPC_ANIMATION;
  338. public static int MAX_NPC_ANIMATION;
  339. public static int MIN_MONSTER_ANIMATION;
  340. public static int MAX_MONSTER_ANIMATION;
  341. public static int COORD_SYNCHRONIZE;
  342. public static boolean GRIDS_ALWAYS_ON;
  343. public static int GRID_NEIGHBOR_TURNON_TIME;
  344. public static int GRID_NEIGHBOR_TURNOFF_TIME;
  345. public static int GEODATA;
  346. public static boolean FORCE_GEODATA;
  347. public static boolean MOVE_BASED_KNOWNLIST;
  348. public static int ZONE_TOWN;
  349. public static boolean ACTIVATE_POSITION_RECORDER;
  350. public static String DEFAULT_GLOBAL_CHAT;
  351. public static String DEFAULT_TRADE_CHAT;
  352. public static boolean ALLOW_WAREHOUSE;
  353. public static boolean WAREHOUSE_CACHE;
  354. public static int WAREHOUSE_CACHE_TIME;
  355. public static boolean ALLOW_FREIGHT;
  356. public static boolean ALLOW_WEAR;
  357. public static int WEAR_DELAY;
  358. public static int WEAR_PRICE;
  359. public static boolean ALLOW_LOTTERY;
  360. public static boolean ALLOW_RACE;
  361. public static boolean ALLOW_WATER;
  362. public static boolean ALLOW_RENTPET;
  363. public static boolean ALLOWFISHING;
  364. public static boolean ALLOW_BOAT;
  365. public static boolean ALLOW_CURSED_WEAPONS;
  366. public static boolean ALLOW_MANOR;
  367. public static boolean ALLOW_NPC_WALKERS;
  368. public static boolean ALLOW_PET_WALKERS;
  369. public static boolean SERVER_NEWS;
  370. public static String COMMUNITY_TYPE;
  371. public static boolean BBS_SHOW_PLAYERLIST;
  372. public static String BBS_DEFAULT;
  373. public static boolean SHOW_LEVEL_COMMUNITYBOARD;
  374. public static boolean SHOW_STATUS_COMMUNITYBOARD;
  375. public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
  376. public static int NAME_PER_ROW_COMMUNITYBOARD;
  377. public static int ALT_OLY_START_TIME;
  378. public static int ALT_OLY_MIN;
  379. public static long ALT_OLY_CPERIOD;
  380. public static long ALT_OLY_BATTLE;
  381. public static long ALT_OLY_BWAIT;
  382. public static long ALT_OLY_IWAIT;
  383. public static long ALT_OLY_WPERIOD;
  384. public static long ALT_OLY_VPERIOD;
  385. public static int ALT_OLY_CLASSED;
  386. public static int ALT_OLY_NONCLASSED;
  387. public static int ALT_OLY_BATTLE_REWARD_ITEM;
  388. public static int ALT_OLY_CLASSED_RITEM_C;
  389. public static int ALT_OLY_NONCLASSED_RITEM_C;
  390. public static int ALT_OLY_COMP_RITEM;
  391. public static int ALT_OLY_GP_PER_POINT;
  392. public static int ALT_OLY_MIN_POINT_FOR_EXCH;
  393. public static int ALT_OLY_HERO_POINTS;
  394. public static String ALT_OLY_RESTRICTED_ITEMS;
  395. public static List<Integer> LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
  396. public static int ALT_MANOR_REFRESH_TIME;
  397. public static int ALT_MANOR_REFRESH_MIN;
  398. public static int ALT_MANOR_APPROVE_TIME;
  399. public static int ALT_MANOR_APPROVE_MIN;
  400. public static int ALT_MANOR_MAINTENANCE_PERIOD;
  401. public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
  402. public static int ALT_MANOR_SAVE_PERIOD_RATE;
  403. public static int ALT_LOTTERY_PRIZE;
  404. public static int ALT_LOTTERY_TICKET_PRICE;
  405. public static float ALT_LOTTERY_5_NUMBER_RATE;
  406. public static float ALT_LOTTERY_4_NUMBER_RATE;
  407. public static float ALT_LOTTERY_3_NUMBER_RATE;
  408. public static int ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
  409. public static int RIFT_MIN_PARTY_SIZE;
  410. public static int RIFT_SPAWN_DELAY;
  411. public static int RIFT_MAX_JUMPS;
  412. public static int RIFT_AUTO_JUMPS_TIME_MIN;
  413. public static int RIFT_AUTO_JUMPS_TIME_MAX;
  414. public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
  415. public static int RIFT_ENTER_COST_RECRUIT;
  416. public static int RIFT_ENTER_COST_SOLDIER;
  417. public static int RIFT_ENTER_COST_OFFICER;
  418. public static int RIFT_ENTER_COST_CAPTAIN;
  419. public static int RIFT_ENTER_COST_COMMANDER;
  420. public static int RIFT_ENTER_COST_HERO;
  421. public static int DEFAULT_PUNISH;
  422. public static int DEFAULT_PUNISH_PARAM;
  423. public static boolean ONLY_GM_ITEMS_FREE;
  424. public static boolean JAIL_IS_PVP;
  425. public static boolean JAIL_DISABLE_CHAT;
  426. public static boolean CUSTOM_SPAWNLIST_TABLE;
  427. public static boolean SAVE_GMSPAWN_ON_CUSTOM;
  428. public static boolean DELETE_GMSPAWN_ON_CUSTOM;
  429. public static boolean CUSTOM_NPC_TABLE;
  430. public static boolean CUSTOM_ETCITEM_TABLE;
  431. public static boolean CUSTOM_ARMOR_TABLE;
  432. public static boolean CUSTOM_ARMORSETS_TABLE;
  433. public static boolean CUSTOM_WEAPON_TABLE;
  434. public static boolean CUSTOM_TELEPORT_TABLE;
  435. public static boolean CUSTOM_DROPLIST_TABLE;
  436. public static boolean CUSTOM_MERCHANT_TABLES;
  437. /** ************************************************** **/
  438. /** General Settings -End **/
  439. /** ************************************************** **/
  440. /** ************************************************** **/
  441. /** L2JMods Settings -Begin **/
  442. /** ************************************************** **/
  443. public static boolean L2JMOD_CHAMPION_ENABLE;
  444. public static boolean L2JMOD_CHAMPION_PASSIVE;
  445. public static int L2JMOD_CHAMPION_FREQUENCY;
  446. public static String L2JMOD_CHAMP_TITLE;
  447. public static int L2JMOD_CHAMP_MIN_LVL;
  448. public static int L2JMOD_CHAMP_MAX_LVL;
  449. public static int L2JMOD_CHAMPION_HP;
  450. public static int L2JMOD_CHAMPION_REWARDS;
  451. public static int L2JMOD_CHAMPION_ADENAS_REWARDS;
  452. public static float L2JMOD_CHAMPION_HP_REGEN;
  453. public static float L2JMOD_CHAMPION_ATK;
  454. public static float L2JMOD_CHAMPION_SPD_ATK;
  455. public static int L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
  456. public static int L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
  457. public static int L2JMOD_CHAMPION_REWARD_ID;
  458. public static int L2JMOD_CHAMPION_REWARD_QTY;
  459. public static boolean TVT_EVENT_ENABLED;
  460. public static int TVT_EVENT_INTERVAL;
  461. public static int TVT_EVENT_PARTICIPATION_TIME;
  462. public static int TVT_EVENT_RUNNING_TIME;
  463. public static int TVT_EVENT_PARTICIPATION_NPC_ID;
  464. public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
  465. public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
  466. public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
  467. public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
  468. public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
  469. public static String TVT_EVENT_TEAM_1_NAME;
  470. public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  471. public static String TVT_EVENT_TEAM_2_NAME;
  472. public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  473. public static List<int[]> TVT_EVENT_REWARDS = new FastList<int[]>();
  474. public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  475. public static boolean TVT_EVENT_SCROLL_ALLOWED;
  476. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  477. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  478. public static List<Integer> TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  479. public static List<Integer> TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  480. public static boolean TVT_REWARD_TEAM_TIE;
  481. public static byte TVT_EVENT_MIN_LVL;
  482. public static byte TVT_EVENT_MAX_LVL;
  483. public static boolean L2JMOD_ALLOW_WEDDING;
  484. public static int L2JMOD_WEDDING_PRICE;
  485. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  486. public static boolean L2JMOD_WEDDING_TELEPORT;
  487. public static int L2JMOD_WEDDING_TELEPORT_PRICE;
  488. public static int L2JMOD_WEDDING_TELEPORT_DURATION;
  489. public static boolean L2JMOD_WEDDING_SAMESEX;
  490. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  491. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  492. public static boolean BANKING_SYSTEM_ENABLED;
  493. public static int BANKING_SYSTEM_GOLDBARS;
  494. public static int BANKING_SYSTEM_ADENA;
  495. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
  496. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
  497. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;
  498. /** ************************************************** **/
  499. /** L2JMods Settings -End **/
  500. /** ************************************************** **/
  501. /** ************************************************** **/
  502. /** NPC Settings -Begin **/
  503. /** ************************************************** **/
  504. public static boolean ANNOUNCE_MAMMON_SPAWN;
  505. public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
  506. public static boolean ALT_GAME_VIEWNPC;
  507. public static int MAX_DRIFT_RANGE;
  508. public static boolean DEEPBLUE_DROP_RULES;
  509. public static boolean SHOW_NPC_LVL;
  510. public static boolean GUARD_ATTACK_AGGRO_MOB;
  511. public static boolean ALLOW_WYVERN_UPGRADER;
  512. public static String PET_RENT_NPC;
  513. public static List<Integer> LIST_PET_RENT_NPC = new FastList<Integer>();
  514. public static int WYVERN_SPEED;
  515. public static int STRIDER_SPEED;
  516. public static int FENRIR_SPEED;
  517. public static int GREAT_SNOW_WOLF_SPEED;
  518. public static int SNOW_FENRIR_SPEED;
  519. public static double RAID_HP_REGEN_MULTIPLIER;
  520. public static double RAID_MP_REGEN_MULTIPLIER;
  521. public static double RAID_PDEFENCE_MULTIPLIER;
  522. public static double RAID_MDEFENCE_MULTIPLIER;
  523. public static double RAID_MINION_RESPAWN_TIMER;
  524. public static float RAID_MIN_RESPAWN_MULTIPLIER;
  525. public static float RAID_MAX_RESPAWN_MULTIPLIER;
  526. /** ************************************************** **/
  527. /** NPC Settings -End **/
  528. /** ************************************************** **/
  529. /** ************************************************** **/
  530. /** PvP Settings -Begin **/
  531. /** ************************************************** **/
  532. /** Minimum karma gain/loss */
  533. public static int KARMA_MIN_KARMA;
  534. /** Maximum karma gain/loss */
  535. public static int KARMA_MAX_KARMA;
  536. /** Number to divide the xp received by, to calculate karma lost on xp gain/lost */
  537. public static int KARMA_XP_DIVIDER;
  538. /** The Minimum Karma lost if 0 karma is to be removed */
  539. public static int KARMA_LOST_BASE;
  540. /** Can a GM drop item ? */
  541. public static boolean KARMA_DROP_GM;
  542. /** Should award a pvp point for killing a player with karma ? */
  543. public static boolean KARMA_AWARD_PK_KILL;
  544. /** Minimum PK required to drop */
  545. public static int KARMA_PK_LIMIT;
  546. /** List of pet items that cannot be dropped (separated by ",") when PVP */
  547. public static String KARMA_NONDROPPABLE_PET_ITEMS;
  548. /** List of items that cannot be dropped (separated by ",") when PVP*/
  549. public static String KARMA_NONDROPPABLE_ITEMS;
  550. /** List of pet items that cannot be dropped when PVP */
  551. public static List<Integer> KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<Integer>();
  552. /** List of items that cannot be dropped when PVP */
  553. public static List<Integer> KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  554. /** ************************************************** **/
  555. /** PvP Settings -End **/
  556. /** ************************************************** **/
  557. /** ************************************************** **/
  558. /** Rate Settings -Begin **/
  559. /** ************************************************** **/
  560. /** Rate for eXperience Point rewards */
  561. public static float RATE_XP;
  562. /** Rate for Skill Point rewards */
  563. public static float RATE_SP;
  564. /** Rate for party eXperience Point rewards */
  565. public static float RATE_PARTY_XP;
  566. /** Rate for party Skill Point rewards */
  567. public static float RATE_PARTY_SP;
  568. /** Rate for Quest rewards (XP and SP) */
  569. public static float RATE_QUESTS_REWARD;
  570. /** Rate for drop adena */
  571. public static float RATE_DROP_ADENA;
  572. /** Rate for cost of consumable */
  573. public static float RATE_CONSUMABLE_COST;
  574. /** Rate for dropped items */
  575. public static float RATE_DROP_ITEMS;
  576. /** Rate for dropped items by Raid Bosses */
  577. public static float RATE_DROP_ITEMS_BY_RAID;
  578. /** Rate for spoiled items */
  579. public static float RATE_DROP_SPOIL;
  580. /** Rate for manor items */
  581. public static int RATE_DROP_MANOR;
  582. /** Rate for quest items */
  583. public static float RATE_DROP_QUEST;
  584. /** Rate for karma and experience lose */
  585. public static float RATE_KARMA_EXP_LOST;
  586. /** Rate siege guards prices */
  587. public static float RATE_SIEGE_GUARDS_PRICE;
  588. /** Rate Common herbs */
  589. public static float RATE_DROP_COMMON_HERBS;
  590. /** Rate MP/HP herbs */
  591. public static float RATE_DROP_MP_HP_HERBS;
  592. /** Rate Common herbs */
  593. public static float RATE_DROP_GREATER_HERBS;
  594. /** Rate Common herbs */
  595. public static float RATE_DROP_SUPERIOR_HERBS;
  596. /** Rate Common herbs */
  597. public static float RATE_DROP_SPECIAL_HERBS;
  598. /** Limit for player drop */
  599. public static int PLAYER_DROP_LIMIT;
  600. /** Rate for drop */
  601. public static int PLAYER_RATE_DROP;
  602. /** Rate for player's item drop */
  603. public static int PLAYER_RATE_DROP_ITEM;
  604. /** Rate for player's equipment drop */
  605. public static int PLAYER_RATE_DROP_EQUIP;
  606. /** Rate for player's equipment and weapon drop */
  607. public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
  608. /** Rate for experience rewards of the pet */
  609. public static float PET_XP_RATE;
  610. /** Rate for food consumption of the pet */
  611. public static int PET_FOOD_RATE;
  612. /** Rate for experience rewards of the Sin Eater */
  613. public static float SINEATER_XP_RATE;
  614. /** Karma drop limit */
  615. public static int KARMA_DROP_LIMIT;
  616. /** Karma drop rate */
  617. public static int KARMA_RATE_DROP;
  618. /** Karma drop rate for item */
  619. public static int KARMA_RATE_DROP_ITEM;
  620. /** Karma drop rate for equipment */
  621. public static int KARMA_RATE_DROP_EQUIP;
  622. /** Karma drop rate for equipment and weapon */
  623. public static int KARMA_RATE_DROP_EQUIP_WEAPON;
  624. /** ************************************************** **/
  625. /** Rate Settings -End **/
  626. /** ************************************************** **/
  627. /** ************************************************** **/
  628. /** SevinSigns Settings -Begin **/
  629. /** ************************************************** **/
  630. public static boolean ALT_GAME_REQUIRE_CASTLE_DAWN;
  631. public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
  632. public static int ALT_FESTIVAL_MIN_PLAYER;
  633. public static int ALT_MAXIMUM_PLAYER_CONTRIB;
  634. public static long ALT_FESTIVAL_MANAGER_START;
  635. public static long ALT_FESTIVAL_LENGTH;
  636. public static long ALT_FESTIVAL_CYCLE_LENGTH;
  637. public static long ALT_FESTIVAL_FIRST_SPAWN;
  638. public static long ALT_FESTIVAL_FIRST_SWARM;
  639. public static long ALT_FESTIVAL_SECOND_SPAWN;
  640. public static long ALT_FESTIVAL_SECOND_SWARM;
  641. public static long ALT_FESTIVAL_CHEST_SPAWN;
  642. /** ************************************************** **/
  643. /** SevinSigns Settings -End **/
  644. /** ************************************************** **/
  645. /** ************************************************** **/
  646. /** Server Settings -Begin **/
  647. /** ************************************************** **/
  648. /** Game Server ports */
  649. public static int PORT_GAME;
  650. /** Login Server port */
  651. public static int PORT_LOGIN;
  652. /** Login Server bind ip */
  653. public static String LOGIN_BIND_ADDRESS;
  654. /** Number of login tries before IP ban gets activated, default 10*/
  655. public static int LOGIN_TRY_BEFORE_BAN;
  656. /** Number of seconds the IP ban will last, default 10 minutes */
  657. public static int LOGIN_BLOCK_AFTER_BAN;
  658. /** Hostname of the Game Server */
  659. public static String GAMESERVER_HOSTNAME;
  660. /** Driver to access to database */
  661. public static String DATABASE_DRIVER;
  662. /** Path to access to database */
  663. public static String DATABASE_URL;
  664. /** Database login */
  665. public static String DATABASE_LOGIN;
  666. /** Database password */
  667. public static String DATABASE_PASSWORD;
  668. /** Maximum number of connections to the database */
  669. public static int DATABASE_MAX_CONNECTIONS;
  670. /** Maximum number of players allowed to play simultaneously on server */
  671. public static int MAXIMUM_ONLINE_USERS;
  672. /** Character name template */
  673. public static String CNAME_TEMPLATE;
  674. /** Pet name template */
  675. public static String PET_NAME_TEMPLATE;
  676. /** Maximum number of characters per account */
  677. public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
  678. /** Datapack root directory */
  679. public static File DATAPACK_ROOT;
  680. /** Accept alternate ID for server ? */
  681. public static boolean ACCEPT_ALTERNATE_ID;
  682. /** ID for request to the server */
  683. public static int REQUEST_ID;
  684. public static boolean RESERVE_HOST_ON_LOGIN = false;
  685. /** Minimal protocol revision */
  686. public static int MIN_PROTOCOL_REVISION;
  687. /** Maximal protocol revision */
  688. public static int MAX_PROTOCOL_REVISION;
  689. /** ************************************************** **/
  690. /** Server Settings -End **/
  691. /** ************************************************** **/
  692. /******************************************************************************************************************************************************/
  693. /** L2J Variable Definitions End Here**/
  694. /******************************************************************************************************************************************************/
  695. public static int MAX_ITEM_IN_PACKET;
  696. public static boolean CHECK_KNOWN;
  697. /** Game Server login port */
  698. public static int GAME_SERVER_LOGIN_PORT;
  699. /** Game Server login Host */
  700. public static String GAME_SERVER_LOGIN_HOST;
  701. /** Internal Hostname */
  702. public static String INTERNAL_HOSTNAME;
  703. /** External Hostname */
  704. public static String EXTERNAL_HOSTNAME;
  705. public static int PATH_NODE_RADIUS;
  706. public static int NEW_NODE_ID;
  707. public static int SELECTED_NODE_ID;
  708. public static int LINKED_NODE_ID;
  709. public static String NEW_NODE_TYPE;
  710. /** Time between 2 updates of IP */
  711. public static int IP_UPDATE_TIME;
  712. // Server version
  713. /** Server version */
  714. public static String SERVER_VERSION;
  715. /** Date of server build */
  716. public static String SERVER_BUILD_DATE;
  717. // Datapack version
  718. /** Datapack version */
  719. public static String DATAPACK_VERSION;
  720. /** List of items that cannot be dropped (seperated by ",") */
  721. public static String NONDROPPABLE_ITEMS;
  722. /** List of items that cannot be dropped */
  723. public static List<Integer> LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  724. /** Duration (in ms) while a player stay in PVP mode after hitting an innocent */
  725. public static int PVP_NORMAL_TIME;
  726. /** Duration (in ms) while a player stay in PVP mode after hitting a purple player */
  727. public static int PVP_PVP_TIME;
  728. // Packet information
  729. /** Count the amount of packets per minute ? */
  730. public static boolean COUNT_PACKETS = false;
  731. /** Dump packet count ? */
  732. public static boolean DUMP_PACKET_COUNTS = false;
  733. /** Time interval between 2 dumps */
  734. public static int DUMP_INTERVAL_SECONDS = 60;
  735. /** Enumeration for type of ID Factory */
  736. public static enum IdFactoryType
  737. {
  738. Compaction,
  739. BitSet,
  740. Stack
  741. }
  742. /** ID Factory type */
  743. public static IdFactoryType IDFACTORY_TYPE;
  744. /** Check for bad ID ? */
  745. public static boolean BAD_ID_CHECKING;
  746. /** Enumeration for type of maps object */
  747. public static enum ObjectMapType
  748. {
  749. L2ObjectHashMap,
  750. WorldObjectMap
  751. }
  752. /** Enumeration for type of set object */
  753. public static enum ObjectSetType
  754. {
  755. L2ObjectHashSet,
  756. WorldObjectSet
  757. }
  758. /** Type of map object */
  759. public static ObjectMapType MAP_TYPE;
  760. /** Type of set object */
  761. public static ObjectSetType SET_TYPE;
  762. /** Chance that an item will successfully be enchanted */
  763. public static int ENCHANT_CHANCE_WEAPON;
  764. public static int ENCHANT_CHANCE_ARMOR;
  765. public static int ENCHANT_CHANCE_JEWELRY;
  766. public static int BLESSED_ENCHANT_CHANCE_WEAPON;
  767. public static int BLESSED_ENCHANT_CHANCE_ARMOR;
  768. public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
  769. /** Maximum level of enchantment */
  770. public static int ENCHANT_MAX_WEAPON;
  771. public static int ENCHANT_MAX_ARMOR;
  772. public static int ENCHANT_MAX_JEWELRY;
  773. /** maximum level of safe enchantment for normal items*/
  774. public static int ENCHANT_SAFE_MAX;
  775. /** maximum level of safe enchantment for full body armor*/
  776. public static int ENCHANT_SAFE_MAX_FULL;
  777. // Character multipliers
  778. /** Multiplier for character HP regeneration */
  779. public static double HP_REGEN_MULTIPLIER;
  780. /** Mutilplier for character MP regeneration */
  781. public static double MP_REGEN_MULTIPLIER;
  782. /** Multiplier for character CP regeneration */
  783. public static double CP_REGEN_MULTIPLIER;
  784. /** Is telnet enabled ? */
  785. public static boolean IS_TELNET_ENABLED;
  786. /** Show licence or not just after login (if false, will directly go to the Server List */
  787. public static boolean SHOW_LICENCE;
  788. /** Force GameGuard authorization in loginserver */
  789. public static boolean FORCE_GGAUTH;
  790. /** Accept new game server ? */
  791. public static boolean ACCEPT_NEW_GAMESERVER;
  792. /** Server ID used with the HexID */
  793. public static int SERVER_ID;
  794. /** Hexadecimal ID of the game server */
  795. public static byte[] HEX_ID;
  796. public static int MINIMUM_UPDATE_DISTANCE;
  797. public static int KNOWNLIST_FORGET_DELAY;
  798. public static int MINIMUN_UPDATE_TIME;
  799. /** Allow auto-create account ? */
  800. public static boolean AUTO_CREATE_ACCOUNTS;
  801. public static boolean FLOOD_PROTECTION;
  802. public static int FAST_CONNECTION_LIMIT;
  803. public static int NORMAL_CONNECTION_TIME;
  804. public static int FAST_CONNECTION_TIME;
  805. public static int MAX_CONNECTION_PER_IP;
  806. /**
  807. * This class initializes all global variables for configuration.<br>
  808. * If key doesn't appear in properties file, a default value is setting on by this class.
  809. * @see CONFIGURATION_FILE (propertie file) for configuring your server.
  810. */
  811. public static void load()
  812. {
  813. if(Server.serverMode == Server.MODE_GAMESERVER)
  814. {
  815. _log.info("loading gameserver config");
  816. try {
  817. Properties serverSettings = new Properties();
  818. InputStream is = new FileInputStream(new File(CONFIGURATION_FILE));
  819. serverSettings.load(is);
  820. is.close();
  821. GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
  822. PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
  823. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
  824. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
  825. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
  826. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");
  827. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  828. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  829. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  830. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  831. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  832. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  833. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  834. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  835. CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
  836. PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
  837. MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
  838. MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
  839. MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
  840. MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
  841. if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
  842. {
  843. throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
  844. }
  845. }
  846. catch (Exception e)
  847. {
  848. e.printStackTrace();
  849. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  850. }
  851. // Feature Config File
  852. try
  853. {
  854. Properties Feature = new Properties();
  855. InputStream is = new FileInputStream(new File(FEATURE_CONFIG_FILE));
  856. Feature.load(is);
  857. is.close();
  858. CH_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallTeleportFunctionFeeRatio", "604800000"));
  859. CH_TELE1_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "7000"));
  860. CH_TELE2_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "14000"));
  861. CH_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallSupportFunctionFeeRatio", "86400000"));
  862. CH_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl1", "2500"));
  863. CH_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl2", "5000"));
  864. CH_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl3", "7000"));
  865. CH_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl4", "11000"));
  866. CH_SUPPORT5_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl5", "21000"));
  867. CH_SUPPORT6_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl6", "36000"));
  868. CH_SUPPORT7_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl7", "37000"));
  869. CH_SUPPORT8_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl8", "52000"));
  870. CH_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRatio", "86400000"));
  871. CH_MPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "2000"));
  872. CH_MPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "3750"));
  873. CH_MPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "6500"));
  874. CH_MPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "13750"));
  875. CH_MPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "20000"));
  876. CH_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRatio", "86400000"));
  877. CH_HPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "700"));
  878. CH_HPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "800"));
  879. CH_HPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "1000"));
  880. CH_HPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "1166"));
  881. CH_HPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "1500"));
  882. CH_HPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "1750"));
  883. CH_HPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "2000"));
  884. CH_HPREG8_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "2250"));
  885. CH_HPREG9_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "2500"));
  886. CH_HPREG10_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "3250"));
  887. CH_HPREG11_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "3270"));
  888. CH_HPREG12_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "4250"));
  889. CH_HPREG13_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "5166"));
  890. CH_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRatio", "86400000"));
  891. CH_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "3000"));
  892. CH_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "6000"));
  893. CH_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "9000"));
  894. CH_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "15000"));
  895. CH_EXPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "21000"));
  896. CH_EXPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "23330"));
  897. CH_EXPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "30000"));
  898. CH_ITEM_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallItemCreationFunctionFeeRatio", "86400000"));
  899. CH_ITEM1_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "30000"));
  900. CH_ITEM2_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "70000"));
  901. CH_ITEM3_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "140000"));
  902. CH_CURTAIN_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallCurtainFunctionFeeRatio", "604800000"));
  903. CH_CURTAIN1_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "2000"));
  904. CH_CURTAIN2_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "2500"));
  905. CH_FRONT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRatio", "259200000"));
  906. CH_FRONT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "1300"));
  907. CH_FRONT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "4000"));
  908. //
  909. CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
  910. CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
  911. CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
  912. CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
  913. CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
  914. CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
  915. CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
  916. CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
  917. CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
  918. CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
  919. CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
  920. CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
  921. CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
  922. CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
  923. CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
  924. CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
  925. CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
  926. CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl14", "3270"));
  927. CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl15", "5166"));
  928. CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
  929. CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
  930. CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
  931. CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
  932. CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));
  933. //
  934. ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltRequireCastleForDawn", "False"));
  935. ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
  936. ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
  937. ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
  938. ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
  939. ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
  940. ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
  941. ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
  942. ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000")); ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
  943. ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
  944. ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
  945. }
  946. catch (Exception e)
  947. {
  948. e.printStackTrace();
  949. throw new Error("Failed to Load "+FEATURE_CONFIG_FILE+" File.");
  950. }
  951. // Character Config File
  952. try
  953. {
  954. Properties Character = new Properties();
  955. InputStream is = new FileInputStream(new File(CHARACTER_CONFIG_FILE));
  956. Character.load(is);
  957. is.close();
  958. MASTERACCESS_LEVEL = Integer.parseInt(Character.getProperty("MasterAccessLevel", "127"));
  959. MASTERACCESS_NAME_COLOR = Integer.decode("0x" + Character.getProperty("MasterNameColor", "00FF00"));
  960. MASTERACCESS_TITLE_COLOR = Integer.decode("0x" + Character.getProperty("MasterTitleColor", "00FF00"));
  961. ALT_GAME_DELEVEL = Boolean.parseBoolean(Character.getProperty("Delevel", "true"));
  962. ALT_WEIGHT_LIMIT = Double.parseDouble(Character.getProperty("AltWeightLimit", "1"));
  963. RUN_SPD_BOOST = Integer.parseInt(Character.getProperty("RunSpeedBoost", "0"));
  964. DEATH_PENALTY_CHANCE = Integer.parseInt(Character.getProperty("DeathPenaltyChance", "20"));
  965. RESPAWN_RESTORE_CP = Double.parseDouble(Character.getProperty("RespawnRestoreCP", "0")) / 100;
  966. RESPAWN_RESTORE_HP = Double.parseDouble(Character.getProperty("RespawnRestoreHP", "70")) / 100;
  967. RESPAWN_RESTORE_MP = Double.parseDouble(Character.getProperty("RespawnRestoreMP", "70")) / 100;
  968. HP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("HpRegenMultiplier", "100")) /100;
  969. MP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("MpRegenMultiplier", "100")) /100;
  970. CP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("CpRegenMultiplier", "100")) /100;
  971. ALT_GAME_TIREDNESS = Boolean.parseBoolean(Character.getProperty("AltGameTiredness", "false"));
  972. ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(Character.getProperty("EnableModifySkillDuration", "false"));
  973. // Create Map only if enabled
  974. if (ENABLE_MODIFY_SKILL_DURATION)
  975. {
  976. SKILL_DURATION_LIST = new FastMap<Integer, Integer>();
  977. String[] propertySplit;
  978. propertySplit = Character.getProperty("SkillDurationList", "").split(";");
  979. for (String skill : propertySplit)
  980. {
  981. String[] skillSplit = skill.split(",");
  982. if (skillSplit.length != 2)
  983. {
  984. System.out.println("[SkillDurationList]: invalid config property -> SkillDurationList \"" + skill + "\"");
  985. } else
  986. {
  987. try
  988. {
  989. SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  990. } catch (NumberFormatException nfe)
  991. {
  992. if (!skill.equals(""))
  993. {
  994. System.out.println("[SkillDurationList]: invalid config property -> SkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
  995. }
  996. }
  997. }
  998. }
  999. }
  1000. ENABLE_MODIFY_SKILL_REUSE = Boolean.parseBoolean(Character.getProperty("EnableModifySkillReuse", "false"));
  1001. // Create Map only if enabled
  1002. if (ENABLE_MODIFY_SKILL_REUSE)
  1003. {
  1004. SKILL_REUSE_LIST = new FastMap<Integer, Integer>();
  1005. String[] propertySplit;
  1006. propertySplit = Character.getProperty("SkillReuseList", "").split(";");
  1007. for (String skill : propertySplit)
  1008. {
  1009. String[] skillSplit = skill.split(",");
  1010. if (skillSplit.length != 2)
  1011. {
  1012. System.out.println("[SkillReuseList]: invalid config property -> SkillReuseList \"" + skill + "\"");
  1013. } else
  1014. {
  1015. try
  1016. {
  1017. SKILL_REUSE_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
  1018. } catch (NumberFormatException nfe)
  1019. {
  1020. if (!skill.equals(""))
  1021. {
  1022. System.out.println("[SkillReuseList]: invalid config property -> SkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
  1023. }
  1024. }
  1025. }
  1026. }
  1027. }
  1028. AUTO_LEARN_SKILLS = Boolean.parseBoolean(Character.getProperty("AutoLearnSkills", "false"));
  1029. AUTO_LOOT_HERBS = Boolean.parseBoolean(Character.getProperty("AutoLootHerbs", "true"));
  1030. BUFFS_MAX_AMOUNT = Byte.parseByte(Character.getProperty("maxbuffamount","24"));
  1031. AUTO_LEARN_DIVINE_INSPIRATION = Boolean.parseBoolean(Character.getProperty("AutoLearnDivineInspiration", "false"));
  1032. ALT_GAME_CANCEL_BOW = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1033. ALT_GAME_CANCEL_CAST = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1034. EFFECT_CANCELING = Boolean.parseBoolean(Character.getProperty("CancelLesserEffect", "True"));
  1035. ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(Character.getProperty("MagicFailures", "false"));
  1036. PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(Character.getProperty("PlayerFakeDeathUpProtection", "0"));
  1037. STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("StoreSkillCooltime", "true"));
  1038. ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(Character.getProperty("AltShieldBlocks", "false"));
  1039. ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(Character.getProperty("AltPerfectShieldBlockRate", "10"));
  1040. ALLOW_CLASS_MASTERS = Boolean.parseBoolean(Character.getProperty("AllowClassMasters", "False"));
  1041. LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(Character.getProperty("LifeCrystalNeeded", "true"));
  1042. SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("SpBookNeeded", "true"));
  1043. ES_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("EnchantSkillSpBookNeeded","true"));
  1044. ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(Character.getProperty("AltGameSkillLearn", "false"));
  1045. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(Character.getProperty("AltSubClassWithoutQuests", "False"));
  1046. MAX_RUN_SPEED = Integer.parseInt(Character.getProperty("MaxRunSpeed", "250"));
  1047. MAX_PCRIT_RATE = Integer.parseInt(Character.getProperty("MaxPCritRate", "500"));
  1048. MAX_MCRIT_RATE = Integer.parseInt(Character.getProperty("MaxMCritRate", "300"));
  1049. MAX_SUBCLASS = Byte.parseByte(Character.getProperty("MaxSubclass", "3"));
  1050. MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
  1051. MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsOther", "3"));
  1052. MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsDwarf", "5"));
  1053. MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsOther", "4"));
  1054. INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForNoDwarf", "80"));
  1055. INVENTORY_MAXIMUM_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForDwarf", "100"));
  1056. INVENTORY_MAXIMUM_GM = Integer.parseInt(Character.getProperty("MaximumSlotsForGMPlayer", "250"));
  1057. MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
  1058. WAREHOUSE_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
  1059. WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
  1060. WAREHOUSE_SLOTS_CLAN = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForClan", "150"));
  1061. FREIGHT_SLOTS = Integer.parseInt(Character.getProperty("MaximumFreightSlots", "20"));
  1062. CASTLE_SHIELD = Boolean.parseBoolean(Character.getProperty("CastleShieldRestriction", "True"));
  1063. CLANHALL_SHIELD = Boolean.parseBoolean(Character.getProperty("ClanHallShieldRestriction", "True"));
  1064. APELLA_ARMORS = Boolean.parseBoolean(Character.getProperty("ApellaArmorsRestriction", "True"));
  1065. OATH_ARMORS = Boolean.parseBoolean(Character.getProperty("OathArmorsRestriction", "True"));
  1066. CASTLE_CROWN = Boolean.parseBoolean(Character.getProperty("CastleLordsCrownRestriction", "True"));
  1067. CASTLE_CIRCLETS = Boolean.parseBoolean(Character.getProperty("CastleCircletsRestriction", "True"));
  1068. ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("EnchantChanceWeapon", "68"));
  1069. ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("EnchantChanceArmor", "52"));
  1070. ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("EnchantChanceJewelry", "54"));
  1071. BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("BlessedEnchantChanceWeapon", "68"));
  1072. BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("BlessedEnchantChanceArmor", "52"));
  1073. BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("BlessedEnchantChanceJewelry", "54"));
  1074. ENCHANT_MAX_WEAPON = Integer.parseInt(Character.getProperty("EnchantMaxWeapon", "255"));
  1075. ENCHANT_MAX_ARMOR = Integer.parseInt(Character.getProperty("EnchantMaxArmor", "255"));
  1076. ENCHANT_MAX_JEWELRY = Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "255"));
  1077. ENCHANT_SAFE_MAX = Integer.parseInt(Character.getProperty("EnchantSafeMax", "3"));
  1078. ENCHANT_SAFE_MAX_FULL = Integer.parseInt(Character.getProperty("EnchantSafeMaxFull", "4"));
  1079. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
  1080. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanShop", "true"));
  1081. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTeleport", "true"));
  1082. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseGK", "false"));
  1083. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTrade", "true"));
  1084. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
  1085. IS_CRAFTING_ENABLED = Boolean.parseBoolean(Character.getProperty("CraftingEnabled", "true"));
  1086. DWARF_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("DwarfRecipeLimit","50"));
  1087. COMMON_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("CommonRecipeLimit","50"));
  1088. ALT_GAME_CREATION = Boolean.parseBoolean(Character.getProperty("AltGameCreation", "false"));
  1089. ALT_GAME_CREATION_SPEED = Double.parseDouble(Character.getProperty("AltGameCreationSpeed", "1"));
  1090. ALT_GAME_CREATION_XP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationRateXp", "1"));
  1091. ALT_GAME_CREATION_SP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationRateSp", "1"));
  1092. ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(Character.getProperty("AltBlacksmithUseRecipes", "true"));
  1093. ALT_CLAN_JOIN_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeJoinAClan", "5"));
  1094. ALT_CLAN_CREATE_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeCreateAClan", "10"));
  1095. ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(Character.getProperty("DaysToPassToDissolveAClan", "7"));
  1096. ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
  1097. ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
  1098. ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
  1099. ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(Character.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "10"));
  1100. ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(Character.getProperty("AltMaxNumOfClansInAlly", "3"));
  1101. ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(Character.getProperty("AltClanMembersForWar", "15"));
  1102. //ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.parseBoolean(Character.getProperty("AltNewCharAlwaysIsNewbie", "False"));
  1103. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH= Boolean.parseBoolean(Character.getProperty("AltMembersCanWithdrawFromClanWH", "false"));
  1104. REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(Character.getProperty("RemoveCastleCirclets", "true"));
  1105. ALT_PARTY_RANGE = Integer.parseInt(Character.getProperty("AltPartyRange", "1600"));
  1106. ALT_PARTY_RANGE2 = Integer.parseInt(Character.getProperty("AltPartyRange2", "1400"));
  1107. STARTING_ADENA = Integer.parseInt(Character.getProperty("StartingAdena", "100"));
  1108. AUTO_LOOT = Boolean.parseBoolean(Character.getProperty("AutoLoot", "true"));
  1109. UNSTUCK_INTERVAL = Integer.parseInt(Character.getProperty("UnstuckInterval", "300"));
  1110. PLAYER_SPAWN_PROTECTION = Integer.parseInt(Character.getProperty("PlayerSpawnProtection", "0"));
  1111. RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(Character.getProperty("RespawnRandomInTown", "False"));
  1112. RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(Character.getProperty("RespawnRandomMaxOffset", "50"));
  1113. PETITIONING_ALLOWED = Boolean.parseBoolean(Character.getProperty("PetitioningAllowed", "True"));
  1114. MAX_PETITIONS_PER_PLAYER = Integer.parseInt(Character.getProperty("MaxPetitionsPerPlayer", "5"));
  1115. MAX_PETITIONS_PENDING = Integer.parseInt(Character.getProperty("MaxPetitionsPending", "25"));
  1116. ALT_GAME_FREIGHTS = Boolean.parseBoolean(Character.getProperty("AltGameFreights", "false"));
  1117. ALT_GAME_FREIGHT_PRICE = Integer.parseInt(Character.getProperty("AltGameFreightPrice", "1000"));
  1118. ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltFreeTeleporting", "False"));
  1119. ALT_RECOMMEND = Boolean.parseBoolean(Character.getProperty("AltRecommend", "False"));
  1120. DELETE_DAYS = Integer.parseInt(Character.getProperty("DeleteCharAfterDays", "7"));
  1121. ALT_GAME_EXPONENT_XP = Float.parseFloat(Character.getProperty("AltGameExponentXp", "0."));
  1122. ALT_GAME_EXPONENT_SP = Float.parseFloat(Character.getProperty("AltGameExponentSp", "0."));
  1123. PARTY_XP_CUTOFF_METHOD = Character.getProperty("PartyXpCutoffMethod", "percentage");
  1124. PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(Character.getProperty("PartyXpCutoffPercent", "3."));
  1125. PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(Character.getProperty("PartyXpCutoffLevel", "30"));
  1126. }
  1127. catch (Exception e)
  1128. {
  1129. e.printStackTrace();
  1130. throw new Error("Failed to Load "+CHARACTER_CONFIG_FILE+" File.");
  1131. }
  1132. /*
  1133. * Load L2J Server Version Properties file (if exists)
  1134. */
  1135. try
  1136. {
  1137. Properties serverVersion = new Properties();
  1138. InputStream is = new FileInputStream(new File(SERVER_VERSION_FILE));
  1139. serverVersion.load(is);
  1140. is.close();
  1141. SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1142. SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
  1143. }
  1144. catch (Exception e)
  1145. {
  1146. //Ignore Properties file if it doesnt exist
  1147. SERVER_VERSION = "Unsupported Custom Version.";
  1148. SERVER_BUILD_DATE = "Undefined Date.";
  1149. }
  1150. /*
  1151. * Load L2J Datapack Version Properties file (if exists)
  1152. */
  1153. try
  1154. {
  1155. Properties serverVersion = new Properties();
  1156. InputStream is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
  1157. serverVersion.load(is);
  1158. is.close();
  1159. DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1160. }
  1161. catch (Exception e)
  1162. {
  1163. //Ignore Properties file if it doesnt exist
  1164. DATAPACK_VERSION = "Unsupported Custom Version.";
  1165. }
  1166. // telnet
  1167. try
  1168. {
  1169. Properties telnetSettings = new Properties();
  1170. InputStream is = new FileInputStream(new File(TELNET_FILE));
  1171. telnetSettings.load(is);
  1172. is.close();
  1173. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  1174. }
  1175. catch (Exception e)
  1176. {
  1177. e.printStackTrace();
  1178. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1179. }
  1180. // id factory
  1181. try
  1182. {
  1183. Properties idSettings = new Properties();
  1184. InputStream is = new FileInputStream(new File(ID_CONFIG_FILE));
  1185. idSettings.load(is);
  1186. is.close();
  1187. MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
  1188. SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
  1189. IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
  1190. BAD_ID_CHECKING = Boolean.parseBoolean(idSettings.getProperty("BadIdChecking", "True"));
  1191. }
  1192. catch (Exception e)
  1193. {
  1194. e.printStackTrace();
  1195. throw new Error("Failed to Load "+ID_CONFIG_FILE+" File.");
  1196. }
  1197. // General Config File
  1198. try
  1199. {
  1200. Properties General = new Properties();
  1201. InputStream is = new FileInputStream(new File(GENERAL_CONFIG_FILE));
  1202. General.load(is);
  1203. is.close();
  1204. EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(General.getProperty("EverybodyHasAdminRights", "false"));
  1205. SERVER_LIST_BRACKET = Boolean.parseBoolean(General.getProperty("ServerListBrackets", "false"));
  1206. SERVER_LIST_CLOCK = Boolean.parseBoolean(General.getProperty("ServerListClock", "false"));
  1207. SERVER_GMONLY = Boolean.parseBoolean(General.getProperty("ServerGMOnly", "false"));
  1208. GM_HERO_AURA = Boolean.parseBoolean(General.getProperty("GMHeroAura", "True"));
  1209. GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(General.getProperty("GMStartupInvulnerable", "True"));
  1210. GM_STARTUP_INVISIBLE = Boolean.parseBoolean(General.getProperty("GMStartupInvisible", "True"));
  1211. GM_STARTUP_SILENCE = Boolean.parseBoolean(General.getProperty("GMStartupSilence", "True"));
  1212. GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(General.getProperty("GMStartupAutoList", "True"));
  1213. GM_ADMIN_MENU_STYLE = General.getProperty("GMAdminMenuStyle", "modern");
  1214. BYPASS_VALIDATION = Boolean.parseBoolean(General.getProperty("BypassValidation", "True"));
  1215. GAMEGUARD_ENFORCE = Boolean.parseBoolean(General.getProperty("GameGuardEnforce", "False"));
  1216. GAMEGUARD_PROHIBITACTION = Boolean.parseBoolean(General.getProperty("GameGuardProhibitAction", "False"));
  1217. LOG_CHAT = Boolean.parseBoolean(General.getProperty("LogChat", "false"));
  1218. LOG_ITEMS = Boolean.parseBoolean(General.getProperty("LogItems", "false"));
  1219. GMAUDIT = Boolean.parseBoolean(General.getProperty("GMAudit", "False"));
  1220. DEBUG = Boolean.parseBoolean(General.getProperty("Debug", "false"));
  1221. ASSERT = Boolean.parseBoolean(General.getProperty("Assert", "false"));
  1222. DEVELOPER = Boolean.parseBoolean(General.getProperty("Developer", "false"));
  1223. ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(General.getProperty("AcceptGeoeditorConn", "false"));
  1224. TEST_SERVER = Boolean.parseBoolean(General.getProperty("TestServer", "false"));
  1225. SERVER_LIST_TESTSERVER = Boolean.parseBoolean(General.getProperty("ListTestServers", "false"));
  1226. ALT_DEV_NO_QUESTS = Boolean.parseBoolean(General.getProperty("AltDevNoQuests", "False"));
  1227. ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(General.getProperty("AltDevNoSpawns", "False"));
  1228. THREAD_P_EFFECTS = Integer.parseInt(General.getProperty("ThreadPoolSizeEffects", "6"));
  1229. THREAD_P_GENERAL = Integer.parseInt(General.getProperty("ThreadPoolSizeGeneral", "15"));
  1230. IO_PACKET_THREAD_CORE_SIZE =Integer.parseInt(General.getProperty("UrgentPacketThreadCoreSize", "2"));
  1231. GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralPacketThreadCoreSize", "4"));
  1232. GENERAL_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralThreadCoreSize", "4"));
  1233. AI_MAX_THREAD = Integer.parseInt(General.getProperty("AiMaxThread", "10"));
  1234. PACKET_LIFETIME = Integer.parseInt(General.getProperty("PacketLifeTime", "0"));
  1235. FLOODPROTECTOR_INITIALSIZE = Integer.parseInt(General.getProperty("FloodProtectorInitialSize", "50"));
  1236. ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
  1237. AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "0"));
  1238. HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime","15"))*1000;
  1239. PROTECTED_ITEMS = General.getProperty("ListOfProtectedItems");
  1240. LIST_PROTECTED_ITEMS = new FastList<Integer>();
  1241. for (String id : PROTECTED_ITEMS.split(","))
  1242. {
  1243. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
  1244. }
  1245. CHAR_STORE_INTERVAL = Integer.parseInt(General.getProperty("CharacterDataStoreInterval", "15"));
  1246. LAZY_ITEMS_UPDATE = Boolean.parseBoolean(General.getProperty("LazyItemsUpdate", "false"));
  1247. UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(General.getProperty("UpdateItemsOnCharStore", "false"));
  1248. DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyPlayerDroppedItem", "false"));
  1249. DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyEquipableItem", "false"));
  1250. SAVE_DROPPED_ITEM = Boolean.parseBoolean(General.getProperty("SaveDroppedItem", "false"));
  1251. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(General.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
  1252. SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(General.getProperty("SaveDroppedItemInterval", "0"))*60000;
  1253. CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(General.getProperty("ClearDroppedItemTable", "false"));
  1254. AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(General.getProperty("AutoDeleteInvalidQuestData", "False"));
  1255. PRECISE_DROP_CALCULATION = Boolean.parseBoolean(General.getProperty("PreciseDropCalculation", "True"));
  1256. MULTIPLE_ITEM_DROP = Boolean.parseBoolean(General.getProperty("MultipleItemDrop", "True"));
  1257. FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(General.getProperty("ForceInventoryUpdate", "False"));
  1258. LAZY_CACHE = Boolean.parseBoolean(General.getProperty("LazyCache", "False"));
  1259. MIN_NPC_ANIMATION = Integer.parseInt(General.getProperty("MinNPCAnimation", "10"));
  1260. MAX_NPC_ANIMATION = Integer.parseInt(General.getProperty("MaxNPCAnimation", "20"));
  1261. MIN_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MinMonsterAnimation", "5"));
  1262. MAX_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MaxMonsterAnimation", "20"));
  1263. COORD_SYNCHRONIZE = Integer.parseInt(General.getProperty("CoordSynchronize", "-1"));
  1264. GRIDS_ALWAYS_ON = Boolean.parseBoolean(General.getProperty("GridsAlwaysOn", "False"));
  1265. GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOnTime", "1"));
  1266. GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOffTime", "90"));
  1267. GEODATA = Integer.parseInt(General.getProperty("GeoData", "0"));
  1268. FORCE_GEODATA = Boolean.parseBoolean(General.getProperty("ForceGeoData", "True"));
  1269. MOVE_BASED_KNOWNLIST = Boolean.parseBoolean(General.getProperty("MoveBasedKnownlist", "False"));
  1270. ZONE_TOWN = Integer.parseInt(General.getProperty("ZoneTown", "0"));
  1271. ACTIVATE_POSITION_RECORDER = Boolean.parseBoolean(General.getProperty("ActivatePositionRecorder", "False"));
  1272. DEFAULT_GLOBAL_CHAT = General.getProperty("GlobalChat", "ON");
  1273. DEFAULT_TRADE_CHAT = General.getProperty("TradeChat", "ON");
  1274. ALLOW_WAREHOUSE = Boolean.parseBoolean(General.getProperty("AllowWarehouse", "True"));
  1275. WAREHOUSE_CACHE = Boolean.parseBoolean(General.getProperty("WarehouseCache", "False"));
  1276. WAREHOUSE_CACHE_TIME = Integer.parseInt(General.getProperty("WarehouseCacheTime", "15"));
  1277. ALLOW_FREIGHT = Boolean.parseBoolean(General.getProperty("AllowFreight", "True"));
  1278. ALLOW_WEAR = Boolean.parseBoolean(General.getProperty("AllowWear", "False"));
  1279. WEAR_DELAY = Integer.parseInt(General.getProperty("WearDelay", "5"));
  1280. WEAR_PRICE = Integer.parseInt(General.getProperty("WearPrice", "10"));
  1281. ALLOW_LOTTERY = Boolean.parseBoolean(General.getProperty("AllowLottery", "False"));
  1282. ALLOW_RACE = Boolean.parseBoolean(General.getProperty("AllowRace", "False"));
  1283. ALLOW_WATER = Boolean.parseBoolean(General.getProperty("AllowWater", "False"));
  1284. ALLOW_RENTPET = Boolean.parseBoolean(General.getProperty("AllowRentPet", "False"));
  1285. FLOODPROTECTOR_INITIALSIZE = Integer.parseInt(General.getProperty("FloodProtectorInitialSize", "50"));
  1286. ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
  1287. ALLOWFISHING = Boolean.parseBoolean(General.getProperty("AllowFishing", "False"));
  1288. ALLOW_MANOR = Boolean.parseBoolean(General.getProperty("AllowManor", "False"));
  1289. ALLOW_BOAT = Boolean.parseBoolean(General.getProperty("AllowBoat", "False"));
  1290. ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(General.getProperty("AllowCursedWeapons", "False"));
  1291. ALLOW_MANOR = Boolean.parseBoolean(General.getProperty("AllowManor", "False"));
  1292. ALLOW_NPC_WALKERS = Boolean.parseBoolean(General.getProperty("AllowNpcWalkers", "true"));
  1293. ALLOW_PET_WALKERS = Boolean.parseBoolean(General.getProperty("AllowPetWalkers", "False"));
  1294. SERVER_NEWS = Boolean.parseBoolean(General.getProperty("ShowServerNews", "False"));
  1295. COMMUNITY_TYPE = General.getProperty("CommunityType", "old").toLowerCase();
  1296. BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(General.getProperty("BBSShowPlayerList", "false"));
  1297. BBS_DEFAULT = General.getProperty("BBSDefault", "_bbshome");
  1298. SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowLevelOnCommunityBoard", "False"));
  1299. SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowStatusOnCommunityBoard", "True"));
  1300. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePageSizeOnCommunityBoard", "50"));
  1301. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePerRowOnCommunityBoard", "5"));
  1302. ALT_OLY_START_TIME = Integer.parseInt(General.getProperty("AltOlyStartTime", "18"));
  1303. ALT_OLY_MIN = Integer.parseInt(General.getProperty("AltOlyMin","00"));
  1304. ALT_OLY_CPERIOD = Long.parseLong(General.getProperty("AltOlyCPeriod","21600000"));
  1305. ALT_OLY_BATTLE = Long.parseLong(General.getProperty("AltOlyBattle","360000"));
  1306. ALT_OLY_BWAIT = Long.parseLong(General.getProperty("AltOlyBWait","600000"));
  1307. ALT_OLY_IWAIT = Long.parseLong(General.getProperty("AltOlyIWait","300000"));
  1308. ALT_OLY_WPERIOD = Long.parseLong(General.getProperty("AltOlyWPeriod","604800000"));
  1309. ALT_OLY_VPERIOD = Long.parseLong(General.getProperty("AltOlyVPeriod","86400000"));
  1310. ALT_OLY_CLASSED = Integer.parseInt(General.getProperty("AltOlyClassedParticipants","5"));
  1311. ALT_OLY_NONCLASSED = Integer.parseInt(General.getProperty("AltOlyNonClassedParticipants","9"));
  1312. ALT_OLY_BATTLE_REWARD_ITEM = Integer.parseInt(General.getProperty("AltOlyBattleRewItem","6651"));
  1313. ALT_OLY_CLASSED_RITEM_C = Integer.parseInt(General.getProperty("AltOlyClassedRewItemCount","50"));
  1314. ALT_OLY_NONCLASSED_RITEM_C = Integer.parseInt(General.getProperty("AltOlyNonClassedRewItemCount","30"));
  1315. ALT_OLY_COMP_RITEM = Integer.parseInt(General.getProperty("AltOlyCompRewItem","6651"));
  1316. ALT_OLY_GP_PER_POINT = Integer.parseInt(General.getProperty("AltOlyGPPerPoint","1000"));
  1317. ALT_OLY_MIN_POINT_FOR_EXCH = Integer.parseInt(General.getProperty("AltOlyMinPointForExchange","50"));
  1318. ALT_OLY_HERO_POINTS = Integer.parseInt(General.getProperty("AltOlyHeroPoints","300"));
  1319. ALT_OLY_RESTRICTED_ITEMS = General.getProperty("AltOlyRestrictedItems","0");
  1320. LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
  1321. for (String id : ALT_OLY_RESTRICTED_ITEMS.split(","))
  1322. {
  1323. LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
  1324. }
  1325. ALT_MANOR_REFRESH_TIME = Integer.parseInt(General.getProperty("AltManorRefreshTime","20"));
  1326. ALT_MANOR_REFRESH_MIN = Integer.parseInt(General.getProperty("AltManorRefreshMin","00"));
  1327. ALT_MANOR_APPROVE_TIME = Integer.parseInt(General.getProperty("AltManorApproveTime","6"));
  1328. ALT_MANOR_APPROVE_MIN = Integer.parseInt(General.getProperty("AltManorApproveMin","00"));
  1329. ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(General.getProperty("AltManorMaintenancePeriod","360000"));
  1330. ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(General.getProperty("AltManorSaveAllActions","false"));
  1331. ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(General.getProperty("AltManorSavePeriodRate","2"));
  1332. ALT_LOTTERY_PRIZE = Integer.parseInt(General.getProperty("AltLotteryPrize","50000"));
  1333. ALT_LOTTERY_TICKET_PRICE = Integer.parseInt(General.getProperty("AltLotteryTicketPrice","2000"));
  1334. ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery5NumberRate","0.6"));
  1335. ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery4NumberRate","0.2"));
  1336. ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery3NumberRate","0.2"));
  1337. ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Integer.parseInt(General.getProperty("AltLottery2and1NumberPrize","200"));
  1338. RIFT_MIN_PARTY_SIZE = Integer.parseInt(General.getProperty("RiftMinPartySize", "5"));
  1339. RIFT_MAX_JUMPS = Integer.parseInt(General.getProperty("MaxRiftJumps", "4"));
  1340. RIFT_SPAWN_DELAY = Integer.parseInt(General.getProperty("RiftSpawnDelay", "10000"));
  1341. RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(General.getProperty("AutoJumpsDelayMin", "480"));
  1342. RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(General.getProperty("AutoJumpsDelayMax", "600"));
  1343. RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(General.getProperty("BossRoomTimeMultiply", "1.5"));
  1344. RIFT_ENTER_COST_RECRUIT = Integer.parseInt(General.getProperty("RecruitCost", "18"));
  1345. RIFT_ENTER_COST_SOLDIER = Integer.parseInt(General.getProperty("SoldierCost", "21"));
  1346. RIFT_ENTER_COST_OFFICER = Integer.parseInt(General.getProperty("OfficerCost", "24"));
  1347. RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(General.getProperty("CaptainCost", "27"));
  1348. RIFT_ENTER_COST_COMMANDER = Integer.parseInt(General.getProperty("CommanderCost", "30"));
  1349. RIFT_ENTER_COST_HERO = Integer.parseInt(General.getProperty("HeroCost", "33"));
  1350. DEFAULT_PUNISH = Integer.parseInt(General.getProperty("DefaultPunish", "2"));
  1351. DEFAULT_PUNISH_PARAM = Integer.parseInt(General.getProperty("DefaultPunishParam", "0"));
  1352. ONLY_GM_ITEMS_FREE = Boolean.parseBoolean(General.getProperty("OnlyGMItemsFree", "True"));
  1353. JAIL_IS_PVP = Boolean.parseBoolean(General.getProperty("JailIsPvp", "True"));
  1354. JAIL_DISABLE_CHAT = Boolean.parseBoolean(General.getProperty("JailDisableChat", "True"));
  1355. CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(General.getProperty("CustomSpawnlistTable", "false"));
  1356. SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("SaveGmSpawnOnCustom", "false"));
  1357. DELETE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("DeleteGmSpawnOnCustom", "false"));
  1358. CUSTOM_NPC_TABLE = Boolean.valueOf(General.getProperty("CustomNpcTable", "false"));
  1359. CUSTOM_ETCITEM_TABLE = Boolean.valueOf(General.getProperty("CustomEtcitemTable", "false"));
  1360. CUSTOM_ARMOR_TABLE = Boolean.valueOf(General.getProperty("CustomArmorTable", "false"));
  1361. CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(General.getProperty("CustomArmorSetsTable", "false"));
  1362. CUSTOM_WEAPON_TABLE = Boolean.valueOf(General.getProperty("CustomWeaponTable", "false"));
  1363. CUSTOM_TELEPORT_TABLE = Boolean.valueOf(General.getProperty("CustomTeleportTable", "false"));
  1364. CUSTOM_DROPLIST_TABLE = Boolean.valueOf(General.getProperty("CustomDroplistTable", "false"));
  1365. CUSTOM_MERCHANT_TABLES = Boolean.valueOf(General.getProperty("CustomMerchantTables", "false"));
  1366. }
  1367. catch (Exception e)
  1368. {
  1369. e.printStackTrace();
  1370. throw new Error("Failed to Load "+GENERAL_CONFIG_FILE+" File.");
  1371. }
  1372. // NPC settings
  1373. try
  1374. {
  1375. Properties NPC = new Properties();
  1376. InputStream is = new FileInputStream(new File(NPC_CONFIG_FILE));
  1377. NPC.load(is);
  1378. is.close();
  1379. ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(NPC.getProperty("AnnounceMammonSpawn", "True"));
  1380. ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(NPC.getProperty("AltMobAgroInPeaceZone", "true"));
  1381. ALT_GAME_VIEWNPC = Boolean.parseBoolean(NPC.getProperty("AltGameViewNpc", "False"));
  1382. MAX_DRIFT_RANGE = Integer.parseInt(NPC.getProperty("MaxDriftRange", "300"));
  1383. DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
  1384. SHOW_NPC_LVL = Boolean.parseBoolean(NPC.getProperty("ShowNpcLevel", "False"));
  1385. GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
  1386. ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
  1387. PET_RENT_NPC = NPC.getProperty("ListPetRentNpc", "30827");
  1388. LIST_PET_RENT_NPC = new FastList<Integer>();
  1389. for (String id : PET_RENT_NPC.split(","))
  1390. {
  1391. LIST_PET_RENT_NPC.add(Integer.parseInt(id));
  1392. }
  1393. WYVERN_SPEED = Integer.parseInt(NPC.getProperty("WyvernSpeed", "100"));
  1394. STRIDER_SPEED = Integer.parseInt(NPC.getProperty("StriderSpeed", "80"));
  1395. FENRIR_SPEED = Integer.parseInt(NPC.getProperty("FenrirSpeed", "80"));
  1396. SNOW_FENRIR_SPEED = Integer.parseInt(NPC.getProperty("SnowFenrirSpeed", "80"));
  1397. GREAT_SNOW_WOLF_SPEED = Integer.parseInt(NPC.getProperty("GreatSnowWolfSpeed", "80"));
  1398. RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) /100;
  1399. RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) /100;
  1400. RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPDefenceMultiplier", "100")) /100;
  1401. RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMDefenceMultiplier", "100")) /100;
  1402. RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMinRespawnMultiplier", "1.0"));
  1403. RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
  1404. RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
  1405. }
  1406. catch (Exception e)
  1407. {
  1408. e.printStackTrace();
  1409. throw new Error("Failed to Load "+NPC_CONFIG_FILE+" File.");
  1410. }
  1411. // rates
  1412. try
  1413. {
  1414. Properties ratesSettings = new Properties();
  1415. InputStream is = new FileInputStream(new File(RATES_CONFIG_FILE));
  1416. ratesSettings.load(is);
  1417. is.close();
  1418. RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
  1419. RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
  1420. RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
  1421. RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
  1422. RATE_QUESTS_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestsReward", "1."));
  1423. RATE_DROP_ADENA = Float.parseFloat(ratesSettings.getProperty("RateDropAdena", "1."));
  1424. RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
  1425. RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
  1426. RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(ratesSettings.getProperty("RateRaidDropItems", "1."));
  1427. RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
  1428. RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
  1429. RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("RateDropQuest", "1."));
  1430. RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
  1431. RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
  1432. RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "15."));
  1433. RATE_DROP_MP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpMpHerbs", "10."));
  1434. RATE_DROP_GREATER_HERBS = Float.parseFloat(ratesSettings.getProperty("RateGreaterHerbs", "4."));
  1435. RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSuperiorHerbs", "0.8"))*10;
  1436. RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "0.2"))*10;
  1437. PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
  1438. PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
  1439. PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
  1440. PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
  1441. PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
  1442. PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
  1443. PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
  1444. SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
  1445. KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
  1446. KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
  1447. KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
  1448. KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
  1449. KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
  1450. }
  1451. catch (Exception e) {
  1452. e.printStackTrace();
  1453. throw new Error("Failed to Load "+RATES_CONFIG_FILE+" File.");
  1454. }
  1455. try
  1456. {
  1457. Properties L2JModSettings = new Properties();
  1458. InputStream is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
  1459. L2JModSettings.load(is);
  1460. is.close();
  1461. L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
  1462. L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
  1463. L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
  1464. L2JMOD_CHAMP_TITLE = L2JModSettings.getProperty("ChampionTitle", "Champion");
  1465. L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
  1466. L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
  1467. L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
  1468. L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
  1469. L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
  1470. L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
  1471. L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
  1472. L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
  1473. L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
  1474. L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
  1475. L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
  1476. L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
  1477. TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
  1478. TVT_EVENT_INTERVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventInterval", "18000"));
  1479. TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
  1480. TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
  1481. TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
  1482. /** L2JMOD Wedding system */
  1483. L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(L2JModSettings.getProperty("AllowWedding", "False"));
  1484. L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
  1485. L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
  1486. L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
  1487. L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
  1488. L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
  1489. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
  1490. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
  1491. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
  1492. L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
  1493. L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
  1494. L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingFreight", "False"));
  1495. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  1496. {
  1497. TVT_EVENT_ENABLED = false;
  1498. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
  1499. }
  1500. else
  1501. {
  1502. String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
  1503. if (propertySplit.length < 3)
  1504. {
  1505. TVT_EVENT_ENABLED = false;
  1506. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
  1507. }
  1508. else
  1509. {
  1510. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1511. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1512. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1513. TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
  1514. TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
  1515. TVT_EVENT_MIN_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
  1516. TVT_EVENT_MAX_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
  1517. TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
  1518. TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
  1519. TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
  1520. propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
  1521. if (propertySplit.length < 3)
  1522. {
  1523. TVT_EVENT_ENABLED = false;
  1524. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
  1525. }
  1526. else
  1527. {
  1528. TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1529. TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1530. TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1531. TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
  1532. propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
  1533. if (propertySplit.length < 3)
  1534. {
  1535. TVT_EVENT_ENABLED= false;
  1536. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
  1537. }
  1538. else
  1539. {
  1540. TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1541. TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1542. TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1543. propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
  1544. for (String reward : propertySplit)
  1545. {
  1546. String[] rewardSplit = reward.split(",");
  1547. if (rewardSplit.length != 2)
  1548. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
  1549. else
  1550. {
  1551. try
  1552. {
  1553. TVT_EVENT_REWARDS.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  1554. }
  1555. catch (NumberFormatException nfe)
  1556. {
  1557. if (!reward.equals(""))
  1558. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
  1559. }
  1560. }
  1561. }
  1562. TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
  1563. TVT_EVENT_SCROLL_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventScrollAllowed", "false"));
  1564. TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
  1565. TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
  1566. TVT_REWARD_TEAM_TIE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTRewardTeamTie", "false"));
  1567. propertySplit = L2JModSettings.getProperty("TvTDoorsToOpen", "").split(";");
  1568. for (String door : propertySplit)
  1569. {
  1570. try
  1571. {
  1572. TVT_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
  1573. }
  1574. catch (NumberFormatException nfe)
  1575. {
  1576. if (!door.equals(""))
  1577. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"" + door + "\"");
  1578. }
  1579. }
  1580. propertySplit = L2JModSettings.getProperty("TvTDoorsToClose", "").split(";");
  1581. for (String door : propertySplit)
  1582. {
  1583. try
  1584. {
  1585. TVT_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
  1586. }
  1587. catch (NumberFormatException nfe)
  1588. {
  1589. if (!door.equals(""))
  1590. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"" + door + "\"");
  1591. }
  1592. }
  1593. }
  1594. }
  1595. }
  1596. }
  1597. BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
  1598. BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
  1599. BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
  1600. }
  1601. catch (Exception e)
  1602. {
  1603. e.printStackTrace();
  1604. throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File.");
  1605. }
  1606. // pvp config
  1607. try
  1608. {
  1609. Properties pvpSettings = new Properties();
  1610. InputStream is = new FileInputStream(new File(PVP_CONFIG_FILE));
  1611. pvpSettings.load(is);
  1612. is.close();
  1613. /* KARMA SYSTEM */
  1614. KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
  1615. KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
  1616. KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
  1617. KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
  1618. KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
  1619. KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
  1620. KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
  1621. KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
  1622. KARMA_NONDROPPABLE_ITEMS = pvpSettings.getProperty("ListOfNonDroppableItems", "57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,7694,8181,5575,7694,9388,9389,9390");
  1623. KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<Integer>();
  1624. for (String id : KARMA_NONDROPPABLE_PET_ITEMS.split(",")) {
  1625. KARMA_LIST_NONDROPPABLE_PET_ITEMS.add(Integer.parseInt(id));
  1626. }
  1627. KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  1628. for (String id : KARMA_NONDROPPABLE_ITEMS.split(",")) {
  1629. KARMA_LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
  1630. }
  1631. PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "15000"));
  1632. PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "30000"));
  1633. }
  1634. catch (Exception e)
  1635. {
  1636. e.printStackTrace();
  1637. throw new Error("Failed to Load "+PVP_CONFIG_FILE+" File.");
  1638. }
  1639. try
  1640. {
  1641. Properties Settings = new Properties();
  1642. InputStream is = new FileInputStream(HEXID_FILE);
  1643. Settings.load(is);
  1644. is.close();
  1645. SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
  1646. HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
  1647. }
  1648. catch (Exception e)
  1649. {
  1650. _log.warning("Could not load HexID file ("+HEXID_FILE+"). Hopefully login will give us one.");
  1651. }
  1652. }
  1653. else if(Server.serverMode == Server.MODE_LOGINSERVER)
  1654. {
  1655. _log.info("loading login config");
  1656. try
  1657. {
  1658. Properties serverSettings = new Properties();
  1659. InputStream is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
  1660. serverSettings.load(is);
  1661. is.close();
  1662. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");
  1663. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));
  1664. LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
  1665. PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
  1666. DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
  1667. DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
  1668. ASSERT = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));
  1669. ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
  1670. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  1671. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  1672. LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
  1673. LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
  1674. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); //FIXME: in login?
  1675. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
  1676. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
  1677. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  1678. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  1679. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  1680. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  1681. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  1682. SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
  1683. IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime","15"));
  1684. FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "false"));
  1685. AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));
  1686. FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
  1687. FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
  1688. NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
  1689. FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
  1690. MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
  1691. }
  1692. catch (Exception e)
  1693. {
  1694. e.printStackTrace();
  1695. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  1696. }
  1697. // telnet
  1698. try
  1699. {
  1700. Properties telnetSettings = new Properties();
  1701. InputStream is = new FileInputStream(new File(TELNET_FILE));
  1702. telnetSettings.load(is);
  1703. is.close();
  1704. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  1705. }
  1706. catch (Exception e)
  1707. {
  1708. e.printStackTrace();
  1709. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1710. }
  1711. }
  1712. else
  1713. {
  1714. _log.severe("Could not Load Config: server mode was not set");
  1715. }
  1716. }
  1717. /**
  1718. * Set a new value to a game parameter from the admin console.
  1719. * @param pName (String) : name of the parameter to change
  1720. * @param pValue (String) : new value of the parameter
  1721. * @return boolean : true if modification has been made
  1722. * @link useAdminCommand
  1723. */
  1724. public static boolean setParameterValue(String pName, String pValue)
  1725. {
  1726. // Server settings
  1727. if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
  1728. else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
  1729. else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
  1730. else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
  1731. else if (pName.equalsIgnoreCase("RateQuestsReward")) RATE_QUESTS_REWARD = Float.parseFloat(pValue);
  1732. else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ADENA = Float.parseFloat(pValue);
  1733. else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
  1734. else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
  1735. else if (pName.equalsIgnoreCase("RateRaidDropItems")) RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(pValue);
  1736. else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
  1737. else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
  1738. else if (pName.equalsIgnoreCase("RateDropQuest")) RATE_DROP_QUEST = Float.parseFloat(pValue);
  1739. else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
  1740. else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
  1741. else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
  1742. else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
  1743. else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
  1744. else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  1745. else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  1746. else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
  1747. else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
  1748. else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
  1749. else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  1750. else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  1751. else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
  1752. else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  1753. else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  1754. else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.parseBoolean(pValue);
  1755. else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(pValue);
  1756. else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
  1757. else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(pValue);
  1758. else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
  1759. else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
  1760. else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
  1761. else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
  1762. else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
  1763. else if (pName.equalsIgnoreCase("AllowFreight")) ALLOW_FREIGHT = Boolean.parseBoolean(pValue);
  1764. else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.parseBoolean(pValue);
  1765. else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.parseBoolean(pValue);
  1766. else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
  1767. else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
  1768. else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.parseBoolean(pValue);
  1769. else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.parseBoolean(pValue);
  1770. else if (pName.equalsIgnoreCase("AllowBoat")) ALLOW_BOAT = Boolean.parseBoolean(pValue);
  1771. else if (pName.equalsIgnoreCase("AllowCursedWeapons")) ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(pValue);
  1772. else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.parseBoolean(pValue);
  1773. else if (pName.equalsIgnoreCase("AllowPetWalkers")) ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
  1774. else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.parseBoolean(pValue);
  1775. else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = pValue.toLowerCase();
  1776. else if (pName.equalsIgnoreCase("BBSShowPlayerList")) BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
  1777. else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
  1778. else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  1779. else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  1780. else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
  1781. else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
  1782. else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.parseBoolean(pValue);
  1783. else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.parseBoolean(pValue);
  1784. else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);
  1785. else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(pValue);
  1786. else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
  1787. else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);
  1788. else if (pName.equalsIgnoreCase("MaximumUpdateDistance")) MINIMUM_UPDATE_DISTANCE = Integer.parseInt(pValue);
  1789. else if (pName.equalsIgnoreCase("MinimumUpdateTime")) MINIMUN_UPDATE_TIME = Integer.parseInt(pValue);
  1790. else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.parseBoolean(pValue);
  1791. else if (pName.equalsIgnoreCase("KnownListForgetDelay")) KNOWNLIST_FORGET_DELAY = Integer.parseInt(pValue);
  1792. // Other settings
  1793. else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.parseBoolean(pValue);
  1794. else if (pName.equalsIgnoreCase("AllowGuards")) GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(pValue);
  1795. else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.parseBoolean(pValue);
  1796. else if (pName.equalsIgnoreCase("WyvernSpeed")) WYVERN_SPEED = Integer.parseInt(pValue);
  1797. else if (pName.equalsIgnoreCase("StriderSpeed")) STRIDER_SPEED = Integer.parseInt(pValue);
  1798. else if (pName.equalsIgnoreCase("FenrirSpeed")) FENRIR_SPEED = Integer.parseInt(pValue);
  1799. else if (pName.equalsIgnoreCase("SnowFenrirSpeed")) SNOW_FENRIR_SPEED = Integer.parseInt(pValue);
  1800. else if (pName.equalsIgnoreCase("GreatSnowWolfSpeed")) GREAT_SNOW_WOLF_SPEED = Integer.parseInt(pValue);
  1801. else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
  1802. else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
  1803. else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
  1804. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
  1805. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
  1806. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
  1807. else if (pName.equalsIgnoreCase("MaximumFreightSlots")) FREIGHT_SLOTS = Integer.parseInt(pValue);
  1808. else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
  1809. else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
  1810. else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
  1811. else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
  1812. else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
  1813. else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
  1814. else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
  1815. else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
  1816. else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1817. else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1818. else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1819. else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1820. else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1821. else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier")) RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  1822. else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier")) RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  1823. else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
  1824. else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Integer.parseInt(pValue);
  1825. else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
  1826. else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
  1827. else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
  1828. else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
  1829. else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
  1830. else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
  1831. else if (pName.equalsIgnoreCase("RespawnRestoreCP")) RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
  1832. else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
  1833. else if (pName.equalsIgnoreCase("RespawnRestoreMP")) RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
  1834. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsDwarf")) MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(pValue);
  1835. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsOther")) MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(pValue);
  1836. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsDwarf")) MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(pValue);
  1837. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsOther")) MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(pValue);
  1838. else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  1839. else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(pValue);
  1840. // Alternative settings
  1841. else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.parseBoolean(pValue);
  1842. else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.parseBoolean(pValue);
  1843. else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
  1844. else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
  1845. else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
  1846. else if (pName.equalsIgnoreCase("AltWeightLimit")) ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
  1847. else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes")) ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(pValue);
  1848. else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(pValue);
  1849. else if (pName.equalsIgnoreCase("RemoveCastleCirclets")) REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
  1850. else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
  1851. {
  1852. ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
  1853. ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
  1854. }
  1855. else if (pName.equalsIgnoreCase("AltShieldBlocks")) ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(pValue);
  1856. else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
  1857. else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.parseBoolean(pValue);
  1858. else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(pValue);
  1859. else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone")) ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  1860. else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
  1861. else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
  1862. else if (pName.equalsIgnoreCase("AllowClassMasters")) ALLOW_CLASS_MASTERS = Boolean.parseBoolean(pValue);
  1863. else if (pName.equalsIgnoreCase("AltGameFreights")) ALT_GAME_FREIGHTS = Boolean.parseBoolean(pValue);
  1864. else if (pName.equalsIgnoreCase("AltGameFreightPrice")) ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue);
  1865. else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
  1866. else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
  1867. else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.parseBoolean(pValue);
  1868. else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
  1869. else if (pName.equalsIgnoreCase("SpBookNeeded")) SP_BOOK_NEEDED = Boolean.parseBoolean(pValue);
  1870. else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.parseBoolean(pValue);
  1871. else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);
  1872. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  1873. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(pValue);
  1874. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(pValue);
  1875. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pValue);
  1876. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pValue);
  1877. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pValue);
  1878. else if (pName.equalsIgnoreCase("AltRequireCastleForDawn")) ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.parseBoolean(pValue);
  1879. else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(pValue);
  1880. else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(pValue);
  1881. else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
  1882. //else if (pName.equalsIgnoreCase("AltNewCharAlwaysIsNewbie")) ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.parseBoolean(pValue);
  1883. else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
  1884. else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
  1885. else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
  1886. else if (pName.equalsIgnoreCase("CastleShieldRestriction")) CASTLE_SHIELD = Boolean.parseBoolean(pValue);
  1887. else if (pName.equalsIgnoreCase("ClanHallShieldRestriction")) CLANHALL_SHIELD = Boolean.parseBoolean(pValue);
  1888. else if (pName.equalsIgnoreCase("ApellaArmorsRestriction")) APELLA_ARMORS = Boolean.parseBoolean(pValue);
  1889. else if (pName.equalsIgnoreCase("OathArmorsRestriction")) OATH_ARMORS = Boolean.parseBoolean(pValue);
  1890. else if (pName.equalsIgnoreCase("CastleLordsCrownRestriction")) CASTLE_CROWN = Boolean.parseBoolean(pValue);
  1891. else if (pName.equalsIgnoreCase("CastleCircletsRestriction")) CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
  1892. //ChampionMobs L2JMOD
  1893. else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(pValue);
  1894. else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
  1895. else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
  1896. else if (pName.equalsIgnoreCase("ChampionMaxLevel")) L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
  1897. else if (pName.equalsIgnoreCase("ChampionHp")) L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
  1898. else if (pName.equalsIgnoreCase("ChampionHpRegen")) L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
  1899. else if (pName.equalsIgnoreCase("ChampionRewards")) L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
  1900. else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(pValue);
  1901. else if (pName.equalsIgnoreCase("ChampionAtk")) L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
  1902. else if (pName.equalsIgnoreCase("ChampionSpdAtk")) L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
  1903. else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance")) L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  1904. else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance")) L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  1905. else if (pName.equalsIgnoreCase("ChampionRewardItemID")) L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
  1906. else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
  1907. // L2JMOD Wedding System
  1908. else if (pName.equalsIgnoreCase("AllowWedding")) L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(pValue);
  1909. else if (pName.equalsIgnoreCase("WeddingPrice")) L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
  1910. else if (pName.equalsIgnoreCase("WeddingPunishInfidelity")) L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
  1911. else if (pName.equalsIgnoreCase("WeddingTeleport")) L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
  1912. else if (pName.equalsIgnoreCase("WeddingTeleportPrice")) L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
  1913. else if (pName.equalsIgnoreCase("WeddingTeleportDuration")) L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
  1914. else if (pName.equalsIgnoreCase("WeddingAllowSameSex")) L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
  1915. else if (pName.equalsIgnoreCase("WeddingFormalWear")) L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
  1916. else if (pName.equalsIgnoreCase("WeddingDivorceCosts")) L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
  1917. else if (pName.equalsIgnoreCase("TvTEventEnabled")) TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  1918. else if (pName.equalsIgnoreCase("TvTEventInterval")) TVT_EVENT_INTERVAL = Integer.parseInt(pValue);
  1919. else if (pName.equalsIgnoreCase("TvTEventParticipationTime")) TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  1920. else if (pName.equalsIgnoreCase("TvTEventRunningTime")) TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  1921. else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId")) TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  1922. // L2JMOD Warehouse Sorting
  1923. else if (pName.equalsIgnoreCase("EnableWarehouseSortingClan")) L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
  1924. else if (pName.equalsIgnoreCase("EnableWarehouseSortingPrivate")) L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
  1925. else if (pName.equalsIgnoreCase("EnableWarehouseSortingFreight")) L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT = Boolean.parseBoolean(pValue);
  1926. // PvP settings
  1927. else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
  1928. else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
  1929. else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
  1930. else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);
  1931. else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.parseBoolean(pValue);
  1932. else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pValue);
  1933. else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);
  1934. else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
  1935. else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
  1936. else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
  1937. else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
  1938. else if (pName.equalsIgnoreCase("MenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
  1939. else return false;
  1940. return true;
  1941. }
  1942. // it has no instances
  1943. private Config() {}
  1944. /**
  1945. * Save hexadecimal ID of the server in the properties file.
  1946. * @param string (String) : hexadecimal ID of the server to store
  1947. * @see HEXID_FILE
  1948. * @see saveHexid(String string, String fileName)
  1949. * @link LoginServerThread
  1950. */
  1951. public static void saveHexid(int serverId, String string)
  1952. {
  1953. Config.saveHexid(serverId, string, HEXID_FILE);
  1954. }
  1955. /**
  1956. * Save hexadecimal ID of the server in the properties file.
  1957. * @param hexId (String) : hexadecimal ID of the server to store
  1958. * @param fileName (String) : name of the properties file
  1959. */
  1960. public static void saveHexid(int serverId, String hexId, String fileName)
  1961. {
  1962. try
  1963. {
  1964. Properties hexSetting = new Properties();
  1965. File file = new File(fileName);
  1966. //Create a new empty file only if it doesn't exist
  1967. file.createNewFile();
  1968. OutputStream out = new FileOutputStream(file);
  1969. hexSetting.setProperty("ServerID",String.valueOf(serverId));
  1970. hexSetting.setProperty("HexID",hexId);
  1971. hexSetting.store(out,"the hexID to auth into login");
  1972. out.close();
  1973. }
  1974. catch (Exception e)
  1975. {
  1976. _log.warning("Failed to save hex id to "+fileName+" File.");
  1977. e.printStackTrace();
  1978. }
  1979. }
  1980. }