Config.java 141 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package net.sf.l2j;
  16. import java.io.File;
  17. import java.io.FileInputStream;
  18. import java.io.FileOutputStream;
  19. import java.io.InputStream;
  20. import java.io.OutputStream;
  21. import java.math.BigInteger;
  22. import java.util.ArrayList;
  23. import java.util.Arrays;
  24. import java.util.List;
  25. import java.util.Map;
  26. import java.util.Properties;
  27. import java.util.logging.Logger;
  28. import javolution.util.FastList;
  29. import javolution.util.FastMap;
  30. import net.sf.l2j.gameserver.util.FloodProtectorConfig;
  31. import net.sf.l2j.gameserver.util.StringUtil;
  32. public final class Config
  33. {
  34. protected static final Logger _log = Logger.getLogger(Config.class.getName());
  35. //--------------------------------------------------
  36. // L2J Property File Definitions
  37. //--------------------------------------------------
  38. public static final String CHARACTER_CONFIG_FILE = "./config/Character.properties";
  39. public static final String EXTENSIONS_CONFIG_FILE = "./config/extensions.properties";
  40. public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
  41. public static final String FORTSIEGE_CONFIGURATION_FILE = "./config/fortsiege.properties";
  42. public static final String GENERAL_CONFIG_FILE = "./config/General.properties";
  43. public static final String HEXID_FILE = "./config/hexid.txt";
  44. public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
  45. public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
  46. public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
  47. public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
  48. public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
  49. public static final String NPC_CONFIG_FILE = "./config/NPC.properties";
  50. public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
  51. public static final String RATES_CONFIG_FILE = "./config/rates.properties";
  52. public static final String CONFIGURATION_FILE = "./config/server.properties";
  53. public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
  54. public static final String TELNET_FILE = "./config/telnet.properties";
  55. public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
  56. public static final String MMO_CONFIG_FILE = "./config/mmo.properties";
  57. //--------------------------------------------------
  58. // L2J Variable Definitions
  59. //--------------------------------------------------
  60. public static int MASTERACCESS_LEVEL;
  61. public static int MASTERACCESS_NAME_COLOR;
  62. public static int MASTERACCESS_TITLE_COLOR;
  63. public static boolean ALT_GAME_DELEVEL;
  64. public static double ALT_WEIGHT_LIMIT;
  65. public static int RUN_SPD_BOOST;
  66. public static int DEATH_PENALTY_CHANCE;
  67. public static double RESPAWN_RESTORE_CP;
  68. public static double RESPAWN_RESTORE_HP;
  69. public static double RESPAWN_RESTORE_MP;
  70. public static boolean ALT_GAME_TIREDNESS;
  71. public static boolean ENABLE_MODIFY_SKILL_DURATION;
  72. public static Map<Integer, Integer> SKILL_DURATION_LIST;
  73. public static boolean ENABLE_MODIFY_SKILL_REUSE;
  74. public static Map<Integer, Integer> SKILL_REUSE_LIST;
  75. public static boolean AUTO_LEARN_SKILLS;
  76. public static boolean AUTO_LOOT_HERBS;
  77. public static byte BUFFS_MAX_AMOUNT;
  78. public static byte DANCES_MAX_AMOUNT;
  79. public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
  80. public static boolean ALT_GAME_CANCEL_BOW;
  81. public static boolean ALT_GAME_CANCEL_CAST;
  82. public static boolean EFFECT_CANCELING;
  83. public static boolean ALT_GAME_MAGICFAILURES;
  84. public static int PLAYER_FAKEDEATH_UP_PROTECTION;
  85. public static boolean STORE_SKILL_COOLTIME;
  86. public static boolean SUBCLASS_STORE_SKILL_COOLTIME;
  87. public static boolean ALT_GAME_SHIELD_BLOCKS;
  88. public static int ALT_PERFECT_SHLD_BLOCK;
  89. public static boolean ALLOW_CLASS_MASTERS;
  90. public static boolean LIFE_CRYSTAL_NEEDED;
  91. public static boolean SP_BOOK_NEEDED;
  92. public static boolean ES_SP_BOOK_NEEDED;
  93. public static boolean DIVINE_SP_BOOK_NEEDED;
  94. public static boolean ALT_GAME_SKILL_LEARN;
  95. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  96. public static int MAX_RUN_SPEED;
  97. public static int MAX_PCRIT_RATE;
  98. public static int MAX_MCRIT_RATE;
  99. public static int MAX_PATK_SPEED;
  100. public static int MAX_MATK_SPEED;
  101. public static int MAX_EVASION;
  102. public static byte MAX_SUBCLASS;
  103. public static byte MAX_SUBCLASS_LEVEL;
  104. public static int MAX_PVTSTORESELL_SLOTS_DWARF;
  105. public static int MAX_PVTSTORESELL_SLOTS_OTHER;
  106. public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
  107. public static int MAX_PVTSTOREBUY_SLOTS_OTHER;
  108. public static int INVENTORY_MAXIMUM_NO_DWARF;
  109. public static int INVENTORY_MAXIMUM_DWARF;
  110. public static int INVENTORY_MAXIMUM_GM;
  111. public static int WAREHOUSE_SLOTS_DWARF;
  112. public static int WAREHOUSE_SLOTS_NO_DWARF;
  113. public static int WAREHOUSE_SLOTS_CLAN;
  114. public static int FREIGHT_SLOTS;
  115. public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
  116. public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
  117. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
  118. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
  119. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
  120. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
  121. public static int MAX_PERSONAL_FAME_POINTS;
  122. public static int FORTRESS_ZONE_FAME_TASK_FREQUENCY;
  123. public static int FORTRESS_ZONE_FAME_AQUIRE_POINTS;
  124. public static int CASTLE_ZONE_FAME_TASK_FREQUENCY;
  125. public static int CASTLE_ZONE_FAME_AQUIRE_POINTS;
  126. public static boolean IS_CRAFTING_ENABLED;
  127. public static boolean CRAFT_MASTERWORK;
  128. public static int DWARF_RECIPE_LIMIT;
  129. public static int COMMON_RECIPE_LIMIT;
  130. public static boolean ALT_GAME_CREATION;
  131. public static double ALT_GAME_CREATION_SPEED;
  132. public static double ALT_GAME_CREATION_XP_RATE;
  133. public static double ALT_GAME_CREATION_RARE_XPSP_RATE;
  134. public static double ALT_GAME_CREATION_SP_RATE;
  135. public static boolean ALT_BLACKSMITH_USE_RECIPES;
  136. public static int ALT_CLAN_JOIN_DAYS;
  137. public static int ALT_CLAN_CREATE_DAYS;
  138. public static int ALT_CLAN_DISSOLVE_DAYS;
  139. public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
  140. public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
  141. public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
  142. public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
  143. public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
  144. public static int ALT_CLAN_MEMBERS_FOR_WAR;
  145. public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
  146. public static boolean REMOVE_CASTLE_CIRCLETS;
  147. public static int ALT_PARTY_RANGE;
  148. public static int ALT_PARTY_RANGE2;
  149. public static long STARTING_ADENA;
  150. public static boolean AUTO_LOOT;
  151. public static boolean AUTO_LOOT_RAIDS;
  152. public static int UNSTUCK_INTERVAL;
  153. public static int PLAYER_SPAWN_PROTECTION;
  154. public static boolean RESPAWN_RANDOM_ENABLED;
  155. public static int RESPAWN_RANDOM_MAX_OFFSET;
  156. public static boolean RESTORE_PLAYER_INSTANCE;
  157. public static boolean ALLOW_SUMMON_TO_INSTANCE;
  158. public static boolean PETITIONING_ALLOWED;
  159. public static int MAX_PETITIONS_PER_PLAYER;
  160. public static int MAX_PETITIONS_PENDING;
  161. public static boolean ALT_GAME_FREIGHTS;
  162. public static int ALT_GAME_FREIGHT_PRICE;
  163. public static boolean ALT_GAME_FREE_TELEPORT;
  164. public static boolean ALT_RECOMMEND;
  165. public static int DELETE_DAYS;
  166. public static float ALT_GAME_EXPONENT_XP;
  167. public static float ALT_GAME_EXPONENT_SP;
  168. public static String PARTY_XP_CUTOFF_METHOD;
  169. public static double PARTY_XP_CUTOFF_PERCENT;
  170. public static int PARTY_XP_CUTOFF_LEVEL;
  171. //--------------------------------------------------
  172. // ClanHall Settings
  173. //--------------------------------------------------
  174. public static long CH_TELE_FEE_RATIO;
  175. public static int CH_TELE1_FEE;
  176. public static int CH_TELE2_FEE;
  177. public static long CH_ITEM_FEE_RATIO;
  178. public static int CH_ITEM1_FEE;
  179. public static int CH_ITEM2_FEE;
  180. public static int CH_ITEM3_FEE;
  181. public static long CH_MPREG_FEE_RATIO;
  182. public static int CH_MPREG1_FEE;
  183. public static int CH_MPREG2_FEE;
  184. public static int CH_MPREG3_FEE;
  185. public static int CH_MPREG4_FEE;
  186. public static int CH_MPREG5_FEE;
  187. public static long CH_HPREG_FEE_RATIO;
  188. public static int CH_HPREG1_FEE;
  189. public static int CH_HPREG2_FEE;
  190. public static int CH_HPREG3_FEE;
  191. public static int CH_HPREG4_FEE;
  192. public static int CH_HPREG5_FEE;
  193. public static int CH_HPREG6_FEE;
  194. public static int CH_HPREG7_FEE;
  195. public static int CH_HPREG8_FEE;
  196. public static int CH_HPREG9_FEE;
  197. public static int CH_HPREG10_FEE;
  198. public static int CH_HPREG11_FEE;
  199. public static int CH_HPREG12_FEE;
  200. public static int CH_HPREG13_FEE;
  201. public static long CH_EXPREG_FEE_RATIO;
  202. public static int CH_EXPREG1_FEE;
  203. public static int CH_EXPREG2_FEE;
  204. public static int CH_EXPREG3_FEE;
  205. public static int CH_EXPREG4_FEE;
  206. public static int CH_EXPREG5_FEE;
  207. public static int CH_EXPREG6_FEE;
  208. public static int CH_EXPREG7_FEE;
  209. public static long CH_SUPPORT_FEE_RATIO;
  210. public static int CH_SUPPORT1_FEE;
  211. public static int CH_SUPPORT2_FEE;
  212. public static int CH_SUPPORT3_FEE;
  213. public static int CH_SUPPORT4_FEE;
  214. public static int CH_SUPPORT5_FEE;
  215. public static int CH_SUPPORT6_FEE;
  216. public static int CH_SUPPORT7_FEE;
  217. public static int CH_SUPPORT8_FEE;
  218. public static long CH_CURTAIN_FEE_RATIO;
  219. public static int CH_CURTAIN1_FEE;
  220. public static int CH_CURTAIN2_FEE;
  221. public static long CH_FRONT_FEE_RATIO;
  222. public static int CH_FRONT1_FEE;
  223. public static int CH_FRONT2_FEE;
  224. //--------------------------------------------------
  225. // Castle Settings
  226. //--------------------------------------------------
  227. public static long CS_TELE_FEE_RATIO;
  228. public static int CS_TELE1_FEE;
  229. public static int CS_TELE2_FEE;
  230. public static long CS_MPREG_FEE_RATIO;
  231. public static int CS_MPREG1_FEE;
  232. public static int CS_MPREG2_FEE;
  233. public static int CS_MPREG3_FEE;
  234. public static int CS_MPREG4_FEE;
  235. public static long CS_HPREG_FEE_RATIO;
  236. public static int CS_HPREG1_FEE;
  237. public static int CS_HPREG2_FEE;
  238. public static int CS_HPREG3_FEE;
  239. public static int CS_HPREG4_FEE;
  240. public static int CS_HPREG5_FEE;
  241. public static long CS_EXPREG_FEE_RATIO;
  242. public static int CS_EXPREG1_FEE;
  243. public static int CS_EXPREG2_FEE;
  244. public static int CS_EXPREG3_FEE;
  245. public static int CS_EXPREG4_FEE;
  246. public static long CS_SUPPORT_FEE_RATIO;
  247. public static int CS_SUPPORT1_FEE;
  248. public static int CS_SUPPORT2_FEE;
  249. public static int CS_SUPPORT3_FEE;
  250. public static int CS_SUPPORT4_FEE;
  251. public static List<String> CL_SET_SIEGE_TIME_LIST;
  252. public static List<Integer> SIEGE_HOUR_LIST_MORNING;
  253. public static List<Integer> SIEGE_HOUR_LIST_AFTERNOON;
  254. //--------------------------------------------------
  255. // Fortress Settings
  256. //--------------------------------------------------
  257. public static long FS_TELE_FEE_RATIO;
  258. public static int FS_TELE1_FEE;
  259. public static int FS_TELE2_FEE;
  260. public static long FS_MPREG_FEE_RATIO;
  261. public static int FS_MPREG1_FEE;
  262. public static int FS_MPREG2_FEE;
  263. public static long FS_HPREG_FEE_RATIO;
  264. public static int FS_HPREG1_FEE;
  265. public static int FS_HPREG2_FEE;
  266. public static long FS_EXPREG_FEE_RATIO;
  267. public static int FS_EXPREG1_FEE;
  268. public static int FS_EXPREG2_FEE;
  269. public static long FS_SUPPORT_FEE_RATIO;
  270. public static int FS_SUPPORT1_FEE;
  271. public static int FS_SUPPORT2_FEE;
  272. public static int FS_BLOOD_OATH_COUNT;
  273. public static int FS_BLOOD_OATH_FRQ;
  274. //--------------------------------------------------
  275. // Feature Settings
  276. //--------------------------------------------------
  277. public static int TAKE_FORT_POINTS;
  278. public static int LOOSE_FORT_POINTS;
  279. public static int TAKE_CASTLE_POINTS;
  280. public static int LOOSE_CASTLE_POINTS;
  281. public static int CASTLE_DEFENDED_POINTS;
  282. public static int FESTIVAL_WIN_POINTS;
  283. public static int HERO_POINTS;
  284. public static int ROYAL_GUARD_COST;
  285. public static int KNIGHT_UNIT_COST;
  286. public static int KNIGHT_REINFORCE_COST;
  287. public static int BALLISTA_POINTS;
  288. public static int REPUTATION_SCORE_PER_KILL;
  289. public static int JOIN_ACADEMY_MIN_REP_SCORE;
  290. public static int JOIN_ACADEMY_MAX_REP_SCORE;
  291. public static int RAID_RANKING_1ST;
  292. public static int RAID_RANKING_2ND;
  293. public static int RAID_RANKING_3RD;
  294. public static int RAID_RANKING_4TH;
  295. public static int RAID_RANKING_5TH;
  296. public static int RAID_RANKING_6TH;
  297. public static int RAID_RANKING_7TH;
  298. public static int RAID_RANKING_8TH;
  299. public static int RAID_RANKING_9TH;
  300. public static int RAID_RANKING_10TH;
  301. public static int RAID_RANKING_UP_TO_50TH;
  302. public static int RAID_RANKING_UP_TO_100TH;
  303. public static int CLAN_LEVEL_6_COST;
  304. public static int CLAN_LEVEL_7_COST;
  305. public static int CLAN_LEVEL_8_COST;
  306. public static int CLAN_LEVEL_9_COST;
  307. public static int CLAN_LEVEL_10_COST;
  308. //--------------------------------------------------
  309. // General Settings
  310. //--------------------------------------------------
  311. public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
  312. public static boolean DISPLAY_SERVER_VERSION;
  313. public static boolean SERVER_LIST_BRACKET;
  314. public static boolean SERVER_LIST_CLOCK;
  315. public static boolean SERVER_GMONLY;
  316. public static boolean GM_HERO_AURA;
  317. public static boolean GM_STARTUP_INVULNERABLE;
  318. public static boolean GM_STARTUP_INVISIBLE;
  319. public static boolean GM_STARTUP_SILENCE;
  320. public static boolean GM_STARTUP_AUTO_LIST;
  321. public static boolean GM_STARTUP_DIET_MODE;
  322. public static String GM_ADMIN_MENU_STYLE;
  323. public static boolean GM_ITEM_RESTRICTION;
  324. public static boolean GM_SKILL_RESTRICTION;
  325. public static boolean BYPASS_VALIDATION;
  326. public static boolean GAMEGUARD_ENFORCE;
  327. public static boolean GAMEGUARD_PROHIBITACTION;
  328. public static boolean LOG_CHAT;
  329. public static boolean LOG_ITEMS;
  330. public static boolean GMAUDIT;
  331. public static boolean LOG_GAME_DAMAGE;
  332. public static boolean DEBUG;
  333. public static boolean PACKET_HANDLER_DEBUG;
  334. public static boolean ASSERT;
  335. public static boolean DEVELOPER;
  336. public static boolean ACCEPT_GEOEDITOR_CONN;
  337. public static boolean TEST_SERVER;
  338. public static boolean ALT_DEV_NO_QUESTS;
  339. public static boolean ALT_DEV_NO_SPAWNS;
  340. public static boolean SERVER_LIST_TESTSERVER;
  341. public static int THREAD_P_EFFECTS;
  342. public static int THREAD_P_GENERAL;
  343. public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  344. public static int IO_PACKET_THREAD_CORE_SIZE;
  345. public static int GENERAL_THREAD_CORE_SIZE;
  346. public static int AI_MAX_THREAD;
  347. public static int PACKET_LIFETIME;
  348. public static boolean DEADLOCK_DETECTOR;
  349. public static int DEADLOCK_CHECK_INTERVAL;
  350. public static boolean RESTART_ON_DEADLOCK;
  351. public static final FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM =
  352. new FloodProtectorConfig("UseItemFloodProtector");
  353. public static final FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE =
  354. new FloodProtectorConfig("RollDiceFloodProtector");
  355. public static final FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK =
  356. new FloodProtectorConfig("FireworkFloodProtector");
  357. public static final FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON =
  358. new FloodProtectorConfig("ItemPetSummonFloodProtector");
  359. public static final FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE =
  360. new FloodProtectorConfig("HeroVoiceFloodProtector");
  361. public static final FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS =
  362. new FloodProtectorConfig("SubclassFloodProtector");
  363. public static final FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM =
  364. new FloodProtectorConfig("DropItemFloodProtector");
  365. public static final FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS =
  366. new FloodProtectorConfig("ServerBypassFloodProtector");
  367. public static final FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL =
  368. new FloodProtectorConfig("MultiSellFloodProtector");
  369. public static boolean ALLOW_DISCARDITEM;
  370. public static int AUTODESTROY_ITEM_AFTER;
  371. public static int HERB_AUTO_DESTROY_TIME;
  372. public static String PROTECTED_ITEMS;
  373. public static List<Integer> LIST_PROTECTED_ITEMS = new FastList<Integer>();
  374. public static int CHAR_STORE_INTERVAL;
  375. public static boolean LAZY_ITEMS_UPDATE;
  376. public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
  377. public static boolean DESTROY_DROPPED_PLAYER_ITEM;
  378. public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
  379. public static boolean SAVE_DROPPED_ITEM;
  380. public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
  381. public static int SAVE_DROPPED_ITEM_INTERVAL;
  382. public static boolean CLEAR_DROPPED_ITEM_TABLE;
  383. public static boolean AUTODELETE_INVALID_QUEST_DATA;
  384. public static boolean PRECISE_DROP_CALCULATION;
  385. public static boolean MULTIPLE_ITEM_DROP;
  386. public static boolean FORCE_INVENTORY_UPDATE;
  387. public static boolean LAZY_CACHE;
  388. public static int MIN_NPC_ANIMATION;
  389. public static int MAX_NPC_ANIMATION;
  390. public static int MIN_MONSTER_ANIMATION;
  391. public static int MAX_MONSTER_ANIMATION;
  392. public static int COORD_SYNCHRONIZE;
  393. public static boolean GRIDS_ALWAYS_ON;
  394. public static int GRID_NEIGHBOR_TURNON_TIME;
  395. public static int GRID_NEIGHBOR_TURNOFF_TIME;
  396. public static int GEODATA;
  397. public static boolean GEODATA_CELLFINDING;
  398. public static boolean FORCE_GEODATA;
  399. public static boolean MOVE_BASED_KNOWNLIST;
  400. public static long KNOWNLIST_UPDATE_INTERVAL;
  401. public static int ZONE_TOWN;
  402. public static boolean ACTIVATE_POSITION_RECORDER;
  403. public static String DEFAULT_GLOBAL_CHAT;
  404. public static String DEFAULT_TRADE_CHAT;
  405. public static boolean ALLOW_WAREHOUSE;
  406. public static boolean WAREHOUSE_CACHE;
  407. public static int WAREHOUSE_CACHE_TIME;
  408. public static boolean ALLOW_FREIGHT;
  409. public static boolean ALLOW_WEAR;
  410. public static int WEAR_DELAY;
  411. public static int WEAR_PRICE;
  412. public static boolean ALLOW_LOTTERY;
  413. public static boolean ALLOW_RACE;
  414. public static boolean ALLOW_WATER;
  415. public static boolean ALLOW_RENTPET;
  416. public static boolean ALLOWFISHING;
  417. public static boolean ALLOW_BOAT;
  418. public static boolean ALLOW_CURSED_WEAPONS;
  419. public static boolean ALLOW_MANOR;
  420. public static boolean ALLOW_NPC_WALKERS;
  421. public static boolean ALLOW_PET_WALKERS;
  422. public static boolean SERVER_NEWS;
  423. public static int COMMUNITY_TYPE;
  424. public static boolean BBS_SHOW_PLAYERLIST;
  425. public static String BBS_DEFAULT;
  426. public static boolean SHOW_LEVEL_COMMUNITYBOARD;
  427. public static boolean SHOW_STATUS_COMMUNITYBOARD;
  428. public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
  429. public static int NAME_PER_ROW_COMMUNITYBOARD;
  430. public static int ALT_OLY_START_TIME;
  431. public static int ALT_OLY_MIN;
  432. public static long ALT_OLY_CPERIOD;
  433. public static long ALT_OLY_BATTLE;
  434. public static long ALT_OLY_WPERIOD;
  435. public static long ALT_OLY_VPERIOD;
  436. public static int ALT_OLY_CLASSED;
  437. public static int ALT_OLY_NONCLASSED;
  438. public static int ALT_OLY_REG_DISPLAY;
  439. public static int ALT_OLY_BATTLE_REWARD_ITEM;
  440. public static int ALT_OLY_CLASSED_RITEM_C;
  441. public static int ALT_OLY_NONCLASSED_RITEM_C;
  442. public static int ALT_OLY_COMP_RITEM;
  443. public static int ALT_OLY_GP_PER_POINT;
  444. public static int ALT_OLY_HERO_POINTS;
  445. public static int ALT_OLY_RANK1_POINTS;
  446. public static int ALT_OLY_RANK2_POINTS;
  447. public static int ALT_OLY_RANK3_POINTS;
  448. public static int ALT_OLY_RANK4_POINTS;
  449. public static int ALT_OLY_RANK5_POINTS;
  450. public static boolean ALT_OLY_LOG_FIGHTS;
  451. public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
  452. public static boolean ALT_OLY_ANNOUNCE_GAMES;
  453. public static List<Integer> LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
  454. public static int ALT_OLY_ENCHANT_LIMIT;
  455. public static int ALT_MANOR_REFRESH_TIME;
  456. public static int ALT_MANOR_REFRESH_MIN;
  457. public static int ALT_MANOR_APPROVE_TIME;
  458. public static int ALT_MANOR_APPROVE_MIN;
  459. public static int ALT_MANOR_MAINTENANCE_PERIOD;
  460. public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
  461. public static int ALT_MANOR_SAVE_PERIOD_RATE;
  462. public static long ALT_LOTTERY_PRIZE;
  463. public static long ALT_LOTTERY_TICKET_PRICE;
  464. public static float ALT_LOTTERY_5_NUMBER_RATE;
  465. public static float ALT_LOTTERY_4_NUMBER_RATE;
  466. public static float ALT_LOTTERY_3_NUMBER_RATE;
  467. public static long ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
  468. public static int FS_TIME_ATTACK;
  469. public static int FS_TIME_COOLDOWN;
  470. public static int FS_TIME_ENTRY;
  471. public static int FS_TIME_WARMUP;
  472. public static int FS_PARTY_MEMBER_COUNT;
  473. public static int RIFT_MIN_PARTY_SIZE;
  474. public static int RIFT_SPAWN_DELAY;
  475. public static int RIFT_MAX_JUMPS;
  476. public static int RIFT_AUTO_JUMPS_TIME_MIN;
  477. public static int RIFT_AUTO_JUMPS_TIME_MAX;
  478. public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
  479. public static int RIFT_ENTER_COST_RECRUIT;
  480. public static int RIFT_ENTER_COST_SOLDIER;
  481. public static int RIFT_ENTER_COST_OFFICER;
  482. public static int RIFT_ENTER_COST_CAPTAIN;
  483. public static int RIFT_ENTER_COST_COMMANDER;
  484. public static int RIFT_ENTER_COST_HERO;
  485. public static int DEFAULT_PUNISH;
  486. public static int DEFAULT_PUNISH_PARAM;
  487. public static boolean ONLY_GM_ITEMS_FREE;
  488. public static boolean JAIL_IS_PVP;
  489. public static boolean JAIL_DISABLE_CHAT;
  490. public static boolean CUSTOM_SPAWNLIST_TABLE;
  491. public static boolean SAVE_GMSPAWN_ON_CUSTOM;
  492. public static boolean DELETE_GMSPAWN_ON_CUSTOM;
  493. public static boolean CUSTOM_NPC_TABLE;
  494. public static boolean CUSTOM_ITEM_TABLES;
  495. public static boolean CUSTOM_ARMORSETS_TABLE;
  496. public static boolean CUSTOM_TELEPORT_TABLE;
  497. public static boolean CUSTOM_DROPLIST_TABLE;
  498. public static boolean CUSTOM_MERCHANT_TABLES;
  499. //--------------------------------------------------
  500. // L2JMods Settings
  501. //--------------------------------------------------
  502. public static boolean L2JMOD_CHAMPION_ENABLE;
  503. public static boolean L2JMOD_CHAMPION_PASSIVE;
  504. public static int L2JMOD_CHAMPION_FREQUENCY;
  505. public static String L2JMOD_CHAMP_TITLE;
  506. public static int L2JMOD_CHAMP_MIN_LVL;
  507. public static int L2JMOD_CHAMP_MAX_LVL;
  508. public static int L2JMOD_CHAMPION_HP;
  509. public static int L2JMOD_CHAMPION_REWARDS;
  510. public static float L2JMOD_CHAMPION_ADENAS_REWARDS;
  511. public static float L2JMOD_CHAMPION_HP_REGEN;
  512. public static float L2JMOD_CHAMPION_ATK;
  513. public static float L2JMOD_CHAMPION_SPD_ATK;
  514. public static int L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
  515. public static int L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
  516. public static int L2JMOD_CHAMPION_REWARD_ID;
  517. public static int L2JMOD_CHAMPION_REWARD_QTY;
  518. public static boolean TVT_EVENT_ENABLED;
  519. public static String[] TVT_EVENT_INTERVAL;
  520. public static int TVT_EVENT_PARTICIPATION_TIME;
  521. public static int TVT_EVENT_RUNNING_TIME;
  522. public static int TVT_EVENT_PARTICIPATION_NPC_ID;
  523. public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
  524. public static int[] TVT_EVENT_PARTICIPATION_FEE = new int[2];
  525. public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
  526. public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
  527. public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
  528. public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
  529. public static String TVT_EVENT_TEAM_1_NAME;
  530. public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  531. public static String TVT_EVENT_TEAM_2_NAME;
  532. public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  533. public static List<int[]> TVT_EVENT_REWARDS = new FastList<int[]>();
  534. public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  535. public static boolean TVT_EVENT_SCROLL_ALLOWED;
  536. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  537. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  538. public static List<Integer> TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  539. public static List<Integer> TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  540. public static boolean TVT_REWARD_TEAM_TIE;
  541. public static byte TVT_EVENT_MIN_LVL;
  542. public static byte TVT_EVENT_MAX_LVL;
  543. public static int TVT_EVENT_EFFECTS_REMOVAL;
  544. public static boolean L2JMOD_ALLOW_WEDDING;
  545. public static int L2JMOD_WEDDING_PRICE;
  546. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  547. public static boolean L2JMOD_WEDDING_TELEPORT;
  548. public static int L2JMOD_WEDDING_TELEPORT_PRICE;
  549. public static int L2JMOD_WEDDING_TELEPORT_DURATION;
  550. public static boolean L2JMOD_WEDDING_SAMESEX;
  551. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  552. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  553. public static boolean BANKING_SYSTEM_ENABLED;
  554. public static int BANKING_SYSTEM_GOLDBARS;
  555. public static int BANKING_SYSTEM_ADENA;
  556. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
  557. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
  558. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;
  559. public static boolean OFFLINE_TRADE_ENABLE;
  560. public static boolean OFFLINE_CRAFT_ENABLE;
  561. public static boolean OFFLINE_SET_NAME_COLOR;
  562. public static int OFFLINE_NAME_COLOR;
  563. public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
  564. //--------------------------------------------------
  565. // NPC Settings
  566. //--------------------------------------------------
  567. public static boolean ANNOUNCE_MAMMON_SPAWN;
  568. public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
  569. public static boolean ALT_ATTACKABLE_NPCS;
  570. public static boolean ALT_GAME_VIEWNPC;
  571. public static int MAX_DRIFT_RANGE;
  572. public static boolean DEEPBLUE_DROP_RULES;
  573. public static boolean DEEPBLUE_DROP_RULES_RAID;
  574. public static boolean SHOW_NPC_LVL;
  575. public static boolean GUARD_ATTACK_AGGRO_MOB;
  576. public static boolean ALLOW_WYVERN_UPGRADER;
  577. public static String PET_RENT_NPC;
  578. public static List<Integer> LIST_PET_RENT_NPC = new FastList<Integer>();
  579. public static double RAID_HP_REGEN_MULTIPLIER;
  580. public static double RAID_MP_REGEN_MULTIPLIER;
  581. public static double RAID_PDEFENCE_MULTIPLIER;
  582. public static double RAID_MDEFENCE_MULTIPLIER;
  583. public static double RAID_MINION_RESPAWN_TIMER;
  584. public static float RAID_MIN_RESPAWN_MULTIPLIER;
  585. public static float RAID_MAX_RESPAWN_MULTIPLIER;
  586. public static boolean RAID_DISABLE_CURSE;
  587. public static int INVENTORY_MAXIMUM_PET;
  588. //--------------------------------------------------
  589. // PvP Settings
  590. //--------------------------------------------------
  591. public static int KARMA_MIN_KARMA;
  592. public static int KARMA_MAX_KARMA;
  593. public static int KARMA_XP_DIVIDER;
  594. public static int KARMA_LOST_BASE;
  595. public static boolean KARMA_DROP_GM;
  596. public static boolean KARMA_AWARD_PK_KILL;
  597. public static int KARMA_PK_LIMIT;
  598. public static String KARMA_NONDROPPABLE_PET_ITEMS;
  599. public static String KARMA_NONDROPPABLE_ITEMS;
  600. public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS;
  601. public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
  602. //--------------------------------------------------
  603. // Rate Settings
  604. //--------------------------------------------------
  605. public static float RATE_XP;
  606. public static float RATE_SP;
  607. public static float RATE_PARTY_XP;
  608. public static float RATE_PARTY_SP;
  609. public static float RATE_QUESTS_REWARD;
  610. public static float RATE_DROP_ADENA;
  611. public static float RATE_CONSUMABLE_COST;
  612. public static float RATE_EXTR_FISH;
  613. public static float RATE_DROP_ITEMS;
  614. public static float RATE_DROP_ITEMS_BY_RAID;
  615. public static float RATE_DROP_SPOIL;
  616. public static int RATE_DROP_MANOR;
  617. public static float RATE_DROP_QUEST;
  618. public static float RATE_KARMA_EXP_LOST;
  619. public static float RATE_SIEGE_GUARDS_PRICE;
  620. public static float RATE_DROP_COMMON_HERBS;
  621. public static float RATE_DROP_MP_HP_HERBS;
  622. public static float RATE_DROP_GREATER_HERBS;
  623. public static float RATE_DROP_SUPERIOR_HERBS;
  624. public static float RATE_DROP_SPECIAL_HERBS;
  625. public static int PLAYER_DROP_LIMIT;
  626. public static int PLAYER_RATE_DROP;
  627. public static int PLAYER_RATE_DROP_ITEM;
  628. public static int PLAYER_RATE_DROP_EQUIP;
  629. public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
  630. public static float PET_XP_RATE;
  631. public static int PET_FOOD_RATE;
  632. public static float SINEATER_XP_RATE;
  633. public static int KARMA_DROP_LIMIT;
  634. public static int KARMA_RATE_DROP;
  635. public static int KARMA_RATE_DROP_ITEM;
  636. public static int KARMA_RATE_DROP_EQUIP;
  637. public static int KARMA_RATE_DROP_EQUIP_WEAPON;
  638. public static double[] PLAYER_XP_PERCENT_LOST;
  639. //--------------------------------------------------
  640. // Seven Signs Settings
  641. //--------------------------------------------------
  642. public static boolean ALT_GAME_CASTLE_DAWN;
  643. public static boolean ALT_GAME_CASTLE_DUSK;
  644. public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
  645. public static int ALT_FESTIVAL_MIN_PLAYER;
  646. public static int ALT_MAXIMUM_PLAYER_CONTRIB;
  647. public static long ALT_FESTIVAL_MANAGER_START;
  648. public static long ALT_FESTIVAL_LENGTH;
  649. public static long ALT_FESTIVAL_CYCLE_LENGTH;
  650. public static long ALT_FESTIVAL_FIRST_SPAWN;
  651. public static long ALT_FESTIVAL_FIRST_SWARM;
  652. public static long ALT_FESTIVAL_SECOND_SPAWN;
  653. public static long ALT_FESTIVAL_SECOND_SWARM;
  654. public static long ALT_FESTIVAL_CHEST_SPAWN;
  655. public static double ALT_SIEGE_DAWN_GATES_PDEF_MULT;
  656. public static double ALT_SIEGE_DUSK_GATES_PDEF_MULT;
  657. public static double ALT_SIEGE_DAWN_GATES_MDEF_MULT;
  658. public static double ALT_SIEGE_DUSK_GATES_MDEF_MULT;
  659. //--------------------------------------------------
  660. // Server Settings
  661. //--------------------------------------------------
  662. public static int PORT_GAME;
  663. public static int PORT_LOGIN;
  664. public static String LOGIN_BIND_ADDRESS;
  665. public static int LOGIN_TRY_BEFORE_BAN;
  666. public static int LOGIN_BLOCK_AFTER_BAN;
  667. public static String GAMESERVER_HOSTNAME;
  668. public static String DATABASE_DRIVER;
  669. public static String DATABASE_URL;
  670. public static String DATABASE_LOGIN;
  671. public static String DATABASE_PASSWORD;
  672. public static int DATABASE_MAX_CONNECTIONS;
  673. public static int DATABASE_MAX_IDLE_TIME;
  674. public static int MAXIMUM_ONLINE_USERS;
  675. public static String CNAME_TEMPLATE;
  676. public static String PET_NAME_TEMPLATE;
  677. public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
  678. public static File DATAPACK_ROOT;
  679. public static boolean ACCEPT_ALTERNATE_ID;
  680. public static int REQUEST_ID;
  681. public static boolean RESERVE_HOST_ON_LOGIN = false;
  682. public static int MIN_PROTOCOL_REVISION;
  683. public static int MAX_PROTOCOL_REVISION;
  684. public static boolean LOG_LOGIN_CONTROLLER;
  685. /** ************************************************** **/
  686. /** MMO Settings - Begin **/
  687. /** ************************************************** **/
  688. public static int MMO_SELECTOR_SLEEP_TIME;
  689. public static int MMO_MAX_SEND_PER_PASS;
  690. public static int MMO_MAX_READ_PER_PASS;
  691. public static int MMO_HELPER_BUFFER_COUNT;
  692. public static int MMO_IO_SELECTOR_THREAD_COUNT;
  693. /** ************************************************** **/
  694. /** MMO Settings - End **/
  695. /** ************************************************** **/
  696. //--------------------------------------------------
  697. // No classification assigned to the following yet
  698. //--------------------------------------------------
  699. public static int MAX_ITEM_IN_PACKET;
  700. public static boolean CHECK_KNOWN;
  701. public static int GAME_SERVER_LOGIN_PORT;
  702. public static String GAME_SERVER_LOGIN_HOST;
  703. public static String INTERNAL_HOSTNAME;
  704. public static String EXTERNAL_HOSTNAME;
  705. public static int PATH_NODE_RADIUS;
  706. public static int NEW_NODE_ID;
  707. public static int SELECTED_NODE_ID;
  708. public static int LINKED_NODE_ID;
  709. public static String NEW_NODE_TYPE;
  710. public static int IP_UPDATE_TIME;
  711. public static String SERVER_VERSION;
  712. public static String SERVER_BUILD_DATE;
  713. public static String DATAPACK_VERSION;
  714. public static String NONDROPPABLE_ITEMS;
  715. public static List<Integer> LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  716. public static int PVP_NORMAL_TIME;
  717. public static int PVP_PVP_TIME;
  718. public static boolean COUNT_PACKETS = false;
  719. public static boolean DUMP_PACKET_COUNTS = false;
  720. public static int DUMP_INTERVAL_SECONDS = 60;
  721. public static enum IdFactoryType
  722. {
  723. Compaction,
  724. BitSet,
  725. Stack
  726. }
  727. public static IdFactoryType IDFACTORY_TYPE;
  728. public static boolean BAD_ID_CHECKING;
  729. public static enum ObjectMapType
  730. {
  731. L2ObjectHashMap,
  732. WorldObjectMap
  733. }
  734. public static enum ObjectSetType
  735. {
  736. L2ObjectHashSet,
  737. WorldObjectSet
  738. }
  739. public static ObjectMapType MAP_TYPE;
  740. public static ObjectSetType SET_TYPE;
  741. public static int ENCHANT_CHANCE_WEAPON;
  742. public static int ENCHANT_CHANCE_ARMOR;
  743. public static int ENCHANT_CHANCE_JEWELRY;
  744. public static int BLESSED_ENCHANT_CHANCE_WEAPON;
  745. public static int BLESSED_ENCHANT_CHANCE_ARMOR;
  746. public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
  747. public static int ENCHANT_MAX_WEAPON;
  748. public static int ENCHANT_MAX_ARMOR;
  749. public static int ENCHANT_MAX_JEWELRY;
  750. public static int ENCHANT_SAFE_MAX;
  751. public static int ENCHANT_SAFE_MAX_FULL;
  752. public static int AUGMENTATION_NG_SKILL_CHANCE;
  753. public static int AUGMENTATION_NG_GLOW_CHANCE;
  754. public static int AUGMENTATION_MID_SKILL_CHANCE;
  755. public static int AUGMENTATION_MID_GLOW_CHANCE;
  756. public static int AUGMENTATION_HIGH_SKILL_CHANCE;
  757. public static int AUGMENTATION_HIGH_GLOW_CHANCE;
  758. public static int AUGMENTATION_TOP_SKILL_CHANCE;
  759. public static int AUGMENTATION_TOP_GLOW_CHANCE;
  760. public static int AUGMENTATION_BASESTAT_CHANCE;
  761. public static double HP_REGEN_MULTIPLIER;
  762. public static double MP_REGEN_MULTIPLIER;
  763. public static double CP_REGEN_MULTIPLIER;
  764. public static boolean IS_TELNET_ENABLED;
  765. public static boolean SHOW_LICENCE;
  766. public static boolean FORCE_GGAUTH;
  767. public static boolean ACCEPT_NEW_GAMESERVER;
  768. public static int SERVER_ID;
  769. public static byte[] HEX_ID;
  770. public static boolean AUTO_CREATE_ACCOUNTS;
  771. public static boolean FLOOD_PROTECTION;
  772. public static int FAST_CONNECTION_LIMIT;
  773. public static int NORMAL_CONNECTION_TIME;
  774. public static int FAST_CONNECTION_TIME;
  775. public static int MAX_CONNECTION_PER_IP;
  776. /**
  777. * This class initializes all global variables for configuration.<br>
  778. * If the key doesn't appear in properties file, a default value is set by this class.
  779. * @see CONFIGURATION_FILE (properties file) for configuring your server.
  780. */
  781. public static void load()
  782. {
  783. if(Server.serverMode == Server.MODE_GAMESERVER)
  784. {
  785. _log.info("Loading GameServer Configuration Files...");
  786. InputStream is = null;
  787. try
  788. {
  789. try
  790. {
  791. Properties serverSettings = new Properties();
  792. is = new FileInputStream(new File(CONFIGURATION_FILE));
  793. serverSettings.load(is);
  794. GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
  795. PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
  796. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
  797. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
  798. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
  799. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");
  800. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  801. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  802. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  803. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  804. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  805. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  806. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  807. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  808. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  809. CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
  810. PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
  811. MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
  812. MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
  813. MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
  814. MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
  815. if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
  816. {
  817. throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
  818. }
  819. }
  820. catch (Exception e)
  821. {
  822. e.printStackTrace();
  823. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  824. }
  825. // Load Feature Properties file (if exists)
  826. try
  827. {
  828. Properties Feature = new Properties();
  829. is = new FileInputStream(new File(FEATURE_CONFIG_FILE));
  830. Feature.load(is);
  831. CH_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallTeleportFunctionFeeRatio", "604800000"));
  832. CH_TELE1_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "7000"));
  833. CH_TELE2_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "14000"));
  834. CH_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallSupportFunctionFeeRatio", "86400000"));
  835. CH_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl1", "2500"));
  836. CH_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl2", "5000"));
  837. CH_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl3", "7000"));
  838. CH_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl4", "11000"));
  839. CH_SUPPORT5_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl5", "21000"));
  840. CH_SUPPORT6_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl6", "36000"));
  841. CH_SUPPORT7_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl7", "37000"));
  842. CH_SUPPORT8_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl8", "52000"));
  843. CH_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRatio", "86400000"));
  844. CH_MPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "2000"));
  845. CH_MPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "3750"));
  846. CH_MPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "6500"));
  847. CH_MPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "13750"));
  848. CH_MPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "20000"));
  849. CH_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRatio", "86400000"));
  850. CH_HPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "700"));
  851. CH_HPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "800"));
  852. CH_HPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "1000"));
  853. CH_HPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "1166"));
  854. CH_HPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "1500"));
  855. CH_HPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "1750"));
  856. CH_HPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "2000"));
  857. CH_HPREG8_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "2250"));
  858. CH_HPREG9_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "2500"));
  859. CH_HPREG10_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "3250"));
  860. CH_HPREG11_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "3270"));
  861. CH_HPREG12_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "4250"));
  862. CH_HPREG13_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "5166"));
  863. CH_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRatio", "86400000"));
  864. CH_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "3000"));
  865. CH_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "6000"));
  866. CH_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "9000"));
  867. CH_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "15000"));
  868. CH_EXPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "21000"));
  869. CH_EXPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "23330"));
  870. CH_EXPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "30000"));
  871. CH_ITEM_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallItemCreationFunctionFeeRatio", "86400000"));
  872. CH_ITEM1_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "30000"));
  873. CH_ITEM2_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "70000"));
  874. CH_ITEM3_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "140000"));
  875. CH_CURTAIN_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallCurtainFunctionFeeRatio", "604800000"));
  876. CH_CURTAIN1_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "2000"));
  877. CH_CURTAIN2_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "2500"));
  878. CH_FRONT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRatio", "259200000"));
  879. CH_FRONT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "1300"));
  880. CH_FRONT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "4000"));
  881. CL_SET_SIEGE_TIME_LIST = new FastList<String>();
  882. SIEGE_HOUR_LIST_MORNING = new FastList<Integer>();
  883. SIEGE_HOUR_LIST_AFTERNOON = new FastList<Integer>();
  884. String[] sstl = Feature.getProperty("CLSetSiegeTimeList", "").split(",");
  885. if (sstl.length != 0)
  886. {
  887. boolean isHour = false;
  888. for (String st : sstl)
  889. {
  890. if (st.equalsIgnoreCase("day") || st.equalsIgnoreCase("hour") || st.equalsIgnoreCase("minute"))
  891. {
  892. if (st.equalsIgnoreCase("hour")) isHour = true;
  893. CL_SET_SIEGE_TIME_LIST.add(st.toLowerCase());
  894. }
  895. else
  896. {
  897. _log.warning(StringUtil.concat("[CLSetSiegeTimeList]: invalid config property -> CLSetSiegeTimeList \"", st, "\""));
  898. }
  899. }
  900. if (isHour)
  901. {
  902. String[] shl = Feature.getProperty("SiegeHourList", "").split(",");
  903. for (String st : shl)
  904. {
  905. if (!st.equalsIgnoreCase(""))
  906. {
  907. int val = Integer.valueOf(st);
  908. if (val > 23 || val < 0)
  909. _log.warning(StringUtil.concat("[SiegeHourList]: invalid config property -> SiegeHourList \"", st, "\""));
  910. else if (val < 12)
  911. SIEGE_HOUR_LIST_MORNING.add(val);
  912. else
  913. {
  914. val -= 12;
  915. SIEGE_HOUR_LIST_AFTERNOON.add(val);
  916. }
  917. }
  918. }
  919. if (Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty() && Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty())
  920. {
  921. _log.warning("[SiegeHourList]: invalid config property -> SiegeHourList is empty");
  922. CL_SET_SIEGE_TIME_LIST.remove("hour");
  923. }
  924. }
  925. }
  926. CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
  927. CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
  928. CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
  929. CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
  930. CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
  931. CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
  932. CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
  933. CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
  934. CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
  935. CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
  936. CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
  937. CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
  938. CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
  939. CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
  940. CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
  941. CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
  942. CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
  943. CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl4", "3270"));
  944. CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl5", "5166"));
  945. CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
  946. CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
  947. CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
  948. CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
  949. CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));
  950. FS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressTeleportFunctionFeeRatio", "604800000"));
  951. FS_TELE1_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl1", "1000"));
  952. FS_TELE2_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl2", "10000"));
  953. FS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressSupportFunctionFeeRatio", "86400000"));
  954. FS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl1", "7000"));
  955. FS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl2", "17000"));
  956. FS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressMpRegenerationFunctionFeeRatio", "86400000"));
  957. FS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl1", "6500"));
  958. FS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl2", "9300"));
  959. FS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressHpRegenerationFunctionFeeRatio", "86400000"));
  960. FS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl1", "2000"));
  961. FS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl2", "3500"));
  962. FS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressExpRegenerationFunctionFeeRatio", "86400000"));
  963. FS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl1", "9000"));
  964. FS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl2", "10000"));
  965. FS_BLOOD_OATH_COUNT = Integer.parseInt(Feature.getProperty("FortressBloodOathCount", "1"));
  966. FS_BLOOD_OATH_FRQ = Integer.parseInt(Feature.getProperty("FortressBloodOathFrequency", "360"));
  967. ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltCastleForDawn", "True"));
  968. ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(Feature.getProperty("AltCastleForDusk", "True"));
  969. ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
  970. ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
  971. ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
  972. ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
  973. ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
  974. ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
  975. ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
  976. ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));
  977. ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
  978. ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
  979. ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
  980. ALT_SIEGE_DAWN_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesPdefMult", "1.1"));
  981. ALT_SIEGE_DUSK_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesPdefMult", "0.8"));
  982. ALT_SIEGE_DAWN_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesMdefMult", "1.1"));
  983. ALT_SIEGE_DUSK_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesMdefMult", "0.8"));
  984. TAKE_FORT_POINTS = Integer.parseInt(Feature.getProperty("TakeFortPoints", "200"));
  985. LOOSE_FORT_POINTS = Integer.parseInt(Feature.getProperty("LooseFortPoints", "400"));
  986. TAKE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("TakeCastlePoints", "1500"));
  987. LOOSE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("LooseCastlePoints", "3000"));
  988. CASTLE_DEFENDED_POINTS = Integer.parseInt(Feature.getProperty("CastleDefendedPoints", "750"));
  989. FESTIVAL_WIN_POINTS = Integer.parseInt(Feature.getProperty("FestivalOfDarknessWin", "200"));
  990. HERO_POINTS = Integer.parseInt(Feature.getProperty("HeroPoints", "1000"));
  991. ROYAL_GUARD_COST = Integer.parseInt(Feature.getProperty("CreateRoyalGuardCost", "5000"));
  992. KNIGHT_UNIT_COST = Integer.parseInt(Feature.getProperty("CreateKnightUnitCost", "10000"));
  993. KNIGHT_REINFORCE_COST = Integer.parseInt(Feature.getProperty("ReinforceKnightUnitCost", "5000"));
  994. BALLISTA_POINTS = Integer.parseInt(Feature.getProperty("KillBallistaPoints", "30"));
  995. REPUTATION_SCORE_PER_KILL = Integer.parseInt(Feature.getProperty("ReputationScorePerKill", "1"));
  996. JOIN_ACADEMY_MIN_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMinPoints", "190"));
  997. JOIN_ACADEMY_MAX_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMaxPoints", "650"));
  998. RAID_RANKING_1ST = Integer.parseInt(Feature.getProperty("1stRaidRankingPoints", "1250"));
  999. RAID_RANKING_2ND = Integer.parseInt(Feature.getProperty("2ndRaidRankingPoints", "900"));
  1000. RAID_RANKING_3RD = Integer.parseInt(Feature.getProperty("3rdRaidRankingPoints", "700"));
  1001. RAID_RANKING_4TH = Integer.parseInt(Feature.getProperty("4thRaidRankingPoints", "600"));
  1002. RAID_RANKING_5TH = Integer.parseInt(Feature.getProperty("5thRaidRankingPoints", "450"));
  1003. RAID_RANKING_6TH = Integer.parseInt(Feature.getProperty("6thRaidRankingPoints", "350"));
  1004. RAID_RANKING_7TH = Integer.parseInt(Feature.getProperty("7thRaidRankingPoints", "300"));
  1005. RAID_RANKING_8TH = Integer.parseInt(Feature.getProperty("8thRaidRankingPoints", "200"));
  1006. RAID_RANKING_9TH = Integer.parseInt(Feature.getProperty("9thRaidRankingPoints", "150"));
  1007. RAID_RANKING_10TH = Integer.parseInt(Feature.getProperty("10thRaidRankingPoints", "100"));
  1008. RAID_RANKING_UP_TO_50TH = Integer.parseInt(Feature.getProperty("UpTo50thRaidRankingPoints", "25"));
  1009. RAID_RANKING_UP_TO_100TH = Integer.parseInt(Feature.getProperty("UpTo100thRaidRankingPoints", "12"));
  1010. CLAN_LEVEL_6_COST = Integer.parseInt(Feature.getProperty("ClanLevel6Cost", "10000"));
  1011. CLAN_LEVEL_7_COST = Integer.parseInt(Feature.getProperty("ClanLevel7Cost", "20000"));
  1012. CLAN_LEVEL_8_COST = Integer.parseInt(Feature.getProperty("ClanLevel8Cost", "40000"));
  1013. CLAN_LEVEL_9_COST = Integer.parseInt(Feature.getProperty("ClanLevel9Cost", "40000"));
  1014. CLAN_LEVEL_10_COST = Integer.parseInt(Feature.getProperty("ClanLevel10Cost", "40000"));
  1015. }
  1016. catch (Exception e)
  1017. {
  1018. e.printStackTrace();
  1019. throw new Error("Failed to Load "+FEATURE_CONFIG_FILE+" File.");
  1020. }
  1021. // Load Character Properties file (if exists)
  1022. try
  1023. {
  1024. Properties Character = new Properties();
  1025. is = new FileInputStream(new File(CHARACTER_CONFIG_FILE));
  1026. Character.load(is);
  1027. MASTERACCESS_LEVEL = Integer.parseInt(Character.getProperty("MasterAccessLevel", "127"));
  1028. MASTERACCESS_NAME_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterNameColor", "00FF00")));
  1029. MASTERACCESS_TITLE_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterTitleColor", "00FF00")));
  1030. ALT_GAME_DELEVEL = Boolean.parseBoolean(Character.getProperty("Delevel", "true"));
  1031. ALT_WEIGHT_LIMIT = Double.parseDouble(Character.getProperty("AltWeightLimit", "1"));
  1032. RUN_SPD_BOOST = Integer.parseInt(Character.getProperty("RunSpeedBoost", "0"));
  1033. DEATH_PENALTY_CHANCE = Integer.parseInt(Character.getProperty("DeathPenaltyChance", "20"));
  1034. RESPAWN_RESTORE_CP = Double.parseDouble(Character.getProperty("RespawnRestoreCP", "0")) / 100;
  1035. RESPAWN_RESTORE_HP = Double.parseDouble(Character.getProperty("RespawnRestoreHP", "70")) / 100;
  1036. RESPAWN_RESTORE_MP = Double.parseDouble(Character.getProperty("RespawnRestoreMP", "70")) / 100;
  1037. HP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("HpRegenMultiplier", "100")) /100;
  1038. MP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("MpRegenMultiplier", "100")) /100;
  1039. CP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("CpRegenMultiplier", "100")) /100;
  1040. ALT_GAME_TIREDNESS = Boolean.parseBoolean(Character.getProperty("AltGameTiredness", "false"));
  1041. ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(Character.getProperty("EnableModifySkillDuration", "false"));
  1042. // Create Map only if enabled
  1043. if (ENABLE_MODIFY_SKILL_DURATION)
  1044. {
  1045. SKILL_DURATION_LIST = new FastMap<Integer, Integer>();
  1046. String[] propertySplit;
  1047. propertySplit = Character.getProperty("SkillDurationList", "").split(";");
  1048. for (String skill : propertySplit)
  1049. {
  1050. String[] skillSplit = skill.split(",");
  1051. if (skillSplit.length != 2)
  1052. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillDurationList \"", skill, "\""));
  1053. else
  1054. {
  1055. try
  1056. {
  1057. SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  1058. }
  1059. catch (NumberFormatException nfe)
  1060. {
  1061. if (!skill.isEmpty())
  1062. {
  1063. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1064. }
  1065. }
  1066. }
  1067. }
  1068. }
  1069. ENABLE_MODIFY_SKILL_REUSE = Boolean.parseBoolean(Character.getProperty("EnableModifySkillReuse", "false"));
  1070. // Create Map only if enabled
  1071. if (ENABLE_MODIFY_SKILL_REUSE)
  1072. {
  1073. SKILL_REUSE_LIST = new FastMap<Integer, Integer>();
  1074. String[] propertySplit;
  1075. propertySplit = Character.getProperty("SkillReuseList", "").split(";");
  1076. for (String skill : propertySplit)
  1077. {
  1078. String[] skillSplit = skill.split(",");
  1079. if (skillSplit.length != 2)
  1080. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillReuseList \"", skill, "\""));
  1081. else
  1082. {
  1083. try
  1084. {
  1085. SKILL_REUSE_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
  1086. }
  1087. catch (NumberFormatException nfe)
  1088. {
  1089. if (!skill.isEmpty())
  1090. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1091. }
  1092. }
  1093. }
  1094. }
  1095. AUTO_LEARN_SKILLS = Boolean.parseBoolean(Character.getProperty("AutoLearnSkills", "false"));
  1096. AUTO_LOOT_HERBS = Boolean.parseBoolean(Character.getProperty("AutoLootHerbs", "false"));
  1097. BUFFS_MAX_AMOUNT = Byte.parseByte(Character.getProperty("maxbuffamount","20"));
  1098. DANCES_MAX_AMOUNT = Byte.parseByte(Character.getProperty("maxdanceamount","12"));
  1099. AUTO_LEARN_DIVINE_INSPIRATION = Boolean.parseBoolean(Character.getProperty("AutoLearnDivineInspiration", "false"));
  1100. ALT_GAME_CANCEL_BOW = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1101. ALT_GAME_CANCEL_CAST = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1102. EFFECT_CANCELING = Boolean.parseBoolean(Character.getProperty("CancelLesserEffect", "True"));
  1103. ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(Character.getProperty("MagicFailures", "true"));
  1104. PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(Character.getProperty("PlayerFakeDeathUpProtection", "0"));
  1105. STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("StoreSkillCooltime", "true"));
  1106. SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("SubclassStoreSkillCooltime", "false"));
  1107. ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(Character.getProperty("AltShieldBlocks", "false"));
  1108. ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(Character.getProperty("AltPerfectShieldBlockRate", "10"));
  1109. ALLOW_CLASS_MASTERS = Boolean.parseBoolean(Character.getProperty("AllowClassMasters", "False"));
  1110. LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(Character.getProperty("LifeCrystalNeeded", "true"));
  1111. SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("SpBookNeeded", "false"));
  1112. ES_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("EnchantSkillSpBookNeeded","true"));
  1113. DIVINE_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("DivineInspirationSpBookNeeded", "true"));
  1114. ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(Character.getProperty("AltGameSkillLearn", "false"));
  1115. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(Character.getProperty("AltSubClassWithoutQuests", "False"));
  1116. MAX_RUN_SPEED = Integer.parseInt(Character.getProperty("MaxRunSpeed", "250"));
  1117. MAX_PCRIT_RATE = Integer.parseInt(Character.getProperty("MaxPCritRate", "500"));
  1118. MAX_MCRIT_RATE = Integer.parseInt(Character.getProperty("MaxMCritRate", "200"));
  1119. MAX_PATK_SPEED = Integer.parseInt(Character.getProperty("MaxPAtkSpeed", "1500"));
  1120. MAX_MATK_SPEED = Integer.parseInt(Character.getProperty("MaxMAtkSpeed", "1999"));
  1121. MAX_EVASION = Integer.parseInt(Character.getProperty("MaxEvasion", "200"));
  1122. MAX_SUBCLASS = Byte.parseByte(Character.getProperty("MaxSubclass", "3"));
  1123. MAX_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("MaxSubclassLevel", "80"));
  1124. MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
  1125. MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsOther", "3"));
  1126. MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsDwarf", "5"));
  1127. MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsOther", "4"));
  1128. INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForNoDwarf", "80"));
  1129. INVENTORY_MAXIMUM_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForDwarf", "100"));
  1130. INVENTORY_MAXIMUM_GM = Integer.parseInt(Character.getProperty("MaximumSlotsForGMPlayer", "250"));
  1131. MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
  1132. WAREHOUSE_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
  1133. WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
  1134. WAREHOUSE_SLOTS_CLAN = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForClan", "150"));
  1135. FREIGHT_SLOTS = Integer.parseInt(Character.getProperty("MaximumFreightSlots", "20"));
  1136. ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("EnchantChanceWeapon", "66"));
  1137. ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("EnchantChanceArmor", "66"));
  1138. ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("EnchantChanceJewelry", "66"));
  1139. BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("BlessedEnchantChanceWeapon", "66"));
  1140. BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("BlessedEnchantChanceArmor", "66"));
  1141. BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("BlessedEnchantChanceJewelry", "66"));
  1142. ENCHANT_MAX_WEAPON = Integer.parseInt(Character.getProperty("EnchantMaxWeapon", "0"));
  1143. ENCHANT_MAX_ARMOR = Integer.parseInt(Character.getProperty("EnchantMaxArmor", "0"));
  1144. ENCHANT_MAX_JEWELRY = Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "0"));
  1145. ENCHANT_SAFE_MAX = Integer.parseInt(Character.getProperty("EnchantSafeMax", "3"));
  1146. ENCHANT_SAFE_MAX_FULL = Integer.parseInt(Character.getProperty("EnchantSafeMaxFull", "4"));
  1147. AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGSkillChance", "15"));
  1148. AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGGlowChance", "0"));
  1149. AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidSkillChance", "30"));
  1150. AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidGlowChance", "40"));
  1151. AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighSkillChance", "45"));
  1152. AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighGlowChance", "70"));
  1153. AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopSkillChance", "60"));
  1154. AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopGlowChance", "100"));
  1155. AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(Character.getProperty("AugmentationBaseStatChance", "1"));
  1156. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
  1157. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanShop", "true"));
  1158. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTeleport", "true"));
  1159. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseGK", "false"));
  1160. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTrade", "true"));
  1161. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
  1162. MAX_PERSONAL_FAME_POINTS = Integer.parseInt(Character.getProperty("MaxPersonalFamePoints","65535"));
  1163. FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("FortressZoneFameTaskFrequency","300"));
  1164. FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("FortressZoneFameAquirePoints","31"));
  1165. CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("CastleZoneFameTaskFrequency","300"));
  1166. CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("CastleZoneFameAquirePoints","125"));
  1167. IS_CRAFTING_ENABLED = Boolean.parseBoolean(Character.getProperty("CraftingEnabled", "true"));
  1168. CRAFT_MASTERWORK = Boolean.parseBoolean(Character.getProperty("CraftMasterwork", "True"));
  1169. DWARF_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("DwarfRecipeLimit","50"));
  1170. COMMON_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("CommonRecipeLimit","50"));
  1171. ALT_GAME_CREATION = Boolean.parseBoolean(Character.getProperty("AltGameCreation", "false"));
  1172. ALT_GAME_CREATION_SPEED = Double.parseDouble(Character.getProperty("AltGameCreationSpeed", "1"));
  1173. ALT_GAME_CREATION_XP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationXpRate", "1"));
  1174. ALT_GAME_CREATION_SP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationSpRate", "1"));
  1175. ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationRareXpSpRate", "2"));
  1176. ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(Character.getProperty("AltBlacksmithUseRecipes", "true"));
  1177. ALT_CLAN_JOIN_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeJoinAClan", "1"));
  1178. ALT_CLAN_CREATE_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeCreateAClan", "10"));
  1179. ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(Character.getProperty("DaysToPassToDissolveAClan", "7"));
  1180. ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
  1181. ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
  1182. ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
  1183. ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(Character.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "10"));
  1184. ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(Character.getProperty("AltMaxNumOfClansInAlly", "3"));
  1185. ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(Character.getProperty("AltClanMembersForWar", "15"));
  1186. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH= Boolean.parseBoolean(Character.getProperty("AltMembersCanWithdrawFromClanWH", "false"));
  1187. REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(Character.getProperty("RemoveCastleCirclets", "true"));
  1188. ALT_PARTY_RANGE = Integer.parseInt(Character.getProperty("AltPartyRange", "1600"));
  1189. ALT_PARTY_RANGE2 = Integer.parseInt(Character.getProperty("AltPartyRange2", "1400"));
  1190. STARTING_ADENA = Long.parseLong(Character.getProperty("StartingAdena", "0"));
  1191. AUTO_LOOT = Boolean.parseBoolean(Character.getProperty("AutoLoot", "false"));
  1192. AUTO_LOOT_RAIDS = Boolean.parseBoolean(Character.getProperty("AutoLootRaids", "false"));
  1193. UNSTUCK_INTERVAL = Integer.parseInt(Character.getProperty("UnstuckInterval", "300"));
  1194. PLAYER_SPAWN_PROTECTION = Integer.parseInt(Character.getProperty("PlayerSpawnProtection", "0"));
  1195. RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(Character.getProperty("RespawnRandomInTown", "True"));
  1196. RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(Character.getProperty("RespawnRandomMaxOffset", "50"));
  1197. RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(Character.getProperty("RestorePlayerInstance", "False"));
  1198. ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(Character.getProperty("AllowSummonToInstance", "True"));
  1199. PETITIONING_ALLOWED = Boolean.parseBoolean(Character.getProperty("PetitioningAllowed", "True"));
  1200. MAX_PETITIONS_PER_PLAYER = Integer.parseInt(Character.getProperty("MaxPetitionsPerPlayer", "5"));
  1201. MAX_PETITIONS_PENDING = Integer.parseInt(Character.getProperty("MaxPetitionsPending", "25"));
  1202. ALT_GAME_FREIGHTS = Boolean.parseBoolean(Character.getProperty("AltGameFreights", "true"));
  1203. ALT_GAME_FREIGHT_PRICE = Integer.parseInt(Character.getProperty("AltGameFreightPrice", "1000"));
  1204. ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltFreeTeleporting", "False"));
  1205. ALT_RECOMMEND = Boolean.parseBoolean(Character.getProperty("AltRecommend", "False"));
  1206. DELETE_DAYS = Integer.parseInt(Character.getProperty("DeleteCharAfterDays", "7"));
  1207. ALT_GAME_EXPONENT_XP = Float.parseFloat(Character.getProperty("AltGameExponentXp", "0."));
  1208. ALT_GAME_EXPONENT_SP = Float.parseFloat(Character.getProperty("AltGameExponentSp", "0."));
  1209. PARTY_XP_CUTOFF_METHOD = Character.getProperty("PartyXpCutoffMethod", "auto");
  1210. PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(Character.getProperty("PartyXpCutoffPercent", "3."));
  1211. PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(Character.getProperty("PartyXpCutoffLevel", "30"));
  1212. }
  1213. catch (Exception e)
  1214. {
  1215. e.printStackTrace();
  1216. throw new Error("Failed to Load "+CHARACTER_CONFIG_FILE+" file.");
  1217. }
  1218. // Load L2J Server Version Properties file (if exists)
  1219. try
  1220. {
  1221. Properties serverVersion = new Properties();
  1222. is = new FileInputStream(new File(SERVER_VERSION_FILE));
  1223. serverVersion.load(is);
  1224. SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1225. SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
  1226. }
  1227. catch (Exception e)
  1228. {
  1229. //Ignore Properties file if it doesnt exist
  1230. SERVER_VERSION = "Unsupported Custom Version.";
  1231. SERVER_BUILD_DATE = "Undefined Date.";
  1232. }
  1233. // Load L2J Datapack Version Properties file (if exists)
  1234. try
  1235. {
  1236. Properties serverVersion = new Properties();
  1237. is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
  1238. serverVersion.load(is);
  1239. DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1240. }
  1241. catch (Exception e)
  1242. {
  1243. //Ignore Properties file if it doesnt exist
  1244. DATAPACK_VERSION = "Unsupported Custom Version.";
  1245. }
  1246. // Load Telnet Properties file (if exists)
  1247. try
  1248. {
  1249. Properties telnetSettings = new Properties();
  1250. is = new FileInputStream(new File(TELNET_FILE));
  1251. telnetSettings.load(is);
  1252. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  1253. }
  1254. catch (Exception e)
  1255. {
  1256. e.printStackTrace();
  1257. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1258. }
  1259. // MMO
  1260. try
  1261. {
  1262. _log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  1263. Properties mmoSettings = new Properties();
  1264. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  1265. mmoSettings.load(is);
  1266. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  1267. MMO_IO_SELECTOR_THREAD_COUNT = Integer.parseInt(mmoSettings.getProperty("IOSelectorThreadCount", "2"));
  1268. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  1269. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  1270. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  1271. }
  1272. catch (Exception e)
  1273. {
  1274. e.printStackTrace();
  1275. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  1276. }
  1277. // Load IdFactory Properties file (if exists)
  1278. try
  1279. {
  1280. Properties idSettings = new Properties();
  1281. is = new FileInputStream(new File(ID_CONFIG_FILE));
  1282. idSettings.load(is);
  1283. MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
  1284. SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
  1285. IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
  1286. BAD_ID_CHECKING = Boolean.parseBoolean(idSettings.getProperty("BadIdChecking", "True"));
  1287. }
  1288. catch (Exception e)
  1289. {
  1290. e.printStackTrace();
  1291. throw new Error("Failed to Load "+ID_CONFIG_FILE+" file.");
  1292. }
  1293. // Load General Properties file (if exists)
  1294. try
  1295. {
  1296. Properties General = new Properties();
  1297. is = new FileInputStream(new File(GENERAL_CONFIG_FILE));
  1298. General.load(is);
  1299. EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(General.getProperty("EverybodyHasAdminRights", "false"));
  1300. DISPLAY_SERVER_VERSION = Boolean.parseBoolean(General.getProperty("DisplayServerRevision","True"));
  1301. SERVER_LIST_BRACKET = Boolean.parseBoolean(General.getProperty("ServerListBrackets", "false"));
  1302. SERVER_LIST_CLOCK = Boolean.parseBoolean(General.getProperty("ServerListClock", "false"));
  1303. SERVER_GMONLY = Boolean.parseBoolean(General.getProperty("ServerGMOnly", "false"));
  1304. GM_HERO_AURA = Boolean.parseBoolean(General.getProperty("GMHeroAura", "False"));
  1305. GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(General.getProperty("GMStartupInvulnerable", "False"));
  1306. GM_STARTUP_INVISIBLE = Boolean.parseBoolean(General.getProperty("GMStartupInvisible", "False"));
  1307. GM_STARTUP_SILENCE = Boolean.parseBoolean(General.getProperty("GMStartupSilence", "False"));
  1308. GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(General.getProperty("GMStartupAutoList", "False"));
  1309. GM_STARTUP_DIET_MODE = Boolean.parseBoolean(General.getProperty("GMStartupDietMode", "False"));
  1310. GM_ADMIN_MENU_STYLE = General.getProperty("GMAdminMenuStyle", "modern");
  1311. GM_ITEM_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMItemRestriction", "True"));
  1312. GM_SKILL_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMSkillRestriction", "True"));
  1313. BYPASS_VALIDATION = Boolean.parseBoolean(General.getProperty("BypassValidation", "True"));
  1314. GAMEGUARD_ENFORCE = Boolean.parseBoolean(General.getProperty("GameGuardEnforce", "True"));
  1315. GAMEGUARD_PROHIBITACTION = Boolean.parseBoolean(General.getProperty("GameGuardProhibitAction", "True"));
  1316. LOG_CHAT = Boolean.parseBoolean(General.getProperty("LogChat", "false"));
  1317. LOG_ITEMS = Boolean.parseBoolean(General.getProperty("LogItems", "false"));
  1318. GMAUDIT = Boolean.parseBoolean(General.getProperty("GMAudit", "False"));
  1319. LOG_GAME_DAMAGE = Boolean.parseBoolean(General.getProperty("LogGameDamage", "False"));
  1320. DEBUG = Boolean.parseBoolean(General.getProperty("Debug", "false"));
  1321. PACKET_HANDLER_DEBUG = Boolean.parseBoolean(General.getProperty("PacketHandlerDebug", "false"));
  1322. ASSERT = Boolean.parseBoolean(General.getProperty("Assert", "false"));
  1323. DEVELOPER = Boolean.parseBoolean(General.getProperty("Developer", "false"));
  1324. ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(General.getProperty("AcceptGeoeditorConn", "false"));
  1325. TEST_SERVER = Boolean.parseBoolean(General.getProperty("TestServer", "false"));
  1326. SERVER_LIST_TESTSERVER = Boolean.parseBoolean(General.getProperty("ListTestServers", "false"));
  1327. ALT_DEV_NO_QUESTS = Boolean.parseBoolean(General.getProperty("AltDevNoQuests", "False"));
  1328. ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(General.getProperty("AltDevNoSpawns", "False"));
  1329. THREAD_P_EFFECTS = Integer.parseInt(General.getProperty("ThreadPoolSizeEffects", "10"));
  1330. THREAD_P_GENERAL = Integer.parseInt(General.getProperty("ThreadPoolSizeGeneral", "13"));
  1331. IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("UrgentPacketThreadCoreSize", "2"));
  1332. GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralPacketThreadCoreSize", "4"));
  1333. GENERAL_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralThreadCoreSize", "4"));
  1334. AI_MAX_THREAD = Integer.parseInt(General.getProperty("AiMaxThread", "6"));
  1335. PACKET_LIFETIME = Integer.parseInt(General.getProperty("PacketLifeTime", "0"));
  1336. DEADLOCK_DETECTOR = Boolean.parseBoolean(General.getProperty("DeadLockDetector", "False"));
  1337. DEADLOCK_CHECK_INTERVAL = Integer.parseInt(General.getProperty("DeadLockCheckInterval", "20"));
  1338. RESTART_ON_DEADLOCK = Boolean.parseBoolean(General.getProperty("RestartOnDeadlock", "False"));
  1339. ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
  1340. AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600"));
  1341. HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime","15"))*1000;
  1342. PROTECTED_ITEMS = General.getProperty("ListOfProtectedItems", "0");
  1343. LIST_PROTECTED_ITEMS = new FastList<Integer>();
  1344. for (String id : PROTECTED_ITEMS.split(","))
  1345. {
  1346. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
  1347. }
  1348. CHAR_STORE_INTERVAL = Integer.parseInt(General.getProperty("CharacterDataStoreInterval", "15"));
  1349. LAZY_ITEMS_UPDATE = Boolean.parseBoolean(General.getProperty("LazyItemsUpdate", "false"));
  1350. UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(General.getProperty("UpdateItemsOnCharStore", "false"));
  1351. DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyPlayerDroppedItem", "false"));
  1352. DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyEquipableItem", "false"));
  1353. SAVE_DROPPED_ITEM = Boolean.parseBoolean(General.getProperty("SaveDroppedItem", "false"));
  1354. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(General.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
  1355. SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(General.getProperty("SaveDroppedItemInterval", "60"))*60000;
  1356. CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(General.getProperty("ClearDroppedItemTable", "false"));
  1357. AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(General.getProperty("AutoDeleteInvalidQuestData", "False"));
  1358. PRECISE_DROP_CALCULATION = Boolean.parseBoolean(General.getProperty("PreciseDropCalculation", "True"));
  1359. MULTIPLE_ITEM_DROP = Boolean.parseBoolean(General.getProperty("MultipleItemDrop", "True"));
  1360. FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(General.getProperty("ForceInventoryUpdate", "False"));
  1361. LAZY_CACHE = Boolean.parseBoolean(General.getProperty("LazyCache", "True"));
  1362. MIN_NPC_ANIMATION = Integer.parseInt(General.getProperty("MinNPCAnimation", "10"));
  1363. MAX_NPC_ANIMATION = Integer.parseInt(General.getProperty("MaxNPCAnimation", "20"));
  1364. MIN_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MinMonsterAnimation", "5"));
  1365. MAX_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MaxMonsterAnimation", "20"));
  1366. MOVE_BASED_KNOWNLIST = Boolean.parseBoolean(General.getProperty("MoveBasedKnownlist", "False"));
  1367. KNOWNLIST_UPDATE_INTERVAL = Long.parseLong(General.getProperty("KnownListUpdateInterval", "1250"));
  1368. GRIDS_ALWAYS_ON = Boolean.parseBoolean(General.getProperty("GridsAlwaysOn", "False"));
  1369. GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOnTime", "1"));
  1370. GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOffTime", "90"));
  1371. GEODATA = Integer.parseInt(General.getProperty("GeoData", "0"));
  1372. GEODATA_CELLFINDING = Boolean.parseBoolean(General.getProperty("CellPathFinding", "False"));
  1373. FORCE_GEODATA = Boolean.parseBoolean(General.getProperty("ForceGeodata", "True"));
  1374. COORD_SYNCHRONIZE = Integer.parseInt(General.getProperty("CoordSynchronize", "-1"));
  1375. ZONE_TOWN = Integer.parseInt(General.getProperty("ZoneTown", "0"));
  1376. ACTIVATE_POSITION_RECORDER = Boolean.parseBoolean(General.getProperty("ActivatePositionRecorder", "False"));
  1377. DEFAULT_GLOBAL_CHAT = General.getProperty("GlobalChat", "ON");
  1378. DEFAULT_TRADE_CHAT = General.getProperty("TradeChat", "LIMITED");
  1379. ALLOW_WAREHOUSE = Boolean.parseBoolean(General.getProperty("AllowWarehouse", "True"));
  1380. WAREHOUSE_CACHE = Boolean.parseBoolean(General.getProperty("WarehouseCache", "False"));
  1381. WAREHOUSE_CACHE_TIME = Integer.parseInt(General.getProperty("WarehouseCacheTime", "15"));
  1382. ALLOW_FREIGHT = Boolean.parseBoolean(General.getProperty("AllowFreight", "True"));
  1383. ALLOW_WEAR = Boolean.parseBoolean(General.getProperty("AllowWear", "False"));
  1384. WEAR_DELAY = Integer.parseInt(General.getProperty("WearDelay", "5"));
  1385. WEAR_PRICE = Integer.parseInt(General.getProperty("WearPrice", "10"));
  1386. ALLOW_LOTTERY = Boolean.parseBoolean(General.getProperty("AllowLottery", "True"));
  1387. ALLOW_RACE = Boolean.parseBoolean(General.getProperty("AllowRace", "True"));
  1388. ALLOW_WATER = Boolean.parseBoolean(General.getProperty("AllowWater", "True"));
  1389. ALLOW_RENTPET = Boolean.parseBoolean(General.getProperty("AllowRentPet", "False"));
  1390. ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
  1391. ALLOWFISHING = Boolean.parseBoolean(General.getProperty("AllowFishing", "True"));
  1392. ALLOW_MANOR = Boolean.parseBoolean(General.getProperty("AllowManor", "True"));
  1393. ALLOW_BOAT = Boolean.parseBoolean(General.getProperty("AllowBoat", "True"));
  1394. ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(General.getProperty("AllowCursedWeapons", "True"));
  1395. ALLOW_NPC_WALKERS = Boolean.parseBoolean(General.getProperty("AllowNpcWalkers", "true"));
  1396. ALLOW_PET_WALKERS = Boolean.parseBoolean(General.getProperty("AllowPetWalkers", "True"));
  1397. SERVER_NEWS = Boolean.parseBoolean(General.getProperty("ShowServerNews", "False"));
  1398. COMMUNITY_TYPE = Integer.parseInt(General.getProperty("CommunityType", "1"));
  1399. BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(General.getProperty("BBSShowPlayerList", "false"));
  1400. BBS_DEFAULT = General.getProperty("BBSDefault", "_bbshome");
  1401. SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowLevelOnCommunityBoard", "False"));
  1402. SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowStatusOnCommunityBoard", "True"));
  1403. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePageSizeOnCommunityBoard", "50"));
  1404. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePerRowOnCommunityBoard", "5"));
  1405. ALT_OLY_START_TIME = Integer.parseInt(General.getProperty("AltOlyStartTime", "18"));
  1406. ALT_OLY_MIN = Integer.parseInt(General.getProperty("AltOlyMin","00"));
  1407. ALT_OLY_CPERIOD = Long.parseLong(General.getProperty("AltOlyCPeriod","21600000"));
  1408. ALT_OLY_BATTLE = Long.parseLong(General.getProperty("AltOlyBattle","360000"));
  1409. ALT_OLY_WPERIOD = Long.parseLong(General.getProperty("AltOlyWPeriod","604800000"));
  1410. ALT_OLY_VPERIOD = Long.parseLong(General.getProperty("AltOlyVPeriod","86400000"));
  1411. ALT_OLY_CLASSED = Integer.parseInt(General.getProperty("AltOlyClassedParticipants","5"));
  1412. ALT_OLY_NONCLASSED = Integer.parseInt(General.getProperty("AltOlyNonClassedParticipants","9"));
  1413. ALT_OLY_REG_DISPLAY = Integer.parseInt(General.getProperty("AltOlyRegistrationDisplayNumber","100"));
  1414. ALT_OLY_BATTLE_REWARD_ITEM = Integer.parseInt(General.getProperty("AltOlyBattleRewItem","6651"));
  1415. ALT_OLY_CLASSED_RITEM_C = Integer.parseInt(General.getProperty("AltOlyClassedRewItemCount","50"));
  1416. ALT_OLY_NONCLASSED_RITEM_C = Integer.parseInt(General.getProperty("AltOlyNonClassedRewItemCount","30"));
  1417. ALT_OLY_COMP_RITEM = Integer.parseInt(General.getProperty("AltOlyCompRewItem","13722"));
  1418. ALT_OLY_GP_PER_POINT = Integer.parseInt(General.getProperty("AltOlyGPPerPoint","1000"));
  1419. ALT_OLY_HERO_POINTS = Integer.parseInt(General.getProperty("AltOlyHeroPoints","180"));
  1420. ALT_OLY_RANK1_POINTS = Integer.parseInt(General.getProperty("AltOlyRank1Points","120"));
  1421. ALT_OLY_RANK2_POINTS = Integer.parseInt(General.getProperty("AltOlyRank2Points","80"));
  1422. ALT_OLY_RANK3_POINTS = Integer.parseInt(General.getProperty("AltOlyRank3Points","55"));
  1423. ALT_OLY_RANK4_POINTS = Integer.parseInt(General.getProperty("AltOlyRank4Points","35"));
  1424. ALT_OLY_RANK5_POINTS = Integer.parseInt(General.getProperty("AltOlyRank5Points","20"));
  1425. ALT_OLY_LOG_FIGHTS = Boolean.parseBoolean(General.getProperty("AlyOlyLogFights","false"));
  1426. ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(General.getProperty("AltOlyShowMonthlyWinners","true"));
  1427. ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(General.getProperty("AltOlyAnnounceGames","true"));
  1428. LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
  1429. for (String id : General.getProperty("AltOlyRestrictedItems","0").split(","))
  1430. {
  1431. LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
  1432. }
  1433. ALT_OLY_ENCHANT_LIMIT = Integer.parseInt(General.getProperty("AltOlyEnchantLimit","-1"));
  1434. ALT_MANOR_REFRESH_TIME = Integer.parseInt(General.getProperty("AltManorRefreshTime","20"));
  1435. ALT_MANOR_REFRESH_MIN = Integer.parseInt(General.getProperty("AltManorRefreshMin","00"));
  1436. ALT_MANOR_APPROVE_TIME = Integer.parseInt(General.getProperty("AltManorApproveTime","6"));
  1437. ALT_MANOR_APPROVE_MIN = Integer.parseInt(General.getProperty("AltManorApproveMin","00"));
  1438. ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(General.getProperty("AltManorMaintenancePeriod","360000"));
  1439. ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(General.getProperty("AltManorSaveAllActions","false"));
  1440. ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(General.getProperty("AltManorSavePeriodRate","2"));
  1441. ALT_LOTTERY_PRIZE = Long.parseLong(General.getProperty("AltLotteryPrize","50000"));
  1442. ALT_LOTTERY_TICKET_PRICE = Long.parseLong(General.getProperty("AltLotteryTicketPrice","2000"));
  1443. ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery5NumberRate","0.6"));
  1444. ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery4NumberRate","0.2"));
  1445. ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery3NumberRate","0.2"));
  1446. ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Long.parseLong(General.getProperty("AltLottery2and1NumberPrize","200"));
  1447. FS_TIME_ATTACK = Integer.parseInt(General.getProperty("TimeOfAttack", "50"));
  1448. FS_TIME_COOLDOWN = Integer.parseInt(General.getProperty("TimeOfCoolDown", "5"));
  1449. FS_TIME_ENTRY = Integer.parseInt(General.getProperty("TimeOfEntry", "3"));
  1450. FS_TIME_WARMUP = Integer.parseInt(General.getProperty("TimeOfWarmUp", "2"));
  1451. FS_PARTY_MEMBER_COUNT = Integer.parseInt(General.getProperty("NumberOfNecessaryPartyMembers", "4"));
  1452. if (FS_TIME_ATTACK <= 0)
  1453. FS_TIME_ATTACK = 50;
  1454. if (FS_TIME_COOLDOWN <= 0)
  1455. FS_TIME_COOLDOWN = 5;
  1456. if (FS_TIME_ENTRY <= 0)
  1457. FS_TIME_ENTRY = 3;
  1458. if (FS_TIME_ENTRY <= 0)
  1459. FS_TIME_ENTRY = 3;
  1460. if (FS_TIME_ENTRY <= 0)
  1461. FS_TIME_ENTRY = 3;
  1462. RIFT_MIN_PARTY_SIZE = Integer.parseInt(General.getProperty("RiftMinPartySize", "5"));
  1463. RIFT_MAX_JUMPS = Integer.parseInt(General.getProperty("MaxRiftJumps", "4"));
  1464. RIFT_SPAWN_DELAY = Integer.parseInt(General.getProperty("RiftSpawnDelay", "10000"));
  1465. RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(General.getProperty("AutoJumpsDelayMin", "480"));
  1466. RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(General.getProperty("AutoJumpsDelayMax", "600"));
  1467. RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(General.getProperty("BossRoomTimeMultiply", "1.5"));
  1468. RIFT_ENTER_COST_RECRUIT = Integer.parseInt(General.getProperty("RecruitCost", "18"));
  1469. RIFT_ENTER_COST_SOLDIER = Integer.parseInt(General.getProperty("SoldierCost", "21"));
  1470. RIFT_ENTER_COST_OFFICER = Integer.parseInt(General.getProperty("OfficerCost", "24"));
  1471. RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(General.getProperty("CaptainCost", "27"));
  1472. RIFT_ENTER_COST_COMMANDER = Integer.parseInt(General.getProperty("CommanderCost", "30"));
  1473. RIFT_ENTER_COST_HERO = Integer.parseInt(General.getProperty("HeroCost", "33"));
  1474. DEFAULT_PUNISH = Integer.parseInt(General.getProperty("DefaultPunish", "2"));
  1475. DEFAULT_PUNISH_PARAM = Integer.parseInt(General.getProperty("DefaultPunishParam", "0"));
  1476. ONLY_GM_ITEMS_FREE = Boolean.parseBoolean(General.getProperty("OnlyGMItemsFree", "True"));
  1477. JAIL_IS_PVP = Boolean.parseBoolean(General.getProperty("JailIsPvp", "True"));
  1478. JAIL_DISABLE_CHAT = Boolean.parseBoolean(General.getProperty("JailDisableChat", "True"));
  1479. CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(General.getProperty("CustomSpawnlistTable", "false"));
  1480. SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("SaveGmSpawnOnCustom", "false"));
  1481. DELETE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("DeleteGmSpawnOnCustom", "false"));
  1482. CUSTOM_NPC_TABLE = Boolean.valueOf(General.getProperty("CustomNpcTable", "false"));
  1483. CUSTOM_ITEM_TABLES = Boolean.valueOf(General.getProperty("CustomItemTables", "false"));
  1484. CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(General.getProperty("CustomArmorSetsTable", "false"));
  1485. CUSTOM_TELEPORT_TABLE = Boolean.valueOf(General.getProperty("CustomTeleportTable", "false"));
  1486. CUSTOM_DROPLIST_TABLE = Boolean.valueOf(General.getProperty("CustomDroplistTable", "false"));
  1487. CUSTOM_MERCHANT_TABLES = Boolean.valueOf(General.getProperty("CustomMerchantTables", "false"));
  1488. }
  1489. catch (Exception e)
  1490. {
  1491. e.printStackTrace();
  1492. throw new Error("Failed to Load "+GENERAL_CONFIG_FILE+" File.");
  1493. }
  1494. // Load FloodProtector Properties file
  1495. try
  1496. {
  1497. Properties security = new Properties();
  1498. is = new FileInputStream(new File(FLOOD_PROTECTOR_FILE));
  1499. security.load(is);
  1500. loadFloodProtectorConfigs(security);
  1501. }
  1502. catch (Exception e)
  1503. {
  1504. e.printStackTrace();
  1505. throw new Error("Failed to Load "+FLOOD_PROTECTOR_FILE);
  1506. }
  1507. // Load NPC Properties file (if exists)
  1508. try
  1509. {
  1510. Properties NPC = new Properties();
  1511. is = new FileInputStream(new File(NPC_CONFIG_FILE));
  1512. NPC.load(is);
  1513. ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(NPC.getProperty("AnnounceMammonSpawn", "False"));
  1514. ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(NPC.getProperty("AltMobAgroInPeaceZone", "True"));
  1515. ALT_ATTACKABLE_NPCS = Boolean.parseBoolean(NPC.getProperty("AltAttackableNpcs", "True"));
  1516. ALT_GAME_VIEWNPC = Boolean.parseBoolean(NPC.getProperty("AltGameViewNpc", "False"));
  1517. MAX_DRIFT_RANGE = Integer.parseInt(NPC.getProperty("MaxDriftRange", "300"));
  1518. DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
  1519. DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRulesRaid", "True"));
  1520. SHOW_NPC_LVL = Boolean.parseBoolean(NPC.getProperty("ShowNpcLevel", "False"));
  1521. GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
  1522. ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
  1523. PET_RENT_NPC = NPC.getProperty("ListPetRentNpc", "30827");
  1524. LIST_PET_RENT_NPC = new FastList<Integer>();
  1525. for (String id : PET_RENT_NPC.split(","))
  1526. {
  1527. LIST_PET_RENT_NPC.add(Integer.parseInt(id));
  1528. }
  1529. RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) /100;
  1530. RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) /100;
  1531. RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPDefenceMultiplier", "100")) /100;
  1532. RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMDefenceMultiplier", "100")) /100;
  1533. RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMinRespawnMultiplier", "1.0"));
  1534. RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
  1535. RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
  1536. RAID_DISABLE_CURSE = Boolean.parseBoolean(NPC.getProperty("DisableRaidCurse", "False"));
  1537. INVENTORY_MAXIMUM_PET = Integer.parseInt(NPC.getProperty("MaximumSlotsForPet", "12"));
  1538. }
  1539. catch (Exception e)
  1540. {
  1541. e.printStackTrace();
  1542. throw new Error("Failed to Load "+NPC_CONFIG_FILE+" File.");
  1543. }
  1544. // Load Rates Properties file (if exists)
  1545. try
  1546. {
  1547. Properties ratesSettings = new Properties();
  1548. is = new FileInputStream(new File(RATES_CONFIG_FILE));
  1549. ratesSettings.load(is);
  1550. RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
  1551. RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
  1552. RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
  1553. RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
  1554. RATE_QUESTS_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestsReward", "1."));
  1555. RATE_DROP_ADENA = Float.parseFloat(ratesSettings.getProperty("RateDropAdena", "1."));
  1556. RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
  1557. RATE_EXTR_FISH = Float.parseFloat(ratesSettings.getProperty("RateExtractFish", "1."));
  1558. RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
  1559. RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(ratesSettings.getProperty("RateRaidDropItems", "1."));
  1560. RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
  1561. RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
  1562. RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("RateDropQuest", "1."));
  1563. RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
  1564. RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
  1565. RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "15."));
  1566. RATE_DROP_MP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpMpHerbs", "10."));
  1567. RATE_DROP_GREATER_HERBS = Float.parseFloat(ratesSettings.getProperty("RateGreaterHerbs", "4."));
  1568. RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSuperiorHerbs", "0.8"))*10;
  1569. RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "0.2"))*10;
  1570. PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
  1571. PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
  1572. PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
  1573. PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
  1574. PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
  1575. PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
  1576. PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
  1577. SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
  1578. KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
  1579. KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
  1580. KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
  1581. KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
  1582. KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
  1583. // Initializing table
  1584. PLAYER_XP_PERCENT_LOST = new double[Byte.MAX_VALUE+1];
  1585. // Default value
  1586. for (int i = 0; i <= Byte.MAX_VALUE; i++)
  1587. PLAYER_XP_PERCENT_LOST[i] = 1.;
  1588. // Now loading into table parsed values
  1589. try
  1590. {
  1591. String[] values = ratesSettings.getProperty("PlayerXPPercentLost", "0,39-7.0;40,75-4.0;76,76-2.5;77,77-2.0;78,78-1.5").split(";");
  1592. for (String s : values)
  1593. {
  1594. int min;
  1595. int max;
  1596. double val;
  1597. String[] vals = s.split("-");
  1598. String[] mM = vals[0].split(",");
  1599. min = Integer.parseInt(mM[0]);
  1600. max = Integer.parseInt(mM[1]);
  1601. val = Double.parseDouble(vals[1]);
  1602. for (int i = min; i <= max; i++)
  1603. PLAYER_XP_PERCENT_LOST[i] = val;
  1604. }
  1605. }
  1606. catch (Exception e)
  1607. {
  1608. _log.warning("Error while loading Player XP percent lost");
  1609. e.printStackTrace();
  1610. }
  1611. }
  1612. catch (Exception e)
  1613. {
  1614. e.printStackTrace();
  1615. throw new Error("Failed to Load "+RATES_CONFIG_FILE+" File.");
  1616. }
  1617. // Load L2JMod Properties file (if exists)
  1618. try
  1619. {
  1620. Properties L2JModSettings = new Properties();
  1621. is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
  1622. L2JModSettings.load(is);
  1623. L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
  1624. L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
  1625. L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
  1626. L2JMOD_CHAMP_TITLE = L2JModSettings.getProperty("ChampionTitle", "Champion");
  1627. L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
  1628. L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
  1629. L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
  1630. L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
  1631. L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
  1632. L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
  1633. L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
  1634. L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
  1635. L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
  1636. L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
  1637. L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
  1638. L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
  1639. TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
  1640. TVT_EVENT_INTERVAL = L2JModSettings.getProperty("TvTEventInterval", "20:00").split(",");
  1641. TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
  1642. TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
  1643. TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
  1644. L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(L2JModSettings.getProperty("AllowWedding", "False"));
  1645. L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
  1646. L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
  1647. L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
  1648. L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
  1649. L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
  1650. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
  1651. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
  1652. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
  1653. L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
  1654. L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
  1655. L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingFreight", "False"));
  1656. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  1657. {
  1658. TVT_EVENT_ENABLED = false;
  1659. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
  1660. }
  1661. else
  1662. {
  1663. String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
  1664. if (propertySplit.length < 3)
  1665. {
  1666. TVT_EVENT_ENABLED = false;
  1667. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
  1668. }
  1669. else
  1670. {
  1671. TVT_EVENT_REWARDS = new FastList<int[]>();
  1672. TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  1673. TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  1674. TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
  1675. TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  1676. TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  1677. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1678. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1679. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1680. TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
  1681. TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
  1682. TVT_EVENT_MIN_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
  1683. TVT_EVENT_MAX_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
  1684. TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
  1685. TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
  1686. TVT_EVENT_EFFECTS_REMOVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventEffectsRemoval", "0"));
  1687. TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
  1688. propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
  1689. if (propertySplit.length < 3)
  1690. {
  1691. TVT_EVENT_ENABLED = false;
  1692. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
  1693. }
  1694. else
  1695. {
  1696. TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1697. TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1698. TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1699. TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
  1700. propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
  1701. if (propertySplit.length < 3)
  1702. {
  1703. TVT_EVENT_ENABLED= false;
  1704. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
  1705. }
  1706. else
  1707. {
  1708. TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1709. TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1710. TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1711. propertySplit = L2JModSettings.getProperty("TvTEventParticipationFee", "0,0").split(",");
  1712. try
  1713. {
  1714. TVT_EVENT_PARTICIPATION_FEE[0] = Integer.parseInt(propertySplit[0]);
  1715. TVT_EVENT_PARTICIPATION_FEE[1] = Integer.parseInt(propertySplit[1]);
  1716. }
  1717. catch (NumberFormatException nfe)
  1718. {
  1719. if (propertySplit.length > 0)
  1720. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationFee");
  1721. }
  1722. propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
  1723. for (String reward : propertySplit)
  1724. {
  1725. String[] rewardSplit = reward.split(",");
  1726. if (rewardSplit.length != 2)
  1727. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  1728. else
  1729. {
  1730. try
  1731. {
  1732. TVT_EVENT_REWARDS.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  1733. }
  1734. catch (NumberFormatException nfe)
  1735. {
  1736. if (!reward.isEmpty())
  1737. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  1738. }
  1739. }
  1740. }
  1741. TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
  1742. TVT_EVENT_SCROLL_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventScrollsAllowed", "false"));
  1743. TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
  1744. TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
  1745. TVT_REWARD_TEAM_TIE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTRewardTeamTie", "false"));
  1746. propertySplit = L2JModSettings.getProperty("TvTDoorsToOpen", "").split(";");
  1747. for (String door : propertySplit)
  1748. {
  1749. try
  1750. {
  1751. TVT_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
  1752. }
  1753. catch (NumberFormatException nfe)
  1754. {
  1755. if (!door.equals(""))
  1756. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"", door, "\""));
  1757. }
  1758. }
  1759. propertySplit = L2JModSettings.getProperty("TvTDoorsToClose", "").split(";");
  1760. for (String door : propertySplit)
  1761. {
  1762. try
  1763. {
  1764. TVT_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
  1765. }
  1766. catch (NumberFormatException nfe)
  1767. {
  1768. if (!door.isEmpty())
  1769. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"", door, "\""));
  1770. }
  1771. }
  1772. }
  1773. }
  1774. }
  1775. }
  1776. BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
  1777. BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
  1778. BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
  1779. OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
  1780. OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
  1781. OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
  1782. OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
  1783. L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
  1784. }
  1785. catch (Exception e)
  1786. {
  1787. e.printStackTrace();
  1788. throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File.");
  1789. }
  1790. // Load PvP Properties file (if exists)
  1791. try
  1792. {
  1793. Properties pvpSettings = new Properties();
  1794. is = new FileInputStream(new File(PVP_CONFIG_FILE));
  1795. pvpSettings.load(is);
  1796. KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
  1797. KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
  1798. KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
  1799. KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
  1800. KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
  1801. KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
  1802. KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
  1803. KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
  1804. 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");
  1805. String[] array = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
  1806. KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[array.length];
  1807. for (int i = 0; i < array.length; i++)
  1808. KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(array[i]);
  1809. array = KARMA_NONDROPPABLE_ITEMS.split(",");
  1810. KARMA_LIST_NONDROPPABLE_ITEMS = new int[array.length];
  1811. for (int i = 0; i < array.length; i++)
  1812. KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(array[i]);
  1813. // sorting so binarySearch can be used later
  1814. Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
  1815. Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
  1816. PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "120000"));
  1817. PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "60000"));
  1818. }
  1819. catch (Exception e)
  1820. {
  1821. e.printStackTrace();
  1822. throw new Error("Failed to Load "+PVP_CONFIG_FILE+" File.");
  1823. }
  1824. try
  1825. {
  1826. Properties Settings = new Properties();
  1827. is = new FileInputStream(HEXID_FILE);
  1828. Settings.load(is);
  1829. SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
  1830. HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
  1831. }
  1832. catch (Exception e)
  1833. {
  1834. _log.warning("Could not load HexID file ("+HEXID_FILE+"). Hopefully login will give us one.");
  1835. }
  1836. }
  1837. finally
  1838. {
  1839. try
  1840. {
  1841. is.close();
  1842. }
  1843. catch (Exception e) { }
  1844. }
  1845. }
  1846. else if(Server.serverMode == Server.MODE_LOGINSERVER)
  1847. {
  1848. _log.info("loading login config");
  1849. InputStream is = null;
  1850. try
  1851. {
  1852. try
  1853. {
  1854. Properties serverSettings = new Properties();
  1855. is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
  1856. serverSettings.load(is);
  1857. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");
  1858. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));
  1859. LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
  1860. PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
  1861. DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
  1862. PACKET_HANDLER_DEBUG = Boolean.parseBoolean(serverSettings.getProperty("PacketHandlerDebug", "false"));
  1863. DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
  1864. ASSERT = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));
  1865. ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
  1866. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  1867. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  1868. LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
  1869. LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
  1870. LOG_LOGIN_CONTROLLER = Boolean.parseBoolean(serverSettings.getProperty("LogLoginController", "true"));
  1871. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); //FIXME: in login?
  1872. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
  1873. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
  1874. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  1875. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  1876. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  1877. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  1878. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  1879. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  1880. SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
  1881. IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime","15"));
  1882. FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "false"));
  1883. AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));
  1884. FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
  1885. FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
  1886. NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
  1887. FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
  1888. MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
  1889. }
  1890. catch (Exception e)
  1891. {
  1892. e.printStackTrace();
  1893. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  1894. }
  1895. // MMO
  1896. try
  1897. {
  1898. _log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  1899. Properties mmoSettings = new Properties();
  1900. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  1901. mmoSettings.load(is);
  1902. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  1903. MMO_IO_SELECTOR_THREAD_COUNT = Integer.parseInt(mmoSettings.getProperty("IOSelectorThreadCount", "2"));
  1904. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  1905. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  1906. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  1907. }
  1908. catch (Exception e)
  1909. {
  1910. e.printStackTrace();
  1911. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  1912. }
  1913. // Load Telnet Properties file (if exists)
  1914. try
  1915. {
  1916. Properties telnetSettings = new Properties();
  1917. is = new FileInputStream(new File(TELNET_FILE));
  1918. telnetSettings.load(is);
  1919. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  1920. }
  1921. catch (Exception e)
  1922. {
  1923. e.printStackTrace();
  1924. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1925. }
  1926. }
  1927. finally
  1928. {
  1929. try
  1930. {
  1931. is.close();
  1932. }
  1933. catch(Exception e) { }
  1934. }
  1935. }
  1936. else
  1937. {
  1938. _log.severe("Could not Load Config: server mode was not set");
  1939. }
  1940. }
  1941. /**
  1942. * Set a new value to a game parameter from the admin console.
  1943. * @param pName (String) : name of the parameter to change
  1944. * @param pValue (String) : new value of the parameter
  1945. * @return boolean : true if modification has been made
  1946. * @link useAdminCommand
  1947. */
  1948. public static boolean setParameterValue(String pName, String pValue)
  1949. {
  1950. if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
  1951. else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
  1952. else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
  1953. else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
  1954. else if (pName.equalsIgnoreCase("RateQuestsReward")) RATE_QUESTS_REWARD = Float.parseFloat(pValue);
  1955. else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ADENA = Float.parseFloat(pValue);
  1956. else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
  1957. else if (pName.equalsIgnoreCase("RateExtractFish")) RATE_EXTR_FISH = Float.parseFloat(pValue);
  1958. else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
  1959. else if (pName.equalsIgnoreCase("RateRaidDropItems")) RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(pValue);
  1960. else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
  1961. else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
  1962. else if (pName.equalsIgnoreCase("RateDropQuest")) RATE_DROP_QUEST = Float.parseFloat(pValue);
  1963. else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
  1964. else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
  1965. else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
  1966. else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
  1967. else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
  1968. else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  1969. else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  1970. else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
  1971. else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
  1972. else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
  1973. else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  1974. else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  1975. else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
  1976. else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  1977. else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  1978. else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.parseBoolean(pValue);
  1979. else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(pValue);
  1980. else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
  1981. else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(pValue);
  1982. else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
  1983. else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
  1984. else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
  1985. else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
  1986. else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
  1987. else if (pName.equalsIgnoreCase("AllowFreight")) ALLOW_FREIGHT = Boolean.parseBoolean(pValue);
  1988. else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.parseBoolean(pValue);
  1989. else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.parseBoolean(pValue);
  1990. else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
  1991. else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
  1992. else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.parseBoolean(pValue);
  1993. else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.parseBoolean(pValue);
  1994. else if (pName.equalsIgnoreCase("AllowBoat")) ALLOW_BOAT = Boolean.parseBoolean(pValue);
  1995. else if (pName.equalsIgnoreCase("AllowCursedWeapons")) ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(pValue);
  1996. else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.parseBoolean(pValue);
  1997. else if (pName.equalsIgnoreCase("AllowNpcWalkers")) ALLOW_NPC_WALKERS = Boolean.parseBoolean(pValue);
  1998. else if (pName.equalsIgnoreCase("AllowPetWalkers")) ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
  1999. else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.parseBoolean(pValue);
  2000. else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = Integer.parseInt(pValue);
  2001. else if (pName.equalsIgnoreCase("BBSShowPlayerList")) BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
  2002. else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
  2003. else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  2004. else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  2005. else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
  2006. else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
  2007. else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.parseBoolean(pValue);
  2008. else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.parseBoolean(pValue);
  2009. else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);
  2010. else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(pValue);
  2011. else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
  2012. else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);
  2013. else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.parseBoolean(pValue);
  2014. else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.parseBoolean(pValue);
  2015. else if (pName.equalsIgnoreCase("AllowGuards")) GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(pValue);
  2016. else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.parseBoolean(pValue);
  2017. else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
  2018. else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
  2019. else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
  2020. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
  2021. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
  2022. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
  2023. else if (pName.equalsIgnoreCase("MaximumFreightSlots")) FREIGHT_SLOTS = Integer.parseInt(pValue);
  2024. else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
  2025. else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
  2026. else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
  2027. else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
  2028. else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
  2029. else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
  2030. else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
  2031. else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
  2032. else if (pName.equalsIgnoreCase("AugmentationNGSkillChance")) AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(pValue);
  2033. else if (pName.equalsIgnoreCase("AugmentationNGGlowChance")) AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(pValue);
  2034. else if (pName.equalsIgnoreCase("AugmentationMidSkillChance")) AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(pValue);
  2035. else if (pName.equalsIgnoreCase("AugmentationMidGlowChance")) AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(pValue);
  2036. else if (pName.equalsIgnoreCase("AugmentationHighSkillChance")) AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(pValue);
  2037. else if (pName.equalsIgnoreCase("AugmentationHighGlowChance")) AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(pValue);
  2038. else if (pName.equalsIgnoreCase("AugmentationTopSkillChance")) AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(pValue);
  2039. else if (pName.equalsIgnoreCase("AugmentationTopGlowChance")) AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(pValue);
  2040. else if (pName.equalsIgnoreCase("AugmentationBaseStatChance")) AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(pValue);
  2041. else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2042. else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2043. else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2044. else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2045. else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2046. else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier")) RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  2047. else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier")) RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  2048. else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
  2049. else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Long.parseLong(pValue);
  2050. else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
  2051. else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
  2052. else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
  2053. else if (pName.equalsIgnoreCase("RestorePlayerInstance")) RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(pValue);
  2054. else if (pName.equalsIgnoreCase("AllowSummonToInstance")) ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(pValue);
  2055. else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
  2056. else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
  2057. else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
  2058. else if (pName.equalsIgnoreCase("RespawnRestoreCP")) RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
  2059. else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
  2060. else if (pName.equalsIgnoreCase("RespawnRestoreMP")) RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
  2061. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsDwarf")) MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(pValue);
  2062. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsOther")) MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(pValue);
  2063. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsDwarf")) MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(pValue);
  2064. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsOther")) MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(pValue);
  2065. else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  2066. else if (pName.equalsIgnoreCase("SubclassStoreSkillCooltime")) SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  2067. else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(pValue);
  2068. else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.parseBoolean(pValue);
  2069. else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.parseBoolean(pValue);
  2070. else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
  2071. else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
  2072. else if (pName.equalsIgnoreCase("AltGameCreationRareXpSpRate")) ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(pValue);
  2073. else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
  2074. else if (pName.equalsIgnoreCase("AltWeightLimit")) ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
  2075. else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes")) ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(pValue);
  2076. else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(pValue);
  2077. else if (pName.equalsIgnoreCase("RemoveCastleCirclets")) REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
  2078. else if (pName.equalsIgnoreCase("ReputationScorePerKill")) REPUTATION_SCORE_PER_KILL = Integer.parseInt(pValue);
  2079. else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
  2080. {
  2081. ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
  2082. ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
  2083. }
  2084. else if (pName.equalsIgnoreCase("AltShieldBlocks")) ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(pValue);
  2085. else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
  2086. else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.parseBoolean(pValue);
  2087. else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(pValue);
  2088. else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone")) ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  2089. else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
  2090. else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
  2091. else if (pName.equalsIgnoreCase("AllowClassMasters")) ALLOW_CLASS_MASTERS = Boolean.parseBoolean(pValue);
  2092. else if (pName.equalsIgnoreCase("AltGameFreights")) ALT_GAME_FREIGHTS = Boolean.parseBoolean(pValue);
  2093. else if (pName.equalsIgnoreCase("AltGameFreightPrice")) ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue);
  2094. else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
  2095. else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
  2096. else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.parseBoolean(pValue);
  2097. else if (pName.equalsIgnoreCase("CraftMasterwork")) CRAFT_MASTERWORK = Boolean.parseBoolean(pValue);
  2098. else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
  2099. else if (pName.equalsIgnoreCase("SpBookNeeded")) SP_BOOK_NEEDED = Boolean.parseBoolean(pValue);
  2100. else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.parseBoolean(pValue);
  2101. else if (pName.equalsIgnoreCase("AutoLootRaids")) AUTO_LOOT_RAIDS = Boolean.parseBoolean(pValue);
  2102. else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);
  2103. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  2104. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(pValue);
  2105. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(pValue);
  2106. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pValue);
  2107. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pValue);
  2108. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pValue);
  2109. else if (pName.equalsIgnoreCase("MaxPersonalFamePoints")) MAX_PERSONAL_FAME_POINTS = Integer.parseInt(pValue);
  2110. else if (pName.equalsIgnoreCase("FortressZoneFameTaskFrequency")) FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  2111. else if (pName.equalsIgnoreCase("FortressZoneFameAquirePoints")) FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  2112. else if (pName.equalsIgnoreCase("CastleZoneFameTaskFrequency")) CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  2113. else if (pName.equalsIgnoreCase("CastleZoneFameAquirePoints")) CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  2114. else if (pName.equalsIgnoreCase("AltCastleForDawn")) ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(pValue);
  2115. else if (pName.equalsIgnoreCase("AltCastleForDusk")) ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(pValue);
  2116. else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(pValue);
  2117. else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(pValue);
  2118. else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
  2119. else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
  2120. else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
  2121. else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
  2122. else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(pValue);
  2123. else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
  2124. else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
  2125. else if (pName.equalsIgnoreCase("ChampionMaxLevel")) L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
  2126. else if (pName.equalsIgnoreCase("ChampionHp")) L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
  2127. else if (pName.equalsIgnoreCase("ChampionHpRegen")) L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
  2128. else if (pName.equalsIgnoreCase("ChampionRewards")) L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
  2129. else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(pValue);
  2130. else if (pName.equalsIgnoreCase("ChampionAtk")) L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
  2131. else if (pName.equalsIgnoreCase("ChampionSpdAtk")) L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
  2132. else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance")) L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  2133. else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance")) L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  2134. else if (pName.equalsIgnoreCase("ChampionRewardItemID")) L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
  2135. else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
  2136. else if (pName.equalsIgnoreCase("AllowWedding")) L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(pValue);
  2137. else if (pName.equalsIgnoreCase("WeddingPrice")) L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
  2138. else if (pName.equalsIgnoreCase("WeddingPunishInfidelity")) L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
  2139. else if (pName.equalsIgnoreCase("WeddingTeleport")) L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
  2140. else if (pName.equalsIgnoreCase("WeddingTeleportPrice")) L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
  2141. else if (pName.equalsIgnoreCase("WeddingTeleportDuration")) L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
  2142. else if (pName.equalsIgnoreCase("WeddingAllowSameSex")) L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
  2143. else if (pName.equalsIgnoreCase("WeddingFormalWear")) L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
  2144. else if (pName.equalsIgnoreCase("WeddingDivorceCosts")) L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
  2145. else if (pName.equalsIgnoreCase("TvTEventEnabled")) TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  2146. else if (pName.equalsIgnoreCase("TvTEventInterval")) TVT_EVENT_INTERVAL = pValue.split(",");
  2147. else if (pName.equalsIgnoreCase("TvTEventParticipationTime")) TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  2148. else if (pName.equalsIgnoreCase("TvTEventRunningTime")) TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  2149. else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId")) TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  2150. else if (pName.equalsIgnoreCase("EnableWarehouseSortingClan")) L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
  2151. else if (pName.equalsIgnoreCase("EnableWarehouseSortingPrivate")) L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
  2152. else if (pName.equalsIgnoreCase("EnableWarehouseSortingFreight")) L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT = Boolean.parseBoolean(pValue);
  2153. else if (pName.equalsIgnoreCase("EnableManaPotionSupport")) L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(pValue);
  2154. else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
  2155. else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
  2156. else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
  2157. else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);
  2158. else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.parseBoolean(pValue);
  2159. else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pValue);
  2160. else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);
  2161. else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
  2162. else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
  2163. else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
  2164. else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
  2165. else if (pName.equalsIgnoreCase("GMAdminMenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
  2166. else return false;
  2167. return true;
  2168. }
  2169. private Config() { }
  2170. /**
  2171. * Save hexadecimal ID of the server in the properties file.
  2172. * @param string (String) : hexadecimal ID of the server to store
  2173. * @see HEXID_FILE
  2174. * @see saveHexid(String string, String fileName)
  2175. * @link LoginServerThread
  2176. */
  2177. public static void saveHexid(int serverId, String string)
  2178. {
  2179. Config.saveHexid(serverId, string, HEXID_FILE);
  2180. }
  2181. /**
  2182. * Save hexadecimal ID of the server in the properties file.
  2183. * @param hexId (String) : hexadecimal ID of the server to store
  2184. * @param fileName (String) : name of the properties file
  2185. */
  2186. public static void saveHexid(int serverId, String hexId, String fileName)
  2187. {
  2188. try
  2189. {
  2190. Properties hexSetting = new Properties();
  2191. File file = new File(fileName);
  2192. //Create a new empty file only if it doesn't exist
  2193. file.createNewFile();
  2194. OutputStream out = new FileOutputStream(file);
  2195. hexSetting.setProperty("ServerID",String.valueOf(serverId));
  2196. hexSetting.setProperty("HexID",hexId);
  2197. hexSetting.store(out,"the hexID to auth into login");
  2198. out.close();
  2199. }
  2200. catch (Exception e)
  2201. {
  2202. _log.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
  2203. e.printStackTrace();
  2204. }
  2205. }
  2206. /**
  2207. * Loads flood protector configurations.
  2208. *
  2209. * @param properties
  2210. * properties file reader
  2211. */
  2212. private static void loadFloodProtectorConfigs(final Properties properties)
  2213. {
  2214. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4");
  2215. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
  2216. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42");
  2217. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16");
  2218. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100");
  2219. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20");
  2220. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10");
  2221. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
  2222. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1");
  2223. }
  2224. /**
  2225. * Loads single flood protector configuration.
  2226. *
  2227. * @param properties
  2228. * properties file reader
  2229. * @param config
  2230. * flood protector configuration instance
  2231. * @param configString
  2232. * flood protector configuration string that determines for which flood protector
  2233. * configuration should be read
  2234. * @param defaultInterval
  2235. * default flood protector interval
  2236. */
  2237. private static void loadFloodProtectorConfig(final Properties properties,
  2238. final FloodProtectorConfig config, final String configString,
  2239. final String defaultInterval)
  2240. {
  2241. config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval));
  2242. config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False"));
  2243. config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0"));
  2244. config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
  2245. config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0"));
  2246. }
  2247. }