2
0

Config.java 214 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764
  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.list.array.TIntArrayList;
  17. import gnu.trove.map.hash.TIntFloatHashMap;
  18. import gnu.trove.map.hash.TIntIntHashMap;
  19. import gnu.trove.map.hash.TIntObjectHashMap;
  20. import java.io.BufferedReader;
  21. import java.io.File;
  22. import java.io.FileInputStream;
  23. import java.io.FileOutputStream;
  24. import java.io.FileReader;
  25. import java.io.InputStream;
  26. import java.io.LineNumberReader;
  27. import java.io.OutputStream;
  28. import java.lang.reflect.Field;
  29. import java.lang.reflect.Modifier;
  30. import java.math.BigInteger;
  31. import java.net.InetAddress;
  32. import java.net.UnknownHostException;
  33. import java.util.ArrayList;
  34. import java.util.Arrays;
  35. import java.util.List;
  36. import java.util.StringTokenizer;
  37. import java.util.logging.Level;
  38. import java.util.logging.Logger;
  39. import javax.xml.parsers.DocumentBuilderFactory;
  40. import org.w3c.dom.Document;
  41. import org.w3c.dom.NamedNodeMap;
  42. import org.w3c.dom.Node;
  43. import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
  44. import com.l2jserver.gameserver.util.FloodProtectorConfig;
  45. import com.l2jserver.util.L2Properties;
  46. import com.l2jserver.util.StringUtil;
  47. public final class Config
  48. {
  49. protected static final Logger _log = Logger.getLogger(Config.class.getName());
  50. //--------------------------------------------------
  51. // L2J Property File Definitions
  52. //--------------------------------------------------
  53. public static final String CHARACTER_CONFIG_FILE = "./config/Character.properties";
  54. public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
  55. public static final String FORTSIEGE_CONFIGURATION_FILE = "./config/fortsiege.properties";
  56. public static final String GENERAL_CONFIG_FILE = "./config/General.properties";
  57. public static final String HEXID_FILE = "./config/hexid.txt";
  58. public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
  59. public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
  60. public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
  61. public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
  62. public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
  63. public static final String NPC_CONFIG_FILE = "./config/NPC.properties";
  64. public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
  65. public static final String RATES_CONFIG_FILE = "./config/rates.properties";
  66. public static final String CONFIGURATION_FILE = "./config/server.properties";
  67. public static final String IP_CONFIG_FILE = "./config/ipconfig.xml";
  68. public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
  69. public static final String TW_CONFIGURATION_FILE = "./config/territorywar.properties";
  70. public static final String TELNET_FILE = "./config/telnet.properties";
  71. public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
  72. public static final String MMO_CONFIG_FILE = "./config/mmo.properties";
  73. public static final String OLYMPIAD_CONFIG_FILE = "./config/olympiad.properties";
  74. public static final String COMMUNITY_CONFIGURATION_FILE = "./config/CommunityServer.properties";
  75. public static final String GRANDBOSS_CONFIG_FILE = "./config/Grandboss.properties";
  76. public static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.properties";
  77. public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
  78. public static final String SECURITY_CONFIG_FILE = "./config/security.properties";
  79. public static final String EMAIL_CONFIG_FILE = "./config/email.properties";
  80. public static final String CH_SIEGE_FILE = "./config/ConquerableHallSiege.properties";
  81. //--------------------------------------------------
  82. // L2J Variable Definitions
  83. //--------------------------------------------------
  84. public static int MASTERACCESS_LEVEL;
  85. public static int MASTERACCESS_NAME_COLOR;
  86. public static int MASTERACCESS_TITLE_COLOR;
  87. public static boolean ALT_GAME_DELEVEL;
  88. public static boolean DECREASE_SKILL_LEVEL;
  89. public static double ALT_WEIGHT_LIMIT;
  90. public static int RUN_SPD_BOOST;
  91. public static int DEATH_PENALTY_CHANCE;
  92. public static double RESPAWN_RESTORE_CP;
  93. public static double RESPAWN_RESTORE_HP;
  94. public static double RESPAWN_RESTORE_MP;
  95. public static boolean ALT_GAME_TIREDNESS;
  96. public static boolean ENABLE_MODIFY_SKILL_DURATION;
  97. public static TIntIntHashMap SKILL_DURATION_LIST;
  98. public static boolean ENABLE_MODIFY_SKILL_REUSE;
  99. public static TIntIntHashMap SKILL_REUSE_LIST;
  100. public static boolean AUTO_LEARN_SKILLS;
  101. public static boolean AUTO_LEARN_FS_SKILLS;
  102. public static boolean AUTO_LOOT_HERBS;
  103. public static byte BUFFS_MAX_AMOUNT;
  104. public static byte TRIGGERED_BUFFS_MAX_AMOUNT;
  105. public static byte DANCES_MAX_AMOUNT;
  106. public static boolean DANCE_CANCEL_BUFF;
  107. public static boolean DANCE_CONSUME_ADDITIONAL_MP;
  108. public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
  109. public static boolean ALT_GAME_CANCEL_BOW;
  110. public static boolean ALT_GAME_CANCEL_CAST;
  111. public static boolean EFFECT_CANCELING;
  112. public static boolean ALT_GAME_MAGICFAILURES;
  113. public static int PLAYER_FAKEDEATH_UP_PROTECTION;
  114. public static boolean STORE_SKILL_COOLTIME;
  115. public static boolean SUBCLASS_STORE_SKILL_COOLTIME;
  116. public static boolean SUMMON_STORE_SKILL_COOLTIME;
  117. public static boolean ALT_GAME_SHIELD_BLOCKS;
  118. public static int ALT_PERFECT_SHLD_BLOCK;
  119. public static boolean ALLOW_CLASS_MASTERS;
  120. public static ClassMasterSettings CLASS_MASTER_SETTINGS;
  121. public static boolean ALLOW_ENTIRE_TREE;
  122. public static boolean ALTERNATE_CLASS_MASTER;
  123. public static boolean LIFE_CRYSTAL_NEEDED;
  124. public static boolean ES_SP_BOOK_NEEDED;
  125. public static boolean DIVINE_SP_BOOK_NEEDED;
  126. public static boolean ALT_GAME_SKILL_LEARN;
  127. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  128. public static boolean ALT_GAME_SUBCLASS_EVERYWHERE;
  129. public static boolean ALLOW_TRANSFORM_WITHOUT_QUEST;
  130. public static int FEE_DELETE_TRANSFER_SKILLS;
  131. public static int FEE_DELETE_SUBCLASS_SKILLS;
  132. public static boolean RESTORE_SERVITOR_ON_RECONNECT;
  133. public static boolean RESTORE_PET_ON_RECONNECT;
  134. public static double MAX_BONUS_EXP;
  135. public static int MAX_RUN_SPEED;
  136. public static int MAX_PCRIT_RATE;
  137. public static int MAX_MCRIT_RATE;
  138. public static int MAX_PATK_SPEED;
  139. public static int MAX_MATK_SPEED;
  140. public static int MAX_EVASION;
  141. public static int MIN_DEBUFF_CHANCE;
  142. public static int MAX_DEBUFF_CHANCE;
  143. public static byte MAX_SUBCLASS;
  144. public static byte BASE_SUBCLASS_LEVEL;
  145. public static byte MAX_SUBCLASS_LEVEL;
  146. public static int MAX_PVTSTORESELL_SLOTS_DWARF;
  147. public static int MAX_PVTSTORESELL_SLOTS_OTHER;
  148. public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
  149. public static int MAX_PVTSTOREBUY_SLOTS_OTHER;
  150. public static int INVENTORY_MAXIMUM_NO_DWARF;
  151. public static int INVENTORY_MAXIMUM_DWARF;
  152. public static int INVENTORY_MAXIMUM_GM;
  153. public static int INVENTORY_MAXIMUM_QUEST_ITEMS;
  154. public static int WAREHOUSE_SLOTS_DWARF;
  155. public static int WAREHOUSE_SLOTS_NO_DWARF;
  156. public static int WAREHOUSE_SLOTS_CLAN;
  157. public static int ALT_FREIGHT_SLOTS;
  158. public static int ALT_FREIGHT_PRIECE;
  159. public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
  160. public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
  161. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
  162. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
  163. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
  164. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
  165. public static int MAX_PERSONAL_FAME_POINTS;
  166. public static int FORTRESS_ZONE_FAME_TASK_FREQUENCY;
  167. public static int FORTRESS_ZONE_FAME_AQUIRE_POINTS;
  168. public static int CASTLE_ZONE_FAME_TASK_FREQUENCY;
  169. public static int CASTLE_ZONE_FAME_AQUIRE_POINTS;
  170. public static boolean FAME_FOR_DEAD_PLAYERS;
  171. public static boolean IS_CRAFTING_ENABLED;
  172. public static boolean CRAFT_MASTERWORK;
  173. public static int DWARF_RECIPE_LIMIT;
  174. public static int COMMON_RECIPE_LIMIT;
  175. public static boolean ALT_GAME_CREATION;
  176. public static double ALT_GAME_CREATION_SPEED;
  177. public static double ALT_GAME_CREATION_XP_RATE;
  178. public static double ALT_GAME_CREATION_RARE_XPSP_RATE;
  179. public static double ALT_GAME_CREATION_SP_RATE;
  180. public static boolean ALT_BLACKSMITH_USE_RECIPES;
  181. public static int ALT_CLAN_JOIN_DAYS;
  182. public static int ALT_CLAN_CREATE_DAYS;
  183. public static int ALT_CLAN_DISSOLVE_DAYS;
  184. public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
  185. public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
  186. public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
  187. public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
  188. public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
  189. public static int ALT_CLAN_MEMBERS_FOR_WAR;
  190. public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
  191. public static boolean REMOVE_CASTLE_CIRCLETS;
  192. public static int ALT_PARTY_RANGE;
  193. public static int ALT_PARTY_RANGE2;
  194. public static boolean ALT_LEAVE_PARTY_LEADER;
  195. public static long STARTING_ADENA;
  196. public static byte STARTING_LEVEL;
  197. public static int STARTING_SP;
  198. public static boolean AUTO_LOOT;
  199. public static boolean AUTO_LOOT_RAIDS;
  200. public static int LOOT_RAIDS_PRIVILEGE_INTERVAL;
  201. public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE;
  202. public static int UNSTUCK_INTERVAL;
  203. public static int TELEPORT_WATCHDOG_TIMEOUT;
  204. public static int PLAYER_SPAWN_PROTECTION;
  205. public static ArrayList<Integer> SPAWN_PROTECTION_ALLOWED_ITEMS;
  206. public static int PLAYER_TELEPORT_PROTECTION;
  207. public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED;
  208. public static boolean OFFSET_ON_TELEPORT_ENABLED;
  209. public static int MAX_OFFSET_ON_TELEPORT;
  210. public static boolean RESTORE_PLAYER_INSTANCE;
  211. public static boolean ALLOW_SUMMON_TO_INSTANCE;
  212. public static boolean PETITIONING_ALLOWED;
  213. public static int MAX_PETITIONS_PER_PLAYER;
  214. public static int MAX_PETITIONS_PENDING;
  215. public static boolean ALT_GAME_FREE_TELEPORT;
  216. public static int DELETE_DAYS;
  217. public static float ALT_GAME_EXPONENT_XP;
  218. public static float ALT_GAME_EXPONENT_SP;
  219. public static String PARTY_XP_CUTOFF_METHOD;
  220. public static double PARTY_XP_CUTOFF_PERCENT;
  221. public static int PARTY_XP_CUTOFF_LEVEL;
  222. public static boolean DISABLE_TUTORIAL;
  223. public static boolean EXPERTISE_PENALTY;
  224. public static boolean STORE_RECIPE_SHOPLIST;
  225. public static boolean STORE_UI_SETTINGS;
  226. public static String[] FORBIDDEN_NAMES;
  227. public static boolean SILENCE_MODE_EXCLUDE;
  228. //--------------------------------------------------
  229. // ClanHall Settings
  230. //--------------------------------------------------
  231. public static long CH_TELE_FEE_RATIO;
  232. public static int CH_TELE1_FEE;
  233. public static int CH_TELE2_FEE;
  234. public static long CH_ITEM_FEE_RATIO;
  235. public static int CH_ITEM1_FEE;
  236. public static int CH_ITEM2_FEE;
  237. public static int CH_ITEM3_FEE;
  238. public static long CH_MPREG_FEE_RATIO;
  239. public static int CH_MPREG1_FEE;
  240. public static int CH_MPREG2_FEE;
  241. public static int CH_MPREG3_FEE;
  242. public static int CH_MPREG4_FEE;
  243. public static int CH_MPREG5_FEE;
  244. public static long CH_HPREG_FEE_RATIO;
  245. public static int CH_HPREG1_FEE;
  246. public static int CH_HPREG2_FEE;
  247. public static int CH_HPREG3_FEE;
  248. public static int CH_HPREG4_FEE;
  249. public static int CH_HPREG5_FEE;
  250. public static int CH_HPREG6_FEE;
  251. public static int CH_HPREG7_FEE;
  252. public static int CH_HPREG8_FEE;
  253. public static int CH_HPREG9_FEE;
  254. public static int CH_HPREG10_FEE;
  255. public static int CH_HPREG11_FEE;
  256. public static int CH_HPREG12_FEE;
  257. public static int CH_HPREG13_FEE;
  258. public static long CH_EXPREG_FEE_RATIO;
  259. public static int CH_EXPREG1_FEE;
  260. public static int CH_EXPREG2_FEE;
  261. public static int CH_EXPREG3_FEE;
  262. public static int CH_EXPREG4_FEE;
  263. public static int CH_EXPREG5_FEE;
  264. public static int CH_EXPREG6_FEE;
  265. public static int CH_EXPREG7_FEE;
  266. public static long CH_SUPPORT_FEE_RATIO;
  267. public static int CH_SUPPORT1_FEE;
  268. public static int CH_SUPPORT2_FEE;
  269. public static int CH_SUPPORT3_FEE;
  270. public static int CH_SUPPORT4_FEE;
  271. public static int CH_SUPPORT5_FEE;
  272. public static int CH_SUPPORT6_FEE;
  273. public static int CH_SUPPORT7_FEE;
  274. public static int CH_SUPPORT8_FEE;
  275. public static long CH_CURTAIN_FEE_RATIO;
  276. public static int CH_CURTAIN1_FEE;
  277. public static int CH_CURTAIN2_FEE;
  278. public static long CH_FRONT_FEE_RATIO;
  279. public static int CH_FRONT1_FEE;
  280. public static int CH_FRONT2_FEE;
  281. public static boolean CH_BUFF_FREE;
  282. //--------------------------------------------------
  283. // Castle Settings
  284. //--------------------------------------------------
  285. public static long CS_TELE_FEE_RATIO;
  286. public static int CS_TELE1_FEE;
  287. public static int CS_TELE2_FEE;
  288. public static long CS_MPREG_FEE_RATIO;
  289. public static int CS_MPREG1_FEE;
  290. public static int CS_MPREG2_FEE;
  291. public static int CS_MPREG3_FEE;
  292. public static int CS_MPREG4_FEE;
  293. public static long CS_HPREG_FEE_RATIO;
  294. public static int CS_HPREG1_FEE;
  295. public static int CS_HPREG2_FEE;
  296. public static int CS_HPREG3_FEE;
  297. public static int CS_HPREG4_FEE;
  298. public static int CS_HPREG5_FEE;
  299. public static long CS_EXPREG_FEE_RATIO;
  300. public static int CS_EXPREG1_FEE;
  301. public static int CS_EXPREG2_FEE;
  302. public static int CS_EXPREG3_FEE;
  303. public static int CS_EXPREG4_FEE;
  304. public static long CS_SUPPORT_FEE_RATIO;
  305. public static int CS_SUPPORT1_FEE;
  306. public static int CS_SUPPORT2_FEE;
  307. public static int CS_SUPPORT3_FEE;
  308. public static int CS_SUPPORT4_FEE;
  309. public static List<String> CL_SET_SIEGE_TIME_LIST;
  310. public static List<Integer> SIEGE_HOUR_LIST_MORNING;
  311. public static List<Integer> SIEGE_HOUR_LIST_AFTERNOON;
  312. //--------------------------------------------------
  313. // Fortress Settings
  314. //--------------------------------------------------
  315. public static long FS_TELE_FEE_RATIO;
  316. public static int FS_TELE1_FEE;
  317. public static int FS_TELE2_FEE;
  318. public static long FS_MPREG_FEE_RATIO;
  319. public static int FS_MPREG1_FEE;
  320. public static int FS_MPREG2_FEE;
  321. public static long FS_HPREG_FEE_RATIO;
  322. public static int FS_HPREG1_FEE;
  323. public static int FS_HPREG2_FEE;
  324. public static long FS_EXPREG_FEE_RATIO;
  325. public static int FS_EXPREG1_FEE;
  326. public static int FS_EXPREG2_FEE;
  327. public static long FS_SUPPORT_FEE_RATIO;
  328. public static int FS_SUPPORT1_FEE;
  329. public static int FS_SUPPORT2_FEE;
  330. public static int FS_BLOOD_OATH_COUNT;
  331. public static int FS_UPDATE_FRQ;
  332. public static int FS_MAX_SUPPLY_LEVEL;
  333. public static int FS_FEE_FOR_CASTLE;
  334. public static int FS_MAX_OWN_TIME;
  335. //--------------------------------------------------
  336. // Feature Settings
  337. //--------------------------------------------------
  338. public static int TAKE_FORT_POINTS;
  339. public static int LOOSE_FORT_POINTS;
  340. public static int TAKE_CASTLE_POINTS;
  341. public static int LOOSE_CASTLE_POINTS;
  342. public static int CASTLE_DEFENDED_POINTS;
  343. public static int FESTIVAL_WIN_POINTS;
  344. public static int HERO_POINTS;
  345. public static int ROYAL_GUARD_COST;
  346. public static int KNIGHT_UNIT_COST;
  347. public static int KNIGHT_REINFORCE_COST;
  348. public static int BALLISTA_POINTS;
  349. public static int BLOODALLIANCE_POINTS;
  350. public static int BLOODOATH_POINTS;
  351. public static int KNIGHTSEPAULETTE_POINTS;
  352. public static int REPUTATION_SCORE_PER_KILL;
  353. public static int JOIN_ACADEMY_MIN_REP_SCORE;
  354. public static int JOIN_ACADEMY_MAX_REP_SCORE;
  355. public static int RAID_RANKING_1ST;
  356. public static int RAID_RANKING_2ND;
  357. public static int RAID_RANKING_3RD;
  358. public static int RAID_RANKING_4TH;
  359. public static int RAID_RANKING_5TH;
  360. public static int RAID_RANKING_6TH;
  361. public static int RAID_RANKING_7TH;
  362. public static int RAID_RANKING_8TH;
  363. public static int RAID_RANKING_9TH;
  364. public static int RAID_RANKING_10TH;
  365. public static int RAID_RANKING_UP_TO_50TH;
  366. public static int RAID_RANKING_UP_TO_100TH;
  367. public static int CLAN_LEVEL_6_COST;
  368. public static int CLAN_LEVEL_7_COST;
  369. public static int CLAN_LEVEL_8_COST;
  370. public static int CLAN_LEVEL_9_COST;
  371. public static int CLAN_LEVEL_10_COST;
  372. public static int CLAN_LEVEL_11_COST;
  373. public static int CLAN_LEVEL_6_REQUIREMENT;
  374. public static int CLAN_LEVEL_7_REQUIREMENT;
  375. public static int CLAN_LEVEL_8_REQUIREMENT;
  376. public static int CLAN_LEVEL_9_REQUIREMENT;
  377. public static int CLAN_LEVEL_10_REQUIREMENT;
  378. public static int CLAN_LEVEL_11_REQUIREMENT;
  379. public static boolean ALLOW_WYVERN_DURING_SIEGE;
  380. //--------------------------------------------------
  381. // General Settings
  382. //--------------------------------------------------
  383. public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
  384. public static boolean DISPLAY_SERVER_VERSION;
  385. public static boolean SERVER_LIST_BRACKET;
  386. public static int SERVER_LIST_TYPE;
  387. public static int SERVER_LIST_AGE;
  388. public static boolean SERVER_GMONLY;
  389. public static boolean GM_HERO_AURA;
  390. public static boolean GM_STARTUP_INVULNERABLE;
  391. public static boolean GM_STARTUP_INVISIBLE;
  392. public static boolean GM_STARTUP_SILENCE;
  393. public static boolean GM_STARTUP_AUTO_LIST;
  394. public static boolean GM_STARTUP_DIET_MODE;
  395. public static String GM_ADMIN_MENU_STYLE;
  396. public static boolean GM_ITEM_RESTRICTION;
  397. public static boolean GM_SKILL_RESTRICTION;
  398. public static boolean GM_TRADE_RESTRICTED_ITEMS;
  399. public static boolean GM_RESTART_FIGHTING;
  400. public static boolean GM_ANNOUNCER_NAME;
  401. public static boolean GM_CRITANNOUNCER_NAME;
  402. public static boolean GM_GIVE_SPECIAL_SKILLS;
  403. public static boolean GM_GIVE_SPECIAL_AURA_SKILLS;
  404. public static boolean BYPASS_VALIDATION;
  405. public static boolean GAMEGUARD_ENFORCE;
  406. public static boolean GAMEGUARD_PROHIBITACTION;
  407. public static boolean LOG_CHAT;
  408. public static boolean LOG_ITEMS;
  409. public static boolean LOG_ITEMS_SMALL_LOG;
  410. public static boolean LOG_ITEM_ENCHANTS;
  411. public static boolean LOG_SKILL_ENCHANTS;
  412. public static boolean GMAUDIT;
  413. public static boolean LOG_GAME_DAMAGE;
  414. public static int LOG_GAME_DAMAGE_THRESHOLD;
  415. public static boolean SKILL_CHECK_ENABLE;
  416. public static boolean SKILL_CHECK_REMOVE;
  417. public static boolean SKILL_CHECK_GM;
  418. public static boolean DEBUG;
  419. public static boolean PACKET_HANDLER_DEBUG;
  420. public static boolean DEVELOPER;
  421. public static boolean ACCEPT_GEOEDITOR_CONN;
  422. public static boolean ALT_DEV_NO_HANDLERS;
  423. public static boolean ALT_DEV_NO_QUESTS;
  424. public static boolean ALT_DEV_NO_SPAWNS;
  425. public static int THREAD_P_EFFECTS;
  426. public static int THREAD_P_GENERAL;
  427. public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  428. public static int IO_PACKET_THREAD_CORE_SIZE;
  429. public static int GENERAL_THREAD_CORE_SIZE;
  430. public static int AI_MAX_THREAD;
  431. public static int CLIENT_PACKET_QUEUE_SIZE;
  432. public static int CLIENT_PACKET_QUEUE_MAX_BURST_SIZE;
  433. public static int CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND;
  434. public static int CLIENT_PACKET_QUEUE_MEASURE_INTERVAL;
  435. public static int CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND;
  436. public static int CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN;
  437. public static int CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN;
  438. public static int CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN;
  439. public static int CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN;
  440. public static boolean DEADLOCK_DETECTOR;
  441. public static int DEADLOCK_CHECK_INTERVAL;
  442. public static boolean RESTART_ON_DEADLOCK;
  443. public static boolean ALLOW_DISCARDITEM;
  444. public static int AUTODESTROY_ITEM_AFTER;
  445. public static int HERB_AUTO_DESTROY_TIME;
  446. public static TIntArrayList LIST_PROTECTED_ITEMS;
  447. public static boolean DATABASE_CLEAN_UP;
  448. public static long CONNECTION_CLOSE_TIME;
  449. public static int CHAR_STORE_INTERVAL;
  450. public static boolean LAZY_ITEMS_UPDATE;
  451. public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
  452. public static boolean DESTROY_DROPPED_PLAYER_ITEM;
  453. public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
  454. public static boolean SAVE_DROPPED_ITEM;
  455. public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
  456. public static int SAVE_DROPPED_ITEM_INTERVAL;
  457. public static boolean CLEAR_DROPPED_ITEM_TABLE;
  458. public static boolean AUTODELETE_INVALID_QUEST_DATA;
  459. public static boolean PRECISE_DROP_CALCULATION;
  460. public static boolean MULTIPLE_ITEM_DROP;
  461. public static boolean FORCE_INVENTORY_UPDATE;
  462. public static boolean LAZY_CACHE;
  463. public static boolean CACHE_CHAR_NAMES;
  464. public static int MIN_NPC_ANIMATION;
  465. public static int MAX_NPC_ANIMATION;
  466. public static int MIN_MONSTER_ANIMATION;
  467. public static int MAX_MONSTER_ANIMATION;
  468. public static int COORD_SYNCHRONIZE;
  469. public static boolean ENABLE_FALLING_DAMAGE;
  470. public static boolean GRIDS_ALWAYS_ON;
  471. public static int GRID_NEIGHBOR_TURNON_TIME;
  472. public static int GRID_NEIGHBOR_TURNOFF_TIME;
  473. public static int WORLD_X_MIN;
  474. public static int WORLD_X_MAX;
  475. public static int WORLD_Y_MIN;
  476. public static int WORLD_Y_MAX;
  477. public static int GEODATA;
  478. public static boolean GEODATA_CELLFINDING;
  479. public static String PATHFIND_BUFFERS;
  480. public static float LOW_WEIGHT;
  481. public static float MEDIUM_WEIGHT;
  482. public static float HIGH_WEIGHT;
  483. public static boolean ADVANCED_DIAGONAL_STRATEGY;
  484. public static float DIAGONAL_WEIGHT;
  485. public static int MAX_POSTFILTER_PASSES;
  486. public static boolean DEBUG_PATH;
  487. public static boolean FORCE_GEODATA;
  488. public static boolean MOVE_BASED_KNOWNLIST;
  489. public static long KNOWNLIST_UPDATE_INTERVAL;
  490. public static int ZONE_TOWN;
  491. public static String DEFAULT_GLOBAL_CHAT;
  492. public static String DEFAULT_TRADE_CHAT;
  493. public static boolean ALLOW_WAREHOUSE;
  494. public static boolean WAREHOUSE_CACHE;
  495. public static int WAREHOUSE_CACHE_TIME;
  496. public static boolean ALLOW_REFUND;
  497. public static boolean ALLOW_MAIL;
  498. public static boolean ALLOW_ATTACHMENTS;
  499. public static boolean ALLOW_WEAR;
  500. public static int WEAR_DELAY;
  501. public static int WEAR_PRICE;
  502. public static boolean ALLOW_LOTTERY;
  503. public static boolean ALLOW_RACE;
  504. public static boolean ALLOW_WATER;
  505. public static boolean ALLOW_RENTPET;
  506. public static boolean ALLOWFISHING;
  507. public static boolean ALLOW_BOAT;
  508. public static int BOAT_BROADCAST_RADIUS;
  509. public static boolean ALLOW_CURSED_WEAPONS;
  510. public static boolean ALLOW_MANOR;
  511. public static boolean ALLOW_NPC_WALKERS;
  512. public static boolean ALLOW_PET_WALKERS;
  513. public static boolean SERVER_NEWS;
  514. public static int COMMUNITY_TYPE;
  515. public static boolean BBS_SHOW_PLAYERLIST;
  516. public static String BBS_DEFAULT;
  517. public static boolean SHOW_LEVEL_COMMUNITYBOARD;
  518. public static boolean SHOW_STATUS_COMMUNITYBOARD;
  519. public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
  520. public static int NAME_PER_ROW_COMMUNITYBOARD;
  521. public static boolean USE_SAY_FILTER;
  522. public static String CHAT_FILTER_CHARS;
  523. public static int[] BAN_CHAT_CHANNELS;
  524. public static int ALT_OLY_START_TIME;
  525. public static int ALT_OLY_MIN;
  526. public static long ALT_OLY_CPERIOD;
  527. public static long ALT_OLY_BATTLE;
  528. public static long ALT_OLY_WPERIOD;
  529. public static long ALT_OLY_VPERIOD;
  530. public static int ALT_OLY_START_POINTS;
  531. public static int ALT_OLY_WEEKLY_POINTS;
  532. public static int ALT_OLY_CLASSED;
  533. public static int ALT_OLY_NONCLASSED;
  534. public static int ALT_OLY_TEAMS;
  535. public static int ALT_OLY_REG_DISPLAY;
  536. public static int[][] ALT_OLY_CLASSED_REWARD;
  537. public static int[][] ALT_OLY_NONCLASSED_REWARD;
  538. public static int[][] ALT_OLY_TEAM_REWARD;
  539. public static int ALT_OLY_COMP_RITEM;
  540. public static int ALT_OLY_MIN_MATCHES;
  541. public static int ALT_OLY_GP_PER_POINT;
  542. public static int ALT_OLY_HERO_POINTS;
  543. public static int ALT_OLY_RANK1_POINTS;
  544. public static int ALT_OLY_RANK2_POINTS;
  545. public static int ALT_OLY_RANK3_POINTS;
  546. public static int ALT_OLY_RANK4_POINTS;
  547. public static int ALT_OLY_RANK5_POINTS;
  548. public static int ALT_OLY_MAX_POINTS;
  549. public static int ALT_OLY_DIVIDER_CLASSED;
  550. public static int ALT_OLY_DIVIDER_NON_CLASSED;
  551. public static int ALT_OLY_MAX_WEEKLY_MATCHES;
  552. public static int ALT_OLY_MAX_WEEKLY_MATCHES_NON_CLASSED;
  553. public static int ALT_OLY_MAX_WEEKLY_MATCHES_CLASSED;
  554. public static int ALT_OLY_MAX_WEEKLY_MATCHES_TEAM;
  555. public static boolean ALT_OLY_LOG_FIGHTS;
  556. public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
  557. public static boolean ALT_OLY_ANNOUNCE_GAMES;
  558. public static TIntArrayList LIST_OLY_RESTRICTED_ITEMS;
  559. public static int ALT_OLY_ENCHANT_LIMIT;
  560. public static int ALT_OLY_WAIT_TIME;
  561. public static int ALT_MANOR_REFRESH_TIME;
  562. public static int ALT_MANOR_REFRESH_MIN;
  563. public static int ALT_MANOR_APPROVE_TIME;
  564. public static int ALT_MANOR_APPROVE_MIN;
  565. public static int ALT_MANOR_MAINTENANCE_PERIOD;
  566. public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
  567. public static int ALT_MANOR_SAVE_PERIOD_RATE;
  568. public static long ALT_LOTTERY_PRIZE;
  569. public static long ALT_LOTTERY_TICKET_PRICE;
  570. public static float ALT_LOTTERY_5_NUMBER_RATE;
  571. public static float ALT_LOTTERY_4_NUMBER_RATE;
  572. public static float ALT_LOTTERY_3_NUMBER_RATE;
  573. public static long ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
  574. public static boolean ALT_ITEM_AUCTION_ENABLED;
  575. public static int ALT_ITEM_AUCTION_EXPIRED_AFTER;
  576. public static long ALT_ITEM_AUCTION_TIME_EXTENDS_ON_BID;
  577. public static int FS_TIME_ATTACK;
  578. public static int FS_TIME_COOLDOWN;
  579. public static int FS_TIME_ENTRY;
  580. public static int FS_TIME_WARMUP;
  581. public static int FS_PARTY_MEMBER_COUNT;
  582. public static int RIFT_MIN_PARTY_SIZE;
  583. public static int RIFT_SPAWN_DELAY;
  584. public static int RIFT_MAX_JUMPS;
  585. public static int RIFT_AUTO_JUMPS_TIME_MIN;
  586. public static int RIFT_AUTO_JUMPS_TIME_MAX;
  587. public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
  588. public static int RIFT_ENTER_COST_RECRUIT;
  589. public static int RIFT_ENTER_COST_SOLDIER;
  590. public static int RIFT_ENTER_COST_OFFICER;
  591. public static int RIFT_ENTER_COST_CAPTAIN;
  592. public static int RIFT_ENTER_COST_COMMANDER;
  593. public static int RIFT_ENTER_COST_HERO;
  594. public static int DEFAULT_PUNISH;
  595. public static int DEFAULT_PUNISH_PARAM;
  596. public static boolean ONLY_GM_ITEMS_FREE;
  597. public static boolean JAIL_IS_PVP;
  598. public static boolean JAIL_DISABLE_CHAT;
  599. public static boolean JAIL_DISABLE_TRANSACTION;
  600. public static boolean CUSTOM_SPAWNLIST_TABLE;
  601. public static boolean SAVE_GMSPAWN_ON_CUSTOM;
  602. public static boolean CUSTOM_NPC_TABLE;
  603. public static boolean CUSTOM_NPC_SKILLS_TABLE;
  604. public static boolean CUSTOM_ARMORSETS_TABLE;
  605. public static boolean CUSTOM_TELEPORT_TABLE;
  606. public static boolean CUSTOM_DROPLIST_TABLE;
  607. public static boolean CUSTOM_MERCHANT_TABLES;
  608. public static boolean CUSTOM_NPCBUFFER_TABLES;
  609. public static boolean CUSTOM_SKILLS_LOAD;
  610. public static boolean CUSTOM_ITEMS_LOAD;
  611. public static boolean CUSTOM_MULTISELL_LOAD;
  612. public static int ALT_BIRTHDAY_GIFT;
  613. public static String ALT_BIRTHDAY_MAIL_SUBJECT;
  614. public static String ALT_BIRTHDAY_MAIL_TEXT;
  615. public static boolean ENABLE_BLOCK_CHECKER_EVENT;
  616. public static int MIN_BLOCK_CHECKER_TEAM_MEMBERS;
  617. public static boolean HBCE_FAIR_PLAY;
  618. public static int PLAYER_MOVEMENT_BLOCK_TIME;
  619. public static boolean CLEAR_CREST_CACHE;
  620. //--------------------------------------------------
  621. // FloodProtector Settings
  622. //--------------------------------------------------
  623. public static FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM;
  624. public static FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE;
  625. public static FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK;
  626. public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON;
  627. public static FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE;
  628. public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
  629. public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS;
  630. public static FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM;
  631. public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS;
  632. public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
  633. public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
  634. public static FloodProtectorConfig FLOOD_PROTECTOR_MANUFACTURE;
  635. public static FloodProtectorConfig FLOOD_PROTECTOR_MANOR;
  636. public static FloodProtectorConfig FLOOD_PROTECTOR_SENDMAIL;
  637. public static FloodProtectorConfig FLOOD_PROTECTOR_CHARACTER_SELECT;
  638. public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_AUCTION;
  639. //--------------------------------------------------
  640. // L2JMods Settings
  641. //--------------------------------------------------
  642. public static boolean L2JMOD_CHAMPION_ENABLE;
  643. public static boolean L2JMOD_CHAMPION_PASSIVE;
  644. public static int L2JMOD_CHAMPION_FREQUENCY;
  645. public static String L2JMOD_CHAMP_TITLE;
  646. public static int L2JMOD_CHAMP_MIN_LVL;
  647. public static int L2JMOD_CHAMP_MAX_LVL;
  648. public static int L2JMOD_CHAMPION_HP;
  649. public static int L2JMOD_CHAMPION_REWARDS;
  650. public static float L2JMOD_CHAMPION_ADENAS_REWARDS;
  651. public static float L2JMOD_CHAMPION_HP_REGEN;
  652. public static float L2JMOD_CHAMPION_ATK;
  653. public static float L2JMOD_CHAMPION_SPD_ATK;
  654. public static int L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
  655. public static int L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
  656. public static int L2JMOD_CHAMPION_REWARD_ID;
  657. public static int L2JMOD_CHAMPION_REWARD_QTY;
  658. public static boolean L2JMOD_CHAMPION_ENABLE_VITALITY;
  659. public static boolean L2JMOD_CHAMPION_ENABLE_IN_INSTANCES;
  660. public static boolean TVT_EVENT_ENABLED;
  661. public static boolean TVT_EVENT_IN_INSTANCE;
  662. public static String TVT_EVENT_INSTANCE_FILE;
  663. public static String[] TVT_EVENT_INTERVAL;
  664. public static int TVT_EVENT_PARTICIPATION_TIME;
  665. public static int TVT_EVENT_RUNNING_TIME;
  666. public static int TVT_EVENT_PARTICIPATION_NPC_ID;
  667. public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  668. public static int[] TVT_EVENT_PARTICIPATION_FEE = new int[2];
  669. public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
  670. public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
  671. public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
  672. public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
  673. public static String TVT_EVENT_TEAM_1_NAME;
  674. public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  675. public static String TVT_EVENT_TEAM_2_NAME;
  676. public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  677. public static List<int[]> TVT_EVENT_REWARDS;
  678. public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  679. public static boolean TVT_EVENT_SCROLL_ALLOWED;
  680. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  681. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  682. public static List<Integer> TVT_DOORS_IDS_TO_OPEN;
  683. public static List<Integer> TVT_DOORS_IDS_TO_CLOSE;
  684. public static boolean TVT_REWARD_TEAM_TIE;
  685. public static byte TVT_EVENT_MIN_LVL;
  686. public static byte TVT_EVENT_MAX_LVL;
  687. public static int TVT_EVENT_EFFECTS_REMOVAL;
  688. public static TIntIntHashMap TVT_EVENT_FIGHTER_BUFFS;
  689. public static TIntIntHashMap TVT_EVENT_MAGE_BUFFS;
  690. public static int TVT_EVENT_MAX_PARTICIPANTS_PER_IP;
  691. public static boolean TVT_ALLOW_VOICED_COMMAND;
  692. public static boolean L2JMOD_ALLOW_WEDDING;
  693. public static int L2JMOD_WEDDING_PRICE;
  694. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  695. public static boolean L2JMOD_WEDDING_TELEPORT;
  696. public static int L2JMOD_WEDDING_TELEPORT_PRICE;
  697. public static int L2JMOD_WEDDING_TELEPORT_DURATION;
  698. public static boolean L2JMOD_WEDDING_SAMESEX;
  699. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  700. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  701. public static boolean L2JMOD_HELLBOUND_STATUS;
  702. public static boolean BANKING_SYSTEM_ENABLED;
  703. public static int BANKING_SYSTEM_GOLDBARS;
  704. public static int BANKING_SYSTEM_ADENA;
  705. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
  706. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
  707. public static boolean OFFLINE_TRADE_ENABLE;
  708. public static boolean OFFLINE_CRAFT_ENABLE;
  709. public static boolean OFFLINE_MODE_IN_PEACE_ZONE;
  710. public static boolean OFFLINE_MODE_SET_INVULNERABLE;
  711. public static boolean RESTORE_OFFLINERS;
  712. public static int OFFLINE_MAX_DAYS;
  713. public static boolean OFFLINE_DISCONNECT_FINISHED;
  714. public static boolean OFFLINE_SET_NAME_COLOR;
  715. public static int OFFLINE_NAME_COLOR;
  716. public static boolean OFFLINE_FAME;
  717. public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
  718. public static boolean L2JMOD_DISPLAY_SERVER_TIME;
  719. public static boolean WELCOME_MESSAGE_ENABLED;
  720. public static String WELCOME_MESSAGE_TEXT;
  721. public static int WELCOME_MESSAGE_TIME;
  722. public static boolean L2JMOD_ANTIFEED_ENABLE;
  723. public static boolean L2JMOD_ANTIFEED_DUALBOX;
  724. public static boolean L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX;
  725. public static int L2JMOD_ANTIFEED_INTERVAL;
  726. public static boolean ANNOUNCE_PK_PVP;
  727. public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE;
  728. public static String ANNOUNCE_PK_MSG;
  729. public static String ANNOUNCE_PVP_MSG;
  730. public static boolean L2JMOD_CHAT_ADMIN;
  731. public static boolean L2JMOD_MULTILANG_ENABLE;
  732. public static List<String> L2JMOD_MULTILANG_ALLOWED = new ArrayList<String>();
  733. public static String L2JMOD_MULTILANG_DEFAULT;
  734. public static boolean L2JMOD_MULTILANG_VOICED_ALLOW;
  735. public static boolean L2JMOD_MULTILANG_SM_ENABLE;
  736. public static List<String> L2JMOD_MULTILANG_SM_ALLOWED = new ArrayList<String>();
  737. public static boolean L2JMOD_MULTILANG_NS_ENABLE;
  738. public static List<String> L2JMOD_MULTILANG_NS_ALLOWED = new ArrayList<String>();
  739. public static boolean L2WALKER_PROTECTION;
  740. public static boolean L2JMOD_DEBUG_VOICE_COMMAND;
  741. public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
  742. public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
  743. public static int L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
  744. public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST;
  745. public static boolean L2JMOD_ALLOW_CHANGE_PASSWORD;
  746. //--------------------------------------------------
  747. // NPC Settings
  748. //--------------------------------------------------
  749. public static boolean ANNOUNCE_MAMMON_SPAWN;
  750. public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
  751. public static boolean ALT_ATTACKABLE_NPCS;
  752. public static boolean ALT_GAME_VIEWNPC;
  753. public static int MAX_DRIFT_RANGE;
  754. public static boolean DEEPBLUE_DROP_RULES;
  755. public static boolean DEEPBLUE_DROP_RULES_RAID;
  756. public static boolean SHOW_NPC_LVL;
  757. public static boolean SHOW_CREST_WITHOUT_QUEST;
  758. public static boolean ENABLE_RANDOM_ENCHANT_EFFECT;
  759. public static int MIN_NPC_LVL_DMG_PENALTY;
  760. public static TIntFloatHashMap NPC_DMG_PENALTY;
  761. public static TIntFloatHashMap NPC_CRIT_DMG_PENALTY;
  762. public static TIntFloatHashMap NPC_SKILL_DMG_PENALTY;
  763. public static int MIN_NPC_LVL_MAGIC_PENALTY;
  764. public static TIntFloatHashMap NPC_SKILL_CHANCE_PENALTY;
  765. public static int DECAY_TIME_TASK;
  766. public static int NPC_DECAY_TIME;
  767. public static int RAID_BOSS_DECAY_TIME;
  768. public static int SPOILED_DECAY_TIME;
  769. public static boolean GUARD_ATTACK_AGGRO_MOB;
  770. public static boolean ALLOW_WYVERN_UPGRADER;
  771. public static TIntArrayList LIST_PET_RENT_NPC;
  772. public static double RAID_HP_REGEN_MULTIPLIER;
  773. public static double RAID_MP_REGEN_MULTIPLIER;
  774. public static double RAID_PDEFENCE_MULTIPLIER;
  775. public static double RAID_MDEFENCE_MULTIPLIER;
  776. public static double RAID_PATTACK_MULTIPLIER;
  777. public static double RAID_MATTACK_MULTIPLIER;
  778. public static double RAID_MINION_RESPAWN_TIMER;
  779. public static TIntIntHashMap MINIONS_RESPAWN_TIME;
  780. public static float RAID_MIN_RESPAWN_MULTIPLIER;
  781. public static float RAID_MAX_RESPAWN_MULTIPLIER;
  782. public static boolean RAID_DISABLE_CURSE;
  783. public static int RAID_CHAOS_TIME;
  784. public static int GRAND_CHAOS_TIME;
  785. public static int MINION_CHAOS_TIME;
  786. public static int INVENTORY_MAXIMUM_PET;
  787. public static double PET_HP_REGEN_MULTIPLIER;
  788. public static double PET_MP_REGEN_MULTIPLIER;
  789. public static TIntArrayList NON_TALKING_NPCS;
  790. //--------------------------------------------------
  791. // PvP Settings
  792. //--------------------------------------------------
  793. public static int KARMA_MIN_KARMA;
  794. public static int KARMA_MAX_KARMA;
  795. public static int KARMA_XP_DIVIDER;
  796. public static int KARMA_LOST_BASE;
  797. public static boolean KARMA_DROP_GM;
  798. public static boolean KARMA_AWARD_PK_KILL;
  799. public static int KARMA_PK_LIMIT;
  800. public static String KARMA_NONDROPPABLE_PET_ITEMS;
  801. public static String KARMA_NONDROPPABLE_ITEMS;
  802. public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS;
  803. public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
  804. //--------------------------------------------------
  805. // Rate Settings
  806. //--------------------------------------------------
  807. public static float RATE_XP;
  808. public static float RATE_SP;
  809. public static float RATE_PARTY_XP;
  810. public static float RATE_PARTY_SP;
  811. public static float RATE_CONSUMABLE_COST;
  812. public static float RATE_HB_TRUST_INCREASE;
  813. public static float RATE_HB_TRUST_DECREASE;
  814. public static float RATE_EXTR_FISH;
  815. public static float RATE_DROP_ITEMS;
  816. public static float RATE_DROP_ITEMS_BY_RAID;
  817. public static float RATE_DROP_SPOIL;
  818. public static int RATE_DROP_MANOR;
  819. public static float RATE_QUEST_DROP;
  820. public static float RATE_QUEST_REWARD;
  821. public static float RATE_QUEST_REWARD_XP;
  822. public static float RATE_QUEST_REWARD_SP;
  823. public static float RATE_QUEST_REWARD_ADENA;
  824. public static boolean RATE_QUEST_REWARD_USE_MULTIPLIERS;
  825. public static float RATE_QUEST_REWARD_POTION;
  826. public static float RATE_QUEST_REWARD_SCROLL;
  827. public static float RATE_QUEST_REWARD_RECIPE;
  828. public static float RATE_QUEST_REWARD_MATERIAL;
  829. public static TIntFloatHashMap RATE_DROP_ITEMS_ID;
  830. public static float RATE_KARMA_EXP_LOST;
  831. public static float RATE_SIEGE_GUARDS_PRICE;
  832. public static float RATE_DROP_COMMON_HERBS;
  833. public static float RATE_DROP_HP_HERBS;
  834. public static float RATE_DROP_MP_HERBS;
  835. public static float RATE_DROP_SPECIAL_HERBS;
  836. public static int PLAYER_DROP_LIMIT;
  837. public static int PLAYER_RATE_DROP;
  838. public static int PLAYER_RATE_DROP_ITEM;
  839. public static int PLAYER_RATE_DROP_EQUIP;
  840. public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
  841. public static float PET_XP_RATE;
  842. public static int PET_FOOD_RATE;
  843. public static float SINEATER_XP_RATE;
  844. public static int KARMA_DROP_LIMIT;
  845. public static int KARMA_RATE_DROP;
  846. public static int KARMA_RATE_DROP_ITEM;
  847. public static int KARMA_RATE_DROP_EQUIP;
  848. public static int KARMA_RATE_DROP_EQUIP_WEAPON;
  849. public static double[] PLAYER_XP_PERCENT_LOST;
  850. //--------------------------------------------------
  851. // Seven Signs Settings
  852. //--------------------------------------------------
  853. public static boolean ALT_GAME_CASTLE_DAWN;
  854. public static boolean ALT_GAME_CASTLE_DUSK;
  855. public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
  856. public static int ALT_FESTIVAL_MIN_PLAYER;
  857. public static int ALT_MAXIMUM_PLAYER_CONTRIB;
  858. public static long ALT_FESTIVAL_MANAGER_START;
  859. public static long ALT_FESTIVAL_LENGTH;
  860. public static long ALT_FESTIVAL_CYCLE_LENGTH;
  861. public static long ALT_FESTIVAL_FIRST_SPAWN;
  862. public static long ALT_FESTIVAL_FIRST_SWARM;
  863. public static long ALT_FESTIVAL_SECOND_SPAWN;
  864. public static long ALT_FESTIVAL_SECOND_SWARM;
  865. public static long ALT_FESTIVAL_CHEST_SPAWN;
  866. public static double ALT_SIEGE_DAWN_GATES_PDEF_MULT;
  867. public static double ALT_SIEGE_DUSK_GATES_PDEF_MULT;
  868. public static double ALT_SIEGE_DAWN_GATES_MDEF_MULT;
  869. public static double ALT_SIEGE_DUSK_GATES_MDEF_MULT;
  870. public static boolean ALT_STRICT_SEVENSIGNS;
  871. public static boolean ALT_SEVENSIGNS_LAZY_UPDATE;
  872. //--------------------------------------------------
  873. // Server Settings
  874. //--------------------------------------------------
  875. public static int PORT_GAME;
  876. public static int PORT_LOGIN;
  877. public static String LOGIN_BIND_ADDRESS;
  878. public static int LOGIN_TRY_BEFORE_BAN;
  879. public static int LOGIN_BLOCK_AFTER_BAN;
  880. public static String GAMESERVER_HOSTNAME;
  881. public static String DATABASE_DRIVER;
  882. public static String DATABASE_URL;
  883. public static String DATABASE_LOGIN;
  884. public static String DATABASE_PASSWORD;
  885. public static int DATABASE_MAX_CONNECTIONS;
  886. public static int DATABASE_MAX_IDLE_TIME;
  887. public static int MAXIMUM_ONLINE_USERS;
  888. public static String CNAME_TEMPLATE;
  889. public static String PET_NAME_TEMPLATE;
  890. public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
  891. public static File DATAPACK_ROOT;
  892. public static boolean ACCEPT_ALTERNATE_ID;
  893. public static int REQUEST_ID;
  894. public static boolean RESERVE_HOST_ON_LOGIN = false;
  895. public static TIntArrayList PROTOCOL_LIST;
  896. public static boolean LOG_LOGIN_CONTROLLER;
  897. public static boolean LOGIN_SERVER_SCHEDULE_RESTART;
  898. public static long LOGIN_SERVER_SCHEDULE_RESTART_TIME;
  899. //--------------------------------------------------
  900. // CommunityServer Settings
  901. //--------------------------------------------------
  902. public static boolean ENABLE_COMMUNITY_BOARD;
  903. public static String COMMUNITY_SERVER_ADDRESS;
  904. public static int COMMUNITY_SERVER_PORT;
  905. public static byte[] COMMUNITY_SERVER_HEX_ID;
  906. public static int COMMUNITY_SERVER_SQL_DP_ID;
  907. //--------------------------------------------------
  908. // MMO Settings
  909. //--------------------------------------------------
  910. public static int MMO_SELECTOR_SLEEP_TIME;
  911. public static int MMO_MAX_SEND_PER_PASS;
  912. public static int MMO_MAX_READ_PER_PASS;
  913. public static int MMO_HELPER_BUFFER_COUNT;
  914. public static boolean MMO_TCP_NODELAY;
  915. //--------------------------------------------------
  916. // Vitality Settings
  917. //--------------------------------------------------
  918. public static boolean ENABLE_VITALITY;
  919. public static boolean RECOVER_VITALITY_ON_RECONNECT;
  920. public static boolean ENABLE_DROP_VITALITY_HERBS;
  921. public static float RATE_VITALITY_LEVEL_1;
  922. public static float RATE_VITALITY_LEVEL_2;
  923. public static float RATE_VITALITY_LEVEL_3;
  924. public static float RATE_VITALITY_LEVEL_4;
  925. public static float RATE_DROP_VITALITY_HERBS;
  926. public static float RATE_RECOVERY_VITALITY_PEACE_ZONE;
  927. public static float RATE_VITALITY_LOST;
  928. public static float RATE_VITALITY_GAIN;
  929. public static float RATE_RECOVERY_ON_RECONNECT;
  930. public static int STARTING_VITALITY_POINTS;
  931. //--------------------------------------------------
  932. // No classification assigned to the following yet
  933. //--------------------------------------------------
  934. public static int MAX_ITEM_IN_PACKET;
  935. public static boolean CHECK_KNOWN;
  936. public static int GAME_SERVER_LOGIN_PORT;
  937. public static String GAME_SERVER_LOGIN_HOST;
  938. public static String[] GAME_SERVER_SUBNETS;
  939. public static String[] GAME_SERVER_HOSTS;
  940. public static int NEW_NODE_ID;
  941. public static int SELECTED_NODE_ID;
  942. public static int LINKED_NODE_ID;
  943. public static String NEW_NODE_TYPE;
  944. public static String SERVER_VERSION;
  945. public static String SERVER_BUILD_DATE;
  946. public static String DATAPACK_VERSION;
  947. public static int PVP_NORMAL_TIME;
  948. public static int PVP_PVP_TIME;
  949. public static enum IdFactoryType
  950. {
  951. Compaction,
  952. BitSet,
  953. Stack
  954. }
  955. public static IdFactoryType IDFACTORY_TYPE;
  956. public static boolean BAD_ID_CHECKING;
  957. public static enum ObjectMapType
  958. {
  959. L2ObjectHashMap,
  960. WorldObjectMap
  961. }
  962. public static enum ObjectSetType
  963. {
  964. L2ObjectHashSet,
  965. WorldObjectSet
  966. }
  967. public static ObjectMapType MAP_TYPE;
  968. public static ObjectSetType SET_TYPE;
  969. public static int ENCHANT_CHANCE_WEAPON;
  970. public static int ENCHANT_CHANCE_ARMOR;
  971. public static int ENCHANT_CHANCE_JEWELRY;
  972. public static int ENCHANT_CHANCE_ELEMENT_STONE;
  973. public static int ENCHANT_CHANCE_ELEMENT_CRYSTAL;
  974. public static int ENCHANT_CHANCE_ELEMENT_JEWEL;
  975. public static int ENCHANT_CHANCE_ELEMENT_ENERGY;
  976. public static int BLESSED_ENCHANT_CHANCE_WEAPON;
  977. public static int BLESSED_ENCHANT_CHANCE_ARMOR;
  978. public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
  979. public static int ENCHANT_MAX_WEAPON;
  980. public static int ENCHANT_MAX_ARMOR;
  981. public static int ENCHANT_MAX_JEWELRY;
  982. public static int ENCHANT_SAFE_MAX;
  983. public static int ENCHANT_SAFE_MAX_FULL;
  984. public static int[] ENCHANT_BLACKLIST;
  985. public static int AUGMENTATION_NG_SKILL_CHANCE;
  986. public static int AUGMENTATION_NG_GLOW_CHANCE;
  987. public static int AUGMENTATION_MID_SKILL_CHANCE;
  988. public static int AUGMENTATION_MID_GLOW_CHANCE;
  989. public static int AUGMENTATION_HIGH_SKILL_CHANCE;
  990. public static int AUGMENTATION_HIGH_GLOW_CHANCE;
  991. public static int AUGMENTATION_TOP_SKILL_CHANCE;
  992. public static int AUGMENTATION_TOP_GLOW_CHANCE;
  993. public static int AUGMENTATION_BASESTAT_CHANCE;
  994. public static int AUGMENTATION_ACC_SKILL_CHANCE;
  995. public static int[] AUGMENTATION_BLACKLIST;
  996. public static double HP_REGEN_MULTIPLIER;
  997. public static double MP_REGEN_MULTIPLIER;
  998. public static double CP_REGEN_MULTIPLIER;
  999. public static boolean IS_TELNET_ENABLED;
  1000. public static boolean SHOW_LICENCE;
  1001. public static boolean ACCEPT_NEW_GAMESERVER;
  1002. public static int SERVER_ID;
  1003. public static byte[] HEX_ID;
  1004. public static boolean AUTO_CREATE_ACCOUNTS;
  1005. public static boolean FLOOD_PROTECTION;
  1006. public static int FAST_CONNECTION_LIMIT;
  1007. public static int NORMAL_CONNECTION_TIME;
  1008. public static int FAST_CONNECTION_TIME;
  1009. public static int MAX_CONNECTION_PER_IP;
  1010. // GrandBoss Settings
  1011. public static int Antharas_Wait_Time;
  1012. public static int Valakas_Wait_Time;
  1013. public static int Interval_Of_Antharas_Spawn;
  1014. public static int Random_Of_Antharas_Spawn;
  1015. public static int Interval_Of_Valakas_Spawn;
  1016. public static int Random_Of_Valakas_Spawn;
  1017. public static int Interval_Of_Baium_Spawn;
  1018. public static int Random_Of_Baium_Spawn;
  1019. public static int Interval_Of_Core_Spawn;
  1020. public static int Random_Of_Core_Spawn;
  1021. public static int Interval_Of_Orfen_Spawn;
  1022. public static int Random_Of_Orfen_Spawn;
  1023. public static int Interval_Of_QueenAnt_Spawn;
  1024. public static int Random_Of_QueenAnt_Spawn;
  1025. public static int Interval_Of_Zaken_Spawn;
  1026. public static int Random_Of_Zaken_Spawn;
  1027. public static int Interval_Of_Frintezza_Spawn;
  1028. public static int Random_Of_Frintezza_Spawn;
  1029. public static int BELETH_MIN_PLAYERS;
  1030. public static int INTERVAL_OF_BELETH_SPAWN;
  1031. public static int RANDOM_OF_BELETH_SPAWN;
  1032. // Gracia Seeds Settings
  1033. public static int SOD_TIAT_KILL_COUNT;
  1034. public static long SOD_STAGE_2_LENGTH;
  1035. //chatfilter
  1036. public static ArrayList<String> FILTER_LIST;
  1037. // Security
  1038. public static boolean SECOND_AUTH_ENABLED;
  1039. public static int SECOND_AUTH_MAX_ATTEMPTS;
  1040. public static long SECOND_AUTH_BAN_TIME;
  1041. public static String SECOND_AUTH_REC_LINK;
  1042. // Email
  1043. public static String EMAIL_SERVERINFO_NAME;
  1044. public static String EMAIL_SERVERINFO_ADDRESS;
  1045. public static boolean EMAIL_SYS_ENABLED;
  1046. public static String EMAIL_SYS_HOST;
  1047. public static int EMAIL_SYS_PORT;
  1048. public static boolean EMAIL_SYS_SMTP_AUTH;
  1049. public static String EMAIL_SYS_FACTORY;
  1050. public static boolean EMAIL_SYS_FACTORY_CALLBACK;
  1051. public static String EMAIL_SYS_USERNAME;
  1052. public static String EMAIL_SYS_PASSWORD;
  1053. public static String EMAIL_SYS_ADDRESS;
  1054. public static String EMAIL_SYS_SELECTQUERY;
  1055. public static String EMAIL_SYS_DBFIELD;
  1056. // Conquerable Halls Settings
  1057. public static int CHS_CLAN_MINLEVEL;
  1058. public static int CHS_MAX_ATTACKERS;
  1059. public static int CHS_MAX_FLAGS_PER_CLAN;
  1060. public static boolean CHS_ENABLE_FAME;
  1061. public static int CHS_FAME_AMOUNT;
  1062. public static int CHS_FAME_FREQUENCY;
  1063. /**
  1064. * This class initializes all global variables for configuration.<br>
  1065. * If the key doesn't appear in properties file, a default value is set by this class.
  1066. * {@link #CONFIGURATION_FILE} (properties file) for configuring your server.
  1067. */
  1068. public static void load()
  1069. {
  1070. if(Server.serverMode == Server.MODE_GAMESERVER)
  1071. {
  1072. FLOOD_PROTECTOR_USE_ITEM =
  1073. new FloodProtectorConfig("UseItemFloodProtector");
  1074. FLOOD_PROTECTOR_ROLL_DICE =
  1075. new FloodProtectorConfig("RollDiceFloodProtector");
  1076. FLOOD_PROTECTOR_FIREWORK =
  1077. new FloodProtectorConfig("FireworkFloodProtector");
  1078. FLOOD_PROTECTOR_ITEM_PET_SUMMON =
  1079. new FloodProtectorConfig("ItemPetSummonFloodProtector");
  1080. FLOOD_PROTECTOR_HERO_VOICE =
  1081. new FloodProtectorConfig("HeroVoiceFloodProtector");
  1082. FLOOD_PROTECTOR_GLOBAL_CHAT =
  1083. new FloodProtectorConfig("GlobalChatFloodProtector");
  1084. FLOOD_PROTECTOR_SUBCLASS =
  1085. new FloodProtectorConfig("SubclassFloodProtector");
  1086. FLOOD_PROTECTOR_DROP_ITEM =
  1087. new FloodProtectorConfig("DropItemFloodProtector");
  1088. FLOOD_PROTECTOR_SERVER_BYPASS =
  1089. new FloodProtectorConfig("ServerBypassFloodProtector");
  1090. FLOOD_PROTECTOR_MULTISELL =
  1091. new FloodProtectorConfig("MultiSellFloodProtector");
  1092. FLOOD_PROTECTOR_TRANSACTION =
  1093. new FloodProtectorConfig("TransactionFloodProtector");
  1094. FLOOD_PROTECTOR_MANUFACTURE =
  1095. new FloodProtectorConfig("ManufactureFloodProtector");
  1096. FLOOD_PROTECTOR_MANOR =
  1097. new FloodProtectorConfig("ManorFloodProtector");
  1098. FLOOD_PROTECTOR_SENDMAIL =
  1099. new FloodProtectorConfig("SendMailFloodProtector");
  1100. FLOOD_PROTECTOR_CHARACTER_SELECT =
  1101. new FloodProtectorConfig("CharacterSelectFloodProtector");
  1102. FLOOD_PROTECTOR_ITEM_AUCTION =
  1103. new FloodProtectorConfig("ItemAuctionFloodProtector");
  1104. _log.info("Loading GameServer Configuration Files...");
  1105. InputStream is = null;
  1106. try
  1107. {
  1108. try
  1109. {
  1110. L2Properties serverSettings = new L2Properties();
  1111. is = new FileInputStream(new File(CONFIGURATION_FILE));
  1112. serverSettings.load(is);
  1113. GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
  1114. PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
  1115. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
  1116. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");
  1117. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  1118. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  1119. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  1120. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jgs");
  1121. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  1122. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  1123. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  1124. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  1125. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  1126. CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
  1127. PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
  1128. MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
  1129. MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
  1130. String[] protocols = serverSettings.getProperty("AllowedProtocolRevisions", "267;268;271;273").split(";");
  1131. PROTOCOL_LIST = new TIntArrayList(protocols.length);
  1132. for (String protocol : protocols)
  1133. {
  1134. try
  1135. {
  1136. PROTOCOL_LIST.add(Integer.parseInt(protocol.trim()));
  1137. }
  1138. catch(NumberFormatException e)
  1139. {
  1140. _log.info("Wrong config protocol version: "+protocol+". Skipped.");
  1141. }
  1142. }
  1143. }
  1144. catch (Exception e)
  1145. {
  1146. e.printStackTrace();
  1147. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  1148. }
  1149. File file = new File(IP_CONFIG_FILE);
  1150. Document doc = null;
  1151. ArrayList <String> subnets = new ArrayList<String>(5);
  1152. ArrayList <String> hosts = new ArrayList<String>(5);
  1153. try
  1154. {
  1155. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  1156. factory.setValidating(false);
  1157. factory.setIgnoringComments(true);
  1158. doc = factory.newDocumentBuilder().parse(file);
  1159. for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
  1160. {
  1161. NamedNodeMap attrs;
  1162. Node att;
  1163. if ("gameserver".equalsIgnoreCase(n.getNodeName()))
  1164. {
  1165. for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
  1166. {
  1167. if ("define".equalsIgnoreCase(d.getNodeName()))
  1168. {
  1169. attrs = d.getAttributes();
  1170. att = attrs.getNamedItem("subnet");
  1171. if (att == null)
  1172. continue;
  1173. subnets.add(att.getNodeValue());
  1174. att = attrs.getNamedItem("address");
  1175. if (att == null)
  1176. continue;
  1177. hosts.add(att.getNodeValue());
  1178. if (hosts.size() != subnets.size())
  1179. throw new Error("Failed to Load "+IP_CONFIG_FILE+" File - subnets does not match server addresses.");
  1180. }
  1181. }
  1182. attrs = n.getAttributes();
  1183. att = attrs.getNamedItem("address");
  1184. if (att == null)
  1185. throw new Error("Failed to Load "+IP_CONFIG_FILE+" File - default server address is missing.");
  1186. subnets.add("0.0.0.0/0");
  1187. hosts.add(att.getNodeValue());
  1188. }
  1189. }
  1190. GAME_SERVER_SUBNETS = subnets.toArray(new String[subnets.size()]);
  1191. GAME_SERVER_HOSTS = hosts.toArray(new String[hosts.size()]);
  1192. }
  1193. catch (Exception e)
  1194. {
  1195. e.printStackTrace();
  1196. throw new Error("Failed to Load "+IP_CONFIG_FILE+" File.");
  1197. }
  1198. // Load Community Properties file (if exists)
  1199. try
  1200. {
  1201. L2Properties communityServerSettings = new L2Properties();
  1202. is = new FileInputStream(new File(COMMUNITY_CONFIGURATION_FILE));
  1203. communityServerSettings.load(is);
  1204. ENABLE_COMMUNITY_BOARD = Boolean.parseBoolean(communityServerSettings.getProperty("EnableCommunityBoard", "False"));
  1205. COMMUNITY_SERVER_ADDRESS = communityServerSettings.getProperty("CommunityServerHostname", "localhost");
  1206. COMMUNITY_SERVER_PORT = Integer.parseInt(communityServerSettings.getProperty("CommunityServerPort", "9013"));
  1207. COMMUNITY_SERVER_HEX_ID = new BigInteger(communityServerSettings.getProperty("CommunityServerHexId"), 16).toByteArray();
  1208. COMMUNITY_SERVER_SQL_DP_ID = Integer.parseInt(communityServerSettings.getProperty("CommunityServerSqlDpId", "200"));
  1209. }
  1210. catch (Exception e)
  1211. {
  1212. e.printStackTrace();
  1213. throw new Error("Failed to Load "+COMMUNITY_CONFIGURATION_FILE+" File.");
  1214. }
  1215. // Load Feature L2Properties file (if exists)
  1216. try
  1217. {
  1218. L2Properties Feature = new L2Properties();
  1219. is = new FileInputStream(new File(FEATURE_CONFIG_FILE));
  1220. Feature.load(is);
  1221. CH_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallTeleportFunctionFeeRatio", "604800000"));
  1222. CH_TELE1_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "7000"));
  1223. CH_TELE2_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "14000"));
  1224. CH_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallSupportFunctionFeeRatio", "86400000"));
  1225. CH_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl1", "2500"));
  1226. CH_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl2", "5000"));
  1227. CH_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl3", "7000"));
  1228. CH_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl4", "11000"));
  1229. CH_SUPPORT5_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl5", "21000"));
  1230. CH_SUPPORT6_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl6", "36000"));
  1231. CH_SUPPORT7_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl7", "37000"));
  1232. CH_SUPPORT8_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl8", "52000"));
  1233. CH_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRatio", "86400000"));
  1234. CH_MPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "2000"));
  1235. CH_MPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "3750"));
  1236. CH_MPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "6500"));
  1237. CH_MPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "13750"));
  1238. CH_MPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "20000"));
  1239. CH_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRatio", "86400000"));
  1240. CH_HPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "700"));
  1241. CH_HPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "800"));
  1242. CH_HPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "1000"));
  1243. CH_HPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "1166"));
  1244. CH_HPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "1500"));
  1245. CH_HPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "1750"));
  1246. CH_HPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "2000"));
  1247. CH_HPREG8_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "2250"));
  1248. CH_HPREG9_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "2500"));
  1249. CH_HPREG10_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "3250"));
  1250. CH_HPREG11_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "3270"));
  1251. CH_HPREG12_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "4250"));
  1252. CH_HPREG13_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "5166"));
  1253. CH_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRatio", "86400000"));
  1254. CH_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "3000"));
  1255. CH_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "6000"));
  1256. CH_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "9000"));
  1257. CH_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "15000"));
  1258. CH_EXPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "21000"));
  1259. CH_EXPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "23330"));
  1260. CH_EXPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "30000"));
  1261. CH_ITEM_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallItemCreationFunctionFeeRatio", "86400000"));
  1262. CH_ITEM1_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "30000"));
  1263. CH_ITEM2_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "70000"));
  1264. CH_ITEM3_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "140000"));
  1265. CH_CURTAIN_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallCurtainFunctionFeeRatio", "604800000"));
  1266. CH_CURTAIN1_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "2000"));
  1267. CH_CURTAIN2_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "2500"));
  1268. CH_FRONT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRatio", "259200000"));
  1269. CH_FRONT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "1300"));
  1270. CH_FRONT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "4000"));
  1271. CH_BUFF_FREE = Boolean.parseBoolean(Feature.getProperty("AltClanHallMpBuffFree", "False"));
  1272. CL_SET_SIEGE_TIME_LIST = new ArrayList<String>();
  1273. SIEGE_HOUR_LIST_MORNING = new ArrayList<Integer>();
  1274. SIEGE_HOUR_LIST_AFTERNOON = new ArrayList<Integer>();
  1275. String[] sstl = Feature.getProperty("CLSetSiegeTimeList", "").split(",");
  1276. if (sstl.length != 0)
  1277. {
  1278. boolean isHour = false;
  1279. for (String st : sstl)
  1280. {
  1281. if (st.equalsIgnoreCase("day") || st.equalsIgnoreCase("hour") || st.equalsIgnoreCase("minute"))
  1282. {
  1283. if (st.equalsIgnoreCase("hour")) isHour = true;
  1284. CL_SET_SIEGE_TIME_LIST.add(st.toLowerCase());
  1285. }
  1286. else
  1287. {
  1288. _log.warning(StringUtil.concat("[CLSetSiegeTimeList]: invalid config property -> CLSetSiegeTimeList \"", st, "\""));
  1289. }
  1290. }
  1291. if (isHour)
  1292. {
  1293. String[] shl = Feature.getProperty("SiegeHourList", "").split(",");
  1294. for (String st : shl)
  1295. {
  1296. if (!st.equalsIgnoreCase(""))
  1297. {
  1298. int val = Integer.parseInt(st);
  1299. if (val > 23 || val < 0)
  1300. _log.warning(StringUtil.concat("[SiegeHourList]: invalid config property -> SiegeHourList \"", st, "\""));
  1301. else if (val < 12)
  1302. SIEGE_HOUR_LIST_MORNING.add(val);
  1303. else
  1304. {
  1305. val -= 12;
  1306. SIEGE_HOUR_LIST_AFTERNOON.add(val);
  1307. }
  1308. }
  1309. }
  1310. if (Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty() && Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty())
  1311. {
  1312. _log.warning("[SiegeHourList]: invalid config property -> SiegeHourList is empty");
  1313. CL_SET_SIEGE_TIME_LIST.remove("hour");
  1314. }
  1315. }
  1316. }
  1317. CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
  1318. CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
  1319. CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
  1320. CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
  1321. CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
  1322. CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
  1323. CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
  1324. CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
  1325. CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
  1326. CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
  1327. CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
  1328. CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
  1329. CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
  1330. CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
  1331. CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
  1332. CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
  1333. CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
  1334. CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl4", "3270"));
  1335. CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl5", "5166"));
  1336. CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
  1337. CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
  1338. CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
  1339. CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
  1340. CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));
  1341. FS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressTeleportFunctionFeeRatio", "604800000"));
  1342. FS_TELE1_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl1", "1000"));
  1343. FS_TELE2_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl2", "10000"));
  1344. FS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressSupportFunctionFeeRatio", "86400000"));
  1345. FS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl1", "7000"));
  1346. FS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl2", "17000"));
  1347. FS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressMpRegenerationFunctionFeeRatio", "86400000"));
  1348. FS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl1", "6500"));
  1349. FS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl2", "9300"));
  1350. FS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressHpRegenerationFunctionFeeRatio", "86400000"));
  1351. FS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl1", "2000"));
  1352. FS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl2", "3500"));
  1353. FS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressExpRegenerationFunctionFeeRatio", "86400000"));
  1354. FS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl1", "9000"));
  1355. FS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl2", "10000"));
  1356. FS_UPDATE_FRQ = Integer.parseInt(Feature.getProperty("FortressPeriodicUpdateFrequency", "360"));
  1357. FS_BLOOD_OATH_COUNT = Integer.parseInt(Feature.getProperty("FortressBloodOathCount", "1"));
  1358. FS_MAX_SUPPLY_LEVEL = Integer.parseInt(Feature.getProperty("FortressMaxSupplyLevel", "6"));
  1359. FS_FEE_FOR_CASTLE = Integer.parseInt(Feature.getProperty("FortressFeeForCastle", "25000"));
  1360. FS_MAX_OWN_TIME = Integer.parseInt(Feature.getProperty("FortressMaximumOwnTime", "168"));
  1361. ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltCastleForDawn", "True"));
  1362. ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(Feature.getProperty("AltCastleForDusk", "True"));
  1363. ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
  1364. ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
  1365. ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
  1366. ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
  1367. ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
  1368. ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
  1369. ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
  1370. ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));
  1371. ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
  1372. ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
  1373. ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
  1374. ALT_SIEGE_DAWN_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesPdefMult", "1.1"));
  1375. ALT_SIEGE_DUSK_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesPdefMult", "0.8"));
  1376. ALT_SIEGE_DAWN_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesMdefMult", "1.1"));
  1377. ALT_SIEGE_DUSK_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesMdefMult", "0.8"));
  1378. ALT_STRICT_SEVENSIGNS = Boolean.parseBoolean(Feature.getProperty("StrictSevenSigns", "True"));
  1379. ALT_SEVENSIGNS_LAZY_UPDATE = Boolean.parseBoolean(Feature.getProperty("AltSevenSignsLazyUpdate", "True"));
  1380. TAKE_FORT_POINTS = Integer.parseInt(Feature.getProperty("TakeFortPoints", "200"));
  1381. LOOSE_FORT_POINTS = Integer.parseInt(Feature.getProperty("LooseFortPoints", "0"));
  1382. TAKE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("TakeCastlePoints", "1500"));
  1383. LOOSE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("LooseCastlePoints", "3000"));
  1384. CASTLE_DEFENDED_POINTS = Integer.parseInt(Feature.getProperty("CastleDefendedPoints", "750"));
  1385. FESTIVAL_WIN_POINTS = Integer.parseInt(Feature.getProperty("FestivalOfDarknessWin", "200"));
  1386. HERO_POINTS = Integer.parseInt(Feature.getProperty("HeroPoints", "1000"));
  1387. ROYAL_GUARD_COST = Integer.parseInt(Feature.getProperty("CreateRoyalGuardCost", "5000"));
  1388. KNIGHT_UNIT_COST = Integer.parseInt(Feature.getProperty("CreateKnightUnitCost", "10000"));
  1389. KNIGHT_REINFORCE_COST = Integer.parseInt(Feature.getProperty("ReinforceKnightUnitCost", "5000"));
  1390. BALLISTA_POINTS = Integer.parseInt(Feature.getProperty("KillBallistaPoints", "30"));
  1391. BLOODALLIANCE_POINTS = Integer.parseInt(Feature.getProperty("BloodAlliancePoints", "500"));
  1392. BLOODOATH_POINTS = Integer.parseInt(Feature.getProperty("BloodOathPoints", "200"));
  1393. KNIGHTSEPAULETTE_POINTS = Integer.parseInt(Feature.getProperty("KnightsEpaulettePoints", "20"));
  1394. REPUTATION_SCORE_PER_KILL = Integer.parseInt(Feature.getProperty("ReputationScorePerKill", "1"));
  1395. JOIN_ACADEMY_MIN_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMinPoints", "190"));
  1396. JOIN_ACADEMY_MAX_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMaxPoints", "650"));
  1397. RAID_RANKING_1ST = Integer.parseInt(Feature.getProperty("1stRaidRankingPoints", "1250"));
  1398. RAID_RANKING_2ND = Integer.parseInt(Feature.getProperty("2ndRaidRankingPoints", "900"));
  1399. RAID_RANKING_3RD = Integer.parseInt(Feature.getProperty("3rdRaidRankingPoints", "700"));
  1400. RAID_RANKING_4TH = Integer.parseInt(Feature.getProperty("4thRaidRankingPoints", "600"));
  1401. RAID_RANKING_5TH = Integer.parseInt(Feature.getProperty("5thRaidRankingPoints", "450"));
  1402. RAID_RANKING_6TH = Integer.parseInt(Feature.getProperty("6thRaidRankingPoints", "350"));
  1403. RAID_RANKING_7TH = Integer.parseInt(Feature.getProperty("7thRaidRankingPoints", "300"));
  1404. RAID_RANKING_8TH = Integer.parseInt(Feature.getProperty("8thRaidRankingPoints", "200"));
  1405. RAID_RANKING_9TH = Integer.parseInt(Feature.getProperty("9thRaidRankingPoints", "150"));
  1406. RAID_RANKING_10TH = Integer.parseInt(Feature.getProperty("10thRaidRankingPoints", "100"));
  1407. RAID_RANKING_UP_TO_50TH = Integer.parseInt(Feature.getProperty("UpTo50thRaidRankingPoints", "25"));
  1408. RAID_RANKING_UP_TO_100TH = Integer.parseInt(Feature.getProperty("UpTo100thRaidRankingPoints", "12"));
  1409. CLAN_LEVEL_6_COST = Integer.parseInt(Feature.getProperty("ClanLevel6Cost", "5000"));
  1410. CLAN_LEVEL_7_COST = Integer.parseInt(Feature.getProperty("ClanLevel7Cost", "10000"));
  1411. CLAN_LEVEL_8_COST = Integer.parseInt(Feature.getProperty("ClanLevel8Cost", "20000"));
  1412. CLAN_LEVEL_9_COST = Integer.parseInt(Feature.getProperty("ClanLevel9Cost", "40000"));
  1413. CLAN_LEVEL_10_COST = Integer.parseInt(Feature.getProperty("ClanLevel10Cost", "40000"));
  1414. CLAN_LEVEL_11_COST = Integer.parseInt(Feature.getProperty("ClanLevel11Cost", "75000"));
  1415. CLAN_LEVEL_6_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel6Requirement", "30"));
  1416. CLAN_LEVEL_7_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel7Requirement", "50"));
  1417. CLAN_LEVEL_8_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel8Requirement", "80"));
  1418. CLAN_LEVEL_9_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel9Requirement", "120"));
  1419. CLAN_LEVEL_10_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel10Requirement", "140"));
  1420. CLAN_LEVEL_11_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel11Requirement", "170"));
  1421. ALLOW_WYVERN_DURING_SIEGE = Boolean.parseBoolean(Feature.getProperty("AllowRideWyvernDuringSiege", "True"));
  1422. }
  1423. catch (Exception e)
  1424. {
  1425. e.printStackTrace();
  1426. throw new Error("Failed to Load "+FEATURE_CONFIG_FILE+" File.");
  1427. }
  1428. // Load Character L2Properties file (if exists)
  1429. try
  1430. {
  1431. L2Properties Character = new L2Properties();
  1432. is = new FileInputStream(new File(CHARACTER_CONFIG_FILE));
  1433. Character.load(is);
  1434. MASTERACCESS_LEVEL = Integer.parseInt(Character.getProperty("MasterAccessLevel", "127"));
  1435. MASTERACCESS_NAME_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterNameColor", "00FF00")));
  1436. MASTERACCESS_TITLE_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterTitleColor", "00FF00")));
  1437. ALT_GAME_DELEVEL = Boolean.parseBoolean(Character.getProperty("Delevel", "true"));
  1438. DECREASE_SKILL_LEVEL = Boolean.parseBoolean(Character.getProperty("DecreaseSkillOnDelevel", "true"));
  1439. ALT_WEIGHT_LIMIT = Double.parseDouble(Character.getProperty("AltWeightLimit", "1"));
  1440. RUN_SPD_BOOST = Integer.parseInt(Character.getProperty("RunSpeedBoost", "0"));
  1441. DEATH_PENALTY_CHANCE = Integer.parseInt(Character.getProperty("DeathPenaltyChance", "20"));
  1442. RESPAWN_RESTORE_CP = Double.parseDouble(Character.getProperty("RespawnRestoreCP", "0")) / 100;
  1443. RESPAWN_RESTORE_HP = Double.parseDouble(Character.getProperty("RespawnRestoreHP", "65")) / 100;
  1444. RESPAWN_RESTORE_MP = Double.parseDouble(Character.getProperty("RespawnRestoreMP", "0")) / 100;
  1445. HP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("HpRegenMultiplier", "100")) /100;
  1446. MP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("MpRegenMultiplier", "100")) /100;
  1447. CP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("CpRegenMultiplier", "100")) /100;
  1448. ALT_GAME_TIREDNESS = Boolean.parseBoolean(Character.getProperty("AltGameTiredness", "false"));
  1449. ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(Character.getProperty("EnableModifySkillDuration", "false"));
  1450. // Create Map only if enabled
  1451. if (ENABLE_MODIFY_SKILL_DURATION)
  1452. {
  1453. String[] propertySplit = Character.getProperty("SkillDurationList", "").split(";");
  1454. SKILL_DURATION_LIST = new TIntIntHashMap(propertySplit.length);
  1455. for (String skill : propertySplit)
  1456. {
  1457. String[] skillSplit = skill.split(",");
  1458. if (skillSplit.length != 2)
  1459. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillDurationList \"", skill, "\""));
  1460. else
  1461. {
  1462. try
  1463. {
  1464. SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  1465. }
  1466. catch (NumberFormatException nfe)
  1467. {
  1468. if (!skill.isEmpty())
  1469. {
  1470. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1471. }
  1472. }
  1473. }
  1474. }
  1475. }
  1476. ENABLE_MODIFY_SKILL_REUSE = Boolean.parseBoolean(Character.getProperty("EnableModifySkillReuse", "false"));
  1477. // Create Map only if enabled
  1478. if (ENABLE_MODIFY_SKILL_REUSE)
  1479. {
  1480. String[] propertySplit = Character.getProperty("SkillReuseList", "").split(";");
  1481. SKILL_REUSE_LIST = new TIntIntHashMap(propertySplit.length);
  1482. for (String skill : propertySplit)
  1483. {
  1484. String[] skillSplit = skill.split(",");
  1485. if (skillSplit.length != 2)
  1486. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillReuseList \"", skill, "\""));
  1487. else
  1488. {
  1489. try
  1490. {
  1491. SKILL_REUSE_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
  1492. }
  1493. catch (NumberFormatException nfe)
  1494. {
  1495. if (!skill.isEmpty())
  1496. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1497. }
  1498. }
  1499. }
  1500. }
  1501. AUTO_LEARN_SKILLS = Boolean.parseBoolean(Character.getProperty("AutoLearnSkills", "False"));
  1502. AUTO_LEARN_FS_SKILLS = Boolean.parseBoolean(Character.getProperty("AutoLearnForgottenScrollSkills", "False"));
  1503. AUTO_LOOT_HERBS = Boolean.parseBoolean(Character.getProperty("AutoLootHerbs", "false"));
  1504. BUFFS_MAX_AMOUNT = Byte.parseByte(Character.getProperty("MaxBuffAmount","20"));
  1505. TRIGGERED_BUFFS_MAX_AMOUNT = Byte.parseByte(Character.getProperty("MaxTriggeredBuffAmount","12"));
  1506. DANCES_MAX_AMOUNT = Byte.parseByte(Character.getProperty("MaxDanceAmount","12"));
  1507. DANCE_CANCEL_BUFF = Boolean.parseBoolean(Character.getProperty("DanceCancelBuff", "false"));
  1508. DANCE_CONSUME_ADDITIONAL_MP = Boolean.parseBoolean(Character.getProperty("DanceConsumeAdditionalMP", "true"));
  1509. AUTO_LEARN_DIVINE_INSPIRATION = Boolean.parseBoolean(Character.getProperty("AutoLearnDivineInspiration", "false"));
  1510. ALT_GAME_CANCEL_BOW = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1511. ALT_GAME_CANCEL_CAST = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1512. EFFECT_CANCELING = Boolean.parseBoolean(Character.getProperty("CancelLesserEffect", "True"));
  1513. ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(Character.getProperty("MagicFailures", "true"));
  1514. PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(Character.getProperty("PlayerFakeDeathUpProtection", "0"));
  1515. STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("StoreSkillCooltime", "true"));
  1516. SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("SubclassStoreSkillCooltime", "false"));
  1517. SUMMON_STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("SummonStoreSkillCooltime", "True"));
  1518. ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(Character.getProperty("AltShieldBlocks", "false"));
  1519. ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(Character.getProperty("AltPerfectShieldBlockRate", "10"));
  1520. ALLOW_CLASS_MASTERS = Boolean.parseBoolean(Character.getProperty("AllowClassMasters", "False"));
  1521. ALLOW_ENTIRE_TREE = Boolean.parseBoolean(Character.getProperty("AllowEntireTree", "False"));
  1522. ALTERNATE_CLASS_MASTER = Boolean.parseBoolean(Character.getProperty("AlternateClassMaster", "False"));
  1523. if (ALLOW_CLASS_MASTERS || ALTERNATE_CLASS_MASTER)
  1524. CLASS_MASTER_SETTINGS = new ClassMasterSettings(Character.getProperty("ConfigClassMaster"));
  1525. LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(Character.getProperty("LifeCrystalNeeded", "true"));
  1526. ES_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("EnchantSkillSpBookNeeded","true"));
  1527. DIVINE_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("DivineInspirationSpBookNeeded", "true"));
  1528. ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(Character.getProperty("AltGameSkillLearn", "false"));
  1529. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(Character.getProperty("AltSubClassWithoutQuests", "False"));
  1530. ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(Character.getProperty("AltSubclassEverywhere", "False"));
  1531. RESTORE_SERVITOR_ON_RECONNECT = Boolean.parseBoolean(Character.getProperty("RestoreServitorOnReconnect", "True"));
  1532. RESTORE_PET_ON_RECONNECT = Boolean.parseBoolean(Character.getProperty("RestorePetOnReconnect", "True"));
  1533. ALLOW_TRANSFORM_WITHOUT_QUEST = Boolean.parseBoolean(Character.getProperty("AltTransformationWithoutQuest", "False"));
  1534. FEE_DELETE_TRANSFER_SKILLS = Integer.parseInt(Character.getProperty("FeeDeleteTransferSkills", "10000000"));
  1535. FEE_DELETE_SUBCLASS_SKILLS = Integer.parseInt(Character.getProperty("FeeDeleteSubClassSkills", "10000000"));
  1536. ENABLE_VITALITY = Boolean.parseBoolean(Character.getProperty("EnableVitality", "True"));
  1537. RECOVER_VITALITY_ON_RECONNECT = Boolean.parseBoolean(Character.getProperty("RecoverVitalityOnReconnect", "True"));
  1538. STARTING_VITALITY_POINTS = Integer.parseInt(Character.getProperty("StartingVitalityPoints", "20000"));
  1539. MAX_BONUS_EXP = Double.parseDouble(Character.getProperty("MaxExpBonus", "3.5"));
  1540. MAX_RUN_SPEED = Integer.parseInt(Character.getProperty("MaxRunSpeed", "250"));
  1541. MAX_PCRIT_RATE = Integer.parseInt(Character.getProperty("MaxPCritRate", "500"));
  1542. MAX_MCRIT_RATE = Integer.parseInt(Character.getProperty("MaxMCritRate", "200"));
  1543. MAX_PATK_SPEED = Integer.parseInt(Character.getProperty("MaxPAtkSpeed", "1500"));
  1544. MAX_MATK_SPEED = Integer.parseInt(Character.getProperty("MaxMAtkSpeed", "1999"));
  1545. MAX_EVASION = Integer.parseInt(Character.getProperty("MaxEvasion", "250"));
  1546. MIN_DEBUFF_CHANCE = Integer.parseInt(Character.getProperty("MinDebuffChance", "10"));
  1547. MAX_DEBUFF_CHANCE = Integer.parseInt(Character.getProperty("MaxDebuffChance", "90"));
  1548. MAX_SUBCLASS = Byte.parseByte(Character.getProperty("MaxSubclass", "3"));
  1549. BASE_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("BaseSubclassLevel", "40"));
  1550. MAX_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("MaxSubclassLevel", "80"));
  1551. MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
  1552. MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsOther", "3"));
  1553. MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsDwarf", "5"));
  1554. MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsOther", "4"));
  1555. INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForNoDwarf", "80"));
  1556. INVENTORY_MAXIMUM_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForDwarf", "100"));
  1557. INVENTORY_MAXIMUM_GM = Integer.parseInt(Character.getProperty("MaximumSlotsForGMPlayer", "250"));
  1558. INVENTORY_MAXIMUM_QUEST_ITEMS = Integer.parseInt(Character.getProperty("MaximumSlotsForQuestItems", "100"));
  1559. MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
  1560. WAREHOUSE_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
  1561. WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
  1562. WAREHOUSE_SLOTS_CLAN = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForClan", "150"));
  1563. ALT_FREIGHT_SLOTS = Integer.parseInt(Character.getProperty("MaximumFreightSlots", "200"));
  1564. ALT_FREIGHT_PRIECE = Integer.parseInt(Character.getProperty("FreightPriece", "1000"));
  1565. ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("EnchantChanceWeapon", "66"));
  1566. ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("EnchantChanceArmor", "66"));
  1567. ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("EnchantChanceJewelry", "66"));
  1568. ENCHANT_CHANCE_ELEMENT_STONE = Integer.parseInt(Character.getProperty("EnchantChanceElementStone", "50"));
  1569. ENCHANT_CHANCE_ELEMENT_CRYSTAL = Integer.parseInt(Character.getProperty("EnchantChanceElementCrystal", "30"));
  1570. ENCHANT_CHANCE_ELEMENT_JEWEL = Integer.parseInt(Character.getProperty("EnchantChanceElementJewel", "20"));
  1571. ENCHANT_CHANCE_ELEMENT_ENERGY = Integer.parseInt(Character.getProperty("EnchantChanceElementEnergy", "10"));
  1572. BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("BlessedEnchantChanceWeapon", "66"));
  1573. BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("BlessedEnchantChanceArmor", "66"));
  1574. BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("BlessedEnchantChanceJewelry", "66"));
  1575. ENCHANT_MAX_WEAPON = Integer.parseInt(Character.getProperty("EnchantMaxWeapon", "0"));
  1576. ENCHANT_MAX_ARMOR = Integer.parseInt(Character.getProperty("EnchantMaxArmor", "0"));
  1577. ENCHANT_MAX_JEWELRY = Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "0"));
  1578. ENCHANT_SAFE_MAX = Integer.parseInt(Character.getProperty("EnchantSafeMax", "3"));
  1579. ENCHANT_SAFE_MAX_FULL = Integer.parseInt(Character.getProperty("EnchantSafeMaxFull", "4"));
  1580. String[] notenchantable = Character.getProperty("EnchantBlackList","7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296").split(",");
  1581. ENCHANT_BLACKLIST = new int[notenchantable.length];
  1582. for (int i = 0; i < notenchantable.length; i++)
  1583. ENCHANT_BLACKLIST[i] = Integer.parseInt(notenchantable[i]);
  1584. Arrays.sort(ENCHANT_BLACKLIST);
  1585. AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGSkillChance", "15"));
  1586. AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGGlowChance", "0"));
  1587. AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidSkillChance", "30"));
  1588. AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidGlowChance", "40"));
  1589. AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighSkillChance", "45"));
  1590. AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighGlowChance", "70"));
  1591. AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopSkillChance", "60"));
  1592. AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopGlowChance", "100"));
  1593. AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(Character.getProperty("AugmentationBaseStatChance", "1"));
  1594. AUGMENTATION_ACC_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationAccSkillChance", "0"));
  1595. String[] array = Character.getProperty("AugmentationBlackList", "6656,6657,6658,6659,6660,6661,6662,8191,10170,10314,13740,13741,13742,13743,13744,13745,13746,13747,13748,14592,14593,14594,14595,14596,14597,14598,14599,14600,14664,14665,14666,14667,14668,14669,14670,14671,14672,14801,14802,14803,14804,14805,14806,14807,14808,14809,15282,15283,15284,15285,15286,15287,15288,15289,15290,15291,15292,15293,15294,15295,15296,15297,15298,15299,16025,16026,21712,22173,22174,22175").split(",");
  1596. AUGMENTATION_BLACKLIST = new int[array.length];
  1597. for (int i = 0; i < array.length; i++)
  1598. AUGMENTATION_BLACKLIST[i] = Integer.parseInt(array[i]);
  1599. Arrays.sort(AUGMENTATION_BLACKLIST);
  1600. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
  1601. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanShop", "true"));
  1602. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTeleport", "true"));
  1603. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseGK", "false"));
  1604. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTrade", "true"));
  1605. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
  1606. MAX_PERSONAL_FAME_POINTS = Integer.parseInt(Character.getProperty("MaxPersonalFamePoints","100000"));
  1607. FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("FortressZoneFameTaskFrequency","300"));
  1608. FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("FortressZoneFameAquirePoints","31"));
  1609. CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("CastleZoneFameTaskFrequency","300"));
  1610. CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("CastleZoneFameAquirePoints","125"));
  1611. FAME_FOR_DEAD_PLAYERS = Boolean.parseBoolean(Character.getProperty("FameForDeadPlayers", "true"));
  1612. IS_CRAFTING_ENABLED = Boolean.parseBoolean(Character.getProperty("CraftingEnabled", "true"));
  1613. CRAFT_MASTERWORK = Boolean.parseBoolean(Character.getProperty("CraftMasterwork", "True"));
  1614. DWARF_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("DwarfRecipeLimit","50"));
  1615. COMMON_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("CommonRecipeLimit","50"));
  1616. ALT_GAME_CREATION = Boolean.parseBoolean(Character.getProperty("AltGameCreation", "false"));
  1617. ALT_GAME_CREATION_SPEED = Double.parseDouble(Character.getProperty("AltGameCreationSpeed", "1"));
  1618. ALT_GAME_CREATION_XP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationXpRate", "1"));
  1619. ALT_GAME_CREATION_SP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationSpRate", "1"));
  1620. ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationRareXpSpRate", "2"));
  1621. ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(Character.getProperty("AltBlacksmithUseRecipes", "true"));
  1622. ALT_CLAN_JOIN_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeJoinAClan", "1"));
  1623. ALT_CLAN_CREATE_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeCreateAClan", "10"));
  1624. ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(Character.getProperty("DaysToPassToDissolveAClan", "7"));
  1625. ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
  1626. ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
  1627. ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
  1628. ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(Character.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "1"));
  1629. ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(Character.getProperty("AltMaxNumOfClansInAlly", "3"));
  1630. ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(Character.getProperty("AltClanMembersForWar", "15"));
  1631. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH= Boolean.parseBoolean(Character.getProperty("AltMembersCanWithdrawFromClanWH", "false"));
  1632. REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(Character.getProperty("RemoveCastleCirclets", "true"));
  1633. ALT_PARTY_RANGE = Integer.parseInt(Character.getProperty("AltPartyRange", "1600"));
  1634. ALT_PARTY_RANGE2 = Integer.parseInt(Character.getProperty("AltPartyRange2", "1400"));
  1635. ALT_LEAVE_PARTY_LEADER = Boolean.parseBoolean(Character.getProperty("AltLeavePartyLeader", "False"));
  1636. STARTING_ADENA = Long.parseLong(Character.getProperty("StartingAdena", "0"));
  1637. STARTING_LEVEL = Byte.parseByte(Character.getProperty("StartingLevel", "1"));
  1638. STARTING_SP = Integer.parseInt(Character.getProperty("StartingSP", "0"));
  1639. AUTO_LOOT = Boolean.parseBoolean(Character.getProperty("AutoLoot", "false"));
  1640. AUTO_LOOT_RAIDS = Boolean.parseBoolean(Character.getProperty("AutoLootRaids", "false"));
  1641. LOOT_RAIDS_PRIVILEGE_INTERVAL = Integer.parseInt(Character.getProperty("RaidLootRightsInterval", "900")) * 1000;
  1642. LOOT_RAIDS_PRIVILEGE_CC_SIZE = Integer.parseInt(Character.getProperty("RaidLootRightsCCSize", "45"));
  1643. UNSTUCK_INTERVAL = Integer.parseInt(Character.getProperty("UnstuckInterval", "300"));
  1644. TELEPORT_WATCHDOG_TIMEOUT = Integer.parseInt(Character.getProperty("TeleportWatchdogTimeout", "0"));
  1645. PLAYER_SPAWN_PROTECTION = Integer.parseInt(Character.getProperty("PlayerSpawnProtection", "0"));
  1646. String[] items = Character.getProperty("PlayerSpawnProtectionAllowedItems", "0").split(",");
  1647. SPAWN_PROTECTION_ALLOWED_ITEMS = new ArrayList<Integer>(items.length);
  1648. for(String item : items)
  1649. {
  1650. Integer itm = 0;
  1651. try { itm = Integer.parseInt(item); }
  1652. catch(NumberFormatException nfe)
  1653. {
  1654. _log.warning("Player Spawn Protection: Wrong ItemId passed: "+item);
  1655. _log.warning(nfe.getMessage());
  1656. }
  1657. if(itm != 0)
  1658. SPAWN_PROTECTION_ALLOWED_ITEMS.add(itm);
  1659. }
  1660. SPAWN_PROTECTION_ALLOWED_ITEMS.trimToSize();
  1661. PLAYER_TELEPORT_PROTECTION = Integer.parseInt(Character.getProperty("PlayerTeleportProtection", "0"));
  1662. RANDOM_RESPAWN_IN_TOWN_ENABLED = Boolean.parseBoolean(Character.getProperty("RandomRespawnInTownEnabled", "True"));
  1663. OFFSET_ON_TELEPORT_ENABLED = Boolean.parseBoolean(Character.getProperty("OffsetOnTeleportEnabled", "True"));
  1664. MAX_OFFSET_ON_TELEPORT = Integer.parseInt(Character.getProperty("MaxOffsetOnTeleport", "50"));
  1665. RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(Character.getProperty("RestorePlayerInstance", "False"));
  1666. ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(Character.getProperty("AllowSummonToInstance", "True"));
  1667. PETITIONING_ALLOWED = Boolean.parseBoolean(Character.getProperty("PetitioningAllowed", "True"));
  1668. MAX_PETITIONS_PER_PLAYER = Integer.parseInt(Character.getProperty("MaxPetitionsPerPlayer", "5"));
  1669. MAX_PETITIONS_PENDING = Integer.parseInt(Character.getProperty("MaxPetitionsPending", "25"));
  1670. ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltFreeTeleporting", "False"));
  1671. DELETE_DAYS = Integer.parseInt(Character.getProperty("DeleteCharAfterDays", "7"));
  1672. ALT_GAME_EXPONENT_XP = Float.parseFloat(Character.getProperty("AltGameExponentXp", "0."));
  1673. ALT_GAME_EXPONENT_SP = Float.parseFloat(Character.getProperty("AltGameExponentSp", "0."));
  1674. PARTY_XP_CUTOFF_METHOD = Character.getProperty("PartyXpCutoffMethod", "level");
  1675. PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(Character.getProperty("PartyXpCutoffPercent", "3."));
  1676. PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(Character.getProperty("PartyXpCutoffLevel", "20"));
  1677. DISABLE_TUTORIAL = Boolean.parseBoolean(Character.getProperty("DisableTutorial", "False"));
  1678. EXPERTISE_PENALTY = Boolean.parseBoolean(Character.getProperty("ExpertisePenalty", "True"));
  1679. STORE_RECIPE_SHOPLIST = Boolean.parseBoolean(Character.getProperty("StoreRecipeShopList", "False"));
  1680. STORE_UI_SETTINGS = Boolean.parseBoolean(Character.getProperty("StoreCharUiSettings", "False"));
  1681. FORBIDDEN_NAMES = Character.getProperty("ForbiddenNames", "").split(",");
  1682. SILENCE_MODE_EXCLUDE = Boolean.parseBoolean(Character.getProperty("SilenceModeExclude", "False"));
  1683. PLAYER_MOVEMENT_BLOCK_TIME = Integer.parseInt(Character.getProperty("NpcTalkBlockingTime", "0")) * 1000;
  1684. }
  1685. catch (Exception e)
  1686. {
  1687. e.printStackTrace();
  1688. throw new Error("Failed to Load "+CHARACTER_CONFIG_FILE+" file.");
  1689. }
  1690. // Load L2J Server Version L2Properties file (if exists)
  1691. try
  1692. {
  1693. L2Properties serverVersion = new L2Properties();
  1694. is = new FileInputStream(new File(SERVER_VERSION_FILE));
  1695. serverVersion.load(is);
  1696. SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1697. SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
  1698. }
  1699. catch (Exception e)
  1700. {
  1701. //Ignore L2Properties file if it doesnt exist
  1702. SERVER_VERSION = "Unsupported Custom Version.";
  1703. SERVER_BUILD_DATE = "Undefined Date.";
  1704. }
  1705. // Load L2J Datapack Version L2Properties file (if exists)
  1706. try
  1707. {
  1708. L2Properties serverVersion = new L2Properties();
  1709. is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
  1710. serverVersion.load(is);
  1711. DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1712. }
  1713. catch (Exception e)
  1714. {
  1715. //Ignore L2Properties file if it doesnt exist
  1716. DATAPACK_VERSION = "Unsupported Custom Version.";
  1717. }
  1718. // Load Telnet L2Properties file (if exists)
  1719. try
  1720. {
  1721. L2Properties telnetSettings = new L2Properties();
  1722. is = new FileInputStream(new File(TELNET_FILE));
  1723. telnetSettings.load(is);
  1724. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  1725. }
  1726. catch (Exception e)
  1727. {
  1728. e.printStackTrace();
  1729. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1730. }
  1731. // MMO
  1732. try
  1733. {
  1734. //_log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  1735. L2Properties mmoSettings = new L2Properties();
  1736. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  1737. mmoSettings.load(is);
  1738. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  1739. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  1740. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  1741. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  1742. MMO_TCP_NODELAY = Boolean.parseBoolean(mmoSettings.getProperty("TcpNoDelay", "False"));
  1743. }
  1744. catch (Exception e)
  1745. {
  1746. e.printStackTrace();
  1747. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  1748. }
  1749. // Load IdFactory L2Properties file (if exists)
  1750. try
  1751. {
  1752. L2Properties idSettings = new L2Properties();
  1753. is = new FileInputStream(new File(ID_CONFIG_FILE));
  1754. idSettings.load(is);
  1755. MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
  1756. SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
  1757. IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
  1758. BAD_ID_CHECKING = Boolean.parseBoolean(idSettings.getProperty("BadIdChecking", "True"));
  1759. }
  1760. catch (Exception e)
  1761. {
  1762. e.printStackTrace();
  1763. throw new Error("Failed to Load "+ID_CONFIG_FILE+" file.");
  1764. }
  1765. // Load General L2Properties file (if exists)
  1766. try
  1767. {
  1768. L2Properties General = new L2Properties();
  1769. is = new FileInputStream(new File(GENERAL_CONFIG_FILE));
  1770. General.load(is);
  1771. EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(General.getProperty("EverybodyHasAdminRights", "false"));
  1772. DISPLAY_SERVER_VERSION = Boolean.parseBoolean(General.getProperty("DisplayServerRevision","True"));
  1773. SERVER_LIST_BRACKET = Boolean.parseBoolean(General.getProperty("ServerListBrackets", "false"));
  1774. SERVER_LIST_TYPE = getServerTypeId(General.getProperty("ServerListType", "Normal").split(","));
  1775. SERVER_LIST_AGE = Integer.parseInt(General.getProperty("ServerListAge", "0"));
  1776. SERVER_GMONLY = Boolean.parseBoolean(General.getProperty("ServerGMOnly", "false"));
  1777. GM_HERO_AURA = Boolean.parseBoolean(General.getProperty("GMHeroAura", "False"));
  1778. GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(General.getProperty("GMStartupInvulnerable", "False"));
  1779. GM_STARTUP_INVISIBLE = Boolean.parseBoolean(General.getProperty("GMStartupInvisible", "False"));
  1780. GM_STARTUP_SILENCE = Boolean.parseBoolean(General.getProperty("GMStartupSilence", "False"));
  1781. GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(General.getProperty("GMStartupAutoList", "False"));
  1782. GM_STARTUP_DIET_MODE = Boolean.parseBoolean(General.getProperty("GMStartupDietMode", "False"));
  1783. GM_ADMIN_MENU_STYLE = General.getProperty("GMAdminMenuStyle", "modern");
  1784. GM_ITEM_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMItemRestriction", "True"));
  1785. GM_SKILL_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMSkillRestriction", "True"));
  1786. GM_TRADE_RESTRICTED_ITEMS = Boolean.parseBoolean(General.getProperty("GMTradeRestrictedItems", "False"));
  1787. GM_RESTART_FIGHTING = Boolean.parseBoolean(General.getProperty("GMRestartFighting", "True"));
  1788. GM_ANNOUNCER_NAME = Boolean.parseBoolean(General.getProperty("GMShowAnnouncerName", "False"));
  1789. GM_CRITANNOUNCER_NAME = Boolean.parseBoolean(General.getProperty("GMShowCritAnnouncerName", "False"));
  1790. GM_GIVE_SPECIAL_SKILLS = Boolean.parseBoolean(General.getProperty("GMGiveSpecialSkills", "False"));
  1791. GM_GIVE_SPECIAL_AURA_SKILLS = Boolean.parseBoolean(General.getProperty("GMGiveSpecialAuraSkills", "False"));
  1792. BYPASS_VALIDATION = Boolean.parseBoolean(General.getProperty("BypassValidation", "True"));
  1793. GAMEGUARD_ENFORCE = Boolean.parseBoolean(General.getProperty("GameGuardEnforce", "False"));
  1794. GAMEGUARD_PROHIBITACTION = Boolean.parseBoolean(General.getProperty("GameGuardProhibitAction", "False"));
  1795. LOG_CHAT = Boolean.parseBoolean(General.getProperty("LogChat", "false"));
  1796. LOG_ITEMS = Boolean.parseBoolean(General.getProperty("LogItems", "false"));
  1797. LOG_ITEMS_SMALL_LOG = Boolean.parseBoolean(General.getProperty("LogItemsSmallLog", "false"));
  1798. LOG_ITEM_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogItemEnchants", "false"));
  1799. LOG_SKILL_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogSkillEnchants", "false"));
  1800. GMAUDIT = Boolean.parseBoolean(General.getProperty("GMAudit", "False"));
  1801. LOG_GAME_DAMAGE = Boolean.parseBoolean(General.getProperty("LogGameDamage", "False"));
  1802. LOG_GAME_DAMAGE_THRESHOLD = Integer.parseInt(General.getProperty("LogGameDamageThreshold", "5000"));
  1803. SKILL_CHECK_ENABLE = Boolean.parseBoolean(General.getProperty("SkillCheckEnable", "False"));
  1804. SKILL_CHECK_REMOVE = Boolean.parseBoolean(General.getProperty("SkillCheckRemove", "False"));
  1805. SKILL_CHECK_GM = Boolean.parseBoolean(General.getProperty("SkillCheckGM", "True"));
  1806. DEBUG = Boolean.parseBoolean(General.getProperty("Debug", "false"));
  1807. PACKET_HANDLER_DEBUG = Boolean.parseBoolean(General.getProperty("PacketHandlerDebug", "false"));
  1808. DEVELOPER = Boolean.parseBoolean(General.getProperty("Developer", "false"));
  1809. ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(General.getProperty("AcceptGeoeditorConn", "false"));
  1810. ALT_DEV_NO_HANDLERS = Boolean.parseBoolean(General.getProperty("AltDevNoHandlers", "False"));
  1811. ALT_DEV_NO_QUESTS = Boolean.parseBoolean(General.getProperty("AltDevNoQuests", "False"));
  1812. ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(General.getProperty("AltDevNoSpawns", "False"));
  1813. THREAD_P_EFFECTS = Integer.parseInt(General.getProperty("ThreadPoolSizeEffects", "10"));
  1814. THREAD_P_GENERAL = Integer.parseInt(General.getProperty("ThreadPoolSizeGeneral", "13"));
  1815. IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("UrgentPacketThreadCoreSize", "2"));
  1816. GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralPacketThreadCoreSize", "4"));
  1817. GENERAL_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralThreadCoreSize", "4"));
  1818. AI_MAX_THREAD = Integer.parseInt(General.getProperty("AiMaxThread", "6"));
  1819. CLIENT_PACKET_QUEUE_SIZE = Integer.parseInt(General.getProperty("ClientPacketQueueSize", "0"));
  1820. if (CLIENT_PACKET_QUEUE_SIZE == 0)
  1821. CLIENT_PACKET_QUEUE_SIZE = MMO_MAX_READ_PER_PASS + 2;
  1822. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = Integer.parseInt(General.getProperty("ClientPacketQueueMaxBurstSize", "0"));
  1823. if (CLIENT_PACKET_QUEUE_MAX_BURST_SIZE == 0)
  1824. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = MMO_MAX_READ_PER_PASS + 1;
  1825. CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND = Integer.parseInt(General.getProperty("ClientPacketQueueMaxPacketsPerSecond", "80"));
  1826. CLIENT_PACKET_QUEUE_MEASURE_INTERVAL = Integer.parseInt(General.getProperty("ClientPacketQueueMeasureInterval", "5"));
  1827. CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND = Integer.parseInt(General.getProperty("ClientPacketQueueMaxAveragePacketsPerSecond", "40"));
  1828. CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN = Integer.parseInt(General.getProperty("ClientPacketQueueMaxFloodsPerMin", "2"));
  1829. CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN = Integer.parseInt(General.getProperty("ClientPacketQueueMaxOverflowsPerMin", "1"));
  1830. CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = Integer.parseInt(General.getProperty("ClientPacketQueueMaxUnderflowsPerMin", "1"));
  1831. CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = Integer.parseInt(General.getProperty("ClientPacketQueueMaxUnknownPerMin", "5"));
  1832. DEADLOCK_DETECTOR = Boolean.parseBoolean(General.getProperty("DeadLockDetector", "True"));
  1833. DEADLOCK_CHECK_INTERVAL = Integer.parseInt(General.getProperty("DeadLockCheckInterval", "20"));
  1834. RESTART_ON_DEADLOCK = Boolean.parseBoolean(General.getProperty("RestartOnDeadlock", "False"));
  1835. ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
  1836. AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600"));
  1837. HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime","60"))*1000;
  1838. String[] split = General.getProperty("ListOfProtectedItems", "0").split(",");
  1839. LIST_PROTECTED_ITEMS = new TIntArrayList(split.length);
  1840. for (String id : split)
  1841. {
  1842. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
  1843. }
  1844. DATABASE_CLEAN_UP = Boolean.parseBoolean(General.getProperty("DatabaseCleanUp", "true"));
  1845. CONNECTION_CLOSE_TIME = Long.parseLong(General.getProperty("ConnectionCloseTime", "60000"));
  1846. CHAR_STORE_INTERVAL = Integer.parseInt(General.getProperty("CharacterDataStoreInterval", "15"));
  1847. LAZY_ITEMS_UPDATE = Boolean.parseBoolean(General.getProperty("LazyItemsUpdate", "false"));
  1848. UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(General.getProperty("UpdateItemsOnCharStore", "false"));
  1849. DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyPlayerDroppedItem", "false"));
  1850. DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyEquipableItem", "false"));
  1851. SAVE_DROPPED_ITEM = Boolean.parseBoolean(General.getProperty("SaveDroppedItem", "false"));
  1852. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(General.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
  1853. SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(General.getProperty("SaveDroppedItemInterval", "60"))*60000;
  1854. CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(General.getProperty("ClearDroppedItemTable", "false"));
  1855. AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(General.getProperty("AutoDeleteInvalidQuestData", "False"));
  1856. PRECISE_DROP_CALCULATION = Boolean.parseBoolean(General.getProperty("PreciseDropCalculation", "True"));
  1857. MULTIPLE_ITEM_DROP = Boolean.parseBoolean(General.getProperty("MultipleItemDrop", "True"));
  1858. FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(General.getProperty("ForceInventoryUpdate", "False"));
  1859. LAZY_CACHE = Boolean.parseBoolean(General.getProperty("LazyCache", "True"));
  1860. CACHE_CHAR_NAMES = Boolean.parseBoolean(General.getProperty("CacheCharNames", "True"));
  1861. MIN_NPC_ANIMATION = Integer.parseInt(General.getProperty("MinNPCAnimation", "10"));
  1862. MAX_NPC_ANIMATION = Integer.parseInt(General.getProperty("MaxNPCAnimation", "20"));
  1863. MIN_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MinMonsterAnimation", "5"));
  1864. MAX_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MaxMonsterAnimation", "20"));
  1865. MOVE_BASED_KNOWNLIST = Boolean.parseBoolean(General.getProperty("MoveBasedKnownlist", "False"));
  1866. KNOWNLIST_UPDATE_INTERVAL = Long.parseLong(General.getProperty("KnownListUpdateInterval", "1250"));
  1867. GRIDS_ALWAYS_ON = Boolean.parseBoolean(General.getProperty("GridsAlwaysOn", "False"));
  1868. GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOnTime", "1"));
  1869. GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOffTime", "90"));
  1870. WORLD_X_MIN = Integer.parseInt(General.getProperty("WorldXMin", "10"));
  1871. WORLD_X_MAX = Integer.parseInt(General.getProperty("WorldXMax", "26"));
  1872. WORLD_Y_MIN = Integer.parseInt(General.getProperty("WorldYMin", "10"));
  1873. WORLD_Y_MAX = Integer.parseInt(General.getProperty("WorldYMax", "26"));
  1874. GEODATA = Integer.parseInt(General.getProperty("GeoData", "0"));
  1875. GEODATA_CELLFINDING = Boolean.parseBoolean(General.getProperty("CellPathFinding", "False"));
  1876. PATHFIND_BUFFERS = General.getProperty("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
  1877. LOW_WEIGHT = Float.parseFloat(General.getProperty("LowWeight", "0.5"));
  1878. MEDIUM_WEIGHT = Float.parseFloat(General.getProperty("MediumWeight", "2"));
  1879. HIGH_WEIGHT = Float.parseFloat(General.getProperty("HighWeight", "3"));
  1880. ADVANCED_DIAGONAL_STRATEGY = Boolean.parseBoolean(General.getProperty("AdvancedDiagonalStrategy", "True"));
  1881. DIAGONAL_WEIGHT = Float.parseFloat(General.getProperty("DiagonalWeight", "0.707"));
  1882. MAX_POSTFILTER_PASSES = Integer.parseInt(General.getProperty("MaxPostfilterPasses", "3"));
  1883. DEBUG_PATH = Boolean.parseBoolean(General.getProperty("DebugPath", "False"));
  1884. FORCE_GEODATA = Boolean.parseBoolean(General.getProperty("ForceGeodata", "True"));
  1885. COORD_SYNCHRONIZE = Integer.parseInt(General.getProperty("CoordSynchronize", "-1"));
  1886. String str = General.getProperty("EnableFallingDamage", "auto");
  1887. ENABLE_FALLING_DAMAGE = "auto".equalsIgnoreCase(str) ? GEODATA > 0 : Boolean.parseBoolean(str);
  1888. ZONE_TOWN = Integer.parseInt(General.getProperty("ZoneTown", "0"));
  1889. DEFAULT_GLOBAL_CHAT = General.getProperty("GlobalChat", "ON");
  1890. DEFAULT_TRADE_CHAT = General.getProperty("TradeChat", "ON");
  1891. ALLOW_WAREHOUSE = Boolean.parseBoolean(General.getProperty("AllowWarehouse", "True"));
  1892. WAREHOUSE_CACHE = Boolean.parseBoolean(General.getProperty("WarehouseCache", "False"));
  1893. WAREHOUSE_CACHE_TIME = Integer.parseInt(General.getProperty("WarehouseCacheTime", "15"));
  1894. ALLOW_REFUND = Boolean.parseBoolean(General.getProperty("AllowRefund", "True"));
  1895. ALLOW_MAIL = Boolean.parseBoolean(General.getProperty("AllowMail", "True"));
  1896. ALLOW_ATTACHMENTS = Boolean.parseBoolean(General.getProperty("AllowAttachments", "True"));
  1897. ALLOW_WEAR = Boolean.parseBoolean(General.getProperty("AllowWear", "True"));
  1898. WEAR_DELAY = Integer.parseInt(General.getProperty("WearDelay", "5"));
  1899. WEAR_PRICE = Integer.parseInt(General.getProperty("WearPrice", "10"));
  1900. ALLOW_LOTTERY = Boolean.parseBoolean(General.getProperty("AllowLottery", "True"));
  1901. ALLOW_RACE = Boolean.parseBoolean(General.getProperty("AllowRace", "True"));
  1902. ALLOW_WATER = Boolean.parseBoolean(General.getProperty("AllowWater", "True"));
  1903. ALLOW_RENTPET = Boolean.parseBoolean(General.getProperty("AllowRentPet", "False"));
  1904. ALLOWFISHING = Boolean.parseBoolean(General.getProperty("AllowFishing", "True"));
  1905. ALLOW_MANOR = Boolean.parseBoolean(General.getProperty("AllowManor", "True"));
  1906. ALLOW_BOAT = Boolean.parseBoolean(General.getProperty("AllowBoat", "True"));
  1907. BOAT_BROADCAST_RADIUS = Integer.parseInt(General.getProperty("BoatBroadcastRadius", "20000"));
  1908. ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(General.getProperty("AllowCursedWeapons", "True"));
  1909. ALLOW_NPC_WALKERS = Boolean.parseBoolean(General.getProperty("AllowNpcWalkers", "true"));
  1910. ALLOW_PET_WALKERS = Boolean.parseBoolean(General.getProperty("AllowPetWalkers", "True"));
  1911. SERVER_NEWS = Boolean.parseBoolean(General.getProperty("ShowServerNews", "False"));
  1912. COMMUNITY_TYPE = Integer.parseInt(General.getProperty("CommunityType", "1"));
  1913. BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(General.getProperty("BBSShowPlayerList", "false"));
  1914. BBS_DEFAULT = General.getProperty("BBSDefault", "_bbshome");
  1915. SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowLevelOnCommunityBoard", "False"));
  1916. SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowStatusOnCommunityBoard", "True"));
  1917. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePageSizeOnCommunityBoard", "50"));
  1918. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePerRowOnCommunityBoard", "5"));
  1919. USE_SAY_FILTER = Boolean.parseBoolean(General.getProperty("UseChatFilter", "false"));
  1920. CHAT_FILTER_CHARS = General.getProperty("ChatFilterChars", "^_^");
  1921. String[] propertySplit4 = General.getProperty("BanChatChannels", "0;1;8;17").trim().split(";");
  1922. BAN_CHAT_CHANNELS = new int[propertySplit4.length];
  1923. try
  1924. {
  1925. int i = 0;
  1926. for (String chatId : propertySplit4)
  1927. BAN_CHAT_CHANNELS[i++] = Integer.parseInt(chatId);
  1928. }
  1929. catch (NumberFormatException nfe)
  1930. {
  1931. _log.log(Level.WARNING, nfe.getMessage(), nfe);
  1932. }
  1933. ALT_MANOR_REFRESH_TIME = Integer.parseInt(General.getProperty("AltManorRefreshTime","20"));
  1934. ALT_MANOR_REFRESH_MIN = Integer.parseInt(General.getProperty("AltManorRefreshMin","00"));
  1935. ALT_MANOR_APPROVE_TIME = Integer.parseInt(General.getProperty("AltManorApproveTime","6"));
  1936. ALT_MANOR_APPROVE_MIN = Integer.parseInt(General.getProperty("AltManorApproveMin","00"));
  1937. ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(General.getProperty("AltManorMaintenancePeriod","360000"));
  1938. ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(General.getProperty("AltManorSaveAllActions","false"));
  1939. ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(General.getProperty("AltManorSavePeriodRate","2"));
  1940. ALT_LOTTERY_PRIZE = Long.parseLong(General.getProperty("AltLotteryPrize","50000"));
  1941. ALT_LOTTERY_TICKET_PRICE = Long.parseLong(General.getProperty("AltLotteryTicketPrice","2000"));
  1942. ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery5NumberRate","0.6"));
  1943. ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery4NumberRate","0.2"));
  1944. ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery3NumberRate","0.2"));
  1945. ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Long.parseLong(General.getProperty("AltLottery2and1NumberPrize","200"));
  1946. ALT_ITEM_AUCTION_ENABLED = Boolean.valueOf(General.getProperty("AltItemAuctionEnabled", "False"));
  1947. ALT_ITEM_AUCTION_EXPIRED_AFTER = Integer.valueOf(General.getProperty("AltItemAuctionExpiredAfter", "14"));
  1948. ALT_ITEM_AUCTION_TIME_EXTENDS_ON_BID = 1000 * (long)Integer.valueOf(General.getProperty("AltItemAuctionTimeExtendsOnBid", "0"));
  1949. FS_TIME_ATTACK = Integer.parseInt(General.getProperty("TimeOfAttack", "50"));
  1950. FS_TIME_COOLDOWN = Integer.parseInt(General.getProperty("TimeOfCoolDown", "5"));
  1951. FS_TIME_ENTRY = Integer.parseInt(General.getProperty("TimeOfEntry", "3"));
  1952. FS_TIME_WARMUP = Integer.parseInt(General.getProperty("TimeOfWarmUp", "2"));
  1953. FS_PARTY_MEMBER_COUNT = Integer.parseInt(General.getProperty("NumberOfNecessaryPartyMembers", "4"));
  1954. if (FS_TIME_ATTACK <= 0)
  1955. FS_TIME_ATTACK = 50;
  1956. if (FS_TIME_COOLDOWN <= 0)
  1957. FS_TIME_COOLDOWN = 5;
  1958. if (FS_TIME_ENTRY <= 0)
  1959. FS_TIME_ENTRY = 3;
  1960. if (FS_TIME_ENTRY <= 0)
  1961. FS_TIME_ENTRY = 3;
  1962. if (FS_TIME_ENTRY <= 0)
  1963. FS_TIME_ENTRY = 3;
  1964. RIFT_MIN_PARTY_SIZE = Integer.parseInt(General.getProperty("RiftMinPartySize", "5"));
  1965. RIFT_MAX_JUMPS = Integer.parseInt(General.getProperty("MaxRiftJumps", "4"));
  1966. RIFT_SPAWN_DELAY = Integer.parseInt(General.getProperty("RiftSpawnDelay", "10000"));
  1967. RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(General.getProperty("AutoJumpsDelayMin", "480"));
  1968. RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(General.getProperty("AutoJumpsDelayMax", "600"));
  1969. RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(General.getProperty("BossRoomTimeMultiply", "1.5"));
  1970. RIFT_ENTER_COST_RECRUIT = Integer.parseInt(General.getProperty("RecruitCost", "18"));
  1971. RIFT_ENTER_COST_SOLDIER = Integer.parseInt(General.getProperty("SoldierCost", "21"));
  1972. RIFT_ENTER_COST_OFFICER = Integer.parseInt(General.getProperty("OfficerCost", "24"));
  1973. RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(General.getProperty("CaptainCost", "27"));
  1974. RIFT_ENTER_COST_COMMANDER = Integer.parseInt(General.getProperty("CommanderCost", "30"));
  1975. RIFT_ENTER_COST_HERO = Integer.parseInt(General.getProperty("HeroCost", "33"));
  1976. DEFAULT_PUNISH = Integer.parseInt(General.getProperty("DefaultPunish", "2"));
  1977. DEFAULT_PUNISH_PARAM = Integer.parseInt(General.getProperty("DefaultPunishParam", "0"));
  1978. ONLY_GM_ITEMS_FREE = Boolean.parseBoolean(General.getProperty("OnlyGMItemsFree", "True"));
  1979. JAIL_IS_PVP = Boolean.parseBoolean(General.getProperty("JailIsPvp", "False"));
  1980. JAIL_DISABLE_CHAT = Boolean.parseBoolean(General.getProperty("JailDisableChat", "True"));
  1981. JAIL_DISABLE_TRANSACTION = Boolean.parseBoolean(General.getProperty("JailDisableTransaction", "False"));
  1982. CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(General.getProperty("CustomSpawnlistTable", "false"));
  1983. SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("SaveGmSpawnOnCustom", "false"));
  1984. CUSTOM_NPC_TABLE = Boolean.valueOf(General.getProperty("CustomNpcTable", "false"));
  1985. CUSTOM_NPC_SKILLS_TABLE = Boolean.valueOf(General.getProperty("CustomNpcSkillsTable", "false"));
  1986. CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(General.getProperty("CustomArmorSetsTable", "false"));
  1987. CUSTOM_TELEPORT_TABLE = Boolean.valueOf(General.getProperty("CustomTeleportTable", "false"));
  1988. CUSTOM_DROPLIST_TABLE = Boolean.valueOf(General.getProperty("CustomDroplistTable", "false"));
  1989. CUSTOM_MERCHANT_TABLES = Boolean.valueOf(General.getProperty("CustomMerchantTables", "false"));
  1990. CUSTOM_NPCBUFFER_TABLES = Boolean.valueOf(General.getProperty("CustomNpcBufferTables", "false"));
  1991. CUSTOM_SKILLS_LOAD = Boolean.valueOf(General.getProperty("CustomSkillsLoad", "false"));
  1992. CUSTOM_ITEMS_LOAD = Boolean.valueOf(General.getProperty("CustomItemsLoad", "false"));
  1993. CUSTOM_MULTISELL_LOAD = Boolean.valueOf(General.getProperty("CustomMultisellLoad", "false"));
  1994. ALT_BIRTHDAY_GIFT = Integer.parseInt(General.getProperty("AltBirthdayGift", "22187"));
  1995. ALT_BIRTHDAY_MAIL_SUBJECT = General.getProperty("AltBirthdayMailSubject", "Happy Birthday!");
  1996. ALT_BIRTHDAY_MAIL_TEXT = General.getProperty("AltBirthdayMailText", "Hello Adventurer!! Seeing as you're one year older now, I thought I would send you some birthday cheer :) Please find your birthday pack attached. May these gifts bring you joy and happiness on this very special day.\n\nSincerely, Alegria");
  1997. ENABLE_BLOCK_CHECKER_EVENT = Boolean.valueOf(General.getProperty("EnableBlockCheckerEvent", "false"));
  1998. MIN_BLOCK_CHECKER_TEAM_MEMBERS = Integer.valueOf(General.getProperty("BlockCheckerMinTeamMembers", "2"));
  1999. if(MIN_BLOCK_CHECKER_TEAM_MEMBERS < 1)
  2000. MIN_BLOCK_CHECKER_TEAM_MEMBERS = 1;
  2001. else if(MIN_BLOCK_CHECKER_TEAM_MEMBERS > 6)
  2002. MIN_BLOCK_CHECKER_TEAM_MEMBERS = 6;
  2003. HBCE_FAIR_PLAY = Boolean.parseBoolean(General.getProperty("HBCEFairPlay", "false"));
  2004. CLEAR_CREST_CACHE = Boolean.parseBoolean(General.getProperty("ClearClanCache", "false"));
  2005. }
  2006. catch (Exception e)
  2007. {
  2008. e.printStackTrace();
  2009. throw new Error("Failed to Load "+GENERAL_CONFIG_FILE+" File.");
  2010. }
  2011. // Load FloodProtector L2Properties file
  2012. try
  2013. {
  2014. L2Properties security = new L2Properties();
  2015. is = new FileInputStream(new File(FLOOD_PROTECTOR_FILE));
  2016. security.load(is);
  2017. loadFloodProtectorConfigs(security);
  2018. }
  2019. catch (Exception e)
  2020. {
  2021. e.printStackTrace();
  2022. throw new Error("Failed to Load "+FLOOD_PROTECTOR_FILE);
  2023. }
  2024. // Load NPC L2Properties file (if exists)
  2025. try
  2026. {
  2027. L2Properties NPC = new L2Properties();
  2028. is = new FileInputStream(new File(NPC_CONFIG_FILE));
  2029. NPC.load(is);
  2030. ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(NPC.getProperty("AnnounceMammonSpawn", "False"));
  2031. ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(NPC.getProperty("AltMobAgroInPeaceZone", "True"));
  2032. ALT_ATTACKABLE_NPCS = Boolean.parseBoolean(NPC.getProperty("AltAttackableNpcs", "True"));
  2033. ALT_GAME_VIEWNPC = Boolean.parseBoolean(NPC.getProperty("AltGameViewNpc", "False"));
  2034. MAX_DRIFT_RANGE = Integer.parseInt(NPC.getProperty("MaxDriftRange", "300"));
  2035. DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
  2036. DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRulesRaid", "True"));
  2037. SHOW_NPC_LVL = Boolean.parseBoolean(NPC.getProperty("ShowNpcLevel", "False"));
  2038. SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(NPC.getProperty("ShowCrestWithoutQuest", "False"));
  2039. ENABLE_RANDOM_ENCHANT_EFFECT = Boolean.parseBoolean(NPC.getProperty("EnableRandomEnchantEffect", "False"));
  2040. MIN_NPC_LVL_DMG_PENALTY = Integer.parseInt(NPC.getProperty("MinNPCLevelForDmgPenalty", "78"));
  2041. NPC_DMG_PENALTY = parseConfigLine(NPC.getProperty("DmgPenaltyForLvLDifferences", "0.7, 0.6, 0.6, 0.55"));
  2042. NPC_CRIT_DMG_PENALTY = parseConfigLine(NPC.getProperty("CritDmgPenaltyForLvLDifferences", "0.75, 0.65, 0.6, 0.58"));
  2043. NPC_SKILL_DMG_PENALTY = parseConfigLine(NPC.getProperty("SkillDmgPenaltyForLvLDifferences", "0.8, 0.7, 0.65, 0.62"));
  2044. MIN_NPC_LVL_MAGIC_PENALTY = Integer.parseInt(NPC.getProperty("MinNPCLevelForMagicPenalty", "78"));
  2045. NPC_SKILL_CHANCE_PENALTY = parseConfigLine(NPC.getProperty("SkillChancePenaltyForLvLDifferences", "2.5, 3.0, 3.25, 3.5"));
  2046. DECAY_TIME_TASK = Integer.parseInt(NPC.getProperty("DecayTimeTask", "5000"));
  2047. NPC_DECAY_TIME = Integer.parseInt(NPC.getProperty("NpcDecayTime", "8500"));
  2048. RAID_BOSS_DECAY_TIME = Integer.parseInt(NPC.getProperty("RaidBossDecayTime", "30000"));
  2049. SPOILED_DECAY_TIME = Integer.parseInt(NPC.getProperty("SpoiledDecayTime", "18500"));
  2050. ENABLE_DROP_VITALITY_HERBS = Boolean.parseBoolean(NPC.getProperty("EnableVitalityHerbs", "True"));
  2051. GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
  2052. ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
  2053. String[] split = NPC.getProperty("ListPetRentNpc", "30827").split(",");
  2054. LIST_PET_RENT_NPC = new TIntArrayList(split.length);
  2055. for (String id : split)
  2056. {
  2057. LIST_PET_RENT_NPC.add(Integer.parseInt(id));
  2058. }
  2059. RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) /100;
  2060. RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) /100;
  2061. RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPDefenceMultiplier", "100")) /100;
  2062. RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMDefenceMultiplier", "100")) /100;
  2063. RAID_PATTACK_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPAttackMultiplier", "100")) /100;
  2064. RAID_MATTACK_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMAttackMultiplier", "100")) /100;
  2065. RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMinRespawnMultiplier", "1.0"));
  2066. RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
  2067. RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
  2068. final String[] propertySplit = NPC.getProperty("CustomMinionsRespawnTime", "").split(";");
  2069. MINIONS_RESPAWN_TIME = new TIntIntHashMap(propertySplit.length);
  2070. for (String prop : propertySplit)
  2071. {
  2072. String[] propSplit = prop.split(",");
  2073. if (propSplit.length != 2)
  2074. {
  2075. _log.warning(StringUtil.concat("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"", prop, "\""));
  2076. }
  2077. try
  2078. {
  2079. MINIONS_RESPAWN_TIME.put(Integer.valueOf(propSplit[0]), Integer.valueOf(propSplit[1]));
  2080. }
  2081. catch (NumberFormatException nfe)
  2082. {
  2083. if (!prop.isEmpty())
  2084. _log.warning(StringUtil.concat("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"", propSplit[0], "\"", propSplit[1]));
  2085. }
  2086. }
  2087. RAID_DISABLE_CURSE = Boolean.parseBoolean(NPC.getProperty("DisableRaidCurse", "False"));
  2088. RAID_CHAOS_TIME = Integer.parseInt(NPC.getProperty("RaidChaosTime", "10"));
  2089. GRAND_CHAOS_TIME = Integer.parseInt(NPC.getProperty("GrandChaosTime", "10"));
  2090. MINION_CHAOS_TIME = Integer.parseInt(NPC.getProperty("MinionChaosTime", "10"));
  2091. INVENTORY_MAXIMUM_PET = Integer.parseInt(NPC.getProperty("MaximumSlotsForPet", "12"));
  2092. PET_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetHpRegenMultiplier", "100")) /100;
  2093. PET_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetMpRegenMultiplier", "100")) /100;
  2094. split = NPC.getProperty("NonTalkingNpcs", "18684,18685,18686,18687,18688,18689,18690,19691,18692,31557,31606,31671,31672,31673,31674,32026,32030,32031,32032,32306,32619,32620,32621").split(",");
  2095. NON_TALKING_NPCS = new TIntArrayList(split.length);
  2096. for (String npcId : split)
  2097. {
  2098. try
  2099. {
  2100. NON_TALKING_NPCS.add(Integer.parseInt(npcId));
  2101. }
  2102. catch (NumberFormatException nfe)
  2103. {
  2104. if (!npcId.isEmpty())
  2105. {
  2106. _log.warning("Could not parse " + npcId + " id for NonTalkingNpcs. Please check that all values are digits and coma separated.");
  2107. }
  2108. }
  2109. }
  2110. }
  2111. catch (Exception e)
  2112. {
  2113. e.printStackTrace();
  2114. throw new Error("Failed to Load "+NPC_CONFIG_FILE+" File.");
  2115. }
  2116. // Load Rates L2Properties file (if exists)
  2117. try
  2118. {
  2119. L2Properties ratesSettings = new L2Properties();
  2120. is = new FileInputStream(new File(RATES_CONFIG_FILE));
  2121. ratesSettings.load(is);
  2122. RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
  2123. RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
  2124. RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
  2125. RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
  2126. RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
  2127. RATE_EXTR_FISH = Float.parseFloat(ratesSettings.getProperty("RateExtractFish", "1."));
  2128. RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
  2129. RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(ratesSettings.getProperty("RateRaidDropItems", "1."));
  2130. RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
  2131. RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
  2132. RATE_QUEST_DROP = Float.parseFloat(ratesSettings.getProperty("RateQuestDrop", "1."));
  2133. RATE_QUEST_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestReward", "1."));
  2134. RATE_QUEST_REWARD_XP = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardXP", "1."));
  2135. RATE_QUEST_REWARD_SP = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardSP", "1."));
  2136. RATE_QUEST_REWARD_ADENA = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardAdena", "1."));
  2137. RATE_QUEST_REWARD_USE_MULTIPLIERS = Boolean.parseBoolean(ratesSettings.getProperty("UseQuestRewardMultipliers", "False"));
  2138. RATE_QUEST_REWARD_POTION = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardPotion", "1."));
  2139. RATE_QUEST_REWARD_SCROLL = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardScroll", "1."));
  2140. RATE_QUEST_REWARD_RECIPE = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardRecipe", "1."));
  2141. RATE_QUEST_REWARD_MATERIAL = Float.parseFloat(ratesSettings.getProperty("RateQuestRewardMaterial", "1."));
  2142. RATE_HB_TRUST_INCREASE = Float.parseFloat(ratesSettings.getProperty("RateHellboundTrustIncrease", "1."));
  2143. RATE_HB_TRUST_DECREASE = Float.parseFloat(ratesSettings.getProperty("RateHellboundTrustDecrease", "1."));
  2144. RATE_VITALITY_LEVEL_1 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel1", "1.5"));
  2145. RATE_VITALITY_LEVEL_2 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel2", "2."));
  2146. RATE_VITALITY_LEVEL_3 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel3", "2.5"));
  2147. RATE_VITALITY_LEVEL_4 = Float.parseFloat(ratesSettings.getProperty("RateVitalityLevel4", "3."));
  2148. RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(ratesSettings.getProperty("RateRecoveryPeaceZone", "1."));
  2149. RATE_VITALITY_LOST = Float.parseFloat(ratesSettings.getProperty("RateVitalityLost", "1."));
  2150. RATE_VITALITY_GAIN = Float.parseFloat(ratesSettings.getProperty("RateVitalityGain", "1."));
  2151. RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(ratesSettings.getProperty("RateRecoveryOnReconnect", "4."));
  2152. RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
  2153. RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
  2154. RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "1."));
  2155. RATE_DROP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpHerbs", "1."));
  2156. RATE_DROP_MP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateMpHerbs", "1."));
  2157. RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "1."));
  2158. RATE_DROP_VITALITY_HERBS = Float.parseFloat(ratesSettings.getProperty("RateVitalityHerbs", "1."));
  2159. PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
  2160. PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
  2161. PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
  2162. PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
  2163. PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
  2164. PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
  2165. PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
  2166. SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
  2167. KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
  2168. KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
  2169. KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
  2170. KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
  2171. KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
  2172. // Initializing table
  2173. PLAYER_XP_PERCENT_LOST = new double[Byte.MAX_VALUE+1];
  2174. // Default value
  2175. for (int i = 0; i <= Byte.MAX_VALUE; i++)
  2176. PLAYER_XP_PERCENT_LOST[i] = 1.;
  2177. // Now loading into table parsed values
  2178. try
  2179. {
  2180. 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(";");
  2181. for (String s : values)
  2182. {
  2183. int min;
  2184. int max;
  2185. double val;
  2186. String[] vals = s.split("-");
  2187. String[] mM = vals[0].split(",");
  2188. min = Integer.parseInt(mM[0]);
  2189. max = Integer.parseInt(mM[1]);
  2190. val = Double.parseDouble(vals[1]);
  2191. for (int i = min; i <= max; i++)
  2192. PLAYER_XP_PERCENT_LOST[i] = val;
  2193. }
  2194. }
  2195. catch (Exception e)
  2196. {
  2197. _log.warning("Error while loading Player XP percent lost");
  2198. e.printStackTrace();
  2199. }
  2200. String[] propertySplit = ratesSettings.getProperty("RateDropItemsById", "").split(";");
  2201. RATE_DROP_ITEMS_ID = new TIntFloatHashMap(propertySplit.length);
  2202. if (!propertySplit[0].isEmpty())
  2203. {
  2204. for (String item : propertySplit)
  2205. {
  2206. String[] itemSplit = item.split(",");
  2207. if (itemSplit.length != 2)
  2208. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  2209. else
  2210. {
  2211. try
  2212. {
  2213. RATE_DROP_ITEMS_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
  2214. }
  2215. catch (NumberFormatException nfe)
  2216. {
  2217. if (!item.isEmpty())
  2218. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  2219. }
  2220. }
  2221. }
  2222. }
  2223. if (RATE_DROP_ITEMS_ID.get(PcInventory.ADENA_ID) == 0f)
  2224. {
  2225. RATE_DROP_ITEMS_ID.put(PcInventory.ADENA_ID, RATE_DROP_ITEMS); //for Adena rate if not defined
  2226. }
  2227. }
  2228. catch (Exception e)
  2229. {
  2230. e.printStackTrace();
  2231. throw new Error("Failed to Load "+RATES_CONFIG_FILE+" File.");
  2232. }
  2233. // Load L2JMod L2Properties file (if exists)
  2234. try
  2235. {
  2236. L2Properties L2JModSettings = new L2Properties();
  2237. is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
  2238. L2JModSettings.load(is);
  2239. L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
  2240. L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
  2241. L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
  2242. L2JMOD_CHAMP_TITLE = L2JModSettings.getProperty("ChampionTitle", "Champion");
  2243. L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
  2244. L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
  2245. L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
  2246. L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
  2247. L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
  2248. L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
  2249. L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
  2250. L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
  2251. L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
  2252. L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
  2253. L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
  2254. L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
  2255. L2JMOD_CHAMPION_ENABLE_VITALITY = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnableVitality", "False"));
  2256. L2JMOD_CHAMPION_ENABLE_IN_INSTANCES = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnableInInstances", "False"));
  2257. TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
  2258. TVT_EVENT_IN_INSTANCE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventInInstance", "false"));
  2259. TVT_EVENT_INSTANCE_FILE = L2JModSettings.getProperty("TvTEventInstanceFile", "coliseum.xml");
  2260. TVT_EVENT_INTERVAL = L2JModSettings.getProperty("TvTEventInterval", "20:00").split(",");
  2261. TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
  2262. TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
  2263. TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
  2264. L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(L2JModSettings.getProperty("AllowWedding", "False"));
  2265. L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
  2266. L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
  2267. L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
  2268. L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
  2269. L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
  2270. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
  2271. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
  2272. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
  2273. L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
  2274. L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
  2275. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  2276. {
  2277. TVT_EVENT_ENABLED = false;
  2278. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
  2279. }
  2280. else
  2281. {
  2282. String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
  2283. if (propertySplit.length < 3)
  2284. {
  2285. TVT_EVENT_ENABLED = false;
  2286. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
  2287. }
  2288. else
  2289. {
  2290. TVT_EVENT_REWARDS = new ArrayList<int[]>();
  2291. TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  2292. TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  2293. TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  2294. TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  2295. TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  2296. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  2297. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  2298. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  2299. if (propertySplit.length == 4)
  2300. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[3] = Integer.parseInt(propertySplit[3]);
  2301. TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
  2302. TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
  2303. TVT_EVENT_MIN_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
  2304. TVT_EVENT_MAX_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
  2305. TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
  2306. TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
  2307. TVT_EVENT_EFFECTS_REMOVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventEffectsRemoval", "0"));
  2308. TVT_EVENT_MAX_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxParticipantsPerIP", "0"));
  2309. TVT_ALLOW_VOICED_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("TvTAllowVoicedInfoCommand", "false"));
  2310. TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
  2311. propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
  2312. if (propertySplit.length < 3)
  2313. {
  2314. TVT_EVENT_ENABLED = false;
  2315. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
  2316. }
  2317. else
  2318. {
  2319. TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  2320. TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  2321. TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  2322. TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
  2323. propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
  2324. if (propertySplit.length < 3)
  2325. {
  2326. TVT_EVENT_ENABLED= false;
  2327. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
  2328. }
  2329. else
  2330. {
  2331. TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  2332. TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  2333. TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  2334. propertySplit = L2JModSettings.getProperty("TvTEventParticipationFee", "0,0").split(",");
  2335. try
  2336. {
  2337. TVT_EVENT_PARTICIPATION_FEE[0] = Integer.parseInt(propertySplit[0]);
  2338. TVT_EVENT_PARTICIPATION_FEE[1] = Integer.parseInt(propertySplit[1]);
  2339. }
  2340. catch (NumberFormatException nfe)
  2341. {
  2342. if (propertySplit.length > 0)
  2343. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationFee");
  2344. }
  2345. propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
  2346. for (String reward : propertySplit)
  2347. {
  2348. String[] rewardSplit = reward.split(",");
  2349. if (rewardSplit.length != 2)
  2350. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  2351. else
  2352. {
  2353. try
  2354. {
  2355. TVT_EVENT_REWARDS.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  2356. }
  2357. catch (NumberFormatException nfe)
  2358. {
  2359. if (!reward.isEmpty())
  2360. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  2361. }
  2362. }
  2363. }
  2364. TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
  2365. TVT_EVENT_SCROLL_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventScrollsAllowed", "false"));
  2366. TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
  2367. TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
  2368. TVT_REWARD_TEAM_TIE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTRewardTeamTie", "false"));
  2369. propertySplit = L2JModSettings.getProperty("TvTDoorsToOpen", "").split(";");
  2370. for (String door : propertySplit)
  2371. {
  2372. try
  2373. {
  2374. TVT_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
  2375. }
  2376. catch (NumberFormatException nfe)
  2377. {
  2378. if (!door.isEmpty())
  2379. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"", door, "\""));
  2380. }
  2381. }
  2382. propertySplit = L2JModSettings.getProperty("TvTDoorsToClose", "").split(";");
  2383. for (String door : propertySplit)
  2384. {
  2385. try
  2386. {
  2387. TVT_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
  2388. }
  2389. catch (NumberFormatException nfe)
  2390. {
  2391. if (!door.isEmpty())
  2392. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"", door, "\""));
  2393. }
  2394. }
  2395. propertySplit = L2JModSettings.getProperty("TvTEventFighterBuffs", "").split(";");
  2396. if (!propertySplit[0].isEmpty())
  2397. {
  2398. TVT_EVENT_FIGHTER_BUFFS = new TIntIntHashMap(propertySplit.length);
  2399. for (String skill : propertySplit)
  2400. {
  2401. String[] skillSplit = skill.split(",");
  2402. if (skillSplit.length != 2)
  2403. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2404. else
  2405. {
  2406. try
  2407. {
  2408. TVT_EVENT_FIGHTER_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2409. }
  2410. catch (NumberFormatException nfe)
  2411. {
  2412. if (!skill.isEmpty())
  2413. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2414. }
  2415. }
  2416. }
  2417. }
  2418. propertySplit = L2JModSettings.getProperty("TvTEventMageBuffs", "").split(";");
  2419. if (!propertySplit[0].isEmpty())
  2420. {
  2421. TVT_EVENT_MAGE_BUFFS = new TIntIntHashMap(propertySplit.length);
  2422. for (String skill : propertySplit)
  2423. {
  2424. String[] skillSplit = skill.split(",");
  2425. if (skillSplit.length != 2)
  2426. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2427. else
  2428. {
  2429. try
  2430. {
  2431. TVT_EVENT_MAGE_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2432. }
  2433. catch (NumberFormatException nfe)
  2434. {
  2435. if (!skill.isEmpty())
  2436. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2437. }
  2438. }
  2439. }
  2440. }
  2441. }
  2442. }
  2443. }
  2444. }
  2445. BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
  2446. BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
  2447. BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
  2448. OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
  2449. OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
  2450. OFFLINE_MODE_IN_PEACE_ZONE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineModeInPaceZone", "False"));
  2451. OFFLINE_MODE_SET_INVULNERABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineModeSetInvulnerable", "False"));
  2452. OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
  2453. OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
  2454. OFFLINE_FAME = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineFame", "true"));
  2455. RESTORE_OFFLINERS = Boolean.parseBoolean(L2JModSettings.getProperty("RestoreOffliners", "false"));
  2456. OFFLINE_MAX_DAYS = Integer.parseInt(L2JModSettings.getProperty("OfflineMaxDays", "10"));
  2457. OFFLINE_DISCONNECT_FINISHED = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineDisconnectFinished", "true"));
  2458. L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
  2459. L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(L2JModSettings.getProperty("DisplayServerTime", "false"));
  2460. WELCOME_MESSAGE_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("ScreenWelcomeMessageEnable", "false"));
  2461. WELCOME_MESSAGE_TEXT = L2JModSettings.getProperty("ScreenWelcomeMessageText", "Welcome to L2J server!");
  2462. WELCOME_MESSAGE_TIME = Integer.parseInt(L2JModSettings.getProperty("ScreenWelcomeMessageTime", "10")) * 1000;
  2463. L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedEnable", "false"));
  2464. L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDualbox", "true"));
  2465. L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDisconnectedAsDualbox", "true"));
  2466. L2JMOD_ANTIFEED_INTERVAL = 1000*Integer.parseInt(L2JModSettings.getProperty("AntiFeedInterval", "120"));
  2467. ANNOUNCE_PK_PVP = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvP", "False"));
  2468. ANNOUNCE_PK_PVP_NORMAL_MESSAGE = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvPNormalMessage", "True"));
  2469. ANNOUNCE_PK_MSG = L2JModSettings.getProperty("AnnouncePkMsg", "$killer has slaughtered $target");
  2470. ANNOUNCE_PVP_MSG = L2JModSettings.getProperty("AnnouncePvpMsg", "$killer has defeated $target");
  2471. L2JMOD_CHAT_ADMIN = Boolean.parseBoolean(L2JModSettings.getProperty("ChatAdmin", "false"));
  2472. L2JMOD_MULTILANG_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangEnable", "false"));
  2473. String[] allowed = L2JModSettings.getProperty("MultiLangAllowed", "en").split(";");
  2474. L2JMOD_MULTILANG_ALLOWED = new ArrayList<String>(allowed.length);
  2475. for (String lang : allowed)
  2476. L2JMOD_MULTILANG_ALLOWED.add(lang);
  2477. L2JMOD_MULTILANG_DEFAULT = L2JModSettings.getProperty("MultiLangDefault", "en");
  2478. if (!L2JMOD_MULTILANG_ALLOWED.contains(L2JMOD_MULTILANG_DEFAULT))
  2479. _log.warning("MultiLang[Config.load()]: default language: " + L2JMOD_MULTILANG_DEFAULT + " is not in allowed list !");
  2480. L2JMOD_HELLBOUND_STATUS = Boolean.parseBoolean(L2JModSettings.getProperty("HellboundStatus", "False"));
  2481. L2JMOD_MULTILANG_VOICED_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangVoiceCommand", "True"));
  2482. L2JMOD_MULTILANG_SM_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangSystemMessageEnable", "false"));
  2483. allowed = L2JModSettings.getProperty("MultiLangSystemMessageAllowed", "").split(";");
  2484. L2JMOD_MULTILANG_SM_ALLOWED = new ArrayList<String>(allowed.length);
  2485. for (String lang : allowed)
  2486. {
  2487. if (!lang.isEmpty())
  2488. L2JMOD_MULTILANG_SM_ALLOWED.add(lang);
  2489. }
  2490. L2JMOD_MULTILANG_NS_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangNpcStringEnable", "false"));
  2491. allowed = L2JModSettings.getProperty("MultiLangNpcStringAllowed", "").split(";");
  2492. L2JMOD_MULTILANG_NS_ALLOWED = new ArrayList<String>(allowed.length);
  2493. for (String lang : allowed)
  2494. {
  2495. if (!lang.isEmpty())
  2496. L2JMOD_MULTILANG_NS_ALLOWED.add(lang);
  2497. }
  2498. L2WALKER_PROTECTION = Boolean.parseBoolean(L2JModSettings.getProperty("L2WalkerProtection", "False"));
  2499. L2JMOD_DEBUG_VOICE_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("DebugVoiceCommand", "False"));
  2500. L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxPlayersPerIP", "0"));
  2501. L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxOlympiadParticipantsPerIP", "0"));
  2502. L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxL2EventParticipantsPerIP", "0"));
  2503. String[] propertySplit = L2JModSettings.getProperty("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
  2504. L2JMOD_DUALBOX_CHECK_WHITELIST = new TIntIntHashMap(propertySplit.length);
  2505. for (String entry : propertySplit)
  2506. {
  2507. String[] entrySplit = entry.split(",");
  2508. if (entrySplit.length != 2)
  2509. _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid config property -> DualboxCheckWhitelist \"", entry, "\""));
  2510. else
  2511. {
  2512. try
  2513. {
  2514. int num = Integer.parseInt(entrySplit[1]);
  2515. num = num == 0 ? -1 : num;
  2516. L2JMOD_DUALBOX_CHECK_WHITELIST.put(InetAddress.getByName(entrySplit[0]).hashCode(), num);
  2517. }
  2518. catch (UnknownHostException e)
  2519. {
  2520. _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid address -> DualboxCheckWhitelist \"", entrySplit[0], "\""));
  2521. }
  2522. catch (NumberFormatException e)
  2523. {
  2524. _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid number -> DualboxCheckWhitelist \"", entrySplit[1], "\""));
  2525. }
  2526. }
  2527. }
  2528. L2JMOD_ALLOW_CHANGE_PASSWORD = Boolean.parseBoolean(L2JModSettings.getProperty("AllowChangePassword", "False"));
  2529. }
  2530. catch (Exception e)
  2531. {
  2532. e.printStackTrace();
  2533. throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File.");
  2534. }
  2535. // Load PvP L2Properties file (if exists)
  2536. try
  2537. {
  2538. L2Properties pvpSettings = new L2Properties();
  2539. is = new FileInputStream(new File(PVP_CONFIG_FILE));
  2540. pvpSettings.load(is);
  2541. KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
  2542. KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
  2543. KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
  2544. KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
  2545. KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
  2546. KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
  2547. KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
  2548. KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
  2549. 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");
  2550. String[] array = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
  2551. KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[array.length];
  2552. for (int i = 0; i < array.length; i++)
  2553. KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(array[i]);
  2554. array = KARMA_NONDROPPABLE_ITEMS.split(",");
  2555. KARMA_LIST_NONDROPPABLE_ITEMS = new int[array.length];
  2556. for (int i = 0; i < array.length; i++)
  2557. KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(array[i]);
  2558. // sorting so binarySearch can be used later
  2559. Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
  2560. Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
  2561. PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "120000"));
  2562. PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "60000"));
  2563. }
  2564. catch (Exception e)
  2565. {
  2566. e.printStackTrace();
  2567. throw new Error("Failed to Load "+PVP_CONFIG_FILE+" File.");
  2568. }
  2569. // Load Olympiad L2Properties file (if exists)
  2570. try
  2571. {
  2572. L2Properties olympiad = new L2Properties();
  2573. is = new FileInputStream(new File(OLYMPIAD_CONFIG_FILE));
  2574. olympiad.load(is);
  2575. ALT_OLY_START_TIME = Integer.parseInt(olympiad.getProperty("AltOlyStartTime", "18"));
  2576. ALT_OLY_MIN = Integer.parseInt(olympiad.getProperty("AltOlyMin","00"));
  2577. ALT_OLY_CPERIOD = Long.parseLong(olympiad.getProperty("AltOlyCPeriod","21600000"));
  2578. ALT_OLY_BATTLE = Long.parseLong(olympiad.getProperty("AltOlyBattle","300000"));
  2579. ALT_OLY_WPERIOD = Long.parseLong(olympiad.getProperty("AltOlyWPeriod","604800000"));
  2580. ALT_OLY_VPERIOD = Long.parseLong(olympiad.getProperty("AltOlyVPeriod","86400000"));
  2581. ALT_OLY_START_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyStartPoints","10"));
  2582. ALT_OLY_WEEKLY_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyWeeklyPoints","10"));
  2583. ALT_OLY_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyClassedParticipants","11"));
  2584. ALT_OLY_NONCLASSED = Integer.parseInt(olympiad.getProperty("AltOlyNonClassedParticipants","11"));
  2585. ALT_OLY_TEAMS = Integer.parseInt(olympiad.getProperty("AltOlyTeamsParticipants","6"));
  2586. ALT_OLY_REG_DISPLAY = Integer.parseInt(olympiad.getProperty("AltOlyRegistrationDisplayNumber","100"));
  2587. ALT_OLY_CLASSED_REWARD = parseItemsList(olympiad.getProperty("AltOlyClassedReward","13722,50"));
  2588. ALT_OLY_NONCLASSED_REWARD = parseItemsList(olympiad.getProperty("AltOlyNonClassedReward","13722,40"));
  2589. ALT_OLY_TEAM_REWARD = parseItemsList(olympiad.getProperty("AltOlyTeamReward","13722,85"));
  2590. ALT_OLY_COMP_RITEM = Integer.parseInt(olympiad.getProperty("AltOlyCompRewItem","13722"));
  2591. ALT_OLY_MIN_MATCHES = Integer.parseInt(olympiad.getProperty("AltOlyMinMatchesForPoints","15"));
  2592. ALT_OLY_GP_PER_POINT = Integer.parseInt(olympiad.getProperty("AltOlyGPPerPoint","1000"));
  2593. ALT_OLY_HERO_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyHeroPoints","200"));
  2594. ALT_OLY_RANK1_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank1Points","100"));
  2595. ALT_OLY_RANK2_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank2Points","75"));
  2596. ALT_OLY_RANK3_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank3Points","55"));
  2597. ALT_OLY_RANK4_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank4Points","40"));
  2598. ALT_OLY_RANK5_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyRank5Points","30"));
  2599. ALT_OLY_MAX_POINTS = Integer.parseInt(olympiad.getProperty("AltOlyMaxPoints","10"));
  2600. ALT_OLY_DIVIDER_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyDividerClassed","5"));
  2601. ALT_OLY_DIVIDER_NON_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyDividerNonClassed","5"));
  2602. ALT_OLY_MAX_WEEKLY_MATCHES = Integer.parseInt(olympiad.getProperty("AltOlyMaxWeeklyMatches","70"));
  2603. ALT_OLY_MAX_WEEKLY_MATCHES_NON_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyMaxWeeklyMatchesNonClassed","60"));
  2604. ALT_OLY_MAX_WEEKLY_MATCHES_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyMaxWeeklyMatchesClassed","30"));
  2605. ALT_OLY_MAX_WEEKLY_MATCHES_TEAM = Integer.parseInt(olympiad.getProperty("AltOlyMaxWeeklyMatchesTeam","10"));
  2606. ALT_OLY_LOG_FIGHTS = Boolean.parseBoolean(olympiad.getProperty("AltOlyLogFights","false"));
  2607. ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(olympiad.getProperty("AltOlyShowMonthlyWinners","true"));
  2608. ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(olympiad.getProperty("AltOlyAnnounceGames","true"));
  2609. String[] split = olympiad.getProperty("AltOlyRestrictedItems","6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,9388,9389,9390,17049,17050,17051,17052,17053,17054,17055,17056,17057,17058,17059,17060,17061,20759,20775,20776,20777,20778,14774").split(",");
  2610. LIST_OLY_RESTRICTED_ITEMS = new TIntArrayList(split.length);
  2611. for (String id : split)
  2612. {
  2613. LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
  2614. }
  2615. ALT_OLY_ENCHANT_LIMIT = Integer.parseInt(olympiad.getProperty("AltOlyEnchantLimit","-1"));
  2616. ALT_OLY_WAIT_TIME = Integer.parseInt(olympiad.getProperty("AltOlyWaitTime","120"));
  2617. }
  2618. catch (Exception e)
  2619. {
  2620. e.printStackTrace();
  2621. throw new Error("Failed to Load "+OLYMPIAD_CONFIG_FILE+" File.");
  2622. }
  2623. try
  2624. {
  2625. L2Properties Settings = new L2Properties();
  2626. is = new FileInputStream(HEXID_FILE);
  2627. Settings.load(is);
  2628. SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
  2629. HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
  2630. }
  2631. catch (Exception e)
  2632. {
  2633. _log.warning("Could not load HexID file ("+HEXID_FILE+"). Hopefully login will give us one.");
  2634. }
  2635. // Grandboss
  2636. try
  2637. {
  2638. L2Properties grandbossSettings = new L2Properties();
  2639. is = new FileInputStream(new File(GRANDBOSS_CONFIG_FILE));
  2640. grandbossSettings.load(is);
  2641. Antharas_Wait_Time = Integer.parseInt(grandbossSettings.getProperty("AntharasWaitTime", "30"));
  2642. if (Antharas_Wait_Time < 3 || Antharas_Wait_Time > 60)
  2643. Antharas_Wait_Time = 30;
  2644. Antharas_Wait_Time = Antharas_Wait_Time * 60000;
  2645. Valakas_Wait_Time = Integer.parseInt(grandbossSettings.getProperty("ValakasWaitTime", "30"));
  2646. if (Valakas_Wait_Time < 3 || Valakas_Wait_Time > 60)
  2647. Valakas_Wait_Time = 30;
  2648. Valakas_Wait_Time = Valakas_Wait_Time * 60000;
  2649. Interval_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfAntharasSpawn", "264"));
  2650. if (Interval_Of_Antharas_Spawn < 1 || Interval_Of_Antharas_Spawn > 480)
  2651. Interval_Of_Antharas_Spawn = 192;
  2652. Interval_Of_Antharas_Spawn = Interval_Of_Antharas_Spawn * 3600000;
  2653. Random_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfAntharasSpawn", "72"));
  2654. if (Random_Of_Antharas_Spawn < 1 || Random_Of_Antharas_Spawn > 192)
  2655. Random_Of_Antharas_Spawn = 145;
  2656. Random_Of_Antharas_Spawn = Random_Of_Antharas_Spawn * 3600000;
  2657. Interval_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfValakasSpawn", "264"));
  2658. if (Interval_Of_Valakas_Spawn < 1 || Interval_Of_Valakas_Spawn > 480)
  2659. Interval_Of_Valakas_Spawn = 192;
  2660. Interval_Of_Valakas_Spawn = Interval_Of_Valakas_Spawn * 3600000;
  2661. Random_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfValakasSpawn", "72"));
  2662. if (Random_Of_Valakas_Spawn < 1 || Random_Of_Valakas_Spawn > 192)
  2663. Random_Of_Valakas_Spawn = 145;
  2664. Random_Of_Valakas_Spawn = Random_Of_Valakas_Spawn * 3600000;
  2665. Interval_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfBaiumSpawn", "168"));
  2666. if (Interval_Of_Baium_Spawn < 1 || Interval_Of_Baium_Spawn > 480)
  2667. Interval_Of_Baium_Spawn = 121;
  2668. Interval_Of_Baium_Spawn = Interval_Of_Baium_Spawn * 3600000;
  2669. Random_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfBaiumSpawn", "48"));
  2670. if (Random_Of_Baium_Spawn < 1 || Random_Of_Baium_Spawn > 192)
  2671. Random_Of_Baium_Spawn = 8;
  2672. Random_Of_Baium_Spawn = Random_Of_Baium_Spawn * 3600000;
  2673. Interval_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfCoreSpawn", "60"));
  2674. if (Interval_Of_Core_Spawn < 1 || Interval_Of_Core_Spawn > 480)
  2675. Interval_Of_Core_Spawn = 27;
  2676. Interval_Of_Core_Spawn = Interval_Of_Core_Spawn * 3600000;
  2677. Random_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfCoreSpawn", "24"));
  2678. if (Random_Of_Core_Spawn < 1 || Random_Of_Core_Spawn > 192)
  2679. Random_Of_Core_Spawn = 47;
  2680. Random_Of_Core_Spawn = Random_Of_Core_Spawn * 3600000;
  2681. Interval_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfOrfenSpawn", "48"));
  2682. if (Interval_Of_Orfen_Spawn < 1 || Interval_Of_Orfen_Spawn > 480)
  2683. Interval_Of_Orfen_Spawn = 28;
  2684. Interval_Of_Orfen_Spawn = Interval_Of_Orfen_Spawn * 3600000;
  2685. Random_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfOrfenSpawn", "20"));
  2686. if (Random_Of_Orfen_Spawn < 1 || Random_Of_Orfen_Spawn > 192)
  2687. Random_Of_Orfen_Spawn = 41;
  2688. Random_Of_Orfen_Spawn = Random_Of_Orfen_Spawn * 3600000;
  2689. Interval_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfQueenAntSpawn", "36"));
  2690. if (Interval_Of_QueenAnt_Spawn < 1 || Interval_Of_QueenAnt_Spawn > 480)
  2691. Interval_Of_QueenAnt_Spawn = 19;
  2692. Interval_Of_QueenAnt_Spawn = Interval_Of_QueenAnt_Spawn * 3600000;
  2693. Random_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfQueenAntSpawn", "17"));
  2694. if (Random_Of_QueenAnt_Spawn < 1 || Random_Of_QueenAnt_Spawn > 192)
  2695. Random_Of_QueenAnt_Spawn = 35;
  2696. Random_Of_QueenAnt_Spawn = Random_Of_QueenAnt_Spawn * 3600000;
  2697. Interval_Of_Zaken_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfZakenSpawn", "19"));
  2698. if (Interval_Of_Zaken_Spawn < 1 || Interval_Of_Zaken_Spawn > 480)
  2699. Interval_Of_Zaken_Spawn = 19;
  2700. Interval_Of_Zaken_Spawn = Interval_Of_Zaken_Spawn * 3600000;
  2701. Random_Of_Zaken_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfZakenSpawn", "35"));
  2702. if (Random_Of_Zaken_Spawn < 1 || Random_Of_Zaken_Spawn > 192)
  2703. Random_Of_Zaken_Spawn = 35;
  2704. Random_Of_Zaken_Spawn = Random_Of_Zaken_Spawn * 3600000;
  2705. Interval_Of_Frintezza_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfFrintezzaSpawn", "48"));
  2706. if (Interval_Of_Frintezza_Spawn < 1 || Interval_Of_Frintezza_Spawn > 480)
  2707. Interval_Of_Frintezza_Spawn = 121;
  2708. Interval_Of_Frintezza_Spawn = Interval_Of_Frintezza_Spawn * 3600000;
  2709. Random_Of_Frintezza_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfFrintezzaSpawn", "8"));
  2710. if (Random_Of_Frintezza_Spawn < 1 || Random_Of_Frintezza_Spawn > 192)
  2711. Random_Of_Frintezza_Spawn = 8;
  2712. Random_Of_Frintezza_Spawn = Random_Of_Frintezza_Spawn * 3600000;
  2713. INTERVAL_OF_BELETH_SPAWN = Integer.parseInt(grandbossSettings.getProperty("IntervalOfBelethSpawn", "192"));
  2714. if (INTERVAL_OF_BELETH_SPAWN < 1 || INTERVAL_OF_BELETH_SPAWN > 480)
  2715. INTERVAL_OF_BELETH_SPAWN = 192;
  2716. INTERVAL_OF_BELETH_SPAWN *= 3600000;
  2717. RANDOM_OF_BELETH_SPAWN = Integer.parseInt(grandbossSettings.getProperty("RandomOfBelethSpawn", "148"));
  2718. if (RANDOM_OF_BELETH_SPAWN < 1 || RANDOM_OF_BELETH_SPAWN > 192)
  2719. RANDOM_OF_BELETH_SPAWN = 148;
  2720. RANDOM_OF_BELETH_SPAWN *= 3600000;
  2721. BELETH_MIN_PLAYERS = Integer.parseInt(grandbossSettings.getProperty("BelethMinPlayers", "36"));
  2722. }
  2723. catch (Exception e)
  2724. {
  2725. e.printStackTrace();
  2726. throw new Error("Failed to Load " + GRANDBOSS_CONFIG_FILE + " File.");
  2727. }
  2728. // Gracia Seeds
  2729. try
  2730. {
  2731. L2Properties graciaseedsSettings = new L2Properties();
  2732. is = new FileInputStream(new File(GRACIASEEDS_CONFIG_FILE));
  2733. graciaseedsSettings.load(is);
  2734. // Seed of Destruction
  2735. SOD_TIAT_KILL_COUNT = Integer.parseInt(graciaseedsSettings.getProperty("TiatKillCountForNextState", "10"));
  2736. SOD_STAGE_2_LENGTH = Long.parseLong(graciaseedsSettings.getProperty("Stage2Length", "720")) * 60000;
  2737. }
  2738. catch (Exception e)
  2739. {
  2740. e.printStackTrace();
  2741. throw new Error("Failed to Load " + GRACIASEEDS_CONFIG_FILE + " File.");
  2742. }
  2743. try
  2744. {
  2745. FILTER_LIST = new ArrayList<String>();
  2746. LineNumberReader lnr = new LineNumberReader(new BufferedReader(new FileReader(new File(CHAT_FILTER_FILE))));
  2747. String line = null;
  2748. while ((line = lnr.readLine()) != null)
  2749. {
  2750. if (line.trim().isEmpty() || line.startsWith("#"))
  2751. continue;
  2752. FILTER_LIST.add(line.trim());
  2753. }
  2754. _log.info("Loaded " + FILTER_LIST.size() + " Filter Words.");
  2755. }
  2756. catch (Exception e)
  2757. {
  2758. e.printStackTrace();
  2759. throw new Error("Failed to Load " + CHAT_FILTER_FILE + " File.");
  2760. }
  2761. // Security
  2762. try
  2763. {
  2764. L2Properties securitySettings = new L2Properties();
  2765. is = new FileInputStream(new File(SECURITY_CONFIG_FILE));
  2766. securitySettings.load(is);
  2767. // Second Auth Settings
  2768. SECOND_AUTH_ENABLED = Boolean.parseBoolean(securitySettings.getProperty("SecondAuthEnabled", "false"));
  2769. SECOND_AUTH_MAX_ATTEMPTS = Integer.parseInt(securitySettings.getProperty("SecondAuthMaxAttempts", "5"));
  2770. SECOND_AUTH_BAN_TIME = Integer.parseInt(securitySettings.getProperty("SecondAuthBanTime", "480"));
  2771. SECOND_AUTH_REC_LINK = securitySettings.getProperty("SecondAuthRecoveryLink", "5");
  2772. }
  2773. catch (Exception e)
  2774. {
  2775. e.printStackTrace();
  2776. throw new Error("Failed to Load " + SECURITY_CONFIG_FILE + " File.");
  2777. }
  2778. try
  2779. {
  2780. L2Properties chSiege = new L2Properties();
  2781. is = new FileInputStream(new File(CH_SIEGE_FILE));
  2782. chSiege.load(is);
  2783. CHS_MAX_ATTACKERS = Integer.parseInt(chSiege.getProperty("MaxAttackers", "500"));
  2784. CHS_CLAN_MINLEVEL = Integer.parseInt(chSiege.getProperty("MinClanLevel", "4"));
  2785. CHS_MAX_FLAGS_PER_CLAN = Integer.parseInt(chSiege.getProperty("MaxFlagsPerClan", "1"));
  2786. CHS_ENABLE_FAME = Boolean.parseBoolean(chSiege.getProperty("EnableFame", "false"));
  2787. CHS_FAME_AMOUNT = Integer.parseInt(chSiege.getProperty("FameAmount", "0"));
  2788. CHS_FAME_FREQUENCY = Integer.parseInt(chSiege.getProperty("FameFrequency", "0"));
  2789. }
  2790. catch(Exception e)
  2791. {
  2792. e.printStackTrace();
  2793. }
  2794. }
  2795. finally
  2796. {
  2797. try
  2798. {
  2799. is.close();
  2800. }
  2801. catch (Exception e)
  2802. {}
  2803. }
  2804. }
  2805. else if(Server.serverMode == Server.MODE_LOGINSERVER)
  2806. {
  2807. _log.info("loading login config");
  2808. InputStream is = null;
  2809. try
  2810. {
  2811. try
  2812. {
  2813. L2Properties serverSettings = new L2Properties();
  2814. is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
  2815. serverSettings.load(is);
  2816. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");
  2817. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));
  2818. LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
  2819. PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
  2820. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  2821. DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
  2822. ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
  2823. LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
  2824. LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
  2825. LOG_LOGIN_CONTROLLER = Boolean.parseBoolean(serverSettings.getProperty("LogLoginController", "true"));
  2826. LOGIN_SERVER_SCHEDULE_RESTART = Boolean.parseBoolean(serverSettings.getProperty("LoginRestartSchedule", "False"));
  2827. LOGIN_SERVER_SCHEDULE_RESTART_TIME = Long.parseLong(serverSettings.getProperty("LoginRestartTime", "24"));
  2828. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  2829. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jls");
  2830. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  2831. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  2832. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  2833. DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
  2834. SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
  2835. AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));
  2836. FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
  2837. FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
  2838. NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
  2839. FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
  2840. MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
  2841. }
  2842. catch (Exception e)
  2843. {
  2844. e.printStackTrace();
  2845. throw new Error("Failed to Load " + LOGIN_CONFIGURATION_FILE + " File.");
  2846. }
  2847. // MMO
  2848. try
  2849. {
  2850. _log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
  2851. L2Properties mmoSettings = new L2Properties();
  2852. is = new FileInputStream(new File(MMO_CONFIG_FILE));
  2853. mmoSettings.load(is);
  2854. MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
  2855. MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
  2856. MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
  2857. MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
  2858. MMO_TCP_NODELAY = Boolean.parseBoolean(mmoSettings.getProperty("TcpNoDelay", "False"));
  2859. }
  2860. catch (Exception e)
  2861. {
  2862. e.printStackTrace();
  2863. throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
  2864. }
  2865. // Load Telnet L2Properties file (if exists)
  2866. try
  2867. {
  2868. L2Properties telnetSettings = new L2Properties();
  2869. is = new FileInputStream(new File(TELNET_FILE));
  2870. telnetSettings.load(is);
  2871. IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
  2872. }
  2873. catch (Exception e)
  2874. {
  2875. e.printStackTrace();
  2876. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  2877. }
  2878. // Email
  2879. try
  2880. {
  2881. L2Properties emailSettings = new L2Properties();
  2882. is = new FileInputStream(new File(EMAIL_CONFIG_FILE));
  2883. emailSettings.load(is);
  2884. EMAIL_SERVERINFO_NAME = emailSettings.getProperty("ServerInfoName", "Unconfigured L2J Server");
  2885. EMAIL_SERVERINFO_ADDRESS = emailSettings.getProperty("ServerInfoAddress", "info@myl2jserver.com");
  2886. EMAIL_SYS_ENABLED = Boolean.parseBoolean(emailSettings.getProperty("EmailSystemEnabled", "false"));
  2887. EMAIL_SYS_HOST = emailSettings.getProperty("SmtpServerHost", "smtp.gmail.com");
  2888. EMAIL_SYS_PORT = Integer.parseInt(emailSettings.getProperty("SmtpServerPort", "465"));
  2889. EMAIL_SYS_SMTP_AUTH = Boolean.parseBoolean(emailSettings.getProperty("SmtpAuthRequired", "true"));
  2890. EMAIL_SYS_FACTORY = emailSettings.getProperty("SmtpFactory", "javax.net.ssl.SSLSocketFactory");
  2891. EMAIL_SYS_FACTORY_CALLBACK = Boolean.parseBoolean(emailSettings.getProperty("SmtpFactoryCallback", "false"));
  2892. EMAIL_SYS_USERNAME = emailSettings.getProperty("SmtpUsername", "user@gmail.com");
  2893. EMAIL_SYS_PASSWORD = emailSettings.getProperty("SmtpPassword", "password");
  2894. EMAIL_SYS_ADDRESS = emailSettings.getProperty("EmailSystemAddress", "noreply@myl2jserver.com");
  2895. EMAIL_SYS_SELECTQUERY = emailSettings.getProperty("EmailDBSelectQuery", "SELECT value FROM account_data WHERE account_name=? AND var='email_addr'");
  2896. EMAIL_SYS_DBFIELD = emailSettings.getProperty("EmailDBField", "value");
  2897. }
  2898. catch (Exception e)
  2899. {
  2900. e.printStackTrace();
  2901. throw new Error("Failed to Load " + EMAIL_CONFIG_FILE + " File.");
  2902. }
  2903. }
  2904. finally
  2905. {
  2906. try
  2907. {
  2908. is.close();
  2909. }
  2910. catch(Exception e) { }
  2911. }
  2912. }
  2913. else
  2914. {
  2915. _log.severe("Could not Load Config: server mode was not set");
  2916. }
  2917. }
  2918. /**
  2919. * Set a new value to a game parameter from the admin console.
  2920. * @param pName (String) : name of the parameter to change
  2921. * @param pValue (String) : new value of the parameter
  2922. * @return boolean : true if modification has been made
  2923. */
  2924. public static boolean setParameterValue(String pName, String pValue)
  2925. {
  2926. // rates.properties
  2927. if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
  2928. else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
  2929. else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
  2930. else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
  2931. else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
  2932. else if (pName.equalsIgnoreCase("RateExtractFish")) RATE_EXTR_FISH = Float.parseFloat(pValue);
  2933. else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
  2934. else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ITEMS_ID.put(PcInventory.ADENA_ID, Float.parseFloat(pValue));
  2935. else if (pName.equalsIgnoreCase("RateRaidDropItems")) RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(pValue);
  2936. else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
  2937. else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
  2938. else if (pName.equalsIgnoreCase("RateQuestDrop")) RATE_QUEST_DROP = Float.parseFloat(pValue);
  2939. else if (pName.equalsIgnoreCase("RateQuestReward")) RATE_QUEST_REWARD = Float.parseFloat(pValue);
  2940. else if (pName.equalsIgnoreCase("RateQuestRewardXP")) RATE_QUEST_REWARD_XP = Float.parseFloat(pValue);
  2941. else if (pName.equalsIgnoreCase("RateQuestRewardSP")) RATE_QUEST_REWARD_SP = Float.parseFloat(pValue);
  2942. else if (pName.equalsIgnoreCase("RateQuestRewardAdena")) RATE_QUEST_REWARD_ADENA = Float.parseFloat(pValue);
  2943. else if (pName.equalsIgnoreCase("UseQuestRewardMultipliers")) RATE_QUEST_REWARD_USE_MULTIPLIERS = Boolean.parseBoolean(pValue);
  2944. else if (pName.equalsIgnoreCase("RateQuestRewardPotion")) RATE_QUEST_REWARD_POTION = Float.parseFloat(pValue);
  2945. else if (pName.equalsIgnoreCase("RateQuestRewardScroll")) RATE_QUEST_REWARD_SCROLL = Float.parseFloat(pValue);
  2946. else if (pName.equalsIgnoreCase("RateQuestRewardRecipe")) RATE_QUEST_REWARD_RECIPE = Float.parseFloat(pValue);
  2947. else if (pName.equalsIgnoreCase("RateQuestRewardMaterial")) RATE_QUEST_REWARD_MATERIAL = Float.parseFloat(pValue);
  2948. else if (pName.equalsIgnoreCase("RateHellboundTrustIncrease")) RATE_HB_TRUST_INCREASE = Float.parseFloat(pValue);
  2949. else if (pName.equalsIgnoreCase("RateHellboundTrustDecrease")) RATE_HB_TRUST_DECREASE = Float.parseFloat(pValue);
  2950. else if (pName.equalsIgnoreCase("RateVitalityLevel1")) RATE_VITALITY_LEVEL_1 = Float.parseFloat(pValue);
  2951. else if (pName.equalsIgnoreCase("RateVitalityLevel2")) RATE_VITALITY_LEVEL_2 = Float.parseFloat(pValue);
  2952. else if (pName.equalsIgnoreCase("RateVitalityLevel3")) RATE_VITALITY_LEVEL_3 = Float.parseFloat(pValue);
  2953. else if (pName.equalsIgnoreCase("RateVitalityLevel4")) RATE_VITALITY_LEVEL_4 = Float.parseFloat(pValue);
  2954. else if (pName.equalsIgnoreCase("RateRecoveryPeaceZone")) RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(pValue);
  2955. else if (pName.equalsIgnoreCase("RateVitalityLost")) RATE_VITALITY_LOST = Float.parseFloat(pValue);
  2956. else if (pName.equalsIgnoreCase("RateVitalityGain")) RATE_VITALITY_GAIN = Float.parseFloat(pValue);
  2957. else if (pName.equalsIgnoreCase("RateRecoveryOnReconnect")) RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(pValue);
  2958. else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
  2959. else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
  2960. else if (pName.equalsIgnoreCase("RateCommonHerbs")) RATE_DROP_COMMON_HERBS = Float.parseFloat(pValue);
  2961. else if (pName.equalsIgnoreCase("RateHpHerbs")) RATE_DROP_HP_HERBS = Float.parseFloat(pValue);
  2962. else if (pName.equalsIgnoreCase("RateMpHerbs")) RATE_DROP_MP_HERBS = Float.parseFloat(pValue);
  2963. else if (pName.equalsIgnoreCase("RateSpecialHerbs")) RATE_DROP_SPECIAL_HERBS = Float.parseFloat(pValue);
  2964. else if (pName.equalsIgnoreCase("RateVitalityHerbs")) RATE_DROP_VITALITY_HERBS = Float.parseFloat(pValue);
  2965. else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
  2966. else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
  2967. else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2968. else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2969. else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2970. else if (pName.equalsIgnoreCase("PetXpRate")) PET_XP_RATE = Float.parseFloat(pValue);
  2971. else if (pName.equalsIgnoreCase("PetFoodRate")) PET_FOOD_RATE = Integer.parseInt(pValue);
  2972. else if (pName.equalsIgnoreCase("SinEaterXpRate")) SINEATER_XP_RATE = Float.parseFloat(pValue);
  2973. else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
  2974. else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
  2975. else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2976. else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2977. else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2978. // general.properties
  2979. else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
  2980. else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2981. else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2982. else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.parseBoolean(pValue);
  2983. else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(pValue);
  2984. else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
  2985. else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(pValue);
  2986. else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
  2987. else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
  2988. else if (pName.equalsIgnoreCase("LowWeight")) LOW_WEIGHT = Float.parseFloat(pValue);
  2989. else if (pName.equalsIgnoreCase("MediumWeight")) MEDIUM_WEIGHT = Float.parseFloat(pValue);
  2990. else if (pName.equalsIgnoreCase("HighWeight")) HIGH_WEIGHT = Float.parseFloat(pValue);
  2991. else if (pName.equalsIgnoreCase("AdvancedDiagonalStrategy")) ADVANCED_DIAGONAL_STRATEGY= Boolean.parseBoolean(pValue);
  2992. else if (pName.equalsIgnoreCase("DiagonalWeight")) DIAGONAL_WEIGHT = Float.parseFloat(pValue);
  2993. else if (pName.equalsIgnoreCase("MaxPostfilterPasses")) MAX_POSTFILTER_PASSES = Integer.parseInt(pValue);
  2994. else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
  2995. else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
  2996. else if (pName.equalsIgnoreCase("ClientPacketQueueSize"))
  2997. {
  2998. CLIENT_PACKET_QUEUE_SIZE = Integer.parseInt(pValue);
  2999. if (CLIENT_PACKET_QUEUE_SIZE == 0)
  3000. CLIENT_PACKET_QUEUE_SIZE = MMO_MAX_READ_PER_PASS + 1;
  3001. }
  3002. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxBurstSize"))
  3003. {
  3004. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = Integer.parseInt(pValue);
  3005. if (CLIENT_PACKET_QUEUE_MAX_BURST_SIZE == 0)
  3006. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = MMO_MAX_READ_PER_PASS;
  3007. }
  3008. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxPacketsPerSecond")) CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND = Integer.parseInt(pValue);
  3009. else if (pName.equalsIgnoreCase("ClientPacketQueueMeasureInterval")) CLIENT_PACKET_QUEUE_MEASURE_INTERVAL = Integer.parseInt(pValue);
  3010. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxAveragePacketsPerSecond")) CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND = Integer.parseInt(pValue);
  3011. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxFloodsPerMin")) CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN = Integer.parseInt(pValue);
  3012. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxOverflowsPerMin")) CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN = Integer.parseInt(pValue);
  3013. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxUnderflowsPerMin")) CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = Integer.parseInt(pValue);
  3014. else if (pName.equalsIgnoreCase("ClientPacketQueueMaxUnknownPerMin")) CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = Integer.parseInt(pValue);
  3015. else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
  3016. else if (pName.equalsIgnoreCase("AllowRefund")) ALLOW_REFUND = Boolean.parseBoolean(pValue);
  3017. else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.parseBoolean(pValue);
  3018. else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.parseBoolean(pValue);
  3019. else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
  3020. else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
  3021. else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.parseBoolean(pValue);
  3022. else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.parseBoolean(pValue);
  3023. else if (pName.equalsIgnoreCase("BoatBroadcastRadius")) BOAT_BROADCAST_RADIUS = Integer.parseInt(pValue);
  3024. else if (pName.equalsIgnoreCase("AllowCursedWeapons")) ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(pValue);
  3025. else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.parseBoolean(pValue);
  3026. else if (pName.equalsIgnoreCase("AllowNpcWalkers")) ALLOW_NPC_WALKERS = Boolean.parseBoolean(pValue);
  3027. else if (pName.equalsIgnoreCase("AllowPetWalkers")) ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
  3028. else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.parseBoolean(pValue);
  3029. else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = Integer.parseInt(pValue);
  3030. else if (pName.equalsIgnoreCase("BBSShowPlayerList")) BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
  3031. else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
  3032. else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  3033. else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  3034. else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
  3035. else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
  3036. else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.parseBoolean(pValue);
  3037. else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.parseBoolean(pValue);
  3038. else if (pName.equalsIgnoreCase("ShowCrestWithoutQuest")) SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(pValue);
  3039. else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);
  3040. else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(pValue);
  3041. else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
  3042. else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);
  3043. else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.parseBoolean(pValue);
  3044. else if (pName.equalsIgnoreCase("MaxDriftRange")) MAX_DRIFT_RANGE = Integer.parseInt(pValue);
  3045. else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.parseBoolean(pValue);
  3046. else if (pName.equalsIgnoreCase("UseDeepBlueDropRulesRaid")) DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(pValue);
  3047. else if (pName.equalsIgnoreCase("GuardAttackAggroMob")) GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(pValue);
  3048. else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.parseBoolean(pValue);
  3049. else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
  3050. else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
  3051. else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
  3052. else if (pName.equalsIgnoreCase("MaximumSlotsForQuestItems")) INVENTORY_MAXIMUM_QUEST_ITEMS = Integer.parseInt(pValue);
  3053. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
  3054. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
  3055. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
  3056. else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
  3057. else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
  3058. else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
  3059. else if (pName.equalsIgnoreCase("EnchantChanceElementStone")) ENCHANT_CHANCE_ELEMENT_STONE = Integer.parseInt(pValue);
  3060. else if (pName.equalsIgnoreCase("EnchantChanceElementCrystal")) ENCHANT_CHANCE_ELEMENT_CRYSTAL = Integer.parseInt(pValue);
  3061. else if (pName.equalsIgnoreCase("EnchantChanceElementJewel")) ENCHANT_CHANCE_ELEMENT_JEWEL = Integer.parseInt(pValue);
  3062. else if (pName.equalsIgnoreCase("EnchantChanceElementEnergy")) ENCHANT_CHANCE_ELEMENT_ENERGY = Integer.parseInt(pValue);
  3063. else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
  3064. else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
  3065. else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
  3066. else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
  3067. else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
  3068. else if (pName.equalsIgnoreCase("AugmentationNGSkillChance")) AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(pValue);
  3069. else if (pName.equalsIgnoreCase("AugmentationNGGlowChance")) AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(pValue);
  3070. else if (pName.equalsIgnoreCase("AugmentationMidSkillChance")) AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(pValue);
  3071. else if (pName.equalsIgnoreCase("AugmentationMidGlowChance")) AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(pValue);
  3072. else if (pName.equalsIgnoreCase("AugmentationHighSkillChance")) AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(pValue);
  3073. else if (pName.equalsIgnoreCase("AugmentationHighGlowChance")) AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(pValue);
  3074. else if (pName.equalsIgnoreCase("AugmentationTopSkillChance")) AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(pValue);
  3075. else if (pName.equalsIgnoreCase("AugmentationTopGlowChance")) AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(pValue);
  3076. else if (pName.equalsIgnoreCase("AugmentationBaseStatChance")) AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(pValue);
  3077. else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3078. else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3079. else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3080. else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3081. else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3082. else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier")) RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  3083. else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier")) RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  3084. else if (pName.equalsIgnoreCase("RaidPAttackMultiplier")) RAID_PATTACK_MULTIPLIER = Double.parseDouble(pValue) /100;
  3085. else if (pName.equalsIgnoreCase("RaidMAttackMultiplier")) RAID_MATTACK_MULTIPLIER = Double.parseDouble(pValue) /100;
  3086. else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
  3087. else if (pName.equalsIgnoreCase("RaidChaosTime")) RAID_CHAOS_TIME =Integer.parseInt(pValue);
  3088. else if (pName.equalsIgnoreCase("GrandChaosTime")) GRAND_CHAOS_TIME =Integer.parseInt(pValue);
  3089. else if (pName.equalsIgnoreCase("MinionChaosTime")) MINION_CHAOS_TIME =Integer.parseInt(pValue);
  3090. else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Long.parseLong(pValue);
  3091. else if (pName.equalsIgnoreCase("StartingLevel")) STARTING_LEVEL = Byte.parseByte(pValue);
  3092. else if (pName.equalsIgnoreCase("StartingSP")) STARTING_SP = Integer.parseInt(pValue);
  3093. else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
  3094. else if (pName.equalsIgnoreCase("TeleportWatchdogTimeout")) TELEPORT_WATCHDOG_TIMEOUT = Integer.parseInt(pValue);
  3095. else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
  3096. else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
  3097. else if (pName.equalsIgnoreCase("RestorePlayerInstance")) RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(pValue);
  3098. else if (pName.equalsIgnoreCase("AllowSummonToInstance")) ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(pValue);
  3099. else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
  3100. else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
  3101. else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
  3102. else if (pName.equalsIgnoreCase("RespawnRestoreCP")) RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
  3103. else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
  3104. else if (pName.equalsIgnoreCase("RespawnRestoreMP")) RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
  3105. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsDwarf")) MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(pValue);
  3106. else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsOther")) MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(pValue);
  3107. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsDwarf")) MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(pValue);
  3108. else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsOther")) MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(pValue);
  3109. else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  3110. else if (pName.equalsIgnoreCase("SubclassStoreSkillCooltime")) SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  3111. else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(pValue);
  3112. else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.parseBoolean(pValue);
  3113. else if (pName.equalsIgnoreCase("EnableFallingDamage")) ENABLE_FALLING_DAMAGE = Boolean.parseBoolean(pValue);
  3114. else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.parseBoolean(pValue);
  3115. else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
  3116. else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
  3117. else if (pName.equalsIgnoreCase("AltGameCreationRareXpSpRate")) ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(pValue);
  3118. else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
  3119. else if (pName.equalsIgnoreCase("AltWeightLimit")) ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
  3120. else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes")) ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(pValue);
  3121. else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(pValue);
  3122. else if (pName.equalsIgnoreCase("RemoveCastleCirclets")) REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
  3123. else if (pName.equalsIgnoreCase("ReputationScorePerKill")) REPUTATION_SCORE_PER_KILL = Integer.parseInt(pValue);
  3124. else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
  3125. {
  3126. ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
  3127. ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
  3128. }
  3129. else if (pName.equalsIgnoreCase("AltShieldBlocks")) ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(pValue);
  3130. else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
  3131. else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.parseBoolean(pValue);
  3132. else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(pValue);
  3133. else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone")) ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  3134. else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
  3135. else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
  3136. else if (pName.equalsIgnoreCase("AllowClassMasters")) ALLOW_CLASS_MASTERS = Boolean.parseBoolean(pValue);
  3137. else if (pName.equalsIgnoreCase("AllowEntireTree")) ALLOW_ENTIRE_TREE = Boolean.parseBoolean(pValue);
  3138. else if (pName.equalsIgnoreCase("AlternateClassMaster")) ALTERNATE_CLASS_MASTER = Boolean.parseBoolean(pValue);
  3139. else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
  3140. else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
  3141. else if (pName.equalsIgnoreCase("AltLeavePartyLeader")) ALT_LEAVE_PARTY_LEADER = Boolean.parseBoolean(pValue);
  3142. else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.parseBoolean(pValue);
  3143. else if (pName.equalsIgnoreCase("CraftMasterwork")) CRAFT_MASTERWORK = Boolean.parseBoolean(pValue);
  3144. else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
  3145. else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.parseBoolean(pValue);
  3146. else if (pName.equalsIgnoreCase("AutoLootRaids")) AUTO_LOOT_RAIDS = Boolean.parseBoolean(pValue);
  3147. else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);
  3148. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  3149. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(pValue);
  3150. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(pValue);
  3151. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pValue);
  3152. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pValue);
  3153. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pValue);
  3154. else if (pName.equalsIgnoreCase("MaxPersonalFamePoints")) MAX_PERSONAL_FAME_POINTS = Integer.parseInt(pValue);
  3155. else if (pName.equalsIgnoreCase("FortressZoneFameTaskFrequency")) FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  3156. else if (pName.equalsIgnoreCase("FortressZoneFameAquirePoints")) FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  3157. else if (pName.equalsIgnoreCase("CastleZoneFameTaskFrequency")) CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  3158. else if (pName.equalsIgnoreCase("CastleZoneFameAquirePoints")) CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  3159. else if (pName.equalsIgnoreCase("AltCastleForDawn")) ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(pValue);
  3160. else if (pName.equalsIgnoreCase("AltCastleForDusk")) ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(pValue);
  3161. else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(pValue);
  3162. else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(pValue);
  3163. else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
  3164. else if (pName.equalsIgnoreCase("AltSubclassEverywhere")) ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(pValue);
  3165. else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
  3166. else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
  3167. else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
  3168. else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(pValue);
  3169. else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
  3170. else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
  3171. else if (pName.equalsIgnoreCase("ChampionMaxLevel")) L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
  3172. else if (pName.equalsIgnoreCase("ChampionHp")) L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
  3173. else if (pName.equalsIgnoreCase("ChampionHpRegen")) L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
  3174. else if (pName.equalsIgnoreCase("ChampionRewards")) L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
  3175. else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(pValue);
  3176. else if (pName.equalsIgnoreCase("ChampionAtk")) L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
  3177. else if (pName.equalsIgnoreCase("ChampionSpdAtk")) L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
  3178. else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance")) L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  3179. else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance")) L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  3180. else if (pName.equalsIgnoreCase("ChampionRewardItemID")) L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
  3181. else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
  3182. else if (pName.equalsIgnoreCase("ChampionEnableInInstances")) L2JMOD_CHAMPION_ENABLE_IN_INSTANCES = Boolean.parseBoolean(pValue);
  3183. else if (pName.equalsIgnoreCase("AllowWedding")) L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(pValue);
  3184. else if (pName.equalsIgnoreCase("WeddingPrice")) L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
  3185. else if (pName.equalsIgnoreCase("WeddingPunishInfidelity")) L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
  3186. else if (pName.equalsIgnoreCase("WeddingTeleport")) L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
  3187. else if (pName.equalsIgnoreCase("WeddingTeleportPrice")) L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
  3188. else if (pName.equalsIgnoreCase("WeddingTeleportDuration")) L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
  3189. else if (pName.equalsIgnoreCase("WeddingAllowSameSex")) L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
  3190. else if (pName.equalsIgnoreCase("WeddingFormalWear")) L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
  3191. else if (pName.equalsIgnoreCase("WeddingDivorceCosts")) L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
  3192. else if (pName.equalsIgnoreCase("TvTEventEnabled")) TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  3193. else if (pName.equalsIgnoreCase("TvTEventInterval")) TVT_EVENT_INTERVAL = pValue.split(",");
  3194. else if (pName.equalsIgnoreCase("TvTEventParticipationTime")) TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  3195. else if (pName.equalsIgnoreCase("TvTEventRunningTime")) TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  3196. else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId")) TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  3197. else if (pName.equalsIgnoreCase("EnableWarehouseSortingClan")) L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
  3198. else if (pName.equalsIgnoreCase("EnableWarehouseSortingPrivate")) L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
  3199. else if (pName.equalsIgnoreCase("EnableManaPotionSupport")) L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(pValue);
  3200. else if (pName.equalsIgnoreCase("DisplayServerTime")) L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(pValue);
  3201. else if (pName.equalsIgnoreCase("AntiFeedEnable")) L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(pValue);
  3202. else if (pName.equalsIgnoreCase("AntiFeedDualbox")) L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(pValue);
  3203. else if (pName.equalsIgnoreCase("AntiFeedDisconnectedAsDualbox")) L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(pValue);
  3204. else if (pName.equalsIgnoreCase("AntiFeedInterval")) L2JMOD_ANTIFEED_INTERVAL = 1000*Integer.parseInt(pValue);
  3205. else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
  3206. else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
  3207. else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
  3208. else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);
  3209. else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.parseBoolean(pValue);
  3210. else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pValue);
  3211. else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);
  3212. else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
  3213. else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
  3214. else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
  3215. else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
  3216. else if (pName.equalsIgnoreCase("GMAdminMenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
  3217. else
  3218. {
  3219. try
  3220. {
  3221. //TODO: stupid GB configs...
  3222. if (!pName.startsWith("Interval_") && !pName.startsWith("Random_"))
  3223. pName = pName.toUpperCase();
  3224. Field clazField = Config.class.getField(pName);
  3225. int modifiers = clazField.getModifiers();
  3226. // just in case :)
  3227. if (!Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers))
  3228. throw new SecurityException("Cannot modify non public or non static config!");
  3229. if (clazField.getType() == int.class)
  3230. {
  3231. clazField.setInt(clazField, Integer.parseInt(pValue));
  3232. }
  3233. else if (clazField.getType() == short.class)
  3234. {
  3235. clazField.setShort(clazField, Short.parseShort(pValue));
  3236. }
  3237. else if (clazField.getType() == byte.class)
  3238. {
  3239. clazField.setByte(clazField, Byte.parseByte(pValue));
  3240. }
  3241. else if (clazField.getType() == long.class)
  3242. {
  3243. clazField.setLong(clazField, Long.parseLong(pValue));
  3244. }
  3245. else if (clazField.getType() == float.class)
  3246. {
  3247. clazField.setFloat(clazField, Float.parseFloat(pValue));
  3248. }
  3249. else if (clazField.getType() == double.class)
  3250. {
  3251. clazField.setDouble(clazField, Double.parseDouble(pValue));
  3252. }
  3253. else if (clazField.getType() == boolean.class)
  3254. {
  3255. clazField.setBoolean(clazField, Boolean.parseBoolean(pValue));
  3256. }
  3257. else if (clazField.getType() == String.class)
  3258. {
  3259. clazField.set(clazField, pValue);
  3260. }
  3261. else
  3262. return false;
  3263. }
  3264. catch (NoSuchFieldException e)
  3265. {
  3266. return false;
  3267. }
  3268. catch (Exception e)
  3269. {
  3270. _log.log(Level.WARNING, "", e);
  3271. return false;
  3272. }
  3273. }
  3274. return true;
  3275. }
  3276. private Config() { }
  3277. /**
  3278. * Save hexadecimal ID of the server in the L2Properties file.
  3279. * {@link #HEXID_FILE}
  3280. * @param serverId
  3281. * @param string hexadecimal ID of the server to store
  3282. */
  3283. public static void saveHexid(int serverId, String string)
  3284. {
  3285. Config.saveHexid(serverId, string, HEXID_FILE);
  3286. }
  3287. /**
  3288. * Save hexadecimal ID of the server in the L2Properties file.
  3289. * @param serverId
  3290. * @param hexId (String) : hexadecimal ID of the server to store
  3291. * @param fileName (String) : name of the L2Properties file
  3292. */
  3293. public static void saveHexid(int serverId, String hexId, String fileName)
  3294. {
  3295. try
  3296. {
  3297. L2Properties hexSetting = new L2Properties();
  3298. File file = new File(fileName);
  3299. //Create a new empty file only if it doesn't exist
  3300. file.createNewFile();
  3301. OutputStream out = new FileOutputStream(file);
  3302. hexSetting.setProperty("ServerID",String.valueOf(serverId));
  3303. hexSetting.setProperty("HexID",hexId);
  3304. hexSetting.store(out,"the hexID to auth into login");
  3305. out.close();
  3306. }
  3307. catch (Exception e)
  3308. {
  3309. _log.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
  3310. e.printStackTrace();
  3311. }
  3312. }
  3313. /**
  3314. * Loads flood protector configurations.
  3315. * @param properties
  3316. */
  3317. private static void loadFloodProtectorConfigs(final L2Properties properties)
  3318. {
  3319. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4");
  3320. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
  3321. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42");
  3322. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16");
  3323. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100");
  3324. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", "5");
  3325. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20");
  3326. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10");
  3327. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
  3328. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1");
  3329. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", "10");
  3330. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANUFACTURE, "Manufacture", "3");
  3331. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANOR, "Manor", "30");
  3332. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SENDMAIL, "SendMail", "100");
  3333. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_CHARACTER_SELECT, "CharacterSelect", "30");
  3334. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_AUCTION, "ItemAuction", "9");
  3335. }
  3336. /**
  3337. * Loads single flood protector configuration.
  3338. *
  3339. * @param properties
  3340. * L2Properties file reader
  3341. * @param config
  3342. * flood protector configuration instance
  3343. * @param configString
  3344. * flood protector configuration string that determines for which flood protector
  3345. * configuration should be read
  3346. * @param defaultInterval
  3347. * default flood protector interval
  3348. */
  3349. private static void loadFloodProtectorConfig(final L2Properties properties, final FloodProtectorConfig config, final String configString, final String defaultInterval)
  3350. {
  3351. config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval));
  3352. config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False"));
  3353. config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0"));
  3354. config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
  3355. config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0"));
  3356. }
  3357. public static int getServerTypeId(String[] serverTypes)
  3358. {
  3359. int tType = 0;
  3360. for (String cType : serverTypes)
  3361. {
  3362. cType = cType.trim();
  3363. if (cType.equalsIgnoreCase("Normal"))
  3364. tType |= 0x01;
  3365. else if (cType.equalsIgnoreCase("Relax"))
  3366. tType |= 0x02;
  3367. else if (cType.equalsIgnoreCase("Test"))
  3368. tType |= 0x04;
  3369. else if (cType.equalsIgnoreCase("NoLabel"))
  3370. tType |= 0x08;
  3371. else if (cType.equalsIgnoreCase("Restricted"))
  3372. tType |= 0x10;
  3373. else if (cType.equalsIgnoreCase("Event"))
  3374. tType |= 0x20;
  3375. else if (cType.equalsIgnoreCase("Free"))
  3376. tType |= 0x40;
  3377. }
  3378. return tType;
  3379. }
  3380. public static class ClassMasterSettings
  3381. {
  3382. private final TIntObjectHashMap<TIntIntHashMap> _claimItems;
  3383. private final TIntObjectHashMap<TIntIntHashMap> _rewardItems;
  3384. private final TIntObjectHashMap<Boolean> _allowedClassChange;
  3385. public ClassMasterSettings(String _configLine)
  3386. {
  3387. _claimItems = new TIntObjectHashMap<TIntIntHashMap>(3);
  3388. _rewardItems = new TIntObjectHashMap<TIntIntHashMap>(3);
  3389. _allowedClassChange = new TIntObjectHashMap<Boolean>(3);
  3390. if (_configLine != null)
  3391. parseConfigLine(_configLine.trim());
  3392. }
  3393. private void parseConfigLine(String _configLine)
  3394. {
  3395. StringTokenizer st = new StringTokenizer(_configLine, ";");
  3396. while (st.hasMoreTokens())
  3397. {
  3398. // get allowed class change
  3399. int job = Integer.parseInt(st.nextToken());
  3400. _allowedClassChange.put(job, true);
  3401. TIntIntHashMap _items = new TIntIntHashMap();
  3402. // parse items needed for class change
  3403. if (st.hasMoreTokens())
  3404. {
  3405. StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  3406. while (st2.hasMoreTokens())
  3407. {
  3408. StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  3409. int _itemId = Integer.parseInt(st3.nextToken());
  3410. int _quantity = Integer.parseInt(st3.nextToken());
  3411. _items.put(_itemId, _quantity);
  3412. }
  3413. }
  3414. _claimItems.put(job, _items);
  3415. _items = new TIntIntHashMap();
  3416. // parse gifts after class change
  3417. if (st.hasMoreTokens())
  3418. {
  3419. StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  3420. while (st2.hasMoreTokens())
  3421. {
  3422. StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  3423. int _itemId = Integer.parseInt(st3.nextToken());
  3424. int _quantity = Integer.parseInt(st3.nextToken());
  3425. _items.put(_itemId, _quantity);
  3426. }
  3427. }
  3428. _rewardItems.put(job, _items);
  3429. }
  3430. }
  3431. public boolean isAllowed(int job)
  3432. {
  3433. if (_allowedClassChange == null)
  3434. return false;
  3435. if (_allowedClassChange.containsKey(job))
  3436. return _allowedClassChange.get(job);
  3437. return false;
  3438. }
  3439. public TIntIntHashMap getRewardItems(int job)
  3440. {
  3441. if (_rewardItems.containsKey(job))
  3442. return _rewardItems.get(job);
  3443. return null;
  3444. }
  3445. public TIntIntHashMap getRequireItems(int job)
  3446. {
  3447. if (_claimItems.containsKey(job))
  3448. return _claimItems.get(job);
  3449. return null;
  3450. }
  3451. }
  3452. private static TIntFloatHashMap parseConfigLine(String line)
  3453. {
  3454. String[] propertySplit = line.split(",");
  3455. TIntFloatHashMap ret = new TIntFloatHashMap(propertySplit.length);
  3456. int i = 1;
  3457. for (String value : propertySplit)
  3458. ret.put(i++, Float.parseFloat(value));
  3459. return ret;
  3460. }
  3461. /**
  3462. * itemId1,itemNumber1;itemId2,itemNumber2...
  3463. * to the int[n][2] = [itemId1][itemNumber1],[itemId2][itemNumber2]...
  3464. * @param line
  3465. * @return
  3466. */
  3467. private static int[][] parseItemsList(String line)
  3468. {
  3469. final String[] propertySplit = line.split(";");
  3470. if (propertySplit.length == 0)
  3471. return null;
  3472. int i = 0;
  3473. String[] valueSplit;
  3474. final int[][] result = new int[propertySplit.length][];
  3475. for (String value : propertySplit)
  3476. {
  3477. valueSplit = value.split(",");
  3478. if (valueSplit.length != 2)
  3479. {
  3480. _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid entry -> \"", valueSplit[0], "\", should be itemId,itemNumber"));
  3481. return null;
  3482. }
  3483. result[i] = new int[2];
  3484. try
  3485. {
  3486. result[i][0] = Integer.parseInt(valueSplit[0]);
  3487. }
  3488. catch (NumberFormatException e)
  3489. {
  3490. _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid itemId -> \"", valueSplit[0], "\""));
  3491. return null;
  3492. }
  3493. try
  3494. {
  3495. result[i][1] = Integer.parseInt(valueSplit[1]);
  3496. }
  3497. catch (NumberFormatException e)
  3498. {
  3499. _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid item number -> \"", valueSplit[1], "\""));
  3500. return null;
  3501. }
  3502. i++;
  3503. }
  3504. return result;
  3505. }
  3506. }