Config.java 180 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126
  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 com.l2jserver;
  16. import gnu.trove.TIntArrayList;
  17. import gnu.trove.TIntFloatHashMap;
  18. import gnu.trove.TIntIntHashMap;
  19. import gnu.trove.TIntObjectHashMap;
  20. import java.io.BufferedReader;
  21. import java.io.File;
  22. import java.io.FileInputStream;
  23. import java.io.FileOutputStream;
  24. import java.io.FileReader;
  25. import java.io.InputStream;
  26. import java.io.LineNumberReader;
  27. import java.io.OutputStream;
  28. import java.math.BigInteger;
  29. import java.util.ArrayList;
  30. import java.util.Arrays;
  31. import java.util.List;
  32. import java.util.StringTokenizer;
  33. import java.util.logging.Logger;
  34. import com.l2jserver.gameserver.util.FloodProtectorConfig;
  35. import com.l2jserver.util.L2Properties;
  36. import com.l2jserver.util.StringUtil;
  37. public final class Config
  38. {
  39. protected static final Logger _log = Logger.getLogger(Config.class.getName());
  40. //--------------------------------------------------
  41. // L2J Property File Definitions
  42. //--------------------------------------------------
  43. public static final String CHARACTER_CONFIG_FILE = "./config/Character.properties";
  44. public static final String EXTENSIONS_CONFIG_FILE = "./config/extensions.properties";
  45. public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
  46. public static final String FORTSIEGE_CONFIGURATION_FILE = "./config/fortsiege.properties";
  47. public static final String GENERAL_CONFIG_FILE = "./config/General.properties";
  48. public static final String HEXID_FILE = "./config/hexid.txt";
  49. public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
  50. public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
  51. public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
  52. public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
  53. public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
  54. public static final String NPC_CONFIG_FILE = "./config/NPC.properties";
  55. public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
  56. public static final String RATES_CONFIG_FILE = "./config/rates.properties";
  57. public static final String CONFIGURATION_FILE = "./config/server.properties";
  58. public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
  59. public static final String TW_CONFIGURATION_FILE = "./config/territorywar.properties";
  60. public static final String TELNET_FILE = "./config/telnet.properties";
  61. public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
  62. public static final String MMO_CONFIG_FILE = "./config/mmo.properties";
  63. public static final String OLYMPIAD_CONFIG_FILE = "./config/olympiad.properties";
  64. public static final String COMMUNITY_CONFIGURATION_FILE = "./config/CommunityServer.properties";
  65. public static final String GRANDBOSS_CONFIG_FILE = "./config/Grandboss.properties";
  66. public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
  67. //--------------------------------------------------
  68. // L2J Variable Definitions
  69. //--------------------------------------------------
  70. public static int MASTERACCESS_LEVEL;
  71. public static int MASTERACCESS_NAME_COLOR;
  72. public static int MASTERACCESS_TITLE_COLOR;
  73. public static boolean ALT_GAME_DELEVEL;
  74. public static double ALT_WEIGHT_LIMIT;
  75. public static int RUN_SPD_BOOST;
  76. public static int DEATH_PENALTY_CHANCE;
  77. public static double RESPAWN_RESTORE_CP;
  78. public static double RESPAWN_RESTORE_HP;
  79. public static double RESPAWN_RESTORE_MP;
  80. public static boolean ALT_GAME_TIREDNESS;
  81. public static boolean ENABLE_MODIFY_SKILL_DURATION;
  82. public static TIntIntHashMap SKILL_DURATION_LIST;
  83. public static boolean ENABLE_MODIFY_SKILL_REUSE;
  84. public static TIntIntHashMap SKILL_REUSE_LIST;
  85. public static boolean AUTO_LEARN_SKILLS;
  86. public static boolean AUTO_LOOT_HERBS;
  87. public static byte BUFFS_MAX_AMOUNT;
  88. public static byte DANCES_MAX_AMOUNT;
  89. public static boolean DANCE_CANCEL_BUFF;
  90. public static boolean DANCE_CONSUME_ADDITIONAL_MP;
  91. public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
  92. public static boolean ALT_GAME_CANCEL_BOW;
  93. public static boolean ALT_GAME_CANCEL_CAST;
  94. public static boolean EFFECT_CANCELING;
  95. public static boolean ALT_GAME_MAGICFAILURES;
  96. public static int PLAYER_FAKEDEATH_UP_PROTECTION;
  97. public static boolean STORE_SKILL_COOLTIME;
  98. public static boolean SUBCLASS_STORE_SKILL_COOLTIME;
  99. public static boolean ALT_GAME_SHIELD_BLOCKS;
  100. public static int ALT_PERFECT_SHLD_BLOCK;
  101. public static boolean ALLOW_CLASS_MASTERS;
  102. public static ClassMasterSettings CLASS_MASTER_SETTINGS;
  103. public static boolean ALLOW_ENTIRE_TREE;
  104. public static boolean ALTERNATE_CLASS_MASTER;
  105. public static boolean LIFE_CRYSTAL_NEEDED;
  106. public static boolean SP_BOOK_NEEDED;
  107. public static boolean ES_SP_BOOK_NEEDED;
  108. public static boolean DIVINE_SP_BOOK_NEEDED;
  109. public static boolean ALT_GAME_SKILL_LEARN;
  110. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  111. public static boolean ALT_GAME_SUBCLASS_EVERYWHERE;
  112. public static int MAX_RUN_SPEED;
  113. public static int MAX_PCRIT_RATE;
  114. public static int MAX_MCRIT_RATE;
  115. public static int MAX_PATK_SPEED;
  116. public static int MAX_MATK_SPEED;
  117. public static int MAX_EVASION;
  118. public static byte MAX_SUBCLASS;
  119. public static byte MAX_SUBCLASS_LEVEL;
  120. public static int MAX_PVTSTORESELL_SLOTS_DWARF;
  121. public static int MAX_PVTSTORESELL_SLOTS_OTHER;
  122. public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
  123. public static int MAX_PVTSTOREBUY_SLOTS_OTHER;
  124. public static int INVENTORY_MAXIMUM_NO_DWARF;
  125. public static int INVENTORY_MAXIMUM_DWARF;
  126. public static int INVENTORY_MAXIMUM_GM;
  127. public static int WAREHOUSE_SLOTS_DWARF;
  128. public static int WAREHOUSE_SLOTS_NO_DWARF;
  129. public static int WAREHOUSE_SLOTS_CLAN;
  130. public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
  131. public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
  132. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
  133. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
  134. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
  135. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
  136. public static int MAX_PERSONAL_FAME_POINTS;
  137. public static int FORTRESS_ZONE_FAME_TASK_FREQUENCY;
  138. public static int FORTRESS_ZONE_FAME_AQUIRE_POINTS;
  139. public static int CASTLE_ZONE_FAME_TASK_FREQUENCY;
  140. public static int CASTLE_ZONE_FAME_AQUIRE_POINTS;
  141. public static boolean FAME_FOR_DEAD_PLAYERS;
  142. public static boolean IS_CRAFTING_ENABLED;
  143. public static boolean CRAFT_MASTERWORK;
  144. public static int DWARF_RECIPE_LIMIT;
  145. public static int COMMON_RECIPE_LIMIT;
  146. public static boolean ALT_GAME_CREATION;
  147. public static double ALT_GAME_CREATION_SPEED;
  148. public static double ALT_GAME_CREATION_XP_RATE;
  149. public static double ALT_GAME_CREATION_RARE_XPSP_RATE;
  150. public static double ALT_GAME_CREATION_SP_RATE;
  151. public static boolean ALT_BLACKSMITH_USE_RECIPES;
  152. public static int ALT_CLAN_JOIN_DAYS;
  153. public static int ALT_CLAN_CREATE_DAYS;
  154. public static int ALT_CLAN_DISSOLVE_DAYS;
  155. public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
  156. public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
  157. public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
  158. public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
  159. public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
  160. public static int ALT_CLAN_MEMBERS_FOR_WAR;
  161. public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
  162. public static boolean REMOVE_CASTLE_CIRCLETS;
  163. public static int ALT_PARTY_RANGE;
  164. public static int ALT_PARTY_RANGE2;
  165. public static long STARTING_ADENA;
  166. public static byte STARTING_LEVEL;
  167. public static int STARTING_SP;
  168. public static boolean AUTO_LOOT;
  169. public static boolean AUTO_LOOT_RAIDS;
  170. public static int LOOT_RAIDS_PRIVILEGE_INTERVAL;
  171. public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE;
  172. public static int UNSTUCK_INTERVAL;
  173. public static int TELEPORT_WATCHDOG_TIMEOUT;
  174. public static int PLAYER_SPAWN_PROTECTION;
  175. public static ArrayList<Integer> SPAWN_PROTECTION_ALLOWED_ITEMS;
  176. public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED;
  177. public static boolean OFFSET_ON_TELEPORT_ENABLED;
  178. public static int MAX_OFFSET_ON_TELEPORT;
  179. public static boolean RESTORE_PLAYER_INSTANCE;
  180. public static boolean ALLOW_SUMMON_TO_INSTANCE;
  181. public static boolean PETITIONING_ALLOWED;
  182. public static int MAX_PETITIONS_PER_PLAYER;
  183. public static int MAX_PETITIONS_PENDING;
  184. public static boolean ALT_GAME_FREE_TELEPORT;
  185. public static boolean ALT_RECOMMEND;
  186. public static int DELETE_DAYS;
  187. public static float ALT_GAME_EXPONENT_XP;
  188. public static float ALT_GAME_EXPONENT_SP;
  189. public static String PARTY_XP_CUTOFF_METHOD;
  190. public static double PARTY_XP_CUTOFF_PERCENT;
  191. public static int PARTY_XP_CUTOFF_LEVEL;
  192. public static boolean DISABLE_TUTORIAL;
  193. public static boolean EXPERTISE_PENALTY;
  194. public static boolean STORE_RECIPE_SHOPLIST;
  195. public static boolean STORE_UI_SETTINGS;
  196. //--------------------------------------------------
  197. // ClanHall Settings
  198. //--------------------------------------------------
  199. public static long CH_TELE_FEE_RATIO;
  200. public static int CH_TELE1_FEE;
  201. public static int CH_TELE2_FEE;
  202. public static long CH_ITEM_FEE_RATIO;
  203. public static int CH_ITEM1_FEE;
  204. public static int CH_ITEM2_FEE;
  205. public static int CH_ITEM3_FEE;
  206. public static long CH_MPREG_FEE_RATIO;
  207. public static int CH_MPREG1_FEE;
  208. public static int CH_MPREG2_FEE;
  209. public static int CH_MPREG3_FEE;
  210. public static int CH_MPREG4_FEE;
  211. public static int CH_MPREG5_FEE;
  212. public static long CH_HPREG_FEE_RATIO;
  213. public static int CH_HPREG1_FEE;
  214. public static int CH_HPREG2_FEE;
  215. public static int CH_HPREG3_FEE;
  216. public static int CH_HPREG4_FEE;
  217. public static int CH_HPREG5_FEE;
  218. public static int CH_HPREG6_FEE;
  219. public static int CH_HPREG7_FEE;
  220. public static int CH_HPREG8_FEE;
  221. public static int CH_HPREG9_FEE;
  222. public static int CH_HPREG10_FEE;
  223. public static int CH_HPREG11_FEE;
  224. public static int CH_HPREG12_FEE;
  225. public static int CH_HPREG13_FEE;
  226. public static long CH_EXPREG_FEE_RATIO;
  227. public static int CH_EXPREG1_FEE;
  228. public static int CH_EXPREG2_FEE;
  229. public static int CH_EXPREG3_FEE;
  230. public static int CH_EXPREG4_FEE;
  231. public static int CH_EXPREG5_FEE;
  232. public static int CH_EXPREG6_FEE;
  233. public static int CH_EXPREG7_FEE;
  234. public static long CH_SUPPORT_FEE_RATIO;
  235. public static int CH_SUPPORT1_FEE;
  236. public static int CH_SUPPORT2_FEE;
  237. public static int CH_SUPPORT3_FEE;
  238. public static int CH_SUPPORT4_FEE;
  239. public static int CH_SUPPORT5_FEE;
  240. public static int CH_SUPPORT6_FEE;
  241. public static int CH_SUPPORT7_FEE;
  242. public static int CH_SUPPORT8_FEE;
  243. public static long CH_CURTAIN_FEE_RATIO;
  244. public static int CH_CURTAIN1_FEE;
  245. public static int CH_CURTAIN2_FEE;
  246. public static long CH_FRONT_FEE_RATIO;
  247. public static int CH_FRONT1_FEE;
  248. public static int CH_FRONT2_FEE;
  249. //--------------------------------------------------
  250. // Castle Settings
  251. //--------------------------------------------------
  252. public static long CS_TELE_FEE_RATIO;
  253. public static int CS_TELE1_FEE;
  254. public static int CS_TELE2_FEE;
  255. public static long CS_MPREG_FEE_RATIO;
  256. public static int CS_MPREG1_FEE;
  257. public static int CS_MPREG2_FEE;
  258. public static int CS_MPREG3_FEE;
  259. public static int CS_MPREG4_FEE;
  260. public static long CS_HPREG_FEE_RATIO;
  261. public static int CS_HPREG1_FEE;
  262. public static int CS_HPREG2_FEE;
  263. public static int CS_HPREG3_FEE;
  264. public static int CS_HPREG4_FEE;
  265. public static int CS_HPREG5_FEE;
  266. public static long CS_EXPREG_FEE_RATIO;
  267. public static int CS_EXPREG1_FEE;
  268. public static int CS_EXPREG2_FEE;
  269. public static int CS_EXPREG3_FEE;
  270. public static int CS_EXPREG4_FEE;
  271. public static long CS_SUPPORT_FEE_RATIO;
  272. public static int CS_SUPPORT1_FEE;
  273. public static int CS_SUPPORT2_FEE;
  274. public static int CS_SUPPORT3_FEE;
  275. public static int CS_SUPPORT4_FEE;
  276. public static List<String> CL_SET_SIEGE_TIME_LIST;
  277. public static List<Integer> SIEGE_HOUR_LIST_MORNING;
  278. public static List<Integer> SIEGE_HOUR_LIST_AFTERNOON;
  279. //--------------------------------------------------
  280. // Fortress Settings
  281. //--------------------------------------------------
  282. public static long FS_TELE_FEE_RATIO;
  283. public static int FS_TELE1_FEE;
  284. public static int FS_TELE2_FEE;
  285. public static long FS_MPREG_FEE_RATIO;
  286. public static int FS_MPREG1_FEE;
  287. public static int FS_MPREG2_FEE;
  288. public static long FS_HPREG_FEE_RATIO;
  289. public static int FS_HPREG1_FEE;
  290. public static int FS_HPREG2_FEE;
  291. public static long FS_EXPREG_FEE_RATIO;
  292. public static int FS_EXPREG1_FEE;
  293. public static int FS_EXPREG2_FEE;
  294. public static long FS_SUPPORT_FEE_RATIO;
  295. public static int FS_SUPPORT1_FEE;
  296. public static int FS_SUPPORT2_FEE;
  297. public static int FS_BLOOD_OATH_COUNT;
  298. public static int FS_BLOOD_OATH_FRQ;
  299. //--------------------------------------------------
  300. // Feature Settings
  301. //--------------------------------------------------
  302. public static int TAKE_FORT_POINTS;
  303. public static int LOOSE_FORT_POINTS;
  304. public static int TAKE_CASTLE_POINTS;
  305. public static int LOOSE_CASTLE_POINTS;
  306. public static int CASTLE_DEFENDED_POINTS;
  307. public static int FESTIVAL_WIN_POINTS;
  308. public static int HERO_POINTS;
  309. public static int ROYAL_GUARD_COST;
  310. public static int KNIGHT_UNIT_COST;
  311. public static int KNIGHT_REINFORCE_COST;
  312. public static int BALLISTA_POINTS;
  313. public static int BLOODALLIANCE_POINTS;
  314. public static int BLOODOATH_POINTS;
  315. public static int KNIGHTSEPAULETTE_POINTS;
  316. public static int REPUTATION_SCORE_PER_KILL;
  317. public static int JOIN_ACADEMY_MIN_REP_SCORE;
  318. public static int JOIN_ACADEMY_MAX_REP_SCORE;
  319. public static int RAID_RANKING_1ST;
  320. public static int RAID_RANKING_2ND;
  321. public static int RAID_RANKING_3RD;
  322. public static int RAID_RANKING_4TH;
  323. public static int RAID_RANKING_5TH;
  324. public static int RAID_RANKING_6TH;
  325. public static int RAID_RANKING_7TH;
  326. public static int RAID_RANKING_8TH;
  327. public static int RAID_RANKING_9TH;
  328. public static int RAID_RANKING_10TH;
  329. public static int RAID_RANKING_UP_TO_50TH;
  330. public static int RAID_RANKING_UP_TO_100TH;
  331. public static int CLAN_LEVEL_6_COST;
  332. public static int CLAN_LEVEL_7_COST;
  333. public static int CLAN_LEVEL_8_COST;
  334. public static int CLAN_LEVEL_9_COST;
  335. public static int CLAN_LEVEL_10_COST;
  336. public static int CLAN_LEVEL_11_COST;
  337. public static int CLAN_LEVEL_6_REQUIREMENT;
  338. public static int CLAN_LEVEL_7_REQUIREMENT;
  339. public static int CLAN_LEVEL_8_REQUIREMENT;
  340. public static int CLAN_LEVEL_9_REQUIREMENT;
  341. public static int CLAN_LEVEL_10_REQUIREMENT;
  342. public static int CLAN_LEVEL_11_REQUIREMENT;
  343. public static boolean ALLOW_WYVERN_DURING_SIEGE;
  344. //--------------------------------------------------
  345. // General Settings
  346. //--------------------------------------------------
  347. public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
  348. public static boolean DISPLAY_SERVER_VERSION;
  349. public static boolean SERVER_LIST_BRACKET;
  350. public static boolean SERVER_LIST_CLOCK;
  351. public static boolean SERVER_GMONLY;
  352. public static boolean GM_HERO_AURA;
  353. public static boolean GM_STARTUP_INVULNERABLE;
  354. public static boolean GM_STARTUP_INVISIBLE;
  355. public static boolean GM_STARTUP_SILENCE;
  356. public static boolean GM_STARTUP_AUTO_LIST;
  357. public static boolean GM_STARTUP_DIET_MODE;
  358. public static String GM_ADMIN_MENU_STYLE;
  359. public static boolean GM_ITEM_RESTRICTION;
  360. public static boolean GM_SKILL_RESTRICTION;
  361. public static boolean GM_TRADE_RESTRICTED_ITEMS;
  362. public static boolean GM_RESTART_FIGHTING;
  363. public static boolean GM_ANNOUNCER_NAME;
  364. public static boolean GM_GIVE_SPECIAL_SKILLS;
  365. public static boolean BYPASS_VALIDATION;
  366. public static boolean GAMEGUARD_ENFORCE;
  367. public static boolean GAMEGUARD_PROHIBITACTION;
  368. public static boolean LOG_CHAT;
  369. public static boolean LOG_ITEMS;
  370. public static boolean LOG_ITEM_ENCHANTS;
  371. public static boolean LOG_SKILL_ENCHANTS;
  372. public static boolean GMAUDIT;
  373. public static boolean LOG_GAME_DAMAGE;
  374. public static int LOG_GAME_DAMAGE_THRESHOLD;
  375. public static boolean DEBUG;
  376. public static boolean PACKET_HANDLER_DEBUG;
  377. public static boolean DEVELOPER;
  378. public static boolean ACCEPT_GEOEDITOR_CONN;
  379. public static boolean TEST_SERVER;
  380. public static boolean ALT_DEV_NO_HANDLERS;
  381. public static boolean ALT_DEV_NO_QUESTS;
  382. public static boolean ALT_DEV_NO_SPAWNS;
  383. public static boolean SERVER_LIST_TESTSERVER;
  384. public static int THREAD_P_EFFECTS;
  385. public static int THREAD_P_GENERAL;
  386. public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  387. public static int IO_PACKET_THREAD_CORE_SIZE;
  388. public static int GENERAL_THREAD_CORE_SIZE;
  389. public static int AI_MAX_THREAD;
  390. public static boolean DEADLOCK_DETECTOR;
  391. public static int DEADLOCK_CHECK_INTERVAL;
  392. public static boolean RESTART_ON_DEADLOCK;
  393. public static boolean ALLOW_DISCARDITEM;
  394. public static int AUTODESTROY_ITEM_AFTER;
  395. public static int HERB_AUTO_DESTROY_TIME;
  396. public static TIntArrayList LIST_PROTECTED_ITEMS;
  397. public static int CHAR_STORE_INTERVAL;
  398. public static boolean LAZY_ITEMS_UPDATE;
  399. public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
  400. public static boolean DESTROY_DROPPED_PLAYER_ITEM;
  401. public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
  402. public static boolean SAVE_DROPPED_ITEM;
  403. public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
  404. public static int SAVE_DROPPED_ITEM_INTERVAL;
  405. public static boolean CLEAR_DROPPED_ITEM_TABLE;
  406. public static boolean AUTODELETE_INVALID_QUEST_DATA;
  407. public static boolean PRECISE_DROP_CALCULATION;
  408. public static boolean MULTIPLE_ITEM_DROP;
  409. public static boolean FORCE_INVENTORY_UPDATE;
  410. public static boolean LAZY_CACHE;
  411. public static boolean CACHE_CHAR_NAMES;
  412. public static int MIN_NPC_ANIMATION;
  413. public static int MAX_NPC_ANIMATION;
  414. public static int MIN_MONSTER_ANIMATION;
  415. public static int MAX_MONSTER_ANIMATION;
  416. public static int COORD_SYNCHRONIZE;
  417. public static boolean ENABLE_FALLING_DAMAGE;
  418. public static boolean GRIDS_ALWAYS_ON;
  419. public static int GRID_NEIGHBOR_TURNON_TIME;
  420. public static int GRID_NEIGHBOR_TURNOFF_TIME;
  421. public static int WORLD_X_MIN;
  422. public static int WORLD_X_MAX;
  423. public static int WORLD_Y_MIN;
  424. public static int WORLD_Y_MAX;
  425. public static int GEODATA;
  426. public static boolean GEODATA_CELLFINDING;
  427. public static String PATHFIND_BUFFERS;
  428. public static float LOW_WEIGHT;
  429. public static float MEDIUM_WEIGHT;
  430. public static float HIGH_WEIGHT;
  431. public static boolean ADVANCED_DIAGONAL_STRATEGY;
  432. public static float DIAGONAL_WEIGHT;
  433. public static int MAX_POSTFILTER_PASSES;
  434. public static boolean DEBUG_PATH;
  435. public static boolean FORCE_GEODATA;
  436. public static boolean MOVE_BASED_KNOWNLIST;
  437. public static long KNOWNLIST_UPDATE_INTERVAL;
  438. public static int ZONE_TOWN;
  439. public static boolean ACTIVATE_POSITION_RECORDER;
  440. public static String DEFAULT_GLOBAL_CHAT;
  441. public static String DEFAULT_TRADE_CHAT;
  442. public static boolean ALLOW_WAREHOUSE;
  443. public static boolean WAREHOUSE_CACHE;
  444. public static int WAREHOUSE_CACHE_TIME;
  445. public static boolean ALLOW_REFUND;
  446. public static boolean ALLOW_MAIL;
  447. public static boolean ALLOW_ATTACHMENTS;
  448. public static boolean ALLOW_WEAR;
  449. public static int WEAR_DELAY;
  450. public static int WEAR_PRICE;
  451. public static boolean ALLOW_LOTTERY;
  452. public static boolean ALLOW_RACE;
  453. public static boolean ALLOW_WATER;
  454. public static boolean ALLOW_RENTPET;
  455. public static boolean ALLOWFISHING;
  456. public static boolean ALLOW_BOAT;
  457. public static int BOAT_BROADCAST_RADIUS;
  458. public static boolean ALLOW_CURSED_WEAPONS;
  459. public static boolean ALLOW_MANOR;
  460. public static boolean ALLOW_NPC_WALKERS;
  461. public static boolean ALLOW_PET_WALKERS;
  462. public static boolean SERVER_NEWS;
  463. public static int COMMUNITY_TYPE;
  464. public static boolean BBS_SHOW_PLAYERLIST;
  465. public static String BBS_DEFAULT;
  466. public static boolean SHOW_LEVEL_COMMUNITYBOARD;
  467. public static boolean SHOW_STATUS_COMMUNITYBOARD;
  468. public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
  469. public static int NAME_PER_ROW_COMMUNITYBOARD;
  470. public static boolean USE_SAY_FILTER;
  471. public static String CHAT_FILTER_CHARS;
  472. public static int ALT_OLY_START_TIME;
  473. public static int ALT_OLY_MIN;
  474. public static long ALT_OLY_CPERIOD;
  475. public static long ALT_OLY_BATTLE;
  476. public static long ALT_OLY_WPERIOD;
  477. public static long ALT_OLY_VPERIOD;
  478. public static int ALT_OLY_CLASSED;
  479. public static int ALT_OLY_NONCLASSED;
  480. public static int ALT_OLY_REG_DISPLAY;
  481. public static int ALT_OLY_BATTLE_REWARD_ITEM;
  482. public static int ALT_OLY_CLASSED_RITEM_C;
  483. public static int ALT_OLY_NONCLASSED_RITEM_C;
  484. public static int ALT_OLY_COMP_RITEM;
  485. public static int ALT_OLY_GP_PER_POINT;
  486. public static int ALT_OLY_HERO_POINTS;
  487. public static int ALT_OLY_RANK1_POINTS;
  488. public static int ALT_OLY_RANK2_POINTS;
  489. public static int ALT_OLY_RANK3_POINTS;
  490. public static int ALT_OLY_RANK4_POINTS;
  491. public static int ALT_OLY_RANK5_POINTS;
  492. public static int ALT_OLY_MAX_POINTS;
  493. public static boolean ALT_OLY_LOG_FIGHTS;
  494. public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
  495. public static boolean ALT_OLY_ANNOUNCE_GAMES;
  496. public static TIntArrayList LIST_OLY_RESTRICTED_ITEMS;
  497. public static int ALT_OLY_ENCHANT_LIMIT;
  498. public static byte ALT_OLY_WAIT_TIME;
  499. public static int ALT_MANOR_REFRESH_TIME;
  500. public static int ALT_MANOR_REFRESH_MIN;
  501. public static int ALT_MANOR_APPROVE_TIME;
  502. public static int ALT_MANOR_APPROVE_MIN;
  503. public static int ALT_MANOR_MAINTENANCE_PERIOD;
  504. public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
  505. public static int ALT_MANOR_SAVE_PERIOD_RATE;
  506. public static long ALT_LOTTERY_PRIZE;
  507. public static long ALT_LOTTERY_TICKET_PRICE;
  508. public static float ALT_LOTTERY_5_NUMBER_RATE;
  509. public static float ALT_LOTTERY_4_NUMBER_RATE;
  510. public static float ALT_LOTTERY_3_NUMBER_RATE;
  511. public static long ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
  512. public static int FS_TIME_ATTACK;
  513. public static int FS_TIME_COOLDOWN;
  514. public static int FS_TIME_ENTRY;
  515. public static int FS_TIME_WARMUP;
  516. public static int FS_PARTY_MEMBER_COUNT;
  517. public static int RIFT_MIN_PARTY_SIZE;
  518. public static int RIFT_SPAWN_DELAY;
  519. public static int RIFT_MAX_JUMPS;
  520. public static int RIFT_AUTO_JUMPS_TIME_MIN;
  521. public static int RIFT_AUTO_JUMPS_TIME_MAX;
  522. public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
  523. public static int RIFT_ENTER_COST_RECRUIT;
  524. public static int RIFT_ENTER_COST_SOLDIER;
  525. public static int RIFT_ENTER_COST_OFFICER;
  526. public static int RIFT_ENTER_COST_CAPTAIN;
  527. public static int RIFT_ENTER_COST_COMMANDER;
  528. public static int RIFT_ENTER_COST_HERO;
  529. public static int DEFAULT_PUNISH;
  530. public static int DEFAULT_PUNISH_PARAM;
  531. public static boolean ONLY_GM_ITEMS_FREE;
  532. public static boolean JAIL_IS_PVP;
  533. public static boolean JAIL_DISABLE_CHAT;
  534. public static boolean JAIL_DISABLE_TRANSACTION;
  535. public static boolean CUSTOM_SPAWNLIST_TABLE;
  536. public static boolean SAVE_GMSPAWN_ON_CUSTOM;
  537. public static boolean DELETE_GMSPAWN_ON_CUSTOM;
  538. public static boolean CUSTOM_NPC_TABLE;
  539. public static boolean CUSTOM_NPC_SKILLS_TABLE;
  540. public static boolean CUSTOM_ITEM_TABLES;
  541. public static boolean CUSTOM_ARMORSETS_TABLE;
  542. public static boolean CUSTOM_TELEPORT_TABLE;
  543. public static boolean CUSTOM_DROPLIST_TABLE;
  544. public static boolean CUSTOM_MERCHANT_TABLES;
  545. public static boolean CUSTOM_NPCBUFFER_TABLES;
  546. //--------------------------------------------------
  547. // FloodProtector Settings
  548. //--------------------------------------------------
  549. public static FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM;
  550. public static FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE;
  551. public static FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK;
  552. public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON;
  553. public static FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE;
  554. public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
  555. public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS;
  556. public static FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM;
  557. public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS;
  558. public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
  559. public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
  560. public static FloodProtectorConfig FLOOD_PROTECTOR_SENDMAIL;
  561. //--------------------------------------------------
  562. // L2JMods Settings
  563. //--------------------------------------------------
  564. public static boolean L2JMOD_CHAMPION_ENABLE;
  565. public static boolean L2JMOD_CHAMPION_PASSIVE;
  566. public static int L2JMOD_CHAMPION_FREQUENCY;
  567. public static String L2JMOD_CHAMP_TITLE;
  568. public static int L2JMOD_CHAMP_MIN_LVL;
  569. public static int L2JMOD_CHAMP_MAX_LVL;
  570. public static int L2JMOD_CHAMPION_HP;
  571. public static int L2JMOD_CHAMPION_REWARDS;
  572. public static float L2JMOD_CHAMPION_ADENAS_REWARDS;
  573. public static float L2JMOD_CHAMPION_HP_REGEN;
  574. public static float L2JMOD_CHAMPION_ATK;
  575. public static float L2JMOD_CHAMPION_SPD_ATK;
  576. public static int L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
  577. public static int L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
  578. public static int L2JMOD_CHAMPION_REWARD_ID;
  579. public static int L2JMOD_CHAMPION_REWARD_QTY;
  580. public static boolean L2JMOD_CHAMPION_ENABLE_VITALITY;
  581. public static boolean L2JMOD_CHAMPION_ENABLE_IN_INSTANCES;
  582. public static boolean TVT_EVENT_ENABLED;
  583. public static boolean TVT_EVENT_IN_INSTANCE;
  584. public static String TVT_EVENT_INSTANCE_FILE;
  585. public static String[] TVT_EVENT_INTERVAL;
  586. public static int TVT_EVENT_PARTICIPATION_TIME;
  587. public static int TVT_EVENT_RUNNING_TIME;
  588. public static int TVT_EVENT_PARTICIPATION_NPC_ID;
  589. public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  590. public static int[] TVT_EVENT_PARTICIPATION_FEE = new int[2];
  591. public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
  592. public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
  593. public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
  594. public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
  595. public static String TVT_EVENT_TEAM_1_NAME;
  596. public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  597. public static String TVT_EVENT_TEAM_2_NAME;
  598. public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  599. public static List<int[]> TVT_EVENT_REWARDS;
  600. public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  601. public static boolean TVT_EVENT_SCROLL_ALLOWED;
  602. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  603. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  604. public static List<Integer> TVT_DOORS_IDS_TO_OPEN;
  605. public static List<Integer> TVT_DOORS_IDS_TO_CLOSE;
  606. public static boolean TVT_REWARD_TEAM_TIE;
  607. public static byte TVT_EVENT_MIN_LVL;
  608. public static byte TVT_EVENT_MAX_LVL;
  609. public static int TVT_EVENT_EFFECTS_REMOVAL;
  610. public static TIntIntHashMap TVT_EVENT_FIGHTER_BUFFS;
  611. public static TIntIntHashMap TVT_EVENT_MAGE_BUFFS;
  612. public static boolean TVT_ALLOW_VOICED_COMMAND;
  613. public static boolean L2JMOD_ALLOW_WEDDING;
  614. public static int L2JMOD_WEDDING_PRICE;
  615. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  616. public static boolean L2JMOD_WEDDING_TELEPORT;
  617. public static int L2JMOD_WEDDING_TELEPORT_PRICE;
  618. public static int L2JMOD_WEDDING_TELEPORT_DURATION;
  619. public static boolean L2JMOD_WEDDING_SAMESEX;
  620. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  621. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  622. public static boolean BANKING_SYSTEM_ENABLED;
  623. public static int BANKING_SYSTEM_GOLDBARS;
  624. public static int BANKING_SYSTEM_ADENA;
  625. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
  626. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
  627. public static boolean OFFLINE_TRADE_ENABLE;
  628. public static boolean OFFLINE_CRAFT_ENABLE;
  629. public static boolean RESTORE_OFFLINERS;
  630. public static int OFFLINE_MAX_DAYS;
  631. public static boolean OFFLINE_DISCONNECT_FINISHED;
  632. public static boolean OFFLINE_SET_NAME_COLOR;
  633. public static int OFFLINE_NAME_COLOR;
  634. public static boolean OFFLINE_FAME;
  635. public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
  636. public static boolean L2JMOD_DISPLAY_SERVER_TIME;
  637. public static boolean WELCOME_MESSAGE_ENABLED;
  638. public static String WELCOME_MESSAGE_TEXT;
  639. public static int WELCOME_MESSAGE_TIME;
  640. public static boolean L2JMOD_ANTIFEED_ENABLE;
  641. public static boolean L2JMOD_ANTIFEED_DUALBOX;
  642. public static boolean L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX;
  643. public static int L2JMOD_ANTIFEED_INTERVAL;
  644. public static boolean ANNOUNCE_PK_PVP;
  645. public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE;
  646. public static String ANNOUNCE_PK_MSG;
  647. public static String ANNOUNCE_PVP_MSG;
  648. public static boolean L2JMOD_CHAT_ADMIN;
  649. public static boolean L2JMOD_MULTILANG_ENABLE;
  650. public static List<String> L2JMOD_MULTILANG_ALLOWED = new ArrayList<String>();
  651. public static String L2JMOD_MULTILANG_DEFAULT;
  652. public static boolean L2JMOD_MULTILANG_VOICED_ALLOW;
  653. public static boolean L2WALKER_PROTECTION;
  654. //--------------------------------------------------
  655. // NPC Settings
  656. //--------------------------------------------------
  657. public static boolean ANNOUNCE_MAMMON_SPAWN;
  658. public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
  659. public static boolean ALT_ATTACKABLE_NPCS;
  660. public static boolean ALT_GAME_VIEWNPC;
  661. public static int MAX_DRIFT_RANGE;
  662. public static boolean DEEPBLUE_DROP_RULES;
  663. public static boolean DEEPBLUE_DROP_RULES_RAID;
  664. public static boolean SHOW_NPC_LVL;
  665. public static boolean SHOW_CREST_WITHOUT_QUEST;
  666. public static boolean ENABLE_RANDOM_ENCHANT_EFFECT;
  667. public static int MIN_NPC_LVL_DMG_PENALTY;
  668. public static int MIN_NPC_LVL_MAGIC_PENALTY;
  669. public static boolean GUARD_ATTACK_AGGRO_MOB;
  670. public static boolean ALLOW_WYVERN_UPGRADER;
  671. public static TIntArrayList LIST_PET_RENT_NPC;
  672. public static double RAID_HP_REGEN_MULTIPLIER;
  673. public static double RAID_MP_REGEN_MULTIPLIER;
  674. public static double RAID_PDEFENCE_MULTIPLIER;
  675. public static double RAID_MDEFENCE_MULTIPLIER;
  676. public static double RAID_PATTACK_MULTIPLIER;
  677. public static double RAID_MATTACK_MULTIPLIER;
  678. public static double RAID_MINION_RESPAWN_TIMER;
  679. public static float RAID_MIN_RESPAWN_MULTIPLIER;
  680. public static float RAID_MAX_RESPAWN_MULTIPLIER;
  681. public static boolean RAID_DISABLE_CURSE;
  682. public static int RAID_CHAOS_TIME;
  683. public static int GRAND_CHAOS_TIME;
  684. public static int MINION_CHAOS_TIME;
  685. public static int INVENTORY_MAXIMUM_PET;
  686. public static double PET_HP_REGEN_MULTIPLIER;
  687. public static double PET_MP_REGEN_MULTIPLIER;
  688. //--------------------------------------------------
  689. // PvP Settings
  690. //--------------------------------------------------
  691. public static int KARMA_MIN_KARMA;
  692. public static int KARMA_MAX_KARMA;
  693. public static int KARMA_XP_DIVIDER;
  694. public static int KARMA_LOST_BASE;
  695. public static boolean KARMA_DROP_GM;
  696. public static boolean KARMA_AWARD_PK_KILL;
  697. public static int KARMA_PK_LIMIT;
  698. public static String KARMA_NONDROPPABLE_PET_ITEMS;
  699. public static String KARMA_NONDROPPABLE_ITEMS;
  700. public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS;
  701. public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
  702. //--------------------------------------------------
  703. // Rate Settings
  704. //--------------------------------------------------
  705. public static float RATE_XP;
  706. public static float RATE_SP;
  707. public static float RATE_PARTY_XP;
  708. public static float RATE_PARTY_SP;
  709. public static float RATE_CONSUMABLE_COST;
  710. public static float RATE_EXTR_FISH;
  711. public static float RATE_DROP_ITEMS;
  712. public static float RATE_DROP_ITEMS_BY_RAID;
  713. public static float RATE_DROP_SPOIL;
  714. public static int RATE_DROP_MANOR;
  715. public static float RATE_QUEST_DROP;
  716. public static float RATE_QUEST_REWARD;
  717. public static float RATE_QUEST_REWARD_XP;
  718. public static float RATE_QUEST_REWARD_SP;
  719. public static float RATE_QUEST_REWARD_ADENA;
  720. public static boolean RATE_QUEST_REWARD_USE_MULTIPLIERS;
  721. public static float RATE_QUEST_REWARD_POTION;
  722. public static float RATE_QUEST_REWARD_SCROLL;
  723. public static float RATE_QUEST_REWARD_RECIPE;
  724. public static float RATE_QUEST_REWARD_MATERIAL;
  725. public static TIntFloatHashMap RATE_DROP_ITEMS_ID;
  726. public static float RATE_KARMA_EXP_LOST;
  727. public static float RATE_SIEGE_GUARDS_PRICE;
  728. public static float RATE_DROP_COMMON_HERBS;
  729. public static float RATE_DROP_MP_HP_HERBS;
  730. public static float RATE_DROP_GREATER_HERBS;
  731. public static float RATE_DROP_SUPERIOR_HERBS;
  732. public static float RATE_DROP_SPECIAL_HERBS;
  733. public static int PLAYER_DROP_LIMIT;
  734. public static int PLAYER_RATE_DROP;
  735. public static int PLAYER_RATE_DROP_ITEM;
  736. public static int PLAYER_RATE_DROP_EQUIP;
  737. public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
  738. public static float PET_XP_RATE;
  739. public static int PET_FOOD_RATE;
  740. public static float SINEATER_XP_RATE;
  741. public static int KARMA_DROP_LIMIT;
  742. public static int KARMA_RATE_DROP;
  743. public static int KARMA_RATE_DROP_ITEM;
  744. public static int KARMA_RATE_DROP_EQUIP;
  745. public static int KARMA_RATE_DROP_EQUIP_WEAPON;
  746. public static double[] PLAYER_XP_PERCENT_LOST;
  747. //--------------------------------------------------
  748. // Seven Signs Settings
  749. //--------------------------------------------------
  750. public static boolean ALT_GAME_CASTLE_DAWN;
  751. public static boolean ALT_GAME_CASTLE_DUSK;
  752. public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
  753. public static int ALT_FESTIVAL_MIN_PLAYER;
  754. public static int ALT_MAXIMUM_PLAYER_CONTRIB;
  755. public static long ALT_FESTIVAL_MANAGER_START;
  756. public static long ALT_FESTIVAL_LENGTH;
  757. public static long ALT_FESTIVAL_CYCLE_LENGTH;
  758. public static long ALT_FESTIVAL_FIRST_SPAWN;
  759. public static long ALT_FESTIVAL_FIRST_SWARM;
  760. public static long ALT_FESTIVAL_SECOND_SPAWN;
  761. public static long ALT_FESTIVAL_SECOND_SWARM;
  762. public static long ALT_FESTIVAL_CHEST_SPAWN;
  763. public static double ALT_SIEGE_DAWN_GATES_PDEF_MULT;
  764. public static double ALT_SIEGE_DUSK_GATES_PDEF_MULT;
  765. public static double ALT_SIEGE_DAWN_GATES_MDEF_MULT;
  766. public static double ALT_SIEGE_DUSK_GATES_MDEF_MULT;
  767. public static boolean ALT_STRICT_SEVENSIGNS;
  768. public static boolean ALT_SEVENSIGNS_LAZY_UPDATE;
  769. //--------------------------------------------------
  770. // Server Settings
  771. //--------------------------------------------------
  772. public static int PORT_GAME;
  773. public static int PORT_LOGIN;
  774. public static String LOGIN_BIND_ADDRESS;
  775. public static int LOGIN_TRY_BEFORE_BAN;
  776. public static int LOGIN_BLOCK_AFTER_BAN;
  777. public static String GAMESERVER_HOSTNAME;
  778. public static String DATABASE_DRIVER;
  779. public static String DATABASE_URL;
  780. public static String DATABASE_LOGIN;
  781. public static String DATABASE_PASSWORD;
  782. public static int DATABASE_MAX_CONNECTIONS;
  783. public static int DATABASE_MAX_IDLE_TIME;
  784. public static int MAXIMUM_ONLINE_USERS;
  785. public static String CNAME_TEMPLATE;
  786. public static String PET_NAME_TEMPLATE;
  787. public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
  788. public static File DATAPACK_ROOT;
  789. public static boolean ACCEPT_ALTERNATE_ID;
  790. public static int REQUEST_ID;
  791. public static boolean RESERVE_HOST_ON_LOGIN = false;
  792. public static TIntArrayList PROTOCOL_LIST;
  793. public static boolean LOG_LOGIN_CONTROLLER;
  794. //--------------------------------------------------
  795. // CommunityServer Settings
  796. //--------------------------------------------------
  797. public static boolean ENABLE_COMMUNITY_BOARD;
  798. public static String COMMUNITY_SERVER_ADDRESS;
  799. public static int COMMUNITY_SERVER_PORT;
  800. public static byte[] COMMUNITY_SERVER_HEX_ID;
  801. public static int COMMUNITY_SERVER_SQL_DP_ID;
  802. //--------------------------------------------------
  803. // MMO Settings
  804. //--------------------------------------------------
  805. public static int MMO_SELECTOR_SLEEP_TIME;
  806. public static int MMO_MAX_SEND_PER_PASS;
  807. public static int MMO_MAX_READ_PER_PASS;
  808. public static int MMO_HELPER_BUFFER_COUNT;
  809. //--------------------------------------------------
  810. // Vitality Settings
  811. //--------------------------------------------------
  812. public static boolean ENABLE_VITALITY;
  813. public static boolean RECOVER_VITALITY_ON_RECONNECT;
  814. public static boolean ENABLE_DROP_VITALITY_HERBS;
  815. public static float RATE_VITALITY_LEVEL_1;
  816. public static float RATE_VITALITY_LEVEL_2;
  817. public static float RATE_VITALITY_LEVEL_3;
  818. public static float RATE_VITALITY_LEVEL_4;
  819. public static float RATE_DROP_VITALITY_HERBS;
  820. public static float RATE_RECOVERY_VITALITY_PEACE_ZONE;
  821. public static float RATE_VITALITY_LOST;
  822. public static float RATE_VITALITY_GAIN;
  823. public static float RATE_RECOVERY_ON_RECONNECT;
  824. public static int STARTING_VITALITY_POINTS;
  825. //--------------------------------------------------
  826. // No classification assigned to the following yet
  827. //--------------------------------------------------
  828. public static int MAX_ITEM_IN_PACKET;
  829. public static boolean CHECK_KNOWN;
  830. public static int GAME_SERVER_LOGIN_PORT;
  831. public static String GAME_SERVER_LOGIN_HOST;
  832. public static String INTERNAL_HOSTNAME;
  833. public static String EXTERNAL_HOSTNAME;
  834. public static String ROUTER_HOSTNAME;
  835. public static int NEW_NODE_ID;
  836. public static int SELECTED_NODE_ID;
  837. public static int LINKED_NODE_ID;
  838. public static String NEW_NODE_TYPE;
  839. public static int IP_UPDATE_TIME;
  840. public static String SERVER_VERSION;
  841. public static String SERVER_BUILD_DATE;
  842. public static String DATAPACK_VERSION;
  843. public static int PVP_NORMAL_TIME;
  844. public static int PVP_PVP_TIME;
  845. public static enum IdFactoryType
  846. {
  847. Compaction,
  848. BitSet,
  849. Stack
  850. }
  851. public static IdFactoryType IDFACTORY_TYPE;
  852. public static boolean BAD_ID_CHECKING;
  853. public static enum ObjectMapType
  854. {
  855. L2ObjectHashMap,
  856. WorldObjectMap
  857. }
  858. public static enum ObjectSetType
  859. {
  860. L2ObjectHashSet,
  861. WorldObjectSet
  862. }
  863. public static ObjectMapType MAP_TYPE;
  864. public static ObjectSetType SET_TYPE;
  865. public static int ENCHANT_CHANCE_WEAPON;
  866. public static int ENCHANT_CHANCE_ARMOR;
  867. public static int ENCHANT_CHANCE_JEWELRY;
  868. public static int ENCHANT_CHANCE_ELEMENT;
  869. public static int BLESSED_ENCHANT_CHANCE_WEAPON;
  870. public static int BLESSED_ENCHANT_CHANCE_ARMOR;
  871. public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
  872. public static int ENCHANT_MAX_WEAPON;
  873. public static int ENCHANT_MAX_ARMOR;
  874. public static int ENCHANT_MAX_JEWELRY;
  875. public static int ENCHANT_SAFE_MAX;
  876. public static int ENCHANT_SAFE_MAX_FULL;
  877. public static int AUGMENTATION_NG_SKILL_CHANCE;
  878. public static int AUGMENTATION_NG_GLOW_CHANCE;
  879. public static int AUGMENTATION_MID_SKILL_CHANCE;
  880. public static int AUGMENTATION_MID_GLOW_CHANCE;
  881. public static int AUGMENTATION_HIGH_SKILL_CHANCE;
  882. public static int AUGMENTATION_HIGH_GLOW_CHANCE;
  883. public static int AUGMENTATION_TOP_SKILL_CHANCE;
  884. public static int AUGMENTATION_TOP_GLOW_CHANCE;
  885. public static int AUGMENTATION_BASESTAT_CHANCE;
  886. public static int AUGMENTATION_ACC_SKILL_CHANCE;
  887. public static int[] AUGMENTATION_BLACKLIST;
  888. public static double HP_REGEN_MULTIPLIER;
  889. public static double MP_REGEN_MULTIPLIER;
  890. public static double CP_REGEN_MULTIPLIER;
  891. public static boolean IS_TELNET_ENABLED;
  892. public static boolean SHOW_LICENCE;
  893. public static boolean FORCE_GGAUTH;
  894. public static boolean ACCEPT_NEW_GAMESERVER;
  895. public static int SERVER_ID;
  896. public static byte[] HEX_ID;
  897. public static boolean AUTO_CREATE_ACCOUNTS;
  898. public static boolean FLOOD_PROTECTION;
  899. public static int FAST_CONNECTION_LIMIT;
  900. public static int NORMAL_CONNECTION_TIME;
  901. public static int FAST_CONNECTION_TIME;
  902. public static int MAX_CONNECTION_PER_IP;
  903. // GrandBoss Settings
  904. public static int Antharas_Wait_Time;
  905. public static int Valakas_Wait_Time;
  906. public static int Interval_Of_Antharas_Spawn;
  907. public static int Random_Of_Antharas_Spawn;
  908. public static int Interval_Of_Valakas_Spawn;
  909. public static int Random_Of_Valakas_Spawn;
  910. public static int Interval_Of_Baium_Spawn;
  911. public static int Random_Of_Baium_Spawn;
  912. public static int Interval_Of_Core_Spawn;
  913. public static int Random_Of_Core_Spawn;
  914. public static int Interval_Of_Orfen_Spawn;
  915. public static int Random_Of_Orfen_Spawn;
  916. public static int Interval_Of_QueenAnt_Spawn;
  917. public static int Random_Of_QueenAnt_Spawn;
  918. public static int Interval_Of_Zaken_Spawn;
  919. public static int Random_Of_Zaken_Spawn;
  920. public static int Interval_Of_Frintezza_Spawn;
  921. public static int Random_Of_Frintezza_Spawn;
  922. //chatfilter
  923. public static ArrayList<String> FILTER_LIST;
  924. /**
  925. * This class initializes all global variables for configuration.<br>
  926. * If the key doesn't appear in properties file, a default value is set by this class.
  927. * @see CONFIGURATION_FILE (properties file) for configuring your server.
  928. */
  929. public static void load()
  930. {
  931. if(Server.serverMode == Server.MODE_GAMESERVER)
  932. {
  933. FLOOD_PROTECTOR_USE_ITEM =
  934. new FloodProtectorConfig("UseItemFloodProtector");
  935. FLOOD_PROTECTOR_ROLL_DICE =
  936. new FloodProtectorConfig("RollDiceFloodProtector");
  937. FLOOD_PROTECTOR_FIREWORK =
  938. new FloodProtectorConfig("FireworkFloodProtector");
  939. FLOOD_PROTECTOR_ITEM_PET_SUMMON =
  940. new FloodProtectorConfig("ItemPetSummonFloodProtector");
  941. FLOOD_PROTECTOR_HERO_VOICE =
  942. new FloodProtectorConfig("HeroVoiceFloodProtector");
  943. FLOOD_PROTECTOR_GLOBAL_CHAT =
  944. new FloodProtectorConfig("GlobalChatFloodProtector");
  945. FLOOD_PROTECTOR_SUBCLASS =
  946. new FloodProtectorConfig("SubclassFloodProtector");
  947. FLOOD_PROTECTOR_DROP_ITEM =
  948. new FloodProtectorConfig("DropItemFloodProtector");
  949. FLOOD_PROTECTOR_SERVER_BYPASS =
  950. new FloodProtectorConfig("ServerBypassFloodProtector");
  951. FLOOD_PROTECTOR_MULTISELL =
  952. new FloodProtectorConfig("MultiSellFloodProtector");
  953. FLOOD_PROTECTOR_TRANSACTION =
  954. new FloodProtectorConfig("TransactionFloodProtector");
  955. FLOOD_PROTECTOR_SENDMAIL =
  956. new FloodProtectorConfig("SendMailFloodProtector");
  957. _log.info("Loading GameServer Configuration Files...");
  958. InputStream is = null;
  959. try
  960. {
  961. try
  962. {
  963. L2Properties serverSettings = new L2Properties();
  964. is = new FileInputStream(new File(CONFIGURATION_FILE));
  965. serverSettings.load(is);
  966. GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
  967. PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
  968. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
  969. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
  970. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
  971. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");
  972. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  973. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  974. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  975. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  976. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  977. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  978. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  979. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  980. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  981. CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
  982. PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
  983. MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
  984. MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
  985. String[] protocols = serverSettings.getProperty("AllowedProtocolRevisions", "146;152").split(";");
  986. PROTOCOL_LIST = new TIntArrayList(protocols.length);
  987. for (String protocol : protocols)
  988. {
  989. try
  990. {
  991. PROTOCOL_LIST.add(Integer.parseInt(protocol.trim()));
  992. }
  993. catch(NumberFormatException e)
  994. {
  995. _log.info("Wrong config protocol version: "+protocol+". Skipped.");
  996. }
  997. }
  998. }
  999. catch (Exception e)
  1000. {
  1001. e.printStackTrace();
  1002. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  1003. }
  1004. // Load Community Properties file (if exists)
  1005. try
  1006. {
  1007. L2Properties communityServerSettings = new L2Properties();
  1008. is = new FileInputStream(new File(COMMUNITY_CONFIGURATION_FILE));
  1009. communityServerSettings.load(is);
  1010. ENABLE_COMMUNITY_BOARD = Boolean.parseBoolean(communityServerSettings.getProperty("EnableCommunityBoard", "False"));
  1011. COMMUNITY_SERVER_ADDRESS = communityServerSettings.getProperty("CommunityServerHostname", "localhost");
  1012. COMMUNITY_SERVER_PORT = Integer.parseInt(communityServerSettings.getProperty("CommunityServerPort", "9013"));
  1013. COMMUNITY_SERVER_HEX_ID = new BigInteger(communityServerSettings.getProperty("CommunityServerHexId"), 16).toByteArray();
  1014. COMMUNITY_SERVER_SQL_DP_ID = Integer.parseInt(communityServerSettings.getProperty("CommunityServerSqlDpId", "200"));
  1015. }
  1016. catch (Exception e)
  1017. {
  1018. e.printStackTrace();
  1019. throw new Error("Failed to Load "+COMMUNITY_CONFIGURATION_FILE+" File.");
  1020. }
  1021. // Load Feature L2Properties file (if exists)
  1022. try
  1023. {
  1024. L2Properties Feature = new L2Properties();
  1025. is = new FileInputStream(new File(FEATURE_CONFIG_FILE));
  1026. Feature.load(is);
  1027. CH_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallTeleportFunctionFeeRatio", "604800000"));
  1028. CH_TELE1_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "7000"));
  1029. CH_TELE2_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "14000"));
  1030. CH_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallSupportFunctionFeeRatio", "86400000"));
  1031. CH_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl1", "2500"));
  1032. CH_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl2", "5000"));
  1033. CH_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl3", "7000"));
  1034. CH_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl4", "11000"));
  1035. CH_SUPPORT5_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl5", "21000"));
  1036. CH_SUPPORT6_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl6", "36000"));
  1037. CH_SUPPORT7_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl7", "37000"));
  1038. CH_SUPPORT8_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl8", "52000"));
  1039. CH_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRatio", "86400000"));
  1040. CH_MPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "2000"));
  1041. CH_MPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "3750"));
  1042. CH_MPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "6500"));
  1043. CH_MPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "13750"));
  1044. CH_MPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "20000"));
  1045. CH_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRatio", "86400000"));
  1046. CH_HPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "700"));
  1047. CH_HPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "800"));
  1048. CH_HPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "1000"));
  1049. CH_HPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "1166"));
  1050. CH_HPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "1500"));
  1051. CH_HPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "1750"));
  1052. CH_HPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "2000"));
  1053. CH_HPREG8_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "2250"));
  1054. CH_HPREG9_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "2500"));
  1055. CH_HPREG10_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "3250"));
  1056. CH_HPREG11_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "3270"));
  1057. CH_HPREG12_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "4250"));
  1058. CH_HPREG13_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "5166"));
  1059. CH_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRatio", "86400000"));
  1060. CH_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "3000"));
  1061. CH_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "6000"));
  1062. CH_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "9000"));
  1063. CH_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "15000"));
  1064. CH_EXPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "21000"));
  1065. CH_EXPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "23330"));
  1066. CH_EXPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "30000"));
  1067. CH_ITEM_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallItemCreationFunctionFeeRatio", "86400000"));
  1068. CH_ITEM1_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "30000"));
  1069. CH_ITEM2_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "70000"));
  1070. CH_ITEM3_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "140000"));
  1071. CH_CURTAIN_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallCurtainFunctionFeeRatio", "604800000"));
  1072. CH_CURTAIN1_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "2000"));
  1073. CH_CURTAIN2_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "2500"));
  1074. CH_FRONT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRatio", "259200000"));
  1075. CH_FRONT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "1300"));
  1076. CH_FRONT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "4000"));
  1077. CL_SET_SIEGE_TIME_LIST = new ArrayList<String>();
  1078. SIEGE_HOUR_LIST_MORNING = new ArrayList<Integer>();
  1079. SIEGE_HOUR_LIST_AFTERNOON = new ArrayList<Integer>();
  1080. String[] sstl = Feature.getProperty("CLSetSiegeTimeList", "").split(",");
  1081. if (sstl.length != 0)
  1082. {
  1083. boolean isHour = false;
  1084. for (String st : sstl)
  1085. {
  1086. if (st.equalsIgnoreCase("day") || st.equalsIgnoreCase("hour") || st.equalsIgnoreCase("minute"))
  1087. {
  1088. if (st.equalsIgnoreCase("hour")) isHour = true;
  1089. CL_SET_SIEGE_TIME_LIST.add(st.toLowerCase());
  1090. }
  1091. else
  1092. {
  1093. _log.warning(StringUtil.concat("[CLSetSiegeTimeList]: invalid config property -> CLSetSiegeTimeList \"", st, "\""));
  1094. }
  1095. }
  1096. if (isHour)
  1097. {
  1098. String[] shl = Feature.getProperty("SiegeHourList", "").split(",");
  1099. for (String st : shl)
  1100. {
  1101. if (!st.equalsIgnoreCase(""))
  1102. {
  1103. int val = Integer.parseInt(st);
  1104. if (val > 23 || val < 0)
  1105. _log.warning(StringUtil.concat("[SiegeHourList]: invalid config property -> SiegeHourList \"", st, "\""));
  1106. else if (val < 12)
  1107. SIEGE_HOUR_LIST_MORNING.add(val);
  1108. else
  1109. {
  1110. val -= 12;
  1111. SIEGE_HOUR_LIST_AFTERNOON.add(val);
  1112. }
  1113. }
  1114. }
  1115. if (Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty() && Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty())
  1116. {
  1117. _log.warning("[SiegeHourList]: invalid config property -> SiegeHourList is empty");
  1118. CL_SET_SIEGE_TIME_LIST.remove("hour");
  1119. }
  1120. }
  1121. }
  1122. CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
  1123. CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
  1124. CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
  1125. CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
  1126. CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
  1127. CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
  1128. CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
  1129. CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
  1130. CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
  1131. CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
  1132. CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
  1133. CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
  1134. CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
  1135. CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
  1136. CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
  1137. CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
  1138. CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
  1139. CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl4", "3270"));
  1140. CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl5", "5166"));
  1141. CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
  1142. CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
  1143. CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
  1144. CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
  1145. CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));
  1146. FS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressTeleportFunctionFeeRatio", "604800000"));
  1147. FS_TELE1_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl1", "1000"));
  1148. FS_TELE2_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl2", "10000"));
  1149. FS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressSupportFunctionFeeRatio", "86400000"));
  1150. FS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl1", "7000"));
  1151. FS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl2", "17000"));
  1152. FS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressMpRegenerationFunctionFeeRatio", "86400000"));
  1153. FS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl1", "6500"));
  1154. FS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl2", "9300"));
  1155. FS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressHpRegenerationFunctionFeeRatio", "86400000"));
  1156. FS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl1", "2000"));
  1157. FS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl2", "3500"));
  1158. FS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressExpRegenerationFunctionFeeRatio", "86400000"));
  1159. FS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl1", "9000"));
  1160. FS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl2", "10000"));
  1161. FS_BLOOD_OATH_COUNT = Integer.parseInt(Feature.getProperty("FortressBloodOathCount", "1"));
  1162. FS_BLOOD_OATH_FRQ = Integer.parseInt(Feature.getProperty("FortressBloodOathFrequency", "360"));
  1163. ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltCastleForDawn", "True"));
  1164. ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(Feature.getProperty("AltCastleForDusk", "True"));
  1165. ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
  1166. ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
  1167. ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
  1168. ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
  1169. ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
  1170. ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
  1171. ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
  1172. ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));
  1173. ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
  1174. ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
  1175. ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
  1176. ALT_SIEGE_DAWN_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesPdefMult", "1.1"));
  1177. ALT_SIEGE_DUSK_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesPdefMult", "0.8"));
  1178. ALT_SIEGE_DAWN_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesMdefMult", "1.1"));
  1179. ALT_SIEGE_DUSK_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesMdefMult", "0.8"));
  1180. ALT_STRICT_SEVENSIGNS = Boolean.parseBoolean(Feature.getProperty("StrictSevenSigns", "True"));
  1181. ALT_SEVENSIGNS_LAZY_UPDATE = Boolean.parseBoolean(Feature.getProperty("AltSevenSignsLazyUpdate", "True"));
  1182. TAKE_FORT_POINTS = Integer.parseInt(Feature.getProperty("TakeFortPoints", "200"));
  1183. LOOSE_FORT_POINTS = Integer.parseInt(Feature.getProperty("LooseFortPoints", "0"));
  1184. TAKE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("TakeCastlePoints", "1500"));
  1185. LOOSE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("LooseCastlePoints", "3000"));
  1186. CASTLE_DEFENDED_POINTS = Integer.parseInt(Feature.getProperty("CastleDefendedPoints", "750"));
  1187. FESTIVAL_WIN_POINTS = Integer.parseInt(Feature.getProperty("FestivalOfDarknessWin", "200"));
  1188. HERO_POINTS = Integer.parseInt(Feature.getProperty("HeroPoints", "1000"));
  1189. ROYAL_GUARD_COST = Integer.parseInt(Feature.getProperty("CreateRoyalGuardCost", "5000"));
  1190. KNIGHT_UNIT_COST = Integer.parseInt(Feature.getProperty("CreateKnightUnitCost", "10000"));
  1191. KNIGHT_REINFORCE_COST = Integer.parseInt(Feature.getProperty("ReinforceKnightUnitCost", "5000"));
  1192. BALLISTA_POINTS = Integer.parseInt(Feature.getProperty("KillBallistaPoints", "30"));
  1193. BLOODALLIANCE_POINTS = Integer.parseInt(Feature.getProperty("BloodAlliancePoints", "500"));
  1194. BLOODOATH_POINTS = Integer.parseInt(Feature.getProperty("BloodOathPoints", "200"));
  1195. KNIGHTSEPAULETTE_POINTS = Integer.parseInt(Feature.getProperty("KnightsEpaulettePoints", "20"));
  1196. REPUTATION_SCORE_PER_KILL = Integer.parseInt(Feature.getProperty("ReputationScorePerKill", "1"));
  1197. JOIN_ACADEMY_MIN_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMinPoints", "190"));
  1198. JOIN_ACADEMY_MAX_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMaxPoints", "650"));
  1199. RAID_RANKING_1ST = Integer.parseInt(Feature.getProperty("1stRaidRankingPoints", "1250"));
  1200. RAID_RANKING_2ND = Integer.parseInt(Feature.getProperty("2ndRaidRankingPoints", "900"));
  1201. RAID_RANKING_3RD = Integer.parseInt(Feature.getProperty("3rdRaidRankingPoints", "700"));
  1202. RAID_RANKING_4TH = Integer.parseInt(Feature.getProperty("4thRaidRankingPoints", "600"));
  1203. RAID_RANKING_5TH = Integer.parseInt(Feature.getProperty("5thRaidRankingPoints", "450"));
  1204. RAID_RANKING_6TH = Integer.parseInt(Feature.getProperty("6thRaidRankingPoints", "350"));
  1205. RAID_RANKING_7TH = Integer.parseInt(Feature.getProperty("7thRaidRankingPoints", "300"));
  1206. RAID_RANKING_8TH = Integer.parseInt(Feature.getProperty("8thRaidRankingPoints", "200"));
  1207. RAID_RANKING_9TH = Integer.parseInt(Feature.getProperty("9thRaidRankingPoints", "150"));
  1208. RAID_RANKING_10TH = Integer.parseInt(Feature.getProperty("10thRaidRankingPoints", "100"));
  1209. RAID_RANKING_UP_TO_50TH = Integer.parseInt(Feature.getProperty("UpTo50thRaidRankingPoints", "25"));
  1210. RAID_RANKING_UP_TO_100TH = Integer.parseInt(Feature.getProperty("UpTo100thRaidRankingPoints", "12"));
  1211. CLAN_LEVEL_6_COST = Integer.parseInt(Feature.getProperty("ClanLevel6Cost", "10000"));
  1212. CLAN_LEVEL_7_COST = Integer.parseInt(Feature.getProperty("ClanLevel7Cost", "20000"));
  1213. CLAN_LEVEL_8_COST = Integer.parseInt(Feature.getProperty("ClanLevel8Cost", "40000"));
  1214. CLAN_LEVEL_9_COST = Integer.parseInt(Feature.getProperty("ClanLevel9Cost", "40000"));
  1215. CLAN_LEVEL_10_COST = Integer.parseInt(Feature.getProperty("ClanLevel10Cost", "40000"));
  1216. CLAN_LEVEL_11_COST = Integer.parseInt(Feature.getProperty("ClanLevel11Cost", "75000"));
  1217. CLAN_LEVEL_6_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel6Requirement", "30"));
  1218. CLAN_LEVEL_7_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel7Requirement", "80"));
  1219. CLAN_LEVEL_8_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel8Requirement", "120"));
  1220. CLAN_LEVEL_9_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel9Requirement", "120"));
  1221. CLAN_LEVEL_10_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel10Requirement", "140"));
  1222. CLAN_LEVEL_11_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel11Requirement", "170"));
  1223. ALLOW_WYVERN_DURING_SIEGE = Boolean.parseBoolean(Feature.getProperty("AllowRideWyvernDuringSiege", "True"));
  1224. }
  1225. catch (Exception e)
  1226. {
  1227. e.printStackTrace();
  1228. throw new Error("Failed to Load "+FEATURE_CONFIG_FILE+" File.");
  1229. }
  1230. // Load Character L2Properties file (if exists)
  1231. try
  1232. {
  1233. L2Properties Character = new L2Properties();
  1234. is = new FileInputStream(new File(CHARACTER_CONFIG_FILE));
  1235. Character.load(is);
  1236. MASTERACCESS_LEVEL = Integer.parseInt(Character.getProperty("MasterAccessLevel", "127"));
  1237. MASTERACCESS_NAME_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterNameColor", "00FF00")));
  1238. MASTERACCESS_TITLE_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterTitleColor", "00FF00")));
  1239. ALT_GAME_DELEVEL = Boolean.parseBoolean(Character.getProperty("Delevel", "true"));
  1240. ALT_WEIGHT_LIMIT = Double.parseDouble(Character.getProperty("AltWeightLimit", "1"));
  1241. RUN_SPD_BOOST = Integer.parseInt(Character.getProperty("RunSpeedBoost", "0"));
  1242. DEATH_PENALTY_CHANCE = Integer.parseInt(Character.getProperty("DeathPenaltyChance", "20"));
  1243. RESPAWN_RESTORE_CP = Double.parseDouble(Character.getProperty("RespawnRestoreCP", "0")) / 100;
  1244. RESPAWN_RESTORE_HP = Double.parseDouble(Character.getProperty("RespawnRestoreHP", "70")) / 100;
  1245. RESPAWN_RESTORE_MP = Double.parseDouble(Character.getProperty("RespawnRestoreMP", "70")) / 100;
  1246. HP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("HpRegenMultiplier", "100")) /100;
  1247. MP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("MpRegenMultiplier", "100")) /100;
  1248. CP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("CpRegenMultiplier", "100")) /100;
  1249. ALT_GAME_TIREDNESS = Boolean.parseBoolean(Character.getProperty("AltGameTiredness", "false"));
  1250. ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(Character.getProperty("EnableModifySkillDuration", "false"));
  1251. // Create Map only if enabled
  1252. if (ENABLE_MODIFY_SKILL_DURATION)
  1253. {
  1254. String[] propertySplit = Character.getProperty("SkillDurationList", "").split(";");
  1255. SKILL_DURATION_LIST = new TIntIntHashMap(propertySplit.length);
  1256. for (String skill : propertySplit)
  1257. {
  1258. String[] skillSplit = skill.split(",");
  1259. if (skillSplit.length != 2)
  1260. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillDurationList \"", skill, "\""));
  1261. else
  1262. {
  1263. try
  1264. {
  1265. SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  1266. }
  1267. catch (NumberFormatException nfe)
  1268. {
  1269. if (!skill.isEmpty())
  1270. {
  1271. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1272. }
  1273. }
  1274. }
  1275. }
  1276. }
  1277. ENABLE_MODIFY_SKILL_REUSE = Boolean.parseBoolean(Character.getProperty("EnableModifySkillReuse", "false"));
  1278. // Create Map only if enabled
  1279. if (ENABLE_MODIFY_SKILL_REUSE)
  1280. {
  1281. String[] propertySplit = Character.getProperty("SkillReuseList", "").split(";");
  1282. SKILL_REUSE_LIST = new TIntIntHashMap(propertySplit.length);
  1283. for (String skill : propertySplit)
  1284. {
  1285. String[] skillSplit = skill.split(",");
  1286. if (skillSplit.length != 2)
  1287. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillReuseList \"", skill, "\""));
  1288. else
  1289. {
  1290. try
  1291. {
  1292. SKILL_REUSE_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
  1293. }
  1294. catch (NumberFormatException nfe)
  1295. {
  1296. if (!skill.isEmpty())
  1297. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1298. }
  1299. }
  1300. }
  1301. }
  1302. AUTO_LEARN_SKILLS = Boolean.parseBoolean(Character.getProperty("AutoLearnSkills", "false"));
  1303. AUTO_LOOT_HERBS = Boolean.parseBoolean(Character.getProperty("AutoLootHerbs", "false"));
  1304. BUFFS_MAX_AMOUNT = Byte.parseByte(Character.getProperty("maxbuffamount","20"));
  1305. DANCES_MAX_AMOUNT = Byte.parseByte(Character.getProperty("maxdanceamount","12"));
  1306. DANCE_CANCEL_BUFF = Boolean.parseBoolean(Character.getProperty("DanceCancelBuff", "false"));
  1307. DANCE_CONSUME_ADDITIONAL_MP = Boolean.parseBoolean(Character.getProperty("DanceConsumeAdditionalMP", "true"));
  1308. AUTO_LEARN_DIVINE_INSPIRATION = Boolean.parseBoolean(Character.getProperty("AutoLearnDivineInspiration", "false"));
  1309. ALT_GAME_CANCEL_BOW = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1310. ALT_GAME_CANCEL_CAST = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1311. EFFECT_CANCELING = Boolean.parseBoolean(Character.getProperty("CancelLesserEffect", "True"));
  1312. ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(Character.getProperty("MagicFailures", "true"));
  1313. PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(Character.getProperty("PlayerFakeDeathUpProtection", "0"));
  1314. STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("StoreSkillCooltime", "true"));
  1315. SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("SubclassStoreSkillCooltime", "false"));
  1316. ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(Character.getProperty("AltShieldBlocks", "false"));
  1317. ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(Character.getProperty("AltPerfectShieldBlockRate", "10"));
  1318. ALLOW_CLASS_MASTERS = Boolean.parseBoolean(Character.getProperty("AllowClassMasters", "False"));
  1319. ALLOW_ENTIRE_TREE = Boolean.parseBoolean(Character.getProperty("AllowEntireTree", "False"));
  1320. ALTERNATE_CLASS_MASTER = Boolean.parseBoolean(Character.getProperty("AlternateClassMaster", "False"));
  1321. if (ALLOW_CLASS_MASTERS || ALTERNATE_CLASS_MASTER)
  1322. CLASS_MASTER_SETTINGS = new ClassMasterSettings(Character.getProperty("ConfigClassMaster"));
  1323. LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(Character.getProperty("LifeCrystalNeeded", "true"));
  1324. SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("SpBookNeeded", "false"));
  1325. ES_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("EnchantSkillSpBookNeeded","true"));
  1326. DIVINE_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("DivineInspirationSpBookNeeded", "true"));
  1327. ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(Character.getProperty("AltGameSkillLearn", "false"));
  1328. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(Character.getProperty("AltSubClassWithoutQuests", "False"));
  1329. ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(Character.getProperty("AltSubclassEverywhere", "False"));
  1330. ENABLE_VITALITY = Boolean.parseBoolean(Character.getProperty("EnableVitality", "True"));
  1331. RECOVER_VITALITY_ON_RECONNECT = Boolean.parseBoolean(Character.getProperty("RecoverVitalityOnReconnect", "True"));
  1332. STARTING_VITALITY_POINTS = Integer.parseInt(Character.getProperty("StartingVitalityPoints", "20000"));
  1333. MAX_RUN_SPEED = Integer.parseInt(Character.getProperty("MaxRunSpeed", "250"));
  1334. MAX_PCRIT_RATE = Integer.parseInt(Character.getProperty("MaxPCritRate", "500"));
  1335. MAX_MCRIT_RATE = Integer.parseInt(Character.getProperty("MaxMCritRate", "200"));
  1336. MAX_PATK_SPEED = Integer.parseInt(Character.getProperty("MaxPAtkSpeed", "1500"));
  1337. MAX_MATK_SPEED = Integer.parseInt(Character.getProperty("MaxMAtkSpeed", "1999"));
  1338. MAX_EVASION = Integer.parseInt(Character.getProperty("MaxEvasion", "200"));
  1339. MAX_SUBCLASS = Byte.parseByte(Character.getProperty("MaxSubclass", "3"));
  1340. MAX_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("MaxSubclassLevel", "80"));
  1341. MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
  1342. MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsOther", "3"));
  1343. MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsDwarf", "5"));
  1344. MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsOther", "4"));
  1345. INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForNoDwarf", "80"));
  1346. INVENTORY_MAXIMUM_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForDwarf", "100"));
  1347. INVENTORY_MAXIMUM_GM = Integer.parseInt(Character.getProperty("MaximumSlotsForGMPlayer", "250"));
  1348. MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
  1349. WAREHOUSE_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
  1350. WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
  1351. WAREHOUSE_SLOTS_CLAN = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForClan", "150"));
  1352. ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("EnchantChanceWeapon", "66"));
  1353. ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("EnchantChanceArmor", "66"));
  1354. ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("EnchantChanceJewelry", "66"));
  1355. ENCHANT_CHANCE_ELEMENT = Integer.parseInt(Character.getProperty("EnchantChanceElement", "50"));
  1356. BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("BlessedEnchantChanceWeapon", "66"));
  1357. BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("BlessedEnchantChanceArmor", "66"));
  1358. BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("BlessedEnchantChanceJewelry", "66"));
  1359. ENCHANT_MAX_WEAPON = Integer.parseInt(Character.getProperty("EnchantMaxWeapon", "0"));
  1360. ENCHANT_MAX_ARMOR = Integer.parseInt(Character.getProperty("EnchantMaxArmor", "0"));
  1361. ENCHANT_MAX_JEWELRY = Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "0"));
  1362. ENCHANT_SAFE_MAX = Integer.parseInt(Character.getProperty("EnchantSafeMax", "3"));
  1363. ENCHANT_SAFE_MAX_FULL = Integer.parseInt(Character.getProperty("EnchantSafeMaxFull", "4"));
  1364. AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGSkillChance", "15"));
  1365. AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGGlowChance", "0"));
  1366. AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidSkillChance", "30"));
  1367. AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidGlowChance", "40"));
  1368. AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighSkillChance", "45"));
  1369. AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighGlowChance", "70"));
  1370. AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopSkillChance", "60"));
  1371. AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopGlowChance", "100"));
  1372. AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(Character.getProperty("AugmentationBaseStatChance", "1"));
  1373. AUGMENTATION_ACC_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationAccSkillChance", "0"));
  1374. String[] array = Character.getProperty("AugmentationBlackList", "6656,6657,6658,6659,6660,6661,6662,8191,10170,10314").split(",");
  1375. AUGMENTATION_BLACKLIST = new int[array.length];
  1376. for (int i = 0; i < array.length; i++)
  1377. AUGMENTATION_BLACKLIST[i] = Integer.parseInt(array[i]);
  1378. Arrays.sort(AUGMENTATION_BLACKLIST);
  1379. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
  1380. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanShop", "true"));
  1381. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTeleport", "true"));
  1382. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseGK", "false"));
  1383. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTrade", "true"));
  1384. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
  1385. MAX_PERSONAL_FAME_POINTS = Integer.parseInt(Character.getProperty("MaxPersonalFamePoints","65535"));
  1386. FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("FortressZoneFameTaskFrequency","300"));
  1387. FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("FortressZoneFameAquirePoints","31"));
  1388. CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("CastleZoneFameTaskFrequency","300"));
  1389. CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("CastleZoneFameAquirePoints","125"));
  1390. FAME_FOR_DEAD_PLAYERS = Boolean.parseBoolean(Character.getProperty("FameForDeadPlayers", "true"));
  1391. IS_CRAFTING_ENABLED = Boolean.parseBoolean(Character.getProperty("CraftingEnabled", "true"));
  1392. CRAFT_MASTERWORK = Boolean.parseBoolean(Character.getProperty("CraftMasterwork", "True"));
  1393. DWARF_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("DwarfRecipeLimit","50"));
  1394. COMMON_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("CommonRecipeLimit","50"));
  1395. ALT_GAME_CREATION = Boolean.parseBoolean(Character.getProperty("AltGameCreation", "false"));
  1396. ALT_GAME_CREATION_SPEED = Double.parseDouble(Character.getProperty("AltGameCreationSpeed", "1"));
  1397. ALT_GAME_CREATION_XP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationXpRate", "1"));
  1398. ALT_GAME_CREATION_SP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationSpRate", "1"));
  1399. ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationRareXpSpRate", "2"));
  1400. ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(Character.getProperty("AltBlacksmithUseRecipes", "true"));
  1401. ALT_CLAN_JOIN_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeJoinAClan", "1"));
  1402. ALT_CLAN_CREATE_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeCreateAClan", "10"));
  1403. ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(Character.getProperty("DaysToPassToDissolveAClan", "7"));
  1404. ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
  1405. ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
  1406. ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
  1407. ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(Character.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "1"));
  1408. ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(Character.getProperty("AltMaxNumOfClansInAlly", "3"));
  1409. ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(Character.getProperty("AltClanMembersForWar", "15"));
  1410. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH= Boolean.parseBoolean(Character.getProperty("AltMembersCanWithdrawFromClanWH", "false"));
  1411. REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(Character.getProperty("RemoveCastleCirclets", "true"));
  1412. ALT_PARTY_RANGE = Integer.parseInt(Character.getProperty("AltPartyRange", "1600"));
  1413. ALT_PARTY_RANGE2 = Integer.parseInt(Character.getProperty("AltPartyRange2", "1400"));
  1414. STARTING_ADENA = Long.parseLong(Character.getProperty("StartingAdena", "0"));
  1415. STARTING_LEVEL = Byte.parseByte(Character.getProperty("StartingLevel", "1"));
  1416. STARTING_SP = Integer.parseInt(Character.getProperty("StartingSP", "0"));
  1417. AUTO_LOOT = Boolean.parseBoolean(Character.getProperty("AutoLoot", "false"));
  1418. AUTO_LOOT_RAIDS = Boolean.parseBoolean(Character.getProperty("AutoLootRaids", "false"));
  1419. LOOT_RAIDS_PRIVILEGE_INTERVAL = Integer.parseInt(Character.getProperty("RaidLootRightsInterval", "900")) * 1000;
  1420. LOOT_RAIDS_PRIVILEGE_CC_SIZE = Integer.parseInt(Character.getProperty("RaidLootRightsCCSize", "45"));
  1421. UNSTUCK_INTERVAL = Integer.parseInt(Character.getProperty("UnstuckInterval", "300"));
  1422. TELEPORT_WATCHDOG_TIMEOUT = Integer.parseInt(Character.getProperty("TeleportWatchdogTimeout", "0"));
  1423. PLAYER_SPAWN_PROTECTION = Integer.parseInt(Character.getProperty("PlayerSpawnProtection", "0"));
  1424. String[] items = Character.getProperty("PlayerSpawnProtectionAllowedItems", "0").split(",");
  1425. SPAWN_PROTECTION_ALLOWED_ITEMS = new ArrayList<Integer>(items.length);
  1426. for(String item : items)
  1427. {
  1428. Integer itm = 0;
  1429. try { itm = Integer.parseInt(item); }
  1430. catch(NumberFormatException nfe)
  1431. {
  1432. _log.warning("Player Spawn Protection: Wrong ItemId passed: "+item);
  1433. _log.warning(nfe.getMessage());
  1434. }
  1435. if(itm != 0)
  1436. SPAWN_PROTECTION_ALLOWED_ITEMS.add(itm);
  1437. }
  1438. SPAWN_PROTECTION_ALLOWED_ITEMS.trimToSize();
  1439. RANDOM_RESPAWN_IN_TOWN_ENABLED = Boolean.parseBoolean(Character.getProperty("RandomRespawnInTownEnabled", "True"));
  1440. OFFSET_ON_TELEPORT_ENABLED = Boolean.parseBoolean(Character.getProperty("OffsetOnTeleportEnabled", "True"));
  1441. MAX_OFFSET_ON_TELEPORT = Integer.parseInt(Character.getProperty("MaxOffsetOnTeleport", "50"));
  1442. RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(Character.getProperty("RestorePlayerInstance", "False"));
  1443. ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(Character.getProperty("AllowSummonToInstance", "True"));
  1444. PETITIONING_ALLOWED = Boolean.parseBoolean(Character.getProperty("PetitioningAllowed", "True"));
  1445. MAX_PETITIONS_PER_PLAYER = Integer.parseInt(Character.getProperty("MaxPetitionsPerPlayer", "5"));
  1446. MAX_PETITIONS_PENDING = Integer.parseInt(Character.getProperty("MaxPetitionsPending", "25"));
  1447. ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltFreeTeleporting", "False"));
  1448. ALT_RECOMMEND = Boolean.parseBoolean(Character.getProperty("AltRecommend", "False"));
  1449. DELETE_DAYS = Integer.parseInt(Character.getProperty("DeleteCharAfterDays", "7"));
  1450. ALT_GAME_EXPONENT_XP = Float.parseFloat(Character.getProperty("AltGameExponentXp", "0."));
  1451. ALT_GAME_EXPONENT_SP = Float.parseFloat(Character.getProperty("AltGameExponentSp", "0."));
  1452. PARTY_XP_CUTOFF_METHOD = Character.getProperty("PartyXpCutoffMethod", "auto");
  1453. PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(Character.getProperty("PartyXpCutoffPercent", "3."));
  1454. PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(Character.getProperty("PartyXpCutoffLevel", "30"));
  1455. DISABLE_TUTORIAL = Boolean.parseBoolean(Character.getProperty("DisableTutorial", "False"));
  1456. EXPERTISE_PENALTY = Boolean.parseBoolean(Character.getProperty("ExpertisePenalty", "True"));
  1457. STORE_RECIPE_SHOPLIST = Boolean.parseBoolean(Character.getProperty("StoreRecipeShopList", "False"));
  1458. STORE_UI_SETTINGS = Boolean.parseBoolean(Character.getProperty("StoreCharUiSettings", "False"));
  1459. }
  1460. catch (Exception e)
  1461. {
  1462. e.printStackTrace();
  1463. throw new Error("Failed to Load "+CHARACTER_CONFIG_FILE+" file.");
  1464. }
  1465. // Load L2J Server Version L2Properties file (if exists)
  1466. try
  1467. {
  1468. L2Properties serverVersion = new L2Properties();
  1469. is = new FileInputStream(new File(SERVER_VERSION_FILE));
  1470. serverVersion.load(is);
  1471. SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1472. SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
  1473. }
  1474. catch (Exception e)
  1475. {
  1476. //Ignore L2Properties file if it doesnt exist
  1477. SERVER_VERSION = "Unsupported Custom Version.";
  1478. SERVER_BUILD_DATE = "Undefined Date.";
  1479. }
  1480. // Load L2J Datapack Version L2Properties file (if exists)
  1481. try
  1482. {
  1483. L2Properties serverVersion = new L2Properties();
  1484. is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
  1485. serverVersion.load(is);
  1486. DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1487. }
  1488. catch (Exception e)
  1489. {
  1490. //Ignore L2Properties file if it doesnt exist
  1491. DATAPACK_VERSION = "Unsupported Custom Version.";
  1492. }
  1493. // Load Telnet L2Properties file (if exists)
  1494. try
  1495. {
  1496. L2Properties telnetSettings = new L2Properties();
  1497. is = new FileInputStream(new File(TELNET_FILE));
  1498. telnetSettings.load(is);
  1499. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  1500. }
  1501. catch (Exception e)
  1502. {
  1503. e.printStackTrace();
  1504. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1505. }
  1506. // MMO
  1507. try
  1508. {
  1509. //_log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  1510. L2Properties mmoSettings = new L2Properties();
  1511. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  1512. mmoSettings.load(is);
  1513. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  1514. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  1515. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  1516. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  1517. }
  1518. catch (Exception e)
  1519. {
  1520. e.printStackTrace();
  1521. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  1522. }
  1523. // Load IdFactory L2Properties file (if exists)
  1524. try
  1525. {
  1526. L2Properties idSettings = new L2Properties();
  1527. is = new FileInputStream(new File(ID_CONFIG_FILE));
  1528. idSettings.load(is);
  1529. MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
  1530. SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
  1531. IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
  1532. BAD_ID_CHECKING = Boolean.parseBoolean(idSettings.getProperty("BadIdChecking", "True"));
  1533. }
  1534. catch (Exception e)
  1535. {
  1536. e.printStackTrace();
  1537. throw new Error("Failed to Load "+ID_CONFIG_FILE+" file.");
  1538. }
  1539. // Load General L2Properties file (if exists)
  1540. try
  1541. {
  1542. L2Properties General = new L2Properties();
  1543. is = new FileInputStream(new File(GENERAL_CONFIG_FILE));
  1544. General.load(is);
  1545. EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(General.getProperty("EverybodyHasAdminRights", "false"));
  1546. DISPLAY_SERVER_VERSION = Boolean.parseBoolean(General.getProperty("DisplayServerRevision","True"));
  1547. SERVER_LIST_BRACKET = Boolean.parseBoolean(General.getProperty("ServerListBrackets", "false"));
  1548. SERVER_LIST_CLOCK = Boolean.parseBoolean(General.getProperty("ServerListClock", "false"));
  1549. SERVER_GMONLY = Boolean.parseBoolean(General.getProperty("ServerGMOnly", "false"));
  1550. GM_HERO_AURA = Boolean.parseBoolean(General.getProperty("GMHeroAura", "False"));
  1551. GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(General.getProperty("GMStartupInvulnerable", "False"));
  1552. GM_STARTUP_INVISIBLE = Boolean.parseBoolean(General.getProperty("GMStartupInvisible", "False"));
  1553. GM_STARTUP_SILENCE = Boolean.parseBoolean(General.getProperty("GMStartupSilence", "False"));
  1554. GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(General.getProperty("GMStartupAutoList", "False"));
  1555. GM_STARTUP_DIET_MODE = Boolean.parseBoolean(General.getProperty("GMStartupDietMode", "False"));
  1556. GM_ADMIN_MENU_STYLE = General.getProperty("GMAdminMenuStyle", "modern");
  1557. GM_ITEM_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMItemRestriction", "True"));
  1558. GM_SKILL_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMSkillRestriction", "True"));
  1559. GM_TRADE_RESTRICTED_ITEMS = Boolean.parseBoolean(General.getProperty("GMTradeRestrictedItems", "False"));
  1560. GM_RESTART_FIGHTING = Boolean.parseBoolean(General.getProperty("GMRestartFighting", "True"));
  1561. GM_ANNOUNCER_NAME = Boolean.parseBoolean(General.getProperty("GMShowAnnouncerName", "False"));
  1562. GM_GIVE_SPECIAL_SKILLS = Boolean.parseBoolean(General.getProperty("GMGiveSpecialSkills", "False"));
  1563. BYPASS_VALIDATION = Boolean.parseBoolean(General.getProperty("BypassValidation", "True"));
  1564. GAMEGUARD_ENFORCE = Boolean.parseBoolean(General.getProperty("GameGuardEnforce", "False"));
  1565. GAMEGUARD_PROHIBITACTION = Boolean.parseBoolean(General.getProperty("GameGuardProhibitAction", "False"));
  1566. LOG_CHAT = Boolean.parseBoolean(General.getProperty("LogChat", "false"));
  1567. LOG_ITEMS = Boolean.parseBoolean(General.getProperty("LogItems", "false"));
  1568. LOG_ITEM_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogItemEnchants", "false"));
  1569. LOG_SKILL_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogSkillEnchants", "false"));
  1570. GMAUDIT = Boolean.parseBoolean(General.getProperty("GMAudit", "False"));
  1571. LOG_GAME_DAMAGE = Boolean.parseBoolean(General.getProperty("LogGameDamage", "False"));
  1572. LOG_GAME_DAMAGE_THRESHOLD = Integer.parseInt(General.getProperty("LogGameDamageThreshold", "5000"));
  1573. DEBUG = Boolean.parseBoolean(General.getProperty("Debug", "false"));
  1574. PACKET_HANDLER_DEBUG = Boolean.parseBoolean(General.getProperty("PacketHandlerDebug", "false"));
  1575. DEVELOPER = Boolean.parseBoolean(General.getProperty("Developer", "false"));
  1576. ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(General.getProperty("AcceptGeoeditorConn", "false"));
  1577. TEST_SERVER = Boolean.parseBoolean(General.getProperty("TestServer", "false"));
  1578. SERVER_LIST_TESTSERVER = Boolean.parseBoolean(General.getProperty("ListTestServers", "false"));
  1579. ALT_DEV_NO_HANDLERS = Boolean.parseBoolean(General.getProperty("AltDevNoHandlers", "False"));
  1580. ALT_DEV_NO_QUESTS = Boolean.parseBoolean(General.getProperty("AltDevNoQuests", "False"));
  1581. ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(General.getProperty("AltDevNoSpawns", "False"));
  1582. THREAD_P_EFFECTS = Integer.parseInt(General.getProperty("ThreadPoolSizeEffects", "10"));
  1583. THREAD_P_GENERAL = Integer.parseInt(General.getProperty("ThreadPoolSizeGeneral", "13"));
  1584. IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("UrgentPacketThreadCoreSize", "2"));
  1585. GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralPacketThreadCoreSize", "4"));
  1586. GENERAL_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralThreadCoreSize", "4"));
  1587. AI_MAX_THREAD = Integer.parseInt(General.getProperty("AiMaxThread", "6"));
  1588. DEADLOCK_DETECTOR = Boolean.parseBoolean(General.getProperty("DeadLockDetector", "False"));
  1589. DEADLOCK_CHECK_INTERVAL = Integer.parseInt(General.getProperty("DeadLockCheckInterval", "20"));
  1590. RESTART_ON_DEADLOCK = Boolean.parseBoolean(General.getProperty("RestartOnDeadlock", "False"));
  1591. ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
  1592. AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600"));
  1593. HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime","60"))*1000;
  1594. String[] split = General.getProperty("ListOfProtectedItems", "0").split(",");
  1595. LIST_PROTECTED_ITEMS = new TIntArrayList(split.length);
  1596. for (String id : split)
  1597. {
  1598. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
  1599. }
  1600. CHAR_STORE_INTERVAL = Integer.parseInt(General.getProperty("CharacterDataStoreInterval", "15"));
  1601. LAZY_ITEMS_UPDATE = Boolean.parseBoolean(General.getProperty("LazyItemsUpdate", "false"));
  1602. UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(General.getProperty("UpdateItemsOnCharStore", "false"));
  1603. DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyPlayerDroppedItem", "false"));
  1604. DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyEquipableItem", "false"));
  1605. SAVE_DROPPED_ITEM = Boolean.parseBoolean(General.getProperty("SaveDroppedItem", "false"));
  1606. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(General.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
  1607. SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(General.getProperty("SaveDroppedItemInterval", "60"))*60000;
  1608. CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(General.getProperty("ClearDroppedItemTable", "false"));
  1609. AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(General.getProperty("AutoDeleteInvalidQuestData", "False"));
  1610. PRECISE_DROP_CALCULATION = Boolean.parseBoolean(General.getProperty("PreciseDropCalculation", "True"));
  1611. MULTIPLE_ITEM_DROP = Boolean.parseBoolean(General.getProperty("MultipleItemDrop", "True"));
  1612. FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(General.getProperty("ForceInventoryUpdate", "False"));
  1613. LAZY_CACHE = Boolean.parseBoolean(General.getProperty("LazyCache", "True"));
  1614. CACHE_CHAR_NAMES = Boolean.parseBoolean(General.getProperty("CacheCharNames", "True"));
  1615. MIN_NPC_ANIMATION = Integer.parseInt(General.getProperty("MinNPCAnimation", "10"));
  1616. MAX_NPC_ANIMATION = Integer.parseInt(General.getProperty("MaxNPCAnimation", "20"));
  1617. MIN_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MinMonsterAnimation", "5"));
  1618. MAX_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MaxMonsterAnimation", "20"));
  1619. MOVE_BASED_KNOWNLIST = Boolean.parseBoolean(General.getProperty("MoveBasedKnownlist", "False"));
  1620. KNOWNLIST_UPDATE_INTERVAL = Long.parseLong(General.getProperty("KnownListUpdateInterval", "1250"));
  1621. GRIDS_ALWAYS_ON = Boolean.parseBoolean(General.getProperty("GridsAlwaysOn", "False"));
  1622. GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOnTime", "1"));
  1623. GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOffTime", "90"));
  1624. WORLD_X_MIN = Integer.parseInt(General.getProperty("WorldXMin", "11"));
  1625. WORLD_X_MAX = Integer.parseInt(General.getProperty("WorldXMax", "26"));
  1626. WORLD_Y_MIN = Integer.parseInt(General.getProperty("WorldYMin", "10"));
  1627. WORLD_Y_MAX = Integer.parseInt(General.getProperty("WorldYMax", "26"));
  1628. GEODATA = Integer.parseInt(General.getProperty("GeoData", "0"));
  1629. GEODATA_CELLFINDING = Boolean.parseBoolean(General.getProperty("CellPathFinding", "False"));
  1630. PATHFIND_BUFFERS = General.getProperty("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
  1631. LOW_WEIGHT = Float.parseFloat(General.getProperty("LowWeight", "0.5"));
  1632. MEDIUM_WEIGHT = Float.parseFloat(General.getProperty("MediumWeight", "2"));
  1633. HIGH_WEIGHT = Float.parseFloat(General.getProperty("HighWeight", "3"));
  1634. ADVANCED_DIAGONAL_STRATEGY = Boolean.parseBoolean(General.getProperty("AdvancedDiagonalStrategy", "True"));
  1635. DIAGONAL_WEIGHT = Float.parseFloat(General.getProperty("DiagonalWeight", "0.707"));
  1636. MAX_POSTFILTER_PASSES = Integer.parseInt(General.getProperty("MaxPostfilterPasses", "3"));
  1637. DEBUG_PATH = Boolean.parseBoolean(General.getProperty("DebugPath", "False"));
  1638. FORCE_GEODATA = Boolean.parseBoolean(General.getProperty("ForceGeodata", "True"));
  1639. COORD_SYNCHRONIZE = Integer.parseInt(General.getProperty("CoordSynchronize", "-1"));
  1640. String str = General.getProperty("EnableFallingDamage", "auto");
  1641. ENABLE_FALLING_DAMAGE = "auto".equalsIgnoreCase(str) ? GEODATA > 0 : Boolean.parseBoolean(str);
  1642. ZONE_TOWN = Integer.parseInt(General.getProperty("ZoneTown", "0"));
  1643. ACTIVATE_POSITION_RECORDER = Boolean.parseBoolean(General.getProperty("ActivatePositionRecorder", "False"));
  1644. DEFAULT_GLOBAL_CHAT = General.getProperty("GlobalChat", "ON");
  1645. DEFAULT_TRADE_CHAT = General.getProperty("TradeChat", "ON");
  1646. ALLOW_WAREHOUSE = Boolean.parseBoolean(General.getProperty("AllowWarehouse", "True"));
  1647. WAREHOUSE_CACHE = Boolean.parseBoolean(General.getProperty("WarehouseCache", "False"));
  1648. WAREHOUSE_CACHE_TIME = Integer.parseInt(General.getProperty("WarehouseCacheTime", "15"));
  1649. ALLOW_REFUND = Boolean.parseBoolean(General.getProperty("AllowRefund", "True"));
  1650. ALLOW_MAIL = Boolean.parseBoolean(General.getProperty("AllowMail", "True"));
  1651. ALLOW_ATTACHMENTS = Boolean.parseBoolean(General.getProperty("AllowAttachments", "True"));
  1652. ALLOW_WEAR = Boolean.parseBoolean(General.getProperty("AllowWear", "False"));
  1653. WEAR_DELAY = Integer.parseInt(General.getProperty("WearDelay", "5"));
  1654. WEAR_PRICE = Integer.parseInt(General.getProperty("WearPrice", "10"));
  1655. ALLOW_LOTTERY = Boolean.parseBoolean(General.getProperty("AllowLottery", "True"));
  1656. ALLOW_RACE = Boolean.parseBoolean(General.getProperty("AllowRace", "True"));
  1657. ALLOW_WATER = Boolean.parseBoolean(General.getProperty("AllowWater", "True"));
  1658. ALLOW_RENTPET = Boolean.parseBoolean(General.getProperty("AllowRentPet", "False"));
  1659. ALLOWFISHING = Boolean.parseBoolean(General.getProperty("AllowFishing", "True"));
  1660. ALLOW_MANOR = Boolean.parseBoolean(General.getProperty("AllowManor", "True"));
  1661. ALLOW_BOAT = Boolean.parseBoolean(General.getProperty("AllowBoat", "True"));
  1662. BOAT_BROADCAST_RADIUS = Integer.parseInt(General.getProperty("BoatBroadcastRadius", "20000"));
  1663. ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(General.getProperty("AllowCursedWeapons", "True"));
  1664. ALLOW_NPC_WALKERS = Boolean.parseBoolean(General.getProperty("AllowNpcWalkers", "true"));
  1665. ALLOW_PET_WALKERS = Boolean.parseBoolean(General.getProperty("AllowPetWalkers", "True"));
  1666. SERVER_NEWS = Boolean.parseBoolean(General.getProperty("ShowServerNews", "False"));
  1667. COMMUNITY_TYPE = Integer.parseInt(General.getProperty("CommunityType", "1"));
  1668. BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(General.getProperty("BBSShowPlayerList", "false"));
  1669. BBS_DEFAULT = General.getProperty("BBSDefault", "_bbshome");
  1670. SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowLevelOnCommunityBoard", "False"));
  1671. SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowStatusOnCommunityBoard", "True"));
  1672. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePageSizeOnCommunityBoard", "50"));
  1673. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePerRowOnCommunityBoard", "5"));
  1674. USE_SAY_FILTER = Boolean.parseBoolean(General.getProperty("UseChatFilter", "false"));
  1675. CHAT_FILTER_CHARS = General.getProperty("ChatFilterChars", "^_^");
  1676. ALT_MANOR_REFRESH_TIME = Integer.parseInt(General.getProperty("AltManorRefreshTime","20"));
  1677. ALT_MANOR_REFRESH_MIN = Integer.parseInt(General.getProperty("AltManorRefreshMin","00"));
  1678. ALT_MANOR_APPROVE_TIME = Integer.parseInt(General.getProperty("AltManorApproveTime","6"));
  1679. ALT_MANOR_APPROVE_MIN = Integer.parseInt(General.getProperty("AltManorApproveMin","00"));
  1680. ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(General.getProperty("AltManorMaintenancePeriod","360000"));
  1681. ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(General.getProperty("AltManorSaveAllActions","false"));
  1682. ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(General.getProperty("AltManorSavePeriodRate","2"));
  1683. ALT_LOTTERY_PRIZE = Long.parseLong(General.getProperty("AltLotteryPrize","50000"));
  1684. ALT_LOTTERY_TICKET_PRICE = Long.parseLong(General.getProperty("AltLotteryTicketPrice","2000"));
  1685. ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery5NumberRate","0.6"));
  1686. ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery4NumberRate","0.2"));
  1687. ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery3NumberRate","0.2"));
  1688. ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Long.parseLong(General.getProperty("AltLottery2and1NumberPrize","200"));
  1689. FS_TIME_ATTACK = Integer.parseInt(General.getProperty("TimeOfAttack", "50"));
  1690. FS_TIME_COOLDOWN = Integer.parseInt(General.getProperty("TimeOfCoolDown", "5"));
  1691. FS_TIME_ENTRY = Integer.parseInt(General.getProperty("TimeOfEntry", "3"));
  1692. FS_TIME_WARMUP = Integer.parseInt(General.getProperty("TimeOfWarmUp", "2"));
  1693. FS_PARTY_MEMBER_COUNT = Integer.parseInt(General.getProperty("NumberOfNecessaryPartyMembers", "4"));
  1694. if (FS_TIME_ATTACK <= 0)
  1695. FS_TIME_ATTACK = 50;
  1696. if (FS_TIME_COOLDOWN <= 0)
  1697. FS_TIME_COOLDOWN = 5;
  1698. if (FS_TIME_ENTRY <= 0)
  1699. FS_TIME_ENTRY = 3;
  1700. if (FS_TIME_ENTRY <= 0)
  1701. FS_TIME_ENTRY = 3;
  1702. if (FS_TIME_ENTRY <= 0)
  1703. FS_TIME_ENTRY = 3;
  1704. RIFT_MIN_PARTY_SIZE = Integer.parseInt(General.getProperty("RiftMinPartySize", "5"));
  1705. RIFT_MAX_JUMPS = Integer.parseInt(General.getProperty("MaxRiftJumps", "4"));
  1706. RIFT_SPAWN_DELAY = Integer.parseInt(General.getProperty("RiftSpawnDelay", "10000"));
  1707. RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(General.getProperty("AutoJumpsDelayMin", "480"));
  1708. RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(General.getProperty("AutoJumpsDelayMax", "600"));
  1709. RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(General.getProperty("BossRoomTimeMultiply", "1.5"));
  1710. RIFT_ENTER_COST_RECRUIT = Integer.parseInt(General.getProperty("RecruitCost", "18"));
  1711. RIFT_ENTER_COST_SOLDIER = Integer.parseInt(General.getProperty("SoldierCost", "21"));
  1712. RIFT_ENTER_COST_OFFICER = Integer.parseInt(General.getProperty("OfficerCost", "24"));
  1713. RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(General.getProperty("CaptainCost", "27"));
  1714. RIFT_ENTER_COST_COMMANDER = Integer.parseInt(General.getProperty("CommanderCost", "30"));
  1715. RIFT_ENTER_COST_HERO = Integer.parseInt(General.getProperty("HeroCost", "33"));
  1716. DEFAULT_PUNISH = Integer.parseInt(General.getProperty("DefaultPunish", "2"));
  1717. DEFAULT_PUNISH_PARAM = Integer.parseInt(General.getProperty("DefaultPunishParam", "0"));
  1718. ONLY_GM_ITEMS_FREE = Boolean.parseBoolean(General.getProperty("OnlyGMItemsFree", "True"));
  1719. JAIL_IS_PVP = Boolean.parseBoolean(General.getProperty("JailIsPvp", "False"));
  1720. JAIL_DISABLE_CHAT = Boolean.parseBoolean(General.getProperty("JailDisableChat", "True"));
  1721. JAIL_DISABLE_TRANSACTION = Boolean.parseBoolean(General.getProperty("JailDisableTransaction", "False"));
  1722. CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(General.getProperty("CustomSpawnlistTable", "false"));
  1723. SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("SaveGmSpawnOnCustom", "false"));
  1724. DELETE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("DeleteGmSpawnOnCustom", "false"));
  1725. CUSTOM_NPC_TABLE = Boolean.valueOf(General.getProperty("CustomNpcTable", "false"));
  1726. CUSTOM_NPC_SKILLS_TABLE = Boolean.valueOf(General.getProperty("CustomNpcSkillsTable", "false"));
  1727. CUSTOM_ITEM_TABLES = Boolean.valueOf(General.getProperty("CustomItemTables", "false"));
  1728. CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(General.getProperty("CustomArmorSetsTable", "false"));
  1729. CUSTOM_TELEPORT_TABLE = Boolean.valueOf(General.getProperty("CustomTeleportTable", "false"));
  1730. CUSTOM_DROPLIST_TABLE = Boolean.valueOf(General.getProperty("CustomDroplistTable", "false"));
  1731. CUSTOM_MERCHANT_TABLES = Boolean.valueOf(General.getProperty("CustomMerchantTables", "false"));
  1732. CUSTOM_NPCBUFFER_TABLES = Boolean.valueOf(General.getProperty("CustomNpcBufferTables", "false"));
  1733. }
  1734. catch (Exception e)
  1735. {
  1736. e.printStackTrace();
  1737. throw new Error("Failed to Load "+GENERAL_CONFIG_FILE+" File.");
  1738. }
  1739. // Load FloodProtector L2Properties file
  1740. try
  1741. {
  1742. L2Properties security = new L2Properties();
  1743. is = new FileInputStream(new File(FLOOD_PROTECTOR_FILE));
  1744. security.load(is);
  1745. loadFloodProtectorConfigs(security);
  1746. }
  1747. catch (Exception e)
  1748. {
  1749. e.printStackTrace();
  1750. throw new Error("Failed to Load "+FLOOD_PROTECTOR_FILE);
  1751. }
  1752. // Load NPC L2Properties file (if exists)
  1753. try
  1754. {
  1755. L2Properties NPC = new L2Properties();
  1756. is = new FileInputStream(new File(NPC_CONFIG_FILE));
  1757. NPC.load(is);
  1758. ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(NPC.getProperty("AnnounceMammonSpawn", "False"));
  1759. ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(NPC.getProperty("AltMobAgroInPeaceZone", "True"));
  1760. ALT_ATTACKABLE_NPCS = Boolean.parseBoolean(NPC.getProperty("AltAttackableNpcs", "True"));
  1761. ALT_GAME_VIEWNPC = Boolean.parseBoolean(NPC.getProperty("AltGameViewNpc", "False"));
  1762. MAX_DRIFT_RANGE = Integer.parseInt(NPC.getProperty("MaxDriftRange", "300"));
  1763. DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
  1764. DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRulesRaid", "True"));
  1765. SHOW_NPC_LVL = Boolean.parseBoolean(NPC.getProperty("ShowNpcLevel", "False"));
  1766. SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(NPC.getProperty("ShowCrestWithoutQuest", "False"));
  1767. ENABLE_RANDOM_ENCHANT_EFFECT = Boolean.parseBoolean(NPC.getProperty("EnableRandomEnchantEffect", "False"));
  1768. MIN_NPC_LVL_DMG_PENALTY = Integer.parseInt(NPC.getProperty("MinNPCLevelForDmgPenalty", "78"));
  1769. MIN_NPC_LVL_MAGIC_PENALTY = Integer.parseInt(NPC.getProperty("MinNPCLevelForMagicPenalty", "78"));
  1770. ENABLE_DROP_VITALITY_HERBS = Boolean.parseBoolean(NPC.getProperty("EnableVitalityHerbs", "True"));
  1771. GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
  1772. ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
  1773. String[] split = NPC.getProperty("ListPetRentNpc", "30827").split(",");
  1774. LIST_PET_RENT_NPC = new TIntArrayList(split.length);
  1775. for (String id : split)
  1776. {
  1777. LIST_PET_RENT_NPC.add(Integer.parseInt(id));
  1778. }
  1779. RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) /100;
  1780. RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) /100;
  1781. RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPDefenceMultiplier", "100")) /100;
  1782. RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMDefenceMultiplier", "100")) /100;
  1783. RAID_PATTACK_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPAttackMultiplier", "100")) /100;
  1784. RAID_MATTACK_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMAttackMultiplier", "100")) /100;
  1785. RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMinRespawnMultiplier", "1.0"));
  1786. RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
  1787. RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
  1788. RAID_DISABLE_CURSE = Boolean.parseBoolean(NPC.getProperty("DisableRaidCurse", "False"));
  1789. RAID_CHAOS_TIME = Integer.parseInt(NPC.getProperty("RaidChaosTime", "10"));
  1790. GRAND_CHAOS_TIME = Integer.parseInt(NPC.getProperty("GrandChaosTime", "10"));
  1791. MINION_CHAOS_TIME = Integer.parseInt(NPC.getProperty("MinionChaosTime", "10"));
  1792. INVENTORY_MAXIMUM_PET = Integer.parseInt(NPC.getProperty("MaximumSlotsForPet", "12"));
  1793. PET_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetHpRegenMultiplier", "100")) /100;
  1794. PET_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetMpRegenMultiplier", "100")) /100;
  1795. }
  1796. catch (Exception e)
  1797. {
  1798. e.printStackTrace();
  1799. throw new Error("Failed to Load "+NPC_CONFIG_FILE+" File.");
  1800. }
  1801. // Load Rates L2Properties file (if exists)
  1802. try
  1803. {
  1804. L2Properties ratesSettings = new L2Properties();
  1805. is = new FileInputStream(new File(RATES_CONFIG_FILE));
  1806. ratesSettings.load(is);
  1807. RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
  1808. RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
  1809. RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
  1810. RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
  1811. RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
  1812. RATE_EXTR_FISH = Float.parseFloat(ratesSettings.getProperty("RateExtractFish", "1."));
  1813. RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
  1814. RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(ratesSettings.getProperty("RateRaidDropItems", "1."));
  1815. RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
  1816. RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
  1817. RATE_QUEST_DROP = Float.parseFloat(ratesSettings.getProperty("RateQuestDrop", "1."));
  1818. RATE_QUEST_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestReward", "1."));
  1819. RATE_QUEST_REWARD_XP = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardXP", "1."));
  1820. RATE_QUEST_REWARD_SP = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardSP", "1."));
  1821. RATE_QUEST_REWARD_ADENA = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardAdena", "1."));
  1822. RATE_QUEST_REWARD_USE_MULTIPLIERS = Boolean.parseBoolean(ratesSettings.getProperty("UseQuestRewardMultipliers", "False"));
  1823. RATE_QUEST_REWARD_POTION = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardPotion", "1."));
  1824. RATE_QUEST_REWARD_SCROLL = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardScroll", "1."));
  1825. RATE_QUEST_REWARD_RECIPE = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardRecipe", "1."));
  1826. RATE_QUEST_REWARD_MATERIAL = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardMaterial", "1."));
  1827. RATE_VITALITY_LEVEL_1 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel1", "1.5"));
  1828. RATE_VITALITY_LEVEL_2 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel2", "2."));
  1829. RATE_VITALITY_LEVEL_3 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel3", "2.5"));
  1830. RATE_VITALITY_LEVEL_4 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel4", "3."));
  1831. RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(ratesSettings.getProperty("RateRecoveryPeaceZone", "1."));
  1832. RATE_VITALITY_LOST = Float.parseFloat(ratesSettings.getProperty("RateVitalityLost", "1."));
  1833. RATE_VITALITY_GAIN = Float.parseFloat(ratesSettings.getProperty("RateVitalityGain", "1."));
  1834. RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(ratesSettings.getProperty("RateRecoveryOnReconnect", "4."));
  1835. RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
  1836. RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
  1837. RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "15."));
  1838. RATE_DROP_MP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpMpHerbs", "10."));
  1839. RATE_DROP_GREATER_HERBS = Float.parseFloat(ratesSettings.getProperty("RateGreaterHerbs", "4."));
  1840. RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSuperiorHerbs", "0.8"))*10;
  1841. RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "0.2"))*10;
  1842. RATE_DROP_VITALITY_HERBS = Float.parseFloat(ratesSettings.getProperty("RateVitalityHerbs", "2."));
  1843. PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
  1844. PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
  1845. PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
  1846. PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
  1847. PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
  1848. PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
  1849. PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
  1850. SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
  1851. KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
  1852. KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
  1853. KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
  1854. KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
  1855. KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
  1856. // Initializing table
  1857. PLAYER_XP_PERCENT_LOST = new double[Byte.MAX_VALUE+1];
  1858. // Default value
  1859. for (int i = 0; i <= Byte.MAX_VALUE; i++)
  1860. PLAYER_XP_PERCENT_LOST[i] = 1.;
  1861. // Now loading into table parsed values
  1862. try
  1863. {
  1864. 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(";");
  1865. for (String s : values)
  1866. {
  1867. int min;
  1868. int max;
  1869. double val;
  1870. String[] vals = s.split("-");
  1871. String[] mM = vals[0].split(",");
  1872. min = Integer.parseInt(mM[0]);
  1873. max = Integer.parseInt(mM[1]);
  1874. val = Double.parseDouble(vals[1]);
  1875. for (int i = min; i <= max; i++)
  1876. PLAYER_XP_PERCENT_LOST[i] = val;
  1877. }
  1878. }
  1879. catch (Exception e)
  1880. {
  1881. _log.warning("Error while loading Player XP percent lost");
  1882. e.printStackTrace();
  1883. }
  1884. String[] propertySplit = ratesSettings.getProperty("RateDropItemsById", "").split(";");
  1885. RATE_DROP_ITEMS_ID = new TIntFloatHashMap(propertySplit.length);
  1886. if (!propertySplit[0].isEmpty())
  1887. {
  1888. for (String item : propertySplit)
  1889. {
  1890. String[] itemSplit = item.split(",");
  1891. if (itemSplit.length != 2)
  1892. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  1893. else
  1894. {
  1895. try
  1896. {
  1897. RATE_DROP_ITEMS_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
  1898. }
  1899. catch (NumberFormatException nfe)
  1900. {
  1901. if (!item.isEmpty())
  1902. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  1903. }
  1904. }
  1905. }
  1906. }
  1907. if (RATE_DROP_ITEMS_ID.get(57) == 0f)
  1908. {
  1909. RATE_DROP_ITEMS_ID.put(57, RATE_DROP_ITEMS); //for Adena rate if not defined
  1910. }
  1911. }
  1912. catch (Exception e)
  1913. {
  1914. e.printStackTrace();
  1915. throw new Error("Failed to Load "+RATES_CONFIG_FILE+" File.");
  1916. }
  1917. // Load L2JMod L2Properties file (if exists)
  1918. try
  1919. {
  1920. L2Properties L2JModSettings = new L2Properties();
  1921. is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
  1922. L2JModSettings.load(is);
  1923. L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
  1924. L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
  1925. L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
  1926. L2JMOD_CHAMP_TITLE = L2JModSettings.getProperty("ChampionTitle", "Champion");
  1927. L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
  1928. L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
  1929. L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
  1930. L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
  1931. L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
  1932. L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
  1933. L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
  1934. L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
  1935. L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
  1936. L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
  1937. L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
  1938. L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
  1939. L2JMOD_CHAMPION_ENABLE_VITALITY = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnableVitality", "False"));
  1940. L2JMOD_CHAMPION_ENABLE_IN_INSTANCES = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnableInInstances", "False"));
  1941. TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
  1942. TVT_EVENT_IN_INSTANCE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventInInstance", "false"));
  1943. TVT_EVENT_INSTANCE_FILE = L2JModSettings.getProperty("TvTEventInstanceFile", "coliseum.xml");
  1944. TVT_EVENT_INTERVAL = L2JModSettings.getProperty("TvTEventInterval", "20:00").split(",");
  1945. TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
  1946. TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
  1947. TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
  1948. L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(L2JModSettings.getProperty("AllowWedding", "False"));
  1949. L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
  1950. L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
  1951. L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
  1952. L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
  1953. L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
  1954. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
  1955. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
  1956. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
  1957. L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
  1958. L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
  1959. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  1960. {
  1961. TVT_EVENT_ENABLED = false;
  1962. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
  1963. }
  1964. else
  1965. {
  1966. String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
  1967. if (propertySplit.length < 3)
  1968. {
  1969. TVT_EVENT_ENABLED = false;
  1970. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
  1971. }
  1972. else
  1973. {
  1974. TVT_EVENT_REWARDS = new ArrayList<int[]>();
  1975. TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  1976. TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  1977. TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  1978. TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  1979. TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  1980. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1981. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1982. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1983. if (propertySplit.length == 4)
  1984. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[3] = Integer.parseInt(propertySplit[3]);
  1985. TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
  1986. TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
  1987. TVT_EVENT_MIN_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
  1988. TVT_EVENT_MAX_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
  1989. TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
  1990. TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
  1991. TVT_EVENT_EFFECTS_REMOVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventEffectsRemoval", "0"));
  1992. TVT_ALLOW_VOICED_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("TvTAllowVoicedInfoCommand", "false"));
  1993. TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
  1994. propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
  1995. if (propertySplit.length < 3)
  1996. {
  1997. TVT_EVENT_ENABLED = false;
  1998. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
  1999. }
  2000. else
  2001. {
  2002. TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  2003. TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  2004. TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  2005. TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
  2006. propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
  2007. if (propertySplit.length < 3)
  2008. {
  2009. TVT_EVENT_ENABLED= false;
  2010. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
  2011. }
  2012. else
  2013. {
  2014. TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  2015. TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  2016. TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  2017. propertySplit = L2JModSettings.getProperty("TvTEventParticipationFee", "0,0").split(",");
  2018. try
  2019. {
  2020. TVT_EVENT_PARTICIPATION_FEE[0] = Integer.parseInt(propertySplit[0]);
  2021. TVT_EVENT_PARTICIPATION_FEE[1] = Integer.parseInt(propertySplit[1]);
  2022. }
  2023. catch (NumberFormatException nfe)
  2024. {
  2025. if (propertySplit.length > 0)
  2026. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationFee");
  2027. }
  2028. propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
  2029. for (String reward : propertySplit)
  2030. {
  2031. String[] rewardSplit = reward.split(",");
  2032. if (rewardSplit.length != 2)
  2033. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  2034. else
  2035. {
  2036. try
  2037. {
  2038. TVT_EVENT_REWARDS.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  2039. }
  2040. catch (NumberFormatException nfe)
  2041. {
  2042. if (!reward.isEmpty())
  2043. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  2044. }
  2045. }
  2046. }
  2047. TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
  2048. TVT_EVENT_SCROLL_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventScrollsAllowed", "false"));
  2049. TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
  2050. TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
  2051. TVT_REWARD_TEAM_TIE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTRewardTeamTie", "false"));
  2052. propertySplit = L2JModSettings.getProperty("TvTDoorsToOpen", "").split(";");
  2053. for (String door : propertySplit)
  2054. {
  2055. try
  2056. {
  2057. TVT_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
  2058. }
  2059. catch (NumberFormatException nfe)
  2060. {
  2061. if (!door.isEmpty())
  2062. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"", door, "\""));
  2063. }
  2064. }
  2065. propertySplit = L2JModSettings.getProperty("TvTDoorsToClose", "").split(";");
  2066. for (String door : propertySplit)
  2067. {
  2068. try
  2069. {
  2070. TVT_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
  2071. }
  2072. catch (NumberFormatException nfe)
  2073. {
  2074. if (!door.isEmpty())
  2075. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"", door, "\""));
  2076. }
  2077. }
  2078. propertySplit = L2JModSettings.getProperty("TvTEventFighterBuffs", "").split(";");
  2079. if (!propertySplit[0].isEmpty())
  2080. {
  2081. TVT_EVENT_FIGHTER_BUFFS = new TIntIntHashMap(propertySplit.length);
  2082. for (String skill : propertySplit)
  2083. {
  2084. String[] skillSplit = skill.split(",");
  2085. if (skillSplit.length != 2)
  2086. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2087. else
  2088. {
  2089. try
  2090. {
  2091. TVT_EVENT_FIGHTER_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2092. }
  2093. catch (NumberFormatException nfe)
  2094. {
  2095. if (!skill.isEmpty())
  2096. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2097. }
  2098. }
  2099. }
  2100. }
  2101. propertySplit = L2JModSettings.getProperty("TvTEventMageBuffs", "").split(";");
  2102. if (!propertySplit[0].isEmpty())
  2103. {
  2104. TVT_EVENT_MAGE_BUFFS = new TIntIntHashMap(propertySplit.length);
  2105. for (String skill : propertySplit)
  2106. {
  2107. String[] skillSplit = skill.split(",");
  2108. if (skillSplit.length != 2)
  2109. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2110. else
  2111. {
  2112. try
  2113. {
  2114. TVT_EVENT_MAGE_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2115. }
  2116. catch (NumberFormatException nfe)
  2117. {
  2118. if (!skill.isEmpty())
  2119. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2120. }
  2121. }
  2122. }
  2123. }
  2124. }
  2125. }
  2126. }
  2127. }
  2128. BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
  2129. BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
  2130. BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
  2131. OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
  2132. OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
  2133. OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
  2134. OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
  2135. OFFLINE_FAME = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineFame", "true"));
  2136. RESTORE_OFFLINERS = Boolean.parseBoolean(L2JModSettings.getProperty("RestoreOffliners", "false"));
  2137. OFFLINE_MAX_DAYS = Integer.parseInt(L2JModSettings.getProperty("OfflineMaxDays", "10"));
  2138. OFFLINE_DISCONNECT_FINISHED = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineDisconnectFinished", "true"));
  2139. L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
  2140. L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(L2JModSettings.getProperty("DisplayServerTime", "false"));
  2141. WELCOME_MESSAGE_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("ScreenWelcomeMessageEnable", "false"));
  2142. WELCOME_MESSAGE_TEXT = L2JModSettings.getProperty("ScreenWelcomeMessageText", "Welcome to L2J server!");
  2143. WELCOME_MESSAGE_TIME = Integer.parseInt(L2JModSettings.getProperty("ScreenWelcomeMessageTime", "10")) * 1000;
  2144. L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedEnable", "false"));
  2145. L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDualbox", "true"));
  2146. L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDisconnectedAsDualbox", "true"));
  2147. L2JMOD_ANTIFEED_INTERVAL = 1000*Integer.parseInt(L2JModSettings.getProperty("AntiFeedInterval", "120"));
  2148. ANNOUNCE_PK_PVP = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvP", "False"));
  2149. ANNOUNCE_PK_PVP_NORMAL_MESSAGE = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvPNormalMessage", "True"));
  2150. ANNOUNCE_PK_MSG = L2JModSettings.getProperty("AnnouncePkMsg", "$killer has slaughtered $target");
  2151. ANNOUNCE_PVP_MSG = L2JModSettings.getProperty("AnnouncePvpMsg", "$killer has defeated $target");
  2152. L2JMOD_CHAT_ADMIN = Boolean.parseBoolean(L2JModSettings.getProperty("ChatAdmin", "false"));
  2153. L2JMOD_MULTILANG_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangEnable", "false"));
  2154. String[] allowed = L2JModSettings.getProperty("MultiLangAllowed", "en").split(";");
  2155. L2JMOD_MULTILANG_ALLOWED = new ArrayList<String>(allowed.length);
  2156. for (String lang : allowed)
  2157. L2JMOD_MULTILANG_ALLOWED.add(lang);
  2158. L2JMOD_MULTILANG_DEFAULT = L2JModSettings.getProperty("MultiLangDefault", "en");
  2159. if (!L2JMOD_MULTILANG_ALLOWED.contains(L2JMOD_MULTILANG_DEFAULT))
  2160. _log.warning("MultiLang[Config.load()]: default language: " + L2JMOD_MULTILANG_DEFAULT + " is not in allowed list !");
  2161. L2JMOD_MULTILANG_VOICED_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangVoiceCommand", "True"));
  2162. L2WALKER_PROTECTION = Boolean.parseBoolean(L2JModSettings.getProperty("L2WalkerProtection", "False"));
  2163. }
  2164. catch (Exception e)
  2165. {
  2166. e.printStackTrace();
  2167. throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File.");
  2168. }
  2169. // Load PvP L2Properties file (if exists)
  2170. try
  2171. {
  2172. L2Properties pvpSettings = new L2Properties();
  2173. is = new FileInputStream(new File(PVP_CONFIG_FILE));
  2174. pvpSettings.load(is);
  2175. KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
  2176. KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
  2177. KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
  2178. KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
  2179. KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
  2180. KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
  2181. KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
  2182. KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
  2183. 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");
  2184. String[] array = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
  2185. KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[array.length];
  2186. for (int i = 0; i < array.length; i++)
  2187. KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(array[i]);
  2188. array = KARMA_NONDROPPABLE_ITEMS.split(",");
  2189. KARMA_LIST_NONDROPPABLE_ITEMS = new int[array.length];
  2190. for (int i = 0; i < array.length; i++)
  2191. KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(array[i]);
  2192. // sorting so binarySearch can be used later
  2193. Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
  2194. Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
  2195. PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "120000"));
  2196. PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "60000"));
  2197. }
  2198. catch (Exception e)
  2199. {
  2200. e.printStackTrace();
  2201. throw new Error("Failed to Load "+PVP_CONFIG_FILE+" File.");
  2202. }
  2203. // Load Olympiad L2Properties file (if exists)
  2204. try
  2205. {
  2206. L2Properties olympiad = new L2Properties();
  2207. is = new FileInputStream(new File(OLYMPIAD_CONFIG_FILE));
  2208. olympiad.load(is);
  2209. ALT_OLY_START_TIME = Integer.parseInt(olympiad.getProperty("AltOlyStartTime", "18"));
  2210. ALT_OLY_MIN = Integer.parseInt(olympiad.getProperty("AltOlyMin","00"));
  2211. ALT_OLY_CPERIOD = Long.parseLong(olympiad.getProperty("AltOlyCPeriod","21600000"));
  2212. ALT_OLY_BATTLE = Long.parseLong(olympiad.getProperty("AltOlyBattle","360000"));
  2213. ALT_OLY_WPERIOD = Long.parseLong(olympiad.getProperty("AltOlyWPeriod","604800000"));
  2214. ALT_OLY_VPERIOD = Long.parseLong(olympiad.getProperty("AltOlyVPeriod","86400000"));
  2215. ALT_OLY_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyClassedParticipants","5"));
  2216. ALT_OLY_NONCLASSED = Integer.parseInt(olympiad.getProperty("AltOlyNonClassedParticipants","9"));
  2217. ALT_OLY_REG_DISPLAY = Integer.parseInt(olympiad.getProperty("AltOlyRegistrationDisplayNumber","100"));
  2218. ALT_OLY_BATTLE_REWARD_ITEM = Integer.parseInt(olympiad.getProperty("AltOlyBattleRewItem","6651"));
  2219. ALT_OLY_CLASSED_RITEM_C = Integer.parseInt(olympiad.getProperty("AltOlyClassedRewItemCount","50"));
  2220. ALT_OLY_NONCLASSED_RITEM_C = Integer.parseInt(olympiad.getProperty("AltOlyNonClassedRewItemCount","40"));
  2221. ALT_OLY_COMP_RITEM = Integer.parseInt(olympiad.getProperty("AltOlyCompRewItem","13722"));
  2222. ALT_OLY_GP_PER_POINT = Integer.parseInt(olympiad.getProperty("AltOlyGPPerPoint","1000"));
  2223. ALT_OLY_HERO_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyHeroPoints","180"));
  2224. ALT_OLY_RANK1_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank1Points","120"));
  2225. ALT_OLY_RANK2_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank2Points","80"));
  2226. ALT_OLY_RANK3_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank3Points","55"));
  2227. ALT_OLY_RANK4_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank4Points","35"));
  2228. ALT_OLY_RANK5_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank5Points","20"));
  2229. ALT_OLY_MAX_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyMaxPoints","10"));
  2230. ALT_OLY_LOG_FIGHTS = Boolean.parseBoolean(olympiad.getProperty("AltOlyLogFights","false"));
  2231. ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(olympiad.getProperty("AltOlyShowMonthlyWinners","true"));
  2232. ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(olympiad.getProperty("AltOlyAnnounceGames","true"));
  2233. String[] split = olympiad.getProperty("AltOlyRestrictedItems","0").split(",");
  2234. LIST_OLY_RESTRICTED_ITEMS = new TIntArrayList(split.length);
  2235. for (String id : split)
  2236. {
  2237. LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
  2238. }
  2239. ALT_OLY_ENCHANT_LIMIT = Integer.parseInt(olympiad.getProperty("AltOlyEnchantLimit","-1"));
  2240. ALT_OLY_WAIT_TIME = Byte.parseByte(olympiad.getProperty("AltOlyWaitTime","120"));
  2241. if (ALT_OLY_WAIT_TIME != 120 && ALT_OLY_WAIT_TIME != 60 && ALT_OLY_WAIT_TIME != 30 && ALT_OLY_WAIT_TIME != 15 && ALT_OLY_WAIT_TIME != 5) ALT_OLY_WAIT_TIME = 120;
  2242. }
  2243. catch (Exception e)
  2244. {
  2245. e.printStackTrace();
  2246. throw new Error("Failed to Load "+OLYMPIAD_CONFIG_FILE+" File.");
  2247. }
  2248. try
  2249. {
  2250. L2Properties Settings = new L2Properties();
  2251. is = new FileInputStream(HEXID_FILE);
  2252. Settings.load(is);
  2253. SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
  2254. HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
  2255. }
  2256. catch (Exception e)
  2257. {
  2258. _log.warning("Could not load HexID file ("+HEXID_FILE+"). Hopefully login will give us one.");
  2259. }
  2260. // Grandboss
  2261. try
  2262. {
  2263. L2Properties grandbossSettings = new L2Properties();
  2264. is = new FileInputStream(new File(GRANDBOSS_CONFIG_FILE));
  2265. grandbossSettings.load(is);
  2266. Antharas_Wait_Time = Integer.parseInt(grandbossSettings.getProperty("AntharasWaitTime", "30"));
  2267. if (Antharas_Wait_Time < 3 || Antharas_Wait_Time > 60)
  2268. Antharas_Wait_Time = 30;
  2269. Antharas_Wait_Time = Antharas_Wait_Time * 60000;
  2270. Valakas_Wait_Time = Integer.parseInt(grandbossSettings.getProperty("ValakasWaitTime", "30"));
  2271. if (Valakas_Wait_Time < 3 || Valakas_Wait_Time > 60)
  2272. Valakas_Wait_Time = 30;
  2273. Valakas_Wait_Time = Valakas_Wait_Time * 60000;
  2274. Interval_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfAntharasSpawn", "192"));
  2275. if (Interval_Of_Antharas_Spawn < 1 || Interval_Of_Antharas_Spawn > 480)
  2276. Interval_Of_Antharas_Spawn = 192;
  2277. Interval_Of_Antharas_Spawn = Interval_Of_Antharas_Spawn * 3600000;
  2278. Random_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfAntharasSpawn", "145"));
  2279. if (Random_Of_Antharas_Spawn < 1 || Random_Of_Antharas_Spawn > 192)
  2280. Random_Of_Antharas_Spawn = 145;
  2281. Random_Of_Antharas_Spawn = Random_Of_Antharas_Spawn * 3600000;
  2282. Interval_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfValakasSpawn", "192"));
  2283. if (Interval_Of_Valakas_Spawn < 1 || Interval_Of_Valakas_Spawn > 480)
  2284. Interval_Of_Valakas_Spawn = 192;
  2285. Interval_Of_Valakas_Spawn = Interval_Of_Valakas_Spawn * 3600000;
  2286. Random_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfValakasSpawn", "145"));
  2287. if (Random_Of_Valakas_Spawn < 1 || Random_Of_Valakas_Spawn > 192)
  2288. Random_Of_Valakas_Spawn = 145;
  2289. Random_Of_Valakas_Spawn = Random_Of_Valakas_Spawn * 3600000;
  2290. Interval_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfBaiumSpawn", "121"));
  2291. if (Interval_Of_Baium_Spawn < 1 || Interval_Of_Baium_Spawn > 480)
  2292. Interval_Of_Baium_Spawn = 121;
  2293. Interval_Of_Baium_Spawn = Interval_Of_Baium_Spawn * 3600000;
  2294. Random_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfBaiumSpawn", "8"));
  2295. if (Random_Of_Baium_Spawn < 1 || Random_Of_Baium_Spawn > 192)
  2296. Random_Of_Baium_Spawn = 8;
  2297. Random_Of_Baium_Spawn = Random_Of_Baium_Spawn * 3600000;
  2298. Interval_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfCoreSpawn", "27"));
  2299. if (Interval_Of_Core_Spawn < 1 || Interval_Of_Core_Spawn > 480)
  2300. Interval_Of_Core_Spawn = 27;
  2301. Interval_Of_Core_Spawn = Interval_Of_Core_Spawn * 3600000;
  2302. Random_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfCoreSpawn", "47"));
  2303. if (Random_Of_Core_Spawn < 1 || Random_Of_Core_Spawn > 192)
  2304. Random_Of_Core_Spawn = 47;
  2305. Random_Of_Core_Spawn = Random_Of_Core_Spawn * 3600000;
  2306. Interval_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfOrfenSpawn", "28"));
  2307. if (Interval_Of_Orfen_Spawn < 1 || Interval_Of_Orfen_Spawn > 480)
  2308. Interval_Of_Orfen_Spawn = 28;
  2309. Interval_Of_Orfen_Spawn = Interval_Of_Orfen_Spawn * 3600000;
  2310. Random_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfOrfenSpawn", "41"));
  2311. if (Random_Of_Orfen_Spawn < 1 || Random_Of_Orfen_Spawn > 192)
  2312. Random_Of_Orfen_Spawn = 41;
  2313. Random_Of_Orfen_Spawn = Random_Of_Orfen_Spawn * 3600000;
  2314. Interval_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfQueenAntSpawn", "19"));
  2315. if (Interval_Of_QueenAnt_Spawn < 1 || Interval_Of_QueenAnt_Spawn > 480)
  2316. Interval_Of_QueenAnt_Spawn = 19;
  2317. Interval_Of_QueenAnt_Spawn = Interval_Of_QueenAnt_Spawn * 3600000;
  2318. Random_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfQueenAntSpawn", "35"));
  2319. if (Random_Of_QueenAnt_Spawn < 1 || Random_Of_QueenAnt_Spawn > 192)
  2320. Random_Of_QueenAnt_Spawn = 35;
  2321. Random_Of_QueenAnt_Spawn = Random_Of_QueenAnt_Spawn * 3600000;
  2322. Interval_Of_Zaken_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfZakenSpawn", "19"));
  2323. if (Interval_Of_Zaken_Spawn < 1 || Interval_Of_Zaken_Spawn > 480)
  2324. Interval_Of_Zaken_Spawn = 19;
  2325. Interval_Of_Zaken_Spawn = Interval_Of_Zaken_Spawn * 3600000;
  2326. Random_Of_Zaken_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfZakenSpawn", "35"));
  2327. if (Random_Of_Zaken_Spawn < 1 || Random_Of_Zaken_Spawn > 192)
  2328. Random_Of_Zaken_Spawn = 35;
  2329. Random_Of_Zaken_Spawn = Random_Of_Zaken_Spawn * 3600000;
  2330. Interval_Of_Frintezza_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfFrintezzaSpawn", "121"));
  2331. if (Interval_Of_Frintezza_Spawn < 1 || Interval_Of_Frintezza_Spawn > 480)
  2332. Interval_Of_Frintezza_Spawn = 121;
  2333. Interval_Of_Frintezza_Spawn = Interval_Of_Frintezza_Spawn * 3600000;
  2334. Random_Of_Frintezza_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfFrintezzaSpawn", "8"));
  2335. if (Random_Of_Frintezza_Spawn < 1 || Random_Of_Frintezza_Spawn > 192)
  2336. Random_Of_Frintezza_Spawn = 8;
  2337. Random_Of_Frintezza_Spawn = Random_Of_Frintezza_Spawn * 3600000;
  2338. }
  2339. catch (Exception e)
  2340. {
  2341. e.printStackTrace();
  2342. throw new Error("Failed to Load " + GRANDBOSS_CONFIG_FILE + " File.");
  2343. }
  2344. try
  2345. {
  2346. FILTER_LIST = new ArrayList<String>();
  2347. LineNumberReader lnr = new LineNumberReader(new BufferedReader(new FileReader(new File(CHAT_FILTER_FILE))));
  2348. String line = null;
  2349. while ((line = lnr.readLine()) != null)
  2350. {
  2351. if (line.trim().isEmpty() || line.startsWith("#"))
  2352. continue;
  2353. FILTER_LIST.add(line.trim());
  2354. }
  2355. _log.info("Loaded " + FILTER_LIST.size() + " Filter Words.");
  2356. }
  2357. catch (Exception e)
  2358. {
  2359. e.printStackTrace();
  2360. throw new Error("Failed to Load " + CHAT_FILTER_FILE + " File.");
  2361. }
  2362. }
  2363. finally
  2364. {
  2365. try
  2366. {
  2367. is.close();
  2368. }
  2369. catch (Exception e)
  2370. {}
  2371. }
  2372. }
  2373. else if(Server.serverMode == Server.MODE_LOGINSERVER)
  2374. {
  2375. _log.info("loading login config");
  2376. InputStream is = null;
  2377. try
  2378. {
  2379. try
  2380. {
  2381. L2Properties serverSettings = new L2Properties();
  2382. is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
  2383. serverSettings.load(is);
  2384. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");
  2385. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));
  2386. LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
  2387. PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
  2388. DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
  2389. PACKET_HANDLER_DEBUG = Boolean.parseBoolean(serverSettings.getProperty("PacketHandlerDebug", "false"));
  2390. DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
  2391. ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
  2392. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  2393. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  2394. LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
  2395. LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
  2396. LOG_LOGIN_CONTROLLER = Boolean.parseBoolean(serverSettings.getProperty("LogLoginController", "true"));
  2397. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); //FIXME: in login?
  2398. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
  2399. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
  2400. ROUTER_HOSTNAME = serverSettings.getProperty("RouterHostname", "");
  2401. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  2402. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  2403. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  2404. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  2405. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  2406. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  2407. SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
  2408. IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime","15"));
  2409. FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "False"));
  2410. AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));
  2411. FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
  2412. FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
  2413. NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
  2414. FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
  2415. MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
  2416. }
  2417. catch (Exception e)
  2418. {
  2419. e.printStackTrace();
  2420. throw new Error("Failed to Load " + LOGIN_CONFIGURATION_FILE + " File.");
  2421. }
  2422. // MMO
  2423. try
  2424. {
  2425. _log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  2426. L2Properties mmoSettings = new L2Properties();
  2427. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  2428. mmoSettings.load(is);
  2429. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  2430. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  2431. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  2432. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  2433. }
  2434. catch (Exception e)
  2435. {
  2436. e.printStackTrace();
  2437. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  2438. }
  2439. // Load Telnet L2Properties file (if exists)
  2440. try
  2441. {
  2442. L2Properties telnetSettings = new L2Properties();
  2443. is = new FileInputStream(new File(TELNET_FILE));
  2444. telnetSettings.load(is);
  2445. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  2446. }
  2447. catch (Exception e)
  2448. {
  2449. e.printStackTrace();
  2450. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  2451. }
  2452. }
  2453. finally
  2454. {
  2455. try
  2456. {
  2457. is.close();
  2458. }
  2459. catch(Exception e) { }
  2460. }
  2461. }
  2462. else
  2463. {
  2464. _log.severe("Could not Load Config: server mode was not set");
  2465. }
  2466. }
  2467. /**
  2468. * Set a new value to a game parameter from the admin console.
  2469. * @param pName (String) : name of the parameter to change
  2470. * @param pValue (String) : new value of the parameter
  2471. * @return boolean : true if modification has been made
  2472. * @link useAdminCommand
  2473. */
  2474. public static boolean setParameterValue(String pName, String pValue)
  2475. {
  2476. // rates.properties
  2477. if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
  2478. else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
  2479. else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
  2480. else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
  2481. else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
  2482. else if (pName.equalsIgnoreCase("RateExtractFish")) RATE_EXTR_FISH = Float.parseFloat(pValue);
  2483. else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
  2484. else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ITEMS_ID.put(57, Float.parseFloat(pValue));
  2485. else if (pName.equalsIgnoreCase("RateRaidDropItems")) RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(pValue);
  2486. else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
  2487. else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
  2488. else if (pName.equalsIgnoreCase("RateQuestDrop")) RATE_QUEST_DROP = Float.parseFloat(pValue);
  2489. else if (pName.equalsIgnoreCase("RateQuestReward")) RATE_QUEST_REWARD = Float.parseFloat(pValue);
  2490. else if (pName.equalsIgnoreCase("RateQuestRewardXP")) RATE_QUEST_REWARD_XP = Float.parseFloat(pValue);
  2491. else if (pName.equalsIgnoreCase("RateQuestRewardSP")) RATE_QUEST_REWARD_SP = Float.parseFloat(pValue);
  2492. else if (pName.equalsIgnoreCase("RateQuestRewardAdena")) RATE_QUEST_REWARD_ADENA = Float.parseFloat(pValue);
  2493. else if (pName.equalsIgnoreCase("UseQuestRewardMultipliers")) RATE_QUEST_REWARD_USE_MULTIPLIERS = Boolean.parseBoolean(pValue);
  2494. else if (pName.equalsIgnoreCase("RateQuestRewardPotion")) RATE_QUEST_REWARD_POTION = Float.parseFloat(pValue);
  2495. else if (pName.equalsIgnoreCase("RateQuestRewardScroll")) RATE_QUEST_REWARD_SCROLL = Float.parseFloat(pValue);
  2496. else if (pName.equalsIgnoreCase("RateQuestRewardRecipe")) RATE_QUEST_REWARD_RECIPE = Float.parseFloat(pValue);
  2497. else if (pName.equalsIgnoreCase("RateQuestRewardMaterial")) RATE_QUEST_REWARD_MATERIAL = Float.parseFloat(pValue);
  2498. else if (pName.equalsIgnoreCase("RateVitalityLevel1")) RATE_VITALITY_LEVEL_1 = Float.parseFloat(pValue);
  2499. else if (pName.equalsIgnoreCase("RateVitalityLevel2")) RATE_VITALITY_LEVEL_2 = Float.parseFloat(pValue);
  2500. else if (pName.equalsIgnoreCase("RateVitalityLevel3")) RATE_VITALITY_LEVEL_3 = Float.parseFloat(pValue);
  2501. else if (pName.equalsIgnoreCase("RateVitalityLevel4")) RATE_VITALITY_LEVEL_4 = Float.parseFloat(pValue);
  2502. else if (pName.equalsIgnoreCase("RateRecoveryPeaceZone")) RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(pValue);
  2503. else if (pName.equalsIgnoreCase("RateVitalityLost")) RATE_VITALITY_LOST = Float.parseFloat(pValue);
  2504. else if (pName.equalsIgnoreCase("RateVitalityGain")) RATE_VITALITY_GAIN = Float.parseFloat(pValue);
  2505. else if (pName.equalsIgnoreCase("RateRecoveryOnReconnect")) RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(pValue);
  2506. else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
  2507. else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
  2508. else if (pName.equalsIgnoreCase("RateCommonHerbs")) RATE_DROP_COMMON_HERBS = Float.parseFloat(pValue);
  2509. else if (pName.equalsIgnoreCase("RateHpMpHerbs")) RATE_DROP_MP_HP_HERBS = Float.parseFloat(pValue);
  2510. else if (pName.equalsIgnoreCase("RateGreaterHerbs")) RATE_DROP_GREATER_HERBS = Float.parseFloat(pValue);
  2511. else if (pName.equalsIgnoreCase("RateSuperiorHerbs")) RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(pValue);
  2512. else if (pName.equalsIgnoreCase("RateSpecialHerbs")) RATE_DROP_SPECIAL_HERBS = Float.parseFloat(pValue);
  2513. else if (pName.equalsIgnoreCase("RateVitalityHerbs")) RATE_DROP_VITALITY_HERBS = Float.parseFloat(pValue);
  2514. else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
  2515. else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
  2516. else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2517. else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2518. else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2519. else if (pName.equalsIgnoreCase("PetXpRate")) PET_XP_RATE = Float.parseFloat(pValue);
  2520. else if (pName.equalsIgnoreCase("PetFoodRate")) PET_FOOD_RATE = Integer.parseInt(pValue);
  2521. else if (pName.equalsIgnoreCase("SinEaterXpRate")) SINEATER_XP_RATE = Float.parseFloat(pValue);
  2522. else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
  2523. else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
  2524. else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2525. else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2526. else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2527. // general.properties
  2528. else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
  2529. else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2530. else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2531. else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.parseBoolean(pValue);
  2532. else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(pValue);
  2533. else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
  2534. else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(pValue);
  2535. else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
  2536. else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
  2537. else if (pName.equalsIgnoreCase("LowWeight")) LOW_WEIGHT = Float.parseFloat(pValue);
  2538. else if (pName.equalsIgnoreCase("MediumWeight")) MEDIUM_WEIGHT = Float.parseFloat(pValue);
  2539. else if (pName.equalsIgnoreCase("HighWeight")) HIGH_WEIGHT = Float.parseFloat(pValue);
  2540. else if (pName.equalsIgnoreCase("AdvancedDiagonalStrategy")) ADVANCED_DIAGONAL_STRATEGY= Boolean.parseBoolean(pValue);
  2541. else if (pName.equalsIgnoreCase("DiagonalWeight")) DIAGONAL_WEIGHT = Float.parseFloat(pValue);
  2542. else if (pName.equalsIgnoreCase("MaxPostfilterPasses")) MAX_POSTFILTER_PASSES = Integer.parseInt(pValue);
  2543. else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
  2544. else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
  2545. else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
  2546. else if (pName.equalsIgnoreCase("AllowRefund")) ALLOW_REFUND = Boolean.parseBoolean(pValue);
  2547. else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.parseBoolean(pValue);
  2548. else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.parseBoolean(pValue);
  2549. else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
  2550. else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
  2551. else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.parseBoolean(pValue);
  2552. else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.parseBoolean(pValue);
  2553. else if (pName.equalsIgnoreCase("BoatBroadcastRadius")) BOAT_BROADCAST_RADIUS = Integer.parseInt(pValue);
  2554. else if (pName.equalsIgnoreCase("AllowCursedWeapons")) ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(pValue);
  2555. else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.parseBoolean(pValue);
  2556. else if (pName.equalsIgnoreCase("AllowNpcWalkers")) ALLOW_NPC_WALKERS = Boolean.parseBoolean(pValue);
  2557. else if (pName.equalsIgnoreCase("AllowPetWalkers")) ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
  2558. else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.parseBoolean(pValue);
  2559. else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = Integer.parseInt(pValue);
  2560. else if (pName.equalsIgnoreCase("BBSShowPlayerList")) BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
  2561. else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
  2562. else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  2563. else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  2564. else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
  2565. else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
  2566. else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.parseBoolean(pValue);
  2567. else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.parseBoolean(pValue);
  2568. else if (pName.equalsIgnoreCase("ShowCrestWithoutQuest")) SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(pValue);
  2569. else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);
  2570. else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(pValue);
  2571. else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
  2572. else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);
  2573. else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.parseBoolean(pValue);
  2574. else if (pName.equalsIgnoreCase("MaxDriftRange")) MAX_DRIFT_RANGE = Integer.parseInt(pValue);
  2575. else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.parseBoolean(pValue);
  2576. else if (pName.equalsIgnoreCase("UseDeepBlueDropRulesRaid")) DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(pValue);
  2577. else if (pName.equalsIgnoreCase("GuardAttackAggroMob")) GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(pValue);
  2578. else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.parseBoolean(pValue);
  2579. else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
  2580. else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
  2581. else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
  2582. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
  2583. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
  2584. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
  2585. else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
  2586. else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
  2587. else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
  2588. else if (pName.equalsIgnoreCase("EnchantChanceElement")) ENCHANT_CHANCE_ELEMENT = Integer.parseInt(pValue);
  2589. else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
  2590. else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
  2591. else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
  2592. else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
  2593. else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
  2594. else if (pName.equalsIgnoreCase("AugmentationNGSkillChance")) AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(pValue);
  2595. else if (pName.equalsIgnoreCase("AugmentationNGGlowChance")) AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(pValue);
  2596. else if (pName.equalsIgnoreCase("AugmentationMidSkillChance")) AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(pValue);
  2597. else if (pName.equalsIgnoreCase("AugmentationMidGlowChance")) AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(pValue);
  2598. else if (pName.equalsIgnoreCase("AugmentationHighSkillChance")) AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(pValue);
  2599. else if (pName.equalsIgnoreCase("AugmentationHighGlowChance")) AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(pValue);
  2600. else if (pName.equalsIgnoreCase("AugmentationTopSkillChance")) AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(pValue);
  2601. else if (pName.equalsIgnoreCase("AugmentationTopGlowChance")) AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(pValue);
  2602. else if (pName.equalsIgnoreCase("AugmentationBaseStatChance")) AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(pValue);
  2603. else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2604. else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2605. else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2606. else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2607. else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2608. else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier")) RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  2609. else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier")) RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  2610. else if (pName.equalsIgnoreCase("RaidPAttackMultiplier")) RAID_PATTACK_MULTIPLIER = Double.parseDouble(pValue) /100;
  2611. else if (pName.equalsIgnoreCase("RaidMAttackMultiplier")) RAID_MATTACK_MULTIPLIER = Double.parseDouble(pValue) /100;
  2612. else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
  2613. else if (pName.equalsIgnoreCase("RaidChaosTime")) RAID_CHAOS_TIME =Integer.parseInt(pValue);
  2614. else if (pName.equalsIgnoreCase("GrandChaosTime")) GRAND_CHAOS_TIME =Integer.parseInt(pValue);
  2615. else if (pName.equalsIgnoreCase("MinionChaosTime")) MINION_CHAOS_TIME =Integer.parseInt(pValue);
  2616. else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Long.parseLong(pValue);
  2617. else if (pName.equalsIgnoreCase("StartingLevel")) STARTING_LEVEL = Byte.parseByte(pValue);
  2618. else if (pName.equalsIgnoreCase("StartingSP")) STARTING_SP = Integer.parseInt(pValue);
  2619. else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
  2620. else if (pName.equalsIgnoreCase("TeleportWatchdogTimeout")) TELEPORT_WATCHDOG_TIMEOUT = Integer.parseInt(pValue);
  2621. else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
  2622. else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
  2623. else if (pName.equalsIgnoreCase("RestorePlayerInstance")) RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(pValue);
  2624. else if (pName.equalsIgnoreCase("AllowSummonToInstance")) ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(pValue);
  2625. else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
  2626. else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
  2627. else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
  2628. else if (pName.equalsIgnoreCase("RespawnRestoreCP")) RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
  2629. else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
  2630. else if (pName.equalsIgnoreCase("RespawnRestoreMP")) RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
  2631. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsDwarf")) MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(pValue);
  2632. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsOther")) MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(pValue);
  2633. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsDwarf")) MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(pValue);
  2634. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsOther")) MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(pValue);
  2635. else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  2636. else if (pName.equalsIgnoreCase("SubclassStoreSkillCooltime")) SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  2637. else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(pValue);
  2638. else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.parseBoolean(pValue);
  2639. else if (pName.equalsIgnoreCase("EnableFallingDamage")) ENABLE_FALLING_DAMAGE = Boolean.parseBoolean(pValue);
  2640. else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.parseBoolean(pValue);
  2641. else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
  2642. else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
  2643. else if (pName.equalsIgnoreCase("AltGameCreationRareXpSpRate")) ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(pValue);
  2644. else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
  2645. else if (pName.equalsIgnoreCase("AltWeightLimit")) ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
  2646. else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes")) ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(pValue);
  2647. else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(pValue);
  2648. else if (pName.equalsIgnoreCase("RemoveCastleCirclets")) REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
  2649. else if (pName.equalsIgnoreCase("ReputationScorePerKill")) REPUTATION_SCORE_PER_KILL = Integer.parseInt(pValue);
  2650. else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
  2651. {
  2652. ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
  2653. ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
  2654. }
  2655. else if (pName.equalsIgnoreCase("AltShieldBlocks")) ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(pValue);
  2656. else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
  2657. else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.parseBoolean(pValue);
  2658. else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(pValue);
  2659. else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone")) ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  2660. else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
  2661. else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
  2662. else if (pName.equalsIgnoreCase("AllowClassMasters")) ALLOW_CLASS_MASTERS = Boolean.parseBoolean(pValue);
  2663. else if (pName.equalsIgnoreCase("AllowEntireTree")) ALLOW_ENTIRE_TREE = Boolean.parseBoolean(pValue);
  2664. else if (pName.equalsIgnoreCase("AlternateClassMaster")) ALTERNATE_CLASS_MASTER = Boolean.parseBoolean(pValue);
  2665. else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
  2666. else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
  2667. else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.parseBoolean(pValue);
  2668. else if (pName.equalsIgnoreCase("CraftMasterwork")) CRAFT_MASTERWORK = Boolean.parseBoolean(pValue);
  2669. else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
  2670. else if (pName.equalsIgnoreCase("SpBookNeeded")) SP_BOOK_NEEDED = Boolean.parseBoolean(pValue);
  2671. else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.parseBoolean(pValue);
  2672. else if (pName.equalsIgnoreCase("AutoLootRaids")) AUTO_LOOT_RAIDS = Boolean.parseBoolean(pValue);
  2673. else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);
  2674. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  2675. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(pValue);
  2676. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(pValue);
  2677. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pValue);
  2678. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pValue);
  2679. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pValue);
  2680. else if (pName.equalsIgnoreCase("MaxPersonalFamePoints")) MAX_PERSONAL_FAME_POINTS = Integer.parseInt(pValue);
  2681. else if (pName.equalsIgnoreCase("FortressZoneFameTaskFrequency")) FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  2682. else if (pName.equalsIgnoreCase("FortressZoneFameAquirePoints")) FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  2683. else if (pName.equalsIgnoreCase("CastleZoneFameTaskFrequency")) CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  2684. else if (pName.equalsIgnoreCase("CastleZoneFameAquirePoints")) CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  2685. else if (pName.equalsIgnoreCase("AltCastleForDawn")) ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(pValue);
  2686. else if (pName.equalsIgnoreCase("AltCastleForDusk")) ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(pValue);
  2687. else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(pValue);
  2688. else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(pValue);
  2689. else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
  2690. else if (pName.equalsIgnoreCase("AltSubclassEverywhere")) ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(pValue);
  2691. else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
  2692. else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
  2693. else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
  2694. else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(pValue);
  2695. else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
  2696. else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
  2697. else if (pName.equalsIgnoreCase("ChampionMaxLevel")) L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
  2698. else if (pName.equalsIgnoreCase("ChampionHp")) L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
  2699. else if (pName.equalsIgnoreCase("ChampionHpRegen")) L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
  2700. else if (pName.equalsIgnoreCase("ChampionRewards")) L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
  2701. else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(pValue);
  2702. else if (pName.equalsIgnoreCase("ChampionAtk")) L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
  2703. else if (pName.equalsIgnoreCase("ChampionSpdAtk")) L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
  2704. else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance")) L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  2705. else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance")) L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  2706. else if (pName.equalsIgnoreCase("ChampionRewardItemID")) L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
  2707. else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
  2708. else if (pName.equalsIgnoreCase("ChampionEnableInInstances")) L2JMOD_CHAMPION_ENABLE_IN_INSTANCES = Boolean.parseBoolean(pValue);
  2709. else if (pName.equalsIgnoreCase("AllowWedding")) L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(pValue);
  2710. else if (pName.equalsIgnoreCase("WeddingPrice")) L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
  2711. else if (pName.equalsIgnoreCase("WeddingPunishInfidelity")) L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
  2712. else if (pName.equalsIgnoreCase("WeddingTeleport")) L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
  2713. else if (pName.equalsIgnoreCase("WeddingTeleportPrice")) L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
  2714. else if (pName.equalsIgnoreCase("WeddingTeleportDuration")) L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
  2715. else if (pName.equalsIgnoreCase("WeddingAllowSameSex")) L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
  2716. else if (pName.equalsIgnoreCase("WeddingFormalWear")) L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
  2717. else if (pName.equalsIgnoreCase("WeddingDivorceCosts")) L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
  2718. else if (pName.equalsIgnoreCase("TvTEventEnabled")) TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  2719. else if (pName.equalsIgnoreCase("TvTEventInterval")) TVT_EVENT_INTERVAL = pValue.split(",");
  2720. else if (pName.equalsIgnoreCase("TvTEventParticipationTime")) TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  2721. else if (pName.equalsIgnoreCase("TvTEventRunningTime")) TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  2722. else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId")) TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  2723. else if (pName.equalsIgnoreCase("EnableWarehouseSortingClan")) L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
  2724. else if (pName.equalsIgnoreCase("EnableWarehouseSortingPrivate")) L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
  2725. else if (pName.equalsIgnoreCase("EnableManaPotionSupport")) L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(pValue);
  2726. else if (pName.equalsIgnoreCase("DisplayServerTime")) L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(pValue);
  2727. else if (pName.equalsIgnoreCase("AntiFeedEnable")) L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(pValue);
  2728. else if (pName.equalsIgnoreCase("AntiFeedDualbox")) L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(pValue);
  2729. else if (pName.equalsIgnoreCase("AntiFeedDisconnectedAsDualbox")) L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(pValue);
  2730. else if (pName.equalsIgnoreCase("AntiFeedInterval")) L2JMOD_ANTIFEED_INTERVAL = 1000*Integer.parseInt(pValue);
  2731. else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
  2732. else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
  2733. else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
  2734. else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);
  2735. else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.parseBoolean(pValue);
  2736. else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pValue);
  2737. else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);
  2738. else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
  2739. else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
  2740. else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
  2741. else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
  2742. else if (pName.equalsIgnoreCase("GMAdminMenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
  2743. else return false;
  2744. return true;
  2745. }
  2746. private Config() { }
  2747. /**
  2748. * Save hexadecimal ID of the server in the L2Properties file.
  2749. * @param string (String) : hexadecimal ID of the server to store
  2750. * @see HEXID_FILE
  2751. * @see saveHexid(String string, String fileName)
  2752. * @link LoginServerThread
  2753. */
  2754. public static void saveHexid(int serverId, String string)
  2755. {
  2756. Config.saveHexid(serverId, string, HEXID_FILE);
  2757. }
  2758. /**
  2759. * Save hexadecimal ID of the server in the L2Properties file.
  2760. * @param hexId (String) : hexadecimal ID of the server to store
  2761. * @param fileName (String) : name of the L2Properties file
  2762. */
  2763. public static void saveHexid(int serverId, String hexId, String fileName)
  2764. {
  2765. try
  2766. {
  2767. L2Properties hexSetting = new L2Properties();
  2768. File file = new File(fileName);
  2769. //Create a new empty file only if it doesn't exist
  2770. file.createNewFile();
  2771. OutputStream out = new FileOutputStream(file);
  2772. hexSetting.setProperty("ServerID",String.valueOf(serverId));
  2773. hexSetting.setProperty("HexID",hexId);
  2774. hexSetting.store(out,"the hexID to auth into login");
  2775. out.close();
  2776. }
  2777. catch (Exception e)
  2778. {
  2779. _log.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
  2780. e.printStackTrace();
  2781. }
  2782. }
  2783. /**
  2784. * Loads flood protector configurations.
  2785. */
  2786. private static void loadFloodProtectorConfigs(final L2Properties properties)
  2787. {
  2788. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4");
  2789. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
  2790. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42");
  2791. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16");
  2792. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100");
  2793. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", "5");
  2794. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20");
  2795. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10");
  2796. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
  2797. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1");
  2798. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", "10");
  2799. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SENDMAIL, "SendMail", "600");
  2800. }
  2801. /**
  2802. * Loads single flood protector configuration.
  2803. *
  2804. * @param properties
  2805. * L2Properties file reader
  2806. * @param config
  2807. * flood protector configuration instance
  2808. * @param configString
  2809. * flood protector configuration string that determines for which flood protector
  2810. * configuration should be read
  2811. * @param defaultInterval
  2812. * default flood protector interval
  2813. */
  2814. private static void loadFloodProtectorConfig(final L2Properties properties, final FloodProtectorConfig config, final String configString, final String defaultInterval)
  2815. {
  2816. config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval));
  2817. config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False"));
  2818. config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0"));
  2819. config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
  2820. config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0"));
  2821. }
  2822. public static class ClassMasterSettings
  2823. {
  2824. private TIntObjectHashMap<TIntIntHashMap> _claimItems;
  2825. private TIntObjectHashMap<TIntIntHashMap> _rewardItems;
  2826. private TIntObjectHashMap<Boolean> _allowedClassChange;
  2827. public ClassMasterSettings(String _configLine)
  2828. {
  2829. _claimItems = new TIntObjectHashMap<TIntIntHashMap>(3);
  2830. _rewardItems = new TIntObjectHashMap<TIntIntHashMap>(3);
  2831. _allowedClassChange = new TIntObjectHashMap<Boolean>(3);
  2832. if (_configLine != null)
  2833. parseConfigLine(_configLine.trim());
  2834. }
  2835. private void parseConfigLine(String _configLine)
  2836. {
  2837. StringTokenizer st = new StringTokenizer(_configLine, ";");
  2838. while (st.hasMoreTokens())
  2839. {
  2840. // get allowed class change
  2841. int job = Integer.parseInt(st.nextToken());
  2842. _allowedClassChange.put(job, true);
  2843. TIntIntHashMap _items = new TIntIntHashMap();
  2844. // parse items needed for class change
  2845. if (st.hasMoreTokens())
  2846. {
  2847. StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  2848. while (st2.hasMoreTokens())
  2849. {
  2850. StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  2851. int _itemId = Integer.parseInt(st3.nextToken());
  2852. int _quantity = Integer.parseInt(st3.nextToken());
  2853. _items.put(_itemId, _quantity);
  2854. }
  2855. }
  2856. _claimItems.put(job, _items);
  2857. _items = new TIntIntHashMap();
  2858. // parse gifts after class change
  2859. if (st.hasMoreTokens())
  2860. {
  2861. StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  2862. while (st2.hasMoreTokens())
  2863. {
  2864. StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  2865. int _itemId = Integer.parseInt(st3.nextToken());
  2866. int _quantity = Integer.parseInt(st3.nextToken());
  2867. _items.put(_itemId, _quantity);
  2868. }
  2869. }
  2870. _rewardItems.put(job, _items);
  2871. }
  2872. }
  2873. public boolean isAllowed(int job)
  2874. {
  2875. if (_allowedClassChange == null)
  2876. return false;
  2877. if (_allowedClassChange.containsKey(job))
  2878. return _allowedClassChange.get(job);
  2879. return false;
  2880. }
  2881. public TIntIntHashMap getRewardItems(int job)
  2882. {
  2883. if (_rewardItems.containsKey(job))
  2884. return _rewardItems.get(job);
  2885. return null;
  2886. }
  2887. public TIntIntHashMap getRequireItems(int job)
  2888. {
  2889. if (_claimItems.containsKey(job))
  2890. return _claimItems.get(job);
  2891. return null;
  2892. }
  2893. }
  2894. }