Config.java 148 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License as published by
  4. * the Free Software Foundation; either version 2, or (at your option)
  5. * any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software
  14. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  15. * 02111-1307, USA.
  16. *
  17. * http://www.gnu.org/copyleft/gpl.html
  18. */
  19. package net.sf.l2j;
  20. import java.io.File;
  21. import java.io.FileInputStream;
  22. import java.io.FileOutputStream;
  23. import java.io.InputStream;
  24. import java.io.OutputStream;
  25. import java.math.BigInteger;
  26. import java.util.List;
  27. import java.util.Properties;
  28. import java.util.logging.Logger;
  29. import javolution.util.FastList;
  30. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  31. /**
  32. * This class contains global server configuration.<br>
  33. * It has static final fields initialized from configuration files.<br>
  34. * It's initialized at the very begin of startup, and later JIT will optimize
  35. * away debug/unused code.
  36. *
  37. * @author mkizub
  38. */
  39. public final class Config
  40. {
  41. protected static final Logger _log = Logger.getLogger(Config.class.getName());
  42. /** Debug/release mode */
  43. public static boolean DEBUG;
  44. /** Enable/disable assertions */
  45. public static boolean ASSERT;
  46. /** Enable/disable code 'in progress' */
  47. public static boolean DEVELOPER;
  48. /** Set if this server is a test server used for development */
  49. public static boolean TEST_SERVER;
  50. /** Game Server ports */
  51. public static int PORT_GAME;
  52. /** Login Server port */
  53. public static int PORT_LOGIN;
  54. /** Login Server bind ip */
  55. public static String LOGIN_BIND_ADDRESS;
  56. /** Number of login tries before IP ban gets activated, default 10*/
  57. public static int LOGIN_TRY_BEFORE_BAN;
  58. /** Number of seconds the IP ban will last, default 10 minutes */
  59. public static int LOGIN_BLOCK_AFTER_BAN;
  60. /** Hostname of the Game Server */
  61. public static String GAMESERVER_HOSTNAME;
  62. // Access to database
  63. /** Driver to access to database */
  64. public static String DATABASE_DRIVER;
  65. /** Path to access to database */
  66. public static String DATABASE_URL;
  67. /** Database login */
  68. public static String DATABASE_LOGIN;
  69. /** Database password */
  70. public static String DATABASE_PASSWORD;
  71. /** Maximum number of connections to the database */
  72. public static int DATABASE_MAX_CONNECTIONS;
  73. /** Maximum number of players allowed to play simultaneously on server */
  74. public static int MAXIMUM_ONLINE_USERS;
  75. // Setting for serverList
  76. /** Displays [] in front of server name ? */
  77. public static boolean SERVER_LIST_BRACKET;
  78. /** Displays a clock next to the server name ? */
  79. public static boolean SERVER_LIST_CLOCK;
  80. /** Display test server in the list of servers ? */
  81. public static boolean SERVER_LIST_TESTSERVER;
  82. /** Set the server as gm only at startup ? */
  83. public static boolean SERVER_GMONLY;
  84. // Thread pools size
  85. /** Thread pool size effect */
  86. public static int THREAD_P_EFFECTS;
  87. /** Thread pool size general */
  88. public static int THREAD_P_GENERAL;
  89. /** Packet max thread */
  90. public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  91. public static int IO_PACKET_THREAD_CORE_SIZE;
  92. /** General max thread */
  93. public static int GENERAL_THREAD_CORE_SIZE;
  94. /** AI max thread */
  95. public static int AI_MAX_THREAD;
  96. /** Accept auto-loot ? */
  97. public static boolean AUTO_LOOT;
  98. public static boolean AUTO_LOOT_HERBS;
  99. /** Character name template */
  100. public static String CNAME_TEMPLATE;
  101. /** Pet name template */
  102. public static String PET_NAME_TEMPLATE;
  103. /** Maximum number of characters per account */
  104. public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
  105. /** Global chat state */
  106. public static String DEFAULT_GLOBAL_CHAT;
  107. /** Trade chat state */
  108. public static String DEFAULT_TRADE_CHAT;
  109. /** For test servers - everybody has admin rights */
  110. public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
  111. /** Alternative game crafting */
  112. public static boolean ALT_GAME_CREATION;
  113. /** Alternative game crafting speed mutiplier - default 0 (fastest but still not instant) */
  114. public static double ALT_GAME_CREATION_SPEED;
  115. /** Alternative game crafting XP rate multiplier - default 1*/
  116. public static double ALT_GAME_CREATION_XP_RATE;
  117. /** Alternative game crafting SP rate multiplier - default 1*/
  118. public static double ALT_GAME_CREATION_SP_RATE;
  119. /** Alternative setting to blacksmith use of recipes to craft - default true*/
  120. public static boolean ALT_BLACKSMITH_USE_RECIPES;
  121. /** Remove Castle circlets after clan lose his castle? - default true*/
  122. public static boolean REMOVE_CASTLE_CIRCLETS;
  123. /** Alternative game weight limit multiplier - default 1*/
  124. public static double ALT_WEIGHT_LIMIT;
  125. /** Alternative game skill learning */
  126. public static boolean ALT_GAME_SKILL_LEARN;
  127. /** Alternative auto skill learning */
  128. public static boolean AUTO_LEARN_SKILLS;
  129. /** Cancel attack bow by hit */
  130. public static boolean ALT_GAME_CANCEL_BOW;
  131. /** Cancel cast by hit */
  132. public static boolean ALT_GAME_CANCEL_CAST;
  133. /** Alternative game - use tiredness, instead of CP */
  134. public static boolean ALT_GAME_TIREDNESS;
  135. public static int ALT_PARTY_RANGE;
  136. public static int ALT_PARTY_RANGE2;
  137. /** Alternative shield defence */
  138. public static boolean ALT_GAME_SHIELD_BLOCKS;
  139. /** Alternative Perfect shield defence rate */
  140. public static int ALT_PERFECT_SHLD_BLOCK;
  141. /** Alternative game mob ATTACK AI */
  142. public static boolean ALT_GAME_MOB_ATTACK_AI;
  143. public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
  144. /** Alternative freight modes - Freights can be withdrawed from any village */
  145. public static boolean ALT_GAME_FREIGHTS;
  146. /** Alternative freight modes - Sets the price value for each freightened item */
  147. public static int ALT_GAME_FREIGHT_PRICE;
  148. /** Fast or slow multiply coefficient for skill hit time */
  149. public static float ALT_GAME_SKILL_HIT_RATE;
  150. /** Alternative gameing - loss of XP on death */
  151. public static boolean ALT_GAME_DELEVEL;
  152. /** Alternative gameing - magic dmg failures */
  153. public static boolean ALT_GAME_MAGICFAILURES;
  154. /** Alternative gaming - player must be in a castle-owning clan or ally to sign up for Dawn. */
  155. public static boolean ALT_GAME_REQUIRE_CASTLE_DAWN;
  156. /** Alternative gaming - allow clan-based castle ownage check rather than ally-based. */
  157. public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
  158. /** Alternative gaming - allow free teleporting around the world. */
  159. public static boolean ALT_GAME_FREE_TELEPORT;
  160. /** Disallow recommend character twice or more a day ? */
  161. public static boolean ALT_RECOMMEND;
  162. /** Alternative gaming - allow sub-class addition without quest completion. */
  163. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  164. /** View npc stats/drop by shift-cliking it for nongm-players */
  165. public static boolean ALT_GAME_VIEWNPC;
  166. /** Minimum number of player to participate in SevenSigns Festival */
  167. public static int ALT_FESTIVAL_MIN_PLAYER;
  168. /** Maximum of player contrib during Festival */
  169. public static int ALT_MAXIMUM_PLAYER_CONTRIB;
  170. /** Festival Manager start time. */
  171. public static long ALT_FESTIVAL_MANAGER_START;
  172. /** Festival Length */
  173. public static long ALT_FESTIVAL_LENGTH;
  174. /** Festival Cycle Length */
  175. public static long ALT_FESTIVAL_CYCLE_LENGTH;
  176. /** Festival First Spawn */
  177. public static long ALT_FESTIVAL_FIRST_SPAWN;
  178. /** Festival First Swarm */
  179. public static long ALT_FESTIVAL_FIRST_SWARM;
  180. /** Festival Second Spawn */
  181. public static long ALT_FESTIVAL_SECOND_SPAWN;
  182. /** Festival Second Swarm */
  183. public static long ALT_FESTIVAL_SECOND_SWARM;
  184. /** Festival Chest Spawn */
  185. public static long ALT_FESTIVAL_CHEST_SPAWN;
  186. /** Number of members needed to request a clan war */
  187. public static int ALT_CLAN_MEMBERS_FOR_WAR;
  188. /** Number of days before joining a new clan */
  189. public static int ALT_CLAN_JOIN_DAYS;
  190. /** Number of days before creating a new clan */
  191. public static int ALT_CLAN_CREATE_DAYS;
  192. /** Number of days it takes to dissolve a clan */
  193. public static int ALT_CLAN_DISSOLVE_DAYS;
  194. /** Number of days before joining a new alliance when clan voluntarily leave an alliance */
  195. public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
  196. /** Number of days before joining a new alliance when clan was dismissed from an alliance */
  197. public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
  198. /** Number of days before accepting a new clan for alliance when clan was dismissed from an alliance */
  199. public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
  200. /** Number of days before creating a new alliance when dissolved an alliance */
  201. public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
  202. /** Alternative gaming - all new characters always are newbies. */
  203. public static boolean ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE;
  204. /** Alternative gaming - clan members with see privilege can also withdraw from clan warehouse. */
  205. public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
  206. /** Maximum number of clans in ally */
  207. public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
  208. /** Life Crystal needed to learn clan skill */
  209. public static boolean LIFE_CRYSTAL_NEEDED;
  210. /** Spell Book needed to learn skill */
  211. public static boolean SP_BOOK_NEEDED;
  212. /** Spell Book needet to enchant skill */
  213. public static boolean ES_SP_BOOK_NEEDED;
  214. /** Logging Chat Window */
  215. public static boolean LOG_CHAT;
  216. /** Logging Item Window */
  217. public static boolean LOG_ITEMS;
  218. /** Alternative privileges for admin */
  219. public static boolean ALT_PRIVILEGES_ADMIN;
  220. /** Alternative secure check privileges */
  221. public static boolean ALT_PRIVILEGES_SECURE_CHECK;
  222. /** Alternative default level for privileges */
  223. public static int ALT_PRIVILEGES_DEFAULT_LEVEL;
  224. /** Olympiad Competition Starting time */
  225. public static int ALT_OLY_START_TIME;
  226. /** Olympiad Minutes */
  227. public static int ALT_OLY_MIN;
  228. /** Olympiad Competition Period */
  229. public static long ALT_OLY_CPERIOD;
  230. /** Olympiad Battle Period */
  231. public static long ALT_OLY_BATTLE;
  232. /** Olympiad Battle Wait */
  233. public static long ALT_OLY_BWAIT;
  234. /** Olympiad Inital Wait */
  235. public static long ALT_OLY_IWAIT;
  236. /** Olympaid Weekly Period */
  237. public static long ALT_OLY_WPERIOD;
  238. /** Olympaid Validation Period */
  239. public static long ALT_OLY_VPERIOD;
  240. /** Manor Refresh Starting time */
  241. public static int ALT_MANOR_REFRESH_TIME;
  242. /** Manor Refresh Min */
  243. public static int ALT_MANOR_REFRESH_MIN;
  244. /** Manor Next Period Approve Starting time */
  245. public static int ALT_MANOR_APPROVE_TIME;
  246. /** Manor Next Period Approve Min */
  247. public static int ALT_MANOR_APPROVE_MIN;
  248. /** Manor Maintenance Time */
  249. public static int ALT_MANOR_MAINTENANCE_PERIOD;
  250. /** Manor Save All Actions */
  251. public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
  252. /** Manor Save Period Rate */
  253. public static int ALT_MANOR_SAVE_PERIOD_RATE;
  254. /** Initial Lottery prize */
  255. public static int ALT_LOTTERY_PRIZE;
  256. /** Lottery Ticket Price */
  257. public static int ALT_LOTTERY_TICKET_PRICE;
  258. /** What part of jackpot amount should receive characters who pick 5 wining numbers */
  259. public static float ALT_LOTTERY_5_NUMBER_RATE;
  260. /** What part of jackpot amount should receive characters who pick 4 wining numbers */
  261. public static float ALT_LOTTERY_4_NUMBER_RATE;
  262. /** What part of jackpot amount should receive characters who pick 3 wining numbers */
  263. public static float ALT_LOTTERY_3_NUMBER_RATE;
  264. /** How much adena receive characters who pick two or less of the winning number */
  265. public static int ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
  266. /** Minimum siz e of a party that may enter dimensional rift */
  267. public static int RIFT_MIN_PARTY_SIZE;
  268. /** Time in ms the party has to wait until the mobs spawn when entering a room */
  269. public static int RIFT_SPAWN_DELAY;
  270. /** Amount of random rift jumps before party is ported back */
  271. public static int RIFT_MAX_JUMPS;
  272. /** Random time between two jumps in dimensional rift - in seconds */
  273. public static int RIFT_AUTO_JUMPS_TIME_MIN;
  274. public static int RIFT_AUTO_JUMPS_TIME_MAX;
  275. /** Dimensional Fragment cost for entering rift */
  276. public static int RIFT_ENTER_COST_RECRUIT;
  277. public static int RIFT_ENTER_COST_SOLDIER;
  278. public static int RIFT_ENTER_COST_OFFICER;
  279. public static int RIFT_ENTER_COST_CAPTAIN;
  280. public static int RIFT_ENTER_COST_COMMANDER;
  281. public static int RIFT_ENTER_COST_HERO;
  282. /** time multiplier for boss room */
  283. public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
  284. /* **************************************************************************
  285. * GM CONFIG General GM AccessLevel *
  286. ************************************************************************* */
  287. /** General GM access level */
  288. public static int GM_ACCESSLEVEL;
  289. /** General GM Minimal AccessLevel */
  290. public static int GM_MIN;
  291. /** Minimum privileges level for a GM to do Alt+G*/
  292. public static int GM_ALTG_MIN_LEVEL;
  293. /** General GM AccessLevel to change announcements */
  294. public static int GM_ANNOUNCE;
  295. /** General GM AccessLevel can /ban /unban */
  296. public static int GM_BAN;
  297. /** General GM AccessLevel can /ban /unban for chat */
  298. public static int GM_BAN_CHAT;
  299. /** General GM AccessLevel can /create_item and /gmshop */
  300. public static int GM_CREATE_ITEM;
  301. /** General GM AccessLevel can /delete */
  302. public static int GM_DELETE;
  303. /** General GM AccessLevel can /kick /disconnect */
  304. public static int GM_KICK;
  305. /** General GM AccessLevel for access to GMMenu */
  306. public static int GM_MENU;
  307. /** General GM AccessLevel to use god mode command */
  308. public static int GM_GODMODE;
  309. /** General GM AccessLevel with character edit rights */
  310. public static int GM_CHAR_EDIT;
  311. /** General GM AccessLevel with edit rights for other characters */
  312. public static int GM_CHAR_EDIT_OTHER;
  313. /** General GM AccessLevel with character view rights */
  314. public static int GM_CHAR_VIEW;
  315. /** General GM AccessLevel with NPC edit rights */
  316. public static int GM_NPC_EDIT;
  317. public static int GM_NPC_VIEW;
  318. /** General GM AccessLevel to teleport to any location */
  319. public static int GM_TELEPORT;
  320. /** General GM AccessLevel to teleport character to any location */
  321. public static int GM_TELEPORT_OTHER;
  322. /** General GM AccessLevel to restart server */
  323. public static int GM_RESTART;
  324. /** General GM AccessLevel for MonsterRace */
  325. public static int GM_MONSTERRACE;
  326. /** General GM AccessLevel to ride Wyvern */
  327. public static int GM_RIDER;
  328. /** General GM AccessLevel to unstuck without 5min delay */
  329. public static int GM_ESCAPE;
  330. /** General GM AccessLevel to resurect fixed after death */
  331. public static int GM_FIXED;
  332. /** General GM AccessLevel to create Path Nodes */
  333. public static int GM_CREATE_NODES;
  334. /** General GM AccessLevel with Enchant rights */
  335. public static int GM_ENCHANT;
  336. /** General GM AccessLevel to close/open Doors */
  337. public static int GM_DOOR;
  338. /** General GM AccessLevel with Resurrection rights */
  339. public static int GM_RES;
  340. /** General GM AccessLevel to attack in the peace zone */
  341. public static int GM_PEACEATTACK;
  342. /** General GM AccessLevel to heal */
  343. public static int GM_HEAL;
  344. /** General GM AccessLevel to unblock IPs detected as hack IPs */
  345. public static int GM_UNBLOCK;
  346. /** General GM AccessLevel to use Cache commands */
  347. public static int GM_CACHE;
  348. /** General GM AccessLevel to use test&st commands */
  349. public static int GM_TALK_BLOCK;
  350. public static int GM_TEST;
  351. /** Disable transaction on AccessLevel **/
  352. public static boolean GM_DISABLE_TRANSACTION;
  353. /** GM transactions disabled from this range */
  354. public static int GM_TRANSACTION_MIN;
  355. /** GM transactions disabled to this range */
  356. public static int GM_TRANSACTION_MAX;
  357. /** Minimum level to allow a GM giving damage */
  358. public static int GM_CAN_GIVE_DAMAGE;
  359. /** Minimum level to don't give Exp/Sp in party */
  360. public static int GM_DONT_TAKE_EXPSP;
  361. /** Minimum level to don't take aggro */
  362. public static int GM_DONT_TAKE_AGGRO;
  363. public static int GM_REPAIR = 75;
  364. /* Rate control */
  365. /** Rate for eXperience Point rewards */
  366. public static float RATE_XP;
  367. /** Rate for Skill Point rewards */
  368. public static float RATE_SP;
  369. /** Rate for party eXperience Point rewards */
  370. public static float RATE_PARTY_XP;
  371. /** Rate for party Skill Point rewards */
  372. public static float RATE_PARTY_SP;
  373. /** Rate for Quest rewards (XP and SP) */
  374. public static float RATE_QUESTS_REWARD;
  375. /** Rate for drop adena */
  376. public static float RATE_DROP_ADENA;
  377. /** Rate for cost of consumable */
  378. public static float RATE_CONSUMABLE_COST;
  379. /** Rate for dropped items */
  380. public static float RATE_DROP_ITEMS;
  381. /** Rate for spoiled items */
  382. public static float RATE_DROP_SPOIL;
  383. /** Rate for manored items */
  384. public static int RATE_DROP_MANOR;
  385. /** Rate for quest items */
  386. public static float RATE_DROP_QUEST;
  387. /** Rate for karma and experience lose */
  388. public static float RATE_KARMA_EXP_LOST;
  389. /** Rate siege guards prices */
  390. public static float RATE_SIEGE_GUARDS_PRICE;
  391. /*Alternative Xp/Sp rewards, if not 0, then calculated as 2^((mob.level-player.level) / coef),
  392. * A few examples for "AltGameExponentXp = 5." and "AltGameExponentSp = 3."
  393. * diff = 0 (player and mob has the same level), XP bonus rate = 1, SP bonus rate = 1
  394. * diff = 3 (mob is 3 levels above), XP bonus rate = 1.52, SP bonus rate = 2
  395. * diff = 5 (mob is 5 levels above), XP bonus rate = 2, SP bonus rate = 3.17
  396. * diff = -8 (mob is 8 levels below), XP bonus rate = 0.4, SP bonus rate = 0.16 */
  397. /** Alternative eXperience Point rewards */
  398. public static float ALT_GAME_EXPONENT_XP;
  399. /** Alternative Spirit Point rewards */
  400. public static float ALT_GAME_EXPONENT_SP;
  401. /** Rate Common herbs */
  402. public static float RATE_DROP_COMMON_HERBS;
  403. /** Rate MP/HP herbs */
  404. public static float RATE_DROP_MP_HP_HERBS;
  405. /** Rate Common herbs */
  406. public static float RATE_DROP_GREATER_HERBS;
  407. /** Rate Common herbs */
  408. public static float RATE_DROP_SUPERIOR_HERBS;
  409. /** Rate Common herbs */
  410. public static float RATE_DROP_SPECIAL_HERBS;
  411. // Player Drop Rate control
  412. /** Limit for player drop */
  413. public static int PLAYER_DROP_LIMIT;
  414. /** Rate for drop */
  415. public static int PLAYER_RATE_DROP;
  416. /** Rate for player's item drop */
  417. public static int PLAYER_RATE_DROP_ITEM;
  418. /** Rate for player's equipment drop */
  419. public static int PLAYER_RATE_DROP_EQUIP;
  420. /** Rate for player's equipment and weapon drop */
  421. public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
  422. // Pet Rates (Multipliers)
  423. /** Rate for experience rewards of the pet */
  424. public static float PET_XP_RATE;
  425. /** Rate for food consumption of the pet */
  426. public static int PET_FOOD_RATE;
  427. /** Rate for experience rewards of the Sin Eater */
  428. public static float SINEATER_XP_RATE;
  429. // Karma Drop Rate control
  430. /** Karma drop limit */
  431. public static int KARMA_DROP_LIMIT;
  432. /** Karma drop rate */
  433. public static int KARMA_RATE_DROP;
  434. /** Karma drop rate for item */
  435. public static int KARMA_RATE_DROP_ITEM;
  436. /** Karma drop rate for equipment */
  437. public static int KARMA_RATE_DROP_EQUIP;
  438. /** Karma drop rate for equipment and weapon */
  439. public static int KARMA_RATE_DROP_EQUIP_WEAPON;
  440. /** Time after which item will auto-destroy */
  441. public static int AUTODESTROY_ITEM_AFTER;
  442. /** Auto destroy herb time */
  443. public static int HERB_AUTO_DESTROY_TIME;
  444. /** List of items that will not be destroyed (seperated by ",") */
  445. public static String PROTECTED_ITEMS;
  446. /** List of items that will not be destroyed */
  447. public static List<Integer> LIST_PROTECTED_ITEMS = new FastList<Integer>();
  448. /** Auto destroy nonequipable items dropped by players */
  449. public static boolean DESTROY_DROPPED_PLAYER_ITEM;
  450. /** Auto destroy equipable items dropped by players */
  451. public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
  452. /** Save items on ground for restoration on server restart */
  453. public static boolean SAVE_DROPPED_ITEM;
  454. /** Empty table ItemsOnGround after load all items */
  455. public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
  456. /** Time interval to save into db items on ground */
  457. public static int SAVE_DROPPED_ITEM_INTERVAL;
  458. /** Clear all items stored in ItemsOnGround table */
  459. public static boolean CLEAR_DROPPED_ITEM_TABLE;
  460. /** Accept precise drop calculation ? */
  461. public static boolean PRECISE_DROP_CALCULATION;
  462. /** Accept multi-items drop ? */
  463. public static boolean MULTIPLE_ITEM_DROP;
  464. /** This is setting of experimental Client <--> Server Player coordinates synchronization<br>
  465. * <b><u>Valeurs :</u></b>
  466. * <li>0 - no synchronization at all</li>
  467. * <li>1 - parcial synchronization Client --> Server only * using this option it is difficult for players
  468. * to bypass obstacles</li>
  469. * <li>2 - parcial synchronization Server --> Client only</li>
  470. * <li>3 - full synchronization Client <--> Server</li>
  471. * <li>-1 - Old system: will synchronize Z only</li>
  472. */
  473. public static int COORD_SYNCHRONIZE;
  474. /** Period in days after which character is deleted */
  475. public static int DELETE_DAYS;
  476. /** Datapack root directory */
  477. public static File DATAPACK_ROOT;
  478. /** Maximum range mobs can randomly go from spawn point */
  479. public static int MAX_DRIFT_RANGE;
  480. /** Allow fishing ? */
  481. public static boolean ALLOWFISHING;
  482. /** Allow Manor system */
  483. public static boolean ALLOW_MANOR;
  484. /** Jail config **/
  485. public static boolean JAIL_IS_PVP;
  486. public static boolean JAIL_DISABLE_CHAT;
  487. /** Enumeration describing values for Allowing the use of L2Walker client */
  488. public static enum L2WalkerAllowed
  489. {
  490. True,
  491. False,
  492. GM
  493. }
  494. /** Allow the use of L2Walker client ? */
  495. public static L2WalkerAllowed ALLOW_L2WALKER_CLIENT;
  496. /** Auto-ban client that use L2Walker ? */
  497. public static boolean AUTOBAN_L2WALKER_ACC;
  498. /** Revision of L2Walker */
  499. public static int L2WALKER_REVISION;
  500. /** FloodProtector initial capacity */
  501. public static int FLOODPROTECTOR_INITIALSIZE;
  502. /** Allow Discard item ?*/
  503. public static boolean ALLOW_DISCARDITEM;
  504. /** Allow freight ? */
  505. public static boolean ALLOW_FREIGHT;
  506. /** Allow warehouse ? */
  507. public static boolean ALLOW_WAREHOUSE;
  508. /** Allow warehouse cache? */
  509. public static boolean WAREHOUSE_CACHE;
  510. /** How long store WH datas */
  511. public static int WAREHOUSE_CACHE_TIME;
  512. /** Allow wear ? (try on in shop) */
  513. public static boolean ALLOW_WEAR;
  514. /** Duration of the try on after which items are taken back */
  515. public static int WEAR_DELAY;
  516. /** Price of the try on of one item */
  517. public static int WEAR_PRICE;
  518. /** Allow lottery ? */
  519. public static boolean ALLOW_LOTTERY;
  520. /** Allow race ? */
  521. public static boolean ALLOW_RACE;
  522. /** Allow water ? */
  523. public static boolean ALLOW_WATER;
  524. /** Allow rent pet ? */
  525. public static boolean ALLOW_RENTPET;
  526. /** Allow boat ? */
  527. public static boolean ALLOW_BOAT;
  528. /** Allow cursed weapons ? */
  529. public static boolean ALLOW_CURSED_WEAPONS;
  530. //WALKER NPC
  531. public static boolean ALLOW_NPC_WALKERS;
  532. /** Time after which a packet is considered as lost */
  533. public static int PACKET_LIFETIME;
  534. // Pets
  535. /** Speed of Weverns */
  536. public static int WYVERN_SPEED;
  537. /** Speed of Striders */
  538. public static int STRIDER_SPEED;
  539. /** Allow Wyvern Upgrader ? */
  540. public static boolean ALLOW_WYVERN_UPGRADER;
  541. // protocol revision
  542. /** Minimal protocol revision */
  543. public static int MIN_PROTOCOL_REVISION;
  544. /** Maximal protocol revision */
  545. public static int MAX_PROTOCOL_REVISION;
  546. // random animation interval
  547. /** Minimal time between 2 animations of a NPC */
  548. public static int MIN_NPC_ANIMATION;
  549. /** Maximal time between 2 animations of a NPC */
  550. public static int MAX_NPC_ANIMATION;
  551. /** Minimal time between animations of a MONSTER */
  552. public static int MIN_MONSTER_ANIMATION;
  553. /** Maximal time between animations of a MONSTER */
  554. public static int MAX_MONSTER_ANIMATION;
  555. /** Activate position recorder ? */
  556. public static boolean ACTIVATE_POSITION_RECORDER;
  557. /** Use 3D Map ? */
  558. public static boolean USE_3D_MAP;
  559. // Community Board
  560. /** Type of community */
  561. public static String COMMUNITY_TYPE;
  562. public static String BBS_DEFAULT;
  563. /** Show level of the community board ? */
  564. public static boolean SHOW_LEVEL_COMMUNITYBOARD;
  565. /** Show status of the community board ? */
  566. public static boolean SHOW_STATUS_COMMUNITYBOARD;
  567. /** Size of the name page on the community board */
  568. public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
  569. /** Name per row on community board */
  570. public static int NAME_PER_ROW_COMMUNITYBOARD;
  571. // Configuration files
  572. /** Properties file that allows selection of new Classes for storage of World Objects.
  573. * <br>This may help servers with large amounts of players recieving error messages related to
  574. * the <i>L2ObjectHashMap</i> and <i>L2ObejctHashSet</i> classes.*/
  575. /** Properties file for game server (connection and ingame) configurations */
  576. public static final String CONFIGURATION_FILE = "./config/server.properties";
  577. /** Properties file for game server options */
  578. public static final String OPTIONS_FILE = "./config/options.properties";
  579. /** Properties file for login server configurations */
  580. public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
  581. /** Properties file for the ID factory */
  582. public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
  583. /** Properties file for other configurations */
  584. public static final String OTHER_CONFIG_FILE = "./config/other.properties";
  585. /** Properties file for rates configurations */
  586. public static final String RATES_CONFIG_FILE = "./config/rates.properties";
  587. /** Properties file for alternative configuration */
  588. public static final String ALT_SETTINGS_FILE = "./config/altsettings.properties";
  589. /** Properties file for PVP configurations */
  590. public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
  591. /** Properties file for GM access configurations */
  592. public static final String GM_ACCESS_FILE = "./config/GMAccess.properties";
  593. /** Properties file for telnet configuration */
  594. public static final String TELNET_FILE = "./config/telnet.properties";
  595. /** Properties file for l2j server version configurations */
  596. public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
  597. /** Properties file for l2j datapack version configurations */
  598. public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
  599. /** Properties file for siege configuration */
  600. public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
  601. /** XML file for banned IP */
  602. public static final String BANNED_IP_XML = "./config/banned.xml";
  603. /** Text file containing hexadecimal value of server ID */
  604. public static final String HEXID_FILE = "./config/hexid.txt";
  605. /** Properties file for alternative configure GM commands access level.<br>
  606. * Note that this file only read if "AltPrivilegesAdmin = True" */
  607. public static final String COMMAND_PRIVILEGES_FILE = "./config/command-privileges.properties";
  608. /** Properties file for AI configurations */
  609. public static final String AI_FILE = "./config/ai.properties";
  610. /** Properties file for 7 Signs Festival */
  611. public static final String SEVENSIGNS_FILE = "./config/sevensigns.properties";
  612. public static final String CLANHALL_CONFIG_FILE = "./config/clanhall.properties";
  613. public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
  614. public static int MAX_ITEM_IN_PACKET;
  615. public static boolean CHECK_KNOWN;
  616. /** Game Server login port */
  617. public static int GAME_SERVER_LOGIN_PORT;
  618. /** Game Server login Host */
  619. public static String GAME_SERVER_LOGIN_HOST;
  620. /** Internal Hostname */
  621. public static String INTERNAL_HOSTNAME;
  622. /** External Hostname */
  623. public static String EXTERNAL_HOSTNAME;
  624. public static int PATH_NODE_RADIUS;
  625. public static int NEW_NODE_ID;
  626. public static int SELECTED_NODE_ID;
  627. public static int LINKED_NODE_ID;
  628. public static String NEW_NODE_TYPE;
  629. /** Show "data/html/servnews.htm" whenever a character enters world.*/
  630. public static boolean SERVER_NEWS;
  631. /** Show L2Monster level and aggro ? */
  632. public static boolean SHOW_NPC_LVL;
  633. /** Force full item inventory packet to be sent for any item change ?<br>
  634. * <u><i>Note:</i></u> This can increase network traffic*/
  635. public static boolean FORCE_INVENTORY_UPDATE;
  636. /** Disable the use of guards against agressive monsters ? */
  637. public static boolean ALLOW_GUARDS;
  638. /** Allow use Event Managers for change occupation ?*/
  639. public static boolean ALLOW_CLASS_MASTERS;
  640. /** Time between 2 updates of IP */
  641. public static int IP_UPDATE_TIME;
  642. // Server version
  643. /** Server version */
  644. public static String SERVER_VERSION;
  645. /** Date of server build */
  646. public static String SERVER_BUILD_DATE;
  647. // Datapack version
  648. /** Datapack version */
  649. public static String DATAPACK_VERSION;
  650. /** Zone Setting */
  651. public static int ZONE_TOWN;
  652. /** Crafting Enabled? */
  653. public static boolean IS_CRAFTING_ENABLED;
  654. // Inventory slots limit
  655. /** Maximum inventory slots limits for non dwarf characters */
  656. public static int INVENTORY_MAXIMUM_NO_DWARF;
  657. /** Maximum inventory slots limits for dwarf characters */
  658. public static int INVENTORY_MAXIMUM_DWARF;
  659. /** Maximum inventory slots limits for GM */
  660. public static int INVENTORY_MAXIMUM_GM;
  661. // Warehouse slots limits
  662. /** Maximum inventory slots limits for non dwarf warehouse */
  663. public static int WAREHOUSE_SLOTS_NO_DWARF;
  664. /** Maximum inventory slots limits for dwarf warehouse */
  665. public static int WAREHOUSE_SLOTS_DWARF;
  666. /** Maximum inventory slots limits for clan warehouse */
  667. public static int WAREHOUSE_SLOTS_CLAN;
  668. /** Maximum inventory slots limits for freight */
  669. public static int FREIGHT_SLOTS;
  670. // Karma System Variables
  671. /** Minimum karma gain/loss */
  672. public static int KARMA_MIN_KARMA;
  673. /** Maximum karma gain/loss */
  674. public static int KARMA_MAX_KARMA;
  675. /** Number to divide the xp recieved by, to calculate karma lost on xp gain/lost */
  676. public static int KARMA_XP_DIVIDER;
  677. /** The Minimum Karma lost if 0 karma is to be removed */
  678. public static int KARMA_LOST_BASE;
  679. /** Can a GM drop item ? */
  680. public static boolean KARMA_DROP_GM;
  681. /** Should award a pvp point for killing a player with karma ? */
  682. public static boolean KARMA_AWARD_PK_KILL;
  683. /** Minimum PK required to drop */
  684. public static int KARMA_PK_LIMIT;
  685. /** List of pet items that cannot be dropped (seperated by ",") when PVP */
  686. public static String KARMA_NONDROPPABLE_PET_ITEMS;
  687. /** List of items that cannot be dropped (seperated by ",") when PVP*/
  688. public static String KARMA_NONDROPPABLE_ITEMS;
  689. /** List of pet items that cannot be dropped when PVP */
  690. public static List<Integer> KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<Integer>();
  691. /** List of items that cannot be dropped when PVP */
  692. public static List<Integer> KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  693. /** List of items that cannot be dropped (seperated by ",") */
  694. public static String NONDROPPABLE_ITEMS;
  695. /** List of items that cannot be dropped */
  696. public static List<Integer> LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  697. /** List of NPCs that rent pets (seperated by ",") */
  698. public static String PET_RENT_NPC;
  699. /** List of NPCs that rent pets */
  700. public static List<Integer> LIST_PET_RENT_NPC = new FastList<Integer>();
  701. /** Duration (in ms) while a player stay in PVP mode after hitting an innocent */
  702. public static int PVP_NORMAL_TIME;
  703. /** Duration (in ms) while a player stay in PVP mode after hitting a purple player */
  704. public static int PVP_PVP_TIME;
  705. // Karma Punishment
  706. /** Allow player with karma to be killed in peace zone ? */
  707. public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
  708. /** Allow player with karma to shop ? */
  709. public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
  710. /** Allow player with karma to use gatekeepers ? */
  711. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
  712. /** Allow player with karma to use SOE or Return skill ? */
  713. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
  714. /** Allow player with karma to trade ? */
  715. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
  716. /** Allow player with karma to use warehouse ?*/
  717. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
  718. /**define L2JMODS */
  719. /** Champion Mod*/
  720. public static boolean L2JMOD_CHAMPION_ENABLE;
  721. public static int L2JMOD_CHAMPION_FREQUENCY;
  722. public static int L2JMOD_CHAMP_MIN_LVL;
  723. public static int L2JMOD_CHAMP_MAX_LVL;
  724. public static int L2JMOD_CHAMPION_HP;
  725. public static int L2JMOD_CHAMPION_REWARDS;
  726. public static int L2JMOD_CHAMPION_ADENAS_REWARDS;
  727. public static float L2JMOD_CHAMPION_HP_REGEN;
  728. public static float L2JMOD_CHAMPION_ATK;
  729. public static float L2JMOD_CHAMPION_SPD_ATK;
  730. public static int L2JMOD_CHAMPION_REWARD;
  731. public static int L2JMOD_CHAMPION_REWARD_ID;
  732. public static int L2JMOD_CHAMPION_REWARD_QTY;
  733. /** Team vs. Team Event Engine */
  734. public static boolean TVT_EVENT_ENABLED;
  735. public static int TVT_EVENT_INTERVAL;
  736. public static int TVT_EVENT_PARTICIPATION_TIME;
  737. public static int TVT_EVENT_RUNNING_TIME;
  738. public static int TVT_EVENT_PARTICIPATION_NPC_ID;
  739. public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
  740. public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
  741. public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
  742. public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
  743. public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
  744. public static String TVT_EVENT_TEAM_1_NAME;
  745. public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  746. public static String TVT_EVENT_TEAM_2_NAME;
  747. public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  748. public static List<int[]> TVT_EVENT_REWARDS = new FastList<int[]>();
  749. public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  750. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  751. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  752. public static List<Integer> TVT_EVENT_DOOR_IDS = new FastList<Integer>();
  753. public static byte TVT_EVENT_MIN_LVL;
  754. public static byte TVT_EVENT_MAX_LVL;
  755. /** L2JMOD Wedding system */
  756. public static boolean L2JMOD_ALLOW_WEDDING;
  757. public static int L2JMOD_WEDDING_PRICE;
  758. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  759. public static boolean L2JMOD_WEDDING_TELEPORT;
  760. public static int L2JMOD_WEDDING_TELEPORT_PRICE;
  761. public static int L2JMOD_WEDDING_TELEPORT_DURATION;
  762. public static boolean L2JMOD_WEDDING_SAMESEX;
  763. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  764. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  765. // Packet information
  766. /** Count the amount of packets per minute ? */
  767. public static boolean COUNT_PACKETS = false;
  768. /** Dump packet count ? */
  769. public static boolean DUMP_PACKET_COUNTS = false;
  770. /** Time interval between 2 dumps */
  771. public static int DUMP_INTERVAL_SECONDS = 60;
  772. /** Enumeration for type of ID Factory */
  773. public static enum IdFactoryType
  774. {
  775. Compaction,
  776. BitSet,
  777. Stack
  778. }
  779. /** ID Factory type */
  780. public static IdFactoryType IDFACTORY_TYPE;
  781. /** Check for bad ID ? */
  782. public static boolean BAD_ID_CHECKING;
  783. /** Enumeration for type of maps object */
  784. public static enum ObjectMapType
  785. {
  786. L2ObjectHashMap,
  787. WorldObjectMap
  788. }
  789. /** Enumeration for type of set object */
  790. public static enum ObjectSetType
  791. {
  792. L2ObjectHashSet,
  793. WorldObjectSet
  794. }
  795. /** Type of map object */
  796. public static ObjectMapType MAP_TYPE;
  797. /** Type of set object */
  798. public static ObjectSetType SET_TYPE;
  799. /**
  800. * Allow lesser effects to be canceled if stronger effects are used when effects of the same stack group are used.<br>
  801. * New effects that are added will be canceled if they are of lesser priority to the old one.
  802. */
  803. public static boolean EFFECT_CANCELING;
  804. /** Auto-delete invalid quest data ? */
  805. public static boolean AUTODELETE_INVALID_QUEST_DATA;
  806. /** Chance that an item will succesfully be enchanted */
  807. public static int ENCHANT_CHANCE_WEAPON;
  808. public static int ENCHANT_CHANCE_ARMOR;
  809. public static int ENCHANT_CHANCE_JEWELRY;
  810. /** Maximum level of enchantment */
  811. public static int ENCHANT_MAX_WEAPON;
  812. public static int ENCHANT_MAX_ARMOR;
  813. public static int ENCHANT_MAX_JEWELRY;
  814. /** maximum level of safe enchantment for normal items*/
  815. public static int ENCHANT_SAFE_MAX;
  816. /** maximum level of safe enchantment for full body armor*/
  817. public static int ENCHANT_SAFE_MAX_FULL;
  818. // Character multipliers
  819. /** Multiplier for character HP regeneration */
  820. public static double HP_REGEN_MULTIPLIER;
  821. /** Mutilplier for character MP regeneration */
  822. public static double MP_REGEN_MULTIPLIER;
  823. /** Multiplier for character CP regeneration */
  824. public static double CP_REGEN_MULTIPLIER;
  825. // Raid Boss multipliers
  826. /** Multiplier for Raid boss HP regeneration */
  827. public static double RAID_HP_REGEN_MULTIPLIER;
  828. /** Mulitplier for Raid boss MP regeneration */
  829. public static double RAID_MP_REGEN_MULTIPLIER;
  830. /** Multiplier for Raid boss defense multiplier */
  831. public static double RAID_DEFENCE_MULTIPLIER;
  832. /** Raid Boss Minin Spawn Timer */
  833. public static double RAID_MINION_RESPAWN_TIMER;
  834. /** Mulitplier for Raid boss minimum time respawn */
  835. public static float RAID_MIN_RESPAWN_MULTIPLIER;
  836. /** Mulitplier for Raid boss maximum time respawn */
  837. public static float RAID_MAX_RESPAWN_MULTIPLIER;
  838. /** Amount of adenas when starting a new character */
  839. public static int STARTING_ADENA;
  840. /** Deep Blue Mobs' Drop Rules Enabled */
  841. public static boolean DEEPBLUE_DROP_RULES;
  842. public static int UNSTUCK_INTERVAL;
  843. /** Is telnet enabled ? */
  844. public static boolean IS_TELNET_ENABLED;
  845. /** Death Penalty chance */
  846. public static int DEATH_PENALTY_CHANCE;
  847. /** Player Protection control */
  848. public static int PLAYER_SPAWN_PROTECTION;
  849. public static int PLAYER_FAKEDEATH_UP_PROTECTION;
  850. /** Define Party XP cutoff point method - Possible values: level and percentage */
  851. public static String PARTY_XP_CUTOFF_METHOD;
  852. /** Define the cutoff point value for the "level" method */
  853. public static int PARTY_XP_CUTOFF_LEVEL;
  854. /** Define the cutoff point value for the "percentage" method */
  855. public static double PARTY_XP_CUTOFF_PERCENT;
  856. /** Percent CP is restore on respawn */
  857. public static double RESPAWN_RESTORE_CP;
  858. /** Percent HP is restore on respawn */
  859. public static double RESPAWN_RESTORE_HP;
  860. /** Percent MP is restore on respawn */
  861. public static double RESPAWN_RESTORE_MP;
  862. /** Allow randomizing of the respawn point in towns. */
  863. public static boolean RESPAWN_RANDOM_ENABLED;
  864. /** The maximum offset from the base respawn point to allow. */
  865. public static int RESPAWN_RANDOM_MAX_OFFSET;
  866. /** Maximum number of available slots for pvt stores (sell/buy) - Dwarves */
  867. public static int MAX_PVTSTORE_SLOTS_DWARF;
  868. /** Maximum number of available slots for pvt stores (sell/buy) - Others */
  869. public static int MAX_PVTSTORE_SLOTS_OTHER;
  870. /** Store skills cooltime on char exit/relogin */
  871. public static boolean STORE_SKILL_COOLTIME;
  872. /** Show licence or not just after login (if false, will directly go to the Server List */
  873. public static boolean SHOW_LICENCE;
  874. /** Force GameGuard authorization in loginserver */
  875. public static boolean FORCE_GGAUTH;
  876. /** Default punishment for illegal actions */
  877. public static int DEFAULT_PUNISH;
  878. /** Parameter for default punishment */
  879. public static int DEFAULT_PUNISH_PARAM;
  880. /** Accept new game server ? */
  881. public static boolean ACCEPT_NEW_GAMESERVER;
  882. /** Server ID used with the HexID */
  883. public static int SERVER_ID;
  884. /** Hexadecimal ID of the game server */
  885. public static byte[] HEX_ID;
  886. /** Accept alternate ID for server ? */
  887. public static boolean ACCEPT_ALTERNATE_ID;
  888. /** ID for request to the server */
  889. public static int REQUEST_ID;
  890. public static boolean RESERVE_HOST_ON_LOGIN = false;
  891. public static int MINIMUM_UPDATE_DISTANCE;
  892. public static int KNOWNLIST_FORGET_DELAY;
  893. public static int MINIMUN_UPDATE_TIME;
  894. public static boolean ANNOUNCE_MAMMON_SPAWN;
  895. public static boolean LAZY_CACHE;
  896. /** Enable colored name for GM ? */
  897. public static boolean GM_NAME_COLOR_ENABLED;
  898. /** Color of GM name */
  899. public static int GM_NAME_COLOR;
  900. /** Color of admin name */
  901. public static int ADMIN_NAME_COLOR;
  902. /** Place an aura around the GM ? */
  903. public static boolean GM_HERO_AURA;
  904. /** Set the GM invulnerable at startup ? */
  905. public static boolean GM_STARTUP_INVULNERABLE;
  906. /** Set the GM invisible at startup ? */
  907. public static boolean GM_STARTUP_INVISIBLE;
  908. /** Set silence to GM at startup ? */
  909. public static boolean GM_STARTUP_SILENCE;
  910. /** Add GM in the GM list at startup ? */
  911. public static boolean GM_STARTUP_AUTO_LIST;
  912. /** Change the way admin panel is shown */
  913. public static String GM_ADMIN_MENU_STYLE;
  914. /** Allow petition ? */
  915. public static boolean PETITIONING_ALLOWED;
  916. /** Maximum number of petitions per player */
  917. public static int MAX_PETITIONS_PER_PLAYER;
  918. /** Maximum number of petitions pending */
  919. public static int MAX_PETITIONS_PENDING;
  920. /** Bypass exploit protection ? */
  921. public static boolean BYPASS_VALIDATION;
  922. /** Only GM buy items for free**/
  923. public static boolean ONLY_GM_ITEMS_FREE;
  924. /** GM Audit ?*/
  925. public static boolean GMAUDIT;
  926. /** Allow auto-create account ? */
  927. public static boolean AUTO_CREATE_ACCOUNTS;
  928. public static boolean FLOOD_PROTECTION;
  929. public static int FAST_CONNECTION_LIMIT;
  930. public static int NORMAL_CONNECTION_TIME;
  931. public static int FAST_CONNECTION_TIME;
  932. public static int MAX_CONNECTION_PER_IP;
  933. /** Enforce gameguard query on character login ? */
  934. public static boolean GAMEGUARD_ENFORCE;
  935. /** Don't allow player to perform trade,talk with npc and move until gameguard reply received ? */
  936. public static boolean GAMEGUARD_PROHIBITACTION;
  937. /** Recipebook limits */
  938. public static int DWARF_RECIPE_LIMIT;
  939. public static int COMMON_RECIPE_LIMIT;
  940. /** Grid Options */
  941. public static boolean GRIDS_ALWAYS_ON;
  942. public static int GRID_NEIGHBOR_TURNON_TIME;
  943. public static int GRID_NEIGHBOR_TURNOFF_TIME;
  944. /** Clan Hall function related configs*/
  945. public static long CH_TELE_FEE_RATIO;
  946. public static int CH_TELE1_FEE;
  947. public static int CH_TELE2_FEE;
  948. public static long CH_ITEM_FEE_RATIO;
  949. public static int CH_ITEM1_FEE;
  950. public static int CH_ITEM2_FEE;
  951. public static int CH_ITEM3_FEE;
  952. public static long CH_MPREG_FEE_RATIO;
  953. public static int CH_MPREG1_FEE;
  954. public static int CH_MPREG2_FEE;
  955. public static int CH_MPREG3_FEE;
  956. public static int CH_MPREG4_FEE;
  957. public static int CH_MPREG5_FEE;
  958. public static long CH_HPREG_FEE_RATIO;
  959. public static int CH_HPREG1_FEE;
  960. public static int CH_HPREG2_FEE;
  961. public static int CH_HPREG3_FEE;
  962. public static int CH_HPREG4_FEE;
  963. public static int CH_HPREG5_FEE;
  964. public static int CH_HPREG6_FEE;
  965. public static int CH_HPREG7_FEE;
  966. public static int CH_HPREG8_FEE;
  967. public static int CH_HPREG9_FEE;
  968. public static int CH_HPREG10_FEE;
  969. public static int CH_HPREG11_FEE;
  970. public static int CH_HPREG12_FEE;
  971. public static int CH_HPREG13_FEE;
  972. public static long CH_EXPREG_FEE_RATIO;
  973. public static int CH_EXPREG1_FEE;
  974. public static int CH_EXPREG2_FEE;
  975. public static int CH_EXPREG3_FEE;
  976. public static int CH_EXPREG4_FEE;
  977. public static int CH_EXPREG5_FEE;
  978. public static int CH_EXPREG6_FEE;
  979. public static int CH_EXPREG7_FEE;
  980. public static long CH_SUPPORT_FEE_RATIO;
  981. public static int CH_SUPPORT1_FEE;
  982. public static int CH_SUPPORT2_FEE;
  983. public static int CH_SUPPORT3_FEE;
  984. public static int CH_SUPPORT4_FEE;
  985. public static int CH_SUPPORT5_FEE;
  986. public static int CH_SUPPORT6_FEE;
  987. public static int CH_SUPPORT7_FEE;
  988. public static int CH_SUPPORT8_FEE;
  989. public static long CH_CURTAIN_FEE_RATIO;
  990. public static int CH_CURTAIN1_FEE;
  991. public static int CH_CURTAIN2_FEE;
  992. public static long CH_FRONT_FEE_RATIO;
  993. public static int CH_FRONT1_FEE;
  994. public static int CH_FRONT2_FEE;
  995. /** GeoData 0/1/2 */
  996. public static int GEODATA;
  997. /** Force loading GeoData to psychical memory */
  998. public static boolean FORCE_GEODATA;
  999. public static boolean ACCEPT_GEOEDITOR_CONN;
  1000. /** Max amount of buffs */
  1001. public static byte BUFFS_MAX_AMOUNT;
  1002. /** Alt Settings for devs */
  1003. public static boolean ALT_DEV_NO_QUESTS;
  1004. public static boolean ALT_DEV_NO_SPAWNS;
  1005. /**
  1006. * This class initializes all global variables for configuration.<br>
  1007. * If key doesn't appear in properties file, a default value is setting on by this class.
  1008. * @see CONFIGURATION_FILE (propertie file) for configuring your server.
  1009. */
  1010. public static void load()
  1011. {
  1012. if(Server.serverMode == Server.MODE_GAMESERVER)
  1013. {
  1014. _log.info("loading gameserver config");
  1015. try {
  1016. Properties serverSettings = new Properties();
  1017. InputStream is = new FileInputStream(new File(CONFIGURATION_FILE));
  1018. serverSettings.load(is);
  1019. is.close();
  1020. GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
  1021. PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
  1022. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
  1023. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
  1024. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
  1025. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");
  1026. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  1027. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  1028. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  1029. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  1030. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  1031. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  1032. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  1033. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  1034. CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
  1035. PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
  1036. MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
  1037. MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
  1038. MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
  1039. MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
  1040. if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
  1041. {
  1042. throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
  1043. }
  1044. }
  1045. catch (Exception e)
  1046. {
  1047. e.printStackTrace();
  1048. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  1049. }
  1050. try
  1051. {
  1052. Properties optionsSettings = new Properties();
  1053. InputStream is = new FileInputStream(new File(OPTIONS_FILE));
  1054. optionsSettings.load(is);
  1055. is.close();
  1056. EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(optionsSettings.getProperty("EverybodyHasAdminRights", "false"));
  1057. DEBUG = Boolean.parseBoolean(optionsSettings.getProperty("Debug", "false"));
  1058. ASSERT = Boolean.parseBoolean(optionsSettings.getProperty("Assert", "false"));
  1059. DEVELOPER = Boolean.parseBoolean(optionsSettings.getProperty("Developer", "false"));
  1060. TEST_SERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
  1061. SERVER_LIST_TESTSERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
  1062. SERVER_LIST_BRACKET = Boolean.valueOf(optionsSettings.getProperty("ServerListBrackets", "false"));
  1063. SERVER_LIST_CLOCK = Boolean.valueOf(optionsSettings.getProperty("ServerListClock", "false"));
  1064. SERVER_GMONLY = Boolean.valueOf(optionsSettings.getProperty("ServerGMOnly", "false"));
  1065. AUTODESTROY_ITEM_AFTER = Integer.parseInt(optionsSettings.getProperty("AutoDestroyDroppedItemAfter", "0"));
  1066. HERB_AUTO_DESTROY_TIME = Integer.parseInt(optionsSettings.getProperty("AutoDestroyHerbTime","15"))*1000;
  1067. PROTECTED_ITEMS = optionsSettings.getProperty("ListOfProtectedItems");
  1068. LIST_PROTECTED_ITEMS = new FastList<Integer>();
  1069. for (String id : PROTECTED_ITEMS.split(",")) {
  1070. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
  1071. }
  1072. DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyPlayerDroppedItem", "false"));
  1073. DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyEquipableItem", "false"));
  1074. SAVE_DROPPED_ITEM = Boolean.valueOf(optionsSettings.getProperty("SaveDroppedItem", "false"));
  1075. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(optionsSettings.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
  1076. SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(optionsSettings.getProperty("SaveDroppedItemInterval", "0"))*60000;
  1077. CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(optionsSettings.getProperty("ClearDroppedItemTable", "false"));
  1078. PRECISE_DROP_CALCULATION = Boolean.valueOf(optionsSettings.getProperty("PreciseDropCalculation", "True"));
  1079. MULTIPLE_ITEM_DROP = Boolean.valueOf(optionsSettings.getProperty("MultipleItemDrop", "True"));
  1080. COORD_SYNCHRONIZE = Integer.parseInt(optionsSettings.getProperty("CoordSynchronize", "-1"));
  1081. ONLY_GM_ITEMS_FREE = Boolean.valueOf(optionsSettings.getProperty("OnlyGMItemsFree", "True"));
  1082. ALLOW_WAREHOUSE = Boolean.valueOf(optionsSettings.getProperty("AllowWarehouse", "True"));
  1083. WAREHOUSE_CACHE = Boolean.valueOf(optionsSettings.getProperty("WarehouseCache", "False"));
  1084. WAREHOUSE_CACHE_TIME = Integer.parseInt(optionsSettings.getProperty("WarehouseCacheTime", "15"));
  1085. ALLOW_FREIGHT = Boolean.valueOf(optionsSettings.getProperty("AllowFreight", "True"));
  1086. ALLOW_WEAR = Boolean.valueOf(optionsSettings.getProperty("AllowWear", "False"));
  1087. WEAR_DELAY = Integer.parseInt(optionsSettings.getProperty("WearDelay", "5"));
  1088. WEAR_PRICE = Integer.parseInt(optionsSettings.getProperty("WearPrice", "10"));
  1089. ALLOW_LOTTERY = Boolean.valueOf(optionsSettings.getProperty("AllowLottery", "False"));
  1090. ALLOW_RACE = Boolean.valueOf(optionsSettings.getProperty("AllowRace", "False"));
  1091. ALLOW_WATER = Boolean.valueOf(optionsSettings.getProperty("AllowWater", "False"));
  1092. ALLOW_RENTPET = Boolean.valueOf(optionsSettings.getProperty("AllowRentPet", "False"));
  1093. FLOODPROTECTOR_INITIALSIZE = Integer.parseInt(optionsSettings.getProperty("FloodProtectorInitialSize", "50"));
  1094. ALLOW_DISCARDITEM = Boolean.valueOf(optionsSettings.getProperty("AllowDiscardItem", "True"));
  1095. ALLOWFISHING = Boolean.valueOf(optionsSettings.getProperty("AllowFishing", "False"));
  1096. ALLOW_MANOR = Boolean.parseBoolean(optionsSettings.getProperty("AllowManor", "False"));
  1097. ALLOW_BOAT = Boolean.valueOf(optionsSettings.getProperty("AllowBoat", "False"));
  1098. ALLOW_NPC_WALKERS = Boolean.valueOf(optionsSettings.getProperty("AllowNpcWalkers", "true"));
  1099. ALLOW_CURSED_WEAPONS = Boolean.valueOf(optionsSettings.getProperty("AllowCursedWeapons", "False"));
  1100. ALLOW_L2WALKER_CLIENT = L2WalkerAllowed.valueOf(optionsSettings.getProperty("AllowL2Walker", "False"));
  1101. L2WALKER_REVISION = Integer.parseInt(optionsSettings.getProperty("L2WalkerRevision", "537"));
  1102. AUTOBAN_L2WALKER_ACC = Boolean.valueOf(optionsSettings.getProperty("AutobanL2WalkerAcc", "False"));
  1103. ACTIVATE_POSITION_RECORDER = Boolean.valueOf(optionsSettings.getProperty("ActivatePositionRecorder", "False"));
  1104. DEFAULT_GLOBAL_CHAT = optionsSettings.getProperty("GlobalChat", "ON");
  1105. DEFAULT_TRADE_CHAT = optionsSettings.getProperty("TradeChat", "ON");
  1106. LOG_CHAT = Boolean.valueOf(optionsSettings.getProperty("LogChat", "false"));
  1107. LOG_ITEMS = Boolean.valueOf(optionsSettings.getProperty("LogItems", "false"));
  1108. GMAUDIT = Boolean.valueOf(optionsSettings.getProperty("GMAudit", "False"));
  1109. COMMUNITY_TYPE = optionsSettings.getProperty("CommunityType", "old").toLowerCase();
  1110. BBS_DEFAULT = optionsSettings.getProperty("BBSDefault", "_bbshome");
  1111. SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowLevelOnCommunityBoard", "False"));
  1112. SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowStatusOnCommunityBoard", "True"));
  1113. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePageSizeOnCommunityBoard", "50"));
  1114. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePerRowOnCommunityBoard", "5"));
  1115. ZONE_TOWN = Integer.parseInt(optionsSettings.getProperty("ZoneTown", "0"));
  1116. MAX_DRIFT_RANGE = Integer.parseInt(optionsSettings.getProperty("MaxDriftRange", "300"));
  1117. MIN_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinNPCAnimation", "10"));
  1118. MAX_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxNPCAnimation", "20"));
  1119. MIN_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinMonsterAnimation", "5"));
  1120. MAX_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxMonsterAnimation", "20"));
  1121. SERVER_NEWS = Boolean.valueOf(optionsSettings.getProperty("ShowServerNews", "False"));
  1122. SHOW_NPC_LVL = Boolean.valueOf(optionsSettings.getProperty("ShowNpcLevel", "False"));
  1123. FORCE_INVENTORY_UPDATE = Boolean.valueOf(optionsSettings.getProperty("ForceInventoryUpdate", "False"));
  1124. AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(optionsSettings.getProperty("AutoDeleteInvalidQuestData", "False"));
  1125. THREAD_P_EFFECTS = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeEffects", "6"));
  1126. THREAD_P_GENERAL = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeGeneral", "15"));
  1127. GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralPacketThreadCoreSize", "4"));
  1128. IO_PACKET_THREAD_CORE_SIZE =Integer.parseInt(optionsSettings.getProperty("UrgentPacketThreadCoreSize", "2"));
  1129. AI_MAX_THREAD = Integer.parseInt(optionsSettings.getProperty("AiMaxThread", "10"));
  1130. GENERAL_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralThreadCoreSize", "4"));
  1131. DELETE_DAYS = Integer.parseInt(optionsSettings.getProperty("DeleteCharAfterDays", "7"));
  1132. DEFAULT_PUNISH = Integer.parseInt(optionsSettings.getProperty("DefaultPunish", "2"));
  1133. DEFAULT_PUNISH_PARAM = Integer.parseInt(optionsSettings.getProperty("DefaultPunishParam", "0"));
  1134. LAZY_CACHE = Boolean.valueOf(optionsSettings.getProperty("LazyCache", "False"));
  1135. PACKET_LIFETIME = Integer.parseInt(optionsSettings.getProperty("PacketLifeTime", "0"));
  1136. BYPASS_VALIDATION = Boolean.valueOf(optionsSettings.getProperty("BypassValidation", "True"));
  1137. GAMEGUARD_ENFORCE = Boolean.valueOf(optionsSettings.getProperty("GameGuardEnforce", "False"));
  1138. GAMEGUARD_PROHIBITACTION = Boolean.valueOf(optionsSettings.getProperty("GameGuardProhibitAction", "False"));
  1139. GRIDS_ALWAYS_ON = Boolean.parseBoolean(optionsSettings.getProperty("GridsAlwaysOn", "False"));
  1140. GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOnTime", "30"));
  1141. GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOffTime", "300"));
  1142. GEODATA = Integer.parseInt(optionsSettings.getProperty("GeoData", "0"));
  1143. FORCE_GEODATA = Boolean.parseBoolean(optionsSettings.getProperty("ForceGeoData", "True"));
  1144. ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(optionsSettings.getProperty("AcceptGeoeditorConn", "False"));
  1145. // ---------------------------------------------------
  1146. // Configuration values not found in config files
  1147. // ---------------------------------------------------
  1148. USE_3D_MAP = Boolean.valueOf(optionsSettings.getProperty("Use3DMap", "False"));
  1149. PATH_NODE_RADIUS = Integer.parseInt(optionsSettings.getProperty("PathNodeRadius", "50"));
  1150. NEW_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
  1151. SELECTED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
  1152. LINKED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
  1153. NEW_NODE_TYPE = optionsSettings.getProperty("NewNodeType", "npc");
  1154. COUNT_PACKETS = Boolean.valueOf(optionsSettings.getProperty("CountPacket", "false"));
  1155. DUMP_PACKET_COUNTS = Boolean.valueOf(optionsSettings.getProperty("DumpPacketCounts", "false"));
  1156. DUMP_INTERVAL_SECONDS = Integer.parseInt(optionsSettings.getProperty("PacketDumpInterval", "60"));
  1157. MINIMUM_UPDATE_DISTANCE = Integer.parseInt(optionsSettings.getProperty("MaximumUpdateDistance", "50"));
  1158. MINIMUN_UPDATE_TIME = Integer.parseInt(optionsSettings.getProperty("MinimumUpdateTime", "500"));
  1159. CHECK_KNOWN = Boolean.valueOf(optionsSettings.getProperty("CheckKnownList", "false"));
  1160. KNOWNLIST_FORGET_DELAY = Integer.parseInt(optionsSettings.getProperty("KnownListForgetDelay", "10000"));
  1161. }
  1162. catch (Exception e)
  1163. {
  1164. e.printStackTrace();
  1165. throw new Error("Failed to Load "+OPTIONS_FILE+" File.");
  1166. }
  1167. /*
  1168. * Load L2J Server Version Properties file (if exists)
  1169. */
  1170. try
  1171. {
  1172. Properties serverVersion = new Properties();
  1173. InputStream is = new FileInputStream(new File(SERVER_VERSION_FILE));
  1174. serverVersion.load(is);
  1175. is.close();
  1176. SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1177. SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
  1178. }
  1179. catch (Exception e)
  1180. {
  1181. //Ignore Properties file if it doesnt exist
  1182. SERVER_VERSION = "Unsupported Custom Version.";
  1183. SERVER_BUILD_DATE = "Undefined Date.";
  1184. }
  1185. /*
  1186. * Load L2J Datapack Version Properties file (if exists)
  1187. */
  1188. try
  1189. {
  1190. Properties serverVersion = new Properties();
  1191. InputStream is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
  1192. serverVersion.load(is);
  1193. is.close();
  1194. DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1195. }
  1196. catch (Exception e)
  1197. {
  1198. //Ignore Properties file if it doesnt exist
  1199. DATAPACK_VERSION = "Unsupported Custom Version.";
  1200. }
  1201. // telnet
  1202. try
  1203. {
  1204. Properties telnetSettings = new Properties();
  1205. InputStream is = new FileInputStream(new File(TELNET_FILE));
  1206. telnetSettings.load(is);
  1207. is.close();
  1208. IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "false"));
  1209. }
  1210. catch (Exception e)
  1211. {
  1212. e.printStackTrace();
  1213. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1214. }
  1215. // id factory
  1216. try
  1217. {
  1218. Properties idSettings = new Properties();
  1219. InputStream is = new FileInputStream(new File(ID_CONFIG_FILE));
  1220. idSettings.load(is);
  1221. is.close();
  1222. MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
  1223. SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
  1224. IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
  1225. BAD_ID_CHECKING = Boolean.valueOf(idSettings.getProperty("BadIdChecking", "True"));
  1226. }
  1227. catch (Exception e)
  1228. {
  1229. e.printStackTrace();
  1230. throw new Error("Failed to Load "+ID_CONFIG_FILE+" File.");
  1231. }
  1232. // other
  1233. try
  1234. {
  1235. Properties otherSettings = new Properties();
  1236. InputStream is = new FileInputStream(new File(OTHER_CONFIG_FILE));
  1237. otherSettings.load(is);
  1238. is.close();
  1239. DEEPBLUE_DROP_RULES = Boolean.parseBoolean(otherSettings.getProperty("UseDeepBlueDropRules", "True"));
  1240. ALLOW_GUARDS = Boolean.valueOf(otherSettings.getProperty("AllowGuards", "False"));
  1241. EFFECT_CANCELING = Boolean.valueOf(otherSettings.getProperty("CancelLesserEffect", "True"));
  1242. WYVERN_SPEED = Integer.parseInt(otherSettings.getProperty("WyvernSpeed", "100"));
  1243. STRIDER_SPEED = Integer.parseInt(otherSettings.getProperty("StriderSpeed", "80"));
  1244. ALLOW_WYVERN_UPGRADER = Boolean.valueOf(otherSettings.getProperty("AllowWyvernUpgrader", "False"));
  1245. /* Inventory slots limits */
  1246. INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForNoDwarf", "80"));
  1247. INVENTORY_MAXIMUM_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForDwarf", "100"));
  1248. INVENTORY_MAXIMUM_GM = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForGMPlayer", "250"));
  1249. MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
  1250. /* Inventory slots limits */
  1251. WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
  1252. WAREHOUSE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
  1253. WAREHOUSE_SLOTS_CLAN = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForClan", "150"));
  1254. FREIGHT_SLOTS = Integer.parseInt(otherSettings.getProperty("MaximumFreightSlots", "20"));
  1255. /* chance to enchant an item over +3 */
  1256. ENCHANT_CHANCE_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantChanceWeapon", "68"));
  1257. ENCHANT_CHANCE_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantChanceArmor", "52"));
  1258. ENCHANT_CHANCE_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantChanceJewelry", "54"));
  1259. /* limit on enchant */
  1260. ENCHANT_MAX_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantMaxWeapon", "255"));
  1261. ENCHANT_MAX_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantMaxArmor", "255"));
  1262. ENCHANT_MAX_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantMaxJewelry", "255"));
  1263. /*limit of safe enchant normal */
  1264. ENCHANT_SAFE_MAX = Integer.parseInt(otherSettings.getProperty("EnchantSafeMax", "3"));
  1265. /*limit of safe enchant full */
  1266. ENCHANT_SAFE_MAX_FULL = Integer.parseInt(otherSettings.getProperty("EnchantSafeMaxFull", "4"));
  1267. /* if different from 100 (ie 100%) heal rate is modified acordingly */
  1268. HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("HpRegenMultiplier", "100")) /100;
  1269. MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("MpRegenMultiplier", "100")) /100;
  1270. CP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("CpRegenMultiplier", "100")) /100;
  1271. RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidHpRegenMultiplier", "100")) /100;
  1272. RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidMpRegenMultiplier", "100")) /100;
  1273. RAID_DEFENCE_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidDefenceMultiplier", "100")) /100;
  1274. RAID_MINION_RESPAWN_TIMER = Integer.parseInt(otherSettings.getProperty("RaidMinionRespawnTime", "300000"));
  1275. RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMinRespawnMultiplier", "1.0"));
  1276. RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMaxRespawnMultiplier", "1.0"));
  1277. STARTING_ADENA = Integer.parseInt(otherSettings.getProperty("StartingAdena", "100"));
  1278. UNSTUCK_INTERVAL = Integer.parseInt(otherSettings.getProperty("UnstuckInterval", "300"));
  1279. /* Player protection after teleport or login */
  1280. PLAYER_SPAWN_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerSpawnProtection", "0"));
  1281. /* Player protection after recovering from fake death (works against mobs only) */
  1282. PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerFakeDeathUpProtection", "0"));
  1283. /* Defines some Party XP related values */
  1284. PARTY_XP_CUTOFF_METHOD = otherSettings.getProperty("PartyXpCutoffMethod", "percentage");
  1285. PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(otherSettings.getProperty("PartyXpCutoffPercent", "3."));
  1286. PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(otherSettings.getProperty("PartyXpCutoffLevel", "30"));
  1287. /* Amount of HP, MP, and CP is restored */
  1288. RESPAWN_RESTORE_CP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreCP", "0")) / 100;
  1289. RESPAWN_RESTORE_HP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreHP", "70")) / 100;
  1290. RESPAWN_RESTORE_MP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreMP", "70")) / 100;
  1291. RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("RespawnRandomInTown", "False"));
  1292. RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(otherSettings.getProperty("RespawnRandomMaxOffset", "50"));
  1293. /* Maximum number of available slots for pvt stores */
  1294. MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsDwarf", "5"));
  1295. MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsOther", "4"));
  1296. STORE_SKILL_COOLTIME = Boolean.parseBoolean(otherSettings.getProperty("StoreSkillCooltime", "true"));
  1297. PET_RENT_NPC = otherSettings.getProperty("ListPetRentNpc", "30827");
  1298. LIST_PET_RENT_NPC = new FastList<Integer>();
  1299. for (String id : PET_RENT_NPC.split(",")) {
  1300. LIST_PET_RENT_NPC.add(Integer.parseInt(id));
  1301. }
  1302. NONDROPPABLE_ITEMS = otherSettings.getProperty("ListOfNonDroppableItems", "1147,425,1146,461,10,2368,7,6,2370,2369,5598");
  1303. LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  1304. for (String id : NONDROPPABLE_ITEMS.split(",")) {
  1305. LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
  1306. }
  1307. ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(otherSettings.getProperty("AnnounceMammonSpawn", "True"));
  1308. ALT_PRIVILEGES_ADMIN = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesAdmin", "False"));
  1309. ALT_PRIVILEGES_SECURE_CHECK = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesSecureCheck", "True"));
  1310. ALT_PRIVILEGES_DEFAULT_LEVEL = Integer.parseInt(otherSettings.getProperty("AltPrivilegesDefaultLevel", "100"));
  1311. GM_NAME_COLOR_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("GMNameColorEnabled", "False"));
  1312. GM_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("GMNameColor", "FFFF00"));
  1313. ADMIN_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("AdminNameColor", "00FF00"));
  1314. GM_HERO_AURA = Boolean.parseBoolean(otherSettings.getProperty("GMHeroAura", "True"));
  1315. GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvulnerable", "True"));
  1316. GM_STARTUP_INVISIBLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvisible", "True"));
  1317. GM_STARTUP_SILENCE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupSilence", "True"));
  1318. GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(otherSettings.getProperty("GMStartupAutoList", "True"));
  1319. GM_ADMIN_MENU_STYLE = otherSettings.getProperty("GMAdminMenuStyle", "modern");
  1320. PETITIONING_ALLOWED = Boolean.parseBoolean(otherSettings.getProperty("PetitioningAllowed", "True"));
  1321. MAX_PETITIONS_PER_PLAYER = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPerPlayer", "5"));
  1322. MAX_PETITIONS_PENDING = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPending", "25"));
  1323. JAIL_IS_PVP = Boolean.valueOf(otherSettings.getProperty("JailIsPvp", "True"));
  1324. JAIL_DISABLE_CHAT = Boolean.valueOf(otherSettings.getProperty("JailDisableChat", "True"));
  1325. DEATH_PENALTY_CHANCE = Integer.parseInt(otherSettings.getProperty("DeathPenaltyChance", "20"));
  1326. }
  1327. catch (Exception e)
  1328. {
  1329. e.printStackTrace();
  1330. throw new Error("Failed to Load "+OTHER_CONFIG_FILE+" File.");
  1331. }
  1332. // rates
  1333. try
  1334. {
  1335. Properties ratesSettings = new Properties();
  1336. InputStream is = new FileInputStream(new File(RATES_CONFIG_FILE));
  1337. ratesSettings.load(is);
  1338. is.close();
  1339. RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
  1340. RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
  1341. RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
  1342. RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
  1343. RATE_QUESTS_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestsReward", "1."));
  1344. RATE_DROP_ADENA = Float.parseFloat(ratesSettings.getProperty("RateDropAdena", "1."));
  1345. RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
  1346. RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
  1347. RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
  1348. RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
  1349. RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("RateDropQuest", "1."));
  1350. RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
  1351. RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
  1352. RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "15."));
  1353. RATE_DROP_MP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpMpHerbs", "10."));
  1354. RATE_DROP_GREATER_HERBS = Float.parseFloat(ratesSettings.getProperty("RateGreaterHerbs", "4."));
  1355. RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSuperiorHerbs", "0.8"))*10;
  1356. RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "0.2"))*10;
  1357. PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
  1358. PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
  1359. PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
  1360. PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
  1361. PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
  1362. PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
  1363. PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
  1364. SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
  1365. KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
  1366. KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
  1367. KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
  1368. KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
  1369. KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
  1370. }
  1371. catch (Exception e) {
  1372. e.printStackTrace();
  1373. throw new Error("Failed to Load "+RATES_CONFIG_FILE+" File.");
  1374. }
  1375. // alternative settings
  1376. try
  1377. {
  1378. Properties altSettings = new Properties();
  1379. InputStream is = new FileInputStream(new File(ALT_SETTINGS_FILE));
  1380. altSettings.load(is);
  1381. is.close();
  1382. ALT_GAME_TIREDNESS = Boolean.parseBoolean(altSettings.getProperty("AltGameTiredness", "false"));
  1383. ALT_GAME_CREATION = Boolean.parseBoolean(altSettings.getProperty("AltGameCreation", "false"));
  1384. ALT_GAME_CREATION_SPEED = Double.parseDouble(altSettings.getProperty("AltGameCreationSpeed", "1"));
  1385. ALT_GAME_CREATION_XP_RATE=Double.parseDouble(altSettings.getProperty("AltGameCreationRateXp", "1"));
  1386. ALT_GAME_CREATION_SP_RATE=Double.parseDouble(altSettings.getProperty("AltGameCreationRateSp", "1"));
  1387. ALT_WEIGHT_LIMIT =Double.parseDouble(altSettings.getProperty("AltWeightLimit", "1"));
  1388. ALT_BLACKSMITH_USE_RECIPES=Boolean.parseBoolean(altSettings.getProperty("AltBlacksmithUseRecipes", "true"));
  1389. ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(altSettings.getProperty("AltGameSkillLearn", "false"));
  1390. AUTO_LEARN_SKILLS = Boolean.parseBoolean(altSettings.getProperty("AutoLearnSkills", "false"));
  1391. ALT_GAME_CANCEL_BOW = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1392. ALT_GAME_CANCEL_CAST = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1393. ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(altSettings.getProperty("AltShieldBlocks", "false"));
  1394. ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(altSettings.getProperty("AltPerfectShieldBlockRate", "10"));
  1395. ALT_GAME_DELEVEL = Boolean.parseBoolean(altSettings.getProperty("Delevel", "true"));
  1396. ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(altSettings.getProperty("MagicFailures", "false"));
  1397. ALT_GAME_MOB_ATTACK_AI = Boolean.parseBoolean(altSettings.getProperty("AltGameMobAttackAI", "false"));
  1398. ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(altSettings.getProperty("AltMobAgroInPeaceZone", "true"));
  1399. ALT_GAME_EXPONENT_XP = Float.parseFloat(altSettings.getProperty("AltGameExponentXp", "0."));
  1400. ALT_GAME_EXPONENT_SP = Float.parseFloat(altSettings.getProperty("AltGameExponentSp", "0."));
  1401. ALLOW_CLASS_MASTERS = Boolean.valueOf(altSettings.getProperty("AllowClassMasters", "False"));
  1402. ALT_GAME_FREIGHTS = Boolean.parseBoolean(altSettings.getProperty("AltGameFreights", "false"));
  1403. ALT_GAME_FREIGHT_PRICE = Integer.parseInt(altSettings.getProperty("AltGameFreightPrice", "1000"));
  1404. ALT_PARTY_RANGE = Integer.parseInt(altSettings.getProperty("AltPartyRange", "1600"));
  1405. ALT_PARTY_RANGE2 = Integer.parseInt(altSettings.getProperty("AltPartyRange2", "1400"));
  1406. REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(altSettings.getProperty("RemoveCastleCirclets", "true"));
  1407. IS_CRAFTING_ENABLED = Boolean.parseBoolean(altSettings.getProperty("CraftingEnabled", "true"));
  1408. LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(altSettings.getProperty("LifeCrystalNeeded", "true"));
  1409. SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("SpBookNeeded", "true"));
  1410. ES_SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("EnchantSkillSpBookNeeded","true"));
  1411. AUTO_LOOT = altSettings.getProperty("AutoLoot").equalsIgnoreCase("True");
  1412. AUTO_LOOT_HERBS = altSettings.getProperty("AutoLootHerbs").equalsIgnoreCase("True");
  1413. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
  1414. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanShop", "true"));
  1415. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseGK", "false"));
  1416. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTeleport", "true"));
  1417. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTrade", "true"));
  1418. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
  1419. ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(altSettings.getProperty("AltFreeTeleporting", "False"));
  1420. ALT_RECOMMEND = Boolean.parseBoolean(altSettings.getProperty("AltRecommend", "False"));
  1421. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltSubClassWithoutQuests", "False"));
  1422. ALT_GAME_VIEWNPC = Boolean.parseBoolean(altSettings.getProperty("AltGameViewNpc", "False"));
  1423. ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.parseBoolean(altSettings.getProperty("AltNewCharAlwaysIsNewbie", "False"));
  1424. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(altSettings.getProperty("AltMembersCanWithdrawFromClanWH", "False"));
  1425. ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(altSettings.getProperty("AltMaxNumOfClansInAlly", "3"));
  1426. DWARF_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("DwarfRecipeLimit","50"));
  1427. COMMON_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("CommonRecipeLimit","50"));
  1428. ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(altSettings.getProperty("AltClanMembersForWar", "15"));
  1429. ALT_CLAN_JOIN_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAClan", "5"));
  1430. ALT_CLAN_CREATE_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateAClan", "10"));
  1431. ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(altSettings.getProperty("DaysToPassToDissolveAClan", "7"));
  1432. ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
  1433. ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
  1434. ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
  1435. ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "10"));
  1436. ALT_OLY_START_TIME = Integer.parseInt(altSettings.getProperty("AltOlyStartTime", "18"));
  1437. ALT_OLY_MIN = Integer.parseInt(altSettings.getProperty("AltOlyMin","00"));
  1438. ALT_OLY_CPERIOD = Long.parseLong(altSettings.getProperty("AltOlyCPeriod","21600000"));
  1439. ALT_OLY_BATTLE = Long.parseLong(altSettings.getProperty("AltOlyBattle","360000"));
  1440. ALT_OLY_BWAIT = Long.parseLong(altSettings.getProperty("AltOlyBWait","600000"));
  1441. ALT_OLY_IWAIT = Long.parseLong(altSettings.getProperty("AltOlyIWait","300000"));
  1442. ALT_OLY_WPERIOD = Long.parseLong(altSettings.getProperty("AltOlyWPeriod","604800000"));
  1443. ALT_OLY_VPERIOD = Long.parseLong(altSettings.getProperty("AltOlyVPeriod","86400000"));
  1444. ALT_MANOR_REFRESH_TIME = Integer.parseInt(altSettings.getProperty("AltManorRefreshTime","20"));
  1445. ALT_MANOR_REFRESH_MIN = Integer.parseInt(altSettings.getProperty("AltManorRefreshMin","00"));
  1446. ALT_MANOR_APPROVE_TIME = Integer.parseInt(altSettings.getProperty("AltManorApproveTime","6"));
  1447. ALT_MANOR_APPROVE_MIN = Integer.parseInt(altSettings.getProperty("AltManorApproveMin","00"));
  1448. ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(altSettings.getProperty("AltManorMaintenancePeriod","360000"));
  1449. ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(altSettings.getProperty("AltManorSaveAllActions","false"));
  1450. ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(altSettings.getProperty("AltManorSavePeriodRate","2"));
  1451. ALT_LOTTERY_PRIZE = Integer.parseInt(altSettings.getProperty("AltLotteryPrize","50000"));
  1452. ALT_LOTTERY_TICKET_PRICE = Integer.parseInt(altSettings.getProperty("AltLotteryTicketPrice","2000"));
  1453. ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery5NumberRate","0.6"));
  1454. ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery4NumberRate","0.2"));
  1455. ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery3NumberRate","0.2"));
  1456. ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Integer.parseInt(altSettings.getProperty("AltLottery2and1NumberPrize","200"));
  1457. BUFFS_MAX_AMOUNT = Byte.parseByte(altSettings.getProperty("maxbuffamount","24"));
  1458. ALT_DEV_NO_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoQuests", "False"));
  1459. ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoSpawns", "False"));
  1460. // Dimensional Rift Config
  1461. RIFT_MIN_PARTY_SIZE = Integer.parseInt(altSettings.getProperty("RiftMinPartySize", "5"));
  1462. RIFT_MAX_JUMPS = Integer.parseInt(altSettings.getProperty("MaxRiftJumps", "4"));
  1463. RIFT_SPAWN_DELAY = Integer.parseInt(altSettings.getProperty("RiftSpawnDelay", "10000"));
  1464. RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMin", "480"));
  1465. RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMax", "600"));
  1466. RIFT_ENTER_COST_RECRUIT = Integer.parseInt(altSettings.getProperty("RecruitCost", "18"));
  1467. RIFT_ENTER_COST_SOLDIER = Integer.parseInt(altSettings.getProperty("SoldierCost", "21"));
  1468. RIFT_ENTER_COST_OFFICER = Integer.parseInt(altSettings.getProperty("OfficerCost", "24"));
  1469. RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(altSettings.getProperty("CaptainCost", "27"));
  1470. RIFT_ENTER_COST_COMMANDER = Integer.parseInt(altSettings.getProperty("CommanderCost", "30"));
  1471. RIFT_ENTER_COST_HERO = Integer.parseInt(altSettings.getProperty("HeroCost", "33"));
  1472. RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(altSettings.getProperty("BossRoomTimeMultiply", "1.5"));
  1473. }
  1474. catch (Exception e)
  1475. {
  1476. e.printStackTrace();
  1477. throw new Error("Failed to Load "+ALT_SETTINGS_FILE+" File.");
  1478. }
  1479. // Seven Signs Config
  1480. try
  1481. {
  1482. Properties SevenSettings = new Properties();
  1483. InputStream is = new FileInputStream(new File(SEVENSIGNS_FILE));
  1484. SevenSettings.load(is);
  1485. is.close();
  1486. ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.parseBoolean(SevenSettings.getProperty("AltRequireCastleForDawn", "False"));
  1487. ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(SevenSettings.getProperty("AltRequireClanCastle", "False"));
  1488. ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(SevenSettings.getProperty("AltFestivalMinPlayer", "5"));
  1489. ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(SevenSettings.getProperty("AltMaxPlayerContrib", "1000000"));
  1490. ALT_FESTIVAL_MANAGER_START = Long.parseLong(SevenSettings.getProperty("AltFestivalManagerStart", "120000"));
  1491. ALT_FESTIVAL_LENGTH = Long.parseLong(SevenSettings.getProperty("AltFestivalLength", "1080000"));
  1492. ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(SevenSettings.getProperty("AltFestivalCycleLength", "2280000"));
  1493. ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(SevenSettings.getProperty("AltFestivalFirstSpawn", "120000"));
  1494. ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(SevenSettings.getProperty("AltFestivalFirstSwarm", "300000"));
  1495. ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(SevenSettings.getProperty("AltFestivalSecondSpawn", "540000"));
  1496. ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(SevenSettings.getProperty("AltFestivalSecondSwarm", "720000"));
  1497. ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(SevenSettings.getProperty("AltFestivalChestSpawn", "900000"));
  1498. }
  1499. catch (Exception e)
  1500. {
  1501. e.printStackTrace();
  1502. throw new Error("Failed to Load "+SEVENSIGNS_FILE+" File.");
  1503. }
  1504. // clanhall settings
  1505. try
  1506. {
  1507. Properties clanhallSettings = new Properties();
  1508. InputStream is = new FileInputStream(new File(CLANHALL_CONFIG_FILE));
  1509. clanhallSettings.load(is);
  1510. is.close();
  1511. CH_TELE_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallTeleportFunctionFeeRation", "86400000"));
  1512. CH_TELE1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallTeleportFunctionFeeLvl1", "86400000"));
  1513. CH_TELE2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallTeleportFunctionFeeLvl2", "86400000"));
  1514. CH_SUPPORT_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallSupportFunctionFeeRation", "86400000"));
  1515. CH_SUPPORT1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl1", "86400000"));
  1516. CH_SUPPORT2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl2", "86400000"));
  1517. CH_SUPPORT3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl3", "86400000"));
  1518. CH_SUPPORT4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl4", "86400000"));
  1519. CH_SUPPORT5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl5", "86400000"));
  1520. CH_SUPPORT6_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl6", "86400000"));
  1521. CH_SUPPORT7_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl7", "86400000"));
  1522. CH_SUPPORT8_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl8", "86400000"));
  1523. CH_MPREG_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFunctionFeeRation", "86400000"));
  1524. CH_MPREG1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl1", "86400000"));
  1525. CH_MPREG2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl2", "86400000"));
  1526. CH_MPREG3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl3", "86400000"));
  1527. CH_MPREG4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl4", "86400000"));
  1528. CH_MPREG5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl5", "86400000"));
  1529. CH_HPREG_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFunctionFeeRation", "86400000"));
  1530. CH_HPREG1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl1", "86400000"));
  1531. CH_HPREG2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl2", "86400000"));
  1532. CH_HPREG3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl3", "86400000"));
  1533. CH_HPREG4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl4", "86400000"));
  1534. CH_HPREG5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl5", "86400000"));
  1535. CH_HPREG6_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl6", "86400000"));
  1536. CH_HPREG7_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl7", "86400000"));
  1537. CH_HPREG8_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl8", "86400000"));
  1538. CH_HPREG9_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl9", "86400000"));
  1539. CH_HPREG10_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl10", "86400000"));
  1540. CH_HPREG11_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl11", "86400000"));
  1541. CH_HPREG12_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl12", "86400000"));
  1542. CH_HPREG13_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl13", "86400000"));
  1543. CH_EXPREG_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFunctionFeeRation", "86400000"));
  1544. CH_EXPREG1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl1", "86400000"));
  1545. CH_EXPREG2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl2", "86400000"));
  1546. CH_EXPREG3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl3", "86400000"));
  1547. CH_EXPREG4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl4", "86400000"));
  1548. CH_EXPREG5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl5", "86400000"));
  1549. CH_EXPREG6_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl6", "86400000"));
  1550. CH_EXPREG7_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl7", "86400000"));
  1551. CH_ITEM_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeRation", "86400000"));
  1552. CH_ITEM1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeLvl1", "86400000"));
  1553. CH_ITEM2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeLvl2", "86400000"));
  1554. CH_ITEM3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeLvl3", "86400000"));
  1555. CH_CURTAIN_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallCurtainFunctionFeeRation", "86400000"));
  1556. CH_CURTAIN1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallCurtainFunctionFeeLvl1", "86400000"));
  1557. CH_CURTAIN2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallCurtainFunctionFeeLvl2", "86400000"));
  1558. CH_FRONT_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallFrontPlatformFunctionFeeRation", "86400000"));
  1559. CH_FRONT1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "86400000"));
  1560. CH_FRONT2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "86400000"));
  1561. }
  1562. catch (Exception e)
  1563. {
  1564. e.printStackTrace();
  1565. throw new Error("Failed to Load "+CLANHALL_CONFIG_FILE+" File.");
  1566. }
  1567. try
  1568. {
  1569. Properties L2JModSettings = new Properties();
  1570. InputStream is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
  1571. L2JModSettings.load(is);
  1572. is.close();
  1573. L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
  1574. L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
  1575. L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
  1576. L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
  1577. L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
  1578. L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
  1579. L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
  1580. L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
  1581. L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
  1582. L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
  1583. L2JMOD_CHAMPION_REWARD = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItem", "0"));
  1584. L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
  1585. L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
  1586. TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
  1587. TVT_EVENT_INTERVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventInterval", "18000"));
  1588. TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
  1589. TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
  1590. TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
  1591. /** L2JMOD Wedding system */
  1592. L2JMOD_ALLOW_WEDDING = Boolean.valueOf(L2JModSettings.getProperty("AllowWedding", "False"));
  1593. L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
  1594. L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
  1595. L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
  1596. L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
  1597. L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
  1598. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
  1599. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
  1600. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
  1601. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  1602. {
  1603. TVT_EVENT_ENABLED = false;
  1604. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
  1605. }
  1606. else
  1607. {
  1608. String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
  1609. if (propertySplit.length < 3)
  1610. {
  1611. TVT_EVENT_ENABLED = false;
  1612. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
  1613. }
  1614. else
  1615. {
  1616. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1617. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1618. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1619. TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
  1620. TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
  1621. TVT_EVENT_MIN_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
  1622. TVT_EVENT_MAX_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
  1623. TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
  1624. TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
  1625. TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
  1626. propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
  1627. if (propertySplit.length < 3)
  1628. {
  1629. TVT_EVENT_ENABLED = false;
  1630. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
  1631. }
  1632. else
  1633. {
  1634. TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1635. TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1636. TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1637. TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
  1638. propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
  1639. if (propertySplit.length < 3)
  1640. {
  1641. TVT_EVENT_ENABLED= false;
  1642. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
  1643. }
  1644. else
  1645. {
  1646. TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1647. TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1648. TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1649. propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
  1650. for (String reward : propertySplit)
  1651. {
  1652. String[] rewardSplit = reward.split(",");
  1653. if (rewardSplit.length != 2)
  1654. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
  1655. else
  1656. {
  1657. try
  1658. {
  1659. TVT_EVENT_REWARDS.add(new int[]{Integer.valueOf(rewardSplit[0]), Integer.valueOf(rewardSplit[1])});
  1660. }
  1661. catch (NumberFormatException nfe)
  1662. {
  1663. if (!reward.equals(""))
  1664. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
  1665. }
  1666. }
  1667. }
  1668. TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
  1669. TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
  1670. TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
  1671. propertySplit = L2JModSettings.getProperty("TvTEventDoorsCloseOpenOnStartEnd", "").split(";");
  1672. for (String door : propertySplit)
  1673. {
  1674. try
  1675. {
  1676. TVT_EVENT_DOOR_IDS.add(Integer.valueOf(door));
  1677. }
  1678. catch (NumberFormatException nfe)
  1679. {
  1680. if (!door.equals(""))
  1681. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventDoorsCloseOpenOnStartEnd \"" + door + "\"");
  1682. }
  1683. }
  1684. }
  1685. }
  1686. }
  1687. }
  1688. }
  1689. catch (Exception e)
  1690. {
  1691. e.printStackTrace();
  1692. throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File.");
  1693. }
  1694. // pvp config
  1695. try
  1696. {
  1697. Properties pvpSettings = new Properties();
  1698. InputStream is = new FileInputStream(new File(PVP_CONFIG_FILE));
  1699. pvpSettings.load(is);
  1700. is.close();
  1701. /* KARMA SYSTEM */
  1702. KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
  1703. KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
  1704. KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
  1705. KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
  1706. KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
  1707. KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
  1708. KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
  1709. KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650");
  1710. 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");
  1711. KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<Integer>();
  1712. for (String id : KARMA_NONDROPPABLE_PET_ITEMS.split(",")) {
  1713. KARMA_LIST_NONDROPPABLE_PET_ITEMS.add(Integer.parseInt(id));
  1714. }
  1715. KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  1716. for (String id : KARMA_NONDROPPABLE_ITEMS.split(",")) {
  1717. KARMA_LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
  1718. }
  1719. PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "15000"));
  1720. PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "30000"));
  1721. }
  1722. catch (Exception e)
  1723. {
  1724. e.printStackTrace();
  1725. throw new Error("Failed to Load "+PVP_CONFIG_FILE+" File.");
  1726. }
  1727. // access levels
  1728. try
  1729. {
  1730. Properties gmSettings = new Properties();
  1731. InputStream is = new FileInputStream(new File(GM_ACCESS_FILE));
  1732. gmSettings.load(is);
  1733. is.close();
  1734. GM_ACCESSLEVEL = Integer.parseInt(gmSettings.getProperty("GMAccessLevel", "100"));
  1735. GM_MIN = Integer.parseInt(gmSettings.getProperty("GMMinLevel", "100"));
  1736. GM_ALTG_MIN_LEVEL = Integer.parseInt(gmSettings.getProperty("GMCanAltG", "100"));
  1737. GM_ANNOUNCE = Integer.parseInt(gmSettings.getProperty("GMCanAnnounce", "100"));
  1738. GM_BAN = Integer.parseInt(gmSettings.getProperty("GMCanBan", "100"));
  1739. GM_BAN_CHAT = Integer.parseInt(gmSettings.getProperty("GMCanBanChat", "100"));
  1740. GM_CREATE_ITEM = Integer.parseInt(gmSettings.getProperty("GMCanShop", "100"));
  1741. GM_DELETE = Integer.parseInt(gmSettings.getProperty("GMCanDelete", "100"));
  1742. GM_KICK = Integer.parseInt(gmSettings.getProperty("GMCanKick", "100"));
  1743. GM_MENU = Integer.parseInt(gmSettings.getProperty("GMMenu", "100"));
  1744. GM_GODMODE = Integer.parseInt(gmSettings.getProperty("GMGodMode", "100"));
  1745. GM_CHAR_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditChar", "100"));
  1746. GM_CHAR_EDIT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanEditCharOther", "100"));
  1747. GM_CHAR_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewChar", "100"));
  1748. GM_NPC_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditNPC", "100"));
  1749. GM_NPC_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewNPC", "100"));
  1750. GM_TELEPORT = Integer.parseInt(gmSettings.getProperty("GMCanTeleport", "100"));
  1751. GM_TELEPORT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanTeleportOther", "100"));
  1752. GM_RESTART = Integer.parseInt(gmSettings.getProperty("GMCanRestart", "100"));
  1753. GM_MONSTERRACE = Integer.parseInt(gmSettings.getProperty("GMMonsterRace", "100"));
  1754. GM_RIDER = Integer.parseInt(gmSettings.getProperty("GMRider", "100"));
  1755. GM_ESCAPE = Integer.parseInt(gmSettings.getProperty("GMFastUnstuck", "100"));
  1756. GM_FIXED = Integer.parseInt(gmSettings.getProperty("GMResurectFixed", "100"));
  1757. GM_CREATE_NODES = Integer.parseInt(gmSettings.getProperty("GMCreateNodes", "100"));
  1758. GM_ENCHANT = Integer.parseInt(gmSettings.getProperty("GMEnchant", "100"));
  1759. GM_DOOR = Integer.parseInt(gmSettings.getProperty("GMDoor", "100"));
  1760. GM_RES = Integer.parseInt(gmSettings.getProperty("GMRes", "100"));
  1761. GM_PEACEATTACK = Integer.parseInt(gmSettings.getProperty("GMPeaceAttack", "100"));
  1762. GM_HEAL = Integer.parseInt(gmSettings.getProperty("GMHeal", "100"));
  1763. GM_UNBLOCK = Integer.parseInt(gmSettings.getProperty("GMUnblock", "100"));
  1764. GM_CACHE = Integer.parseInt(gmSettings.getProperty("GMCache", "100"));
  1765. GM_TALK_BLOCK = Integer.parseInt(gmSettings.getProperty("GMTalkBlock", "100"));
  1766. GM_TEST = Integer.parseInt(gmSettings.getProperty("GMTest", "100"));
  1767. String gmTrans = gmSettings.getProperty("GMDisableTransaction", "False");
  1768. if (!gmTrans.equalsIgnoreCase("false"))
  1769. {
  1770. String[] params = gmTrans.split(",");
  1771. GM_DISABLE_TRANSACTION = true;
  1772. GM_TRANSACTION_MIN = Integer.parseInt(params[0]);
  1773. GM_TRANSACTION_MAX = Integer.parseInt(params[1]);
  1774. }
  1775. else
  1776. {
  1777. GM_DISABLE_TRANSACTION = false;
  1778. }
  1779. GM_CAN_GIVE_DAMAGE = Integer.parseInt(gmSettings.getProperty("GMCanGiveDamage", "90"));
  1780. GM_DONT_TAKE_AGGRO = Integer.parseInt(gmSettings.getProperty("GMDontTakeAggro", "90"));
  1781. GM_DONT_TAKE_EXPSP = Integer.parseInt(gmSettings.getProperty("GMDontGiveExpSp", "90"));
  1782. }
  1783. catch (Exception e)
  1784. {
  1785. e.printStackTrace();
  1786. throw new Error("Failed to Load "+GM_ACCESS_FILE+" File.");
  1787. }
  1788. try
  1789. {
  1790. Properties Settings = new Properties();
  1791. InputStream is = new FileInputStream(HEXID_FILE);
  1792. Settings.load(is);
  1793. is.close();
  1794. SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
  1795. HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
  1796. }
  1797. catch (Exception e)
  1798. {
  1799. _log.warning("Could not load HexID file ("+HEXID_FILE+"). Hopefully login will give us one.");
  1800. }
  1801. }
  1802. else if(Server.serverMode == Server.MODE_LOGINSERVER)
  1803. {
  1804. _log.info("loading login config");
  1805. try
  1806. {
  1807. Properties serverSettings = new Properties();
  1808. InputStream is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
  1809. serverSettings.load(is);
  1810. is.close();
  1811. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");
  1812. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));
  1813. LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
  1814. PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
  1815. DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
  1816. DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
  1817. ASSERT = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));
  1818. ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
  1819. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  1820. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  1821. LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
  1822. LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
  1823. GM_MIN = Integer.parseInt(serverSettings.getProperty("GMMinLevel", "100"));
  1824. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); //FIXME: in login?
  1825. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
  1826. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
  1827. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  1828. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  1829. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  1830. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  1831. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  1832. SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
  1833. IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime","15"));
  1834. FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "false"));
  1835. AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));
  1836. FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
  1837. FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
  1838. NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
  1839. FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
  1840. MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
  1841. }
  1842. catch (Exception e)
  1843. {
  1844. e.printStackTrace();
  1845. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  1846. }
  1847. // telnet
  1848. try
  1849. {
  1850. Properties telnetSettings = new Properties();
  1851. InputStream is = new FileInputStream(new File(TELNET_FILE));
  1852. telnetSettings.load(is);
  1853. is.close();
  1854. IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "false"));
  1855. }
  1856. catch (Exception e)
  1857. {
  1858. e.printStackTrace();
  1859. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1860. }
  1861. }
  1862. else
  1863. {
  1864. _log.severe("Could not Load Config: server mode was not set");
  1865. }
  1866. }
  1867. /**
  1868. * Set a new value to a game parameter from the admin console.
  1869. * @param pName (String) : name of the parameter to change
  1870. * @param pValue (String) : new value of the parameter
  1871. * @return boolean : true if modification has been made
  1872. * @link useAdminCommand
  1873. */
  1874. public static boolean setParameterValue(String pName, String pValue)
  1875. {
  1876. // Server settings
  1877. if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
  1878. else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
  1879. else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
  1880. else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
  1881. else if (pName.equalsIgnoreCase("RateQuestsReward")) RATE_QUESTS_REWARD = Float.parseFloat(pValue);
  1882. else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ADENA = Float.parseFloat(pValue);
  1883. else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
  1884. else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
  1885. else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
  1886. else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
  1887. else if (pName.equalsIgnoreCase("RateDropQuest")) RATE_DROP_QUEST = Float.parseFloat(pValue);
  1888. else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
  1889. else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
  1890. else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
  1891. else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
  1892. else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
  1893. else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  1894. else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  1895. else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
  1896. else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
  1897. else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
  1898. else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  1899. else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  1900. else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
  1901. else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(pValue);
  1902. else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(pValue);
  1903. else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.valueOf(pValue);
  1904. else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(pValue);
  1905. else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
  1906. else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(pValue);
  1907. else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.valueOf(pValue);
  1908. else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.valueOf(pValue);
  1909. else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
  1910. else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
  1911. else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.valueOf(pValue);
  1912. else if (pName.equalsIgnoreCase("AllowFreight")) ALLOW_FREIGHT = Boolean.valueOf(pValue);
  1913. else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.valueOf(pValue);
  1914. else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.valueOf(pValue);
  1915. else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
  1916. else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
  1917. else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.valueOf(pValue);
  1918. else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.valueOf(pValue);
  1919. else if (pName.equalsIgnoreCase("AllowBoat")) ALLOW_BOAT = Boolean.valueOf(pValue);
  1920. else if (pName.equalsIgnoreCase("AllowCursedWeapons")) ALLOW_CURSED_WEAPONS = Boolean.valueOf(pValue);
  1921. else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.valueOf(pValue);
  1922. else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.valueOf(pValue);
  1923. else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = pValue.toLowerCase();
  1924. else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
  1925. else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(pValue);
  1926. else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(pValue);
  1927. else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
  1928. else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
  1929. else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.valueOf(pValue);
  1930. else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.valueOf(pValue);
  1931. else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.valueOf(pValue);
  1932. else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(pValue);
  1933. else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
  1934. else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);
  1935. else if (pName.equalsIgnoreCase("MaximumUpdateDistance")) MINIMUM_UPDATE_DISTANCE = Integer.parseInt(pValue);
  1936. else if (pName.equalsIgnoreCase("MinimumUpdateTime")) MINIMUN_UPDATE_TIME = Integer.parseInt(pValue);
  1937. else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.valueOf(pValue);
  1938. else if (pName.equalsIgnoreCase("KnownListForgetDelay")) KNOWNLIST_FORGET_DELAY = Integer.parseInt(pValue);
  1939. // Other settings
  1940. else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.valueOf(pValue);
  1941. else if (pName.equalsIgnoreCase("AllowGuards")) ALLOW_GUARDS = Boolean.valueOf(pValue);
  1942. else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.valueOf(pValue);
  1943. else if (pName.equalsIgnoreCase("WyvernSpeed")) WYVERN_SPEED = Integer.parseInt(pValue);
  1944. else if (pName.equalsIgnoreCase("StriderSpeed")) STRIDER_SPEED = Integer.parseInt(pValue);
  1945. else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
  1946. else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
  1947. else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
  1948. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
  1949. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
  1950. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
  1951. else if (pName.equalsIgnoreCase("MaximumFreightSlots")) FREIGHT_SLOTS = Integer.parseInt(pValue);
  1952. else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
  1953. else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
  1954. else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
  1955. else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
  1956. else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
  1957. else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
  1958. else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
  1959. else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
  1960. else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1961. else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1962. else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1963. else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1964. else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1965. else if (pName.equalsIgnoreCase("RaidDefenceMultiplier")) RAID_DEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  1966. else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
  1967. else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Integer.parseInt(pValue);
  1968. else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
  1969. else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
  1970. else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
  1971. else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
  1972. else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
  1973. else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
  1974. else if (pName.equalsIgnoreCase("RespawnRestoreCP")) RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
  1975. else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
  1976. else if (pName.equalsIgnoreCase("RespawnRestoreMP")) RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
  1977. else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsDwarf")) MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(pValue);
  1978. else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsOther")) MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(pValue);
  1979. else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.valueOf(pValue);
  1980. else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.valueOf(pValue);
  1981. // Alternative settings
  1982. else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.valueOf(pValue);
  1983. else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.valueOf(pValue);
  1984. else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
  1985. else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
  1986. else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
  1987. else if (pName.equalsIgnoreCase("AltWeightLimit")) ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
  1988. else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes")) ALT_BLACKSMITH_USE_RECIPES = Boolean.valueOf(pValue);
  1989. else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.valueOf(pValue);
  1990. else if (pName.equalsIgnoreCase("RemoveCastleCirclets")) REMOVE_CASTLE_CIRCLETS = Boolean.valueOf(pValue);
  1991. else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
  1992. {
  1993. ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
  1994. ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
  1995. }
  1996. else if (pName.equalsIgnoreCase("AltShieldBlocks")) ALT_GAME_SHIELD_BLOCKS = Boolean.valueOf(pValue);
  1997. else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
  1998. else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.valueOf(pValue);
  1999. else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.valueOf(pValue);
  2000. else if (pName.equalsIgnoreCase("AltGameMobAttackAI")) ALT_GAME_MOB_ATTACK_AI = Boolean.valueOf(pValue);
  2001. else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone")) ALT_MOB_AGRO_IN_PEACEZONE = Boolean.valueOf(pValue);
  2002. else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
  2003. else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
  2004. else if (pName.equalsIgnoreCase("AllowClassMasters")) ALLOW_CLASS_MASTERS = Boolean.valueOf(pValue);
  2005. else if (pName.equalsIgnoreCase("AltGameFreights")) ALT_GAME_FREIGHTS = Boolean.valueOf(pValue);
  2006. else if (pName.equalsIgnoreCase("AltGameFreightPrice")) ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue);
  2007. else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
  2008. else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
  2009. else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.valueOf(pValue);
  2010. else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.valueOf(pValue);
  2011. else if (pName.equalsIgnoreCase("SpBookNeeded")) SP_BOOK_NEEDED = Boolean.valueOf(pValue);
  2012. else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.valueOf(pValue);
  2013. else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.valueOf(pValue);
  2014. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(pValue);
  2015. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(pValue);
  2016. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(pValue);
  2017. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(pValue);
  2018. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(pValue);
  2019. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(pValue);
  2020. else if (pName.equalsIgnoreCase("AltRequireCastleForDawn")) ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.valueOf(pValue);
  2021. else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.valueOf(pValue);
  2022. else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.valueOf(pValue);
  2023. else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.valueOf(pValue);
  2024. else if (pName.equalsIgnoreCase("AltNewCharAlwaysIsNewbie")) ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.valueOf(pValue);
  2025. else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.valueOf(pValue);
  2026. else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
  2027. else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
  2028. //ChampionMobs L2JMOD
  2029. else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE = Boolean.valueOf(pValue);
  2030. else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
  2031. else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
  2032. else if (pName.equalsIgnoreCase("ChampionMaxLevel")) L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
  2033. else if (pName.equalsIgnoreCase("ChampionHp")) L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
  2034. else if (pName.equalsIgnoreCase("ChampionHpRegen")) L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
  2035. else if (pName.equalsIgnoreCase("ChampionRewards")) L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
  2036. else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(pValue);
  2037. else if (pName.equalsIgnoreCase("ChampionAtk")) L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
  2038. else if (pName.equalsIgnoreCase("ChampionSpdAtk")) L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
  2039. else if (pName.equalsIgnoreCase("ChampionRewardItem")) L2JMOD_CHAMPION_REWARD = Integer.parseInt(pValue);
  2040. else if (pName.equalsIgnoreCase("ChampionRewardItemID")) L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
  2041. else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
  2042. // L2JMOD Wedding System
  2043. else if (pName.equalsIgnoreCase("AllowWedding")) L2JMOD_ALLOW_WEDDING = Boolean.valueOf(pValue);
  2044. else if (pName.equalsIgnoreCase("WeddingPrice")) L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
  2045. else if (pName.equalsIgnoreCase("WeddingPunishInfidelity")) L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
  2046. else if (pName.equalsIgnoreCase("WeddingTeleport")) L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
  2047. else if (pName.equalsIgnoreCase("WeddingTeleportPrice")) L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
  2048. else if (pName.equalsIgnoreCase("WeddingTeleportDuration")) L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
  2049. else if (pName.equalsIgnoreCase("WeddingAllowSameSex")) L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
  2050. else if (pName.equalsIgnoreCase("WeddingFormalWear")) L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
  2051. else if (pName.equalsIgnoreCase("WeddingDivorceCosts")) L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
  2052. else if (pName.equalsIgnoreCase("TvTEventEnabled")) TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  2053. else if (pName.equalsIgnoreCase("TvTEventInterval")) TVT_EVENT_INTERVAL = Integer.parseInt(pValue);
  2054. else if (pName.equalsIgnoreCase("TvTEventParticipationTime")) TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  2055. else if (pName.equalsIgnoreCase("TvTEventRunningTime")) TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  2056. else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId")) TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  2057. // PvP settings
  2058. else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
  2059. else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
  2060. else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
  2061. else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);
  2062. else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.valueOf(pValue);
  2063. else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.valueOf(pValue);
  2064. else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);
  2065. else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
  2066. else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
  2067. else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
  2068. else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
  2069. else if (pName.equalsIgnoreCase("MenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
  2070. else return false;
  2071. return true;
  2072. }
  2073. /**
  2074. * Allow the player to use L2Walker ?
  2075. * @param player (L2PcInstance) : Player trying to use L2Walker
  2076. * @return boolean : true if (L2Walker allowed as a general rule) or (L2Walker client allowed for GM and
  2077. * player is a GM)
  2078. */
  2079. public static boolean allowL2Walker(L2PcInstance player)
  2080. {
  2081. return (ALLOW_L2WALKER_CLIENT == L2WalkerAllowed.True ||
  2082. (ALLOW_L2WALKER_CLIENT == L2WalkerAllowed.GM && player != null && player.isGM()));
  2083. }
  2084. // it has no instances
  2085. private Config() {}
  2086. /**
  2087. * Save hexadecimal ID of the server in the properties file.
  2088. * @param string (String) : hexadecimal ID of the server to store
  2089. * @see HEXID_FILE
  2090. * @see saveHexid(String string, String fileName)
  2091. * @link LoginServerThread
  2092. */
  2093. public static void saveHexid(int serverId, String string)
  2094. {
  2095. Config.saveHexid(serverId, string, HEXID_FILE);
  2096. }
  2097. /**
  2098. * Save hexadecimal ID of the server in the properties file.
  2099. * @param hexId (String) : hexadecimal ID of the server to store
  2100. * @param fileName (String) : name of the properties file
  2101. */
  2102. public static void saveHexid(int serverId, String hexId, String fileName)
  2103. {
  2104. try
  2105. {
  2106. Properties hexSetting = new Properties();
  2107. File file = new File(fileName);
  2108. //Create a new empty file only if it doesn't exist
  2109. file.createNewFile();
  2110. OutputStream out = new FileOutputStream(file);
  2111. hexSetting.setProperty("ServerID",String.valueOf(serverId));
  2112. hexSetting.setProperty("HexID",hexId);
  2113. hexSetting.store(out,"the hexID to auth into login");
  2114. out.close();
  2115. }
  2116. catch (Exception e)
  2117. {
  2118. _log.warning("Failed to save hex id to "+fileName+" File.");
  2119. e.printStackTrace();
  2120. }
  2121. }
  2122. }