Config.java 213 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756
  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.lang.reflect.Field;
  29. import java.lang.reflect.Modifier;
  30. import java.math.BigInteger;
  31. import java.net.InetAddress;
  32. import java.net.UnknownHostException;
  33. import java.util.ArrayList;
  34. import java.util.Arrays;
  35. import java.util.List;
  36. import java.util.StringTokenizer;
  37. import java.util.logging.Level;
  38. import java.util.logging.Logger;
  39. import javax.xml.parsers.DocumentBuilderFactory;
  40. import org.w3c.dom.Document;
  41. import org.w3c.dom.NamedNodeMap;
  42. import org.w3c.dom.Node;
  43. import com.l2jserver.gameserver.util.FloodProtectorConfig;
  44. import com.l2jserver.util.L2Properties;
  45. import com.l2jserver.util.StringUtil;
  46. public final class Config
  47. {
  48. protected static final Logger _log = Logger.getLogger(Config.class.getName());
  49. //--------------------------------------------------
  50. // L2J Property File Definitions
  51. //--------------------------------------------------
  52. public static final String CHARACTER_CONFIG_FILE = "./config/Character.properties";
  53. public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
  54. public static final String FORTSIEGE_CONFIGURATION_FILE = "./config/fortsiege.properties";
  55. public static final String GENERAL_CONFIG_FILE = "./config/General.properties";
  56. public static final String HEXID_FILE = "./config/hexid.txt";
  57. public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
  58. public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
  59. public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
  60. public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
  61. public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
  62. public static final String NPC_CONFIG_FILE = "./config/NPC.properties";
  63. public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
  64. public static final String RATES_CONFIG_FILE = "./config/rates.properties";
  65. public static final String CONFIGURATION_FILE = "./config/server.properties";
  66. public static final String IP_CONFIG_FILE = "./config/ipconfig.xml";
  67. public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
  68. public static final String TW_CONFIGURATION_FILE = "./config/territorywar.properties";
  69. public static final String TELNET_FILE = "./config/telnet.properties";
  70. public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
  71. public static final String MMO_CONFIG_FILE = "./config/mmo.properties";
  72. public static final String OLYMPIAD_CONFIG_FILE = "./config/olympiad.properties";
  73. public static final String COMMUNITY_CONFIGURATION_FILE = "./config/CommunityServer.properties";
  74. public static final String GRANDBOSS_CONFIG_FILE = "./config/Grandboss.properties";
  75. public static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.properties";
  76. public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
  77. public static final String SECURITY_CONFIG_FILE = "./config/security.properties";
  78. public static final String EMAIL_CONFIG_FILE = "./config/email.properties";
  79. public static final String CH_SIEGE_FILE = "./config/ConquerableHallSiege.properties";
  80. //--------------------------------------------------
  81. // L2J Variable Definitions
  82. //--------------------------------------------------
  83. public static int MASTERACCESS_LEVEL;
  84. public static int MASTERACCESS_NAME_COLOR;
  85. public static int MASTERACCESS_TITLE_COLOR;
  86. public static boolean ALT_GAME_DELEVEL;
  87. public static boolean DECREASE_SKILL_LEVEL;
  88. public static double ALT_WEIGHT_LIMIT;
  89. public static int RUN_SPD_BOOST;
  90. public static int DEATH_PENALTY_CHANCE;
  91. public static double RESPAWN_RESTORE_CP;
  92. public static double RESPAWN_RESTORE_HP;
  93. public static double RESPAWN_RESTORE_MP;
  94. public static boolean ALT_GAME_TIREDNESS;
  95. public static boolean ENABLE_MODIFY_SKILL_DURATION;
  96. public static TIntIntHashMap SKILL_DURATION_LIST;
  97. public static boolean ENABLE_MODIFY_SKILL_REUSE;
  98. public static TIntIntHashMap SKILL_REUSE_LIST;
  99. public static boolean AUTO_LEARN_SKILLS;
  100. public static boolean AUTO_LEARN_FS_SKILLS;
  101. public static boolean AUTO_LOOT_HERBS;
  102. public static byte BUFFS_MAX_AMOUNT;
  103. public static byte TRIGGERED_BUFFS_MAX_AMOUNT;
  104. public static byte DANCES_MAX_AMOUNT;
  105. public static boolean DANCE_CANCEL_BUFF;
  106. public static boolean DANCE_CONSUME_ADDITIONAL_MP;
  107. public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
  108. public static boolean ALT_GAME_CANCEL_BOW;
  109. public static boolean ALT_GAME_CANCEL_CAST;
  110. public static boolean EFFECT_CANCELING;
  111. public static boolean ALT_GAME_MAGICFAILURES;
  112. public static int PLAYER_FAKEDEATH_UP_PROTECTION;
  113. public static boolean STORE_SKILL_COOLTIME;
  114. public static boolean SUBCLASS_STORE_SKILL_COOLTIME;
  115. public static boolean SUMMON_STORE_SKILL_COOLTIME;
  116. public static boolean ALT_GAME_SHIELD_BLOCKS;
  117. public static int ALT_PERFECT_SHLD_BLOCK;
  118. public static boolean ALLOW_CLASS_MASTERS;
  119. public static ClassMasterSettings CLASS_MASTER_SETTINGS;
  120. public static boolean ALLOW_ENTIRE_TREE;
  121. public static boolean ALTERNATE_CLASS_MASTER;
  122. public static boolean LIFE_CRYSTAL_NEEDED;
  123. public static boolean ES_SP_BOOK_NEEDED;
  124. public static boolean DIVINE_SP_BOOK_NEEDED;
  125. public static boolean ALT_GAME_SKILL_LEARN;
  126. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  127. public static boolean ALT_GAME_SUBCLASS_EVERYWHERE;
  128. public static boolean ALLOW_TRANSFORM_WITHOUT_QUEST;
  129. public static int FEE_DELETE_TRANSFER_SKILLS;
  130. public static int FEE_DELETE_SUBCLASS_SKILLS;
  131. public static boolean RESTORE_SERVITOR_ON_RECONNECT;
  132. public static boolean RESTORE_PET_ON_RECONNECT;
  133. public static int MAX_RUN_SPEED;
  134. public static int MAX_PCRIT_RATE;
  135. public static int MAX_MCRIT_RATE;
  136. public static int MAX_PATK_SPEED;
  137. public static int MAX_MATK_SPEED;
  138. public static int MAX_EVASION;
  139. public static int MIN_DEBUFF_CHANCE;
  140. public static int MAX_DEBUFF_CHANCE;
  141. public static byte MAX_SUBCLASS;
  142. public static byte BASE_SUBCLASS_LEVEL;
  143. public static byte MAX_SUBCLASS_LEVEL;
  144. public static int MAX_PVTSTORESELL_SLOTS_DWARF;
  145. public static int MAX_PVTSTORESELL_SLOTS_OTHER;
  146. public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
  147. public static int MAX_PVTSTOREBUY_SLOTS_OTHER;
  148. public static int INVENTORY_MAXIMUM_NO_DWARF;
  149. public static int INVENTORY_MAXIMUM_DWARF;
  150. public static int INVENTORY_MAXIMUM_GM;
  151. public static int INVENTORY_MAXIMUM_QUEST_ITEMS;
  152. public static int WAREHOUSE_SLOTS_DWARF;
  153. public static int WAREHOUSE_SLOTS_NO_DWARF;
  154. public static int WAREHOUSE_SLOTS_CLAN;
  155. public static int ALT_FREIGHT_SLOTS;
  156. public static int ALT_FREIGHT_PRIECE;
  157. public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
  158. public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
  159. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
  160. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
  161. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
  162. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
  163. public static int MAX_PERSONAL_FAME_POINTS;
  164. public static int FORTRESS_ZONE_FAME_TASK_FREQUENCY;
  165. public static int FORTRESS_ZONE_FAME_AQUIRE_POINTS;
  166. public static int CASTLE_ZONE_FAME_TASK_FREQUENCY;
  167. public static int CASTLE_ZONE_FAME_AQUIRE_POINTS;
  168. public static boolean FAME_FOR_DEAD_PLAYERS;
  169. public static boolean IS_CRAFTING_ENABLED;
  170. public static boolean CRAFT_MASTERWORK;
  171. public static int DWARF_RECIPE_LIMIT;
  172. public static int COMMON_RECIPE_LIMIT;
  173. public static boolean ALT_GAME_CREATION;
  174. public static double ALT_GAME_CREATION_SPEED;
  175. public static double ALT_GAME_CREATION_XP_RATE;
  176. public static double ALT_GAME_CREATION_RARE_XPSP_RATE;
  177. public static double ALT_GAME_CREATION_SP_RATE;
  178. public static boolean ALT_BLACKSMITH_USE_RECIPES;
  179. public static int ALT_CLAN_JOIN_DAYS;
  180. public static int ALT_CLAN_CREATE_DAYS;
  181. public static int ALT_CLAN_DISSOLVE_DAYS;
  182. public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
  183. public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
  184. public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
  185. public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
  186. public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
  187. public static int ALT_CLAN_MEMBERS_FOR_WAR;
  188. public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
  189. public static boolean REMOVE_CASTLE_CIRCLETS;
  190. public static int ALT_PARTY_RANGE;
  191. public static int ALT_PARTY_RANGE2;
  192. public static boolean ALT_LEAVE_PARTY_LEADER;
  193. public static long STARTING_ADENA;
  194. public static byte STARTING_LEVEL;
  195. public static int STARTING_SP;
  196. public static boolean AUTO_LOOT;
  197. public static boolean AUTO_LOOT_RAIDS;
  198. public static int LOOT_RAIDS_PRIVILEGE_INTERVAL;
  199. public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE;
  200. public static int UNSTUCK_INTERVAL;
  201. public static int TELEPORT_WATCHDOG_TIMEOUT;
  202. public static int PLAYER_SPAWN_PROTECTION;
  203. public static ArrayList<Integer> SPAWN_PROTECTION_ALLOWED_ITEMS;
  204. public static int PLAYER_TELEPORT_PROTECTION;
  205. public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED;
  206. public static boolean OFFSET_ON_TELEPORT_ENABLED;
  207. public static int MAX_OFFSET_ON_TELEPORT;
  208. public static boolean RESTORE_PLAYER_INSTANCE;
  209. public static boolean ALLOW_SUMMON_TO_INSTANCE;
  210. public static boolean PETITIONING_ALLOWED;
  211. public static int MAX_PETITIONS_PER_PLAYER;
  212. public static int MAX_PETITIONS_PENDING;
  213. public static boolean ALT_GAME_FREE_TELEPORT;
  214. public static int DELETE_DAYS;
  215. public static float ALT_GAME_EXPONENT_XP;
  216. public static float ALT_GAME_EXPONENT_SP;
  217. public static String PARTY_XP_CUTOFF_METHOD;
  218. public static double PARTY_XP_CUTOFF_PERCENT;
  219. public static int PARTY_XP_CUTOFF_LEVEL;
  220. public static boolean DISABLE_TUTORIAL;
  221. public static boolean EXPERTISE_PENALTY;
  222. public static boolean STORE_RECIPE_SHOPLIST;
  223. public static boolean STORE_UI_SETTINGS;
  224. public static String[] FORBIDDEN_NAMES;
  225. public static boolean SILENCE_MODE_EXCLUDE;
  226. //--------------------------------------------------
  227. // ClanHall Settings
  228. //--------------------------------------------------
  229. public static long CH_TELE_FEE_RATIO;
  230. public static int CH_TELE1_FEE;
  231. public static int CH_TELE2_FEE;
  232. public static long CH_ITEM_FEE_RATIO;
  233. public static int CH_ITEM1_FEE;
  234. public static int CH_ITEM2_FEE;
  235. public static int CH_ITEM3_FEE;
  236. public static long CH_MPREG_FEE_RATIO;
  237. public static int CH_MPREG1_FEE;
  238. public static int CH_MPREG2_FEE;
  239. public static int CH_MPREG3_FEE;
  240. public static int CH_MPREG4_FEE;
  241. public static int CH_MPREG5_FEE;
  242. public static long CH_HPREG_FEE_RATIO;
  243. public static int CH_HPREG1_FEE;
  244. public static int CH_HPREG2_FEE;
  245. public static int CH_HPREG3_FEE;
  246. public static int CH_HPREG4_FEE;
  247. public static int CH_HPREG5_FEE;
  248. public static int CH_HPREG6_FEE;
  249. public static int CH_HPREG7_FEE;
  250. public static int CH_HPREG8_FEE;
  251. public static int CH_HPREG9_FEE;
  252. public static int CH_HPREG10_FEE;
  253. public static int CH_HPREG11_FEE;
  254. public static int CH_HPREG12_FEE;
  255. public static int CH_HPREG13_FEE;
  256. public static long CH_EXPREG_FEE_RATIO;
  257. public static int CH_EXPREG1_FEE;
  258. public static int CH_EXPREG2_FEE;
  259. public static int CH_EXPREG3_FEE;
  260. public static int CH_EXPREG4_FEE;
  261. public static int CH_EXPREG5_FEE;
  262. public static int CH_EXPREG6_FEE;
  263. public static int CH_EXPREG7_FEE;
  264. public static long CH_SUPPORT_FEE_RATIO;
  265. public static int CH_SUPPORT1_FEE;
  266. public static int CH_SUPPORT2_FEE;
  267. public static int CH_SUPPORT3_FEE;
  268. public static int CH_SUPPORT4_FEE;
  269. public static int CH_SUPPORT5_FEE;
  270. public static int CH_SUPPORT6_FEE;
  271. public static int CH_SUPPORT7_FEE;
  272. public static int CH_SUPPORT8_FEE;
  273. public static long CH_CURTAIN_FEE_RATIO;
  274. public static int CH_CURTAIN1_FEE;
  275. public static int CH_CURTAIN2_FEE;
  276. public static long CH_FRONT_FEE_RATIO;
  277. public static int CH_FRONT1_FEE;
  278. public static int CH_FRONT2_FEE;
  279. public static boolean CH_BUFF_FREE;
  280. //--------------------------------------------------
  281. // Castle Settings
  282. //--------------------------------------------------
  283. public static long CS_TELE_FEE_RATIO;
  284. public static int CS_TELE1_FEE;
  285. public static int CS_TELE2_FEE;
  286. public static long CS_MPREG_FEE_RATIO;
  287. public static int CS_MPREG1_FEE;
  288. public static int CS_MPREG2_FEE;
  289. public static int CS_MPREG3_FEE;
  290. public static int CS_MPREG4_FEE;
  291. public static long CS_HPREG_FEE_RATIO;
  292. public static int CS_HPREG1_FEE;
  293. public static int CS_HPREG2_FEE;
  294. public static int CS_HPREG3_FEE;
  295. public static int CS_HPREG4_FEE;
  296. public static int CS_HPREG5_FEE;
  297. public static long CS_EXPREG_FEE_RATIO;
  298. public static int CS_EXPREG1_FEE;
  299. public static int CS_EXPREG2_FEE;
  300. public static int CS_EXPREG3_FEE;
  301. public static int CS_EXPREG4_FEE;
  302. public static long CS_SUPPORT_FEE_RATIO;
  303. public static int CS_SUPPORT1_FEE;
  304. public static int CS_SUPPORT2_FEE;
  305. public static int CS_SUPPORT3_FEE;
  306. public static int CS_SUPPORT4_FEE;
  307. public static List<String> CL_SET_SIEGE_TIME_LIST;
  308. public static List<Integer> SIEGE_HOUR_LIST_MORNING;
  309. public static List<Integer> SIEGE_HOUR_LIST_AFTERNOON;
  310. //--------------------------------------------------
  311. // Fortress Settings
  312. //--------------------------------------------------
  313. public static long FS_TELE_FEE_RATIO;
  314. public static int FS_TELE1_FEE;
  315. public static int FS_TELE2_FEE;
  316. public static long FS_MPREG_FEE_RATIO;
  317. public static int FS_MPREG1_FEE;
  318. public static int FS_MPREG2_FEE;
  319. public static long FS_HPREG_FEE_RATIO;
  320. public static int FS_HPREG1_FEE;
  321. public static int FS_HPREG2_FEE;
  322. public static long FS_EXPREG_FEE_RATIO;
  323. public static int FS_EXPREG1_FEE;
  324. public static int FS_EXPREG2_FEE;
  325. public static long FS_SUPPORT_FEE_RATIO;
  326. public static int FS_SUPPORT1_FEE;
  327. public static int FS_SUPPORT2_FEE;
  328. public static int FS_BLOOD_OATH_COUNT;
  329. public static int FS_UPDATE_FRQ;
  330. public static int FS_MAX_SUPPLY_LEVEL;
  331. public static int FS_FEE_FOR_CASTLE;
  332. public static int FS_MAX_OWN_TIME;
  333. //--------------------------------------------------
  334. // Feature Settings
  335. //--------------------------------------------------
  336. public static int TAKE_FORT_POINTS;
  337. public static int LOOSE_FORT_POINTS;
  338. public static int TAKE_CASTLE_POINTS;
  339. public static int LOOSE_CASTLE_POINTS;
  340. public static int CASTLE_DEFENDED_POINTS;
  341. public static int FESTIVAL_WIN_POINTS;
  342. public static int HERO_POINTS;
  343. public static int ROYAL_GUARD_COST;
  344. public static int KNIGHT_UNIT_COST;
  345. public static int KNIGHT_REINFORCE_COST;
  346. public static int BALLISTA_POINTS;
  347. public static int BLOODALLIANCE_POINTS;
  348. public static int BLOODOATH_POINTS;
  349. public static int KNIGHTSEPAULETTE_POINTS;
  350. public static int REPUTATION_SCORE_PER_KILL;
  351. public static int JOIN_ACADEMY_MIN_REP_SCORE;
  352. public static int JOIN_ACADEMY_MAX_REP_SCORE;
  353. public static int RAID_RANKING_1ST;
  354. public static int RAID_RANKING_2ND;
  355. public static int RAID_RANKING_3RD;
  356. public static int RAID_RANKING_4TH;
  357. public static int RAID_RANKING_5TH;
  358. public static int RAID_RANKING_6TH;
  359. public static int RAID_RANKING_7TH;
  360. public static int RAID_RANKING_8TH;
  361. public static int RAID_RANKING_9TH;
  362. public static int RAID_RANKING_10TH;
  363. public static int RAID_RANKING_UP_TO_50TH;
  364. public static int RAID_RANKING_UP_TO_100TH;
  365. public static int CLAN_LEVEL_6_COST;
  366. public static int CLAN_LEVEL_7_COST;
  367. public static int CLAN_LEVEL_8_COST;
  368. public static int CLAN_LEVEL_9_COST;
  369. public static int CLAN_LEVEL_10_COST;
  370. public static int CLAN_LEVEL_11_COST;
  371. public static int CLAN_LEVEL_6_REQUIREMENT;
  372. public static int CLAN_LEVEL_7_REQUIREMENT;
  373. public static int CLAN_LEVEL_8_REQUIREMENT;
  374. public static int CLAN_LEVEL_9_REQUIREMENT;
  375. public static int CLAN_LEVEL_10_REQUIREMENT;
  376. public static int CLAN_LEVEL_11_REQUIREMENT;
  377. public static boolean ALLOW_WYVERN_DURING_SIEGE;
  378. //--------------------------------------------------
  379. // General Settings
  380. //--------------------------------------------------
  381. public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
  382. public static boolean DISPLAY_SERVER_VERSION;
  383. public static boolean SERVER_LIST_BRACKET;
  384. public static int SERVER_LIST_TYPE;
  385. public static int SERVER_LIST_AGE;
  386. public static boolean SERVER_GMONLY;
  387. public static boolean GM_HERO_AURA;
  388. public static boolean GM_STARTUP_INVULNERABLE;
  389. public static boolean GM_STARTUP_INVISIBLE;
  390. public static boolean GM_STARTUP_SILENCE;
  391. public static boolean GM_STARTUP_AUTO_LIST;
  392. public static boolean GM_STARTUP_DIET_MODE;
  393. public static String GM_ADMIN_MENU_STYLE;
  394. public static boolean GM_ITEM_RESTRICTION;
  395. public static boolean GM_SKILL_RESTRICTION;
  396. public static boolean GM_TRADE_RESTRICTED_ITEMS;
  397. public static boolean GM_RESTART_FIGHTING;
  398. public static boolean GM_ANNOUNCER_NAME;
  399. public static boolean GM_GIVE_SPECIAL_SKILLS;
  400. public static boolean GM_GIVE_SPECIAL_AURA_SKILLS;
  401. public static boolean BYPASS_VALIDATION;
  402. public static boolean GAMEGUARD_ENFORCE;
  403. public static boolean GAMEGUARD_PROHIBITACTION;
  404. public static boolean LOG_CHAT;
  405. public static boolean LOG_ITEMS;
  406. public static boolean LOG_ITEMS_SMALL_LOG;
  407. public static boolean LOG_ITEM_ENCHANTS;
  408. public static boolean LOG_SKILL_ENCHANTS;
  409. public static boolean GMAUDIT;
  410. public static boolean LOG_GAME_DAMAGE;
  411. public static int LOG_GAME_DAMAGE_THRESHOLD;
  412. public static boolean SKILL_CHECK_ENABLE;
  413. public static boolean SKILL_CHECK_REMOVE;
  414. public static boolean SKILL_CHECK_GM;
  415. public static boolean DEBUG;
  416. public static boolean PACKET_HANDLER_DEBUG;
  417. public static boolean DEVELOPER;
  418. public static boolean ACCEPT_GEOEDITOR_CONN;
  419. public static boolean ALT_DEV_NO_HANDLERS;
  420. public static boolean ALT_DEV_NO_QUESTS;
  421. public static boolean ALT_DEV_NO_SPAWNS;
  422. public static int THREAD_P_EFFECTS;
  423. public static int THREAD_P_GENERAL;
  424. public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  425. public static int IO_PACKET_THREAD_CORE_SIZE;
  426. public static int GENERAL_THREAD_CORE_SIZE;
  427. public static int AI_MAX_THREAD;
  428. public static int CLIENT_PACKET_QUEUE_SIZE;
  429. public static int CLIENT_PACKET_QUEUE_MAX_BURST_SIZE;
  430. public static int CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND;
  431. public static int CLIENT_PACKET_QUEUE_MEASURE_INTERVAL;
  432. public static int CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND;
  433. public static int CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN;
  434. public static int CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN;
  435. public static int CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN;
  436. public static int CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN;
  437. public static boolean DEADLOCK_DETECTOR;
  438. public static int DEADLOCK_CHECK_INTERVAL;
  439. public static boolean RESTART_ON_DEADLOCK;
  440. public static boolean ALLOW_DISCARDITEM;
  441. public static int AUTODESTROY_ITEM_AFTER;
  442. public static int HERB_AUTO_DESTROY_TIME;
  443. public static TIntArrayList LIST_PROTECTED_ITEMS;
  444. public static boolean DATABASE_CLEAN_UP;
  445. public static long CONNECTION_CLOSE_TIME;
  446. public static int CHAR_STORE_INTERVAL;
  447. public static boolean LAZY_ITEMS_UPDATE;
  448. public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
  449. public static boolean DESTROY_DROPPED_PLAYER_ITEM;
  450. public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
  451. public static boolean SAVE_DROPPED_ITEM;
  452. public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
  453. public static int SAVE_DROPPED_ITEM_INTERVAL;
  454. public static boolean CLEAR_DROPPED_ITEM_TABLE;
  455. public static boolean AUTODELETE_INVALID_QUEST_DATA;
  456. public static boolean PRECISE_DROP_CALCULATION;
  457. public static boolean MULTIPLE_ITEM_DROP;
  458. public static boolean FORCE_INVENTORY_UPDATE;
  459. public static boolean LAZY_CACHE;
  460. public static boolean CACHE_CHAR_NAMES;
  461. public static int MIN_NPC_ANIMATION;
  462. public static int MAX_NPC_ANIMATION;
  463. public static int MIN_MONSTER_ANIMATION;
  464. public static int MAX_MONSTER_ANIMATION;
  465. public static int COORD_SYNCHRONIZE;
  466. public static boolean ENABLE_FALLING_DAMAGE;
  467. public static boolean GRIDS_ALWAYS_ON;
  468. public static int GRID_NEIGHBOR_TURNON_TIME;
  469. public static int GRID_NEIGHBOR_TURNOFF_TIME;
  470. public static int WORLD_X_MIN;
  471. public static int WORLD_X_MAX;
  472. public static int WORLD_Y_MIN;
  473. public static int WORLD_Y_MAX;
  474. public static int GEODATA;
  475. public static boolean GEODATA_CELLFINDING;
  476. public static String PATHFIND_BUFFERS;
  477. public static float LOW_WEIGHT;
  478. public static float MEDIUM_WEIGHT;
  479. public static float HIGH_WEIGHT;
  480. public static boolean ADVANCED_DIAGONAL_STRATEGY;
  481. public static float DIAGONAL_WEIGHT;
  482. public static int MAX_POSTFILTER_PASSES;
  483. public static boolean DEBUG_PATH;
  484. public static boolean FORCE_GEODATA;
  485. public static boolean MOVE_BASED_KNOWNLIST;
  486. public static long KNOWNLIST_UPDATE_INTERVAL;
  487. public static int ZONE_TOWN;
  488. public static String DEFAULT_GLOBAL_CHAT;
  489. public static String DEFAULT_TRADE_CHAT;
  490. public static boolean ALLOW_WAREHOUSE;
  491. public static boolean WAREHOUSE_CACHE;
  492. public static int WAREHOUSE_CACHE_TIME;
  493. public static boolean ALLOW_REFUND;
  494. public static boolean ALLOW_MAIL;
  495. public static boolean ALLOW_ATTACHMENTS;
  496. public static boolean ALLOW_WEAR;
  497. public static int WEAR_DELAY;
  498. public static int WEAR_PRICE;
  499. public static boolean ALLOW_LOTTERY;
  500. public static boolean ALLOW_RACE;
  501. public static boolean ALLOW_WATER;
  502. public static boolean ALLOW_RENTPET;
  503. public static boolean ALLOWFISHING;
  504. public static boolean ALLOW_BOAT;
  505. public static int BOAT_BROADCAST_RADIUS;
  506. public static boolean ALLOW_CURSED_WEAPONS;
  507. public static boolean ALLOW_MANOR;
  508. public static boolean ALLOW_NPC_WALKERS;
  509. public static boolean ALLOW_PET_WALKERS;
  510. public static boolean SERVER_NEWS;
  511. public static int COMMUNITY_TYPE;
  512. public static boolean BBS_SHOW_PLAYERLIST;
  513. public static String BBS_DEFAULT;
  514. public static boolean SHOW_LEVEL_COMMUNITYBOARD;
  515. public static boolean SHOW_STATUS_COMMUNITYBOARD;
  516. public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
  517. public static int NAME_PER_ROW_COMMUNITYBOARD;
  518. public static boolean USE_SAY_FILTER;
  519. public static String CHAT_FILTER_CHARS;
  520. public static int[] BAN_CHAT_CHANNELS;
  521. public static int ALT_OLY_START_TIME;
  522. public static int ALT_OLY_MIN;
  523. public static long ALT_OLY_CPERIOD;
  524. public static long ALT_OLY_BATTLE;
  525. public static long ALT_OLY_WPERIOD;
  526. public static long ALT_OLY_VPERIOD;
  527. public static int ALT_OLY_START_POINTS;
  528. public static int ALT_OLY_WEEKLY_POINTS;
  529. public static int ALT_OLY_CLASSED;
  530. public static int ALT_OLY_NONCLASSED;
  531. public static int ALT_OLY_TEAMS;
  532. public static int ALT_OLY_REG_DISPLAY;
  533. public static int[][] ALT_OLY_CLASSED_REWARD;
  534. public static int[][] ALT_OLY_NONCLASSED_REWARD;
  535. public static int[][] ALT_OLY_TEAM_REWARD;
  536. public static int ALT_OLY_COMP_RITEM;
  537. public static int ALT_OLY_MIN_MATCHES;
  538. public static int ALT_OLY_GP_PER_POINT;
  539. public static int ALT_OLY_HERO_POINTS;
  540. public static int ALT_OLY_RANK1_POINTS;
  541. public static int ALT_OLY_RANK2_POINTS;
  542. public static int ALT_OLY_RANK3_POINTS;
  543. public static int ALT_OLY_RANK4_POINTS;
  544. public static int ALT_OLY_RANK5_POINTS;
  545. public static int ALT_OLY_MAX_POINTS;
  546. public static int ALT_OLY_DIVIDER_CLASSED;
  547. public static int ALT_OLY_DIVIDER_NON_CLASSED;
  548. public static int ALT_OLY_MAX_WEEKLY_MATCHES;
  549. public static int ALT_OLY_MAX_WEEKLY_MATCHES_NON_CLASSED;
  550. public static int ALT_OLY_MAX_WEEKLY_MATCHES_CLASSED;
  551. public static int ALT_OLY_MAX_WEEKLY_MATCHES_TEAM;
  552. public static boolean ALT_OLY_LOG_FIGHTS;
  553. public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
  554. public static boolean ALT_OLY_ANNOUNCE_GAMES;
  555. public static TIntArrayList LIST_OLY_RESTRICTED_ITEMS;
  556. public static int ALT_OLY_ENCHANT_LIMIT;
  557. public static int ALT_OLY_WAIT_TIME;
  558. public static int ALT_MANOR_REFRESH_TIME;
  559. public static int ALT_MANOR_REFRESH_MIN;
  560. public static int ALT_MANOR_APPROVE_TIME;
  561. public static int ALT_MANOR_APPROVE_MIN;
  562. public static int ALT_MANOR_MAINTENANCE_PERIOD;
  563. public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
  564. public static int ALT_MANOR_SAVE_PERIOD_RATE;
  565. public static long ALT_LOTTERY_PRIZE;
  566. public static long ALT_LOTTERY_TICKET_PRICE;
  567. public static float ALT_LOTTERY_5_NUMBER_RATE;
  568. public static float ALT_LOTTERY_4_NUMBER_RATE;
  569. public static float ALT_LOTTERY_3_NUMBER_RATE;
  570. public static long ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
  571. public static boolean ALT_ITEM_AUCTION_ENABLED;
  572. public static int ALT_ITEM_AUCTION_EXPIRED_AFTER;
  573. public static long ALT_ITEM_AUCTION_TIME_EXTENDS_ON_BID;
  574. public static int FS_TIME_ATTACK;
  575. public static int FS_TIME_COOLDOWN;
  576. public static int FS_TIME_ENTRY;
  577. public static int FS_TIME_WARMUP;
  578. public static int FS_PARTY_MEMBER_COUNT;
  579. public static int RIFT_MIN_PARTY_SIZE;
  580. public static int RIFT_SPAWN_DELAY;
  581. public static int RIFT_MAX_JUMPS;
  582. public static int RIFT_AUTO_JUMPS_TIME_MIN;
  583. public static int RIFT_AUTO_JUMPS_TIME_MAX;
  584. public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
  585. public static int RIFT_ENTER_COST_RECRUIT;
  586. public static int RIFT_ENTER_COST_SOLDIER;
  587. public static int RIFT_ENTER_COST_OFFICER;
  588. public static int RIFT_ENTER_COST_CAPTAIN;
  589. public static int RIFT_ENTER_COST_COMMANDER;
  590. public static int RIFT_ENTER_COST_HERO;
  591. public static int DEFAULT_PUNISH;
  592. public static int DEFAULT_PUNISH_PARAM;
  593. public static boolean ONLY_GM_ITEMS_FREE;
  594. public static boolean JAIL_IS_PVP;
  595. public static boolean JAIL_DISABLE_CHAT;
  596. public static boolean JAIL_DISABLE_TRANSACTION;
  597. public static boolean CUSTOM_SPAWNLIST_TABLE;
  598. public static boolean SAVE_GMSPAWN_ON_CUSTOM;
  599. public static boolean CUSTOM_NPC_TABLE;
  600. public static boolean CUSTOM_NPC_SKILLS_TABLE;
  601. public static boolean CUSTOM_ARMORSETS_TABLE;
  602. public static boolean CUSTOM_TELEPORT_TABLE;
  603. public static boolean CUSTOM_DROPLIST_TABLE;
  604. public static boolean CUSTOM_MERCHANT_TABLES;
  605. public static boolean CUSTOM_NPCBUFFER_TABLES;
  606. public static boolean CUSTOM_SKILLS_LOAD;
  607. public static boolean CUSTOM_ITEMS_LOAD;
  608. public static boolean CUSTOM_MULTISELL_LOAD;
  609. public static int ALT_BIRTHDAY_GIFT;
  610. public static String ALT_BIRTHDAY_MAIL_SUBJECT;
  611. public static String ALT_BIRTHDAY_MAIL_TEXT;
  612. public static boolean ENABLE_BLOCK_CHECKER_EVENT;
  613. public static int MIN_BLOCK_CHECKER_TEAM_MEMBERS;
  614. public static boolean HBCE_FAIR_PLAY;
  615. public static int PLAYER_MOVEMENT_BLOCK_TIME;
  616. public static boolean CLEAR_CREST_CACHE;
  617. //--------------------------------------------------
  618. // FloodProtector Settings
  619. //--------------------------------------------------
  620. public static FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM;
  621. public static FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE;
  622. public static FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK;
  623. public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON;
  624. public static FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE;
  625. public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
  626. public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS;
  627. public static FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM;
  628. public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS;
  629. public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
  630. public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
  631. public static FloodProtectorConfig FLOOD_PROTECTOR_MANUFACTURE;
  632. public static FloodProtectorConfig FLOOD_PROTECTOR_MANOR;
  633. public static FloodProtectorConfig FLOOD_PROTECTOR_SENDMAIL;
  634. public static FloodProtectorConfig FLOOD_PROTECTOR_CHARACTER_SELECT;
  635. public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_AUCTION;
  636. //--------------------------------------------------
  637. // L2JMods Settings
  638. //--------------------------------------------------
  639. public static boolean L2JMOD_CHAMPION_ENABLE;
  640. public static boolean L2JMOD_CHAMPION_PASSIVE;
  641. public static int L2JMOD_CHAMPION_FREQUENCY;
  642. public static String L2JMOD_CHAMP_TITLE;
  643. public static int L2JMOD_CHAMP_MIN_LVL;
  644. public static int L2JMOD_CHAMP_MAX_LVL;
  645. public static int L2JMOD_CHAMPION_HP;
  646. public static int L2JMOD_CHAMPION_REWARDS;
  647. public static float L2JMOD_CHAMPION_ADENAS_REWARDS;
  648. public static float L2JMOD_CHAMPION_HP_REGEN;
  649. public static float L2JMOD_CHAMPION_ATK;
  650. public static float L2JMOD_CHAMPION_SPD_ATK;
  651. public static int L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
  652. public static int L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
  653. public static int L2JMOD_CHAMPION_REWARD_ID;
  654. public static int L2JMOD_CHAMPION_REWARD_QTY;
  655. public static boolean L2JMOD_CHAMPION_ENABLE_VITALITY;
  656. public static boolean L2JMOD_CHAMPION_ENABLE_IN_INSTANCES;
  657. public static boolean TVT_EVENT_ENABLED;
  658. public static boolean TVT_EVENT_IN_INSTANCE;
  659. public static String TVT_EVENT_INSTANCE_FILE;
  660. public static String[] TVT_EVENT_INTERVAL;
  661. public static int TVT_EVENT_PARTICIPATION_TIME;
  662. public static int TVT_EVENT_RUNNING_TIME;
  663. public static int TVT_EVENT_PARTICIPATION_NPC_ID;
  664. public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  665. public static int[] TVT_EVENT_PARTICIPATION_FEE = new int[2];
  666. public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
  667. public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
  668. public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
  669. public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
  670. public static String TVT_EVENT_TEAM_1_NAME;
  671. public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  672. public static String TVT_EVENT_TEAM_2_NAME;
  673. public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  674. public static List<int[]> TVT_EVENT_REWARDS;
  675. public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  676. public static boolean TVT_EVENT_SCROLL_ALLOWED;
  677. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  678. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  679. public static List<Integer> TVT_DOORS_IDS_TO_OPEN;
  680. public static List<Integer> TVT_DOORS_IDS_TO_CLOSE;
  681. public static boolean TVT_REWARD_TEAM_TIE;
  682. public static byte TVT_EVENT_MIN_LVL;
  683. public static byte TVT_EVENT_MAX_LVL;
  684. public static int TVT_EVENT_EFFECTS_REMOVAL;
  685. public static TIntIntHashMap TVT_EVENT_FIGHTER_BUFFS;
  686. public static TIntIntHashMap TVT_EVENT_MAGE_BUFFS;
  687. public static int TVT_EVENT_MAX_PARTICIPANTS_PER_IP;
  688. public static boolean TVT_ALLOW_VOICED_COMMAND;
  689. public static boolean L2JMOD_ALLOW_WEDDING;
  690. public static int L2JMOD_WEDDING_PRICE;
  691. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  692. public static boolean L2JMOD_WEDDING_TELEPORT;
  693. public static int L2JMOD_WEDDING_TELEPORT_PRICE;
  694. public static int L2JMOD_WEDDING_TELEPORT_DURATION;
  695. public static boolean L2JMOD_WEDDING_SAMESEX;
  696. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  697. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  698. public static boolean L2JMOD_HELLBOUND_STATUS;
  699. public static boolean BANKING_SYSTEM_ENABLED;
  700. public static int BANKING_SYSTEM_GOLDBARS;
  701. public static int BANKING_SYSTEM_ADENA;
  702. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
  703. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
  704. public static boolean OFFLINE_TRADE_ENABLE;
  705. public static boolean OFFLINE_CRAFT_ENABLE;
  706. public static boolean OFFLINE_MODE_IN_PEACE_ZONE;
  707. public static boolean OFFLINE_MODE_SET_INVULNERABLE;
  708. public static boolean RESTORE_OFFLINERS;
  709. public static int OFFLINE_MAX_DAYS;
  710. public static boolean OFFLINE_DISCONNECT_FINISHED;
  711. public static boolean OFFLINE_SET_NAME_COLOR;
  712. public static int OFFLINE_NAME_COLOR;
  713. public static boolean OFFLINE_FAME;
  714. public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
  715. public static boolean L2JMOD_DISPLAY_SERVER_TIME;
  716. public static boolean WELCOME_MESSAGE_ENABLED;
  717. public static String WELCOME_MESSAGE_TEXT;
  718. public static int WELCOME_MESSAGE_TIME;
  719. public static boolean L2JMOD_ANTIFEED_ENABLE;
  720. public static boolean L2JMOD_ANTIFEED_DUALBOX;
  721. public static boolean L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX;
  722. public static int L2JMOD_ANTIFEED_INTERVAL;
  723. public static boolean ANNOUNCE_PK_PVP;
  724. public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE;
  725. public static String ANNOUNCE_PK_MSG;
  726. public static String ANNOUNCE_PVP_MSG;
  727. public static boolean L2JMOD_CHAT_ADMIN;
  728. public static boolean L2JMOD_MULTILANG_ENABLE;
  729. public static List<String> L2JMOD_MULTILANG_ALLOWED = new ArrayList<String>();
  730. public static String L2JMOD_MULTILANG_DEFAULT;
  731. public static boolean L2JMOD_MULTILANG_VOICED_ALLOW;
  732. public static boolean L2JMOD_MULTILANG_SM_ENABLE;
  733. public static List<String> L2JMOD_MULTILANG_SM_ALLOWED = new ArrayList<String>();
  734. public static boolean L2JMOD_MULTILANG_NS_ENABLE;
  735. public static List<String> L2JMOD_MULTILANG_NS_ALLOWED = new ArrayList<String>();
  736. public static boolean L2WALKER_PROTECTION;
  737. public static boolean L2JMOD_DEBUG_VOICE_COMMAND;
  738. public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
  739. public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
  740. public static int L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
  741. public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST;
  742. public static boolean L2JMOD_ALLOW_CHANGE_PASSWORD;
  743. //--------------------------------------------------
  744. // NPC Settings
  745. //--------------------------------------------------
  746. public static boolean ANNOUNCE_MAMMON_SPAWN;
  747. public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
  748. public static boolean ALT_ATTACKABLE_NPCS;
  749. public static boolean ALT_GAME_VIEWNPC;
  750. public static int MAX_DRIFT_RANGE;
  751. public static boolean DEEPBLUE_DROP_RULES;
  752. public static boolean DEEPBLUE_DROP_RULES_RAID;
  753. public static boolean SHOW_NPC_LVL;
  754. public static boolean SHOW_CREST_WITHOUT_QUEST;
  755. public static boolean ENABLE_RANDOM_ENCHANT_EFFECT;
  756. public static int MIN_NPC_LVL_DMG_PENALTY;
  757. public static TIntFloatHashMap NPC_DMG_PENALTY;
  758. public static TIntFloatHashMap NPC_CRIT_DMG_PENALTY;
  759. public static TIntFloatHashMap NPC_SKILL_DMG_PENALTY;
  760. public static int MIN_NPC_LVL_MAGIC_PENALTY;
  761. public static TIntFloatHashMap NPC_SKILL_CHANCE_PENALTY;
  762. public static int DECAY_TIME_TASK;
  763. public static int NPC_DECAY_TIME;
  764. public static int RAID_BOSS_DECAY_TIME;
  765. public static int SPOILED_DECAY_TIME;
  766. public static boolean GUARD_ATTACK_AGGRO_MOB;
  767. public static boolean ALLOW_WYVERN_UPGRADER;
  768. public static TIntArrayList LIST_PET_RENT_NPC;
  769. public static double RAID_HP_REGEN_MULTIPLIER;
  770. public static double RAID_MP_REGEN_MULTIPLIER;
  771. public static double RAID_PDEFENCE_MULTIPLIER;
  772. public static double RAID_MDEFENCE_MULTIPLIER;
  773. public static double RAID_PATTACK_MULTIPLIER;
  774. public static double RAID_MATTACK_MULTIPLIER;
  775. public static double RAID_MINION_RESPAWN_TIMER;
  776. public static TIntIntHashMap MINIONS_RESPAWN_TIME;
  777. public static float RAID_MIN_RESPAWN_MULTIPLIER;
  778. public static float RAID_MAX_RESPAWN_MULTIPLIER;
  779. public static boolean RAID_DISABLE_CURSE;
  780. public static int RAID_CHAOS_TIME;
  781. public static int GRAND_CHAOS_TIME;
  782. public static int MINION_CHAOS_TIME;
  783. public static int INVENTORY_MAXIMUM_PET;
  784. public static double PET_HP_REGEN_MULTIPLIER;
  785. public static double PET_MP_REGEN_MULTIPLIER;
  786. public static TIntArrayList NON_TALKING_NPCS;
  787. //--------------------------------------------------
  788. // PvP Settings
  789. //--------------------------------------------------
  790. public static int KARMA_MIN_KARMA;
  791. public static int KARMA_MAX_KARMA;
  792. public static int KARMA_XP_DIVIDER;
  793. public static int KARMA_LOST_BASE;
  794. public static boolean KARMA_DROP_GM;
  795. public static boolean KARMA_AWARD_PK_KILL;
  796. public static int KARMA_PK_LIMIT;
  797. public static String KARMA_NONDROPPABLE_PET_ITEMS;
  798. public static String KARMA_NONDROPPABLE_ITEMS;
  799. public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS;
  800. public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
  801. //--------------------------------------------------
  802. // Rate Settings
  803. //--------------------------------------------------
  804. public static float RATE_XP;
  805. public static float RATE_SP;
  806. public static float RATE_PARTY_XP;
  807. public static float RATE_PARTY_SP;
  808. public static float RATE_CONSUMABLE_COST;
  809. public static float RATE_HB_TRUST_INCREASE;
  810. public static float RATE_HB_TRUST_DECREASE;
  811. public static float RATE_EXTR_FISH;
  812. public static float RATE_DROP_ITEMS;
  813. public static float RATE_DROP_ITEMS_BY_RAID;
  814. public static float RATE_DROP_SPOIL;
  815. public static int RATE_DROP_MANOR;
  816. public static float RATE_QUEST_DROP;
  817. public static float RATE_QUEST_REWARD;
  818. public static float RATE_QUEST_REWARD_XP;
  819. public static float RATE_QUEST_REWARD_SP;
  820. public static float RATE_QUEST_REWARD_ADENA;
  821. public static boolean RATE_QUEST_REWARD_USE_MULTIPLIERS;
  822. public static float RATE_QUEST_REWARD_POTION;
  823. public static float RATE_QUEST_REWARD_SCROLL;
  824. public static float RATE_QUEST_REWARD_RECIPE;
  825. public static float RATE_QUEST_REWARD_MATERIAL;
  826. public static TIntFloatHashMap RATE_DROP_ITEMS_ID;
  827. public static float RATE_KARMA_EXP_LOST;
  828. public static float RATE_SIEGE_GUARDS_PRICE;
  829. public static float RATE_DROP_COMMON_HERBS;
  830. public static float RATE_DROP_HP_HERBS;
  831. public static float RATE_DROP_MP_HERBS;
  832. public static float RATE_DROP_SPECIAL_HERBS;
  833. public static int PLAYER_DROP_LIMIT;
  834. public static int PLAYER_RATE_DROP;
  835. public static int PLAYER_RATE_DROP_ITEM;
  836. public static int PLAYER_RATE_DROP_EQUIP;
  837. public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
  838. public static float PET_XP_RATE;
  839. public static int PET_FOOD_RATE;
  840. public static float SINEATER_XP_RATE;
  841. public static int KARMA_DROP_LIMIT;
  842. public static int KARMA_RATE_DROP;
  843. public static int KARMA_RATE_DROP_ITEM;
  844. public static int KARMA_RATE_DROP_EQUIP;
  845. public static int KARMA_RATE_DROP_EQUIP_WEAPON;
  846. public static double[] PLAYER_XP_PERCENT_LOST;
  847. //--------------------------------------------------
  848. // Seven Signs Settings
  849. //--------------------------------------------------
  850. public static boolean ALT_GAME_CASTLE_DAWN;
  851. public static boolean ALT_GAME_CASTLE_DUSK;
  852. public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
  853. public static int ALT_FESTIVAL_MIN_PLAYER;
  854. public static int ALT_MAXIMUM_PLAYER_CONTRIB;
  855. public static long ALT_FESTIVAL_MANAGER_START;
  856. public static long ALT_FESTIVAL_LENGTH;
  857. public static long ALT_FESTIVAL_CYCLE_LENGTH;
  858. public static long ALT_FESTIVAL_FIRST_SPAWN;
  859. public static long ALT_FESTIVAL_FIRST_SWARM;
  860. public static long ALT_FESTIVAL_SECOND_SPAWN;
  861. public static long ALT_FESTIVAL_SECOND_SWARM;
  862. public static long ALT_FESTIVAL_CHEST_SPAWN;
  863. public static double ALT_SIEGE_DAWN_GATES_PDEF_MULT;
  864. public static double ALT_SIEGE_DUSK_GATES_PDEF_MULT;
  865. public static double ALT_SIEGE_DAWN_GATES_MDEF_MULT;
  866. public static double ALT_SIEGE_DUSK_GATES_MDEF_MULT;
  867. public static boolean ALT_STRICT_SEVENSIGNS;
  868. public static boolean ALT_SEVENSIGNS_LAZY_UPDATE;
  869. //--------------------------------------------------
  870. // Server Settings
  871. //--------------------------------------------------
  872. public static int PORT_GAME;
  873. public static int PORT_LOGIN;
  874. public static String LOGIN_BIND_ADDRESS;
  875. public static int LOGIN_TRY_BEFORE_BAN;
  876. public static int LOGIN_BLOCK_AFTER_BAN;
  877. public static String GAMESERVER_HOSTNAME;
  878. public static String DATABASE_DRIVER;
  879. public static String DATABASE_URL;
  880. public static String DATABASE_LOGIN;
  881. public static String DATABASE_PASSWORD;
  882. public static int DATABASE_MAX_CONNECTIONS;
  883. public static int DATABASE_MAX_IDLE_TIME;
  884. public static int MAXIMUM_ONLINE_USERS;
  885. public static String CNAME_TEMPLATE;
  886. public static String PET_NAME_TEMPLATE;
  887. public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
  888. public static File DATAPACK_ROOT;
  889. public static boolean ACCEPT_ALTERNATE_ID;
  890. public static int REQUEST_ID;
  891. public static boolean RESERVE_HOST_ON_LOGIN = false;
  892. public static TIntArrayList PROTOCOL_LIST;
  893. public static boolean LOG_LOGIN_CONTROLLER;
  894. public static boolean LOGIN_SERVER_SCHEDULE_RESTART;
  895. public static long LOGIN_SERVER_SCHEDULE_RESTART_TIME;
  896. //--------------------------------------------------
  897. // CommunityServer Settings
  898. //--------------------------------------------------
  899. public static boolean ENABLE_COMMUNITY_BOARD;
  900. public static String COMMUNITY_SERVER_ADDRESS;
  901. public static int COMMUNITY_SERVER_PORT;
  902. public static byte[] COMMUNITY_SERVER_HEX_ID;
  903. public static int COMMUNITY_SERVER_SQL_DP_ID;
  904. //--------------------------------------------------
  905. // MMO Settings
  906. //--------------------------------------------------
  907. public static int MMO_SELECTOR_SLEEP_TIME;
  908. public static int MMO_MAX_SEND_PER_PASS;
  909. public static int MMO_MAX_READ_PER_PASS;
  910. public static int MMO_HELPER_BUFFER_COUNT;
  911. //--------------------------------------------------
  912. // Vitality Settings
  913. //--------------------------------------------------
  914. public static boolean ENABLE_VITALITY;
  915. public static boolean RECOVER_VITALITY_ON_RECONNECT;
  916. public static boolean ENABLE_DROP_VITALITY_HERBS;
  917. public static float RATE_VITALITY_LEVEL_1;
  918. public static float RATE_VITALITY_LEVEL_2;
  919. public static float RATE_VITALITY_LEVEL_3;
  920. public static float RATE_VITALITY_LEVEL_4;
  921. public static float RATE_DROP_VITALITY_HERBS;
  922. public static float RATE_RECOVERY_VITALITY_PEACE_ZONE;
  923. public static float RATE_VITALITY_LOST;
  924. public static float RATE_VITALITY_GAIN;
  925. public static float RATE_RECOVERY_ON_RECONNECT;
  926. public static int STARTING_VITALITY_POINTS;
  927. //--------------------------------------------------
  928. // No classification assigned to the following yet
  929. //--------------------------------------------------
  930. public static int MAX_ITEM_IN_PACKET;
  931. public static boolean CHECK_KNOWN;
  932. public static int GAME_SERVER_LOGIN_PORT;
  933. public static String GAME_SERVER_LOGIN_HOST;
  934. public static String[] GAME_SERVER_SUBNETS;
  935. public static String[] GAME_SERVER_HOSTS;
  936. public static int NEW_NODE_ID;
  937. public static int SELECTED_NODE_ID;
  938. public static int LINKED_NODE_ID;
  939. public static String NEW_NODE_TYPE;
  940. public static String SERVER_VERSION;
  941. public static String SERVER_BUILD_DATE;
  942. public static String DATAPACK_VERSION;
  943. public static int PVP_NORMAL_TIME;
  944. public static int PVP_PVP_TIME;
  945. public static enum IdFactoryType
  946. {
  947. Compaction,
  948. BitSet,
  949. Stack
  950. }
  951. public static IdFactoryType IDFACTORY_TYPE;
  952. public static boolean BAD_ID_CHECKING;
  953. public static enum ObjectMapType
  954. {
  955. L2ObjectHashMap,
  956. WorldObjectMap
  957. }
  958. public static enum ObjectSetType
  959. {
  960. L2ObjectHashSet,
  961. WorldObjectSet
  962. }
  963. public static ObjectMapType MAP_TYPE;
  964. public static ObjectSetType SET_TYPE;
  965. public static int ENCHANT_CHANCE_WEAPON;
  966. public static int ENCHANT_CHANCE_ARMOR;
  967. public static int ENCHANT_CHANCE_JEWELRY;
  968. public static int ENCHANT_CHANCE_ELEMENT_STONE;
  969. public static int ENCHANT_CHANCE_ELEMENT_CRYSTAL;
  970. public static int ENCHANT_CHANCE_ELEMENT_JEWEL;
  971. public static int ENCHANT_CHANCE_ELEMENT_ENERGY;
  972. public static int BLESSED_ENCHANT_CHANCE_WEAPON;
  973. public static int BLESSED_ENCHANT_CHANCE_ARMOR;
  974. public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
  975. public static int ENCHANT_MAX_WEAPON;
  976. public static int ENCHANT_MAX_ARMOR;
  977. public static int ENCHANT_MAX_JEWELRY;
  978. public static int ENCHANT_SAFE_MAX;
  979. public static int ENCHANT_SAFE_MAX_FULL;
  980. public static int[] ENCHANT_BLACKLIST;
  981. public static int AUGMENTATION_NG_SKILL_CHANCE;
  982. public static int AUGMENTATION_NG_GLOW_CHANCE;
  983. public static int AUGMENTATION_MID_SKILL_CHANCE;
  984. public static int AUGMENTATION_MID_GLOW_CHANCE;
  985. public static int AUGMENTATION_HIGH_SKILL_CHANCE;
  986. public static int AUGMENTATION_HIGH_GLOW_CHANCE;
  987. public static int AUGMENTATION_TOP_SKILL_CHANCE;
  988. public static int AUGMENTATION_TOP_GLOW_CHANCE;
  989. public static int AUGMENTATION_BASESTAT_CHANCE;
  990. public static int AUGMENTATION_ACC_SKILL_CHANCE;
  991. public static int[] AUGMENTATION_BLACKLIST;
  992. public static double HP_REGEN_MULTIPLIER;
  993. public static double MP_REGEN_MULTIPLIER;
  994. public static double CP_REGEN_MULTIPLIER;
  995. public static boolean IS_TELNET_ENABLED;
  996. public static boolean SHOW_LICENCE;
  997. public static boolean ACCEPT_NEW_GAMESERVER;
  998. public static int SERVER_ID;
  999. public static byte[] HEX_ID;
  1000. public static boolean AUTO_CREATE_ACCOUNTS;
  1001. public static boolean FLOOD_PROTECTION;
  1002. public static int FAST_CONNECTION_LIMIT;
  1003. public static int NORMAL_CONNECTION_TIME;
  1004. public static int FAST_CONNECTION_TIME;
  1005. public static int MAX_CONNECTION_PER_IP;
  1006. // GrandBoss Settings
  1007. public static int Antharas_Wait_Time;
  1008. public static int Valakas_Wait_Time;
  1009. public static int Interval_Of_Antharas_Spawn;
  1010. public static int Random_Of_Antharas_Spawn;
  1011. public static int Interval_Of_Valakas_Spawn;
  1012. public static int Random_Of_Valakas_Spawn;
  1013. public static int Interval_Of_Baium_Spawn;
  1014. public static int Random_Of_Baium_Spawn;
  1015. public static int Interval_Of_Core_Spawn;
  1016. public static int Random_Of_Core_Spawn;
  1017. public static int Interval_Of_Orfen_Spawn;
  1018. public static int Random_Of_Orfen_Spawn;
  1019. public static int Interval_Of_QueenAnt_Spawn;
  1020. public static int Random_Of_QueenAnt_Spawn;
  1021. public static int Interval_Of_Zaken_Spawn;
  1022. public static int Random_Of_Zaken_Spawn;
  1023. public static int Interval_Of_Frintezza_Spawn;
  1024. public static int Random_Of_Frintezza_Spawn;
  1025. public static int BELETH_MIN_PLAYERS;
  1026. public static int INTERVAL_OF_BELETH_SPAWN;
  1027. public static int RANDOM_OF_BELETH_SPAWN;
  1028. // Gracia Seeds Settings
  1029. public static int SOD_TIAT_KILL_COUNT;
  1030. public static long SOD_STAGE_2_LENGTH;
  1031. //chatfilter
  1032. public static ArrayList<String> FILTER_LIST;
  1033. // Security
  1034. public static boolean SECOND_AUTH_ENABLED;
  1035. public static int SECOND_AUTH_MAX_ATTEMPTS;
  1036. public static long SECOND_AUTH_BAN_TIME;
  1037. public static String SECOND_AUTH_REC_LINK;
  1038. // Email
  1039. public static String EMAIL_SERVERINFO_NAME;
  1040. public static String EMAIL_SERVERINFO_ADDRESS;
  1041. public static boolean EMAIL_SYS_ENABLED;
  1042. public static String EMAIL_SYS_HOST;
  1043. public static int EMAIL_SYS_PORT;
  1044. public static boolean EMAIL_SYS_SMTP_AUTH;
  1045. public static String EMAIL_SYS_FACTORY;
  1046. public static boolean EMAIL_SYS_FACTORY_CALLBACK;
  1047. public static String EMAIL_SYS_USERNAME;
  1048. public static String EMAIL_SYS_PASSWORD;
  1049. public static String EMAIL_SYS_ADDRESS;
  1050. public static String EMAIL_SYS_SELECTQUERY;
  1051. public static String EMAIL_SYS_DBFIELD;
  1052. // Conquerable Halls Settings
  1053. public static int CHS_CLAN_MINLEVEL;
  1054. public static int CHS_MAX_ATTACKERS;
  1055. public static int CHS_MAX_FLAGS_PER_CLAN;
  1056. public static boolean CHS_ENABLE_FAME;
  1057. public static int CHS_FAME_AMOUNT;
  1058. public static int CHS_FAME_FREQUENCY;
  1059. /**
  1060. * This class initializes all global variables for configuration.<br>
  1061. * If the key doesn't appear in properties file, a default value is set by this class.
  1062. * {@link #CONFIGURATION_FILE} (properties file) for configuring your server.
  1063. */
  1064. public static void load()
  1065. {
  1066. if(Server.serverMode == Server.MODE_GAMESERVER)
  1067. {
  1068. FLOOD_PROTECTOR_USE_ITEM =
  1069. new FloodProtectorConfig("UseItemFloodProtector");
  1070. FLOOD_PROTECTOR_ROLL_DICE =
  1071. new FloodProtectorConfig("RollDiceFloodProtector");
  1072. FLOOD_PROTECTOR_FIREWORK =
  1073. new FloodProtectorConfig("FireworkFloodProtector");
  1074. FLOOD_PROTECTOR_ITEM_PET_SUMMON =
  1075. new FloodProtectorConfig("ItemPetSummonFloodProtector");
  1076. FLOOD_PROTECTOR_HERO_VOICE =
  1077. new FloodProtectorConfig("HeroVoiceFloodProtector");
  1078. FLOOD_PROTECTOR_GLOBAL_CHAT =
  1079. new FloodProtectorConfig("GlobalChatFloodProtector");
  1080. FLOOD_PROTECTOR_SUBCLASS =
  1081. new FloodProtectorConfig("SubclassFloodProtector");
  1082. FLOOD_PROTECTOR_DROP_ITEM =
  1083. new FloodProtectorConfig("DropItemFloodProtector");
  1084. FLOOD_PROTECTOR_SERVER_BYPASS =
  1085. new FloodProtectorConfig("ServerBypassFloodProtector");
  1086. FLOOD_PROTECTOR_MULTISELL =
  1087. new FloodProtectorConfig("MultiSellFloodProtector");
  1088. FLOOD_PROTECTOR_TRANSACTION =
  1089. new FloodProtectorConfig("TransactionFloodProtector");
  1090. FLOOD_PROTECTOR_MANUFACTURE =
  1091. new FloodProtectorConfig("ManufactureFloodProtector");
  1092. FLOOD_PROTECTOR_MANOR =
  1093. new FloodProtectorConfig("ManorFloodProtector");
  1094. FLOOD_PROTECTOR_SENDMAIL =
  1095. new FloodProtectorConfig("SendMailFloodProtector");
  1096. FLOOD_PROTECTOR_CHARACTER_SELECT =
  1097. new FloodProtectorConfig("CharacterSelectFloodProtector");
  1098. FLOOD_PROTECTOR_ITEM_AUCTION =
  1099. new FloodProtectorConfig("ItemAuctionFloodProtector");
  1100. _log.info("Loading GameServer Configuration Files...");
  1101. InputStream is = null;
  1102. try
  1103. {
  1104. try
  1105. {
  1106. L2Properties serverSettings = new L2Properties();
  1107. is = new FileInputStream(new File(CONFIGURATION_FILE));
  1108. serverSettings.load(is);
  1109. GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
  1110. PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
  1111. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
  1112. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");
  1113. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  1114. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  1115. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  1116. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jgs");
  1117. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  1118. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  1119. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  1120. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  1121. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  1122. CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
  1123. PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
  1124. MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
  1125. MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
  1126. String[] protocols = serverSettings.getProperty("AllowedProtocolRevisions", "267;268;271;273").split(";");
  1127. PROTOCOL_LIST = new TIntArrayList(protocols.length);
  1128. for (String protocol : protocols)
  1129. {
  1130. try
  1131. {
  1132. PROTOCOL_LIST.add(Integer.parseInt(protocol.trim()));
  1133. }
  1134. catch(NumberFormatException e)
  1135. {
  1136. _log.info("Wrong config protocol version: "+protocol+". Skipped.");
  1137. }
  1138. }
  1139. }
  1140. catch (Exception e)
  1141. {
  1142. e.printStackTrace();
  1143. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  1144. }
  1145. File file = new File(IP_CONFIG_FILE);
  1146. Document doc = null;
  1147. ArrayList <String> subnets = new ArrayList<String>(5);
  1148. ArrayList <String> hosts = new ArrayList<String>(5);
  1149. try
  1150. {
  1151. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  1152. factory.setValidating(false);
  1153. factory.setIgnoringComments(true);
  1154. doc = factory.newDocumentBuilder().parse(file);
  1155. for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
  1156. {
  1157. NamedNodeMap attrs;
  1158. Node att;
  1159. if ("gameserver".equalsIgnoreCase(n.getNodeName()))
  1160. {
  1161. for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
  1162. {
  1163. if ("define".equalsIgnoreCase(d.getNodeName()))
  1164. {
  1165. attrs = d.getAttributes();
  1166. att = attrs.getNamedItem("subnet");
  1167. if (att == null)
  1168. continue;
  1169. subnets.add(att.getNodeValue());
  1170. att = attrs.getNamedItem("address");
  1171. if (att == null)
  1172. continue;
  1173. hosts.add(att.getNodeValue());
  1174. if (hosts.size() != subnets.size())
  1175. throw new Error("Failed to Load "+IP_CONFIG_FILE+" File - subnets does not match server addresses.");
  1176. }
  1177. }
  1178. attrs = n.getAttributes();
  1179. att = attrs.getNamedItem("address");
  1180. if (att == null)
  1181. throw new Error("Failed to Load "+IP_CONFIG_FILE+" File - default server address is missing.");
  1182. subnets.add("0.0.0.0/0");
  1183. hosts.add(att.getNodeValue());
  1184. }
  1185. }
  1186. GAME_SERVER_SUBNETS = subnets.toArray(new String[subnets.size()]);
  1187. GAME_SERVER_HOSTS = hosts.toArray(new String[hosts.size()]);
  1188. }
  1189. catch (Exception e)
  1190. {
  1191. e.printStackTrace();
  1192. throw new Error("Failed to Load "+IP_CONFIG_FILE+" File.");
  1193. }
  1194. // Load Community Properties file (if exists)
  1195. try
  1196. {
  1197. L2Properties communityServerSettings = new L2Properties();
  1198. is = new FileInputStream(new File(COMMUNITY_CONFIGURATION_FILE));
  1199. communityServerSettings.load(is);
  1200. ENABLE_COMMUNITY_BOARD = Boolean.parseBoolean(communityServerSettings.getProperty("EnableCommunityBoard", "False"));
  1201. COMMUNITY_SERVER_ADDRESS = communityServerSettings.getProperty("CommunityServerHostname", "localhost");
  1202. COMMUNITY_SERVER_PORT = Integer.parseInt(communityServerSettings.getProperty("CommunityServerPort", "9013"));
  1203. COMMUNITY_SERVER_HEX_ID = new BigInteger(communityServerSettings.getProperty("CommunityServerHexId"), 16).toByteArray();
  1204. COMMUNITY_SERVER_SQL_DP_ID = Integer.parseInt(communityServerSettings.getProperty("CommunityServerSqlDpId", "200"));
  1205. }
  1206. catch (Exception e)
  1207. {
  1208. e.printStackTrace();
  1209. throw new Error("Failed to Load "+COMMUNITY_CONFIGURATION_FILE+" File.");
  1210. }
  1211. // Load Feature L2Properties file (if exists)
  1212. try
  1213. {
  1214. L2Properties Feature = new L2Properties();
  1215. is = new FileInputStream(new File(FEATURE_CONFIG_FILE));
  1216. Feature.load(is);
  1217. CH_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallTeleportFunctionFeeRatio", "604800000"));
  1218. CH_TELE1_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "7000"));
  1219. CH_TELE2_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "14000"));
  1220. CH_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallSupportFunctionFeeRatio", "86400000"));
  1221. CH_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl1", "2500"));
  1222. CH_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl2", "5000"));
  1223. CH_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl3", "7000"));
  1224. CH_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl4", "11000"));
  1225. CH_SUPPORT5_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl5", "21000"));
  1226. CH_SUPPORT6_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl6", "36000"));
  1227. CH_SUPPORT7_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl7", "37000"));
  1228. CH_SUPPORT8_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl8", "52000"));
  1229. CH_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRatio", "86400000"));
  1230. CH_MPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "2000"));
  1231. CH_MPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "3750"));
  1232. CH_MPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "6500"));
  1233. CH_MPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "13750"));
  1234. CH_MPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "20000"));
  1235. CH_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRatio", "86400000"));
  1236. CH_HPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "700"));
  1237. CH_HPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "800"));
  1238. CH_HPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "1000"));
  1239. CH_HPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "1166"));
  1240. CH_HPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "1500"));
  1241. CH_HPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "1750"));
  1242. CH_HPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "2000"));
  1243. CH_HPREG8_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "2250"));
  1244. CH_HPREG9_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "2500"));
  1245. CH_HPREG10_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "3250"));
  1246. CH_HPREG11_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "3270"));
  1247. CH_HPREG12_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "4250"));
  1248. CH_HPREG13_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "5166"));
  1249. CH_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRatio", "86400000"));
  1250. CH_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "3000"));
  1251. CH_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "6000"));
  1252. CH_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "9000"));
  1253. CH_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "15000"));
  1254. CH_EXPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "21000"));
  1255. CH_EXPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "23330"));
  1256. CH_EXPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "30000"));
  1257. CH_ITEM_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallItemCreationFunctionFeeRatio", "86400000"));
  1258. CH_ITEM1_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "30000"));
  1259. CH_ITEM2_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "70000"));
  1260. CH_ITEM3_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "140000"));
  1261. CH_CURTAIN_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallCurtainFunctionFeeRatio", "604800000"));
  1262. CH_CURTAIN1_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "2000"));
  1263. CH_CURTAIN2_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "2500"));
  1264. CH_FRONT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRatio", "259200000"));
  1265. CH_FRONT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "1300"));
  1266. CH_FRONT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "4000"));
  1267. CH_BUFF_FREE = Boolean.parseBoolean(Feature.getProperty("AltClanHallMpBuffFree", "False"));
  1268. CL_SET_SIEGE_TIME_LIST = new ArrayList<String>();
  1269. SIEGE_HOUR_LIST_MORNING = new ArrayList<Integer>();
  1270. SIEGE_HOUR_LIST_AFTERNOON = new ArrayList<Integer>();
  1271. String[] sstl = Feature.getProperty("CLSetSiegeTimeList", "").split(",");
  1272. if (sstl.length != 0)
  1273. {
  1274. boolean isHour = false;
  1275. for (String st : sstl)
  1276. {
  1277. if (st.equalsIgnoreCase("day") || st.equalsIgnoreCase("hour") || st.equalsIgnoreCase("minute"))
  1278. {
  1279. if (st.equalsIgnoreCase("hour")) isHour = true;
  1280. CL_SET_SIEGE_TIME_LIST.add(st.toLowerCase());
  1281. }
  1282. else
  1283. {
  1284. _log.warning(StringUtil.concat("[CLSetSiegeTimeList]: invalid config property -> CLSetSiegeTimeList \"", st, "\""));
  1285. }
  1286. }
  1287. if (isHour)
  1288. {
  1289. String[] shl = Feature.getProperty("SiegeHourList", "").split(",");
  1290. for (String st : shl)
  1291. {
  1292. if (!st.equalsIgnoreCase(""))
  1293. {
  1294. int val = Integer.parseInt(st);
  1295. if (val > 23 || val < 0)
  1296. _log.warning(StringUtil.concat("[SiegeHourList]: invalid config property -> SiegeHourList \"", st, "\""));
  1297. else if (val < 12)
  1298. SIEGE_HOUR_LIST_MORNING.add(val);
  1299. else
  1300. {
  1301. val -= 12;
  1302. SIEGE_HOUR_LIST_AFTERNOON.add(val);
  1303. }
  1304. }
  1305. }
  1306. if (Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty() && Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty())
  1307. {
  1308. _log.warning("[SiegeHourList]: invalid config property -> SiegeHourList is empty");
  1309. CL_SET_SIEGE_TIME_LIST.remove("hour");
  1310. }
  1311. }
  1312. }
  1313. CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
  1314. CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
  1315. CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
  1316. CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
  1317. CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
  1318. CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
  1319. CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
  1320. CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
  1321. CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
  1322. CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
  1323. CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
  1324. CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
  1325. CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
  1326. CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
  1327. CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
  1328. CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
  1329. CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
  1330. CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl4", "3270"));
  1331. CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl5", "5166"));
  1332. CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
  1333. CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
  1334. CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
  1335. CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
  1336. CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));
  1337. FS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressTeleportFunctionFeeRatio", "604800000"));
  1338. FS_TELE1_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl1", "1000"));
  1339. FS_TELE2_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl2", "10000"));
  1340. FS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressSupportFunctionFeeRatio", "86400000"));
  1341. FS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl1", "7000"));
  1342. FS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl2", "17000"));
  1343. FS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressMpRegenerationFunctionFeeRatio", "86400000"));
  1344. FS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl1", "6500"));
  1345. FS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl2", "9300"));
  1346. FS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressHpRegenerationFunctionFeeRatio", "86400000"));
  1347. FS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl1", "2000"));
  1348. FS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl2", "3500"));
  1349. FS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressExpRegenerationFunctionFeeRatio", "86400000"));
  1350. FS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl1", "9000"));
  1351. FS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl2", "10000"));
  1352. FS_UPDATE_FRQ = Integer.parseInt(Feature.getProperty("FortressPeriodicUpdateFrequency", "360"));
  1353. FS_BLOOD_OATH_COUNT = Integer.parseInt(Feature.getProperty("FortressBloodOathCount", "1"));
  1354. FS_MAX_SUPPLY_LEVEL = Integer.parseInt(Feature.getProperty("FortressMaxSupplyLevel", "6"));
  1355. FS_FEE_FOR_CASTLE = Integer.parseInt(Feature.getProperty("FortressFeeForCastle", "25000"));
  1356. FS_MAX_OWN_TIME = Integer.parseInt(Feature.getProperty("FortressMaximumOwnTime", "168"));
  1357. ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltCastleForDawn", "True"));
  1358. ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(Feature.getProperty("AltCastleForDusk", "True"));
  1359. ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
  1360. ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
  1361. ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
  1362. ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
  1363. ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
  1364. ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
  1365. ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
  1366. ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));
  1367. ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
  1368. ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
  1369. ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
  1370. ALT_SIEGE_DAWN_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesPdefMult", "1.1"));
  1371. ALT_SIEGE_DUSK_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesPdefMult", "0.8"));
  1372. ALT_SIEGE_DAWN_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesMdefMult", "1.1"));
  1373. ALT_SIEGE_DUSK_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesMdefMult", "0.8"));
  1374. ALT_STRICT_SEVENSIGNS = Boolean.parseBoolean(Feature.getProperty("StrictSevenSigns", "True"));
  1375. ALT_SEVENSIGNS_LAZY_UPDATE = Boolean.parseBoolean(Feature.getProperty("AltSevenSignsLazyUpdate", "True"));
  1376. TAKE_FORT_POINTS = Integer.parseInt(Feature.getProperty("TakeFortPoints", "200"));
  1377. LOOSE_FORT_POINTS = Integer.parseInt(Feature.getProperty("LooseFortPoints", "0"));
  1378. TAKE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("TakeCastlePoints", "1500"));
  1379. LOOSE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("LooseCastlePoints", "3000"));
  1380. CASTLE_DEFENDED_POINTS = Integer.parseInt(Feature.getProperty("CastleDefendedPoints", "750"));
  1381. FESTIVAL_WIN_POINTS = Integer.parseInt(Feature.getProperty("FestivalOfDarknessWin", "200"));
  1382. HERO_POINTS = Integer.parseInt(Feature.getProperty("HeroPoints", "1000"));
  1383. ROYAL_GUARD_COST = Integer.parseInt(Feature.getProperty("CreateRoyalGuardCost", "5000"));
  1384. KNIGHT_UNIT_COST = Integer.parseInt(Feature.getProperty("CreateKnightUnitCost", "10000"));
  1385. KNIGHT_REINFORCE_COST = Integer.parseInt(Feature.getProperty("ReinforceKnightUnitCost", "5000"));
  1386. BALLISTA_POINTS = Integer.parseInt(Feature.getProperty("KillBallistaPoints", "30"));
  1387. BLOODALLIANCE_POINTS = Integer.parseInt(Feature.getProperty("BloodAlliancePoints", "500"));
  1388. BLOODOATH_POINTS = Integer.parseInt(Feature.getProperty("BloodOathPoints", "200"));
  1389. KNIGHTSEPAULETTE_POINTS = Integer.parseInt(Feature.getProperty("KnightsEpaulettePoints", "20"));
  1390. REPUTATION_SCORE_PER_KILL = Integer.parseInt(Feature.getProperty("ReputationScorePerKill", "1"));
  1391. JOIN_ACADEMY_MIN_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMinPoints", "190"));
  1392. JOIN_ACADEMY_MAX_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMaxPoints", "650"));
  1393. RAID_RANKING_1ST = Integer.parseInt(Feature.getProperty("1stRaidRankingPoints", "1250"));
  1394. RAID_RANKING_2ND = Integer.parseInt(Feature.getProperty("2ndRaidRankingPoints", "900"));
  1395. RAID_RANKING_3RD = Integer.parseInt(Feature.getProperty("3rdRaidRankingPoints", "700"));
  1396. RAID_RANKING_4TH = Integer.parseInt(Feature.getProperty("4thRaidRankingPoints", "600"));
  1397. RAID_RANKING_5TH = Integer.parseInt(Feature.getProperty("5thRaidRankingPoints", "450"));
  1398. RAID_RANKING_6TH = Integer.parseInt(Feature.getProperty("6thRaidRankingPoints", "350"));
  1399. RAID_RANKING_7TH = Integer.parseInt(Feature.getProperty("7thRaidRankingPoints", "300"));
  1400. RAID_RANKING_8TH = Integer.parseInt(Feature.getProperty("8thRaidRankingPoints", "200"));
  1401. RAID_RANKING_9TH = Integer.parseInt(Feature.getProperty("9thRaidRankingPoints", "150"));
  1402. RAID_RANKING_10TH = Integer.parseInt(Feature.getProperty("10thRaidRankingPoints", "100"));
  1403. RAID_RANKING_UP_TO_50TH = Integer.parseInt(Feature.getProperty("UpTo50thRaidRankingPoints", "25"));
  1404. RAID_RANKING_UP_TO_100TH = Integer.parseInt(Feature.getProperty("UpTo100thRaidRankingPoints", "12"));
  1405. CLAN_LEVEL_6_COST = Integer.parseInt(Feature.getProperty("ClanLevel6Cost", "5000"));
  1406. CLAN_LEVEL_7_COST = Integer.parseInt(Feature.getProperty("ClanLevel7Cost", "10000"));
  1407. CLAN_LEVEL_8_COST = Integer.parseInt(Feature.getProperty("ClanLevel8Cost", "20000"));
  1408. CLAN_LEVEL_9_COST = Integer.parseInt(Feature.getProperty("ClanLevel9Cost", "40000"));
  1409. CLAN_LEVEL_10_COST = Integer.parseInt(Feature.getProperty("ClanLevel10Cost", "40000"));
  1410. CLAN_LEVEL_11_COST = Integer.parseInt(Feature.getProperty("ClanLevel11Cost", "75000"));
  1411. CLAN_LEVEL_6_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel6Requirement", "30"));
  1412. CLAN_LEVEL_7_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel7Requirement", "50"));
  1413. CLAN_LEVEL_8_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel8Requirement", "80"));
  1414. CLAN_LEVEL_9_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel9Requirement", "120"));
  1415. CLAN_LEVEL_10_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel10Requirement", "140"));
  1416. CLAN_LEVEL_11_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel11Requirement", "170"));
  1417. ALLOW_WYVERN_DURING_SIEGE = Boolean.parseBoolean(Feature.getProperty("AllowRideWyvernDuringSiege", "True"));
  1418. }
  1419. catch (Exception e)
  1420. {
  1421. e.printStackTrace();
  1422. throw new Error("Failed to Load "+FEATURE_CONFIG_FILE+" File.");
  1423. }
  1424. // Load Character L2Properties file (if exists)
  1425. try
  1426. {
  1427. L2Properties Character = new L2Properties();
  1428. is = new FileInputStream(new File(CHARACTER_CONFIG_FILE));
  1429. Character.load(is);
  1430. MASTERACCESS_LEVEL = Integer.parseInt(Character.getProperty("MasterAccessLevel", "127"));
  1431. MASTERACCESS_NAME_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterNameColor", "00FF00")));
  1432. MASTERACCESS_TITLE_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterTitleColor", "00FF00")));
  1433. ALT_GAME_DELEVEL = Boolean.parseBoolean(Character.getProperty("Delevel", "true"));
  1434. DECREASE_SKILL_LEVEL = Boolean.parseBoolean(Character.getProperty("DecreaseSkillOnDelevel", "true"));
  1435. ALT_WEIGHT_LIMIT = Double.parseDouble(Character.getProperty("AltWeightLimit", "1"));
  1436. RUN_SPD_BOOST = Integer.parseInt(Character.getProperty("RunSpeedBoost", "0"));
  1437. DEATH_PENALTY_CHANCE = Integer.parseInt(Character.getProperty("DeathPenaltyChance", "20"));
  1438. RESPAWN_RESTORE_CP = Double.parseDouble(Character.getProperty("RespawnRestoreCP", "0")) / 100;
  1439. RESPAWN_RESTORE_HP = Double.parseDouble(Character.getProperty("RespawnRestoreHP", "65")) / 100;
  1440. RESPAWN_RESTORE_MP = Double.parseDouble(Character.getProperty("RespawnRestoreMP", "0")) / 100;
  1441. HP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("HpRegenMultiplier", "100")) /100;
  1442. MP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("MpRegenMultiplier", "100")) /100;
  1443. CP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("CpRegenMultiplier", "100")) /100;
  1444. ALT_GAME_TIREDNESS = Boolean.parseBoolean(Character.getProperty("AltGameTiredness", "false"));
  1445. ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(Character.getProperty("EnableModifySkillDuration", "false"));
  1446. // Create Map only if enabled
  1447. if (ENABLE_MODIFY_SKILL_DURATION)
  1448. {
  1449. String[] propertySplit = Character.getProperty("SkillDurationList", "").split(";");
  1450. SKILL_DURATION_LIST = new TIntIntHashMap(propertySplit.length);
  1451. for (String skill : propertySplit)
  1452. {
  1453. String[] skillSplit = skill.split(",");
  1454. if (skillSplit.length != 2)
  1455. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillDurationList \"", skill, "\""));
  1456. else
  1457. {
  1458. try
  1459. {
  1460. SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  1461. }
  1462. catch (NumberFormatException nfe)
  1463. {
  1464. if (!skill.isEmpty())
  1465. {
  1466. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1467. }
  1468. }
  1469. }
  1470. }
  1471. }
  1472. ENABLE_MODIFY_SKILL_REUSE = Boolean.parseBoolean(Character.getProperty("EnableModifySkillReuse", "false"));
  1473. // Create Map only if enabled
  1474. if (ENABLE_MODIFY_SKILL_REUSE)
  1475. {
  1476. String[] propertySplit = Character.getProperty("SkillReuseList", "").split(";");
  1477. SKILL_REUSE_LIST = new TIntIntHashMap(propertySplit.length);
  1478. for (String skill : propertySplit)
  1479. {
  1480. String[] skillSplit = skill.split(",");
  1481. if (skillSplit.length != 2)
  1482. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillReuseList \"", skill, "\""));
  1483. else
  1484. {
  1485. try
  1486. {
  1487. SKILL_REUSE_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
  1488. }
  1489. catch (NumberFormatException nfe)
  1490. {
  1491. if (!skill.isEmpty())
  1492. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1493. }
  1494. }
  1495. }
  1496. }
  1497. AUTO_LEARN_SKILLS = Boolean.parseBoolean(Character.getProperty("AutoLearnSkills", "False"));
  1498. AUTO_LEARN_FS_SKILLS = Boolean.parseBoolean(Character.getProperty("AutoLearnForgottenScrollSkills", "False"));
  1499. AUTO_LOOT_HERBS = Boolean.parseBoolean(Character.getProperty("AutoLootHerbs", "false"));
  1500. BUFFS_MAX_AMOUNT = Byte.parseByte(Character.getProperty("MaxBuffAmount","20"));
  1501. TRIGGERED_BUFFS_MAX_AMOUNT = Byte.parseByte(Character.getProperty("MaxTriggeredBuffAmount","12"));
  1502. DANCES_MAX_AMOUNT = Byte.parseByte(Character.getProperty("MaxDanceAmount","12"));
  1503. DANCE_CANCEL_BUFF = Boolean.parseBoolean(Character.getProperty("DanceCancelBuff", "false"));
  1504. DANCE_CONSUME_ADDITIONAL_MP = Boolean.parseBoolean(Character.getProperty("DanceConsumeAdditionalMP", "true"));
  1505. AUTO_LEARN_DIVINE_INSPIRATION = Boolean.parseBoolean(Character.getProperty("AutoLearnDivineInspiration", "false"));
  1506. ALT_GAME_CANCEL_BOW = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1507. ALT_GAME_CANCEL_CAST = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1508. EFFECT_CANCELING = Boolean.parseBoolean(Character.getProperty("CancelLesserEffect", "True"));
  1509. ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(Character.getProperty("MagicFailures", "true"));
  1510. PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(Character.getProperty("PlayerFakeDeathUpProtection", "0"));
  1511. STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("StoreSkillCooltime", "true"));
  1512. SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("SubclassStoreSkillCooltime", "false"));
  1513. SUMMON_STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("SummonStoreSkillCooltime", "True"));
  1514. ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(Character.getProperty("AltShieldBlocks", "false"));
  1515. ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(Character.getProperty("AltPerfectShieldBlockRate", "10"));
  1516. ALLOW_CLASS_MASTERS = Boolean.parseBoolean(Character.getProperty("AllowClassMasters", "False"));
  1517. ALLOW_ENTIRE_TREE = Boolean.parseBoolean(Character.getProperty("AllowEntireTree", "False"));
  1518. ALTERNATE_CLASS_MASTER = Boolean.parseBoolean(Character.getProperty("AlternateClassMaster", "False"));
  1519. if (ALLOW_CLASS_MASTERS || ALTERNATE_CLASS_MASTER)
  1520. CLASS_MASTER_SETTINGS = new ClassMasterSettings(Character.getProperty("ConfigClassMaster"));
  1521. LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(Character.getProperty("LifeCrystalNeeded", "true"));
  1522. ES_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("EnchantSkillSpBookNeeded","true"));
  1523. DIVINE_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("DivineInspirationSpBookNeeded", "true"));
  1524. ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(Character.getProperty("AltGameSkillLearn", "false"));
  1525. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(Character.getProperty("AltSubClassWithoutQuests", "False"));
  1526. ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(Character.getProperty("AltSubclassEverywhere", "False"));
  1527. RESTORE_SERVITOR_ON_RECONNECT = Boolean.parseBoolean(Character.getProperty("RestoreServitorOnReconnect", "True"));
  1528. RESTORE_PET_ON_RECONNECT = Boolean.parseBoolean(Character.getProperty("RestorePetOnReconnect", "True"));
  1529. ALLOW_TRANSFORM_WITHOUT_QUEST = Boolean.parseBoolean(Character.getProperty("AltTransformationWithoutQuest", "False"));
  1530. FEE_DELETE_TRANSFER_SKILLS = Integer.parseInt(Character.getProperty("FeeDeleteTransferSkills", "10000000"));
  1531. FEE_DELETE_SUBCLASS_SKILLS = Integer.parseInt(Character.getProperty("FeeDeleteSubClassSkills", "10000000"));
  1532. ENABLE_VITALITY = Boolean.parseBoolean(Character.getProperty("EnableVitality", "True"));
  1533. RECOVER_VITALITY_ON_RECONNECT = Boolean.parseBoolean(Character.getProperty("RecoverVitalityOnReconnect", "True"));
  1534. STARTING_VITALITY_POINTS = Integer.parseInt(Character.getProperty("StartingVitalityPoints", "20000"));
  1535. MAX_RUN_SPEED = Integer.parseInt(Character.getProperty("MaxRunSpeed", "250"));
  1536. MAX_PCRIT_RATE = Integer.parseInt(Character.getProperty("MaxPCritRate", "500"));
  1537. MAX_MCRIT_RATE = Integer.parseInt(Character.getProperty("MaxMCritRate", "200"));
  1538. MAX_PATK_SPEED = Integer.parseInt(Character.getProperty("MaxPAtkSpeed", "1500"));
  1539. MAX_MATK_SPEED = Integer.parseInt(Character.getProperty("MaxMAtkSpeed", "1999"));
  1540. MAX_EVASION = Integer.parseInt(Character.getProperty("MaxEvasion", "250"));
  1541. MIN_DEBUFF_CHANCE = Integer.parseInt(Character.getProperty("MinDebuffChance", "10"));
  1542. MAX_DEBUFF_CHANCE = Integer.parseInt(Character.getProperty("MaxDebuffChance", "90"));
  1543. MAX_SUBCLASS = Byte.parseByte(Character.getProperty("MaxSubclass", "3"));
  1544. BASE_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("BaseSubclassLevel", "40"));
  1545. MAX_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("MaxSubclassLevel", "80"));
  1546. MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
  1547. MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsOther", "3"));
  1548. MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsDwarf", "5"));
  1549. MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsOther", "4"));
  1550. INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForNoDwarf", "80"));
  1551. INVENTORY_MAXIMUM_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForDwarf", "100"));
  1552. INVENTORY_MAXIMUM_GM = Integer.parseInt(Character.getProperty("MaximumSlotsForGMPlayer", "250"));
  1553. INVENTORY_MAXIMUM_QUEST_ITEMS = Integer.parseInt(Character.getProperty("MaximumSlotsForQuestItems", "100"));
  1554. MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
  1555. WAREHOUSE_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
  1556. WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
  1557. WAREHOUSE_SLOTS_CLAN = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForClan", "150"));
  1558. ALT_FREIGHT_SLOTS = Integer.parseInt(Character.getProperty("MaximumFreightSlots", "200"));
  1559. ALT_FREIGHT_PRIECE = Integer.parseInt(Character.getProperty("FreightPriece", "1000"));
  1560. ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("EnchantChanceWeapon", "66"));
  1561. ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("EnchantChanceArmor", "66"));
  1562. ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("EnchantChanceJewelry", "66"));
  1563. ENCHANT_CHANCE_ELEMENT_STONE = Integer.parseInt(Character.getProperty("EnchantChanceElementStone", "50"));
  1564. ENCHANT_CHANCE_ELEMENT_CRYSTAL = Integer.parseInt(Character.getProperty("EnchantChanceElementCrystal", "30"));
  1565. ENCHANT_CHANCE_ELEMENT_JEWEL = Integer.parseInt(Character.getProperty("EnchantChanceElementJewel", "20"));
  1566. ENCHANT_CHANCE_ELEMENT_ENERGY = Integer.parseInt(Character.getProperty("EnchantChanceElementEnergy", "10"));
  1567. BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("BlessedEnchantChanceWeapon", "66"));
  1568. BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("BlessedEnchantChanceArmor", "66"));
  1569. BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("BlessedEnchantChanceJewelry", "66"));
  1570. ENCHANT_MAX_WEAPON = Integer.parseInt(Character.getProperty("EnchantMaxWeapon", "0"));
  1571. ENCHANT_MAX_ARMOR = Integer.parseInt(Character.getProperty("EnchantMaxArmor", "0"));
  1572. ENCHANT_MAX_JEWELRY = Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "0"));
  1573. ENCHANT_SAFE_MAX = Integer.parseInt(Character.getProperty("EnchantSafeMax", "3"));
  1574. ENCHANT_SAFE_MAX_FULL = Integer.parseInt(Character.getProperty("EnchantSafeMaxFull", "4"));
  1575. String[] notenchantable = Character.getProperty("EnchantBlackList","7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296").split(",");
  1576. ENCHANT_BLACKLIST = new int[notenchantable.length];
  1577. for (int i = 0; i < notenchantable.length; i++)
  1578. ENCHANT_BLACKLIST[i] = Integer.parseInt(notenchantable[i]);
  1579. Arrays.sort(ENCHANT_BLACKLIST);
  1580. AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGSkillChance", "15"));
  1581. AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGGlowChance", "0"));
  1582. AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidSkillChance", "30"));
  1583. AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidGlowChance", "40"));
  1584. AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighSkillChance", "45"));
  1585. AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighGlowChance", "70"));
  1586. AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopSkillChance", "60"));
  1587. AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopGlowChance", "100"));
  1588. AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(Character.getProperty("AugmentationBaseStatChance", "1"));
  1589. AUGMENTATION_ACC_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationAccSkillChance", "0"));
  1590. String[] array = Character.getProperty("AugmentationBlackList", "6656,6657,6658,6659,6660,6661,6662,8191,10170,10314,13740,13741,13742,13743,13744,13745,13746,13747,13748,14592,14593,14594,14595,14596,14597,14598,14599,14600,14664,14665,14666,14667,14668,14669,14670,14671,14672,14801,14802,14803,14804,14805,14806,14807,14808,14809,15282,15283,15284,15285,15286,15287,15288,15289,15290,15291,15292,15293,15294,15295,15296,15297,15298,15299,16025,16026,21712,22173,22174,22175").split(",");
  1591. AUGMENTATION_BLACKLIST = new int[array.length];
  1592. for (int i = 0; i < array.length; i++)
  1593. AUGMENTATION_BLACKLIST[i] = Integer.parseInt(array[i]);
  1594. Arrays.sort(AUGMENTATION_BLACKLIST);
  1595. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
  1596. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanShop", "true"));
  1597. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTeleport", "true"));
  1598. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseGK", "false"));
  1599. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTrade", "true"));
  1600. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
  1601. MAX_PERSONAL_FAME_POINTS = Integer.parseInt(Character.getProperty("MaxPersonalFamePoints","100000"));
  1602. FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("FortressZoneFameTaskFrequency","300"));
  1603. FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("FortressZoneFameAquirePoints","31"));
  1604. CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("CastleZoneFameTaskFrequency","300"));
  1605. CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("CastleZoneFameAquirePoints","125"));
  1606. FAME_FOR_DEAD_PLAYERS = Boolean.parseBoolean(Character.getProperty("FameForDeadPlayers", "true"));
  1607. IS_CRAFTING_ENABLED = Boolean.parseBoolean(Character.getProperty("CraftingEnabled", "true"));
  1608. CRAFT_MASTERWORK = Boolean.parseBoolean(Character.getProperty("CraftMasterwork", "True"));
  1609. DWARF_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("DwarfRecipeLimit","50"));
  1610. COMMON_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("CommonRecipeLimit","50"));
  1611. ALT_GAME_CREATION = Boolean.parseBoolean(Character.getProperty("AltGameCreation", "false"));
  1612. ALT_GAME_CREATION_SPEED = Double.parseDouble(Character.getProperty("AltGameCreationSpeed", "1"));
  1613. ALT_GAME_CREATION_XP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationXpRate", "1"));
  1614. ALT_GAME_CREATION_SP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationSpRate", "1"));
  1615. ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationRareXpSpRate", "2"));
  1616. ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(Character.getProperty("AltBlacksmithUseRecipes", "true"));
  1617. ALT_CLAN_JOIN_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeJoinAClan", "1"));
  1618. ALT_CLAN_CREATE_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeCreateAClan", "10"));
  1619. ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(Character.getProperty("DaysToPassToDissolveAClan", "7"));
  1620. ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
  1621. ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
  1622. ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
  1623. ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(Character.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "1"));
  1624. ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(Character.getProperty("AltMaxNumOfClansInAlly", "3"));
  1625. ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(Character.getProperty("AltClanMembersForWar", "15"));
  1626. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH= Boolean.parseBoolean(Character.getProperty("AltMembersCanWithdrawFromClanWH", "false"));
  1627. REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(Character.getProperty("RemoveCastleCirclets", "true"));
  1628. ALT_PARTY_RANGE = Integer.parseInt(Character.getProperty("AltPartyRange", "1600"));
  1629. ALT_PARTY_RANGE2 = Integer.parseInt(Character.getProperty("AltPartyRange2", "1400"));
  1630. ALT_LEAVE_PARTY_LEADER = Boolean.parseBoolean(Character.getProperty("AltLeavePartyLeader", "False"));
  1631. STARTING_ADENA = Long.parseLong(Character.getProperty("StartingAdena", "0"));
  1632. STARTING_LEVEL = Byte.parseByte(Character.getProperty("StartingLevel", "1"));
  1633. STARTING_SP = Integer.parseInt(Character.getProperty("StartingSP", "0"));
  1634. AUTO_LOOT = Boolean.parseBoolean(Character.getProperty("AutoLoot", "false"));
  1635. AUTO_LOOT_RAIDS = Boolean.parseBoolean(Character.getProperty("AutoLootRaids", "false"));
  1636. LOOT_RAIDS_PRIVILEGE_INTERVAL = Integer.parseInt(Character.getProperty("RaidLootRightsInterval", "900")) * 1000;
  1637. LOOT_RAIDS_PRIVILEGE_CC_SIZE = Integer.parseInt(Character.getProperty("RaidLootRightsCCSize", "45"));
  1638. UNSTUCK_INTERVAL = Integer.parseInt(Character.getProperty("UnstuckInterval", "300"));
  1639. TELEPORT_WATCHDOG_TIMEOUT = Integer.parseInt(Character.getProperty("TeleportWatchdogTimeout", "0"));
  1640. PLAYER_SPAWN_PROTECTION = Integer.parseInt(Character.getProperty("PlayerSpawnProtection", "0"));
  1641. String[] items = Character.getProperty("PlayerSpawnProtectionAllowedItems", "0").split(",");
  1642. SPAWN_PROTECTION_ALLOWED_ITEMS = new ArrayList<Integer>(items.length);
  1643. for(String item : items)
  1644. {
  1645. Integer itm = 0;
  1646. try { itm = Integer.parseInt(item); }
  1647. catch(NumberFormatException nfe)
  1648. {
  1649. _log.warning("Player Spawn Protection: Wrong ItemId passed: "+item);
  1650. _log.warning(nfe.getMessage());
  1651. }
  1652. if(itm != 0)
  1653. SPAWN_PROTECTION_ALLOWED_ITEMS.add(itm);
  1654. }
  1655. SPAWN_PROTECTION_ALLOWED_ITEMS.trimToSize();
  1656. PLAYER_TELEPORT_PROTECTION = Integer.parseInt(Character.getProperty("PlayerTeleportProtection", "0"));
  1657. RANDOM_RESPAWN_IN_TOWN_ENABLED = Boolean.parseBoolean(Character.getProperty("RandomRespawnInTownEnabled", "True"));
  1658. OFFSET_ON_TELEPORT_ENABLED = Boolean.parseBoolean(Character.getProperty("OffsetOnTeleportEnabled", "True"));
  1659. MAX_OFFSET_ON_TELEPORT = Integer.parseInt(Character.getProperty("MaxOffsetOnTeleport", "50"));
  1660. RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(Character.getProperty("RestorePlayerInstance", "False"));
  1661. ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(Character.getProperty("AllowSummonToInstance", "True"));
  1662. PETITIONING_ALLOWED = Boolean.parseBoolean(Character.getProperty("PetitioningAllowed", "True"));
  1663. MAX_PETITIONS_PER_PLAYER = Integer.parseInt(Character.getProperty("MaxPetitionsPerPlayer", "5"));
  1664. MAX_PETITIONS_PENDING = Integer.parseInt(Character.getProperty("MaxPetitionsPending", "25"));
  1665. ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltFreeTeleporting", "False"));
  1666. DELETE_DAYS = Integer.parseInt(Character.getProperty("DeleteCharAfterDays", "7"));
  1667. ALT_GAME_EXPONENT_XP = Float.parseFloat(Character.getProperty("AltGameExponentXp", "0."));
  1668. ALT_GAME_EXPONENT_SP = Float.parseFloat(Character.getProperty("AltGameExponentSp", "0."));
  1669. PARTY_XP_CUTOFF_METHOD = Character.getProperty("PartyXpCutoffMethod", "level");
  1670. PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(Character.getProperty("PartyXpCutoffPercent", "3."));
  1671. PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(Character.getProperty("PartyXpCutoffLevel", "20"));
  1672. DISABLE_TUTORIAL = Boolean.parseBoolean(Character.getProperty("DisableTutorial", "False"));
  1673. EXPERTISE_PENALTY = Boolean.parseBoolean(Character.getProperty("ExpertisePenalty", "True"));
  1674. STORE_RECIPE_SHOPLIST = Boolean.parseBoolean(Character.getProperty("StoreRecipeShopList", "False"));
  1675. STORE_UI_SETTINGS = Boolean.parseBoolean(Character.getProperty("StoreCharUiSettings", "False"));
  1676. FORBIDDEN_NAMES = Character.getProperty("ForbiddenNames", "").split(",");
  1677. SILENCE_MODE_EXCLUDE = Boolean.parseBoolean(Character.getProperty("SilenceModeExclude", "False"));
  1678. PLAYER_MOVEMENT_BLOCK_TIME = Integer.parseInt(Character.getProperty("NpcTalkBlockingTime", "0")) * 1000;
  1679. }
  1680. catch (Exception e)
  1681. {
  1682. e.printStackTrace();
  1683. throw new Error("Failed to Load "+CHARACTER_CONFIG_FILE+" file.");
  1684. }
  1685. // Load L2J Server Version L2Properties file (if exists)
  1686. try
  1687. {
  1688. L2Properties serverVersion = new L2Properties();
  1689. is = new FileInputStream(new File(SERVER_VERSION_FILE));
  1690. serverVersion.load(is);
  1691. SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1692. SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
  1693. }
  1694. catch (Exception e)
  1695. {
  1696. //Ignore L2Properties file if it doesnt exist
  1697. SERVER_VERSION = "Unsupported Custom Version.";
  1698. SERVER_BUILD_DATE = "Undefined Date.";
  1699. }
  1700. // Load L2J Datapack Version L2Properties file (if exists)
  1701. try
  1702. {
  1703. L2Properties serverVersion = new L2Properties();
  1704. is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
  1705. serverVersion.load(is);
  1706. DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1707. }
  1708. catch (Exception e)
  1709. {
  1710. //Ignore L2Properties file if it doesnt exist
  1711. DATAPACK_VERSION = "Unsupported Custom Version.";
  1712. }
  1713. // Load Telnet L2Properties file (if exists)
  1714. try
  1715. {
  1716. L2Properties telnetSettings = new L2Properties();
  1717. is = new FileInputStream(new File(TELNET_FILE));
  1718. telnetSettings.load(is);
  1719. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  1720. }
  1721. catch (Exception e)
  1722. {
  1723. e.printStackTrace();
  1724. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1725. }
  1726. // MMO
  1727. try
  1728. {
  1729. //_log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  1730. L2Properties mmoSettings = new L2Properties();
  1731. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  1732. mmoSettings.load(is);
  1733. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  1734. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  1735. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  1736. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  1737. }
  1738. catch (Exception e)
  1739. {
  1740. e.printStackTrace();
  1741. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  1742. }
  1743. // Load IdFactory L2Properties file (if exists)
  1744. try
  1745. {
  1746. L2Properties idSettings = new L2Properties();
  1747. is = new FileInputStream(new File(ID_CONFIG_FILE));
  1748. idSettings.load(is);
  1749. MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
  1750. SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
  1751. IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
  1752. BAD_ID_CHECKING = Boolean.parseBoolean(idSettings.getProperty("BadIdChecking", "True"));
  1753. }
  1754. catch (Exception e)
  1755. {
  1756. e.printStackTrace();
  1757. throw new Error("Failed to Load "+ID_CONFIG_FILE+" file.");
  1758. }
  1759. // Load General L2Properties file (if exists)
  1760. try
  1761. {
  1762. L2Properties General = new L2Properties();
  1763. is = new FileInputStream(new File(GENERAL_CONFIG_FILE));
  1764. General.load(is);
  1765. EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(General.getProperty("EverybodyHasAdminRights", "false"));
  1766. DISPLAY_SERVER_VERSION = Boolean.parseBoolean(General.getProperty("DisplayServerRevision","True"));
  1767. SERVER_LIST_BRACKET = Boolean.parseBoolean(General.getProperty("ServerListBrackets", "false"));
  1768. SERVER_LIST_TYPE = getServerTypeId(General.getProperty("ServerListType", "Normal").split(","));
  1769. SERVER_LIST_AGE = Integer.parseInt(General.getProperty("ServerListAge", "0"));
  1770. SERVER_GMONLY = Boolean.parseBoolean(General.getProperty("ServerGMOnly", "false"));
  1771. GM_HERO_AURA = Boolean.parseBoolean(General.getProperty("GMHeroAura", "False"));
  1772. GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(General.getProperty("GMStartupInvulnerable", "False"));
  1773. GM_STARTUP_INVISIBLE = Boolean.parseBoolean(General.getProperty("GMStartupInvisible", "False"));
  1774. GM_STARTUP_SILENCE = Boolean.parseBoolean(General.getProperty("GMStartupSilence", "False"));
  1775. GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(General.getProperty("GMStartupAutoList", "False"));
  1776. GM_STARTUP_DIET_MODE = Boolean.parseBoolean(General.getProperty("GMStartupDietMode", "False"));
  1777. GM_ADMIN_MENU_STYLE = General.getProperty("GMAdminMenuStyle", "modern");
  1778. GM_ITEM_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMItemRestriction", "True"));
  1779. GM_SKILL_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMSkillRestriction", "True"));
  1780. GM_TRADE_RESTRICTED_ITEMS = Boolean.parseBoolean(General.getProperty("GMTradeRestrictedItems", "False"));
  1781. GM_RESTART_FIGHTING = Boolean.parseBoolean(General.getProperty("GMRestartFighting", "True"));
  1782. GM_ANNOUNCER_NAME = Boolean.parseBoolean(General.getProperty("GMShowAnnouncerName", "False"));
  1783. GM_GIVE_SPECIAL_SKILLS = Boolean.parseBoolean(General.getProperty("GMGiveSpecialSkills", "False"));
  1784. GM_GIVE_SPECIAL_AURA_SKILLS = Boolean.parseBoolean(General.getProperty("GMGiveSpecialAuraSkills", "False"));
  1785. BYPASS_VALIDATION = Boolean.parseBoolean(General.getProperty("BypassValidation", "True"));
  1786. GAMEGUARD_ENFORCE = Boolean.parseBoolean(General.getProperty("GameGuardEnforce", "False"));
  1787. GAMEGUARD_PROHIBITACTION = Boolean.parseBoolean(General.getProperty("GameGuardProhibitAction", "False"));
  1788. LOG_CHAT = Boolean.parseBoolean(General.getProperty("LogChat", "false"));
  1789. LOG_ITEMS = Boolean.parseBoolean(General.getProperty("LogItems", "false"));
  1790. LOG_ITEMS_SMALL_LOG = Boolean.parseBoolean(General.getProperty("LogItemsSmallLog", "false"));
  1791. LOG_ITEM_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogItemEnchants", "false"));
  1792. LOG_SKILL_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogSkillEnchants", "false"));
  1793. GMAUDIT = Boolean.parseBoolean(General.getProperty("GMAudit", "False"));
  1794. LOG_GAME_DAMAGE = Boolean.parseBoolean(General.getProperty("LogGameDamage", "False"));
  1795. LOG_GAME_DAMAGE_THRESHOLD = Integer.parseInt(General.getProperty("LogGameDamageThreshold", "5000"));
  1796. SKILL_CHECK_ENABLE = Boolean.parseBoolean(General.getProperty("SkillCheckEnable", "False"));
  1797. SKILL_CHECK_REMOVE = Boolean.parseBoolean(General.getProperty("SkillCheckRemove", "False"));
  1798. SKILL_CHECK_GM = Boolean.parseBoolean(General.getProperty("SkillCheckGM", "True"));
  1799. DEBUG = Boolean.parseBoolean(General.getProperty("Debug", "false"));
  1800. PACKET_HANDLER_DEBUG = Boolean.parseBoolean(General.getProperty("PacketHandlerDebug", "false"));
  1801. DEVELOPER = Boolean.parseBoolean(General.getProperty("Developer", "false"));
  1802. ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(General.getProperty("AcceptGeoeditorConn", "false"));
  1803. ALT_DEV_NO_HANDLERS = Boolean.parseBoolean(General.getProperty("AltDevNoHandlers", "False"));
  1804. ALT_DEV_NO_QUESTS = Boolean.parseBoolean(General.getProperty("AltDevNoQuests", "False"));
  1805. ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(General.getProperty("AltDevNoSpawns", "False"));
  1806. THREAD_P_EFFECTS = Integer.parseInt(General.getProperty("ThreadPoolSizeEffects", "10"));
  1807. THREAD_P_GENERAL = Integer.parseInt(General.getProperty("ThreadPoolSizeGeneral", "13"));
  1808. IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("UrgentPacketThreadCoreSize", "2"));
  1809. GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralPacketThreadCoreSize", "4"));
  1810. GENERAL_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralThreadCoreSize", "4"));
  1811. AI_MAX_THREAD = Integer.parseInt(General.getProperty("AiMaxThread", "6"));
  1812. CLIENT_PACKET_QUEUE_SIZE = Integer.parseInt(General.getProperty("ClientPacketQueueSize", "0"));
  1813. if (CLIENT_PACKET_QUEUE_SIZE == 0)
  1814. CLIENT_PACKET_QUEUE_SIZE = MMO_MAX_READ_PER_PASS + 2;
  1815. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = Integer.parseInt(General.getProperty("ClientPacketQueueMaxBurstSize", "0"));
  1816. if (CLIENT_PACKET_QUEUE_MAX_BURST_SIZE == 0)
  1817. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = MMO_MAX_READ_PER_PASS + 1;
  1818. CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND = Integer.parseInt(General.getProperty("ClientPacketQueueMaxPacketsPerSecond", "80"));
  1819. CLIENT_PACKET_QUEUE_MEASURE_INTERVAL = Integer.parseInt(General.getProperty("ClientPacketQueueMeasureInterval", "5"));
  1820. CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND = Integer.parseInt(General.getProperty("ClientPacketQueueMaxAveragePacketsPerSecond", "40"));
  1821. CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN = Integer.parseInt(General.getProperty("ClientPacketQueueMaxFloodsPerMin", "2"));
  1822. CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN = Integer.parseInt(General.getProperty("ClientPacketQueueMaxOverflowsPerMin", "1"));
  1823. CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = Integer.parseInt(General.getProperty("ClientPacketQueueMaxUnderflowsPerMin", "1"));
  1824. CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = Integer.parseInt(General.getProperty("ClientPacketQueueMaxUnknownPerMin", "5"));
  1825. DEADLOCK_DETECTOR = Boolean.parseBoolean(General.getProperty("DeadLockDetector", "False"));
  1826. DEADLOCK_CHECK_INTERVAL = Integer.parseInt(General.getProperty("DeadLockCheckInterval", "20"));
  1827. RESTART_ON_DEADLOCK = Boolean.parseBoolean(General.getProperty("RestartOnDeadlock", "False"));
  1828. ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
  1829. AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600"));
  1830. HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime","60"))*1000;
  1831. String[] split = General.getProperty("ListOfProtectedItems", "0").split(",");
  1832. LIST_PROTECTED_ITEMS = new TIntArrayList(split.length);
  1833. for (String id : split)
  1834. {
  1835. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
  1836. }
  1837. DATABASE_CLEAN_UP = Boolean.parseBoolean(General.getProperty("DatabaseCleanUp", "true"));
  1838. CONNECTION_CLOSE_TIME = Long.parseLong(General.getProperty("ConnectionCloseTime", "60000"));
  1839. CHAR_STORE_INTERVAL = Integer.parseInt(General.getProperty("CharacterDataStoreInterval", "15"));
  1840. LAZY_ITEMS_UPDATE = Boolean.parseBoolean(General.getProperty("LazyItemsUpdate", "false"));
  1841. UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(General.getProperty("UpdateItemsOnCharStore", "false"));
  1842. DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyPlayerDroppedItem", "false"));
  1843. DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyEquipableItem", "false"));
  1844. SAVE_DROPPED_ITEM = Boolean.parseBoolean(General.getProperty("SaveDroppedItem", "false"));
  1845. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(General.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
  1846. SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(General.getProperty("SaveDroppedItemInterval", "60"))*60000;
  1847. CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(General.getProperty("ClearDroppedItemTable", "false"));
  1848. AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(General.getProperty("AutoDeleteInvalidQuestData", "False"));
  1849. PRECISE_DROP_CALCULATION = Boolean.parseBoolean(General.getProperty("PreciseDropCalculation", "True"));
  1850. MULTIPLE_ITEM_DROP = Boolean.parseBoolean(General.getProperty("MultipleItemDrop", "True"));
  1851. FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(General.getProperty("ForceInventoryUpdate", "False"));
  1852. LAZY_CACHE = Boolean.parseBoolean(General.getProperty("LazyCache", "True"));
  1853. CACHE_CHAR_NAMES = Boolean.parseBoolean(General.getProperty("CacheCharNames", "True"));
  1854. MIN_NPC_ANIMATION = Integer.parseInt(General.getProperty("MinNPCAnimation", "10"));
  1855. MAX_NPC_ANIMATION = Integer.parseInt(General.getProperty("MaxNPCAnimation", "20"));
  1856. MIN_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MinMonsterAnimation", "5"));
  1857. MAX_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MaxMonsterAnimation", "20"));
  1858. MOVE_BASED_KNOWNLIST = Boolean.parseBoolean(General.getProperty("MoveBasedKnownlist", "False"));
  1859. KNOWNLIST_UPDATE_INTERVAL = Long.parseLong(General.getProperty("KnownListUpdateInterval", "1250"));
  1860. GRIDS_ALWAYS_ON = Boolean.parseBoolean(General.getProperty("GridsAlwaysOn", "False"));
  1861. GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOnTime", "1"));
  1862. GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOffTime", "90"));
  1863. WORLD_X_MIN = Integer.parseInt(General.getProperty("WorldXMin", "10"));
  1864. WORLD_X_MAX = Integer.parseInt(General.getProperty("WorldXMax", "26"));
  1865. WORLD_Y_MIN = Integer.parseInt(General.getProperty("WorldYMin", "10"));
  1866. WORLD_Y_MAX = Integer.parseInt(General.getProperty("WorldYMax", "26"));
  1867. GEODATA = Integer.parseInt(General.getProperty("GeoData", "0"));
  1868. GEODATA_CELLFINDING = Boolean.parseBoolean(General.getProperty("CellPathFinding", "False"));
  1869. PATHFIND_BUFFERS = General.getProperty("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
  1870. LOW_WEIGHT = Float.parseFloat(General.getProperty("LowWeight", "0.5"));
  1871. MEDIUM_WEIGHT = Float.parseFloat(General.getProperty("MediumWeight", "2"));
  1872. HIGH_WEIGHT = Float.parseFloat(General.getProperty("HighWeight", "3"));
  1873. ADVANCED_DIAGONAL_STRATEGY = Boolean.parseBoolean(General.getProperty("AdvancedDiagonalStrategy", "True"));
  1874. DIAGONAL_WEIGHT = Float.parseFloat(General.getProperty("DiagonalWeight", "0.707"));
  1875. MAX_POSTFILTER_PASSES = Integer.parseInt(General.getProperty("MaxPostfilterPasses", "3"));
  1876. DEBUG_PATH = Boolean.parseBoolean(General.getProperty("DebugPath", "False"));
  1877. FORCE_GEODATA = Boolean.parseBoolean(General.getProperty("ForceGeodata", "True"));
  1878. COORD_SYNCHRONIZE = Integer.parseInt(General.getProperty("CoordSynchronize", "-1"));
  1879. String str = General.getProperty("EnableFallingDamage", "auto");
  1880. ENABLE_FALLING_DAMAGE = "auto".equalsIgnoreCase(str) ? GEODATA > 0 : Boolean.parseBoolean(str);
  1881. ZONE_TOWN = Integer.parseInt(General.getProperty("ZoneTown", "0"));
  1882. DEFAULT_GLOBAL_CHAT = General.getProperty("GlobalChat", "ON");
  1883. DEFAULT_TRADE_CHAT = General.getProperty("TradeChat", "ON");
  1884. ALLOW_WAREHOUSE = Boolean.parseBoolean(General.getProperty("AllowWarehouse", "True"));
  1885. WAREHOUSE_CACHE = Boolean.parseBoolean(General.getProperty("WarehouseCache", "False"));
  1886. WAREHOUSE_CACHE_TIME = Integer.parseInt(General.getProperty("WarehouseCacheTime", "15"));
  1887. ALLOW_REFUND = Boolean.parseBoolean(General.getProperty("AllowRefund", "True"));
  1888. ALLOW_MAIL = Boolean.parseBoolean(General.getProperty("AllowMail", "True"));
  1889. ALLOW_ATTACHMENTS = Boolean.parseBoolean(General.getProperty("AllowAttachments", "True"));
  1890. ALLOW_WEAR = Boolean.parseBoolean(General.getProperty("AllowWear", "True"));
  1891. WEAR_DELAY = Integer.parseInt(General.getProperty("WearDelay", "5"));
  1892. WEAR_PRICE = Integer.parseInt(General.getProperty("WearPrice", "10"));
  1893. ALLOW_LOTTERY = Boolean.parseBoolean(General.getProperty("AllowLottery", "True"));
  1894. ALLOW_RACE = Boolean.parseBoolean(General.getProperty("AllowRace", "True"));
  1895. ALLOW_WATER = Boolean.parseBoolean(General.getProperty("AllowWater", "True"));
  1896. ALLOW_RENTPET = Boolean.parseBoolean(General.getProperty("AllowRentPet", "False"));
  1897. ALLOWFISHING = Boolean.parseBoolean(General.getProperty("AllowFishing", "True"));
  1898. ALLOW_MANOR = Boolean.parseBoolean(General.getProperty("AllowManor", "True"));
  1899. ALLOW_BOAT = Boolean.parseBoolean(General.getProperty("AllowBoat", "True"));
  1900. BOAT_BROADCAST_RADIUS = Integer.parseInt(General.getProperty("BoatBroadcastRadius", "20000"));
  1901. ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(General.getProperty("AllowCursedWeapons", "True"));
  1902. ALLOW_NPC_WALKERS = Boolean.parseBoolean(General.getProperty("AllowNpcWalkers", "true"));
  1903. ALLOW_PET_WALKERS = Boolean.parseBoolean(General.getProperty("AllowPetWalkers", "True"));
  1904. SERVER_NEWS = Boolean.parseBoolean(General.getProperty("ShowServerNews", "False"));
  1905. COMMUNITY_TYPE = Integer.parseInt(General.getProperty("CommunityType", "1"));
  1906. BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(General.getProperty("BBSShowPlayerList", "false"));
  1907. BBS_DEFAULT = General.getProperty("BBSDefault", "_bbshome");
  1908. SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowLevelOnCommunityBoard", "False"));
  1909. SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowStatusOnCommunityBoard", "True"));
  1910. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePageSizeOnCommunityBoard", "50"));
  1911. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePerRowOnCommunityBoard", "5"));
  1912. USE_SAY_FILTER = Boolean.parseBoolean(General.getProperty("UseChatFilter", "false"));
  1913. CHAT_FILTER_CHARS = General.getProperty("ChatFilterChars", "^_^");
  1914. String[] propertySplit4 = General.getProperty("BanChatChannels", "0;1;8;17").trim().split(";");
  1915. BAN_CHAT_CHANNELS = new int[propertySplit4.length];
  1916. try
  1917. {
  1918. int i = 0;
  1919. for (String chatId : propertySplit4)
  1920. BAN_CHAT_CHANNELS[i++] = Integer.parseInt(chatId);
  1921. }
  1922. catch (NumberFormatException nfe)
  1923. {
  1924. _log.log(Level.WARNING, nfe.getMessage(), nfe);
  1925. }
  1926. ALT_MANOR_REFRESH_TIME = Integer.parseInt(General.getProperty("AltManorRefreshTime","20"));
  1927. ALT_MANOR_REFRESH_MIN = Integer.parseInt(General.getProperty("AltManorRefreshMin","00"));
  1928. ALT_MANOR_APPROVE_TIME = Integer.parseInt(General.getProperty("AltManorApproveTime","6"));
  1929. ALT_MANOR_APPROVE_MIN = Integer.parseInt(General.getProperty("AltManorApproveMin","00"));
  1930. ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(General.getProperty("AltManorMaintenancePeriod","360000"));
  1931. ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(General.getProperty("AltManorSaveAllActions","false"));
  1932. ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(General.getProperty("AltManorSavePeriodRate","2"));
  1933. ALT_LOTTERY_PRIZE = Long.parseLong(General.getProperty("AltLotteryPrize","50000"));
  1934. ALT_LOTTERY_TICKET_PRICE = Long.parseLong(General.getProperty("AltLotteryTicketPrice","2000"));
  1935. ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery5NumberRate","0.6"));
  1936. ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery4NumberRate","0.2"));
  1937. ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery3NumberRate","0.2"));
  1938. ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Long.parseLong(General.getProperty("AltLottery2and1NumberPrize","200"));
  1939. ALT_ITEM_AUCTION_ENABLED = Boolean.valueOf(General.getProperty("AltItemAuctionEnabled", "False"));
  1940. ALT_ITEM_AUCTION_EXPIRED_AFTER = Integer.valueOf(General.getProperty("AltItemAuctionExpiredAfter", "14"));
  1941. ALT_ITEM_AUCTION_TIME_EXTENDS_ON_BID = 1000 * (long)Integer.valueOf(General.getProperty("AltItemAuctionTimeExtendsOnBid", "0"));
  1942. FS_TIME_ATTACK = Integer.parseInt(General.getProperty("TimeOfAttack", "50"));
  1943. FS_TIME_COOLDOWN = Integer.parseInt(General.getProperty("TimeOfCoolDown", "5"));
  1944. FS_TIME_ENTRY = Integer.parseInt(General.getProperty("TimeOfEntry", "3"));
  1945. FS_TIME_WARMUP = Integer.parseInt(General.getProperty("TimeOfWarmUp", "2"));
  1946. FS_PARTY_MEMBER_COUNT = Integer.parseInt(General.getProperty("NumberOfNecessaryPartyMembers", "4"));
  1947. if (FS_TIME_ATTACK <= 0)
  1948. FS_TIME_ATTACK = 50;
  1949. if (FS_TIME_COOLDOWN <= 0)
  1950. FS_TIME_COOLDOWN = 5;
  1951. if (FS_TIME_ENTRY <= 0)
  1952. FS_TIME_ENTRY = 3;
  1953. if (FS_TIME_ENTRY <= 0)
  1954. FS_TIME_ENTRY = 3;
  1955. if (FS_TIME_ENTRY <= 0)
  1956. FS_TIME_ENTRY = 3;
  1957. RIFT_MIN_PARTY_SIZE = Integer.parseInt(General.getProperty("RiftMinPartySize", "5"));
  1958. RIFT_MAX_JUMPS = Integer.parseInt(General.getProperty("MaxRiftJumps", "4"));
  1959. RIFT_SPAWN_DELAY = Integer.parseInt(General.getProperty("RiftSpawnDelay", "10000"));
  1960. RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(General.getProperty("AutoJumpsDelayMin", "480"));
  1961. RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(General.getProperty("AutoJumpsDelayMax", "600"));
  1962. RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(General.getProperty("BossRoomTimeMultiply", "1.5"));
  1963. RIFT_ENTER_COST_RECRUIT = Integer.parseInt(General.getProperty("RecruitCost", "18"));
  1964. RIFT_ENTER_COST_SOLDIER = Integer.parseInt(General.getProperty("SoldierCost", "21"));
  1965. RIFT_ENTER_COST_OFFICER = Integer.parseInt(General.getProperty("OfficerCost", "24"));
  1966. RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(General.getProperty("CaptainCost", "27"));
  1967. RIFT_ENTER_COST_COMMANDER = Integer.parseInt(General.getProperty("CommanderCost", "30"));
  1968. RIFT_ENTER_COST_HERO = Integer.parseInt(General.getProperty("HeroCost", "33"));
  1969. DEFAULT_PUNISH = Integer.parseInt(General.getProperty("DefaultPunish", "2"));
  1970. DEFAULT_PUNISH_PARAM = Integer.parseInt(General.getProperty("DefaultPunishParam", "0"));
  1971. ONLY_GM_ITEMS_FREE = Boolean.parseBoolean(General.getProperty("OnlyGMItemsFree", "True"));
  1972. JAIL_IS_PVP = Boolean.parseBoolean(General.getProperty("JailIsPvp", "False"));
  1973. JAIL_DISABLE_CHAT = Boolean.parseBoolean(General.getProperty("JailDisableChat", "True"));
  1974. JAIL_DISABLE_TRANSACTION = Boolean.parseBoolean(General.getProperty("JailDisableTransaction", "False"));
  1975. CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(General.getProperty("CustomSpawnlistTable", "false"));
  1976. SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("SaveGmSpawnOnCustom", "false"));
  1977. CUSTOM_NPC_TABLE = Boolean.valueOf(General.getProperty("CustomNpcTable", "false"));
  1978. CUSTOM_NPC_SKILLS_TABLE = Boolean.valueOf(General.getProperty("CustomNpcSkillsTable", "false"));
  1979. CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(General.getProperty("CustomArmorSetsTable", "false"));
  1980. CUSTOM_TELEPORT_TABLE = Boolean.valueOf(General.getProperty("CustomTeleportTable", "false"));
  1981. CUSTOM_DROPLIST_TABLE = Boolean.valueOf(General.getProperty("CustomDroplistTable", "false"));
  1982. CUSTOM_MERCHANT_TABLES = Boolean.valueOf(General.getProperty("CustomMerchantTables", "false"));
  1983. CUSTOM_NPCBUFFER_TABLES = Boolean.valueOf(General.getProperty("CustomNpcBufferTables", "false"));
  1984. CUSTOM_SKILLS_LOAD = Boolean.valueOf(General.getProperty("CustomSkillsLoad", "false"));
  1985. CUSTOM_ITEMS_LOAD = Boolean.valueOf(General.getProperty("CustomItemsLoad", "false"));
  1986. CUSTOM_MULTISELL_LOAD = Boolean.valueOf(General.getProperty("CustomMultisellLoad", "false"));
  1987. ALT_BIRTHDAY_GIFT = Integer.parseInt(General.getProperty("AltBirthdayGift", "22187"));
  1988. ALT_BIRTHDAY_MAIL_SUBJECT = General.getProperty("AltBirthdayMailSubject", "Happy Birthday!");
  1989. ALT_BIRTHDAY_MAIL_TEXT = General.getProperty("AltBirthdayMailText", "Hello Adventurer!! Seeing as you're one year older now, I thought I would send you some birthday cheer :) Please find your birthday pack attached. May these gifts bring you joy and happiness on this very special day.\n\nSincerely, Alegria");
  1990. ENABLE_BLOCK_CHECKER_EVENT = Boolean.valueOf(General.getProperty("EnableBlockCheckerEvent", "false"));
  1991. MIN_BLOCK_CHECKER_TEAM_MEMBERS = Integer.valueOf(General.getProperty("BlockCheckerMinTeamMembers", "2"));
  1992. if(MIN_BLOCK_CHECKER_TEAM_MEMBERS < 1)
  1993. MIN_BLOCK_CHECKER_TEAM_MEMBERS = 1;
  1994. else if(MIN_BLOCK_CHECKER_TEAM_MEMBERS > 6)
  1995. MIN_BLOCK_CHECKER_TEAM_MEMBERS = 6;
  1996. HBCE_FAIR_PLAY = Boolean.parseBoolean(General.getProperty("HBCEFairPlay", "false"));
  1997. CLEAR_CREST_CACHE = Boolean.parseBoolean(General.getProperty("ClearClanCache", "false"));
  1998. }
  1999. catch (Exception e)
  2000. {
  2001. e.printStackTrace();
  2002. throw new Error("Failed to Load "+GENERAL_CONFIG_FILE+" File.");
  2003. }
  2004. // Load FloodProtector L2Properties file
  2005. try
  2006. {
  2007. L2Properties security = new L2Properties();
  2008. is = new FileInputStream(new File(FLOOD_PROTECTOR_FILE));
  2009. security.load(is);
  2010. loadFloodProtectorConfigs(security);
  2011. }
  2012. catch (Exception e)
  2013. {
  2014. e.printStackTrace();
  2015. throw new Error("Failed to Load "+FLOOD_PROTECTOR_FILE);
  2016. }
  2017. // Load NPC L2Properties file (if exists)
  2018. try
  2019. {
  2020. L2Properties NPC = new L2Properties();
  2021. is = new FileInputStream(new File(NPC_CONFIG_FILE));
  2022. NPC.load(is);
  2023. ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(NPC.getProperty("AnnounceMammonSpawn", "False"));
  2024. ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(NPC.getProperty("AltMobAgroInPeaceZone", "True"));
  2025. ALT_ATTACKABLE_NPCS = Boolean.parseBoolean(NPC.getProperty("AltAttackableNpcs", "True"));
  2026. ALT_GAME_VIEWNPC = Boolean.parseBoolean(NPC.getProperty("AltGameViewNpc", "False"));
  2027. MAX_DRIFT_RANGE = Integer.parseInt(NPC.getProperty("MaxDriftRange", "300"));
  2028. DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
  2029. DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRulesRaid", "True"));
  2030. SHOW_NPC_LVL = Boolean.parseBoolean(NPC.getProperty("ShowNpcLevel", "False"));
  2031. SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(NPC.getProperty("ShowCrestWithoutQuest", "False"));
  2032. ENABLE_RANDOM_ENCHANT_EFFECT = Boolean.parseBoolean(NPC.getProperty("EnableRandomEnchantEffect", "False"));
  2033. MIN_NPC_LVL_DMG_PENALTY = Integer.parseInt(NPC.getProperty("MinNPCLevelForDmgPenalty", "78"));
  2034. NPC_DMG_PENALTY = parseConfigLine(NPC.getProperty("DmgPenaltyForLvLDifferences", "0.7, 0.6, 0.6, 0.55"));
  2035. NPC_CRIT_DMG_PENALTY = parseConfigLine(NPC.getProperty("CritDmgPenaltyForLvLDifferences", "0.75, 0.65, 0.6, 0.58"));
  2036. NPC_SKILL_DMG_PENALTY = parseConfigLine(NPC.getProperty("SkillDmgPenaltyForLvLDifferences", "0.8, 0.7, 0.65, 0.62"));
  2037. MIN_NPC_LVL_MAGIC_PENALTY = Integer.parseInt(NPC.getProperty("MinNPCLevelForMagicPenalty", "78"));
  2038. NPC_SKILL_CHANCE_PENALTY = parseConfigLine(NPC.getProperty("SkillChancePenaltyForLvLDifferences", "2.5, 3.0, 3.25, 3.5"));
  2039. DECAY_TIME_TASK = Integer.parseInt(NPC.getProperty("DecayTimeTask", "5000"));
  2040. NPC_DECAY_TIME = Integer.parseInt(NPC.getProperty("NpcDecayTime", "8500"));
  2041. RAID_BOSS_DECAY_TIME = Integer.parseInt(NPC.getProperty("RaidBossDecayTime", "30000"));
  2042. SPOILED_DECAY_TIME = Integer.parseInt(NPC.getProperty("SpoiledDecayTime", "18500"));
  2043. ENABLE_DROP_VITALITY_HERBS = Boolean.parseBoolean(NPC.getProperty("EnableVitalityHerbs", "True"));
  2044. GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
  2045. ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
  2046. String[] split = NPC.getProperty("ListPetRentNpc", "30827").split(",");
  2047. LIST_PET_RENT_NPC = new TIntArrayList(split.length);
  2048. for (String id : split)
  2049. {
  2050. LIST_PET_RENT_NPC.add(Integer.parseInt(id));
  2051. }
  2052. RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) /100;
  2053. RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) /100;
  2054. RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPDefenceMultiplier", "100")) /100;
  2055. RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMDefenceMultiplier", "100")) /100;
  2056. RAID_PATTACK_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPAttackMultiplier", "100")) /100;
  2057. RAID_MATTACK_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMAttackMultiplier", "100")) /100;
  2058. RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMinRespawnMultiplier", "1.0"));
  2059. RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
  2060. RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
  2061. final String[] propertySplit = NPC.getProperty("CustomMinionsRespawnTime", "").split(";");
  2062. MINIONS_RESPAWN_TIME = new TIntIntHashMap(propertySplit.length);
  2063. for (String prop : propertySplit)
  2064. {
  2065. String[] propSplit = prop.split(",");
  2066. if (propSplit.length != 2)
  2067. {
  2068. _log.warning(StringUtil.concat("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"", prop, "\""));
  2069. }
  2070. try
  2071. {
  2072. MINIONS_RESPAWN_TIME.put(Integer.valueOf(propSplit[0]), Integer.valueOf(propSplit[1]));
  2073. }
  2074. catch (NumberFormatException nfe)
  2075. {
  2076. if (!prop.isEmpty())
  2077. _log.warning(StringUtil.concat("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"", propSplit[0], "\"", propSplit[1]));
  2078. }
  2079. }
  2080. RAID_DISABLE_CURSE = Boolean.parseBoolean(NPC.getProperty("DisableRaidCurse", "False"));
  2081. RAID_CHAOS_TIME = Integer.parseInt(NPC.getProperty("RaidChaosTime", "10"));
  2082. GRAND_CHAOS_TIME = Integer.parseInt(NPC.getProperty("GrandChaosTime", "10"));
  2083. MINION_CHAOS_TIME = Integer.parseInt(NPC.getProperty("MinionChaosTime", "10"));
  2084. INVENTORY_MAXIMUM_PET = Integer.parseInt(NPC.getProperty("MaximumSlotsForPet", "12"));
  2085. PET_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetHpRegenMultiplier", "100")) /100;
  2086. PET_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetMpRegenMultiplier", "100")) /100;
  2087. split = NPC.getProperty("NonTalkingNpcs", "18684,18685,18686,18687,18688,18689,18690,19691,18692,31557,31606,31671,31672,31673,31674,32026,32030,32031,32032,32306,32619,32620,32621").split(",");
  2088. NON_TALKING_NPCS = new TIntArrayList(split.length);
  2089. for (String npcId : split)
  2090. {
  2091. try
  2092. {
  2093. NON_TALKING_NPCS.add(Integer.parseInt(npcId));
  2094. }
  2095. catch (NumberFormatException nfe)
  2096. {
  2097. if (!npcId.isEmpty())
  2098. {
  2099. _log.warning("Could not parse " + npcId + " id for NonTalkingNpcs. Please check that all values are digits and coma separated.");
  2100. }
  2101. }
  2102. }
  2103. }
  2104. catch (Exception e)
  2105. {
  2106. e.printStackTrace();
  2107. throw new Error("Failed to Load "+NPC_CONFIG_FILE+" File.");
  2108. }
  2109. // Load Rates L2Properties file (if exists)
  2110. try
  2111. {
  2112. L2Properties ratesSettings = new L2Properties();
  2113. is = new FileInputStream(new File(RATES_CONFIG_FILE));
  2114. ratesSettings.load(is);
  2115. RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
  2116. RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
  2117. RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
  2118. RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
  2119. RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
  2120. RATE_EXTR_FISH = Float.parseFloat(ratesSettings.getProperty("RateExtractFish", "1."));
  2121. RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
  2122. RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(ratesSettings.getProperty("RateRaidDropItems", "1."));
  2123. RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
  2124. RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
  2125. RATE_QUEST_DROP = Float.parseFloat(ratesSettings.getProperty("RateQuestDrop", "1."));
  2126. RATE_QUEST_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestReward", "1."));
  2127. RATE_QUEST_REWARD_XP = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardXP", "1."));
  2128. RATE_QUEST_REWARD_SP = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardSP", "1."));
  2129. RATE_QUEST_REWARD_ADENA = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardAdena", "1."));
  2130. RATE_QUEST_REWARD_USE_MULTIPLIERS = Boolean.parseBoolean(ratesSettings.getProperty("UseQuestRewardMultipliers", "False"));
  2131. RATE_QUEST_REWARD_POTION = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardPotion", "1."));
  2132. RATE_QUEST_REWARD_SCROLL = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardScroll", "1."));
  2133. RATE_QUEST_REWARD_RECIPE = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardRecipe", "1."));
  2134. RATE_QUEST_REWARD_MATERIAL = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardMaterial", "1."));
  2135. RATE_HB_TRUST_INCREASE = Float.parseFloat(ratesSettings.getProperty("RateHellboundTrustIncrease", "1."));
  2136. RATE_HB_TRUST_DECREASE = Float.parseFloat(ratesSettings.getProperty("RateHellboundTrustDecrease", "1."));
  2137. RATE_VITALITY_LEVEL_1 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel1", "1.5"));
  2138. RATE_VITALITY_LEVEL_2 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel2", "2."));
  2139. RATE_VITALITY_LEVEL_3 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel3", "2.5"));
  2140. RATE_VITALITY_LEVEL_4 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel4", "3."));
  2141. RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(ratesSettings.getProperty("RateRecoveryPeaceZone", "1."));
  2142. RATE_VITALITY_LOST = Float.parseFloat(ratesSettings.getProperty("RateVitalityLost", "1."));
  2143. RATE_VITALITY_GAIN = Float.parseFloat(ratesSettings.getProperty("RateVitalityGain", "1."));
  2144. RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(ratesSettings.getProperty("RateRecoveryOnReconnect", "4."));
  2145. RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
  2146. RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
  2147. RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "1."));
  2148. RATE_DROP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpHerbs", "1."));
  2149. RATE_DROP_MP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateMpHerbs", "1."));
  2150. RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "1."));
  2151. RATE_DROP_VITALITY_HERBS = Float.parseFloat(ratesSettings.getProperty("RateVitalityHerbs", "1."));
  2152. PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
  2153. PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
  2154. PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
  2155. PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
  2156. PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
  2157. PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
  2158. PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
  2159. SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
  2160. KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
  2161. KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
  2162. KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
  2163. KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
  2164. KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
  2165. // Initializing table
  2166. PLAYER_XP_PERCENT_LOST = new double[Byte.MAX_VALUE+1];
  2167. // Default value
  2168. for (int i = 0; i <= Byte.MAX_VALUE; i++)
  2169. PLAYER_XP_PERCENT_LOST[i] = 1.;
  2170. // Now loading into table parsed values
  2171. try
  2172. {
  2173. 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(";");
  2174. for (String s : values)
  2175. {
  2176. int min;
  2177. int max;
  2178. double val;
  2179. String[] vals = s.split("-");
  2180. String[] mM = vals[0].split(",");
  2181. min = Integer.parseInt(mM[0]);
  2182. max = Integer.parseInt(mM[1]);
  2183. val = Double.parseDouble(vals[1]);
  2184. for (int i = min; i <= max; i++)
  2185. PLAYER_XP_PERCENT_LOST[i] = val;
  2186. }
  2187. }
  2188. catch (Exception e)
  2189. {
  2190. _log.warning("Error while loading Player XP percent lost");
  2191. e.printStackTrace();
  2192. }
  2193. String[] propertySplit = ratesSettings.getProperty("RateDropItemsById", "").split(";");
  2194. RATE_DROP_ITEMS_ID = new TIntFloatHashMap(propertySplit.length);
  2195. if (!propertySplit[0].isEmpty())
  2196. {
  2197. for (String item : propertySplit)
  2198. {
  2199. String[] itemSplit = item.split(",");
  2200. if (itemSplit.length != 2)
  2201. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  2202. else
  2203. {
  2204. try
  2205. {
  2206. RATE_DROP_ITEMS_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
  2207. }
  2208. catch (NumberFormatException nfe)
  2209. {
  2210. if (!item.isEmpty())
  2211. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  2212. }
  2213. }
  2214. }
  2215. }
  2216. if (RATE_DROP_ITEMS_ID.get(57) == 0f)
  2217. {
  2218. RATE_DROP_ITEMS_ID.put(57, RATE_DROP_ITEMS); //for Adena rate if not defined
  2219. }
  2220. }
  2221. catch (Exception e)
  2222. {
  2223. e.printStackTrace();
  2224. throw new Error("Failed to Load "+RATES_CONFIG_FILE+" File.");
  2225. }
  2226. // Load L2JMod L2Properties file (if exists)
  2227. try
  2228. {
  2229. L2Properties L2JModSettings = new L2Properties();
  2230. is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
  2231. L2JModSettings.load(is);
  2232. L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
  2233. L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
  2234. L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
  2235. L2JMOD_CHAMP_TITLE = L2JModSettings.getProperty("ChampionTitle", "Champion");
  2236. L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
  2237. L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
  2238. L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
  2239. L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
  2240. L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
  2241. L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
  2242. L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
  2243. L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
  2244. L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
  2245. L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
  2246. L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
  2247. L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
  2248. L2JMOD_CHAMPION_ENABLE_VITALITY = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnableVitality", "False"));
  2249. L2JMOD_CHAMPION_ENABLE_IN_INSTANCES = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnableInInstances", "False"));
  2250. TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
  2251. TVT_EVENT_IN_INSTANCE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventInInstance", "false"));
  2252. TVT_EVENT_INSTANCE_FILE = L2JModSettings.getProperty("TvTEventInstanceFile", "coliseum.xml");
  2253. TVT_EVENT_INTERVAL = L2JModSettings.getProperty("TvTEventInterval", "20:00").split(",");
  2254. TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
  2255. TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
  2256. TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
  2257. L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(L2JModSettings.getProperty("AllowWedding", "False"));
  2258. L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
  2259. L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
  2260. L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
  2261. L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
  2262. L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
  2263. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
  2264. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
  2265. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
  2266. L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
  2267. L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
  2268. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  2269. {
  2270. TVT_EVENT_ENABLED = false;
  2271. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
  2272. }
  2273. else
  2274. {
  2275. String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
  2276. if (propertySplit.length < 3)
  2277. {
  2278. TVT_EVENT_ENABLED = false;
  2279. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
  2280. }
  2281. else
  2282. {
  2283. TVT_EVENT_REWARDS = new ArrayList<int[]>();
  2284. TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  2285. TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  2286. TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  2287. TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  2288. TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  2289. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  2290. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  2291. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  2292. if (propertySplit.length == 4)
  2293. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[3] = Integer.parseInt(propertySplit[3]);
  2294. TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
  2295. TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
  2296. TVT_EVENT_MIN_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
  2297. TVT_EVENT_MAX_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
  2298. TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
  2299. TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
  2300. TVT_EVENT_EFFECTS_REMOVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventEffectsRemoval", "0"));
  2301. TVT_EVENT_MAX_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxParticipantsPerIP", "0"));
  2302. TVT_ALLOW_VOICED_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("TvTAllowVoicedInfoCommand", "false"));
  2303. TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
  2304. propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
  2305. if (propertySplit.length < 3)
  2306. {
  2307. TVT_EVENT_ENABLED = false;
  2308. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
  2309. }
  2310. else
  2311. {
  2312. TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  2313. TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  2314. TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  2315. TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
  2316. propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
  2317. if (propertySplit.length < 3)
  2318. {
  2319. TVT_EVENT_ENABLED= false;
  2320. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
  2321. }
  2322. else
  2323. {
  2324. TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  2325. TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  2326. TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  2327. propertySplit = L2JModSettings.getProperty("TvTEventParticipationFee", "0,0").split(",");
  2328. try
  2329. {
  2330. TVT_EVENT_PARTICIPATION_FEE[0] = Integer.parseInt(propertySplit[0]);
  2331. TVT_EVENT_PARTICIPATION_FEE[1] = Integer.parseInt(propertySplit[1]);
  2332. }
  2333. catch (NumberFormatException nfe)
  2334. {
  2335. if (propertySplit.length > 0)
  2336. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationFee");
  2337. }
  2338. propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
  2339. for (String reward : propertySplit)
  2340. {
  2341. String[] rewardSplit = reward.split(",");
  2342. if (rewardSplit.length != 2)
  2343. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  2344. else
  2345. {
  2346. try
  2347. {
  2348. TVT_EVENT_REWARDS.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  2349. }
  2350. catch (NumberFormatException nfe)
  2351. {
  2352. if (!reward.isEmpty())
  2353. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  2354. }
  2355. }
  2356. }
  2357. TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
  2358. TVT_EVENT_SCROLL_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventScrollsAllowed", "false"));
  2359. TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
  2360. TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
  2361. TVT_REWARD_TEAM_TIE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTRewardTeamTie", "false"));
  2362. propertySplit = L2JModSettings.getProperty("TvTDoorsToOpen", "").split(";");
  2363. for (String door : propertySplit)
  2364. {
  2365. try
  2366. {
  2367. TVT_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
  2368. }
  2369. catch (NumberFormatException nfe)
  2370. {
  2371. if (!door.isEmpty())
  2372. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"", door, "\""));
  2373. }
  2374. }
  2375. propertySplit = L2JModSettings.getProperty("TvTDoorsToClose", "").split(";");
  2376. for (String door : propertySplit)
  2377. {
  2378. try
  2379. {
  2380. TVT_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
  2381. }
  2382. catch (NumberFormatException nfe)
  2383. {
  2384. if (!door.isEmpty())
  2385. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"", door, "\""));
  2386. }
  2387. }
  2388. propertySplit = L2JModSettings.getProperty("TvTEventFighterBuffs", "").split(";");
  2389. if (!propertySplit[0].isEmpty())
  2390. {
  2391. TVT_EVENT_FIGHTER_BUFFS = new TIntIntHashMap(propertySplit.length);
  2392. for (String skill : propertySplit)
  2393. {
  2394. String[] skillSplit = skill.split(",");
  2395. if (skillSplit.length != 2)
  2396. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2397. else
  2398. {
  2399. try
  2400. {
  2401. TVT_EVENT_FIGHTER_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2402. }
  2403. catch (NumberFormatException nfe)
  2404. {
  2405. if (!skill.isEmpty())
  2406. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2407. }
  2408. }
  2409. }
  2410. }
  2411. propertySplit = L2JModSettings.getProperty("TvTEventMageBuffs", "").split(";");
  2412. if (!propertySplit[0].isEmpty())
  2413. {
  2414. TVT_EVENT_MAGE_BUFFS = new TIntIntHashMap(propertySplit.length);
  2415. for (String skill : propertySplit)
  2416. {
  2417. String[] skillSplit = skill.split(",");
  2418. if (skillSplit.length != 2)
  2419. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2420. else
  2421. {
  2422. try
  2423. {
  2424. TVT_EVENT_MAGE_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2425. }
  2426. catch (NumberFormatException nfe)
  2427. {
  2428. if (!skill.isEmpty())
  2429. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2430. }
  2431. }
  2432. }
  2433. }
  2434. }
  2435. }
  2436. }
  2437. }
  2438. BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
  2439. BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
  2440. BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
  2441. OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
  2442. OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
  2443. OFFLINE_MODE_IN_PEACE_ZONE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineModeInPaceZone", "False"));
  2444. OFFLINE_MODE_SET_INVULNERABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineModeSetInvulnerable", "False"));
  2445. OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
  2446. OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
  2447. OFFLINE_FAME = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineFame", "true"));
  2448. RESTORE_OFFLINERS = Boolean.parseBoolean(L2JModSettings.getProperty("RestoreOffliners", "false"));
  2449. OFFLINE_MAX_DAYS = Integer.parseInt(L2JModSettings.getProperty("OfflineMaxDays", "10"));
  2450. OFFLINE_DISCONNECT_FINISHED = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineDisconnectFinished", "true"));
  2451. L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
  2452. L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(L2JModSettings.getProperty("DisplayServerTime", "false"));
  2453. WELCOME_MESSAGE_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("ScreenWelcomeMessageEnable", "false"));
  2454. WELCOME_MESSAGE_TEXT = L2JModSettings.getProperty("ScreenWelcomeMessageText", "Welcome to L2J server!");
  2455. WELCOME_MESSAGE_TIME = Integer.parseInt(L2JModSettings.getProperty("ScreenWelcomeMessageTime", "10")) * 1000;
  2456. L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedEnable", "false"));
  2457. L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDualbox", "true"));
  2458. L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDisconnectedAsDualbox", "true"));
  2459. L2JMOD_ANTIFEED_INTERVAL = 1000*Integer.parseInt(L2JModSettings.getProperty("AntiFeedInterval", "120"));
  2460. ANNOUNCE_PK_PVP = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvP", "False"));
  2461. ANNOUNCE_PK_PVP_NORMAL_MESSAGE = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvPNormalMessage", "True"));
  2462. ANNOUNCE_PK_MSG = L2JModSettings.getProperty("AnnouncePkMsg", "$killer has slaughtered $target");
  2463. ANNOUNCE_PVP_MSG = L2JModSettings.getProperty("AnnouncePvpMsg", "$killer has defeated $target");
  2464. L2JMOD_CHAT_ADMIN = Boolean.parseBoolean(L2JModSettings.getProperty("ChatAdmin", "false"));
  2465. L2JMOD_MULTILANG_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangEnable", "false"));
  2466. String[] allowed = L2JModSettings.getProperty("MultiLangAllowed", "en").split(";");
  2467. L2JMOD_MULTILANG_ALLOWED = new ArrayList<String>(allowed.length);
  2468. for (String lang : allowed)
  2469. L2JMOD_MULTILANG_ALLOWED.add(lang);
  2470. L2JMOD_MULTILANG_DEFAULT = L2JModSettings.getProperty("MultiLangDefault", "en");
  2471. if (!L2JMOD_MULTILANG_ALLOWED.contains(L2JMOD_MULTILANG_DEFAULT))
  2472. _log.warning("MultiLang[Config.load()]: default language: " + L2JMOD_MULTILANG_DEFAULT + " is not in allowed list !");
  2473. L2JMOD_HELLBOUND_STATUS = Boolean.parseBoolean(L2JModSettings.getProperty("HellboundStatus", "False"));
  2474. L2JMOD_MULTILANG_VOICED_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangVoiceCommand", "True"));
  2475. L2JMOD_MULTILANG_SM_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangSystemMessageEnable", "false"));
  2476. allowed = L2JModSettings.getProperty("MultiLangSystemMessageAllowed", "").split(";");
  2477. L2JMOD_MULTILANG_SM_ALLOWED = new ArrayList<String>(allowed.length);
  2478. for (String lang : allowed)
  2479. {
  2480. if (!lang.isEmpty())
  2481. L2JMOD_MULTILANG_SM_ALLOWED.add(lang);
  2482. }
  2483. L2JMOD_MULTILANG_NS_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangNpcStringEnable", "false"));
  2484. allowed = L2JModSettings.getProperty("MultiLangNpcStringAllowed", "").split(";");
  2485. L2JMOD_MULTILANG_NS_ALLOWED = new ArrayList<String>(allowed.length);
  2486. for (String lang : allowed)
  2487. {
  2488. if (!lang.isEmpty())
  2489. L2JMOD_MULTILANG_NS_ALLOWED.add(lang);
  2490. }
  2491. L2WALKER_PROTECTION = Boolean.parseBoolean(L2JModSettings.getProperty("L2WalkerProtection", "False"));
  2492. L2JMOD_DEBUG_VOICE_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("DebugVoiceCommand", "False"));
  2493. L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxPlayersPerIP", "0"));
  2494. L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxOlympiadParticipantsPerIP", "0"));
  2495. L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxL2EventParticipantsPerIP", "0"));
  2496. String[] propertySplit = L2JModSettings.getProperty("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
  2497. L2JMOD_DUALBOX_CHECK_WHITELIST = new TIntIntHashMap(propertySplit.length);
  2498. for (String entry : propertySplit)
  2499. {
  2500. String[] entrySplit = entry.split(",");
  2501. if (entrySplit.length != 2)
  2502. _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid config property -> DualboxCheckWhitelist \"", entry, "\""));
  2503. else
  2504. {
  2505. try
  2506. {
  2507. int num = Integer.parseInt(entrySplit[1]);
  2508. num = num == 0 ? -1 : num;
  2509. L2JMOD_DUALBOX_CHECK_WHITELIST.put(InetAddress.getByName(entrySplit[0]).hashCode(), num);
  2510. }
  2511. catch (UnknownHostException e)
  2512. {
  2513. _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid address -> DualboxCheckWhitelist \"", entrySplit[0], "\""));
  2514. }
  2515. catch (NumberFormatException e)
  2516. {
  2517. _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid number -> DualboxCheckWhitelist \"", entrySplit[1], "\""));
  2518. }
  2519. }
  2520. }
  2521. L2JMOD_ALLOW_CHANGE_PASSWORD = Boolean.parseBoolean(L2JModSettings.getProperty("AllowChangePassword", "False"));
  2522. }
  2523. catch (Exception e)
  2524. {
  2525. e.printStackTrace();
  2526. throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File.");
  2527. }
  2528. // Load PvP L2Properties file (if exists)
  2529. try
  2530. {
  2531. L2Properties pvpSettings = new L2Properties();
  2532. is = new FileInputStream(new File(PVP_CONFIG_FILE));
  2533. pvpSettings.load(is);
  2534. KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
  2535. KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
  2536. KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
  2537. KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
  2538. KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
  2539. KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
  2540. KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
  2541. KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
  2542. 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");
  2543. String[] array = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
  2544. KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[array.length];
  2545. for (int i = 0; i < array.length; i++)
  2546. KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(array[i]);
  2547. array = KARMA_NONDROPPABLE_ITEMS.split(",");
  2548. KARMA_LIST_NONDROPPABLE_ITEMS = new int[array.length];
  2549. for (int i = 0; i < array.length; i++)
  2550. KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(array[i]);
  2551. // sorting so binarySearch can be used later
  2552. Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
  2553. Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
  2554. PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "120000"));
  2555. PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "60000"));
  2556. }
  2557. catch (Exception e)
  2558. {
  2559. e.printStackTrace();
  2560. throw new Error("Failed to Load "+PVP_CONFIG_FILE+" File.");
  2561. }
  2562. // Load Olympiad L2Properties file (if exists)
  2563. try
  2564. {
  2565. L2Properties olympiad = new L2Properties();
  2566. is = new FileInputStream(new File(OLYMPIAD_CONFIG_FILE));
  2567. olympiad.load(is);
  2568. ALT_OLY_START_TIME = Integer.parseInt(olympiad.getProperty("AltOlyStartTime", "18"));
  2569. ALT_OLY_MIN = Integer.parseInt(olympiad.getProperty("AltOlyMin","00"));
  2570. ALT_OLY_CPERIOD = Long.parseLong(olympiad.getProperty("AltOlyCPeriod","21600000"));
  2571. ALT_OLY_BATTLE = Long.parseLong(olympiad.getProperty("AltOlyBattle","360000"));
  2572. ALT_OLY_WPERIOD = Long.parseLong(olympiad.getProperty("AltOlyWPeriod","604800000"));
  2573. ALT_OLY_VPERIOD = Long.parseLong(olympiad.getProperty("AltOlyVPeriod","86400000"));
  2574. ALT_OLY_START_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyStartPoints","10"));
  2575. ALT_OLY_WEEKLY_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyWeeklyPoints","10"));
  2576. ALT_OLY_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyClassedParticipants","11"));
  2577. ALT_OLY_NONCLASSED = Integer.parseInt(olympiad.getProperty("AltOlyNonClassedParticipants","11"));
  2578. ALT_OLY_TEAMS = Integer.parseInt(olympiad.getProperty("AltOlyTeamsParticipants","6"));
  2579. ALT_OLY_REG_DISPLAY = Integer.parseInt(olympiad.getProperty("AltOlyRegistrationDisplayNumber","100"));
  2580. ALT_OLY_CLASSED_REWARD = parseItemsList(olympiad.getProperty("AltOlyClassedReward","13722,50"));
  2581. ALT_OLY_NONCLASSED_REWARD = parseItemsList(olympiad.getProperty("AltOlyNonClassedReward","13722,40"));
  2582. ALT_OLY_TEAM_REWARD = parseItemsList(olympiad.getProperty("AltOlyTeamReward","13722,85"));
  2583. ALT_OLY_COMP_RITEM = Integer.parseInt(olympiad.getProperty("AltOlyCompRewItem","13722"));
  2584. ALT_OLY_MIN_MATCHES = Integer.parseInt(olympiad.getProperty("AltOlyMinMatchesForPoints","15"));
  2585. ALT_OLY_GP_PER_POINT = Integer.parseInt(olympiad.getProperty("AltOlyGPPerPoint","1000"));
  2586. ALT_OLY_HERO_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyHeroPoints","200"));
  2587. ALT_OLY_RANK1_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank1Points","100"));
  2588. ALT_OLY_RANK2_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank2Points","75"));
  2589. ALT_OLY_RANK3_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank3Points","55"));
  2590. ALT_OLY_RANK4_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank4Points","40"));
  2591. ALT_OLY_RANK5_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank5Points","30"));
  2592. ALT_OLY_MAX_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyMaxPoints","10"));
  2593. ALT_OLY_DIVIDER_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyDividerClassed","5"));
  2594. ALT_OLY_DIVIDER_NON_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyDividerNonClassed","5"));
  2595. ALT_OLY_MAX_WEEKLY_MATCHES = Integer.parseInt(olympiad.getProperty("AltOlyMaxWeeklyMatches","70"));
  2596. ALT_OLY_MAX_WEEKLY_MATCHES_NON_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyMaxWeeklyMatchesNonClassed","60"));
  2597. ALT_OLY_MAX_WEEKLY_MATCHES_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyMaxWeeklyMatchesClassed","30"));
  2598. ALT_OLY_MAX_WEEKLY_MATCHES_TEAM = Integer.parseInt(olympiad.getProperty("AltOlyMaxWeeklyMatchesTeam","10"));
  2599. ALT_OLY_LOG_FIGHTS = Boolean.parseBoolean(olympiad.getProperty("AltOlyLogFights","false"));
  2600. ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(olympiad.getProperty("AltOlyShowMonthlyWinners","true"));
  2601. ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(olympiad.getProperty("AltOlyAnnounceGames","true"));
  2602. String[] split = olympiad.getProperty("AltOlyRestrictedItems","6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,9388,9389,9390,17049,17050,17051,17052,17053,17054,17055,17056,17057,17058,17059,17060,17061,20759,20775,20776,20777,20778,14774").split(",");
  2603. LIST_OLY_RESTRICTED_ITEMS = new TIntArrayList(split.length);
  2604. for (String id : split)
  2605. {
  2606. LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
  2607. }
  2608. ALT_OLY_ENCHANT_LIMIT = Integer.parseInt(olympiad.getProperty("AltOlyEnchantLimit","-1"));
  2609. ALT_OLY_WAIT_TIME = Integer.parseInt(olympiad.getProperty("AltOlyWaitTime","120"));
  2610. }
  2611. catch (Exception e)
  2612. {
  2613. e.printStackTrace();
  2614. throw new Error("Failed to Load "+OLYMPIAD_CONFIG_FILE+" File.");
  2615. }
  2616. try
  2617. {
  2618. L2Properties Settings = new L2Properties();
  2619. is = new FileInputStream(HEXID_FILE);
  2620. Settings.load(is);
  2621. SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
  2622. HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
  2623. }
  2624. catch (Exception e)
  2625. {
  2626. _log.warning("Could not load HexID file ("+HEXID_FILE+"). Hopefully login will give us one.");
  2627. }
  2628. // Grandboss
  2629. try
  2630. {
  2631. L2Properties grandbossSettings = new L2Properties();
  2632. is = new FileInputStream(new File(GRANDBOSS_CONFIG_FILE));
  2633. grandbossSettings.load(is);
  2634. Antharas_Wait_Time = Integer.parseInt(grandbossSettings.getProperty("AntharasWaitTime", "30"));
  2635. if (Antharas_Wait_Time < 3 || Antharas_Wait_Time > 60)
  2636. Antharas_Wait_Time = 30;
  2637. Antharas_Wait_Time = Antharas_Wait_Time * 60000;
  2638. Valakas_Wait_Time = Integer.parseInt(grandbossSettings.getProperty("ValakasWaitTime", "30"));
  2639. if (Valakas_Wait_Time < 3 || Valakas_Wait_Time > 60)
  2640. Valakas_Wait_Time = 30;
  2641. Valakas_Wait_Time = Valakas_Wait_Time * 60000;
  2642. Interval_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfAntharasSpawn", "264"));
  2643. if (Interval_Of_Antharas_Spawn < 1 || Interval_Of_Antharas_Spawn > 480)
  2644. Interval_Of_Antharas_Spawn = 192;
  2645. Interval_Of_Antharas_Spawn = Interval_Of_Antharas_Spawn * 3600000;
  2646. Random_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfAntharasSpawn", "72"));
  2647. if (Random_Of_Antharas_Spawn < 1 || Random_Of_Antharas_Spawn > 192)
  2648. Random_Of_Antharas_Spawn = 145;
  2649. Random_Of_Antharas_Spawn = Random_Of_Antharas_Spawn * 3600000;
  2650. Interval_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfValakasSpawn", "264"));
  2651. if (Interval_Of_Valakas_Spawn < 1 || Interval_Of_Valakas_Spawn > 480)
  2652. Interval_Of_Valakas_Spawn = 192;
  2653. Interval_Of_Valakas_Spawn = Interval_Of_Valakas_Spawn * 3600000;
  2654. Random_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfValakasSpawn", "72"));
  2655. if (Random_Of_Valakas_Spawn < 1 || Random_Of_Valakas_Spawn > 192)
  2656. Random_Of_Valakas_Spawn = 145;
  2657. Random_Of_Valakas_Spawn = Random_Of_Valakas_Spawn * 3600000;
  2658. Interval_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfBaiumSpawn", "168"));
  2659. if (Interval_Of_Baium_Spawn < 1 || Interval_Of_Baium_Spawn > 480)
  2660. Interval_Of_Baium_Spawn = 121;
  2661. Interval_Of_Baium_Spawn = Interval_Of_Baium_Spawn * 3600000;
  2662. Random_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfBaiumSpawn", "48"));
  2663. if (Random_Of_Baium_Spawn < 1 || Random_Of_Baium_Spawn > 192)
  2664. Random_Of_Baium_Spawn = 8;
  2665. Random_Of_Baium_Spawn = Random_Of_Baium_Spawn * 3600000;
  2666. Interval_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfCoreSpawn", "60"));
  2667. if (Interval_Of_Core_Spawn < 1 || Interval_Of_Core_Spawn > 480)
  2668. Interval_Of_Core_Spawn = 27;
  2669. Interval_Of_Core_Spawn = Interval_Of_Core_Spawn * 3600000;
  2670. Random_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfCoreSpawn", "24"));
  2671. if (Random_Of_Core_Spawn < 1 || Random_Of_Core_Spawn > 192)
  2672. Random_Of_Core_Spawn = 47;
  2673. Random_Of_Core_Spawn = Random_Of_Core_Spawn * 3600000;
  2674. Interval_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfOrfenSpawn", "48"));
  2675. if (Interval_Of_Orfen_Spawn < 1 || Interval_Of_Orfen_Spawn > 480)
  2676. Interval_Of_Orfen_Spawn = 28;
  2677. Interval_Of_Orfen_Spawn = Interval_Of_Orfen_Spawn * 3600000;
  2678. Random_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfOrfenSpawn", "20"));
  2679. if (Random_Of_Orfen_Spawn < 1 || Random_Of_Orfen_Spawn > 192)
  2680. Random_Of_Orfen_Spawn = 41;
  2681. Random_Of_Orfen_Spawn = Random_Of_Orfen_Spawn * 3600000;
  2682. Interval_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfQueenAntSpawn", "36"));
  2683. if (Interval_Of_QueenAnt_Spawn < 1 || Interval_Of_QueenAnt_Spawn > 480)
  2684. Interval_Of_QueenAnt_Spawn = 19;
  2685. Interval_Of_QueenAnt_Spawn = Interval_Of_QueenAnt_Spawn * 3600000;
  2686. Random_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfQueenAntSpawn", "17"));
  2687. if (Random_Of_QueenAnt_Spawn < 1 || Random_Of_QueenAnt_Spawn > 192)
  2688. Random_Of_QueenAnt_Spawn = 35;
  2689. Random_Of_QueenAnt_Spawn = Random_Of_QueenAnt_Spawn * 3600000;
  2690. Interval_Of_Zaken_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfZakenSpawn", "19"));
  2691. if (Interval_Of_Zaken_Spawn < 1 || Interval_Of_Zaken_Spawn > 480)
  2692. Interval_Of_Zaken_Spawn = 19;
  2693. Interval_Of_Zaken_Spawn = Interval_Of_Zaken_Spawn * 3600000;
  2694. Random_Of_Zaken_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfZakenSpawn", "35"));
  2695. if (Random_Of_Zaken_Spawn < 1 || Random_Of_Zaken_Spawn > 192)
  2696. Random_Of_Zaken_Spawn = 35;
  2697. Random_Of_Zaken_Spawn = Random_Of_Zaken_Spawn * 3600000;
  2698. Interval_Of_Frintezza_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfFrintezzaSpawn", "48"));
  2699. if (Interval_Of_Frintezza_Spawn < 1 || Interval_Of_Frintezza_Spawn > 480)
  2700. Interval_Of_Frintezza_Spawn = 121;
  2701. Interval_Of_Frintezza_Spawn = Interval_Of_Frintezza_Spawn * 3600000;
  2702. Random_Of_Frintezza_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfFrintezzaSpawn", "8"));
  2703. if (Random_Of_Frintezza_Spawn < 1 || Random_Of_Frintezza_Spawn > 192)
  2704. Random_Of_Frintezza_Spawn = 8;
  2705. Random_Of_Frintezza_Spawn = Random_Of_Frintezza_Spawn * 3600000;
  2706. INTERVAL_OF_BELETH_SPAWN = Integer.parseInt(grandbossSettings.getProperty("IntervalOfBelethSpawn", "192"));
  2707. if (INTERVAL_OF_BELETH_SPAWN < 1 || INTERVAL_OF_BELETH_SPAWN > 480)
  2708. INTERVAL_OF_BELETH_SPAWN = 192;
  2709. INTERVAL_OF_BELETH_SPAWN *= 3600000;
  2710. RANDOM_OF_BELETH_SPAWN = Integer.parseInt(grandbossSettings.getProperty("RandomOfBelethSpawn", "148"));
  2711. if (RANDOM_OF_BELETH_SPAWN < 1 || RANDOM_OF_BELETH_SPAWN > 192)
  2712. RANDOM_OF_BELETH_SPAWN = 148;
  2713. RANDOM_OF_BELETH_SPAWN *= 3600000;
  2714. BELETH_MIN_PLAYERS = Integer.parseInt(grandbossSettings.getProperty("BelethMinPlayers", "36"));
  2715. }
  2716. catch (Exception e)
  2717. {
  2718. e.printStackTrace();
  2719. throw new Error("Failed to Load " + GRANDBOSS_CONFIG_FILE + " File.");
  2720. }
  2721. // Gracia Seeds
  2722. try
  2723. {
  2724. L2Properties graciaseedsSettings = new L2Properties();
  2725. is = new FileInputStream(new File(GRACIASEEDS_CONFIG_FILE));
  2726. graciaseedsSettings.load(is);
  2727. // Seed of Destruction
  2728. SOD_TIAT_KILL_COUNT = Integer.parseInt(graciaseedsSettings.getProperty("TiatKillCountForNextState", "10"));
  2729. SOD_STAGE_2_LENGTH = Long.parseLong(graciaseedsSettings.getProperty("Stage2Length", "720")) * 60000;
  2730. }
  2731. catch (Exception e)
  2732. {
  2733. e.printStackTrace();
  2734. throw new Error("Failed to Load " + GRACIASEEDS_CONFIG_FILE + " File.");
  2735. }
  2736. try
  2737. {
  2738. FILTER_LIST = new ArrayList<String>();
  2739. LineNumberReader lnr = new LineNumberReader(new BufferedReader(new FileReader(new File(CHAT_FILTER_FILE))));
  2740. String line = null;
  2741. while ((line = lnr.readLine()) != null)
  2742. {
  2743. if (line.trim().isEmpty() || line.startsWith("#"))
  2744. continue;
  2745. FILTER_LIST.add(line.trim());
  2746. }
  2747. _log.info("Loaded " + FILTER_LIST.size() + " Filter Words.");
  2748. }
  2749. catch (Exception e)
  2750. {
  2751. e.printStackTrace();
  2752. throw new Error("Failed to Load " + CHAT_FILTER_FILE + " File.");
  2753. }
  2754. // Security
  2755. try
  2756. {
  2757. L2Properties securitySettings = new L2Properties();
  2758. is = new FileInputStream(new File(SECURITY_CONFIG_FILE));
  2759. securitySettings.load(is);
  2760. // Second Auth Settings
  2761. SECOND_AUTH_ENABLED = Boolean.parseBoolean(securitySettings.getProperty("SecondAuthEnabled", "false"));
  2762. SECOND_AUTH_MAX_ATTEMPTS = Integer.parseInt(securitySettings.getProperty("SecondAuthMaxAttempts", "5"));
  2763. SECOND_AUTH_BAN_TIME = Integer.parseInt(securitySettings.getProperty("SecondAuthBanTime", "480"));
  2764. SECOND_AUTH_REC_LINK = securitySettings.getProperty("SecondAuthRecoveryLink", "5");
  2765. }
  2766. catch (Exception e)
  2767. {
  2768. e.printStackTrace();
  2769. throw new Error("Failed to Load " + SECURITY_CONFIG_FILE + " File.");
  2770. }
  2771. try
  2772. {
  2773. L2Properties chSiege = new L2Properties();
  2774. is = new FileInputStream(new File(CH_SIEGE_FILE));
  2775. chSiege.load(is);
  2776. CHS_MAX_ATTACKERS = Integer.parseInt(chSiege.getProperty("MaxAttackers", "500"));
  2777. CHS_CLAN_MINLEVEL = Integer.parseInt(chSiege.getProperty("MinClanLevel", "4"));
  2778. CHS_MAX_FLAGS_PER_CLAN = Integer.parseInt(chSiege.getProperty("MaxFlagsPerClan", "1"));
  2779. CHS_ENABLE_FAME = Boolean.parseBoolean(chSiege.getProperty("EnableFame", "false"));
  2780. CHS_FAME_AMOUNT = Integer.parseInt(chSiege.getProperty("FameAmount", "0"));
  2781. CHS_FAME_FREQUENCY = Integer.parseInt(chSiege.getProperty("FameFrequency", "0"));
  2782. }
  2783. catch(Exception e)
  2784. {
  2785. e.printStackTrace();
  2786. }
  2787. }
  2788. finally
  2789. {
  2790. try
  2791. {
  2792. is.close();
  2793. }
  2794. catch (Exception e)
  2795. {}
  2796. }
  2797. }
  2798. else if(Server.serverMode == Server.MODE_LOGINSERVER)
  2799. {
  2800. _log.info("loading login config");
  2801. InputStream is = null;
  2802. try
  2803. {
  2804. try
  2805. {
  2806. L2Properties serverSettings = new L2Properties();
  2807. is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
  2808. serverSettings.load(is);
  2809. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");
  2810. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));
  2811. LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
  2812. PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
  2813. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  2814. DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
  2815. ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
  2816. LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
  2817. LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
  2818. LOG_LOGIN_CONTROLLER = Boolean.parseBoolean(serverSettings.getProperty("LogLoginController", "true"));
  2819. LOGIN_SERVER_SCHEDULE_RESTART = Boolean.parseBoolean(serverSettings.getProperty("LoginRestartSchedule", "False"));
  2820. LOGIN_SERVER_SCHEDULE_RESTART_TIME = Long.parseLong(serverSettings.getProperty("LoginRestartTime", "24"));
  2821. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  2822. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jls");
  2823. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  2824. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  2825. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  2826. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  2827. SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
  2828. AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));
  2829. FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
  2830. FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
  2831. NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
  2832. FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
  2833. MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
  2834. }
  2835. catch (Exception e)
  2836. {
  2837. e.printStackTrace();
  2838. throw new Error("Failed to Load " + LOGIN_CONFIGURATION_FILE + " File.");
  2839. }
  2840. // MMO
  2841. try
  2842. {
  2843. _log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  2844. L2Properties mmoSettings = new L2Properties();
  2845. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  2846. mmoSettings.load(is);
  2847. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  2848. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  2849. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  2850. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  2851. }
  2852. catch (Exception e)
  2853. {
  2854. e.printStackTrace();
  2855. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  2856. }
  2857. // Load Telnet L2Properties file (if exists)
  2858. try
  2859. {
  2860. L2Properties telnetSettings = new L2Properties();
  2861. is = new FileInputStream(new File(TELNET_FILE));
  2862. telnetSettings.load(is);
  2863. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  2864. }
  2865. catch (Exception e)
  2866. {
  2867. e.printStackTrace();
  2868. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  2869. }
  2870. // Email
  2871. try
  2872. {
  2873. L2Properties emailSettings = new L2Properties();
  2874. is = new FileInputStream(new File(EMAIL_CONFIG_FILE));
  2875. emailSettings.load(is);
  2876. EMAIL_SERVERINFO_NAME = emailSettings.getProperty("ServerInfoName", "Unconfigured L2J Server");
  2877. EMAIL_SERVERINFO_ADDRESS = emailSettings.getProperty("ServerInfoAddress", "info@myl2jserver.com");
  2878. EMAIL_SYS_ENABLED = Boolean.parseBoolean(emailSettings.getProperty("EmailSystemEnabled", "false"));
  2879. EMAIL_SYS_HOST = emailSettings.getProperty("SmtpServerHost", "smtp.gmail.com");
  2880. EMAIL_SYS_PORT = Integer.parseInt(emailSettings.getProperty("SmtpServerPort", "465"));
  2881. EMAIL_SYS_SMTP_AUTH = Boolean.parseBoolean(emailSettings.getProperty("SmtpAuthRequired", "true"));
  2882. EMAIL_SYS_FACTORY = emailSettings.getProperty("SmtpFactory", "javax.net.ssl.SSLSocketFactory");
  2883. EMAIL_SYS_FACTORY_CALLBACK = Boolean.parseBoolean(emailSettings.getProperty("SmtpFactoryCallback", "false"));
  2884. EMAIL_SYS_USERNAME = emailSettings.getProperty("SmtpUsername", "user@gmail.com");
  2885. EMAIL_SYS_PASSWORD = emailSettings.getProperty("SmtpPassword", "password");
  2886. EMAIL_SYS_ADDRESS = emailSettings.getProperty("EmailSystemAddress", "noreply@myl2jserver.com");
  2887. EMAIL_SYS_SELECTQUERY = emailSettings.getProperty("EmailDBSelectQuery", "SELECT value FROM account_data WHERE account_name=? AND var='email_addr'");
  2888. EMAIL_SYS_DBFIELD = emailSettings.getProperty("EmailDBField", "value");
  2889. }
  2890. catch (Exception e)
  2891. {
  2892. e.printStackTrace();
  2893. throw new Error("Failed to Load " + EMAIL_CONFIG_FILE + " File.");
  2894. }
  2895. }
  2896. finally
  2897. {
  2898. try
  2899. {
  2900. is.close();
  2901. }
  2902. catch(Exception e) { }
  2903. }
  2904. }
  2905. else
  2906. {
  2907. _log.severe("Could not Load Config: server mode was not set");
  2908. }
  2909. }
  2910. /**
  2911. * Set a new value to a game parameter from the admin console.
  2912. * @param pName (String) : name of the parameter to change
  2913. * @param pValue (String) : new value of the parameter
  2914. * @return boolean : true if modification has been made
  2915. */
  2916. public static boolean setParameterValue(String pName, String pValue)
  2917. {
  2918. // rates.properties
  2919. if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
  2920. else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
  2921. else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
  2922. else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
  2923. else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
  2924. else if (pName.equalsIgnoreCase("RateExtractFish")) RATE_EXTR_FISH = Float.parseFloat(pValue);
  2925. else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
  2926. else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ITEMS_ID.put(57, Float.parseFloat(pValue));
  2927. else if (pName.equalsIgnoreCase("RateRaidDropItems")) RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(pValue);
  2928. else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
  2929. else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
  2930. else if (pName.equalsIgnoreCase("RateQuestDrop")) RATE_QUEST_DROP = Float.parseFloat(pValue);
  2931. else if (pName.equalsIgnoreCase("RateQuestReward")) RATE_QUEST_REWARD = Float.parseFloat(pValue);
  2932. else if (pName.equalsIgnoreCase("RateQuestRewardXP")) RATE_QUEST_REWARD_XP = Float.parseFloat(pValue);
  2933. else if (pName.equalsIgnoreCase("RateQuestRewardSP")) RATE_QUEST_REWARD_SP = Float.parseFloat(pValue);
  2934. else if (pName.equalsIgnoreCase("RateQuestRewardAdena")) RATE_QUEST_REWARD_ADENA = Float.parseFloat(pValue);
  2935. else if (pName.equalsIgnoreCase("UseQuestRewardMultipliers")) RATE_QUEST_REWARD_USE_MULTIPLIERS = Boolean.parseBoolean(pValue);
  2936. else if (pName.equalsIgnoreCase("RateQuestRewardPotion")) RATE_QUEST_REWARD_POTION = Float.parseFloat(pValue);
  2937. else if (pName.equalsIgnoreCase("RateQuestRewardScroll")) RATE_QUEST_REWARD_SCROLL = Float.parseFloat(pValue);
  2938. else if (pName.equalsIgnoreCase("RateQuestRewardRecipe")) RATE_QUEST_REWARD_RECIPE = Float.parseFloat(pValue);
  2939. else if (pName.equalsIgnoreCase("RateQuestRewardMaterial")) RATE_QUEST_REWARD_MATERIAL = Float.parseFloat(pValue);
  2940. else if (pName.equalsIgnoreCase("RateHellboundTrustIncrease")) RATE_HB_TRUST_INCREASE = Float.parseFloat(pValue);
  2941. else if (pName.equalsIgnoreCase("RateHellboundTrustDecrease")) RATE_HB_TRUST_DECREASE = Float.parseFloat(pValue);
  2942. else if (pName.equalsIgnoreCase("RateVitalityLevel1")) RATE_VITALITY_LEVEL_1 = Float.parseFloat(pValue);
  2943. else if (pName.equalsIgnoreCase("RateVitalityLevel2")) RATE_VITALITY_LEVEL_2 = Float.parseFloat(pValue);
  2944. else if (pName.equalsIgnoreCase("RateVitalityLevel3")) RATE_VITALITY_LEVEL_3 = Float.parseFloat(pValue);
  2945. else if (pName.equalsIgnoreCase("RateVitalityLevel4")) RATE_VITALITY_LEVEL_4 = Float.parseFloat(pValue);
  2946. else if (pName.equalsIgnoreCase("RateRecoveryPeaceZone")) RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(pValue);
  2947. else if (pName.equalsIgnoreCase("RateVitalityLost")) RATE_VITALITY_LOST = Float.parseFloat(pValue);
  2948. else if (pName.equalsIgnoreCase("RateVitalityGain")) RATE_VITALITY_GAIN = Float.parseFloat(pValue);
  2949. else if (pName.equalsIgnoreCase("RateRecoveryOnReconnect")) RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(pValue);
  2950. else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
  2951. else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
  2952. else if (pName.equalsIgnoreCase("RateCommonHerbs")) RATE_DROP_COMMON_HERBS = Float.parseFloat(pValue);
  2953. else if (pName.equalsIgnoreCase("RateHpHerbs")) RATE_DROP_HP_HERBS = Float.parseFloat(pValue);
  2954. else if (pName.equalsIgnoreCase("RateMpHerbs")) RATE_DROP_MP_HERBS = Float.parseFloat(pValue);
  2955. else if (pName.equalsIgnoreCase("RateSpecialHerbs")) RATE_DROP_SPECIAL_HERBS = Float.parseFloat(pValue);
  2956. else if (pName.equalsIgnoreCase("RateVitalityHerbs")) RATE_DROP_VITALITY_HERBS = Float.parseFloat(pValue);
  2957. else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
  2958. else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
  2959. else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2960. else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2961. else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2962. else if (pName.equalsIgnoreCase("PetXpRate")) PET_XP_RATE = Float.parseFloat(pValue);
  2963. else if (pName.equalsIgnoreCase("PetFoodRate")) PET_FOOD_RATE = Integer.parseInt(pValue);
  2964. else if (pName.equalsIgnoreCase("SinEaterXpRate")) SINEATER_XP_RATE = Float.parseFloat(pValue);
  2965. else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
  2966. else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
  2967. else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2968. else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2969. else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2970. // general.properties
  2971. else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
  2972. else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2973. else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2974. else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.parseBoolean(pValue);
  2975. else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(pValue);
  2976. else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
  2977. else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(pValue);
  2978. else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
  2979. else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
  2980. else if (pName.equalsIgnoreCase("LowWeight")) LOW_WEIGHT = Float.parseFloat(pValue);
  2981. else if (pName.equalsIgnoreCase("MediumWeight")) MEDIUM_WEIGHT = Float.parseFloat(pValue);
  2982. else if (pName.equalsIgnoreCase("HighWeight")) HIGH_WEIGHT = Float.parseFloat(pValue);
  2983. else if (pName.equalsIgnoreCase("AdvancedDiagonalStrategy")) ADVANCED_DIAGONAL_STRATEGY= Boolean.parseBoolean(pValue);
  2984. else if (pName.equalsIgnoreCase("DiagonalWeight")) DIAGONAL_WEIGHT = Float.parseFloat(pValue);
  2985. else if (pName.equalsIgnoreCase("MaxPostfilterPasses")) MAX_POSTFILTER_PASSES = Integer.parseInt(pValue);
  2986. else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
  2987. else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
  2988. else if (pName.equalsIgnoreCase("ClientPacketQueueSize"))
  2989. {
  2990. CLIENT_PACKET_QUEUE_SIZE = Integer.parseInt(pValue);
  2991. if (CLIENT_PACKET_QUEUE_SIZE == 0)
  2992. CLIENT_PACKET_QUEUE_SIZE = MMO_MAX_READ_PER_PASS + 1;
  2993. }
  2994. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxBurstSize"))
  2995. {
  2996. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = Integer.parseInt(pValue);
  2997. if (CLIENT_PACKET_QUEUE_MAX_BURST_SIZE == 0)
  2998. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = MMO_MAX_READ_PER_PASS;
  2999. }
  3000. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxPacketsPerSecond")) CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND = Integer.parseInt(pValue);
  3001. else if (pName.equalsIgnoreCase("ClientPacketQueueMeasureInterval")) CLIENT_PACKET_QUEUE_MEASURE_INTERVAL = Integer.parseInt(pValue);
  3002. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxAveragePacketsPerSecond")) CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND = Integer.parseInt(pValue);
  3003. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxFloodsPerMin")) CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN = Integer.parseInt(pValue);
  3004. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxOverflowsPerMin")) CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN = Integer.parseInt(pValue);
  3005. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxUnderflowsPerMin")) CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = Integer.parseInt(pValue);
  3006. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxUnknownPerMin")) CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = Integer.parseInt(pValue);
  3007. else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
  3008. else if (pName.equalsIgnoreCase("AllowRefund")) ALLOW_REFUND = Boolean.parseBoolean(pValue);
  3009. else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.parseBoolean(pValue);
  3010. else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.parseBoolean(pValue);
  3011. else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
  3012. else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
  3013. else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.parseBoolean(pValue);
  3014. else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.parseBoolean(pValue);
  3015. else if (pName.equalsIgnoreCase("BoatBroadcastRadius")) BOAT_BROADCAST_RADIUS = Integer.parseInt(pValue);
  3016. else if (pName.equalsIgnoreCase("AllowCursedWeapons")) ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(pValue);
  3017. else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.parseBoolean(pValue);
  3018. else if (pName.equalsIgnoreCase("AllowNpcWalkers")) ALLOW_NPC_WALKERS = Boolean.parseBoolean(pValue);
  3019. else if (pName.equalsIgnoreCase("AllowPetWalkers")) ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
  3020. else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.parseBoolean(pValue);
  3021. else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = Integer.parseInt(pValue);
  3022. else if (pName.equalsIgnoreCase("BBSShowPlayerList")) BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
  3023. else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
  3024. else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  3025. else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  3026. else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
  3027. else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
  3028. else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.parseBoolean(pValue);
  3029. else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.parseBoolean(pValue);
  3030. else if (pName.equalsIgnoreCase("ShowCrestWithoutQuest")) SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(pValue);
  3031. else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);
  3032. else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(pValue);
  3033. else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
  3034. else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);
  3035. else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.parseBoolean(pValue);
  3036. else if (pName.equalsIgnoreCase("MaxDriftRange")) MAX_DRIFT_RANGE = Integer.parseInt(pValue);
  3037. else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.parseBoolean(pValue);
  3038. else if (pName.equalsIgnoreCase("UseDeepBlueDropRulesRaid")) DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(pValue);
  3039. else if (pName.equalsIgnoreCase("GuardAttackAggroMob")) GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(pValue);
  3040. else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.parseBoolean(pValue);
  3041. else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
  3042. else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
  3043. else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
  3044. else if (pName.equalsIgnoreCase("MaximumSlotsForQuestItems")) INVENTORY_MAXIMUM_QUEST_ITEMS = Integer.parseInt(pValue);
  3045. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
  3046. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
  3047. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
  3048. else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
  3049. else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
  3050. else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
  3051. else if (pName.equalsIgnoreCase("EnchantChanceElementStone")) ENCHANT_CHANCE_ELEMENT_STONE = Integer.parseInt(pValue);
  3052. else if (pName.equalsIgnoreCase("EnchantChanceElementCrystal")) ENCHANT_CHANCE_ELEMENT_CRYSTAL = Integer.parseInt(pValue);
  3053. else if (pName.equalsIgnoreCase("EnchantChanceElementJewel")) ENCHANT_CHANCE_ELEMENT_JEWEL = Integer.parseInt(pValue);
  3054. else if (pName.equalsIgnoreCase("EnchantChanceElementEnergy")) ENCHANT_CHANCE_ELEMENT_ENERGY = Integer.parseInt(pValue);
  3055. else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
  3056. else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
  3057. else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
  3058. else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
  3059. else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
  3060. else if (pName.equalsIgnoreCase("AugmentationNGSkillChance")) AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(pValue);
  3061. else if (pName.equalsIgnoreCase("AugmentationNGGlowChance")) AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(pValue);
  3062. else if (pName.equalsIgnoreCase("AugmentationMidSkillChance")) AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(pValue);
  3063. else if (pName.equalsIgnoreCase("AugmentationMidGlowChance")) AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(pValue);
  3064. else if (pName.equalsIgnoreCase("AugmentationHighSkillChance")) AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(pValue);
  3065. else if (pName.equalsIgnoreCase("AugmentationHighGlowChance")) AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(pValue);
  3066. else if (pName.equalsIgnoreCase("AugmentationTopSkillChance")) AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(pValue);
  3067. else if (pName.equalsIgnoreCase("AugmentationTopGlowChance")) AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(pValue);
  3068. else if (pName.equalsIgnoreCase("AugmentationBaseStatChance")) AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(pValue);
  3069. else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3070. else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3071. else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3072. else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3073. else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3074. else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier")) RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  3075. else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier")) RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  3076. else if (pName.equalsIgnoreCase("RaidPAttackMultiplier")) RAID_PATTACK_MULTIPLIER = Double.parseDouble(pValue) /100;
  3077. else if (pName.equalsIgnoreCase("RaidMAttackMultiplier")) RAID_MATTACK_MULTIPLIER = Double.parseDouble(pValue) /100;
  3078. else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
  3079. else if (pName.equalsIgnoreCase("RaidChaosTime")) RAID_CHAOS_TIME =Integer.parseInt(pValue);
  3080. else if (pName.equalsIgnoreCase("GrandChaosTime")) GRAND_CHAOS_TIME =Integer.parseInt(pValue);
  3081. else if (pName.equalsIgnoreCase("MinionChaosTime")) MINION_CHAOS_TIME =Integer.parseInt(pValue);
  3082. else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Long.parseLong(pValue);
  3083. else if (pName.equalsIgnoreCase("StartingLevel")) STARTING_LEVEL = Byte.parseByte(pValue);
  3084. else if (pName.equalsIgnoreCase("StartingSP")) STARTING_SP = Integer.parseInt(pValue);
  3085. else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
  3086. else if (pName.equalsIgnoreCase("TeleportWatchdogTimeout")) TELEPORT_WATCHDOG_TIMEOUT = Integer.parseInt(pValue);
  3087. else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
  3088. else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
  3089. else if (pName.equalsIgnoreCase("RestorePlayerInstance")) RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(pValue);
  3090. else if (pName.equalsIgnoreCase("AllowSummonToInstance")) ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(pValue);
  3091. else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
  3092. else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
  3093. else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
  3094. else if (pName.equalsIgnoreCase("RespawnRestoreCP")) RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
  3095. else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
  3096. else if (pName.equalsIgnoreCase("RespawnRestoreMP")) RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
  3097. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsDwarf")) MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(pValue);
  3098. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsOther")) MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(pValue);
  3099. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsDwarf")) MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(pValue);
  3100. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsOther")) MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(pValue);
  3101. else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  3102. else if (pName.equalsIgnoreCase("SubclassStoreSkillCooltime")) SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  3103. else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(pValue);
  3104. else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.parseBoolean(pValue);
  3105. else if (pName.equalsIgnoreCase("EnableFallingDamage")) ENABLE_FALLING_DAMAGE = Boolean.parseBoolean(pValue);
  3106. else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.parseBoolean(pValue);
  3107. else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
  3108. else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
  3109. else if (pName.equalsIgnoreCase("AltGameCreationRareXpSpRate")) ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(pValue);
  3110. else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
  3111. else if (pName.equalsIgnoreCase("AltWeightLimit")) ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
  3112. else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes")) ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(pValue);
  3113. else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(pValue);
  3114. else if (pName.equalsIgnoreCase("RemoveCastleCirclets")) REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
  3115. else if (pName.equalsIgnoreCase("ReputationScorePerKill")) REPUTATION_SCORE_PER_KILL = Integer.parseInt(pValue);
  3116. else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
  3117. {
  3118. ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
  3119. ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
  3120. }
  3121. else if (pName.equalsIgnoreCase("AltShieldBlocks")) ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(pValue);
  3122. else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
  3123. else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.parseBoolean(pValue);
  3124. else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(pValue);
  3125. else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone")) ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  3126. else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
  3127. else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
  3128. else if (pName.equalsIgnoreCase("AllowClassMasters")) ALLOW_CLASS_MASTERS = Boolean.parseBoolean(pValue);
  3129. else if (pName.equalsIgnoreCase("AllowEntireTree")) ALLOW_ENTIRE_TREE = Boolean.parseBoolean(pValue);
  3130. else if (pName.equalsIgnoreCase("AlternateClassMaster")) ALTERNATE_CLASS_MASTER = Boolean.parseBoolean(pValue);
  3131. else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
  3132. else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
  3133. else if (pName.equalsIgnoreCase("AltLeavePartyLeader")) ALT_LEAVE_PARTY_LEADER = Boolean.parseBoolean(pValue);
  3134. else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.parseBoolean(pValue);
  3135. else if (pName.equalsIgnoreCase("CraftMasterwork")) CRAFT_MASTERWORK = Boolean.parseBoolean(pValue);
  3136. else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
  3137. else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.parseBoolean(pValue);
  3138. else if (pName.equalsIgnoreCase("AutoLootRaids")) AUTO_LOOT_RAIDS = Boolean.parseBoolean(pValue);
  3139. else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);
  3140. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  3141. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(pValue);
  3142. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(pValue);
  3143. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pValue);
  3144. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pValue);
  3145. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pValue);
  3146. else if (pName.equalsIgnoreCase("MaxPersonalFamePoints")) MAX_PERSONAL_FAME_POINTS = Integer.parseInt(pValue);
  3147. else if (pName.equalsIgnoreCase("FortressZoneFameTaskFrequency")) FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  3148. else if (pName.equalsIgnoreCase("FortressZoneFameAquirePoints")) FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  3149. else if (pName.equalsIgnoreCase("CastleZoneFameTaskFrequency")) CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  3150. else if (pName.equalsIgnoreCase("CastleZoneFameAquirePoints")) CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  3151. else if (pName.equalsIgnoreCase("AltCastleForDawn")) ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(pValue);
  3152. else if (pName.equalsIgnoreCase("AltCastleForDusk")) ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(pValue);
  3153. else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(pValue);
  3154. else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(pValue);
  3155. else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
  3156. else if (pName.equalsIgnoreCase("AltSubclassEverywhere")) ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(pValue);
  3157. else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
  3158. else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
  3159. else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
  3160. else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(pValue);
  3161. else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
  3162. else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
  3163. else if (pName.equalsIgnoreCase("ChampionMaxLevel")) L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
  3164. else if (pName.equalsIgnoreCase("ChampionHp")) L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
  3165. else if (pName.equalsIgnoreCase("ChampionHpRegen")) L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
  3166. else if (pName.equalsIgnoreCase("ChampionRewards")) L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
  3167. else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(pValue);
  3168. else if (pName.equalsIgnoreCase("ChampionAtk")) L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
  3169. else if (pName.equalsIgnoreCase("ChampionSpdAtk")) L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
  3170. else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance")) L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  3171. else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance")) L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  3172. else if (pName.equalsIgnoreCase("ChampionRewardItemID")) L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
  3173. else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
  3174. else if (pName.equalsIgnoreCase("ChampionEnableInInstances")) L2JMOD_CHAMPION_ENABLE_IN_INSTANCES = Boolean.parseBoolean(pValue);
  3175. else if (pName.equalsIgnoreCase("AllowWedding")) L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(pValue);
  3176. else if (pName.equalsIgnoreCase("WeddingPrice")) L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
  3177. else if (pName.equalsIgnoreCase("WeddingPunishInfidelity")) L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
  3178. else if (pName.equalsIgnoreCase("WeddingTeleport")) L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
  3179. else if (pName.equalsIgnoreCase("WeddingTeleportPrice")) L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
  3180. else if (pName.equalsIgnoreCase("WeddingTeleportDuration")) L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
  3181. else if (pName.equalsIgnoreCase("WeddingAllowSameSex")) L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
  3182. else if (pName.equalsIgnoreCase("WeddingFormalWear")) L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
  3183. else if (pName.equalsIgnoreCase("WeddingDivorceCosts")) L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
  3184. else if (pName.equalsIgnoreCase("TvTEventEnabled")) TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  3185. else if (pName.equalsIgnoreCase("TvTEventInterval")) TVT_EVENT_INTERVAL = pValue.split(",");
  3186. else if (pName.equalsIgnoreCase("TvTEventParticipationTime")) TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  3187. else if (pName.equalsIgnoreCase("TvTEventRunningTime")) TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  3188. else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId")) TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  3189. else if (pName.equalsIgnoreCase("EnableWarehouseSortingClan")) L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
  3190. else if (pName.equalsIgnoreCase("EnableWarehouseSortingPrivate")) L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
  3191. else if (pName.equalsIgnoreCase("EnableManaPotionSupport")) L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(pValue);
  3192. else if (pName.equalsIgnoreCase("DisplayServerTime")) L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(pValue);
  3193. else if (pName.equalsIgnoreCase("AntiFeedEnable")) L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(pValue);
  3194. else if (pName.equalsIgnoreCase("AntiFeedDualbox")) L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(pValue);
  3195. else if (pName.equalsIgnoreCase("AntiFeedDisconnectedAsDualbox")) L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(pValue);
  3196. else if (pName.equalsIgnoreCase("AntiFeedInterval")) L2JMOD_ANTIFEED_INTERVAL = 1000*Integer.parseInt(pValue);
  3197. else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
  3198. else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
  3199. else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
  3200. else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);
  3201. else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.parseBoolean(pValue);
  3202. else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pValue);
  3203. else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);
  3204. else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
  3205. else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
  3206. else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
  3207. else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
  3208. else if (pName.equalsIgnoreCase("GMAdminMenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
  3209. else
  3210. {
  3211. try
  3212. {
  3213. //TODO: stupid GB configs...
  3214. if (!pName.startsWith("Interval_") && !pName.startsWith("Random_"))
  3215. pName = pName.toUpperCase();
  3216. Field clazField = Config.class.getField(pName);
  3217. int modifiers = clazField.getModifiers();
  3218. // just in case :)
  3219. if (!Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers))
  3220. throw new SecurityException("Cannot modify non public or non static config!");
  3221. if (clazField.getType() == int.class)
  3222. {
  3223. clazField.setInt(clazField, Integer.parseInt(pValue));
  3224. }
  3225. else if (clazField.getType() == short.class)
  3226. {
  3227. clazField.setShort(clazField, Short.parseShort(pValue));
  3228. }
  3229. else if (clazField.getType() == byte.class)
  3230. {
  3231. clazField.setByte(clazField, Byte.parseByte(pValue));
  3232. }
  3233. else if (clazField.getType() == long.class)
  3234. {
  3235. clazField.setLong(clazField, Long.parseLong(pValue));
  3236. }
  3237. else if (clazField.getType() == float.class)
  3238. {
  3239. clazField.setFloat(clazField, Float.parseFloat(pValue));
  3240. }
  3241. else if (clazField.getType() == double.class)
  3242. {
  3243. clazField.setDouble(clazField, Double.parseDouble(pValue));
  3244. }
  3245. else if (clazField.getType() == boolean.class)
  3246. {
  3247. clazField.setBoolean(clazField, Boolean.parseBoolean(pValue));
  3248. }
  3249. else if (clazField.getType() == String.class)
  3250. {
  3251. clazField.set(clazField, pValue);
  3252. }
  3253. else
  3254. return false;
  3255. }
  3256. catch (NoSuchFieldException e)
  3257. {
  3258. return false;
  3259. }
  3260. catch (Exception e)
  3261. {
  3262. _log.log(Level.WARNING, "", e);
  3263. return false;
  3264. }
  3265. }
  3266. return true;
  3267. }
  3268. private Config() { }
  3269. /**
  3270. * Save hexadecimal ID of the server in the L2Properties file.
  3271. * {@link #HEXID_FILE}
  3272. * @param serverId
  3273. * @param string hexadecimal ID of the server to store
  3274. */
  3275. public static void saveHexid(int serverId, String string)
  3276. {
  3277. Config.saveHexid(serverId, string, HEXID_FILE);
  3278. }
  3279. /**
  3280. * Save hexadecimal ID of the server in the L2Properties file.
  3281. * @param serverId
  3282. * @param hexId (String) : hexadecimal ID of the server to store
  3283. * @param fileName (String) : name of the L2Properties file
  3284. */
  3285. public static void saveHexid(int serverId, String hexId, String fileName)
  3286. {
  3287. try
  3288. {
  3289. L2Properties hexSetting = new L2Properties();
  3290. File file = new File(fileName);
  3291. //Create a new empty file only if it doesn't exist
  3292. file.createNewFile();
  3293. OutputStream out = new FileOutputStream(file);
  3294. hexSetting.setProperty("ServerID",String.valueOf(serverId));
  3295. hexSetting.setProperty("HexID",hexId);
  3296. hexSetting.store(out,"the hexID to auth into login");
  3297. out.close();
  3298. }
  3299. catch (Exception e)
  3300. {
  3301. _log.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
  3302. e.printStackTrace();
  3303. }
  3304. }
  3305. /**
  3306. * Loads flood protector configurations.
  3307. * @param properties
  3308. */
  3309. private static void loadFloodProtectorConfigs(final L2Properties properties)
  3310. {
  3311. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4");
  3312. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
  3313. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42");
  3314. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16");
  3315. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100");
  3316. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", "5");
  3317. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20");
  3318. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10");
  3319. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
  3320. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1");
  3321. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", "10");
  3322. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANUFACTURE, "Manufacture", "3");
  3323. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANOR, "Manor", "30");
  3324. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SENDMAIL, "SendMail", "100");
  3325. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_CHARACTER_SELECT, "CharacterSelect", "30");
  3326. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_AUCTION, "ItemAuction", "9");
  3327. }
  3328. /**
  3329. * Loads single flood protector configuration.
  3330. *
  3331. * @param properties
  3332. * L2Properties file reader
  3333. * @param config
  3334. * flood protector configuration instance
  3335. * @param configString
  3336. * flood protector configuration string that determines for which flood protector
  3337. * configuration should be read
  3338. * @param defaultInterval
  3339. * default flood protector interval
  3340. */
  3341. private static void loadFloodProtectorConfig(final L2Properties properties, final FloodProtectorConfig config, final String configString, final String defaultInterval)
  3342. {
  3343. config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval));
  3344. config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False"));
  3345. config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0"));
  3346. config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
  3347. config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0"));
  3348. }
  3349. public static int getServerTypeId(String[] serverTypes)
  3350. {
  3351. int tType = 0;
  3352. for (String cType : serverTypes)
  3353. {
  3354. cType = cType.trim();
  3355. if (cType.equalsIgnoreCase("Normal"))
  3356. tType |= 0x01;
  3357. else if (cType.equalsIgnoreCase("Relax"))
  3358. tType |= 0x02;
  3359. else if (cType.equalsIgnoreCase("Test"))
  3360. tType |= 0x04;
  3361. else if (cType.equalsIgnoreCase("NoLabel"))
  3362. tType |= 0x08;
  3363. else if (cType.equalsIgnoreCase("Restricted"))
  3364. tType |= 0x10;
  3365. else if (cType.equalsIgnoreCase("Event"))
  3366. tType |= 0x20;
  3367. else if (cType.equalsIgnoreCase("Free"))
  3368. tType |= 0x40;
  3369. }
  3370. return tType;
  3371. }
  3372. public static class ClassMasterSettings
  3373. {
  3374. private final TIntObjectHashMap<TIntIntHashMap> _claimItems;
  3375. private final TIntObjectHashMap<TIntIntHashMap> _rewardItems;
  3376. private final TIntObjectHashMap<Boolean> _allowedClassChange;
  3377. public ClassMasterSettings(String _configLine)
  3378. {
  3379. _claimItems = new TIntObjectHashMap<TIntIntHashMap>(3);
  3380. _rewardItems = new TIntObjectHashMap<TIntIntHashMap>(3);
  3381. _allowedClassChange = new TIntObjectHashMap<Boolean>(3);
  3382. if (_configLine != null)
  3383. parseConfigLine(_configLine.trim());
  3384. }
  3385. private void parseConfigLine(String _configLine)
  3386. {
  3387. StringTokenizer st = new StringTokenizer(_configLine, ";");
  3388. while (st.hasMoreTokens())
  3389. {
  3390. // get allowed class change
  3391. int job = Integer.parseInt(st.nextToken());
  3392. _allowedClassChange.put(job, true);
  3393. TIntIntHashMap _items = new TIntIntHashMap();
  3394. // parse items needed for class change
  3395. if (st.hasMoreTokens())
  3396. {
  3397. StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  3398. while (st2.hasMoreTokens())
  3399. {
  3400. StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  3401. int _itemId = Integer.parseInt(st3.nextToken());
  3402. int _quantity = Integer.parseInt(st3.nextToken());
  3403. _items.put(_itemId, _quantity);
  3404. }
  3405. }
  3406. _claimItems.put(job, _items);
  3407. _items = new TIntIntHashMap();
  3408. // parse gifts after class change
  3409. if (st.hasMoreTokens())
  3410. {
  3411. StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  3412. while (st2.hasMoreTokens())
  3413. {
  3414. StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  3415. int _itemId = Integer.parseInt(st3.nextToken());
  3416. int _quantity = Integer.parseInt(st3.nextToken());
  3417. _items.put(_itemId, _quantity);
  3418. }
  3419. }
  3420. _rewardItems.put(job, _items);
  3421. }
  3422. }
  3423. public boolean isAllowed(int job)
  3424. {
  3425. if (_allowedClassChange == null)
  3426. return false;
  3427. if (_allowedClassChange.containsKey(job))
  3428. return _allowedClassChange.get(job);
  3429. return false;
  3430. }
  3431. public TIntIntHashMap getRewardItems(int job)
  3432. {
  3433. if (_rewardItems.containsKey(job))
  3434. return _rewardItems.get(job);
  3435. return null;
  3436. }
  3437. public TIntIntHashMap getRequireItems(int job)
  3438. {
  3439. if (_claimItems.containsKey(job))
  3440. return _claimItems.get(job);
  3441. return null;
  3442. }
  3443. }
  3444. private static TIntFloatHashMap parseConfigLine(String line)
  3445. {
  3446. String[] propertySplit = line.split(",");
  3447. TIntFloatHashMap ret = new TIntFloatHashMap(propertySplit.length);
  3448. int i = 1;
  3449. for (String value : propertySplit)
  3450. ret.put(i++, Float.parseFloat(value));
  3451. return ret;
  3452. }
  3453. /**
  3454. * itemId1,itemNumber1;itemId2,itemNumber2...
  3455. * to the int[n][2] = [itemId1][itemNumber1],[itemId2][itemNumber2]...
  3456. * @param line
  3457. * @return
  3458. */
  3459. private static int[][] parseItemsList(String line)
  3460. {
  3461. final String[] propertySplit = line.split(";");
  3462. if (propertySplit.length == 0)
  3463. return null;
  3464. int i = 0;
  3465. String[] valueSplit;
  3466. final int[][] result = new int[propertySplit.length][];
  3467. for (String value : propertySplit)
  3468. {
  3469. valueSplit = value.split(",");
  3470. if (valueSplit.length != 2)
  3471. {
  3472. _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid entry -> \"", valueSplit[0], "\", should be itemId,itemNumber"));
  3473. return null;
  3474. }
  3475. result[i] = new int[2];
  3476. try
  3477. {
  3478. result[i][0] = Integer.parseInt(valueSplit[0]);
  3479. }
  3480. catch (NumberFormatException e)
  3481. {
  3482. _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid itemId -> \"", valueSplit[0], "\""));
  3483. return null;
  3484. }
  3485. try
  3486. {
  3487. result[i][1] = Integer.parseInt(valueSplit[1]);
  3488. }
  3489. catch (NumberFormatException e)
  3490. {
  3491. _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid item number -> \"", valueSplit[1], "\""));
  3492. return null;
  3493. }
  3494. i++;
  3495. }
  3496. return result;
  3497. }
  3498. }