Config.java 148 KB

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