Config.java 174 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver;
  16. import gnu.trove.TIntFloatHashMap;
  17. import gnu.trove.TIntIntHashMap;
  18. import gnu.trove.TIntObjectHashMap;
  19. import java.io.BufferedReader;
  20. import java.io.File;
  21. import java.io.FileInputStream;
  22. import java.io.FileOutputStream;
  23. import java.io.FileReader;
  24. import java.io.InputStream;
  25. import java.io.LineNumberReader;
  26. import java.io.OutputStream;
  27. import java.math.BigInteger;
  28. import java.util.ArrayList;
  29. import java.util.Arrays;
  30. import java.util.List;
  31. import java.util.StringTokenizer;
  32. import java.util.logging.Logger;
  33. import javolution.util.FastList;
  34. import com.l2jserver.gameserver.util.FloodProtectorConfig;
  35. import com.l2jserver.gameserver.util.StringUtil;
  36. import com.l2jserver.util.L2Properties;
  37. public final class Config
  38. {
  39. protected static final Logger _log = Logger.getLogger(Config.class.getName());
  40. //--------------------------------------------------
  41. // L2J Property File Definitions
  42. //--------------------------------------------------
  43. public static final String CHARACTER_CONFIG_FILE = "./config/Character.properties";
  44. public static final String EXTENSIONS_CONFIG_FILE = "./config/extensions.properties";
  45. public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
  46. public static final String FORTSIEGE_CONFIGURATION_FILE = "./config/fortsiege.properties";
  47. public static final String GENERAL_CONFIG_FILE = "./config/General.properties";
  48. public static final String HEXID_FILE = "./config/hexid.txt";
  49. public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
  50. public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
  51. public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
  52. public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
  53. public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
  54. public static final String NPC_CONFIG_FILE = "./config/NPC.properties";
  55. public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
  56. public static final String RATES_CONFIG_FILE = "./config/rates.properties";
  57. public static final String CONFIGURATION_FILE = "./config/server.properties";
  58. public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
  59. public static final String TELNET_FILE = "./config/telnet.properties";
  60. public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
  61. public static final String MMO_CONFIG_FILE = "./config/mmo.properties";
  62. public static final String OLYMPIAD_CONFIG_FILE = "./config/olympiad.properties";
  63. public static final String COMMUNITY_CONFIGURATION_FILE = "./config/CommunityServer.properties";
  64. public static final String GRANDBOSS_CONFIG_FILE = "./config/Grandboss.properties";
  65. public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
  66. //--------------------------------------------------
  67. // L2J Variable Definitions
  68. //--------------------------------------------------
  69. public static int MASTERACCESS_LEVEL;
  70. public static int MASTERACCESS_NAME_COLOR;
  71. public static int MASTERACCESS_TITLE_COLOR;
  72. public static boolean ALT_GAME_DELEVEL;
  73. public static double ALT_WEIGHT_LIMIT;
  74. public static int RUN_SPD_BOOST;
  75. public static int DEATH_PENALTY_CHANCE;
  76. public static double RESPAWN_RESTORE_CP;
  77. public static double RESPAWN_RESTORE_HP;
  78. public static double RESPAWN_RESTORE_MP;
  79. public static boolean ALT_GAME_TIREDNESS;
  80. public static boolean ENABLE_MODIFY_SKILL_DURATION;
  81. public static TIntIntHashMap SKILL_DURATION_LIST;
  82. public static boolean ENABLE_MODIFY_SKILL_REUSE;
  83. public static TIntIntHashMap SKILL_REUSE_LIST;
  84. public static boolean AUTO_LEARN_SKILLS;
  85. public static boolean AUTO_LOOT_HERBS;
  86. public static byte BUFFS_MAX_AMOUNT;
  87. public static byte DANCES_MAX_AMOUNT;
  88. public static boolean DANCE_CANCEL_BUFF;
  89. public static boolean DANCE_CONSUME_ADDITIONAL_MP;
  90. public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
  91. public static boolean ALT_GAME_CANCEL_BOW;
  92. public static boolean ALT_GAME_CANCEL_CAST;
  93. public static boolean EFFECT_CANCELING;
  94. public static boolean ALT_GAME_MAGICFAILURES;
  95. public static int PLAYER_FAKEDEATH_UP_PROTECTION;
  96. public static boolean STORE_SKILL_COOLTIME;
  97. public static boolean SUBCLASS_STORE_SKILL_COOLTIME;
  98. public static boolean ALT_GAME_SHIELD_BLOCKS;
  99. public static int ALT_PERFECT_SHLD_BLOCK;
  100. public static boolean ALLOW_CLASS_MASTERS;
  101. public static ClassMasterSettings CLASS_MASTER_SETTINGS;
  102. public static boolean ALLOW_ENTIRE_TREE;
  103. public static boolean ALTERNATE_CLASS_MASTER;
  104. public static boolean LIFE_CRYSTAL_NEEDED;
  105. public static boolean SP_BOOK_NEEDED;
  106. public static boolean ES_SP_BOOK_NEEDED;
  107. public static boolean DIVINE_SP_BOOK_NEEDED;
  108. public static boolean ALT_GAME_SKILL_LEARN;
  109. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  110. public static boolean ALT_GAME_SUBCLASS_EVERYWHERE;
  111. public static int MAX_RUN_SPEED;
  112. public static int MAX_PCRIT_RATE;
  113. public static int MAX_MCRIT_RATE;
  114. public static int MAX_PATK_SPEED;
  115. public static int MAX_MATK_SPEED;
  116. public static int MAX_EVASION;
  117. public static byte MAX_SUBCLASS;
  118. public static byte MAX_SUBCLASS_LEVEL;
  119. public static int MAX_PVTSTORESELL_SLOTS_DWARF;
  120. public static int MAX_PVTSTORESELL_SLOTS_OTHER;
  121. public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
  122. public static int MAX_PVTSTOREBUY_SLOTS_OTHER;
  123. public static int INVENTORY_MAXIMUM_NO_DWARF;
  124. public static int INVENTORY_MAXIMUM_DWARF;
  125. public static int INVENTORY_MAXIMUM_GM;
  126. public static int WAREHOUSE_SLOTS_DWARF;
  127. public static int WAREHOUSE_SLOTS_NO_DWARF;
  128. public static int WAREHOUSE_SLOTS_CLAN;
  129. public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
  130. public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
  131. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
  132. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
  133. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
  134. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
  135. public static int MAX_PERSONAL_FAME_POINTS;
  136. public static int FORTRESS_ZONE_FAME_TASK_FREQUENCY;
  137. public static int FORTRESS_ZONE_FAME_AQUIRE_POINTS;
  138. public static int CASTLE_ZONE_FAME_TASK_FREQUENCY;
  139. public static int CASTLE_ZONE_FAME_AQUIRE_POINTS;
  140. public static boolean FAME_FOR_DEAD_PLAYERS;
  141. public static boolean IS_CRAFTING_ENABLED;
  142. public static boolean CRAFT_MASTERWORK;
  143. public static int DWARF_RECIPE_LIMIT;
  144. public static int COMMON_RECIPE_LIMIT;
  145. public static boolean ALT_GAME_CREATION;
  146. public static double ALT_GAME_CREATION_SPEED;
  147. public static double ALT_GAME_CREATION_XP_RATE;
  148. public static double ALT_GAME_CREATION_RARE_XPSP_RATE;
  149. public static double ALT_GAME_CREATION_SP_RATE;
  150. public static boolean ALT_BLACKSMITH_USE_RECIPES;
  151. public static int ALT_CLAN_JOIN_DAYS;
  152. public static int ALT_CLAN_CREATE_DAYS;
  153. public static int ALT_CLAN_DISSOLVE_DAYS;
  154. public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
  155. public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
  156. public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
  157. public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
  158. public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
  159. public static int ALT_CLAN_MEMBERS_FOR_WAR;
  160. public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
  161. public static boolean REMOVE_CASTLE_CIRCLETS;
  162. public static int ALT_PARTY_RANGE;
  163. public static int ALT_PARTY_RANGE2;
  164. public static long STARTING_ADENA;
  165. public static byte STARTING_LEVEL;
  166. public static int STARTING_SP;
  167. public static boolean AUTO_LOOT;
  168. public static boolean AUTO_LOOT_RAIDS;
  169. public static int LOOT_RAIDS_PRIVILEGE_INTERVAL;
  170. public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE;
  171. public static int UNSTUCK_INTERVAL;
  172. public static int TELEPORT_WATCHDOG_TIMEOUT;
  173. public static int PLAYER_SPAWN_PROTECTION;
  174. public static boolean RESPAWN_RANDOM_ENABLED;
  175. public static int RESPAWN_RANDOM_MAX_OFFSET;
  176. public static boolean RESTORE_PLAYER_INSTANCE;
  177. public static boolean ALLOW_SUMMON_TO_INSTANCE;
  178. public static boolean PETITIONING_ALLOWED;
  179. public static int MAX_PETITIONS_PER_PLAYER;
  180. public static int MAX_PETITIONS_PENDING;
  181. public static boolean ALT_GAME_FREE_TELEPORT;
  182. public static boolean ALT_RECOMMEND;
  183. public static int DELETE_DAYS;
  184. public static float ALT_GAME_EXPONENT_XP;
  185. public static float ALT_GAME_EXPONENT_SP;
  186. public static String PARTY_XP_CUTOFF_METHOD;
  187. public static double PARTY_XP_CUTOFF_PERCENT;
  188. public static int PARTY_XP_CUTOFF_LEVEL;
  189. public static boolean DISABLE_TUTORIAL;
  190. public static boolean EXPERTISE_PENALTY;
  191. public static boolean STORE_RECIPE_SHOPLIST;
  192. public static boolean STORE_UI_SETTINGS;
  193. //--------------------------------------------------
  194. // ClanHall Settings
  195. //--------------------------------------------------
  196. public static long CH_TELE_FEE_RATIO;
  197. public static int CH_TELE1_FEE;
  198. public static int CH_TELE2_FEE;
  199. public static long CH_ITEM_FEE_RATIO;
  200. public static int CH_ITEM1_FEE;
  201. public static int CH_ITEM2_FEE;
  202. public static int CH_ITEM3_FEE;
  203. public static long CH_MPREG_FEE_RATIO;
  204. public static int CH_MPREG1_FEE;
  205. public static int CH_MPREG2_FEE;
  206. public static int CH_MPREG3_FEE;
  207. public static int CH_MPREG4_FEE;
  208. public static int CH_MPREG5_FEE;
  209. public static long CH_HPREG_FEE_RATIO;
  210. public static int CH_HPREG1_FEE;
  211. public static int CH_HPREG2_FEE;
  212. public static int CH_HPREG3_FEE;
  213. public static int CH_HPREG4_FEE;
  214. public static int CH_HPREG5_FEE;
  215. public static int CH_HPREG6_FEE;
  216. public static int CH_HPREG7_FEE;
  217. public static int CH_HPREG8_FEE;
  218. public static int CH_HPREG9_FEE;
  219. public static int CH_HPREG10_FEE;
  220. public static int CH_HPREG11_FEE;
  221. public static int CH_HPREG12_FEE;
  222. public static int CH_HPREG13_FEE;
  223. public static long CH_EXPREG_FEE_RATIO;
  224. public static int CH_EXPREG1_FEE;
  225. public static int CH_EXPREG2_FEE;
  226. public static int CH_EXPREG3_FEE;
  227. public static int CH_EXPREG4_FEE;
  228. public static int CH_EXPREG5_FEE;
  229. public static int CH_EXPREG6_FEE;
  230. public static int CH_EXPREG7_FEE;
  231. public static long CH_SUPPORT_FEE_RATIO;
  232. public static int CH_SUPPORT1_FEE;
  233. public static int CH_SUPPORT2_FEE;
  234. public static int CH_SUPPORT3_FEE;
  235. public static int CH_SUPPORT4_FEE;
  236. public static int CH_SUPPORT5_FEE;
  237. public static int CH_SUPPORT6_FEE;
  238. public static int CH_SUPPORT7_FEE;
  239. public static int CH_SUPPORT8_FEE;
  240. public static long CH_CURTAIN_FEE_RATIO;
  241. public static int CH_CURTAIN1_FEE;
  242. public static int CH_CURTAIN2_FEE;
  243. public static long CH_FRONT_FEE_RATIO;
  244. public static int CH_FRONT1_FEE;
  245. public static int CH_FRONT2_FEE;
  246. //--------------------------------------------------
  247. // Castle Settings
  248. //--------------------------------------------------
  249. public static long CS_TELE_FEE_RATIO;
  250. public static int CS_TELE1_FEE;
  251. public static int CS_TELE2_FEE;
  252. public static long CS_MPREG_FEE_RATIO;
  253. public static int CS_MPREG1_FEE;
  254. public static int CS_MPREG2_FEE;
  255. public static int CS_MPREG3_FEE;
  256. public static int CS_MPREG4_FEE;
  257. public static long CS_HPREG_FEE_RATIO;
  258. public static int CS_HPREG1_FEE;
  259. public static int CS_HPREG2_FEE;
  260. public static int CS_HPREG3_FEE;
  261. public static int CS_HPREG4_FEE;
  262. public static int CS_HPREG5_FEE;
  263. public static long CS_EXPREG_FEE_RATIO;
  264. public static int CS_EXPREG1_FEE;
  265. public static int CS_EXPREG2_FEE;
  266. public static int CS_EXPREG3_FEE;
  267. public static int CS_EXPREG4_FEE;
  268. public static long CS_SUPPORT_FEE_RATIO;
  269. public static int CS_SUPPORT1_FEE;
  270. public static int CS_SUPPORT2_FEE;
  271. public static int CS_SUPPORT3_FEE;
  272. public static int CS_SUPPORT4_FEE;
  273. public static List<String> CL_SET_SIEGE_TIME_LIST;
  274. public static List<Integer> SIEGE_HOUR_LIST_MORNING;
  275. public static List<Integer> SIEGE_HOUR_LIST_AFTERNOON;
  276. //--------------------------------------------------
  277. // Fortress Settings
  278. //--------------------------------------------------
  279. public static long FS_TELE_FEE_RATIO;
  280. public static int FS_TELE1_FEE;
  281. public static int FS_TELE2_FEE;
  282. public static long FS_MPREG_FEE_RATIO;
  283. public static int FS_MPREG1_FEE;
  284. public static int FS_MPREG2_FEE;
  285. public static long FS_HPREG_FEE_RATIO;
  286. public static int FS_HPREG1_FEE;
  287. public static int FS_HPREG2_FEE;
  288. public static long FS_EXPREG_FEE_RATIO;
  289. public static int FS_EXPREG1_FEE;
  290. public static int FS_EXPREG2_FEE;
  291. public static long FS_SUPPORT_FEE_RATIO;
  292. public static int FS_SUPPORT1_FEE;
  293. public static int FS_SUPPORT2_FEE;
  294. public static int FS_BLOOD_OATH_COUNT;
  295. public static int FS_BLOOD_OATH_FRQ;
  296. //--------------------------------------------------
  297. // Feature Settings
  298. //--------------------------------------------------
  299. public static int TAKE_FORT_POINTS;
  300. public static int LOOSE_FORT_POINTS;
  301. public static int TAKE_CASTLE_POINTS;
  302. public static int LOOSE_CASTLE_POINTS;
  303. public static int CASTLE_DEFENDED_POINTS;
  304. public static int FESTIVAL_WIN_POINTS;
  305. public static int HERO_POINTS;
  306. public static int ROYAL_GUARD_COST;
  307. public static int KNIGHT_UNIT_COST;
  308. public static int KNIGHT_REINFORCE_COST;
  309. public static int BALLISTA_POINTS;
  310. public static int BLOODALLIANCE_POINTS;
  311. public static int BLOODOATH_POINTS;
  312. public static int KNIGHTSEPAULETTE_POINTS;
  313. public static int REPUTATION_SCORE_PER_KILL;
  314. public static int JOIN_ACADEMY_MIN_REP_SCORE;
  315. public static int JOIN_ACADEMY_MAX_REP_SCORE;
  316. public static int RAID_RANKING_1ST;
  317. public static int RAID_RANKING_2ND;
  318. public static int RAID_RANKING_3RD;
  319. public static int RAID_RANKING_4TH;
  320. public static int RAID_RANKING_5TH;
  321. public static int RAID_RANKING_6TH;
  322. public static int RAID_RANKING_7TH;
  323. public static int RAID_RANKING_8TH;
  324. public static int RAID_RANKING_9TH;
  325. public static int RAID_RANKING_10TH;
  326. public static int RAID_RANKING_UP_TO_50TH;
  327. public static int RAID_RANKING_UP_TO_100TH;
  328. public static int CLAN_LEVEL_6_COST;
  329. public static int CLAN_LEVEL_7_COST;
  330. public static int CLAN_LEVEL_8_COST;
  331. public static int CLAN_LEVEL_9_COST;
  332. public static int CLAN_LEVEL_10_COST;
  333. public static int CLAN_LEVEL_11_COST;
  334. public static int CLAN_LEVEL_6_REQUIREMENT;
  335. public static int CLAN_LEVEL_7_REQUIREMENT;
  336. public static int CLAN_LEVEL_8_REQUIREMENT;
  337. public static int CLAN_LEVEL_9_REQUIREMENT;
  338. public static int CLAN_LEVEL_10_REQUIREMENT;
  339. public static int CLAN_LEVEL_11_REQUIREMENT;
  340. public static boolean ALLOW_WYVERN_DURING_SIEGE;
  341. //--------------------------------------------------
  342. // General Settings
  343. //--------------------------------------------------
  344. public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
  345. public static boolean DISPLAY_SERVER_VERSION;
  346. public static boolean SERVER_LIST_BRACKET;
  347. public static boolean SERVER_LIST_CLOCK;
  348. public static boolean SERVER_GMONLY;
  349. public static boolean GM_HERO_AURA;
  350. public static boolean GM_STARTUP_INVULNERABLE;
  351. public static boolean GM_STARTUP_INVISIBLE;
  352. public static boolean GM_STARTUP_SILENCE;
  353. public static boolean GM_STARTUP_AUTO_LIST;
  354. public static boolean GM_STARTUP_DIET_MODE;
  355. public static String GM_ADMIN_MENU_STYLE;
  356. public static boolean GM_ITEM_RESTRICTION;
  357. public static boolean GM_SKILL_RESTRICTION;
  358. public static boolean GM_TRADE_RESTRICTED_ITEMS;
  359. public static boolean GM_RESTART_FIGHTING;
  360. public static boolean GM_ANNOUNCER_NAME;
  361. public static boolean GM_GIVE_SPECIAL_SKILLS;
  362. public static boolean BYPASS_VALIDATION;
  363. public static boolean GAMEGUARD_ENFORCE;
  364. public static boolean GAMEGUARD_PROHIBITACTION;
  365. public static boolean LOG_CHAT;
  366. public static boolean LOG_ITEMS;
  367. public static boolean LOG_ITEM_ENCHANTS;
  368. public static boolean LOG_SKILL_ENCHANTS;
  369. public static boolean GMAUDIT;
  370. public static boolean LOG_GAME_DAMAGE;
  371. public static int LOG_GAME_DAMAGE_THRESHOLD;
  372. public static boolean DEBUG;
  373. public static boolean PACKET_HANDLER_DEBUG;
  374. public static boolean DEVELOPER;
  375. public static boolean ACCEPT_GEOEDITOR_CONN;
  376. public static boolean TEST_SERVER;
  377. public static boolean ALT_DEV_NO_HANDLERS;
  378. public static boolean ALT_DEV_NO_QUESTS;
  379. public static boolean ALT_DEV_NO_SPAWNS;
  380. public static boolean SERVER_LIST_TESTSERVER;
  381. public static int THREAD_P_EFFECTS;
  382. public static int THREAD_P_GENERAL;
  383. public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  384. public static int IO_PACKET_THREAD_CORE_SIZE;
  385. public static int GENERAL_THREAD_CORE_SIZE;
  386. public static int AI_MAX_THREAD;
  387. public static boolean DEADLOCK_DETECTOR;
  388. public static int DEADLOCK_CHECK_INTERVAL;
  389. public static boolean RESTART_ON_DEADLOCK;
  390. public static boolean ALLOW_DISCARDITEM;
  391. public static int AUTODESTROY_ITEM_AFTER;
  392. public static int HERB_AUTO_DESTROY_TIME;
  393. public static String PROTECTED_ITEMS;
  394. public static List<Integer> LIST_PROTECTED_ITEMS = new ArrayList<Integer>();
  395. public static int CHAR_STORE_INTERVAL;
  396. public static boolean LAZY_ITEMS_UPDATE;
  397. public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
  398. public static boolean DESTROY_DROPPED_PLAYER_ITEM;
  399. public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
  400. public static boolean SAVE_DROPPED_ITEM;
  401. public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
  402. public static int SAVE_DROPPED_ITEM_INTERVAL;
  403. public static boolean CLEAR_DROPPED_ITEM_TABLE;
  404. public static boolean AUTODELETE_INVALID_QUEST_DATA;
  405. public static boolean PRECISE_DROP_CALCULATION;
  406. public static boolean MULTIPLE_ITEM_DROP;
  407. public static boolean FORCE_INVENTORY_UPDATE;
  408. public static boolean LAZY_CACHE;
  409. public static boolean CACHE_CHAR_NAMES;
  410. public static int MIN_NPC_ANIMATION;
  411. public static int MAX_NPC_ANIMATION;
  412. public static int MIN_MONSTER_ANIMATION;
  413. public static int MAX_MONSTER_ANIMATION;
  414. public static int COORD_SYNCHRONIZE;
  415. public static boolean GRIDS_ALWAYS_ON;
  416. public static int GRID_NEIGHBOR_TURNON_TIME;
  417. public static int GRID_NEIGHBOR_TURNOFF_TIME;
  418. public static int GEODATA;
  419. public static boolean GEODATA_CELLFINDING;
  420. public static boolean FORCE_GEODATA;
  421. public static boolean MOVE_BASED_KNOWNLIST;
  422. public static long KNOWNLIST_UPDATE_INTERVAL;
  423. public static int ZONE_TOWN;
  424. public static boolean ACTIVATE_POSITION_RECORDER;
  425. public static String DEFAULT_GLOBAL_CHAT;
  426. public static String DEFAULT_TRADE_CHAT;
  427. public static boolean ALLOW_WAREHOUSE;
  428. public static boolean WAREHOUSE_CACHE;
  429. public static int WAREHOUSE_CACHE_TIME;
  430. public static boolean ALLOW_REFUND;
  431. public static boolean ALLOW_MAIL;
  432. public static boolean ALLOW_ATTACHMENTS;
  433. public static boolean ALLOW_WEAR;
  434. public static int WEAR_DELAY;
  435. public static int WEAR_PRICE;
  436. public static boolean ALLOW_LOTTERY;
  437. public static boolean ALLOW_RACE;
  438. public static boolean ALLOW_WATER;
  439. public static boolean ALLOW_RENTPET;
  440. public static boolean ALLOWFISHING;
  441. public static boolean ALLOW_BOAT;
  442. public static boolean ALLOW_CURSED_WEAPONS;
  443. public static boolean ALLOW_MANOR;
  444. public static boolean ALLOW_NPC_WALKERS;
  445. public static boolean ALLOW_PET_WALKERS;
  446. public static boolean SERVER_NEWS;
  447. public static int COMMUNITY_TYPE;
  448. public static boolean BBS_SHOW_PLAYERLIST;
  449. public static String BBS_DEFAULT;
  450. public static boolean SHOW_LEVEL_COMMUNITYBOARD;
  451. public static boolean SHOW_STATUS_COMMUNITYBOARD;
  452. public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
  453. public static int NAME_PER_ROW_COMMUNITYBOARD;
  454. public static boolean USE_SAY_FILTER;
  455. public static String CHAT_FILTER_CHARS;
  456. public static int ALT_OLY_START_TIME;
  457. public static int ALT_OLY_MIN;
  458. public static long ALT_OLY_CPERIOD;
  459. public static long ALT_OLY_BATTLE;
  460. public static long ALT_OLY_WPERIOD;
  461. public static long ALT_OLY_VPERIOD;
  462. public static int ALT_OLY_CLASSED;
  463. public static int ALT_OLY_NONCLASSED;
  464. public static int ALT_OLY_REG_DISPLAY;
  465. public static int ALT_OLY_BATTLE_REWARD_ITEM;
  466. public static int ALT_OLY_CLASSED_RITEM_C;
  467. public static int ALT_OLY_NONCLASSED_RITEM_C;
  468. public static int ALT_OLY_COMP_RITEM;
  469. public static int ALT_OLY_GP_PER_POINT;
  470. public static int ALT_OLY_HERO_POINTS;
  471. public static int ALT_OLY_RANK1_POINTS;
  472. public static int ALT_OLY_RANK2_POINTS;
  473. public static int ALT_OLY_RANK3_POINTS;
  474. public static int ALT_OLY_RANK4_POINTS;
  475. public static int ALT_OLY_RANK5_POINTS;
  476. public static int ALT_OLY_MAX_POINTS;
  477. public static boolean ALT_OLY_LOG_FIGHTS;
  478. public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
  479. public static boolean ALT_OLY_ANNOUNCE_GAMES;
  480. public static List<Integer> LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
  481. public static int ALT_OLY_ENCHANT_LIMIT;
  482. public static int ALT_MANOR_REFRESH_TIME;
  483. public static int ALT_MANOR_REFRESH_MIN;
  484. public static int ALT_MANOR_APPROVE_TIME;
  485. public static int ALT_MANOR_APPROVE_MIN;
  486. public static int ALT_MANOR_MAINTENANCE_PERIOD;
  487. public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
  488. public static int ALT_MANOR_SAVE_PERIOD_RATE;
  489. public static long ALT_LOTTERY_PRIZE;
  490. public static long ALT_LOTTERY_TICKET_PRICE;
  491. public static float ALT_LOTTERY_5_NUMBER_RATE;
  492. public static float ALT_LOTTERY_4_NUMBER_RATE;
  493. public static float ALT_LOTTERY_3_NUMBER_RATE;
  494. public static long ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
  495. public static int FS_TIME_ATTACK;
  496. public static int FS_TIME_COOLDOWN;
  497. public static int FS_TIME_ENTRY;
  498. public static int FS_TIME_WARMUP;
  499. public static int FS_PARTY_MEMBER_COUNT;
  500. public static int RIFT_MIN_PARTY_SIZE;
  501. public static int RIFT_SPAWN_DELAY;
  502. public static int RIFT_MAX_JUMPS;
  503. public static int RIFT_AUTO_JUMPS_TIME_MIN;
  504. public static int RIFT_AUTO_JUMPS_TIME_MAX;
  505. public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
  506. public static int RIFT_ENTER_COST_RECRUIT;
  507. public static int RIFT_ENTER_COST_SOLDIER;
  508. public static int RIFT_ENTER_COST_OFFICER;
  509. public static int RIFT_ENTER_COST_CAPTAIN;
  510. public static int RIFT_ENTER_COST_COMMANDER;
  511. public static int RIFT_ENTER_COST_HERO;
  512. public static int DEFAULT_PUNISH;
  513. public static int DEFAULT_PUNISH_PARAM;
  514. public static boolean ONLY_GM_ITEMS_FREE;
  515. public static boolean JAIL_IS_PVP;
  516. public static boolean JAIL_DISABLE_CHAT;
  517. public static boolean JAIL_DISABLE_TRANSACTION;
  518. public static boolean CUSTOM_SPAWNLIST_TABLE;
  519. public static boolean SAVE_GMSPAWN_ON_CUSTOM;
  520. public static boolean DELETE_GMSPAWN_ON_CUSTOM;
  521. public static boolean CUSTOM_NPC_TABLE;
  522. public static boolean CUSTOM_ITEM_TABLES;
  523. public static boolean CUSTOM_ARMORSETS_TABLE;
  524. public static boolean CUSTOM_TELEPORT_TABLE;
  525. public static boolean CUSTOM_DROPLIST_TABLE;
  526. public static boolean CUSTOM_MERCHANT_TABLES;
  527. public static boolean CUSTOM_NPCBUFFER_TABLES;
  528. //--------------------------------------------------
  529. // FloodProtector Settings
  530. //--------------------------------------------------
  531. public static final FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM =
  532. new FloodProtectorConfig("UseItemFloodProtector");
  533. public static final FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE =
  534. new FloodProtectorConfig("RollDiceFloodProtector");
  535. public static final FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK =
  536. new FloodProtectorConfig("FireworkFloodProtector");
  537. public static final FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON =
  538. new FloodProtectorConfig("ItemPetSummonFloodProtector");
  539. public static final FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE =
  540. new FloodProtectorConfig("HeroVoiceFloodProtector");
  541. public static final FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT =
  542. new FloodProtectorConfig("GlobalChatFloodProtector");
  543. public static final FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS =
  544. new FloodProtectorConfig("SubclassFloodProtector");
  545. public static final FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM =
  546. new FloodProtectorConfig("DropItemFloodProtector");
  547. public static final FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS =
  548. new FloodProtectorConfig("ServerBypassFloodProtector");
  549. public static final FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL =
  550. new FloodProtectorConfig("MultiSellFloodProtector");
  551. public static final FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION =
  552. new FloodProtectorConfig("TransactionFloodProtector");
  553. public static final FloodProtectorConfig FLOOD_PROTECTOR_SENDMAIL =
  554. new FloodProtectorConfig("SendMailFloodProtector");
  555. //--------------------------------------------------
  556. // L2JMods Settings
  557. //--------------------------------------------------
  558. public static boolean L2JMOD_CHAMPION_ENABLE;
  559. public static boolean L2JMOD_CHAMPION_PASSIVE;
  560. public static int L2JMOD_CHAMPION_FREQUENCY;
  561. public static String L2JMOD_CHAMP_TITLE;
  562. public static int L2JMOD_CHAMP_MIN_LVL;
  563. public static int L2JMOD_CHAMP_MAX_LVL;
  564. public static int L2JMOD_CHAMPION_HP;
  565. public static int L2JMOD_CHAMPION_REWARDS;
  566. public static float L2JMOD_CHAMPION_ADENAS_REWARDS;
  567. public static float L2JMOD_CHAMPION_HP_REGEN;
  568. public static float L2JMOD_CHAMPION_ATK;
  569. public static float L2JMOD_CHAMPION_SPD_ATK;
  570. public static int L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
  571. public static int L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
  572. public static int L2JMOD_CHAMPION_REWARD_ID;
  573. public static int L2JMOD_CHAMPION_REWARD_QTY;
  574. public static boolean L2JMOD_CHAMPION_ENABLE_VITALITY;
  575. public static boolean TVT_EVENT_ENABLED;
  576. public static boolean TVT_EVENT_IN_INSTANCE;
  577. public static String TVT_EVENT_INSTANCE_FILE;
  578. public static String[] TVT_EVENT_INTERVAL;
  579. public static int TVT_EVENT_PARTICIPATION_TIME;
  580. public static int TVT_EVENT_RUNNING_TIME;
  581. public static int TVT_EVENT_PARTICIPATION_NPC_ID;
  582. public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  583. public static int[] TVT_EVENT_PARTICIPATION_FEE = new int[2];
  584. public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
  585. public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
  586. public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
  587. public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
  588. public static String TVT_EVENT_TEAM_1_NAME;
  589. public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  590. public static String TVT_EVENT_TEAM_2_NAME;
  591. public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  592. public static List<int[]> TVT_EVENT_REWARDS = new FastList<int[]>();
  593. public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  594. public static boolean TVT_EVENT_SCROLL_ALLOWED;
  595. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  596. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  597. public static List<Integer> TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  598. public static List<Integer> TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  599. public static boolean TVT_REWARD_TEAM_TIE;
  600. public static byte TVT_EVENT_MIN_LVL;
  601. public static byte TVT_EVENT_MAX_LVL;
  602. public static int TVT_EVENT_EFFECTS_REMOVAL;
  603. public static TIntIntHashMap TVT_EVENT_FIGHTER_BUFFS;
  604. public static TIntIntHashMap TVT_EVENT_MAGE_BUFFS;
  605. public static boolean TVT_ALLOW_VOICED_COMMAND;
  606. public static boolean L2JMOD_ALLOW_WEDDING;
  607. public static int L2JMOD_WEDDING_PRICE;
  608. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  609. public static boolean L2JMOD_WEDDING_TELEPORT;
  610. public static int L2JMOD_WEDDING_TELEPORT_PRICE;
  611. public static int L2JMOD_WEDDING_TELEPORT_DURATION;
  612. public static boolean L2JMOD_WEDDING_SAMESEX;
  613. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  614. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  615. public static boolean BANKING_SYSTEM_ENABLED;
  616. public static int BANKING_SYSTEM_GOLDBARS;
  617. public static int BANKING_SYSTEM_ADENA;
  618. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
  619. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
  620. public static boolean OFFLINE_TRADE_ENABLE;
  621. public static boolean OFFLINE_CRAFT_ENABLE;
  622. public static boolean OFFLINE_SET_NAME_COLOR;
  623. public static int OFFLINE_NAME_COLOR;
  624. public static boolean OFFLINE_FAME;
  625. public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
  626. public static boolean L2JMOD_DISPLAY_SERVER_TIME;
  627. public static boolean WELCOME_MESSAGE_ENABLED;
  628. public static String WELCOME_MESSAGE_TEXT;
  629. public static int WELCOME_MESSAGE_TIME;
  630. public static boolean L2JMOD_ANTIFEED_ENABLE;
  631. public static boolean L2JMOD_ANTIFEED_DUALBOX;
  632. public static boolean L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX;
  633. public static int L2JMOD_ANTIFEED_INTERVAL;
  634. public static boolean ANNOUNCE_PK_PVP;
  635. public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE;
  636. public static String ANNOUNCE_PK_MSG;
  637. public static String ANNOUNCE_PVP_MSG;
  638. public static boolean L2JMOD_CHAT_ADMIN;
  639. public static boolean L2JMOD_MULTILANG_ENABLE;
  640. public static List<String> L2JMOD_MULTILANG_ALLOWED = new ArrayList<String>();
  641. public static String L2JMOD_MULTILANG_DEFAULT;
  642. public static boolean L2JMOD_MULTILANG_VOICED_ALLOW;
  643. //--------------------------------------------------
  644. // NPC Settings
  645. //--------------------------------------------------
  646. public static boolean ANNOUNCE_MAMMON_SPAWN;
  647. public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
  648. public static boolean ALT_ATTACKABLE_NPCS;
  649. public static boolean ALT_GAME_VIEWNPC;
  650. public static int MAX_DRIFT_RANGE;
  651. public static boolean DEEPBLUE_DROP_RULES;
  652. public static boolean DEEPBLUE_DROP_RULES_RAID;
  653. public static boolean SHOW_NPC_LVL;
  654. public static boolean SHOW_CREST_WITHOUT_QUEST;
  655. public static boolean ENABLE_RANDOM_ENCHANT_EFFECT;
  656. public static int MIN_NPC_LVL_DMG_PENALTY;
  657. public static int MIN_NPC_LVL_MAGIC_PENALTY;
  658. public static boolean GUARD_ATTACK_AGGRO_MOB;
  659. public static boolean ALLOW_WYVERN_UPGRADER;
  660. public static String PET_RENT_NPC;
  661. public static List<Integer> LIST_PET_RENT_NPC = new FastList<Integer>();
  662. public static double RAID_HP_REGEN_MULTIPLIER;
  663. public static double RAID_MP_REGEN_MULTIPLIER;
  664. public static double RAID_PDEFENCE_MULTIPLIER;
  665. public static double RAID_MDEFENCE_MULTIPLIER;
  666. public static double RAID_MINION_RESPAWN_TIMER;
  667. public static float RAID_MIN_RESPAWN_MULTIPLIER;
  668. public static float RAID_MAX_RESPAWN_MULTIPLIER;
  669. public static boolean RAID_DISABLE_CURSE;
  670. public static int RAID_CHAOS_TIME;
  671. public static int GRAND_CHAOS_TIME;
  672. public static int MINION_CHAOS_TIME;
  673. public static int INVENTORY_MAXIMUM_PET;
  674. public static double PET_HP_REGEN_MULTIPLIER;
  675. public static double PET_MP_REGEN_MULTIPLIER;
  676. //--------------------------------------------------
  677. // PvP Settings
  678. //--------------------------------------------------
  679. public static int KARMA_MIN_KARMA;
  680. public static int KARMA_MAX_KARMA;
  681. public static int KARMA_XP_DIVIDER;
  682. public static int KARMA_LOST_BASE;
  683. public static boolean KARMA_DROP_GM;
  684. public static boolean KARMA_AWARD_PK_KILL;
  685. public static int KARMA_PK_LIMIT;
  686. public static String KARMA_NONDROPPABLE_PET_ITEMS;
  687. public static String KARMA_NONDROPPABLE_ITEMS;
  688. public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS;
  689. public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
  690. //--------------------------------------------------
  691. // Rate Settings
  692. //--------------------------------------------------
  693. public static float RATE_XP;
  694. public static float RATE_SP;
  695. public static float RATE_PARTY_XP;
  696. public static float RATE_PARTY_SP;
  697. public static float RATE_CONSUMABLE_COST;
  698. public static float RATE_EXTR_FISH;
  699. public static float RATE_DROP_ITEMS;
  700. public static float RATE_DROP_ITEMS_BY_RAID;
  701. public static float RATE_DROP_SPOIL;
  702. public static int RATE_DROP_MANOR;
  703. public static float RATE_QUEST_DROP;
  704. public static float RATE_QUEST_REWARD;
  705. public static float RATE_QUEST_REWARD_XP;
  706. public static float RATE_QUEST_REWARD_SP;
  707. public static float RATE_QUEST_REWARD_ADENA;
  708. public static boolean RATE_QUEST_REWARD_USE_MULTIPLIERS;
  709. public static float RATE_QUEST_REWARD_POTION;
  710. public static float RATE_QUEST_REWARD_SCROLL;
  711. public static float RATE_QUEST_REWARD_RECIPE;
  712. public static float RATE_QUEST_REWARD_MATERIAL;
  713. public static TIntFloatHashMap RATE_DROP_ITEMS_ID;
  714. public static float RATE_KARMA_EXP_LOST;
  715. public static float RATE_SIEGE_GUARDS_PRICE;
  716. public static float RATE_DROP_COMMON_HERBS;
  717. public static float RATE_DROP_MP_HP_HERBS;
  718. public static float RATE_DROP_GREATER_HERBS;
  719. public static float RATE_DROP_SUPERIOR_HERBS;
  720. public static float RATE_DROP_SPECIAL_HERBS;
  721. public static int PLAYER_DROP_LIMIT;
  722. public static int PLAYER_RATE_DROP;
  723. public static int PLAYER_RATE_DROP_ITEM;
  724. public static int PLAYER_RATE_DROP_EQUIP;
  725. public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
  726. public static float PET_XP_RATE;
  727. public static int PET_FOOD_RATE;
  728. public static float SINEATER_XP_RATE;
  729. public static int KARMA_DROP_LIMIT;
  730. public static int KARMA_RATE_DROP;
  731. public static int KARMA_RATE_DROP_ITEM;
  732. public static int KARMA_RATE_DROP_EQUIP;
  733. public static int KARMA_RATE_DROP_EQUIP_WEAPON;
  734. public static double[] PLAYER_XP_PERCENT_LOST;
  735. //--------------------------------------------------
  736. // Seven Signs Settings
  737. //--------------------------------------------------
  738. public static boolean ALT_GAME_CASTLE_DAWN;
  739. public static boolean ALT_GAME_CASTLE_DUSK;
  740. public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
  741. public static int ALT_FESTIVAL_MIN_PLAYER;
  742. public static int ALT_MAXIMUM_PLAYER_CONTRIB;
  743. public static long ALT_FESTIVAL_MANAGER_START;
  744. public static long ALT_FESTIVAL_LENGTH;
  745. public static long ALT_FESTIVAL_CYCLE_LENGTH;
  746. public static long ALT_FESTIVAL_FIRST_SPAWN;
  747. public static long ALT_FESTIVAL_FIRST_SWARM;
  748. public static long ALT_FESTIVAL_SECOND_SPAWN;
  749. public static long ALT_FESTIVAL_SECOND_SWARM;
  750. public static long ALT_FESTIVAL_CHEST_SPAWN;
  751. public static double ALT_SIEGE_DAWN_GATES_PDEF_MULT;
  752. public static double ALT_SIEGE_DUSK_GATES_PDEF_MULT;
  753. public static double ALT_SIEGE_DAWN_GATES_MDEF_MULT;
  754. public static double ALT_SIEGE_DUSK_GATES_MDEF_MULT;
  755. public static boolean ALT_STRICT_SEVENSIGNS;
  756. //--------------------------------------------------
  757. // Server Settings
  758. //--------------------------------------------------
  759. public static int PORT_GAME;
  760. public static int PORT_LOGIN;
  761. public static String LOGIN_BIND_ADDRESS;
  762. public static int LOGIN_TRY_BEFORE_BAN;
  763. public static int LOGIN_BLOCK_AFTER_BAN;
  764. public static String GAMESERVER_HOSTNAME;
  765. public static String DATABASE_DRIVER;
  766. public static String DATABASE_URL;
  767. public static String DATABASE_LOGIN;
  768. public static String DATABASE_PASSWORD;
  769. public static int DATABASE_MAX_CONNECTIONS;
  770. public static int DATABASE_MAX_IDLE_TIME;
  771. public static int MAXIMUM_ONLINE_USERS;
  772. public static String CNAME_TEMPLATE;
  773. public static String PET_NAME_TEMPLATE;
  774. public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
  775. public static File DATAPACK_ROOT;
  776. public static boolean ACCEPT_ALTERNATE_ID;
  777. public static int REQUEST_ID;
  778. public static boolean RESERVE_HOST_ON_LOGIN = false;
  779. public static int MIN_PROTOCOL_REVISION;
  780. public static int MAX_PROTOCOL_REVISION;
  781. public static boolean LOG_LOGIN_CONTROLLER;
  782. //--------------------------------------------------
  783. // CommunityServer Settings
  784. //--------------------------------------------------
  785. public static boolean ENABLE_COMMUNITY_BOARD;
  786. public static String COMMUNITY_SERVER_ADDRESS;
  787. public static int COMMUNITY_SERVER_PORT;
  788. public static byte[] COMMUNITY_SERVER_HEX_ID;
  789. public static int COMMUNITY_SERVER_SQL_DP_ID;
  790. //--------------------------------------------------
  791. // MMO Settings
  792. //--------------------------------------------------
  793. public static int MMO_SELECTOR_SLEEP_TIME;
  794. public static int MMO_MAX_SEND_PER_PASS;
  795. public static int MMO_MAX_READ_PER_PASS;
  796. public static int MMO_HELPER_BUFFER_COUNT;
  797. public static int MMO_IO_SELECTOR_THREAD_COUNT;
  798. //--------------------------------------------------
  799. // Vitality Settings
  800. //--------------------------------------------------
  801. public static boolean ENABLE_VITALITY;
  802. public static boolean RECOVER_VITALITY_ON_RECONNECT;
  803. public static boolean ENABLE_DROP_VITALITY_HERBS;
  804. public static float RATE_VITALITY_LEVEL_1;
  805. public static float RATE_VITALITY_LEVEL_2;
  806. public static float RATE_VITALITY_LEVEL_3;
  807. public static float RATE_VITALITY_LEVEL_4;
  808. public static float RATE_DROP_VITALITY_HERBS;
  809. public static float RATE_RECOVERY_VITALITY_PEACE_ZONE;
  810. public static float RATE_VITALITY_LOST;
  811. public static float RATE_VITALITY_GAIN;
  812. public static float RATE_RECOVERY_ON_RECONNECT;
  813. //--------------------------------------------------
  814. // No classification assigned to the following yet
  815. //--------------------------------------------------
  816. public static int MAX_ITEM_IN_PACKET;
  817. public static boolean CHECK_KNOWN;
  818. public static int GAME_SERVER_LOGIN_PORT;
  819. public static String GAME_SERVER_LOGIN_HOST;
  820. public static String INTERNAL_HOSTNAME;
  821. public static String EXTERNAL_HOSTNAME;
  822. public static String ROUTER_HOSTNAME;
  823. public static int NEW_NODE_ID;
  824. public static int SELECTED_NODE_ID;
  825. public static int LINKED_NODE_ID;
  826. public static String NEW_NODE_TYPE;
  827. public static int IP_UPDATE_TIME;
  828. public static String SERVER_VERSION;
  829. public static String SERVER_BUILD_DATE;
  830. public static String DATAPACK_VERSION;
  831. public static int PVP_NORMAL_TIME;
  832. public static int PVP_PVP_TIME;
  833. public static enum IdFactoryType
  834. {
  835. Compaction,
  836. BitSet,
  837. Stack
  838. }
  839. public static IdFactoryType IDFACTORY_TYPE;
  840. public static boolean BAD_ID_CHECKING;
  841. public static enum ObjectMapType
  842. {
  843. L2ObjectHashMap,
  844. WorldObjectMap
  845. }
  846. public static enum ObjectSetType
  847. {
  848. L2ObjectHashSet,
  849. WorldObjectSet
  850. }
  851. public static ObjectMapType MAP_TYPE;
  852. public static ObjectSetType SET_TYPE;
  853. public static int ENCHANT_CHANCE_WEAPON;
  854. public static int ENCHANT_CHANCE_ARMOR;
  855. public static int ENCHANT_CHANCE_JEWELRY;
  856. public static int ENCHANT_CHANCE_ELEMENT;
  857. public static int BLESSED_ENCHANT_CHANCE_WEAPON;
  858. public static int BLESSED_ENCHANT_CHANCE_ARMOR;
  859. public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
  860. public static int ENCHANT_MAX_WEAPON;
  861. public static int ENCHANT_MAX_ARMOR;
  862. public static int ENCHANT_MAX_JEWELRY;
  863. public static int ENCHANT_SAFE_MAX;
  864. public static int ENCHANT_SAFE_MAX_FULL;
  865. public static int AUGMENTATION_NG_SKILL_CHANCE;
  866. public static int AUGMENTATION_NG_GLOW_CHANCE;
  867. public static int AUGMENTATION_MID_SKILL_CHANCE;
  868. public static int AUGMENTATION_MID_GLOW_CHANCE;
  869. public static int AUGMENTATION_HIGH_SKILL_CHANCE;
  870. public static int AUGMENTATION_HIGH_GLOW_CHANCE;
  871. public static int AUGMENTATION_TOP_SKILL_CHANCE;
  872. public static int AUGMENTATION_TOP_GLOW_CHANCE;
  873. public static int AUGMENTATION_BASESTAT_CHANCE;
  874. public static int AUGMENTATION_ACC_SKILL_CHANCE;
  875. public static int[] AUGMENTATION_BLACKLIST;
  876. public static double HP_REGEN_MULTIPLIER;
  877. public static double MP_REGEN_MULTIPLIER;
  878. public static double CP_REGEN_MULTIPLIER;
  879. public static boolean IS_TELNET_ENABLED;
  880. public static boolean SHOW_LICENCE;
  881. public static boolean FORCE_GGAUTH;
  882. public static boolean ACCEPT_NEW_GAMESERVER;
  883. public static int SERVER_ID;
  884. public static byte[] HEX_ID;
  885. public static boolean AUTO_CREATE_ACCOUNTS;
  886. public static boolean FLOOD_PROTECTION;
  887. public static int FAST_CONNECTION_LIMIT;
  888. public static int NORMAL_CONNECTION_TIME;
  889. public static int FAST_CONNECTION_TIME;
  890. public static int MAX_CONNECTION_PER_IP;
  891. // GrandBoss Settings
  892. public static int Antharas_Wait_Time;
  893. public static int Valakas_Wait_Time;
  894. public static int Interval_Of_Antharas_Spawn;
  895. public static int Random_Of_Antharas_Spawn;
  896. public static int Interval_Of_Valakas_Spawn;
  897. public static int Random_Of_Valakas_Spawn;
  898. public static int Interval_Of_Baium_Spawn;
  899. public static int Random_Of_Baium_Spawn;
  900. public static int Interval_Of_Core_Spawn;
  901. public static int Random_Of_Core_Spawn;
  902. public static int Interval_Of_Orfen_Spawn;
  903. public static int Random_Of_Orfen_Spawn;
  904. public static int Interval_Of_QueenAnt_Spawn;
  905. public static int Random_Of_QueenAnt_Spawn;
  906. public static int Interval_Of_Zaken_Spawn;
  907. public static int Random_Of_Zaken_Spawn;
  908. //chatfilter
  909. public static ArrayList<String> FILTER_LIST;
  910. /**
  911. * This class initializes all global variables for configuration.<br>
  912. * If the key doesn't appear in properties file, a default value is set by this class.
  913. * @see CONFIGURATION_FILE (properties file) for configuring your server.
  914. */
  915. public static void load()
  916. {
  917. if(Server.serverMode == Server.MODE_GAMESERVER)
  918. {
  919. _log.info("Loading GameServer Configuration Files...");
  920. InputStream is = null;
  921. try
  922. {
  923. try
  924. {
  925. L2Properties serverSettings = new L2Properties();
  926. is = new FileInputStream(new File(CONFIGURATION_FILE));
  927. serverSettings.load(is);
  928. GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
  929. PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
  930. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
  931. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
  932. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
  933. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");
  934. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  935. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  936. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  937. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  938. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  939. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  940. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  941. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  942. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  943. CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
  944. PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
  945. MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
  946. MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
  947. MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
  948. MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
  949. if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
  950. {
  951. throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
  952. }
  953. }
  954. catch (Exception e)
  955. {
  956. e.printStackTrace();
  957. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  958. }
  959. // Load Community Properties file (if exists)
  960. try
  961. {
  962. L2Properties communityServerSettings = new L2Properties();
  963. is = new FileInputStream(new File(COMMUNITY_CONFIGURATION_FILE));
  964. communityServerSettings.load(is);
  965. ENABLE_COMMUNITY_BOARD = Boolean.parseBoolean(communityServerSettings.getProperty("EnableCommunityBoard", "False"));
  966. COMMUNITY_SERVER_ADDRESS = communityServerSettings.getProperty("CommunityServerHostname", "localhost");
  967. COMMUNITY_SERVER_PORT = Integer.parseInt(communityServerSettings.getProperty("CommunityServerPort", "9013"));
  968. COMMUNITY_SERVER_HEX_ID = new BigInteger(communityServerSettings.getProperty("CommunityServerHexId"), 16).toByteArray();
  969. COMMUNITY_SERVER_SQL_DP_ID = Integer.parseInt(communityServerSettings.getProperty("CommunityServerSqlDpId", "200"));
  970. }
  971. catch (Exception e)
  972. {
  973. e.printStackTrace();
  974. throw new Error("Failed to Load "+COMMUNITY_CONFIGURATION_FILE+" File.");
  975. }
  976. // Load Feature L2Properties file (if exists)
  977. try
  978. {
  979. L2Properties Feature = new L2Properties();
  980. is = new FileInputStream(new File(FEATURE_CONFIG_FILE));
  981. Feature.load(is);
  982. CH_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallTeleportFunctionFeeRatio", "604800000"));
  983. CH_TELE1_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "7000"));
  984. CH_TELE2_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "14000"));
  985. CH_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallSupportFunctionFeeRatio", "86400000"));
  986. CH_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl1", "2500"));
  987. CH_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl2", "5000"));
  988. CH_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl3", "7000"));
  989. CH_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl4", "11000"));
  990. CH_SUPPORT5_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl5", "21000"));
  991. CH_SUPPORT6_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl6", "36000"));
  992. CH_SUPPORT7_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl7", "37000"));
  993. CH_SUPPORT8_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl8", "52000"));
  994. CH_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRatio", "86400000"));
  995. CH_MPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "2000"));
  996. CH_MPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "3750"));
  997. CH_MPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "6500"));
  998. CH_MPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "13750"));
  999. CH_MPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "20000"));
  1000. CH_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRatio", "86400000"));
  1001. CH_HPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "700"));
  1002. CH_HPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "800"));
  1003. CH_HPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "1000"));
  1004. CH_HPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "1166"));
  1005. CH_HPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "1500"));
  1006. CH_HPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "1750"));
  1007. CH_HPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "2000"));
  1008. CH_HPREG8_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "2250"));
  1009. CH_HPREG9_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "2500"));
  1010. CH_HPREG10_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "3250"));
  1011. CH_HPREG11_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "3270"));
  1012. CH_HPREG12_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "4250"));
  1013. CH_HPREG13_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "5166"));
  1014. CH_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRatio", "86400000"));
  1015. CH_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "3000"));
  1016. CH_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "6000"));
  1017. CH_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "9000"));
  1018. CH_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "15000"));
  1019. CH_EXPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "21000"));
  1020. CH_EXPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "23330"));
  1021. CH_EXPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "30000"));
  1022. CH_ITEM_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallItemCreationFunctionFeeRatio", "86400000"));
  1023. CH_ITEM1_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "30000"));
  1024. CH_ITEM2_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "70000"));
  1025. CH_ITEM3_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "140000"));
  1026. CH_CURTAIN_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallCurtainFunctionFeeRatio", "604800000"));
  1027. CH_CURTAIN1_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "2000"));
  1028. CH_CURTAIN2_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "2500"));
  1029. CH_FRONT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRatio", "259200000"));
  1030. CH_FRONT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "1300"));
  1031. CH_FRONT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "4000"));
  1032. CL_SET_SIEGE_TIME_LIST = new FastList<String>();
  1033. SIEGE_HOUR_LIST_MORNING = new FastList<Integer>();
  1034. SIEGE_HOUR_LIST_AFTERNOON = new FastList<Integer>();
  1035. String[] sstl = Feature.getProperty("CLSetSiegeTimeList", "").split(",");
  1036. if (sstl.length != 0)
  1037. {
  1038. boolean isHour = false;
  1039. for (String st : sstl)
  1040. {
  1041. if (st.equalsIgnoreCase("day") || st.equalsIgnoreCase("hour") || st.equalsIgnoreCase("minute"))
  1042. {
  1043. if (st.equalsIgnoreCase("hour")) isHour = true;
  1044. CL_SET_SIEGE_TIME_LIST.add(st.toLowerCase());
  1045. }
  1046. else
  1047. {
  1048. _log.warning(StringUtil.concat("[CLSetSiegeTimeList]: invalid config property -> CLSetSiegeTimeList \"", st, "\""));
  1049. }
  1050. }
  1051. if (isHour)
  1052. {
  1053. String[] shl = Feature.getProperty("SiegeHourList", "").split(",");
  1054. for (String st : shl)
  1055. {
  1056. if (!st.equalsIgnoreCase(""))
  1057. {
  1058. int val = Integer.parseInt(st);
  1059. if (val > 23 || val < 0)
  1060. _log.warning(StringUtil.concat("[SiegeHourList]: invalid config property -> SiegeHourList \"", st, "\""));
  1061. else if (val < 12)
  1062. SIEGE_HOUR_LIST_MORNING.add(val);
  1063. else
  1064. {
  1065. val -= 12;
  1066. SIEGE_HOUR_LIST_AFTERNOON.add(val);
  1067. }
  1068. }
  1069. }
  1070. if (Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty() && Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty())
  1071. {
  1072. _log.warning("[SiegeHourList]: invalid config property -> SiegeHourList is empty");
  1073. CL_SET_SIEGE_TIME_LIST.remove("hour");
  1074. }
  1075. }
  1076. }
  1077. CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
  1078. CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
  1079. CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
  1080. CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
  1081. CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
  1082. CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
  1083. CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
  1084. CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
  1085. CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
  1086. CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
  1087. CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
  1088. CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
  1089. CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
  1090. CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
  1091. CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
  1092. CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
  1093. CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
  1094. CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl4", "3270"));
  1095. CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl5", "5166"));
  1096. CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
  1097. CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
  1098. CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
  1099. CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
  1100. CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));
  1101. FS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressTeleportFunctionFeeRatio", "604800000"));
  1102. FS_TELE1_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl1", "1000"));
  1103. FS_TELE2_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl2", "10000"));
  1104. FS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressSupportFunctionFeeRatio", "86400000"));
  1105. FS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl1", "7000"));
  1106. FS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl2", "17000"));
  1107. FS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressMpRegenerationFunctionFeeRatio", "86400000"));
  1108. FS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl1", "6500"));
  1109. FS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl2", "9300"));
  1110. FS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressHpRegenerationFunctionFeeRatio", "86400000"));
  1111. FS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl1", "2000"));
  1112. FS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl2", "3500"));
  1113. FS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressExpRegenerationFunctionFeeRatio", "86400000"));
  1114. FS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl1", "9000"));
  1115. FS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl2", "10000"));
  1116. FS_BLOOD_OATH_COUNT = Integer.parseInt(Feature.getProperty("FortressBloodOathCount", "1"));
  1117. FS_BLOOD_OATH_FRQ = Integer.parseInt(Feature.getProperty("FortressBloodOathFrequency", "360"));
  1118. ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltCastleForDawn", "True"));
  1119. ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(Feature.getProperty("AltCastleForDusk", "True"));
  1120. ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
  1121. ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
  1122. ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
  1123. ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
  1124. ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
  1125. ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
  1126. ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
  1127. ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));
  1128. ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
  1129. ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
  1130. ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
  1131. ALT_SIEGE_DAWN_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesPdefMult", "1.1"));
  1132. ALT_SIEGE_DUSK_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesPdefMult", "0.8"));
  1133. ALT_SIEGE_DAWN_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesMdefMult", "1.1"));
  1134. ALT_SIEGE_DUSK_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesMdefMult", "0.8"));
  1135. ALT_STRICT_SEVENSIGNS = Boolean.parseBoolean(Feature.getProperty("StrictSevenSigns", "True"));
  1136. TAKE_FORT_POINTS = Integer.parseInt(Feature.getProperty("TakeFortPoints", "200"));
  1137. LOOSE_FORT_POINTS = Integer.parseInt(Feature.getProperty("LooseFortPoints", "0"));
  1138. TAKE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("TakeCastlePoints", "1500"));
  1139. LOOSE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("LooseCastlePoints", "3000"));
  1140. CASTLE_DEFENDED_POINTS = Integer.parseInt(Feature.getProperty("CastleDefendedPoints", "750"));
  1141. FESTIVAL_WIN_POINTS = Integer.parseInt(Feature.getProperty("FestivalOfDarknessWin", "200"));
  1142. HERO_POINTS = Integer.parseInt(Feature.getProperty("HeroPoints", "1000"));
  1143. ROYAL_GUARD_COST = Integer.parseInt(Feature.getProperty("CreateRoyalGuardCost", "5000"));
  1144. KNIGHT_UNIT_COST = Integer.parseInt(Feature.getProperty("CreateKnightUnitCost", "10000"));
  1145. KNIGHT_REINFORCE_COST = Integer.parseInt(Feature.getProperty("ReinforceKnightUnitCost", "5000"));
  1146. BALLISTA_POINTS = Integer.parseInt(Feature.getProperty("KillBallistaPoints", "30"));
  1147. BLOODALLIANCE_POINTS = Integer.parseInt(Feature.getProperty("BloodAlliancePoints", "500"));
  1148. BLOODOATH_POINTS = Integer.parseInt(Feature.getProperty("BloodOathPoints", "200"));
  1149. KNIGHTSEPAULETTE_POINTS = Integer.parseInt(Feature.getProperty("KnightsEpaulettePoints", "20"));
  1150. REPUTATION_SCORE_PER_KILL = Integer.parseInt(Feature.getProperty("ReputationScorePerKill", "1"));
  1151. JOIN_ACADEMY_MIN_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMinPoints", "190"));
  1152. JOIN_ACADEMY_MAX_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMaxPoints", "650"));
  1153. RAID_RANKING_1ST = Integer.parseInt(Feature.getProperty("1stRaidRankingPoints", "1250"));
  1154. RAID_RANKING_2ND = Integer.parseInt(Feature.getProperty("2ndRaidRankingPoints", "900"));
  1155. RAID_RANKING_3RD = Integer.parseInt(Feature.getProperty("3rdRaidRankingPoints", "700"));
  1156. RAID_RANKING_4TH = Integer.parseInt(Feature.getProperty("4thRaidRankingPoints", "600"));
  1157. RAID_RANKING_5TH = Integer.parseInt(Feature.getProperty("5thRaidRankingPoints", "450"));
  1158. RAID_RANKING_6TH = Integer.parseInt(Feature.getProperty("6thRaidRankingPoints", "350"));
  1159. RAID_RANKING_7TH = Integer.parseInt(Feature.getProperty("7thRaidRankingPoints", "300"));
  1160. RAID_RANKING_8TH = Integer.parseInt(Feature.getProperty("8thRaidRankingPoints", "200"));
  1161. RAID_RANKING_9TH = Integer.parseInt(Feature.getProperty("9thRaidRankingPoints", "150"));
  1162. RAID_RANKING_10TH = Integer.parseInt(Feature.getProperty("10thRaidRankingPoints", "100"));
  1163. RAID_RANKING_UP_TO_50TH = Integer.parseInt(Feature.getProperty("UpTo50thRaidRankingPoints", "25"));
  1164. RAID_RANKING_UP_TO_100TH = Integer.parseInt(Feature.getProperty("UpTo100thRaidRankingPoints", "12"));
  1165. CLAN_LEVEL_6_COST = Integer.parseInt(Feature.getProperty("ClanLevel6Cost", "10000"));
  1166. CLAN_LEVEL_7_COST = Integer.parseInt(Feature.getProperty("ClanLevel7Cost", "20000"));
  1167. CLAN_LEVEL_8_COST = Integer.parseInt(Feature.getProperty("ClanLevel8Cost", "40000"));
  1168. CLAN_LEVEL_9_COST = Integer.parseInt(Feature.getProperty("ClanLevel9Cost", "40000"));
  1169. CLAN_LEVEL_10_COST = Integer.parseInt(Feature.getProperty("ClanLevel10Cost", "40000"));
  1170. CLAN_LEVEL_11_COST = Integer.parseInt(Feature.getProperty("ClanLevel11Cost", "75000"));
  1171. CLAN_LEVEL_6_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel6Requirement", "30"));
  1172. CLAN_LEVEL_7_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel7Requirement", "80"));
  1173. CLAN_LEVEL_8_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel8Requirement", "120"));
  1174. CLAN_LEVEL_9_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel9Requirement", "120"));
  1175. CLAN_LEVEL_10_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel10Requirement", "140"));
  1176. CLAN_LEVEL_11_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel11Requirement", "170"));
  1177. ALLOW_WYVERN_DURING_SIEGE = Boolean.parseBoolean(Feature.getProperty("AllowRideWyvernDuringSiege", "True"));
  1178. }
  1179. catch (Exception e)
  1180. {
  1181. e.printStackTrace();
  1182. throw new Error("Failed to Load "+FEATURE_CONFIG_FILE+" File.");
  1183. }
  1184. // Load Character L2Properties file (if exists)
  1185. try
  1186. {
  1187. L2Properties Character = new L2Properties();
  1188. is = new FileInputStream(new File(CHARACTER_CONFIG_FILE));
  1189. Character.load(is);
  1190. MASTERACCESS_LEVEL = Integer.parseInt(Character.getProperty("MasterAccessLevel", "127"));
  1191. MASTERACCESS_NAME_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterNameColor", "00FF00")));
  1192. MASTERACCESS_TITLE_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterTitleColor", "00FF00")));
  1193. ALT_GAME_DELEVEL = Boolean.parseBoolean(Character.getProperty("Delevel", "true"));
  1194. ALT_WEIGHT_LIMIT = Double.parseDouble(Character.getProperty("AltWeightLimit", "1"));
  1195. RUN_SPD_BOOST = Integer.parseInt(Character.getProperty("RunSpeedBoost", "0"));
  1196. DEATH_PENALTY_CHANCE = Integer.parseInt(Character.getProperty("DeathPenaltyChance", "20"));
  1197. RESPAWN_RESTORE_CP = Double.parseDouble(Character.getProperty("RespawnRestoreCP", "0")) / 100;
  1198. RESPAWN_RESTORE_HP = Double.parseDouble(Character.getProperty("RespawnRestoreHP", "70")) / 100;
  1199. RESPAWN_RESTORE_MP = Double.parseDouble(Character.getProperty("RespawnRestoreMP", "70")) / 100;
  1200. HP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("HpRegenMultiplier", "100")) /100;
  1201. MP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("MpRegenMultiplier", "100")) /100;
  1202. CP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("CpRegenMultiplier", "100")) /100;
  1203. ALT_GAME_TIREDNESS = Boolean.parseBoolean(Character.getProperty("AltGameTiredness", "false"));
  1204. ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(Character.getProperty("EnableModifySkillDuration", "false"));
  1205. // Create Map only if enabled
  1206. if (ENABLE_MODIFY_SKILL_DURATION)
  1207. {
  1208. String[] propertySplit = Character.getProperty("SkillDurationList", "").split(";");
  1209. SKILL_DURATION_LIST = new TIntIntHashMap(propertySplit.length);
  1210. for (String skill : propertySplit)
  1211. {
  1212. String[] skillSplit = skill.split(",");
  1213. if (skillSplit.length != 2)
  1214. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillDurationList \"", skill, "\""));
  1215. else
  1216. {
  1217. try
  1218. {
  1219. SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  1220. }
  1221. catch (NumberFormatException nfe)
  1222. {
  1223. if (!skill.isEmpty())
  1224. {
  1225. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1226. }
  1227. }
  1228. }
  1229. }
  1230. }
  1231. ENABLE_MODIFY_SKILL_REUSE = Boolean.parseBoolean(Character.getProperty("EnableModifySkillReuse", "false"));
  1232. // Create Map only if enabled
  1233. if (ENABLE_MODIFY_SKILL_REUSE)
  1234. {
  1235. String[] propertySplit = Character.getProperty("SkillReuseList", "").split(";");
  1236. SKILL_REUSE_LIST = new TIntIntHashMap(propertySplit.length);
  1237. for (String skill : propertySplit)
  1238. {
  1239. String[] skillSplit = skill.split(",");
  1240. if (skillSplit.length != 2)
  1241. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillReuseList \"", skill, "\""));
  1242. else
  1243. {
  1244. try
  1245. {
  1246. SKILL_REUSE_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
  1247. }
  1248. catch (NumberFormatException nfe)
  1249. {
  1250. if (!skill.isEmpty())
  1251. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1252. }
  1253. }
  1254. }
  1255. }
  1256. AUTO_LEARN_SKILLS = Boolean.parseBoolean(Character.getProperty("AutoLearnSkills", "false"));
  1257. AUTO_LOOT_HERBS = Boolean.parseBoolean(Character.getProperty("AutoLootHerbs", "false"));
  1258. BUFFS_MAX_AMOUNT = Byte.parseByte(Character.getProperty("maxbuffamount","20"));
  1259. DANCES_MAX_AMOUNT = Byte.parseByte(Character.getProperty("maxdanceamount","12"));
  1260. DANCE_CANCEL_BUFF = Boolean.parseBoolean(Character.getProperty("DanceCancelBuff", "false"));
  1261. DANCE_CONSUME_ADDITIONAL_MP = Boolean.parseBoolean(Character.getProperty("DanceConsumeAdditionalMP", "true"));
  1262. AUTO_LEARN_DIVINE_INSPIRATION = Boolean.parseBoolean(Character.getProperty("AutoLearnDivineInspiration", "false"));
  1263. ALT_GAME_CANCEL_BOW = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1264. ALT_GAME_CANCEL_CAST = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1265. EFFECT_CANCELING = Boolean.parseBoolean(Character.getProperty("CancelLesserEffect", "True"));
  1266. ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(Character.getProperty("MagicFailures", "true"));
  1267. PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(Character.getProperty("PlayerFakeDeathUpProtection", "0"));
  1268. STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("StoreSkillCooltime", "true"));
  1269. SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("SubclassStoreSkillCooltime", "false"));
  1270. ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(Character.getProperty("AltShieldBlocks", "false"));
  1271. ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(Character.getProperty("AltPerfectShieldBlockRate", "10"));
  1272. ALLOW_CLASS_MASTERS = Boolean.parseBoolean(Character.getProperty("AllowClassMasters", "False"));
  1273. ALLOW_ENTIRE_TREE = Boolean.parseBoolean(Character.getProperty("AllowEntireTree", "False"));
  1274. ALTERNATE_CLASS_MASTER = Boolean.parseBoolean(Character.getProperty("AlternateClassMaster", "False"));
  1275. if (ALLOW_CLASS_MASTERS || ALTERNATE_CLASS_MASTER)
  1276. CLASS_MASTER_SETTINGS = new ClassMasterSettings(Character.getProperty("ConfigClassMaster"));
  1277. LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(Character.getProperty("LifeCrystalNeeded", "true"));
  1278. SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("SpBookNeeded", "false"));
  1279. ES_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("EnchantSkillSpBookNeeded","true"));
  1280. DIVINE_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("DivineInspirationSpBookNeeded", "true"));
  1281. ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(Character.getProperty("AltGameSkillLearn", "false"));
  1282. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(Character.getProperty("AltSubClassWithoutQuests", "False"));
  1283. ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(Character.getProperty("AltSubclassEverywhere", "False"));
  1284. ENABLE_VITALITY = Boolean.parseBoolean(Character.getProperty("EnableVitality", "True"));
  1285. RECOVER_VITALITY_ON_RECONNECT = Boolean.parseBoolean(Character.getProperty("RecoverVitalityOnReconnect", "True"));
  1286. MAX_RUN_SPEED = Integer.parseInt(Character.getProperty("MaxRunSpeed", "250"));
  1287. MAX_PCRIT_RATE = Integer.parseInt(Character.getProperty("MaxPCritRate", "500"));
  1288. MAX_MCRIT_RATE = Integer.parseInt(Character.getProperty("MaxMCritRate", "200"));
  1289. MAX_PATK_SPEED = Integer.parseInt(Character.getProperty("MaxPAtkSpeed", "1500"));
  1290. MAX_MATK_SPEED = Integer.parseInt(Character.getProperty("MaxMAtkSpeed", "1999"));
  1291. MAX_EVASION = Integer.parseInt(Character.getProperty("MaxEvasion", "200"));
  1292. MAX_SUBCLASS = Byte.parseByte(Character.getProperty("MaxSubclass", "3"));
  1293. MAX_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("MaxSubclassLevel", "80"));
  1294. MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
  1295. MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsOther", "3"));
  1296. MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsDwarf", "5"));
  1297. MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsOther", "4"));
  1298. INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForNoDwarf", "80"));
  1299. INVENTORY_MAXIMUM_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForDwarf", "100"));
  1300. INVENTORY_MAXIMUM_GM = Integer.parseInt(Character.getProperty("MaximumSlotsForGMPlayer", "250"));
  1301. MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
  1302. WAREHOUSE_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
  1303. WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
  1304. WAREHOUSE_SLOTS_CLAN = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForClan", "150"));
  1305. ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("EnchantChanceWeapon", "66"));
  1306. ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("EnchantChanceArmor", "66"));
  1307. ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("EnchantChanceJewelry", "66"));
  1308. ENCHANT_CHANCE_ELEMENT = Integer.parseInt(Character.getProperty("EnchantChanceElement", "50"));
  1309. BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("BlessedEnchantChanceWeapon", "66"));
  1310. BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("BlessedEnchantChanceArmor", "66"));
  1311. BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("BlessedEnchantChanceJewelry", "66"));
  1312. ENCHANT_MAX_WEAPON = Integer.parseInt(Character.getProperty("EnchantMaxWeapon", "0"));
  1313. ENCHANT_MAX_ARMOR = Integer.parseInt(Character.getProperty("EnchantMaxArmor", "0"));
  1314. ENCHANT_MAX_JEWELRY = Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "0"));
  1315. ENCHANT_SAFE_MAX = Integer.parseInt(Character.getProperty("EnchantSafeMax", "3"));
  1316. ENCHANT_SAFE_MAX_FULL = Integer.parseInt(Character.getProperty("EnchantSafeMaxFull", "4"));
  1317. AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGSkillChance", "15"));
  1318. AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGGlowChance", "0"));
  1319. AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidSkillChance", "30"));
  1320. AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidGlowChance", "40"));
  1321. AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighSkillChance", "45"));
  1322. AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighGlowChance", "70"));
  1323. AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopSkillChance", "60"));
  1324. AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopGlowChance", "100"));
  1325. AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(Character.getProperty("AugmentationBaseStatChance", "1"));
  1326. AUGMENTATION_ACC_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationAccSkillChance", "0"));
  1327. String[] array = Character.getProperty("AugmentationBlackList", "6656,6657,6658,6659,6660,6661,6662,8191,10170,10314").split(",");
  1328. AUGMENTATION_BLACKLIST = new int[array.length];
  1329. for (int i = 0; i < array.length; i++)
  1330. AUGMENTATION_BLACKLIST[i] = Integer.parseInt(array[i]);
  1331. Arrays.sort(AUGMENTATION_BLACKLIST);
  1332. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
  1333. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanShop", "true"));
  1334. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTeleport", "true"));
  1335. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseGK", "false"));
  1336. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTrade", "true"));
  1337. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
  1338. MAX_PERSONAL_FAME_POINTS = Integer.parseInt(Character.getProperty("MaxPersonalFamePoints","65535"));
  1339. FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("FortressZoneFameTaskFrequency","300"));
  1340. FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("FortressZoneFameAquirePoints","31"));
  1341. CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("CastleZoneFameTaskFrequency","300"));
  1342. CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("CastleZoneFameAquirePoints","125"));
  1343. FAME_FOR_DEAD_PLAYERS = Boolean.parseBoolean(Character.getProperty("FameForDeadPlayers", "true"));
  1344. IS_CRAFTING_ENABLED = Boolean.parseBoolean(Character.getProperty("CraftingEnabled", "true"));
  1345. CRAFT_MASTERWORK = Boolean.parseBoolean(Character.getProperty("CraftMasterwork", "True"));
  1346. DWARF_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("DwarfRecipeLimit","50"));
  1347. COMMON_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("CommonRecipeLimit","50"));
  1348. ALT_GAME_CREATION = Boolean.parseBoolean(Character.getProperty("AltGameCreation", "false"));
  1349. ALT_GAME_CREATION_SPEED = Double.parseDouble(Character.getProperty("AltGameCreationSpeed", "1"));
  1350. ALT_GAME_CREATION_XP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationXpRate", "1"));
  1351. ALT_GAME_CREATION_SP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationSpRate", "1"));
  1352. ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationRareXpSpRate", "2"));
  1353. ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(Character.getProperty("AltBlacksmithUseRecipes", "true"));
  1354. ALT_CLAN_JOIN_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeJoinAClan", "1"));
  1355. ALT_CLAN_CREATE_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeCreateAClan", "10"));
  1356. ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(Character.getProperty("DaysToPassToDissolveAClan", "7"));
  1357. ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
  1358. ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
  1359. ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
  1360. ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(Character.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "1"));
  1361. ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(Character.getProperty("AltMaxNumOfClansInAlly", "3"));
  1362. ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(Character.getProperty("AltClanMembersForWar", "15"));
  1363. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH= Boolean.parseBoolean(Character.getProperty("AltMembersCanWithdrawFromClanWH", "false"));
  1364. REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(Character.getProperty("RemoveCastleCirclets", "true"));
  1365. ALT_PARTY_RANGE = Integer.parseInt(Character.getProperty("AltPartyRange", "1600"));
  1366. ALT_PARTY_RANGE2 = Integer.parseInt(Character.getProperty("AltPartyRange2", "1400"));
  1367. STARTING_ADENA = Long.parseLong(Character.getProperty("StartingAdena", "0"));
  1368. STARTING_LEVEL = Byte.parseByte(Character.getProperty("StartingLevel", "1"));
  1369. STARTING_SP = Integer.parseInt(Character.getProperty("StartingSP", "0"));
  1370. AUTO_LOOT = Boolean.parseBoolean(Character.getProperty("AutoLoot", "false"));
  1371. AUTO_LOOT_RAIDS = Boolean.parseBoolean(Character.getProperty("AutoLootRaids", "false"));
  1372. LOOT_RAIDS_PRIVILEGE_INTERVAL = Integer.parseInt(Character.getProperty("RaidLootRightsInterval", "900")) * 1000;
  1373. LOOT_RAIDS_PRIVILEGE_CC_SIZE = Integer.parseInt(Character.getProperty("RaidLootRightsCCSize", "45"));
  1374. UNSTUCK_INTERVAL = Integer.parseInt(Character.getProperty("UnstuckInterval", "300"));
  1375. TELEPORT_WATCHDOG_TIMEOUT = Integer.parseInt(Character.getProperty("TeleportWatchdogTimeout", "0"));
  1376. PLAYER_SPAWN_PROTECTION = Integer.parseInt(Character.getProperty("PlayerSpawnProtection", "0"));
  1377. RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(Character.getProperty("RespawnRandomInTown", "True"));
  1378. RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(Character.getProperty("RespawnRandomMaxOffset", "50"));
  1379. RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(Character.getProperty("RestorePlayerInstance", "False"));
  1380. ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(Character.getProperty("AllowSummonToInstance", "True"));
  1381. PETITIONING_ALLOWED = Boolean.parseBoolean(Character.getProperty("PetitioningAllowed", "True"));
  1382. MAX_PETITIONS_PER_PLAYER = Integer.parseInt(Character.getProperty("MaxPetitionsPerPlayer", "5"));
  1383. MAX_PETITIONS_PENDING = Integer.parseInt(Character.getProperty("MaxPetitionsPending", "25"));
  1384. ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltFreeTeleporting", "False"));
  1385. ALT_RECOMMEND = Boolean.parseBoolean(Character.getProperty("AltRecommend", "False"));
  1386. DELETE_DAYS = Integer.parseInt(Character.getProperty("DeleteCharAfterDays", "7"));
  1387. ALT_GAME_EXPONENT_XP = Float.parseFloat(Character.getProperty("AltGameExponentXp", "0."));
  1388. ALT_GAME_EXPONENT_SP = Float.parseFloat(Character.getProperty("AltGameExponentSp", "0."));
  1389. PARTY_XP_CUTOFF_METHOD = Character.getProperty("PartyXpCutoffMethod", "auto");
  1390. PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(Character.getProperty("PartyXpCutoffPercent", "3."));
  1391. PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(Character.getProperty("PartyXpCutoffLevel", "30"));
  1392. DISABLE_TUTORIAL = Boolean.parseBoolean(Character.getProperty("DisableTutorial", "False"));
  1393. EXPERTISE_PENALTY = Boolean.parseBoolean(Character.getProperty("ExpertisePenalty", "True"));
  1394. STORE_RECIPE_SHOPLIST = Boolean.parseBoolean(Character.getProperty("StoreRecipeShopList", "False"));
  1395. STORE_UI_SETTINGS = Boolean.parseBoolean(Character.getProperty("StoreCharUiSettings", "False"));
  1396. }
  1397. catch (Exception e)
  1398. {
  1399. e.printStackTrace();
  1400. throw new Error("Failed to Load "+CHARACTER_CONFIG_FILE+" file.");
  1401. }
  1402. // Load L2J Server Version L2Properties file (if exists)
  1403. try
  1404. {
  1405. L2Properties serverVersion = new L2Properties();
  1406. is = new FileInputStream(new File(SERVER_VERSION_FILE));
  1407. serverVersion.load(is);
  1408. SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1409. SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
  1410. }
  1411. catch (Exception e)
  1412. {
  1413. //Ignore L2Properties file if it doesnt exist
  1414. SERVER_VERSION = "Unsupported Custom Version.";
  1415. SERVER_BUILD_DATE = "Undefined Date.";
  1416. }
  1417. // Load L2J Datapack Version L2Properties file (if exists)
  1418. try
  1419. {
  1420. L2Properties serverVersion = new L2Properties();
  1421. is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
  1422. serverVersion.load(is);
  1423. DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1424. }
  1425. catch (Exception e)
  1426. {
  1427. //Ignore L2Properties file if it doesnt exist
  1428. DATAPACK_VERSION = "Unsupported Custom Version.";
  1429. }
  1430. // Load Telnet L2Properties file (if exists)
  1431. try
  1432. {
  1433. L2Properties telnetSettings = new L2Properties();
  1434. is = new FileInputStream(new File(TELNET_FILE));
  1435. telnetSettings.load(is);
  1436. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  1437. }
  1438. catch (Exception e)
  1439. {
  1440. e.printStackTrace();
  1441. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1442. }
  1443. // MMO
  1444. try
  1445. {
  1446. _log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  1447. L2Properties mmoSettings = new L2Properties();
  1448. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  1449. mmoSettings.load(is);
  1450. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  1451. MMO_IO_SELECTOR_THREAD_COUNT = Integer.parseInt(mmoSettings.getProperty("IOSelectorThreadCount", "2"));
  1452. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  1453. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  1454. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  1455. }
  1456. catch (Exception e)
  1457. {
  1458. e.printStackTrace();
  1459. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  1460. }
  1461. // Load IdFactory L2Properties file (if exists)
  1462. try
  1463. {
  1464. L2Properties idSettings = new L2Properties();
  1465. is = new FileInputStream(new File(ID_CONFIG_FILE));
  1466. idSettings.load(is);
  1467. MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
  1468. SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
  1469. IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
  1470. BAD_ID_CHECKING = Boolean.parseBoolean(idSettings.getProperty("BadIdChecking", "True"));
  1471. }
  1472. catch (Exception e)
  1473. {
  1474. e.printStackTrace();
  1475. throw new Error("Failed to Load "+ID_CONFIG_FILE+" file.");
  1476. }
  1477. // Load General L2Properties file (if exists)
  1478. try
  1479. {
  1480. L2Properties General = new L2Properties();
  1481. is = new FileInputStream(new File(GENERAL_CONFIG_FILE));
  1482. General.load(is);
  1483. EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(General.getProperty("EverybodyHasAdminRights", "false"));
  1484. DISPLAY_SERVER_VERSION = Boolean.parseBoolean(General.getProperty("DisplayServerRevision","True"));
  1485. SERVER_LIST_BRACKET = Boolean.parseBoolean(General.getProperty("ServerListBrackets", "false"));
  1486. SERVER_LIST_CLOCK = Boolean.parseBoolean(General.getProperty("ServerListClock", "false"));
  1487. SERVER_GMONLY = Boolean.parseBoolean(General.getProperty("ServerGMOnly", "false"));
  1488. GM_HERO_AURA = Boolean.parseBoolean(General.getProperty("GMHeroAura", "False"));
  1489. GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(General.getProperty("GMStartupInvulnerable", "False"));
  1490. GM_STARTUP_INVISIBLE = Boolean.parseBoolean(General.getProperty("GMStartupInvisible", "False"));
  1491. GM_STARTUP_SILENCE = Boolean.parseBoolean(General.getProperty("GMStartupSilence", "False"));
  1492. GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(General.getProperty("GMStartupAutoList", "False"));
  1493. GM_STARTUP_DIET_MODE = Boolean.parseBoolean(General.getProperty("GMStartupDietMode", "False"));
  1494. GM_ADMIN_MENU_STYLE = General.getProperty("GMAdminMenuStyle", "modern");
  1495. GM_ITEM_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMItemRestriction", "True"));
  1496. GM_SKILL_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMSkillRestriction", "True"));
  1497. GM_TRADE_RESTRICTED_ITEMS = Boolean.parseBoolean(General.getProperty("GMTradeRestrictedItems", "False"));
  1498. GM_RESTART_FIGHTING = Boolean.parseBoolean(General.getProperty("GMRestartFighting", "True"));
  1499. GM_ANNOUNCER_NAME = Boolean.parseBoolean(General.getProperty("GMShowAnnouncerName", "False"));
  1500. GM_GIVE_SPECIAL_SKILLS = Boolean.parseBoolean(General.getProperty("GMGiveSpecialSkills", "False"));
  1501. BYPASS_VALIDATION = Boolean.parseBoolean(General.getProperty("BypassValidation", "True"));
  1502. GAMEGUARD_ENFORCE = Boolean.parseBoolean(General.getProperty("GameGuardEnforce", "False"));
  1503. GAMEGUARD_PROHIBITACTION = Boolean.parseBoolean(General.getProperty("GameGuardProhibitAction", "False"));
  1504. LOG_CHAT = Boolean.parseBoolean(General.getProperty("LogChat", "false"));
  1505. LOG_ITEMS = Boolean.parseBoolean(General.getProperty("LogItems", "false"));
  1506. LOG_ITEM_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogItemEnchants", "false"));
  1507. LOG_SKILL_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogSkillEnchants", "false"));
  1508. GMAUDIT = Boolean.parseBoolean(General.getProperty("GMAudit", "False"));
  1509. LOG_GAME_DAMAGE = Boolean.parseBoolean(General.getProperty("LogGameDamage", "False"));
  1510. LOG_GAME_DAMAGE_THRESHOLD = Integer.parseInt(General.getProperty("LogGameDamageThreshold", "5000"));
  1511. DEBUG = Boolean.parseBoolean(General.getProperty("Debug", "false"));
  1512. PACKET_HANDLER_DEBUG = Boolean.parseBoolean(General.getProperty("PacketHandlerDebug", "false"));
  1513. DEVELOPER = Boolean.parseBoolean(General.getProperty("Developer", "false"));
  1514. ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(General.getProperty("AcceptGeoeditorConn", "false"));
  1515. TEST_SERVER = Boolean.parseBoolean(General.getProperty("TestServer", "false"));
  1516. SERVER_LIST_TESTSERVER = Boolean.parseBoolean(General.getProperty("ListTestServers", "false"));
  1517. ALT_DEV_NO_HANDLERS = Boolean.parseBoolean(General.getProperty("AltDevNoHandlers", "False"));
  1518. ALT_DEV_NO_QUESTS = Boolean.parseBoolean(General.getProperty("AltDevNoQuests", "False"));
  1519. ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(General.getProperty("AltDevNoSpawns", "False"));
  1520. THREAD_P_EFFECTS = Integer.parseInt(General.getProperty("ThreadPoolSizeEffects", "10"));
  1521. THREAD_P_GENERAL = Integer.parseInt(General.getProperty("ThreadPoolSizeGeneral", "13"));
  1522. IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("UrgentPacketThreadCoreSize", "2"));
  1523. GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralPacketThreadCoreSize", "4"));
  1524. GENERAL_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralThreadCoreSize", "4"));
  1525. AI_MAX_THREAD = Integer.parseInt(General.getProperty("AiMaxThread", "6"));
  1526. DEADLOCK_DETECTOR = Boolean.parseBoolean(General.getProperty("DeadLockDetector", "False"));
  1527. DEADLOCK_CHECK_INTERVAL = Integer.parseInt(General.getProperty("DeadLockCheckInterval", "20"));
  1528. RESTART_ON_DEADLOCK = Boolean.parseBoolean(General.getProperty("RestartOnDeadlock", "False"));
  1529. ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
  1530. AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600"));
  1531. HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime","60"))*1000;
  1532. PROTECTED_ITEMS = General.getProperty("ListOfProtectedItems", "0");
  1533. LIST_PROTECTED_ITEMS = new FastList<Integer>();
  1534. for (String id : PROTECTED_ITEMS.split(","))
  1535. {
  1536. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
  1537. }
  1538. CHAR_STORE_INTERVAL = Integer.parseInt(General.getProperty("CharacterDataStoreInterval", "15"));
  1539. LAZY_ITEMS_UPDATE = Boolean.parseBoolean(General.getProperty("LazyItemsUpdate", "false"));
  1540. UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(General.getProperty("UpdateItemsOnCharStore", "false"));
  1541. DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyPlayerDroppedItem", "false"));
  1542. DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyEquipableItem", "false"));
  1543. SAVE_DROPPED_ITEM = Boolean.parseBoolean(General.getProperty("SaveDroppedItem", "false"));
  1544. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(General.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
  1545. SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(General.getProperty("SaveDroppedItemInterval", "60"))*60000;
  1546. CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(General.getProperty("ClearDroppedItemTable", "false"));
  1547. AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(General.getProperty("AutoDeleteInvalidQuestData", "False"));
  1548. PRECISE_DROP_CALCULATION = Boolean.parseBoolean(General.getProperty("PreciseDropCalculation", "True"));
  1549. MULTIPLE_ITEM_DROP = Boolean.parseBoolean(General.getProperty("MultipleItemDrop", "True"));
  1550. FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(General.getProperty("ForceInventoryUpdate", "False"));
  1551. LAZY_CACHE = Boolean.parseBoolean(General.getProperty("LazyCache", "True"));
  1552. CACHE_CHAR_NAMES = Boolean.parseBoolean(General.getProperty("CacheCharNames", "False"));
  1553. MIN_NPC_ANIMATION = Integer.parseInt(General.getProperty("MinNPCAnimation", "10"));
  1554. MAX_NPC_ANIMATION = Integer.parseInt(General.getProperty("MaxNPCAnimation", "20"));
  1555. MIN_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MinMonsterAnimation", "5"));
  1556. MAX_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MaxMonsterAnimation", "20"));
  1557. MOVE_BASED_KNOWNLIST = Boolean.parseBoolean(General.getProperty("MoveBasedKnownlist", "False"));
  1558. KNOWNLIST_UPDATE_INTERVAL = Long.parseLong(General.getProperty("KnownListUpdateInterval", "1250"));
  1559. GRIDS_ALWAYS_ON = Boolean.parseBoolean(General.getProperty("GridsAlwaysOn", "False"));
  1560. GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOnTime", "1"));
  1561. GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOffTime", "90"));
  1562. GEODATA = Integer.parseInt(General.getProperty("GeoData", "0"));
  1563. GEODATA_CELLFINDING = Boolean.parseBoolean(General.getProperty("CellPathFinding", "False"));
  1564. FORCE_GEODATA = Boolean.parseBoolean(General.getProperty("ForceGeodata", "True"));
  1565. COORD_SYNCHRONIZE = Integer.parseInt(General.getProperty("CoordSynchronize", "-1"));
  1566. ZONE_TOWN = Integer.parseInt(General.getProperty("ZoneTown", "0"));
  1567. ACTIVATE_POSITION_RECORDER = Boolean.parseBoolean(General.getProperty("ActivatePositionRecorder", "False"));
  1568. DEFAULT_GLOBAL_CHAT = General.getProperty("GlobalChat", "ON");
  1569. DEFAULT_TRADE_CHAT = General.getProperty("TradeChat", "ON");
  1570. ALLOW_WAREHOUSE = Boolean.parseBoolean(General.getProperty("AllowWarehouse", "True"));
  1571. WAREHOUSE_CACHE = Boolean.parseBoolean(General.getProperty("WarehouseCache", "False"));
  1572. WAREHOUSE_CACHE_TIME = Integer.parseInt(General.getProperty("WarehouseCacheTime", "15"));
  1573. ALLOW_REFUND = Boolean.parseBoolean(General.getProperty("AllowRefund", "True"));
  1574. ALLOW_MAIL = Boolean.parseBoolean(General.getProperty("AllowMail", "True"));
  1575. ALLOW_ATTACHMENTS = Boolean.parseBoolean(General.getProperty("AllowAttachments", "True"));
  1576. ALLOW_WEAR = Boolean.parseBoolean(General.getProperty("AllowWear", "False"));
  1577. WEAR_DELAY = Integer.parseInt(General.getProperty("WearDelay", "5"));
  1578. WEAR_PRICE = Integer.parseInt(General.getProperty("WearPrice", "10"));
  1579. ALLOW_LOTTERY = Boolean.parseBoolean(General.getProperty("AllowLottery", "True"));
  1580. ALLOW_RACE = Boolean.parseBoolean(General.getProperty("AllowRace", "True"));
  1581. ALLOW_WATER = Boolean.parseBoolean(General.getProperty("AllowWater", "True"));
  1582. ALLOW_RENTPET = Boolean.parseBoolean(General.getProperty("AllowRentPet", "False"));
  1583. ALLOWFISHING = Boolean.parseBoolean(General.getProperty("AllowFishing", "True"));
  1584. ALLOW_MANOR = Boolean.parseBoolean(General.getProperty("AllowManor", "True"));
  1585. ALLOW_BOAT = Boolean.parseBoolean(General.getProperty("AllowBoat", "True"));
  1586. ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(General.getProperty("AllowCursedWeapons", "True"));
  1587. ALLOW_NPC_WALKERS = Boolean.parseBoolean(General.getProperty("AllowNpcWalkers", "true"));
  1588. ALLOW_PET_WALKERS = Boolean.parseBoolean(General.getProperty("AllowPetWalkers", "True"));
  1589. SERVER_NEWS = Boolean.parseBoolean(General.getProperty("ShowServerNews", "False"));
  1590. COMMUNITY_TYPE = Integer.parseInt(General.getProperty("CommunityType", "1"));
  1591. BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(General.getProperty("BBSShowPlayerList", "false"));
  1592. BBS_DEFAULT = General.getProperty("BBSDefault", "_bbshome");
  1593. SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowLevelOnCommunityBoard", "False"));
  1594. SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowStatusOnCommunityBoard", "True"));
  1595. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePageSizeOnCommunityBoard", "50"));
  1596. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePerRowOnCommunityBoard", "5"));
  1597. USE_SAY_FILTER = Boolean.parseBoolean(General.getProperty("UseChatFilter", "false"));
  1598. CHAT_FILTER_CHARS = General.getProperty("ChatFilterChars", "^_^");
  1599. ALT_MANOR_REFRESH_TIME = Integer.parseInt(General.getProperty("AltManorRefreshTime","20"));
  1600. ALT_MANOR_REFRESH_MIN = Integer.parseInt(General.getProperty("AltManorRefreshMin","00"));
  1601. ALT_MANOR_APPROVE_TIME = Integer.parseInt(General.getProperty("AltManorApproveTime","6"));
  1602. ALT_MANOR_APPROVE_MIN = Integer.parseInt(General.getProperty("AltManorApproveMin","00"));
  1603. ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(General.getProperty("AltManorMaintenancePeriod","360000"));
  1604. ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(General.getProperty("AltManorSaveAllActions","false"));
  1605. ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(General.getProperty("AltManorSavePeriodRate","2"));
  1606. ALT_LOTTERY_PRIZE = Long.parseLong(General.getProperty("AltLotteryPrize","50000"));
  1607. ALT_LOTTERY_TICKET_PRICE = Long.parseLong(General.getProperty("AltLotteryTicketPrice","2000"));
  1608. ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery5NumberRate","0.6"));
  1609. ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery4NumberRate","0.2"));
  1610. ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery3NumberRate","0.2"));
  1611. ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Long.parseLong(General.getProperty("AltLottery2and1NumberPrize","200"));
  1612. FS_TIME_ATTACK = Integer.parseInt(General.getProperty("TimeOfAttack", "50"));
  1613. FS_TIME_COOLDOWN = Integer.parseInt(General.getProperty("TimeOfCoolDown", "5"));
  1614. FS_TIME_ENTRY = Integer.parseInt(General.getProperty("TimeOfEntry", "3"));
  1615. FS_TIME_WARMUP = Integer.parseInt(General.getProperty("TimeOfWarmUp", "2"));
  1616. FS_PARTY_MEMBER_COUNT = Integer.parseInt(General.getProperty("NumberOfNecessaryPartyMembers", "4"));
  1617. if (FS_TIME_ATTACK <= 0)
  1618. FS_TIME_ATTACK = 50;
  1619. if (FS_TIME_COOLDOWN <= 0)
  1620. FS_TIME_COOLDOWN = 5;
  1621. if (FS_TIME_ENTRY <= 0)
  1622. FS_TIME_ENTRY = 3;
  1623. if (FS_TIME_ENTRY <= 0)
  1624. FS_TIME_ENTRY = 3;
  1625. if (FS_TIME_ENTRY <= 0)
  1626. FS_TIME_ENTRY = 3;
  1627. RIFT_MIN_PARTY_SIZE = Integer.parseInt(General.getProperty("RiftMinPartySize", "5"));
  1628. RIFT_MAX_JUMPS = Integer.parseInt(General.getProperty("MaxRiftJumps", "4"));
  1629. RIFT_SPAWN_DELAY = Integer.parseInt(General.getProperty("RiftSpawnDelay", "10000"));
  1630. RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(General.getProperty("AutoJumpsDelayMin", "480"));
  1631. RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(General.getProperty("AutoJumpsDelayMax", "600"));
  1632. RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(General.getProperty("BossRoomTimeMultiply", "1.5"));
  1633. RIFT_ENTER_COST_RECRUIT = Integer.parseInt(General.getProperty("RecruitCost", "18"));
  1634. RIFT_ENTER_COST_SOLDIER = Integer.parseInt(General.getProperty("SoldierCost", "21"));
  1635. RIFT_ENTER_COST_OFFICER = Integer.parseInt(General.getProperty("OfficerCost", "24"));
  1636. RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(General.getProperty("CaptainCost", "27"));
  1637. RIFT_ENTER_COST_COMMANDER = Integer.parseInt(General.getProperty("CommanderCost", "30"));
  1638. RIFT_ENTER_COST_HERO = Integer.parseInt(General.getProperty("HeroCost", "33"));
  1639. DEFAULT_PUNISH = Integer.parseInt(General.getProperty("DefaultPunish", "2"));
  1640. DEFAULT_PUNISH_PARAM = Integer.parseInt(General.getProperty("DefaultPunishParam", "0"));
  1641. ONLY_GM_ITEMS_FREE = Boolean.parseBoolean(General.getProperty("OnlyGMItemsFree", "True"));
  1642. JAIL_IS_PVP = Boolean.parseBoolean(General.getProperty("JailIsPvp", "False"));
  1643. JAIL_DISABLE_CHAT = Boolean.parseBoolean(General.getProperty("JailDisableChat", "True"));
  1644. JAIL_DISABLE_TRANSACTION = Boolean.parseBoolean(General.getProperty("JailDisableTransaction", "False"));
  1645. CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(General.getProperty("CustomSpawnlistTable", "false"));
  1646. SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("SaveGmSpawnOnCustom", "false"));
  1647. DELETE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("DeleteGmSpawnOnCustom", "false"));
  1648. CUSTOM_NPC_TABLE = Boolean.valueOf(General.getProperty("CustomNpcTable", "false"));
  1649. CUSTOM_ITEM_TABLES = Boolean.valueOf(General.getProperty("CustomItemTables", "false"));
  1650. CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(General.getProperty("CustomArmorSetsTable", "false"));
  1651. CUSTOM_TELEPORT_TABLE = Boolean.valueOf(General.getProperty("CustomTeleportTable", "false"));
  1652. CUSTOM_DROPLIST_TABLE = Boolean.valueOf(General.getProperty("CustomDroplistTable", "false"));
  1653. CUSTOM_MERCHANT_TABLES = Boolean.valueOf(General.getProperty("CustomMerchantTables", "false"));
  1654. CUSTOM_NPCBUFFER_TABLES = Boolean.valueOf(General.getProperty("CustomNpcBufferTables", "false"));
  1655. }
  1656. catch (Exception e)
  1657. {
  1658. e.printStackTrace();
  1659. throw new Error("Failed to Load "+GENERAL_CONFIG_FILE+" File.");
  1660. }
  1661. // Load FloodProtector L2Properties file
  1662. try
  1663. {
  1664. L2Properties security = new L2Properties();
  1665. is = new FileInputStream(new File(FLOOD_PROTECTOR_FILE));
  1666. security.load(is);
  1667. loadFloodProtectorConfigs(security);
  1668. }
  1669. catch (Exception e)
  1670. {
  1671. e.printStackTrace();
  1672. throw new Error("Failed to Load "+FLOOD_PROTECTOR_FILE);
  1673. }
  1674. // Load NPC L2Properties file (if exists)
  1675. try
  1676. {
  1677. L2Properties NPC = new L2Properties();
  1678. is = new FileInputStream(new File(NPC_CONFIG_FILE));
  1679. NPC.load(is);
  1680. ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(NPC.getProperty("AnnounceMammonSpawn", "False"));
  1681. ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(NPC.getProperty("AltMobAgroInPeaceZone", "True"));
  1682. ALT_ATTACKABLE_NPCS = Boolean.parseBoolean(NPC.getProperty("AltAttackableNpcs", "True"));
  1683. ALT_GAME_VIEWNPC = Boolean.parseBoolean(NPC.getProperty("AltGameViewNpc", "False"));
  1684. MAX_DRIFT_RANGE = Integer.parseInt(NPC.getProperty("MaxDriftRange", "300"));
  1685. DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
  1686. DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRulesRaid", "True"));
  1687. SHOW_NPC_LVL = Boolean.parseBoolean(NPC.getProperty("ShowNpcLevel", "False"));
  1688. SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(NPC.getProperty("ShowCrestWithoutQuest", "False"));
  1689. ENABLE_RANDOM_ENCHANT_EFFECT = Boolean.parseBoolean(NPC.getProperty("EnableRandomEnchantEffect", "False"));;
  1690. MIN_NPC_LVL_DMG_PENALTY = Integer.parseInt(NPC.getProperty("MinNPCLevelForDmgPenalty", "78"));
  1691. MIN_NPC_LVL_MAGIC_PENALTY = Integer.parseInt(NPC.getProperty("MinNPCLevelForMagicPenalty", "78"));
  1692. ENABLE_DROP_VITALITY_HERBS = Boolean.parseBoolean(NPC.getProperty("EnableVitalityHerbs", "True"));
  1693. GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
  1694. ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
  1695. PET_RENT_NPC = NPC.getProperty("ListPetRentNpc", "30827");
  1696. LIST_PET_RENT_NPC = new FastList<Integer>();
  1697. for (String id : PET_RENT_NPC.split(","))
  1698. {
  1699. LIST_PET_RENT_NPC.add(Integer.parseInt(id));
  1700. }
  1701. RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) /100;
  1702. RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) /100;
  1703. RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPDefenceMultiplier", "100")) /100;
  1704. RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMDefenceMultiplier", "100")) /100;
  1705. RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMinRespawnMultiplier", "1.0"));
  1706. RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
  1707. RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
  1708. RAID_DISABLE_CURSE = Boolean.parseBoolean(NPC.getProperty("DisableRaidCurse", "False"));
  1709. RAID_CHAOS_TIME = Integer.parseInt(NPC.getProperty("RaidChaosTime", "10"));
  1710. GRAND_CHAOS_TIME = Integer.parseInt(NPC.getProperty("GrandChaosTime", "10"));
  1711. MINION_CHAOS_TIME = Integer.parseInt(NPC.getProperty("MinionChaosTime", "10"));
  1712. INVENTORY_MAXIMUM_PET = Integer.parseInt(NPC.getProperty("MaximumSlotsForPet", "12"));
  1713. PET_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetHpRegenMultiplier", "100")) /100;
  1714. PET_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetMpRegenMultiplier", "100")) /100;
  1715. }
  1716. catch (Exception e)
  1717. {
  1718. e.printStackTrace();
  1719. throw new Error("Failed to Load "+NPC_CONFIG_FILE+" File.");
  1720. }
  1721. // Load Rates L2Properties file (if exists)
  1722. try
  1723. {
  1724. L2Properties ratesSettings = new L2Properties();
  1725. is = new FileInputStream(new File(RATES_CONFIG_FILE));
  1726. ratesSettings.load(is);
  1727. RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
  1728. RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
  1729. RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
  1730. RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
  1731. RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
  1732. RATE_EXTR_FISH = Float.parseFloat(ratesSettings.getProperty("RateExtractFish", "1."));
  1733. RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
  1734. RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(ratesSettings.getProperty("RateRaidDropItems", "1."));
  1735. RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
  1736. RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
  1737. RATE_QUEST_DROP = Float.parseFloat(ratesSettings.getProperty("RateQuestDrop", "1."));
  1738. RATE_QUEST_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestReward", "1."));
  1739. RATE_QUEST_REWARD_XP = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardXP", "1."));
  1740. RATE_QUEST_REWARD_SP = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardSP", "1."));
  1741. RATE_QUEST_REWARD_ADENA = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardAdena", "1."));
  1742. RATE_QUEST_REWARD_USE_MULTIPLIERS = Boolean.parseBoolean(ratesSettings.getProperty("UseQuestRewardMultipliers", "False"));
  1743. RATE_QUEST_REWARD_POTION = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardPotion", "1."));
  1744. RATE_QUEST_REWARD_SCROLL = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardScroll", "1."));
  1745. RATE_QUEST_REWARD_RECIPE = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardRecipe", "1."));
  1746. RATE_QUEST_REWARD_MATERIAL = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardMaterial", "1."));
  1747. RATE_VITALITY_LEVEL_1 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel1", "1.5"));
  1748. RATE_VITALITY_LEVEL_2 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel2", "2."));
  1749. RATE_VITALITY_LEVEL_3 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel3", "2.5"));
  1750. RATE_VITALITY_LEVEL_4 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel4", "3."));
  1751. RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(ratesSettings.getProperty("RateRecoveryPeaceZone", "1."));
  1752. RATE_VITALITY_LOST = Float.parseFloat(ratesSettings.getProperty("RateVitalityLost", "1."));
  1753. RATE_VITALITY_GAIN = Float.parseFloat(ratesSettings.getProperty("RateVitalityGain", "1."));
  1754. RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(ratesSettings.getProperty("RateRecoveryOnReconnect", "4."));
  1755. RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
  1756. RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
  1757. RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "15."));
  1758. RATE_DROP_MP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpMpHerbs", "10."));
  1759. RATE_DROP_GREATER_HERBS = Float.parseFloat(ratesSettings.getProperty("RateGreaterHerbs", "4."));
  1760. RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSuperiorHerbs", "0.8"))*10;
  1761. RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "0.2"))*10;
  1762. RATE_DROP_VITALITY_HERBS = Float.parseFloat(ratesSettings.getProperty("RateVitalityHerbs", "2."));
  1763. PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
  1764. PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
  1765. PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
  1766. PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
  1767. PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
  1768. PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
  1769. PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
  1770. SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
  1771. KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
  1772. KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
  1773. KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
  1774. KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
  1775. KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
  1776. // Initializing table
  1777. PLAYER_XP_PERCENT_LOST = new double[Byte.MAX_VALUE+1];
  1778. // Default value
  1779. for (int i = 0; i <= Byte.MAX_VALUE; i++)
  1780. PLAYER_XP_PERCENT_LOST[i] = 1.;
  1781. // Now loading into table parsed values
  1782. try
  1783. {
  1784. String[] values = ratesSettings.getProperty("PlayerXPPercentLost", "0,39-7.0;40,75-4.0;76,76-2.5;77,77-2.0;78,78-1.5").split(";");
  1785. for (String s : values)
  1786. {
  1787. int min;
  1788. int max;
  1789. double val;
  1790. String[] vals = s.split("-");
  1791. String[] mM = vals[0].split(",");
  1792. min = Integer.parseInt(mM[0]);
  1793. max = Integer.parseInt(mM[1]);
  1794. val = Double.parseDouble(vals[1]);
  1795. for (int i = min; i <= max; i++)
  1796. PLAYER_XP_PERCENT_LOST[i] = val;
  1797. }
  1798. }
  1799. catch (Exception e)
  1800. {
  1801. _log.warning("Error while loading Player XP percent lost");
  1802. e.printStackTrace();
  1803. }
  1804. String[] propertySplit = ratesSettings.getProperty("RateDropItemsById", "").split(";");
  1805. RATE_DROP_ITEMS_ID = new TIntFloatHashMap(propertySplit.length);
  1806. if (!propertySplit[0].isEmpty())
  1807. {
  1808. for (String item : propertySplit)
  1809. {
  1810. String[] itemSplit = item.split(",");
  1811. if (itemSplit.length != 2)
  1812. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  1813. else
  1814. {
  1815. try
  1816. {
  1817. RATE_DROP_ITEMS_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
  1818. }
  1819. catch (NumberFormatException nfe)
  1820. {
  1821. if (!item.isEmpty())
  1822. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  1823. }
  1824. }
  1825. }
  1826. }
  1827. if (RATE_DROP_ITEMS_ID.get(57) == 0f)
  1828. {
  1829. RATE_DROP_ITEMS_ID.put(57, RATE_DROP_ITEMS); //for Adena rate if not defined
  1830. }
  1831. }
  1832. catch (Exception e)
  1833. {
  1834. e.printStackTrace();
  1835. throw new Error("Failed to Load "+RATES_CONFIG_FILE+" File.");
  1836. }
  1837. // Load L2JMod L2Properties file (if exists)
  1838. try
  1839. {
  1840. L2Properties L2JModSettings = new L2Properties();
  1841. is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
  1842. L2JModSettings.load(is);
  1843. L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
  1844. L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
  1845. L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
  1846. L2JMOD_CHAMP_TITLE = L2JModSettings.getProperty("ChampionTitle", "Champion");
  1847. L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
  1848. L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
  1849. L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
  1850. L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
  1851. L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
  1852. L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
  1853. L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
  1854. L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
  1855. L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
  1856. L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
  1857. L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
  1858. L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
  1859. L2JMOD_CHAMPION_ENABLE_VITALITY = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnableVitality", "False"));
  1860. TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
  1861. TVT_EVENT_IN_INSTANCE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventInInstance", "false"));
  1862. TVT_EVENT_INSTANCE_FILE = L2JModSettings.getProperty("TvTEventInstanceFile", "coliseum.xml");
  1863. TVT_EVENT_INTERVAL = L2JModSettings.getProperty("TvTEventInterval", "20:00").split(",");
  1864. TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
  1865. TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
  1866. TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
  1867. L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(L2JModSettings.getProperty("AllowWedding", "False"));
  1868. L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
  1869. L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
  1870. L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
  1871. L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
  1872. L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
  1873. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
  1874. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
  1875. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
  1876. L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
  1877. L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
  1878. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  1879. {
  1880. TVT_EVENT_ENABLED = false;
  1881. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
  1882. }
  1883. else
  1884. {
  1885. String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
  1886. if (propertySplit.length < 3)
  1887. {
  1888. TVT_EVENT_ENABLED = false;
  1889. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
  1890. }
  1891. else
  1892. {
  1893. TVT_EVENT_REWARDS = new FastList<int[]>();
  1894. TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  1895. TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  1896. TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  1897. TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  1898. TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  1899. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1900. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1901. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1902. if (propertySplit.length == 4)
  1903. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[3] = Integer.parseInt(propertySplit[3]);
  1904. TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
  1905. TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
  1906. TVT_EVENT_MIN_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
  1907. TVT_EVENT_MAX_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
  1908. TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
  1909. TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
  1910. TVT_EVENT_EFFECTS_REMOVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventEffectsRemoval", "0"));
  1911. TVT_ALLOW_VOICED_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("TvTAllowVoicedInfoCommand", "false"));
  1912. TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
  1913. propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
  1914. if (propertySplit.length < 3)
  1915. {
  1916. TVT_EVENT_ENABLED = false;
  1917. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
  1918. }
  1919. else
  1920. {
  1921. TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1922. TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1923. TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1924. TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
  1925. propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
  1926. if (propertySplit.length < 3)
  1927. {
  1928. TVT_EVENT_ENABLED= false;
  1929. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
  1930. }
  1931. else
  1932. {
  1933. TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1934. TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1935. TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1936. propertySplit = L2JModSettings.getProperty("TvTEventParticipationFee", "0,0").split(",");
  1937. try
  1938. {
  1939. TVT_EVENT_PARTICIPATION_FEE[0] = Integer.parseInt(propertySplit[0]);
  1940. TVT_EVENT_PARTICIPATION_FEE[1] = Integer.parseInt(propertySplit[1]);
  1941. }
  1942. catch (NumberFormatException nfe)
  1943. {
  1944. if (propertySplit.length > 0)
  1945. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationFee");
  1946. }
  1947. propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
  1948. for (String reward : propertySplit)
  1949. {
  1950. String[] rewardSplit = reward.split(",");
  1951. if (rewardSplit.length != 2)
  1952. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  1953. else
  1954. {
  1955. try
  1956. {
  1957. TVT_EVENT_REWARDS.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  1958. }
  1959. catch (NumberFormatException nfe)
  1960. {
  1961. if (!reward.isEmpty())
  1962. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  1963. }
  1964. }
  1965. }
  1966. TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
  1967. TVT_EVENT_SCROLL_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventScrollsAllowed", "false"));
  1968. TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
  1969. TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
  1970. TVT_REWARD_TEAM_TIE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTRewardTeamTie", "false"));
  1971. propertySplit = L2JModSettings.getProperty("TvTDoorsToOpen", "").split(";");
  1972. for (String door : propertySplit)
  1973. {
  1974. try
  1975. {
  1976. TVT_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
  1977. }
  1978. catch (NumberFormatException nfe)
  1979. {
  1980. if (!door.isEmpty())
  1981. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"", door, "\""));
  1982. }
  1983. }
  1984. propertySplit = L2JModSettings.getProperty("TvTDoorsToClose", "").split(";");
  1985. for (String door : propertySplit)
  1986. {
  1987. try
  1988. {
  1989. TVT_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
  1990. }
  1991. catch (NumberFormatException nfe)
  1992. {
  1993. if (!door.isEmpty())
  1994. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"", door, "\""));
  1995. }
  1996. }
  1997. propertySplit = L2JModSettings.getProperty("TvTEventFighterBuffs", "").split(";");
  1998. if (!propertySplit[0].isEmpty())
  1999. {
  2000. TVT_EVENT_FIGHTER_BUFFS = new TIntIntHashMap(propertySplit.length);
  2001. for (String skill : propertySplit)
  2002. {
  2003. String[] skillSplit = skill.split(",");
  2004. if (skillSplit.length != 2)
  2005. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2006. else
  2007. {
  2008. try
  2009. {
  2010. TVT_EVENT_FIGHTER_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2011. }
  2012. catch (NumberFormatException nfe)
  2013. {
  2014. if (!skill.isEmpty())
  2015. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2016. }
  2017. }
  2018. }
  2019. }
  2020. propertySplit = L2JModSettings.getProperty("TvTEventMageBuffs", "").split(";");
  2021. if (!propertySplit[0].isEmpty())
  2022. {
  2023. TVT_EVENT_MAGE_BUFFS = new TIntIntHashMap(propertySplit.length);
  2024. for (String skill : propertySplit)
  2025. {
  2026. String[] skillSplit = skill.split(",");
  2027. if (skillSplit.length != 2)
  2028. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2029. else
  2030. {
  2031. try
  2032. {
  2033. TVT_EVENT_MAGE_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2034. }
  2035. catch (NumberFormatException nfe)
  2036. {
  2037. if (!skill.isEmpty())
  2038. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2039. }
  2040. }
  2041. }
  2042. }
  2043. }
  2044. }
  2045. }
  2046. }
  2047. BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
  2048. BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
  2049. BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
  2050. OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
  2051. OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
  2052. OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
  2053. OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
  2054. OFFLINE_FAME = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineFame", "true"));
  2055. L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
  2056. L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(L2JModSettings.getProperty("DisplayServerTime", "false"));
  2057. WELCOME_MESSAGE_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("ScreenWelcomeMessageEnable", "false"));
  2058. WELCOME_MESSAGE_TEXT = L2JModSettings.getProperty("ScreenWelcomeMessageText", "Welcome to L2J server!");
  2059. WELCOME_MESSAGE_TIME = Integer.parseInt(L2JModSettings.getProperty("ScreenWelcomeMessageTime", "10")) * 1000;
  2060. L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedEnable", "false"));
  2061. L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDualbox", "true"));
  2062. L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDisconnectedAsDualbox", "true"));
  2063. L2JMOD_ANTIFEED_INTERVAL = 1000*Integer.parseInt(L2JModSettings.getProperty("AntiFeedInterval", "120"));
  2064. ANNOUNCE_PK_PVP = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvP", "False"));
  2065. ANNOUNCE_PK_PVP_NORMAL_MESSAGE = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvPNormalMessage", "True"));
  2066. ANNOUNCE_PK_MSG = L2JModSettings.getProperty("AnnouncePkMsg", "$killer has slaughtered $target");
  2067. ANNOUNCE_PVP_MSG = L2JModSettings.getProperty("AnnouncePvpMsg", "$killer has defeated $target");
  2068. L2JMOD_CHAT_ADMIN = Boolean.parseBoolean(L2JModSettings.getProperty("ChatAdmin", "false"));
  2069. L2JMOD_MULTILANG_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangEnable", "false"));
  2070. String[] allowed = L2JModSettings.getProperty("MultiLangAllowed", "en").split(";");
  2071. L2JMOD_MULTILANG_ALLOWED = new ArrayList<String>(allowed.length);
  2072. for (String lang : allowed)
  2073. L2JMOD_MULTILANG_ALLOWED.add(lang);
  2074. L2JMOD_MULTILANG_DEFAULT = L2JModSettings.getProperty("MultiLangDefault", "en");
  2075. if (!L2JMOD_MULTILANG_ALLOWED.contains(L2JMOD_MULTILANG_DEFAULT))
  2076. _log.warning("MultiLang[Config.load()]: default language: " + L2JMOD_MULTILANG_DEFAULT + " is not in allowed list !");
  2077. L2JMOD_MULTILANG_VOICED_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangVoiceCommand", "True"));
  2078. }
  2079. catch (Exception e)
  2080. {
  2081. e.printStackTrace();
  2082. throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File.");
  2083. }
  2084. // Load PvP L2Properties file (if exists)
  2085. try
  2086. {
  2087. L2Properties pvpSettings = new L2Properties();
  2088. is = new FileInputStream(new File(PVP_CONFIG_FILE));
  2089. pvpSettings.load(is);
  2090. KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
  2091. KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
  2092. KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
  2093. KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
  2094. KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
  2095. KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
  2096. KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
  2097. KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
  2098. 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");
  2099. String[] array = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
  2100. KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[array.length];
  2101. for (int i = 0; i < array.length; i++)
  2102. KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(array[i]);
  2103. array = KARMA_NONDROPPABLE_ITEMS.split(",");
  2104. KARMA_LIST_NONDROPPABLE_ITEMS = new int[array.length];
  2105. for (int i = 0; i < array.length; i++)
  2106. KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(array[i]);
  2107. // sorting so binarySearch can be used later
  2108. Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
  2109. Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
  2110. PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "120000"));
  2111. PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "60000"));
  2112. }
  2113. catch (Exception e)
  2114. {
  2115. e.printStackTrace();
  2116. throw new Error("Failed to Load "+PVP_CONFIG_FILE+" File.");
  2117. }
  2118. // Load Olympiad L2Properties file (if exists)
  2119. try
  2120. {
  2121. L2Properties olympiad = new L2Properties();
  2122. is = new FileInputStream(new File(OLYMPIAD_CONFIG_FILE));
  2123. olympiad.load(is);
  2124. ALT_OLY_START_TIME = Integer.parseInt(olympiad.getProperty("AltOlyStartTime", "18"));
  2125. ALT_OLY_MIN = Integer.parseInt(olympiad.getProperty("AltOlyMin","00"));
  2126. ALT_OLY_CPERIOD = Long.parseLong(olympiad.getProperty("AltOlyCPeriod","21600000"));
  2127. ALT_OLY_BATTLE = Long.parseLong(olympiad.getProperty("AltOlyBattle","360000"));
  2128. ALT_OLY_WPERIOD = Long.parseLong(olympiad.getProperty("AltOlyWPeriod","604800000"));
  2129. ALT_OLY_VPERIOD = Long.parseLong(olympiad.getProperty("AltOlyVPeriod","86400000"));
  2130. ALT_OLY_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyClassedParticipants","5"));
  2131. ALT_OLY_NONCLASSED = Integer.parseInt(olympiad.getProperty("AltOlyNonClassedParticipants","9"));
  2132. ALT_OLY_REG_DISPLAY = Integer.parseInt(olympiad.getProperty("AltOlyRegistrationDisplayNumber","100"));
  2133. ALT_OLY_BATTLE_REWARD_ITEM = Integer.parseInt(olympiad.getProperty("AltOlyBattleRewItem","6651"));
  2134. ALT_OLY_CLASSED_RITEM_C = Integer.parseInt(olympiad.getProperty("AltOlyClassedRewItemCount","50"));
  2135. ALT_OLY_NONCLASSED_RITEM_C = Integer.parseInt(olympiad.getProperty("AltOlyNonClassedRewItemCount","40"));
  2136. ALT_OLY_COMP_RITEM = Integer.parseInt(olympiad.getProperty("AltOlyCompRewItem","13722"));
  2137. ALT_OLY_GP_PER_POINT = Integer.parseInt(olympiad.getProperty("AltOlyGPPerPoint","1000"));
  2138. ALT_OLY_HERO_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyHeroPoints","180"));
  2139. ALT_OLY_RANK1_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank1Points","120"));
  2140. ALT_OLY_RANK2_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank2Points","80"));
  2141. ALT_OLY_RANK3_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank3Points","55"));
  2142. ALT_OLY_RANK4_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank4Points","35"));
  2143. ALT_OLY_RANK5_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank5Points","20"));
  2144. ALT_OLY_MAX_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyMaxPoints","10"));
  2145. ALT_OLY_LOG_FIGHTS = Boolean.parseBoolean(olympiad.getProperty("AlyOlyLogFights","false"));
  2146. ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(olympiad.getProperty("AltOlyShowMonthlyWinners","true"));
  2147. ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(olympiad.getProperty("AltOlyAnnounceGames","true"));
  2148. LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
  2149. for (String id : olympiad.getProperty("AltOlyRestrictedItems","0").split(","))
  2150. {
  2151. LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
  2152. }
  2153. ALT_OLY_ENCHANT_LIMIT = Integer.parseInt(olympiad.getProperty("AltOlyEnchantLimit","-1"));
  2154. }
  2155. catch (Exception e)
  2156. {
  2157. e.printStackTrace();
  2158. throw new Error("Failed to Load "+OLYMPIAD_CONFIG_FILE+" File.");
  2159. }
  2160. try
  2161. {
  2162. L2Properties Settings = new L2Properties();
  2163. is = new FileInputStream(HEXID_FILE);
  2164. Settings.load(is);
  2165. SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
  2166. HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
  2167. }
  2168. catch (Exception e)
  2169. {
  2170. _log.warning("Could not load HexID file ("+HEXID_FILE+"). Hopefully login will give us one.");
  2171. }
  2172. // Grandboss
  2173. try
  2174. {
  2175. L2Properties grandbossSettings = new L2Properties();
  2176. is = new FileInputStream(new File(GRANDBOSS_CONFIG_FILE));
  2177. grandbossSettings.load(is);
  2178. Antharas_Wait_Time = Integer.parseInt(grandbossSettings.getProperty("AntharasWaitTime", "30"));
  2179. if (Antharas_Wait_Time < 3 || Antharas_Wait_Time > 60)
  2180. Antharas_Wait_Time = 30;
  2181. Antharas_Wait_Time = Antharas_Wait_Time * 60000;
  2182. Valakas_Wait_Time = Integer.parseInt(grandbossSettings.getProperty("ValakasWaitTime", "30"));
  2183. if (Valakas_Wait_Time < 3 || Valakas_Wait_Time > 60)
  2184. Valakas_Wait_Time = 30;
  2185. Valakas_Wait_Time = Valakas_Wait_Time * 60000;
  2186. Interval_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfAntharasSpawn", "192"));
  2187. if (Interval_Of_Antharas_Spawn < 1 || Interval_Of_Antharas_Spawn > 480)
  2188. Interval_Of_Antharas_Spawn = 192;
  2189. Interval_Of_Antharas_Spawn = Interval_Of_Antharas_Spawn * 3600000;
  2190. Random_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfAntharasSpawn", "145"));
  2191. if (Random_Of_Antharas_Spawn < 1 || Random_Of_Antharas_Spawn > 192)
  2192. Random_Of_Antharas_Spawn = 145;
  2193. Random_Of_Antharas_Spawn = Random_Of_Antharas_Spawn * 3600000;
  2194. Interval_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfValakasSpawn", "192"));
  2195. if (Interval_Of_Valakas_Spawn < 1 || Interval_Of_Valakas_Spawn > 480)
  2196. Interval_Of_Valakas_Spawn = 192;
  2197. Interval_Of_Valakas_Spawn = Interval_Of_Valakas_Spawn * 3600000;
  2198. Random_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfValakasSpawn", "145"));
  2199. if (Random_Of_Valakas_Spawn < 1 || Random_Of_Valakas_Spawn > 192)
  2200. Random_Of_Valakas_Spawn = 145;
  2201. Random_Of_Valakas_Spawn = Random_Of_Valakas_Spawn * 3600000;
  2202. Interval_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfBaiumSpawn", "121"));
  2203. if (Interval_Of_Baium_Spawn < 1 || Interval_Of_Baium_Spawn > 480)
  2204. Interval_Of_Baium_Spawn = 121;
  2205. Interval_Of_Baium_Spawn = Interval_Of_Baium_Spawn * 3600000;
  2206. Random_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfBaiumSpawn", "8"));
  2207. if (Random_Of_Baium_Spawn < 1 || Random_Of_Baium_Spawn > 192)
  2208. Random_Of_Baium_Spawn = 8;
  2209. Random_Of_Baium_Spawn = Random_Of_Baium_Spawn * 3600000;
  2210. Interval_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfCoreSpawn", "27"));
  2211. if (Interval_Of_Core_Spawn < 1 || Interval_Of_Core_Spawn > 480)
  2212. Interval_Of_Core_Spawn = 27;
  2213. Interval_Of_Core_Spawn = Interval_Of_Core_Spawn * 3600000;
  2214. Random_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfCoreSpawn", "47"));
  2215. if (Random_Of_Core_Spawn < 1 || Random_Of_Core_Spawn > 192)
  2216. Random_Of_Core_Spawn = 47;
  2217. Random_Of_Core_Spawn = Random_Of_Core_Spawn * 3600000;
  2218. Interval_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfOrfenSpawn", "28"));
  2219. if (Interval_Of_Orfen_Spawn < 1 || Interval_Of_Orfen_Spawn > 480)
  2220. Interval_Of_Orfen_Spawn = 28;
  2221. Interval_Of_Orfen_Spawn = Interval_Of_Orfen_Spawn * 3600000;
  2222. Random_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfOrfenSpawn", "41"));
  2223. if (Random_Of_Orfen_Spawn < 1 || Random_Of_Orfen_Spawn > 192)
  2224. Random_Of_Orfen_Spawn = 41;
  2225. Random_Of_Orfen_Spawn = Random_Of_Orfen_Spawn * 3600000;
  2226. Interval_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfQueenAntSpawn", "19"));
  2227. if (Interval_Of_QueenAnt_Spawn < 1 || Interval_Of_QueenAnt_Spawn > 480)
  2228. Interval_Of_QueenAnt_Spawn = 19;
  2229. Interval_Of_QueenAnt_Spawn = Interval_Of_QueenAnt_Spawn * 3600000;
  2230. Random_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfQueenAntSpawn", "35"));
  2231. if (Random_Of_QueenAnt_Spawn < 1 || Random_Of_QueenAnt_Spawn > 192)
  2232. Random_Of_QueenAnt_Spawn = 35;
  2233. Random_Of_QueenAnt_Spawn = Random_Of_QueenAnt_Spawn * 3600000;
  2234. Interval_Of_Zaken_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfZakenSpawn", "19"));
  2235. if (Interval_Of_Zaken_Spawn < 1 || Interval_Of_Zaken_Spawn > 480)
  2236. Interval_Of_Zaken_Spawn = 19;
  2237. Interval_Of_Zaken_Spawn = Interval_Of_Zaken_Spawn * 3600000;
  2238. Random_Of_Zaken_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfZakenSpawn", "35"));
  2239. if (Random_Of_Zaken_Spawn < 1 || Random_Of_Zaken_Spawn > 192)
  2240. Random_Of_Zaken_Spawn = 35;
  2241. Random_Of_Zaken_Spawn = Random_Of_Zaken_Spawn * 3600000;
  2242. }
  2243. catch (Exception e)
  2244. {
  2245. e.printStackTrace();
  2246. throw new Error("Failed to Load " + GRANDBOSS_CONFIG_FILE + " File.");
  2247. }
  2248. try
  2249. {
  2250. FILTER_LIST = new ArrayList<String>();
  2251. LineNumberReader lnr = new LineNumberReader(new BufferedReader(new FileReader(new File(CHAT_FILTER_FILE))));
  2252. String line = null;
  2253. while ((line = lnr.readLine()) != null)
  2254. {
  2255. if (line.trim().isEmpty() || line.startsWith("#"))
  2256. continue;
  2257. FILTER_LIST.add(line.trim());
  2258. }
  2259. _log.info("Loaded " + FILTER_LIST.size() + " Filter Words.");
  2260. }
  2261. catch (Exception e)
  2262. {
  2263. e.printStackTrace();
  2264. throw new Error("Failed to Load " + CHAT_FILTER_FILE + " File.");
  2265. }
  2266. }
  2267. finally
  2268. {
  2269. try
  2270. {
  2271. is.close();
  2272. }
  2273. catch (Exception e)
  2274. {}
  2275. }
  2276. }
  2277. else if(Server.serverMode == Server.MODE_LOGINSERVER)
  2278. {
  2279. _log.info("loading login config");
  2280. InputStream is = null;
  2281. try
  2282. {
  2283. try
  2284. {
  2285. L2Properties serverSettings = new L2Properties();
  2286. is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
  2287. serverSettings.load(is);
  2288. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");
  2289. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));
  2290. LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
  2291. PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
  2292. DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
  2293. PACKET_HANDLER_DEBUG = Boolean.parseBoolean(serverSettings.getProperty("PacketHandlerDebug", "false"));
  2294. DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
  2295. ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
  2296. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  2297. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  2298. LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
  2299. LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
  2300. LOG_LOGIN_CONTROLLER = Boolean.parseBoolean(serverSettings.getProperty("LogLoginController", "true"));
  2301. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); //FIXME: in login?
  2302. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
  2303. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
  2304. ROUTER_HOSTNAME = serverSettings.getProperty("RouterHostname", "");
  2305. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  2306. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  2307. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  2308. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  2309. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  2310. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  2311. SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
  2312. IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime","15"));
  2313. FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "False"));
  2314. AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));
  2315. FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
  2316. FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
  2317. NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
  2318. FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
  2319. MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
  2320. }
  2321. catch (Exception e)
  2322. {
  2323. e.printStackTrace();
  2324. throw new Error("Failed to Load " + LOGIN_CONFIGURATION_FILE + " File.");
  2325. }
  2326. // MMO
  2327. try
  2328. {
  2329. _log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  2330. L2Properties mmoSettings = new L2Properties();
  2331. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  2332. mmoSettings.load(is);
  2333. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  2334. MMO_IO_SELECTOR_THREAD_COUNT = Integer.parseInt(mmoSettings.getProperty("IOSelectorThreadCount", "2"));
  2335. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  2336. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  2337. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  2338. }
  2339. catch (Exception e)
  2340. {
  2341. e.printStackTrace();
  2342. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  2343. }
  2344. // Load Telnet L2Properties file (if exists)
  2345. try
  2346. {
  2347. L2Properties telnetSettings = new L2Properties();
  2348. is = new FileInputStream(new File(TELNET_FILE));
  2349. telnetSettings.load(is);
  2350. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  2351. }
  2352. catch (Exception e)
  2353. {
  2354. e.printStackTrace();
  2355. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  2356. }
  2357. }
  2358. finally
  2359. {
  2360. try
  2361. {
  2362. is.close();
  2363. }
  2364. catch(Exception e) { }
  2365. }
  2366. }
  2367. else
  2368. {
  2369. _log.severe("Could not Load Config: server mode was not set");
  2370. }
  2371. }
  2372. /**
  2373. * Set a new value to a game parameter from the admin console.
  2374. * @param pName (String) : name of the parameter to change
  2375. * @param pValue (String) : new value of the parameter
  2376. * @return boolean : true if modification has been made
  2377. * @link useAdminCommand
  2378. */
  2379. public static boolean setParameterValue(String pName, String pValue)
  2380. {
  2381. // rates.properties
  2382. if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
  2383. else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
  2384. else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
  2385. else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
  2386. else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
  2387. else if (pName.equalsIgnoreCase("RateExtractFish")) RATE_EXTR_FISH = Float.parseFloat(pValue);
  2388. else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
  2389. else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ITEMS_ID.put(57, Float.parseFloat(pValue));
  2390. else if (pName.equalsIgnoreCase("RateRaidDropItems")) RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(pValue);
  2391. else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
  2392. else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
  2393. else if (pName.equalsIgnoreCase("RateQuestDrop")) RATE_QUEST_DROP = Float.parseFloat(pValue);
  2394. else if (pName.equalsIgnoreCase("RateQuestReward")) RATE_QUEST_REWARD = Float.parseFloat(pValue);
  2395. else if (pName.equalsIgnoreCase("RateQuestRewardXP")) RATE_QUEST_REWARD_XP = Float.parseFloat(pValue);
  2396. else if (pName.equalsIgnoreCase("RateQuestRewardSP")) RATE_QUEST_REWARD_SP = Float.parseFloat(pValue);
  2397. else if (pName.equalsIgnoreCase("RateQuestRewardAdena")) RATE_QUEST_REWARD_ADENA = Float.parseFloat(pValue);
  2398. else if (pName.equalsIgnoreCase("UseQuestRewardMultipliers")) RATE_QUEST_REWARD_USE_MULTIPLIERS = Boolean.parseBoolean(pValue);
  2399. else if (pName.equalsIgnoreCase("RateQuestRewardPotion")) RATE_QUEST_REWARD_POTION = Float.parseFloat(pValue);
  2400. else if (pName.equalsIgnoreCase("RateQuestRewardScroll")) RATE_QUEST_REWARD_SCROLL = Float.parseFloat(pValue);
  2401. else if (pName.equalsIgnoreCase("RateQuestRewardRecipe")) RATE_QUEST_REWARD_RECIPE = Float.parseFloat(pValue);
  2402. else if (pName.equalsIgnoreCase("RateQuestRewardMaterial")) RATE_QUEST_REWARD_MATERIAL = Float.parseFloat(pValue);
  2403. else if (pName.equalsIgnoreCase("RateVitalityLevel1")) RATE_VITALITY_LEVEL_1 = Float.parseFloat(pValue);
  2404. else if (pName.equalsIgnoreCase("RateVitalityLevel2")) RATE_VITALITY_LEVEL_2 = Float.parseFloat(pValue);
  2405. else if (pName.equalsIgnoreCase("RateVitalityLevel3")) RATE_VITALITY_LEVEL_3 = Float.parseFloat(pValue);
  2406. else if (pName.equalsIgnoreCase("RateVitalityLevel4")) RATE_VITALITY_LEVEL_4 = Float.parseFloat(pValue);
  2407. else if (pName.equalsIgnoreCase("RateRecoveryPeaceZone")) RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(pValue);
  2408. else if (pName.equalsIgnoreCase("RateVitalityLost")) RATE_VITALITY_LOST = Float.parseFloat(pValue);
  2409. else if (pName.equalsIgnoreCase("RateVitalityGain")) RATE_VITALITY_GAIN = Float.parseFloat(pValue);
  2410. else if (pName.equalsIgnoreCase("RateRecoveryOnReconnect")) RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(pValue);
  2411. else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
  2412. else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
  2413. else if (pName.equalsIgnoreCase("RateCommonHerbs")) RATE_DROP_COMMON_HERBS = Float.parseFloat(pValue);
  2414. else if (pName.equalsIgnoreCase("RateHpMpHerbs")) RATE_DROP_MP_HP_HERBS = Float.parseFloat(pValue);
  2415. else if (pName.equalsIgnoreCase("RateGreaterHerbs")) RATE_DROP_GREATER_HERBS = Float.parseFloat(pValue);
  2416. else if (pName.equalsIgnoreCase("RateSuperiorHerbs")) RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(pValue);
  2417. else if (pName.equalsIgnoreCase("RateSpecialHerbs")) RATE_DROP_SPECIAL_HERBS = Float.parseFloat(pValue);
  2418. else if (pName.equalsIgnoreCase("RateVitalityHerbs")) RATE_DROP_VITALITY_HERBS = Float.parseFloat(pValue);
  2419. else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
  2420. else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
  2421. else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2422. else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2423. else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2424. else if (pName.equalsIgnoreCase("PetXpRate")) PET_XP_RATE = Float.parseFloat(pValue);
  2425. else if (pName.equalsIgnoreCase("PetFoodRate")) PET_FOOD_RATE = Integer.parseInt(pValue);
  2426. else if (pName.equalsIgnoreCase("SinEaterXpRate")) SINEATER_XP_RATE = Float.parseFloat(pValue);
  2427. else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
  2428. else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
  2429. else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2430. else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2431. else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2432. // general.properties
  2433. else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
  2434. else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2435. else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2436. else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.parseBoolean(pValue);
  2437. else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(pValue);
  2438. else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
  2439. else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(pValue);
  2440. else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
  2441. else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
  2442. else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
  2443. else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
  2444. else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
  2445. else if (pName.equalsIgnoreCase("AllowRefund")) ALLOW_REFUND = Boolean.parseBoolean(pValue);
  2446. else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.parseBoolean(pValue);
  2447. else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.parseBoolean(pValue);
  2448. else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
  2449. else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
  2450. else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.parseBoolean(pValue);
  2451. else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.parseBoolean(pValue);
  2452. else if (pName.equalsIgnoreCase("AllowBoat")) ALLOW_BOAT = Boolean.parseBoolean(pValue);
  2453. else if (pName.equalsIgnoreCase("AllowCursedWeapons")) ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(pValue);
  2454. else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.parseBoolean(pValue);
  2455. else if (pName.equalsIgnoreCase("AllowNpcWalkers")) ALLOW_NPC_WALKERS = Boolean.parseBoolean(pValue);
  2456. else if (pName.equalsIgnoreCase("AllowPetWalkers")) ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
  2457. else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.parseBoolean(pValue);
  2458. else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = Integer.parseInt(pValue);
  2459. else if (pName.equalsIgnoreCase("BBSShowPlayerList")) BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
  2460. else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
  2461. else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  2462. else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  2463. else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
  2464. else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
  2465. else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.parseBoolean(pValue);
  2466. else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.parseBoolean(pValue);
  2467. else if (pName.equalsIgnoreCase("ShowCrestWithoutQuest")) SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(pValue);
  2468. else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);
  2469. else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(pValue);
  2470. else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
  2471. else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);
  2472. else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.parseBoolean(pValue);
  2473. else if (pName.equalsIgnoreCase("MaxDriftRange")) MAX_DRIFT_RANGE = Integer.parseInt(pValue);
  2474. else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.parseBoolean(pValue);
  2475. else if (pName.equalsIgnoreCase("UseDeepBlueDropRulesRaid")) DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(pValue);
  2476. else if (pName.equalsIgnoreCase("GuardAttackAggroMob")) GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(pValue);
  2477. else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.parseBoolean(pValue);
  2478. else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
  2479. else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
  2480. else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
  2481. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
  2482. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
  2483. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
  2484. else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
  2485. else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
  2486. else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
  2487. else if (pName.equalsIgnoreCase("EnchantChanceElement")) ENCHANT_CHANCE_ELEMENT = Integer.parseInt(pValue);
  2488. else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
  2489. else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
  2490. else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
  2491. else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
  2492. else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
  2493. else if (pName.equalsIgnoreCase("AugmentationNGSkillChance")) AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(pValue);
  2494. else if (pName.equalsIgnoreCase("AugmentationNGGlowChance")) AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(pValue);
  2495. else if (pName.equalsIgnoreCase("AugmentationMidSkillChance")) AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(pValue);
  2496. else if (pName.equalsIgnoreCase("AugmentationMidGlowChance")) AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(pValue);
  2497. else if (pName.equalsIgnoreCase("AugmentationHighSkillChance")) AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(pValue);
  2498. else if (pName.equalsIgnoreCase("AugmentationHighGlowChance")) AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(pValue);
  2499. else if (pName.equalsIgnoreCase("AugmentationTopSkillChance")) AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(pValue);
  2500. else if (pName.equalsIgnoreCase("AugmentationTopGlowChance")) AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(pValue);
  2501. else if (pName.equalsIgnoreCase("AugmentationBaseStatChance")) AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(pValue);
  2502. else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2503. else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2504. else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2505. else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2506. else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  2507. else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier")) RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  2508. else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier")) RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  2509. else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
  2510. else if (pName.equalsIgnoreCase("RaidChaosTime")) RAID_CHAOS_TIME =Integer.parseInt(pValue);
  2511. else if (pName.equalsIgnoreCase("GrandChaosTime")) GRAND_CHAOS_TIME =Integer.parseInt(pValue);
  2512. else if (pName.equalsIgnoreCase("MinionChaosTime")) MINION_CHAOS_TIME =Integer.parseInt(pValue);
  2513. else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Long.parseLong(pValue);
  2514. else if (pName.equalsIgnoreCase("StartingLevel")) STARTING_LEVEL = Byte.parseByte(pValue);
  2515. else if (pName.equalsIgnoreCase("StartingSP")) STARTING_SP = Integer.parseInt(pValue);
  2516. else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
  2517. else if (pName.equalsIgnoreCase("TeleportWatchdogTimeout")) TELEPORT_WATCHDOG_TIMEOUT = Integer.parseInt(pValue);
  2518. else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
  2519. else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
  2520. else if (pName.equalsIgnoreCase("RestorePlayerInstance")) RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(pValue);
  2521. else if (pName.equalsIgnoreCase("AllowSummonToInstance")) ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(pValue);
  2522. else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
  2523. else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
  2524. else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
  2525. else if (pName.equalsIgnoreCase("RespawnRestoreCP")) RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
  2526. else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
  2527. else if (pName.equalsIgnoreCase("RespawnRestoreMP")) RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
  2528. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsDwarf")) MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(pValue);
  2529. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsOther")) MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(pValue);
  2530. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsDwarf")) MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(pValue);
  2531. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsOther")) MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(pValue);
  2532. else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  2533. else if (pName.equalsIgnoreCase("SubclassStoreSkillCooltime")) SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  2534. else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(pValue);
  2535. else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.parseBoolean(pValue);
  2536. else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.parseBoolean(pValue);
  2537. else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
  2538. else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
  2539. else if (pName.equalsIgnoreCase("AltGameCreationRareXpSpRate")) ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(pValue);
  2540. else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
  2541. else if (pName.equalsIgnoreCase("AltWeightLimit")) ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
  2542. else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes")) ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(pValue);
  2543. else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(pValue);
  2544. else if (pName.equalsIgnoreCase("RemoveCastleCirclets")) REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
  2545. else if (pName.equalsIgnoreCase("ReputationScorePerKill")) REPUTATION_SCORE_PER_KILL = Integer.parseInt(pValue);
  2546. else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
  2547. {
  2548. ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
  2549. ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
  2550. }
  2551. else if (pName.equalsIgnoreCase("AltShieldBlocks")) ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(pValue);
  2552. else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
  2553. else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.parseBoolean(pValue);
  2554. else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(pValue);
  2555. else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone")) ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  2556. else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
  2557. else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
  2558. else if (pName.equalsIgnoreCase("AllowClassMasters")) ALLOW_CLASS_MASTERS = Boolean.parseBoolean(pValue);
  2559. else if (pName.equalsIgnoreCase("AllowEntireTree")) ALLOW_ENTIRE_TREE = Boolean.parseBoolean(pValue);
  2560. else if (pName.equalsIgnoreCase("AlternateClassMaster")) ALTERNATE_CLASS_MASTER = Boolean.parseBoolean(pValue);
  2561. else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
  2562. else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
  2563. else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.parseBoolean(pValue);
  2564. else if (pName.equalsIgnoreCase("CraftMasterwork")) CRAFT_MASTERWORK = Boolean.parseBoolean(pValue);
  2565. else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
  2566. else if (pName.equalsIgnoreCase("SpBookNeeded")) SP_BOOK_NEEDED = Boolean.parseBoolean(pValue);
  2567. else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.parseBoolean(pValue);
  2568. else if (pName.equalsIgnoreCase("AutoLootRaids")) AUTO_LOOT_RAIDS = Boolean.parseBoolean(pValue);
  2569. else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);
  2570. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  2571. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(pValue);
  2572. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(pValue);
  2573. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pValue);
  2574. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pValue);
  2575. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pValue);
  2576. else if (pName.equalsIgnoreCase("MaxPersonalFamePoints")) MAX_PERSONAL_FAME_POINTS = Integer.parseInt(pValue);
  2577. else if (pName.equalsIgnoreCase("FortressZoneFameTaskFrequency")) FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  2578. else if (pName.equalsIgnoreCase("FortressZoneFameAquirePoints")) FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  2579. else if (pName.equalsIgnoreCase("CastleZoneFameTaskFrequency")) CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  2580. else if (pName.equalsIgnoreCase("CastleZoneFameAquirePoints")) CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  2581. else if (pName.equalsIgnoreCase("AltCastleForDawn")) ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(pValue);
  2582. else if (pName.equalsIgnoreCase("AltCastleForDusk")) ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(pValue);
  2583. else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(pValue);
  2584. else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(pValue);
  2585. else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
  2586. else if (pName.equalsIgnoreCase("AltSubclassEverywhere")) ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(pValue);
  2587. else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
  2588. else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
  2589. else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
  2590. else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(pValue);
  2591. else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
  2592. else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
  2593. else if (pName.equalsIgnoreCase("ChampionMaxLevel")) L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
  2594. else if (pName.equalsIgnoreCase("ChampionHp")) L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
  2595. else if (pName.equalsIgnoreCase("ChampionHpRegen")) L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
  2596. else if (pName.equalsIgnoreCase("ChampionRewards")) L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
  2597. else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(pValue);
  2598. else if (pName.equalsIgnoreCase("ChampionAtk")) L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
  2599. else if (pName.equalsIgnoreCase("ChampionSpdAtk")) L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
  2600. else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance")) L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  2601. else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance")) L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  2602. else if (pName.equalsIgnoreCase("ChampionRewardItemID")) L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
  2603. else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
  2604. else if (pName.equalsIgnoreCase("AllowWedding")) L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(pValue);
  2605. else if (pName.equalsIgnoreCase("WeddingPrice")) L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
  2606. else if (pName.equalsIgnoreCase("WeddingPunishInfidelity")) L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
  2607. else if (pName.equalsIgnoreCase("WeddingTeleport")) L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
  2608. else if (pName.equalsIgnoreCase("WeddingTeleportPrice")) L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
  2609. else if (pName.equalsIgnoreCase("WeddingTeleportDuration")) L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
  2610. else if (pName.equalsIgnoreCase("WeddingAllowSameSex")) L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
  2611. else if (pName.equalsIgnoreCase("WeddingFormalWear")) L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
  2612. else if (pName.equalsIgnoreCase("WeddingDivorceCosts")) L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
  2613. else if (pName.equalsIgnoreCase("TvTEventEnabled")) TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  2614. else if (pName.equalsIgnoreCase("TvTEventInterval")) TVT_EVENT_INTERVAL = pValue.split(",");
  2615. else if (pName.equalsIgnoreCase("TvTEventParticipationTime")) TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  2616. else if (pName.equalsIgnoreCase("TvTEventRunningTime")) TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  2617. else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId")) TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  2618. else if (pName.equalsIgnoreCase("EnableWarehouseSortingClan")) L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
  2619. else if (pName.equalsIgnoreCase("EnableWarehouseSortingPrivate")) L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
  2620. else if (pName.equalsIgnoreCase("EnableManaPotionSupport")) L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(pValue);
  2621. else if (pName.equalsIgnoreCase("DisplayServerTime")) L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(pValue);
  2622. else if (pName.equalsIgnoreCase("AntiFeedEnable")) L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(pValue);
  2623. else if (pName.equalsIgnoreCase("AntiFeedDualbox")) L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(pValue);
  2624. else if (pName.equalsIgnoreCase("AntiFeedDisconnectedAsDualbox")) L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(pValue);
  2625. else if (pName.equalsIgnoreCase("AntiFeedInterval")) L2JMOD_ANTIFEED_INTERVAL = 1000*Integer.parseInt(pValue);
  2626. else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
  2627. else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
  2628. else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
  2629. else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);
  2630. else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.parseBoolean(pValue);
  2631. else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pValue);
  2632. else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);
  2633. else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
  2634. else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
  2635. else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
  2636. else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
  2637. else if (pName.equalsIgnoreCase("GMAdminMenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
  2638. else return false;
  2639. return true;
  2640. }
  2641. private Config() { }
  2642. /**
  2643. * Save hexadecimal ID of the server in the L2Properties file.
  2644. * @param string (String) : hexadecimal ID of the server to store
  2645. * @see HEXID_FILE
  2646. * @see saveHexid(String string, String fileName)
  2647. * @link LoginServerThread
  2648. */
  2649. public static void saveHexid(int serverId, String string)
  2650. {
  2651. Config.saveHexid(serverId, string, HEXID_FILE);
  2652. }
  2653. /**
  2654. * Save hexadecimal ID of the server in the L2Properties file.
  2655. * @param hexId (String) : hexadecimal ID of the server to store
  2656. * @param fileName (String) : name of the L2Properties file
  2657. */
  2658. public static void saveHexid(int serverId, String hexId, String fileName)
  2659. {
  2660. try
  2661. {
  2662. L2Properties hexSetting = new L2Properties();
  2663. File file = new File(fileName);
  2664. //Create a new empty file only if it doesn't exist
  2665. file.createNewFile();
  2666. OutputStream out = new FileOutputStream(file);
  2667. hexSetting.setProperty("ServerID",String.valueOf(serverId));
  2668. hexSetting.setProperty("HexID",hexId);
  2669. hexSetting.store(out,"the hexID to auth into login");
  2670. out.close();
  2671. }
  2672. catch (Exception e)
  2673. {
  2674. _log.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
  2675. e.printStackTrace();
  2676. }
  2677. }
  2678. /**
  2679. * Loads flood protector configurations.
  2680. */
  2681. private static void loadFloodProtectorConfigs(final L2Properties properties)
  2682. {
  2683. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4");
  2684. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
  2685. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42");
  2686. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16");
  2687. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100");
  2688. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", "5");
  2689. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20");
  2690. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10");
  2691. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
  2692. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1");
  2693. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", "10");
  2694. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SENDMAIL, "SendMail", "600");
  2695. }
  2696. /**
  2697. * Loads single flood protector configuration.
  2698. *
  2699. * @param properties
  2700. * L2Properties file reader
  2701. * @param config
  2702. * flood protector configuration instance
  2703. * @param configString
  2704. * flood protector configuration string that determines for which flood protector
  2705. * configuration should be read
  2706. * @param defaultInterval
  2707. * default flood protector interval
  2708. */
  2709. private static void loadFloodProtectorConfig(final L2Properties properties, final FloodProtectorConfig config, final String configString, final String defaultInterval)
  2710. {
  2711. config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval));
  2712. config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False"));
  2713. config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0"));
  2714. config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
  2715. config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0"));
  2716. }
  2717. public static class ClassMasterSettings
  2718. {
  2719. private TIntObjectHashMap<TIntIntHashMap> _claimItems;
  2720. private TIntObjectHashMap<TIntIntHashMap> _rewardItems;
  2721. private TIntObjectHashMap<Boolean> _allowedClassChange;
  2722. public ClassMasterSettings(String _configLine)
  2723. {
  2724. _claimItems = new TIntObjectHashMap<TIntIntHashMap>(3);
  2725. _rewardItems = new TIntObjectHashMap<TIntIntHashMap>(3);
  2726. _allowedClassChange = new TIntObjectHashMap<Boolean>(3);
  2727. if (_configLine != null)
  2728. parseConfigLine(_configLine.trim());
  2729. }
  2730. private void parseConfigLine(String _configLine)
  2731. {
  2732. StringTokenizer st = new StringTokenizer(_configLine, ";");
  2733. while (st.hasMoreTokens())
  2734. {
  2735. // get allowed class change
  2736. int job = Integer.parseInt(st.nextToken());
  2737. _allowedClassChange.put(job, true);
  2738. TIntIntHashMap _items = new TIntIntHashMap();
  2739. // parse items needed for class change
  2740. if (st.hasMoreTokens())
  2741. {
  2742. StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  2743. while (st2.hasMoreTokens())
  2744. {
  2745. StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  2746. int _itemId = Integer.parseInt(st3.nextToken());
  2747. int _quantity = Integer.parseInt(st3.nextToken());
  2748. _items.put(_itemId, _quantity);
  2749. }
  2750. }
  2751. _claimItems.put(job, _items);
  2752. _items = new TIntIntHashMap();
  2753. // parse gifts after class change
  2754. if (st.hasMoreTokens())
  2755. {
  2756. StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  2757. while (st2.hasMoreTokens())
  2758. {
  2759. StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  2760. int _itemId = Integer.parseInt(st3.nextToken());
  2761. int _quantity = Integer.parseInt(st3.nextToken());
  2762. _items.put(_itemId, _quantity);
  2763. }
  2764. }
  2765. _rewardItems.put(job, _items);
  2766. }
  2767. }
  2768. public boolean isAllowed(int job)
  2769. {
  2770. if (_allowedClassChange == null)
  2771. return false;
  2772. if (_allowedClassChange.containsKey(job))
  2773. return _allowedClassChange.get(job);
  2774. return false;
  2775. }
  2776. public TIntIntHashMap getRewardItems(int job)
  2777. {
  2778. if (_rewardItems.containsKey(job))
  2779. return _rewardItems.get(job);
  2780. return null;
  2781. }
  2782. public TIntIntHashMap getRequireItems(int job)
  2783. {
  2784. if (_claimItems.containsKey(job))
  2785. return _claimItems.get(job);
  2786. return null;
  2787. }
  2788. }
  2789. }