Config.java 153 KB

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