2
0

Config.java 151 KB

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