Config.java 161 KB

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