Config.java 185 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111
  1. /*
  2. * Copyright (C) 2004-2014 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver;
  20. import info.tak11.subnet.Subnet;
  21. import java.io.BufferedReader;
  22. import java.io.File;
  23. import java.io.FileOutputStream;
  24. import java.io.FileReader;
  25. import java.io.IOException;
  26. import java.io.InputStreamReader;
  27. import java.io.LineNumberReader;
  28. import java.io.OutputStream;
  29. import java.lang.reflect.Field;
  30. import java.lang.reflect.Modifier;
  31. import java.math.BigInteger;
  32. import java.net.Inet6Address;
  33. import java.net.InetAddress;
  34. import java.net.InterfaceAddress;
  35. import java.net.NetworkInterface;
  36. import java.net.SocketException;
  37. import java.net.URL;
  38. import java.net.UnknownHostException;
  39. import java.util.ArrayList;
  40. import java.util.Arrays;
  41. import java.util.Enumeration;
  42. import java.util.HashMap;
  43. import java.util.List;
  44. import java.util.Map;
  45. import java.util.Properties;
  46. import java.util.StringTokenizer;
  47. import java.util.logging.Level;
  48. import java.util.logging.Logger;
  49. import org.w3c.dom.NamedNodeMap;
  50. import org.w3c.dom.Node;
  51. import com.l2jserver.gameserver.engines.DocumentParser;
  52. import com.l2jserver.gameserver.enums.IllegalActionPunishmentType;
  53. import com.l2jserver.gameserver.model.holders.ItemHolder;
  54. import com.l2jserver.gameserver.model.itemcontainer.Inventory;
  55. import com.l2jserver.gameserver.util.FloodProtectorConfig;
  56. import com.l2jserver.gameserver.util.Util;
  57. import com.l2jserver.util.PropertiesParser;
  58. import com.l2jserver.util.StringUtil;
  59. /**
  60. * This class loads all the game server related configurations from files.<br>
  61. * The files are usually located in config folder in server root folder.<br>
  62. * Each configuration has a default value (that should reflect retail behavior).
  63. */
  64. public final class Config
  65. {
  66. private static final Logger _log = Logger.getLogger(Config.class.getName());
  67. // --------------------------------------------------
  68. // Constants
  69. // --------------------------------------------------
  70. public static final String EOL = System.getProperty("line.separator");
  71. // --------------------------------------------------
  72. // L2J Property File Definitions
  73. // --------------------------------------------------
  74. public static final String CHARACTER_CONFIG_FILE = "./config/Character.properties";
  75. public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
  76. public static final String FORTSIEGE_CONFIGURATION_FILE = "./config/FortSiege.properties";
  77. public static final String GENERAL_CONFIG_FILE = "./config/General.properties";
  78. public static final String HEXID_FILE = "./config/hexid.txt";
  79. public static final String ID_CONFIG_FILE = "./config/IdFactory.properties";
  80. public static final String L2JMOD_CONFIG_FILE = "./config/L2JMods.properties";
  81. public static final String LOGIN_CONFIGURATION_FILE = "./config/LoginServer.properties";
  82. public static final String NPC_CONFIG_FILE = "./config/NPC.properties";
  83. public static final String PVP_CONFIG_FILE = "./config/PVP.properties";
  84. public static final String RATES_CONFIG_FILE = "./config/Rates.properties";
  85. public static final String CONFIGURATION_FILE = "./config/Server.properties";
  86. public static final String IP_CONFIG_FILE = "./config/ipconfig.xml";
  87. public static final String SIEGE_CONFIGURATION_FILE = "./config/Siege.properties";
  88. public static final String TW_CONFIGURATION_FILE = "./config/TerritoryWar.properties";
  89. public static final String TELNET_FILE = "./config/Telnet.properties";
  90. public static final String FLOOD_PROTECTOR_FILE = "./config/FloodProtector.properties";
  91. public static final String MMO_CONFIG_FILE = "./config/MMO.properties";
  92. public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.properties";
  93. public static final String COMMUNITY_CONFIGURATION_FILE = "./config/CommunityServer.properties";
  94. public static final String GRANDBOSS_CONFIG_FILE = "./config/GrandBoss.properties";
  95. public static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.properties";
  96. public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
  97. public static final String EMAIL_CONFIG_FILE = "./config/Email.properties";
  98. public static final String CH_SIEGE_FILE = "./config/ConquerableHallSiege.properties";
  99. // --------------------------------------------------
  100. // L2J Variable Definitions
  101. // --------------------------------------------------
  102. public static boolean ALT_GAME_DELEVEL;
  103. public static boolean DECREASE_SKILL_LEVEL;
  104. public static double ALT_WEIGHT_LIMIT;
  105. public static int RUN_SPD_BOOST;
  106. public static int DEATH_PENALTY_CHANCE;
  107. public static double RESPAWN_RESTORE_CP;
  108. public static double RESPAWN_RESTORE_HP;
  109. public static double RESPAWN_RESTORE_MP;
  110. public static boolean ALT_GAME_TIREDNESS;
  111. public static boolean ENABLE_MODIFY_SKILL_DURATION;
  112. public static Map<Integer, Integer> SKILL_DURATION_LIST;
  113. public static boolean ENABLE_MODIFY_SKILL_REUSE;
  114. public static Map<Integer, Integer> SKILL_REUSE_LIST;
  115. public static boolean AUTO_LEARN_SKILLS;
  116. public static boolean AUTO_LEARN_FS_SKILLS;
  117. public static boolean AUTO_LOOT_HERBS;
  118. public static byte BUFFS_MAX_AMOUNT;
  119. public static byte TRIGGERED_BUFFS_MAX_AMOUNT;
  120. public static byte DANCES_MAX_AMOUNT;
  121. public static boolean DANCE_CANCEL_BUFF;
  122. public static boolean DANCE_CONSUME_ADDITIONAL_MP;
  123. public static boolean ALT_STORE_DANCES;
  124. public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
  125. public static boolean ALT_GAME_CANCEL_BOW;
  126. public static boolean ALT_GAME_CANCEL_CAST;
  127. public static boolean ALT_GAME_MAGICFAILURES;
  128. public static int PLAYER_FAKEDEATH_UP_PROTECTION;
  129. public static boolean STORE_SKILL_COOLTIME;
  130. public static boolean SUBCLASS_STORE_SKILL_COOLTIME;
  131. public static boolean SUMMON_STORE_SKILL_COOLTIME;
  132. public static boolean ALT_GAME_SHIELD_BLOCKS;
  133. public static int ALT_PERFECT_SHLD_BLOCK;
  134. public static long EFFECT_TICK_RATIO;
  135. public static boolean ALLOW_CLASS_MASTERS;
  136. public static ClassMasterSettings CLASS_MASTER_SETTINGS;
  137. public static boolean ALLOW_ENTIRE_TREE;
  138. public static boolean ALTERNATE_CLASS_MASTER;
  139. public static boolean LIFE_CRYSTAL_NEEDED;
  140. public static boolean ES_SP_BOOK_NEEDED;
  141. public static boolean DIVINE_SP_BOOK_NEEDED;
  142. public static boolean ALT_GAME_SKILL_LEARN;
  143. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  144. public static boolean ALT_GAME_SUBCLASS_EVERYWHERE;
  145. public static boolean ALLOW_TRANSFORM_WITHOUT_QUEST;
  146. public static int FEE_DELETE_TRANSFER_SKILLS;
  147. public static int FEE_DELETE_SUBCLASS_SKILLS;
  148. public static boolean RESTORE_SERVITOR_ON_RECONNECT;
  149. public static boolean RESTORE_PET_ON_RECONNECT;
  150. public static double MAX_BONUS_EXP;
  151. public static double MAX_BONUS_SP;
  152. public static int MAX_RUN_SPEED;
  153. public static int MAX_PCRIT_RATE;
  154. public static int MAX_MCRIT_RATE;
  155. public static int MAX_PATK_SPEED;
  156. public static int MAX_MATK_SPEED;
  157. public static int MAX_EVASION;
  158. public static int MIN_ABNORMAL_STATE_SUCCESS_RATE;
  159. public static int MAX_ABNORMAL_STATE_SUCCESS_RATE;
  160. public static byte MAX_SUBCLASS;
  161. public static byte BASE_SUBCLASS_LEVEL;
  162. public static byte MAX_SUBCLASS_LEVEL;
  163. public static int MAX_PVTSTORESELL_SLOTS_DWARF;
  164. public static int MAX_PVTSTORESELL_SLOTS_OTHER;
  165. public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
  166. public static int MAX_PVTSTOREBUY_SLOTS_OTHER;
  167. public static int INVENTORY_MAXIMUM_NO_DWARF;
  168. public static int INVENTORY_MAXIMUM_DWARF;
  169. public static int INVENTORY_MAXIMUM_GM;
  170. public static int INVENTORY_MAXIMUM_QUEST_ITEMS;
  171. public static int WAREHOUSE_SLOTS_DWARF;
  172. public static int WAREHOUSE_SLOTS_NO_DWARF;
  173. public static int WAREHOUSE_SLOTS_CLAN;
  174. public static int ALT_FREIGHT_SLOTS;
  175. public static int ALT_FREIGHT_PRICE;
  176. public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
  177. public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
  178. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
  179. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
  180. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
  181. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
  182. public static int MAX_PERSONAL_FAME_POINTS;
  183. public static int FORTRESS_ZONE_FAME_TASK_FREQUENCY;
  184. public static int FORTRESS_ZONE_FAME_AQUIRE_POINTS;
  185. public static int CASTLE_ZONE_FAME_TASK_FREQUENCY;
  186. public static int CASTLE_ZONE_FAME_AQUIRE_POINTS;
  187. public static boolean FAME_FOR_DEAD_PLAYERS;
  188. public static boolean IS_CRAFTING_ENABLED;
  189. public static boolean CRAFT_MASTERWORK;
  190. public static int DWARF_RECIPE_LIMIT;
  191. public static int COMMON_RECIPE_LIMIT;
  192. public static boolean ALT_GAME_CREATION;
  193. public static double ALT_GAME_CREATION_SPEED;
  194. public static double ALT_GAME_CREATION_XP_RATE;
  195. public static double ALT_GAME_CREATION_RARE_XPSP_RATE;
  196. public static double ALT_GAME_CREATION_SP_RATE;
  197. public static boolean ALT_BLACKSMITH_USE_RECIPES;
  198. public static int ALT_CLAN_LEADER_DATE_CHANGE;
  199. public static String ALT_CLAN_LEADER_HOUR_CHANGE;
  200. public static boolean ALT_CLAN_LEADER_INSTANT_ACTIVATION;
  201. public static int ALT_CLAN_JOIN_DAYS;
  202. public static int ALT_CLAN_CREATE_DAYS;
  203. public static int ALT_CLAN_DISSOLVE_DAYS;
  204. public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
  205. public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
  206. public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
  207. public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
  208. public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
  209. public static int ALT_CLAN_MEMBERS_FOR_WAR;
  210. public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
  211. public static boolean REMOVE_CASTLE_CIRCLETS;
  212. public static int ALT_PARTY_RANGE;
  213. public static int ALT_PARTY_RANGE2;
  214. public static boolean ALT_LEAVE_PARTY_LEADER;
  215. public static boolean INITIAL_EQUIPMENT_EVENT;
  216. public static long STARTING_ADENA;
  217. public static byte STARTING_LEVEL;
  218. public static int STARTING_SP;
  219. public static long MAX_ADENA;
  220. public static boolean AUTO_LOOT;
  221. public static boolean AUTO_LOOT_RAIDS;
  222. public static int LOOT_RAIDS_PRIVILEGE_INTERVAL;
  223. public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE;
  224. public static int UNSTUCK_INTERVAL;
  225. public static int TELEPORT_WATCHDOG_TIMEOUT;
  226. public static int PLAYER_SPAWN_PROTECTION;
  227. public static List<Integer> SPAWN_PROTECTION_ALLOWED_ITEMS;
  228. public static int PLAYER_TELEPORT_PROTECTION;
  229. public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED;
  230. public static boolean OFFSET_ON_TELEPORT_ENABLED;
  231. public static int MAX_OFFSET_ON_TELEPORT;
  232. public static boolean RESTORE_PLAYER_INSTANCE;
  233. public static boolean ALLOW_SUMMON_TO_INSTANCE;
  234. public static int EJECT_DEAD_PLAYER_TIME;
  235. public static boolean PETITIONING_ALLOWED;
  236. public static int MAX_PETITIONS_PER_PLAYER;
  237. public static int MAX_PETITIONS_PENDING;
  238. public static boolean ALT_GAME_FREE_TELEPORT;
  239. public static int DELETE_DAYS;
  240. public static float ALT_GAME_EXPONENT_XP;
  241. public static float ALT_GAME_EXPONENT_SP;
  242. public static String PARTY_XP_CUTOFF_METHOD;
  243. public static double PARTY_XP_CUTOFF_PERCENT;
  244. public static int PARTY_XP_CUTOFF_LEVEL;
  245. public static int[][] PARTY_XP_CUTOFF_GAPS;
  246. public static int[] PARTY_XP_CUTOFF_GAP_PERCENTS;
  247. public static boolean DISABLE_TUTORIAL;
  248. public static boolean EXPERTISE_PENALTY;
  249. public static boolean STORE_RECIPE_SHOPLIST;
  250. public static boolean STORE_UI_SETTINGS;
  251. public static String[] FORBIDDEN_NAMES;
  252. public static boolean SILENCE_MODE_EXCLUDE;
  253. public static boolean ALT_VALIDATE_TRIGGER_SKILLS;
  254. // --------------------------------------------------
  255. // ClanHall Settings
  256. // --------------------------------------------------
  257. public static long CH_TELE_FEE_RATIO;
  258. public static int CH_TELE1_FEE;
  259. public static int CH_TELE2_FEE;
  260. public static long CH_ITEM_FEE_RATIO;
  261. public static int CH_ITEM1_FEE;
  262. public static int CH_ITEM2_FEE;
  263. public static int CH_ITEM3_FEE;
  264. public static long CH_MPREG_FEE_RATIO;
  265. public static int CH_MPREG1_FEE;
  266. public static int CH_MPREG2_FEE;
  267. public static int CH_MPREG3_FEE;
  268. public static int CH_MPREG4_FEE;
  269. public static int CH_MPREG5_FEE;
  270. public static long CH_HPREG_FEE_RATIO;
  271. public static int CH_HPREG1_FEE;
  272. public static int CH_HPREG2_FEE;
  273. public static int CH_HPREG3_FEE;
  274. public static int CH_HPREG4_FEE;
  275. public static int CH_HPREG5_FEE;
  276. public static int CH_HPREG6_FEE;
  277. public static int CH_HPREG7_FEE;
  278. public static int CH_HPREG8_FEE;
  279. public static int CH_HPREG9_FEE;
  280. public static int CH_HPREG10_FEE;
  281. public static int CH_HPREG11_FEE;
  282. public static int CH_HPREG12_FEE;
  283. public static int CH_HPREG13_FEE;
  284. public static long CH_EXPREG_FEE_RATIO;
  285. public static int CH_EXPREG1_FEE;
  286. public static int CH_EXPREG2_FEE;
  287. public static int CH_EXPREG3_FEE;
  288. public static int CH_EXPREG4_FEE;
  289. public static int CH_EXPREG5_FEE;
  290. public static int CH_EXPREG6_FEE;
  291. public static int CH_EXPREG7_FEE;
  292. public static long CH_SUPPORT_FEE_RATIO;
  293. public static int CH_SUPPORT1_FEE;
  294. public static int CH_SUPPORT2_FEE;
  295. public static int CH_SUPPORT3_FEE;
  296. public static int CH_SUPPORT4_FEE;
  297. public static int CH_SUPPORT5_FEE;
  298. public static int CH_SUPPORT6_FEE;
  299. public static int CH_SUPPORT7_FEE;
  300. public static int CH_SUPPORT8_FEE;
  301. public static long CH_CURTAIN_FEE_RATIO;
  302. public static int CH_CURTAIN1_FEE;
  303. public static int CH_CURTAIN2_FEE;
  304. public static long CH_FRONT_FEE_RATIO;
  305. public static int CH_FRONT1_FEE;
  306. public static int CH_FRONT2_FEE;
  307. public static boolean CH_BUFF_FREE;
  308. // --------------------------------------------------
  309. // Castle Settings
  310. // --------------------------------------------------
  311. public static long CS_TELE_FEE_RATIO;
  312. public static int CS_TELE1_FEE;
  313. public static int CS_TELE2_FEE;
  314. public static long CS_MPREG_FEE_RATIO;
  315. public static int CS_MPREG1_FEE;
  316. public static int CS_MPREG2_FEE;
  317. public static long CS_HPREG_FEE_RATIO;
  318. public static int CS_HPREG1_FEE;
  319. public static int CS_HPREG2_FEE;
  320. public static long CS_EXPREG_FEE_RATIO;
  321. public static int CS_EXPREG1_FEE;
  322. public static int CS_EXPREG2_FEE;
  323. public static long CS_SUPPORT_FEE_RATIO;
  324. public static int CS_SUPPORT1_FEE;
  325. public static int CS_SUPPORT2_FEE;
  326. public static List<Integer> SIEGE_HOUR_LIST;
  327. public static int OUTER_DOOR_UPGRADE_PRICE2;
  328. public static int OUTER_DOOR_UPGRADE_PRICE3;
  329. public static int OUTER_DOOR_UPGRADE_PRICE5;
  330. public static int INNER_DOOR_UPGRADE_PRICE2;
  331. public static int INNER_DOOR_UPGRADE_PRICE3;
  332. public static int INNER_DOOR_UPGRADE_PRICE5;
  333. public static int WALL_UPGRADE_PRICE2;
  334. public static int WALL_UPGRADE_PRICE3;
  335. public static int WALL_UPGRADE_PRICE5;
  336. public static int TRAP_UPGRADE_PRICE1;
  337. public static int TRAP_UPGRADE_PRICE2;
  338. public static int TRAP_UPGRADE_PRICE3;
  339. public static int TRAP_UPGRADE_PRICE4;
  340. // --------------------------------------------------
  341. // Fortress Settings
  342. // --------------------------------------------------
  343. public static long FS_TELE_FEE_RATIO;
  344. public static int FS_TELE1_FEE;
  345. public static int FS_TELE2_FEE;
  346. public static long FS_MPREG_FEE_RATIO;
  347. public static int FS_MPREG1_FEE;
  348. public static int FS_MPREG2_FEE;
  349. public static long FS_HPREG_FEE_RATIO;
  350. public static int FS_HPREG1_FEE;
  351. public static int FS_HPREG2_FEE;
  352. public static long FS_EXPREG_FEE_RATIO;
  353. public static int FS_EXPREG1_FEE;
  354. public static int FS_EXPREG2_FEE;
  355. public static long FS_SUPPORT_FEE_RATIO;
  356. public static int FS_SUPPORT1_FEE;
  357. public static int FS_SUPPORT2_FEE;
  358. public static int FS_BLOOD_OATH_COUNT;
  359. public static int FS_UPDATE_FRQ;
  360. public static int FS_MAX_SUPPLY_LEVEL;
  361. public static int FS_FEE_FOR_CASTLE;
  362. public static int FS_MAX_OWN_TIME;
  363. // --------------------------------------------------
  364. // Feature Settings
  365. // --------------------------------------------------
  366. public static int TAKE_FORT_POINTS;
  367. public static int LOOSE_FORT_POINTS;
  368. public static int TAKE_CASTLE_POINTS;
  369. public static int LOOSE_CASTLE_POINTS;
  370. public static int CASTLE_DEFENDED_POINTS;
  371. public static int FESTIVAL_WIN_POINTS;
  372. public static int HERO_POINTS;
  373. public static int ROYAL_GUARD_COST;
  374. public static int KNIGHT_UNIT_COST;
  375. public static int KNIGHT_REINFORCE_COST;
  376. public static int BALLISTA_POINTS;
  377. public static int BLOODALLIANCE_POINTS;
  378. public static int BLOODOATH_POINTS;
  379. public static int KNIGHTSEPAULETTE_POINTS;
  380. public static int REPUTATION_SCORE_PER_KILL;
  381. public static int JOIN_ACADEMY_MIN_REP_SCORE;
  382. public static int JOIN_ACADEMY_MAX_REP_SCORE;
  383. public static int RAID_RANKING_1ST;
  384. public static int RAID_RANKING_2ND;
  385. public static int RAID_RANKING_3RD;
  386. public static int RAID_RANKING_4TH;
  387. public static int RAID_RANKING_5TH;
  388. public static int RAID_RANKING_6TH;
  389. public static int RAID_RANKING_7TH;
  390. public static int RAID_RANKING_8TH;
  391. public static int RAID_RANKING_9TH;
  392. public static int RAID_RANKING_10TH;
  393. public static int RAID_RANKING_UP_TO_50TH;
  394. public static int RAID_RANKING_UP_TO_100TH;
  395. public static int CLAN_LEVEL_6_COST;
  396. public static int CLAN_LEVEL_7_COST;
  397. public static int CLAN_LEVEL_8_COST;
  398. public static int CLAN_LEVEL_9_COST;
  399. public static int CLAN_LEVEL_10_COST;
  400. public static int CLAN_LEVEL_11_COST;
  401. public static int CLAN_LEVEL_6_REQUIREMENT;
  402. public static int CLAN_LEVEL_7_REQUIREMENT;
  403. public static int CLAN_LEVEL_8_REQUIREMENT;
  404. public static int CLAN_LEVEL_9_REQUIREMENT;
  405. public static int CLAN_LEVEL_10_REQUIREMENT;
  406. public static int CLAN_LEVEL_11_REQUIREMENT;
  407. public static boolean ALLOW_WYVERN_ALWAYS;
  408. public static boolean ALLOW_WYVERN_DURING_SIEGE;
  409. // --------------------------------------------------
  410. // General Settings
  411. // --------------------------------------------------
  412. public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
  413. public static boolean SERVER_LIST_BRACKET;
  414. public static int SERVER_LIST_TYPE;
  415. public static int SERVER_LIST_AGE;
  416. public static boolean SERVER_GMONLY;
  417. public static boolean GM_HERO_AURA;
  418. public static boolean GM_STARTUP_INVULNERABLE;
  419. public static boolean GM_STARTUP_INVISIBLE;
  420. public static boolean GM_STARTUP_SILENCE;
  421. public static boolean GM_STARTUP_AUTO_LIST;
  422. public static boolean GM_STARTUP_DIET_MODE;
  423. public static boolean GM_ITEM_RESTRICTION;
  424. public static boolean GM_SKILL_RESTRICTION;
  425. public static boolean GM_TRADE_RESTRICTED_ITEMS;
  426. public static boolean GM_RESTART_FIGHTING;
  427. public static boolean GM_ANNOUNCER_NAME;
  428. public static boolean GM_CRITANNOUNCER_NAME;
  429. public static boolean GM_GIVE_SPECIAL_SKILLS;
  430. public static boolean GM_GIVE_SPECIAL_AURA_SKILLS;
  431. public static boolean GAMEGUARD_ENFORCE;
  432. public static boolean GAMEGUARD_PROHIBITACTION;
  433. public static boolean LOG_CHAT;
  434. public static boolean LOG_AUTO_ANNOUNCEMENTS;
  435. public static boolean LOG_ITEMS;
  436. public static boolean LOG_ITEMS_SMALL_LOG;
  437. public static boolean LOG_ITEM_ENCHANTS;
  438. public static boolean LOG_SKILL_ENCHANTS;
  439. public static boolean GMAUDIT;
  440. public static boolean SKILL_CHECK_ENABLE;
  441. public static boolean SKILL_CHECK_REMOVE;
  442. public static boolean SKILL_CHECK_GM;
  443. public static boolean DEBUG;
  444. public static boolean HTML_ACTION_CACHE_DEBUG;
  445. public static boolean PACKET_HANDLER_DEBUG;
  446. public static boolean DEVELOPER;
  447. public static boolean ACCEPT_GEOEDITOR_CONN;
  448. public static boolean ALT_DEV_NO_HANDLERS;
  449. public static boolean ALT_DEV_NO_QUESTS;
  450. public static boolean ALT_DEV_NO_SPAWNS;
  451. public static boolean ALT_DEV_SHOW_QUESTS_LOAD_IN_LOGS;
  452. public static boolean ALT_DEV_SHOW_SCRIPTS_LOAD_IN_LOGS;
  453. public static int THREAD_P_EFFECTS;
  454. public static int THREAD_P_GENERAL;
  455. public static int THREAD_E_EVENTS;
  456. public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  457. public static int IO_PACKET_THREAD_CORE_SIZE;
  458. public static int GENERAL_THREAD_CORE_SIZE;
  459. public static int AI_MAX_THREAD;
  460. public static int EVENT_MAX_THREAD;
  461. public static int CLIENT_PACKET_QUEUE_SIZE;
  462. public static int CLIENT_PACKET_QUEUE_MAX_BURST_SIZE;
  463. public static int CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND;
  464. public static int CLIENT_PACKET_QUEUE_MEASURE_INTERVAL;
  465. public static int CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND;
  466. public static int CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN;
  467. public static int CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN;
  468. public static int CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN;
  469. public static int CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN;
  470. public static boolean DEADLOCK_DETECTOR;
  471. public static int DEADLOCK_CHECK_INTERVAL;
  472. public static boolean RESTART_ON_DEADLOCK;
  473. public static boolean ALLOW_DISCARDITEM;
  474. public static int AUTODESTROY_ITEM_AFTER;
  475. public static int HERB_AUTO_DESTROY_TIME;
  476. public static List<Integer> LIST_PROTECTED_ITEMS;
  477. public static boolean DATABASE_CLEAN_UP;
  478. public static long CONNECTION_CLOSE_TIME;
  479. public static int CHAR_STORE_INTERVAL;
  480. public static boolean LAZY_ITEMS_UPDATE;
  481. public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
  482. public static boolean DESTROY_DROPPED_PLAYER_ITEM;
  483. public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
  484. public static boolean SAVE_DROPPED_ITEM;
  485. public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
  486. public static int SAVE_DROPPED_ITEM_INTERVAL;
  487. public static boolean CLEAR_DROPPED_ITEM_TABLE;
  488. public static boolean AUTODELETE_INVALID_QUEST_DATA;
  489. public static boolean PRECISE_DROP_CALCULATION;
  490. public static boolean MULTIPLE_ITEM_DROP;
  491. public static boolean FORCE_INVENTORY_UPDATE;
  492. public static boolean LAZY_CACHE;
  493. public static boolean CACHE_CHAR_NAMES;
  494. public static int MIN_NPC_ANIMATION;
  495. public static int MAX_NPC_ANIMATION;
  496. public static int MIN_MONSTER_ANIMATION;
  497. public static int MAX_MONSTER_ANIMATION;
  498. public static int COORD_SYNCHRONIZE;
  499. public static boolean ENABLE_FALLING_DAMAGE;
  500. public static boolean GRIDS_ALWAYS_ON;
  501. public static int GRID_NEIGHBOR_TURNON_TIME;
  502. public static int GRID_NEIGHBOR_TURNOFF_TIME;
  503. public static int GEODATA;
  504. public static String GEODATA_DRIVER;
  505. public static File PATHNODE_DIR;
  506. public static boolean GEODATA_CELLFINDING;
  507. public static String PATHFIND_BUFFERS;
  508. public static float LOW_WEIGHT;
  509. public static float MEDIUM_WEIGHT;
  510. public static float HIGH_WEIGHT;
  511. public static boolean ADVANCED_DIAGONAL_STRATEGY;
  512. public static float DIAGONAL_WEIGHT;
  513. public static int MAX_POSTFILTER_PASSES;
  514. public static boolean DEBUG_PATH;
  515. public static boolean FORCE_GEODATA;
  516. public static boolean MOVE_BASED_KNOWNLIST;
  517. public static long KNOWNLIST_UPDATE_INTERVAL;
  518. public static int PEACE_ZONE_MODE;
  519. public static String DEFAULT_GLOBAL_CHAT;
  520. public static String DEFAULT_TRADE_CHAT;
  521. public static boolean ALLOW_WAREHOUSE;
  522. public static boolean WAREHOUSE_CACHE;
  523. public static int WAREHOUSE_CACHE_TIME;
  524. public static boolean ALLOW_REFUND;
  525. public static boolean ALLOW_MAIL;
  526. public static boolean ALLOW_ATTACHMENTS;
  527. public static boolean ALLOW_WEAR;
  528. public static int WEAR_DELAY;
  529. public static int WEAR_PRICE;
  530. public static boolean ALLOW_LOTTERY;
  531. public static boolean ALLOW_RACE;
  532. public static boolean ALLOW_WATER;
  533. public static boolean ALLOW_RENTPET;
  534. public static boolean ALLOWFISHING;
  535. public static boolean ALLOW_BOAT;
  536. public static int BOAT_BROADCAST_RADIUS;
  537. public static boolean ALLOW_CURSED_WEAPONS;
  538. public static boolean ALLOW_MANOR;
  539. public static boolean ALLOW_PET_WALKERS;
  540. public static boolean SERVER_NEWS;
  541. public static int COMMUNITY_TYPE;
  542. public static boolean BBS_SHOW_PLAYERLIST;
  543. public static String BBS_DEFAULT;
  544. public static boolean SHOW_LEVEL_COMMUNITYBOARD;
  545. public static boolean SHOW_STATUS_COMMUNITYBOARD;
  546. public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
  547. public static int NAME_PER_ROW_COMMUNITYBOARD;
  548. public static boolean USE_SAY_FILTER;
  549. public static String CHAT_FILTER_CHARS;
  550. public static int[] BAN_CHAT_CHANNELS;
  551. public static int ALT_OLY_START_TIME;
  552. public static int ALT_OLY_MIN;
  553. public static int ALT_OLY_MAX_BUFFS;
  554. public static long ALT_OLY_CPERIOD;
  555. public static long ALT_OLY_BATTLE;
  556. public static long ALT_OLY_WPERIOD;
  557. public static long ALT_OLY_VPERIOD;
  558. public static int ALT_OLY_START_POINTS;
  559. public static int ALT_OLY_WEEKLY_POINTS;
  560. public static int ALT_OLY_CLASSED;
  561. public static int ALT_OLY_NONCLASSED;
  562. public static int ALT_OLY_TEAMS;
  563. public static int ALT_OLY_REG_DISPLAY;
  564. public static int[][] ALT_OLY_CLASSED_REWARD;
  565. public static int[][] ALT_OLY_NONCLASSED_REWARD;
  566. public static int[][] ALT_OLY_TEAM_REWARD;
  567. public static int ALT_OLY_COMP_RITEM;
  568. public static int ALT_OLY_MIN_MATCHES;
  569. public static int ALT_OLY_GP_PER_POINT;
  570. public static int ALT_OLY_HERO_POINTS;
  571. public static int ALT_OLY_RANK1_POINTS;
  572. public static int ALT_OLY_RANK2_POINTS;
  573. public static int ALT_OLY_RANK3_POINTS;
  574. public static int ALT_OLY_RANK4_POINTS;
  575. public static int ALT_OLY_RANK5_POINTS;
  576. public static int ALT_OLY_MAX_POINTS;
  577. public static int ALT_OLY_DIVIDER_CLASSED;
  578. public static int ALT_OLY_DIVIDER_NON_CLASSED;
  579. public static int ALT_OLY_MAX_WEEKLY_MATCHES;
  580. public static int ALT_OLY_MAX_WEEKLY_MATCHES_NON_CLASSED;
  581. public static int ALT_OLY_MAX_WEEKLY_MATCHES_CLASSED;
  582. public static int ALT_OLY_MAX_WEEKLY_MATCHES_TEAM;
  583. public static boolean ALT_OLY_LOG_FIGHTS;
  584. public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
  585. public static boolean ALT_OLY_ANNOUNCE_GAMES;
  586. public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
  587. public static int ALT_OLY_ENCHANT_LIMIT;
  588. public static int ALT_OLY_WAIT_TIME;
  589. public static int ALT_MANOR_REFRESH_TIME;
  590. public static int ALT_MANOR_REFRESH_MIN;
  591. public static int ALT_MANOR_APPROVE_TIME;
  592. public static int ALT_MANOR_APPROVE_MIN;
  593. public static int ALT_MANOR_MAINTENANCE_MIN;
  594. public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
  595. public static int ALT_MANOR_SAVE_PERIOD_RATE;
  596. public static long ALT_LOTTERY_PRIZE;
  597. public static long ALT_LOTTERY_TICKET_PRICE;
  598. public static float ALT_LOTTERY_5_NUMBER_RATE;
  599. public static float ALT_LOTTERY_4_NUMBER_RATE;
  600. public static float ALT_LOTTERY_3_NUMBER_RATE;
  601. public static long ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
  602. public static boolean ALT_ITEM_AUCTION_ENABLED;
  603. public static int ALT_ITEM_AUCTION_EXPIRED_AFTER;
  604. public static long ALT_ITEM_AUCTION_TIME_EXTENDS_ON_BID;
  605. public static int FS_TIME_ATTACK;
  606. public static int FS_TIME_COOLDOWN;
  607. public static int FS_TIME_ENTRY;
  608. public static int FS_TIME_WARMUP;
  609. public static int FS_PARTY_MEMBER_COUNT;
  610. public static int RIFT_MIN_PARTY_SIZE;
  611. public static int RIFT_SPAWN_DELAY;
  612. public static int RIFT_MAX_JUMPS;
  613. public static int RIFT_AUTO_JUMPS_TIME_MIN;
  614. public static int RIFT_AUTO_JUMPS_TIME_MAX;
  615. public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
  616. public static int RIFT_ENTER_COST_RECRUIT;
  617. public static int RIFT_ENTER_COST_SOLDIER;
  618. public static int RIFT_ENTER_COST_OFFICER;
  619. public static int RIFT_ENTER_COST_CAPTAIN;
  620. public static int RIFT_ENTER_COST_COMMANDER;
  621. public static int RIFT_ENTER_COST_HERO;
  622. public static IllegalActionPunishmentType DEFAULT_PUNISH;
  623. public static int DEFAULT_PUNISH_PARAM;
  624. public static boolean ONLY_GM_ITEMS_FREE;
  625. public static boolean JAIL_IS_PVP;
  626. public static boolean JAIL_DISABLE_CHAT;
  627. public static boolean JAIL_DISABLE_TRANSACTION;
  628. public static boolean CUSTOM_SPAWNLIST_TABLE;
  629. public static boolean SAVE_GMSPAWN_ON_CUSTOM;
  630. public static boolean CUSTOM_NPC_DATA;
  631. public static boolean CUSTOM_TELEPORT_TABLE;
  632. public static boolean CUSTOM_NPCBUFFER_TABLES;
  633. public static boolean CUSTOM_SKILLS_LOAD;
  634. public static boolean CUSTOM_ITEMS_LOAD;
  635. public static boolean CUSTOM_MULTISELL_LOAD;
  636. public static boolean CUSTOM_BUYLIST_LOAD;
  637. public static int ALT_BIRTHDAY_GIFT;
  638. public static String ALT_BIRTHDAY_MAIL_SUBJECT;
  639. public static String ALT_BIRTHDAY_MAIL_TEXT;
  640. public static boolean ENABLE_BLOCK_CHECKER_EVENT;
  641. public static int MIN_BLOCK_CHECKER_TEAM_MEMBERS;
  642. public static boolean HBCE_FAIR_PLAY;
  643. public static boolean HELLBOUND_WITHOUT_QUEST;
  644. public static int PLAYER_MOVEMENT_BLOCK_TIME;
  645. public static int NORMAL_ENCHANT_COST_MULTIPLIER;
  646. public static int SAFE_ENCHANT_COST_MULTIPLIER;
  647. public static boolean BOTREPORT_ENABLE;
  648. public static String[] BOTREPORT_RESETPOINT_HOUR;
  649. public static long BOTREPORT_REPORT_DELAY;
  650. public static boolean BOTREPORT_ALLOW_REPORTS_FROM_SAME_CLAN_MEMBERS;
  651. // --------------------------------------------------
  652. // FloodProtector Settings
  653. // --------------------------------------------------
  654. public static FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM;
  655. public static FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE;
  656. public static FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK;
  657. public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON;
  658. public static FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE;
  659. public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
  660. public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS;
  661. public static FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM;
  662. public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS;
  663. public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
  664. public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
  665. public static FloodProtectorConfig FLOOD_PROTECTOR_MANUFACTURE;
  666. public static FloodProtectorConfig FLOOD_PROTECTOR_MANOR;
  667. public static FloodProtectorConfig FLOOD_PROTECTOR_SENDMAIL;
  668. public static FloodProtectorConfig FLOOD_PROTECTOR_CHARACTER_SELECT;
  669. public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_AUCTION;
  670. // --------------------------------------------------
  671. // L2JMods Settings
  672. // --------------------------------------------------
  673. public static boolean L2JMOD_CHAMPION_ENABLE;
  674. public static boolean L2JMOD_CHAMPION_PASSIVE;
  675. public static int L2JMOD_CHAMPION_FREQUENCY;
  676. public static String L2JMOD_CHAMP_TITLE;
  677. public static int L2JMOD_CHAMP_MIN_LVL;
  678. public static int L2JMOD_CHAMP_MAX_LVL;
  679. public static int L2JMOD_CHAMPION_HP;
  680. public static int L2JMOD_CHAMPION_REWARDS;
  681. public static float L2JMOD_CHAMPION_ADENAS_REWARDS;
  682. public static float L2JMOD_CHAMPION_HP_REGEN;
  683. public static float L2JMOD_CHAMPION_ATK;
  684. public static float L2JMOD_CHAMPION_SPD_ATK;
  685. public static int L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
  686. public static int L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
  687. public static int L2JMOD_CHAMPION_REWARD_ID;
  688. public static int L2JMOD_CHAMPION_REWARD_QTY;
  689. public static boolean L2JMOD_CHAMPION_ENABLE_VITALITY;
  690. public static boolean L2JMOD_CHAMPION_ENABLE_IN_INSTANCES;
  691. public static boolean TVT_EVENT_ENABLED;
  692. public static boolean TVT_EVENT_IN_INSTANCE;
  693. public static String TVT_EVENT_INSTANCE_FILE;
  694. public static String[] TVT_EVENT_INTERVAL;
  695. public static int TVT_EVENT_PARTICIPATION_TIME;
  696. public static int TVT_EVENT_RUNNING_TIME;
  697. public static int TVT_EVENT_PARTICIPATION_NPC_ID;
  698. public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  699. public static int[] TVT_EVENT_PARTICIPATION_FEE = new int[2];
  700. public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
  701. public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
  702. public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
  703. public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
  704. public static String TVT_EVENT_TEAM_1_NAME;
  705. public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  706. public static String TVT_EVENT_TEAM_2_NAME;
  707. public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  708. public static List<int[]> TVT_EVENT_REWARDS;
  709. public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  710. public static boolean TVT_EVENT_SCROLL_ALLOWED;
  711. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  712. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  713. public static List<Integer> TVT_DOORS_IDS_TO_OPEN;
  714. public static List<Integer> TVT_DOORS_IDS_TO_CLOSE;
  715. public static boolean TVT_REWARD_TEAM_TIE;
  716. public static byte TVT_EVENT_MIN_LVL;
  717. public static byte TVT_EVENT_MAX_LVL;
  718. public static int TVT_EVENT_EFFECTS_REMOVAL;
  719. public static Map<Integer, Integer> TVT_EVENT_FIGHTER_BUFFS;
  720. public static Map<Integer, Integer> TVT_EVENT_MAGE_BUFFS;
  721. public static int TVT_EVENT_MAX_PARTICIPANTS_PER_IP;
  722. public static boolean TVT_ALLOW_VOICED_COMMAND;
  723. public static boolean L2JMOD_ALLOW_WEDDING;
  724. public static int L2JMOD_WEDDING_PRICE;
  725. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  726. public static boolean L2JMOD_WEDDING_TELEPORT;
  727. public static int L2JMOD_WEDDING_TELEPORT_PRICE;
  728. public static int L2JMOD_WEDDING_TELEPORT_DURATION;
  729. public static boolean L2JMOD_WEDDING_SAMESEX;
  730. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  731. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  732. public static boolean L2JMOD_HELLBOUND_STATUS;
  733. public static boolean BANKING_SYSTEM_ENABLED;
  734. public static int BANKING_SYSTEM_GOLDBARS;
  735. public static int BANKING_SYSTEM_ADENA;
  736. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
  737. public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
  738. public static boolean OFFLINE_TRADE_ENABLE;
  739. public static boolean OFFLINE_CRAFT_ENABLE;
  740. public static boolean OFFLINE_MODE_IN_PEACE_ZONE;
  741. public static boolean OFFLINE_MODE_NO_DAMAGE;
  742. public static boolean RESTORE_OFFLINERS;
  743. public static int OFFLINE_MAX_DAYS;
  744. public static boolean OFFLINE_DISCONNECT_FINISHED;
  745. public static boolean OFFLINE_SET_NAME_COLOR;
  746. public static int OFFLINE_NAME_COLOR;
  747. public static boolean OFFLINE_FAME;
  748. public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
  749. public static boolean L2JMOD_DISPLAY_SERVER_TIME;
  750. public static boolean WELCOME_MESSAGE_ENABLED;
  751. public static String WELCOME_MESSAGE_TEXT;
  752. public static int WELCOME_MESSAGE_TIME;
  753. public static boolean L2JMOD_ANTIFEED_ENABLE;
  754. public static boolean L2JMOD_ANTIFEED_DUALBOX;
  755. public static boolean L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX;
  756. public static int L2JMOD_ANTIFEED_INTERVAL;
  757. public static boolean ANNOUNCE_PK_PVP;
  758. public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE;
  759. public static String ANNOUNCE_PK_MSG;
  760. public static String ANNOUNCE_PVP_MSG;
  761. public static boolean L2JMOD_CHAT_ADMIN;
  762. public static boolean L2JMOD_MULTILANG_ENABLE;
  763. public static List<String> L2JMOD_MULTILANG_ALLOWED = new ArrayList<>();
  764. public static String L2JMOD_MULTILANG_DEFAULT;
  765. public static boolean L2JMOD_MULTILANG_VOICED_ALLOW;
  766. public static boolean L2JMOD_MULTILANG_SM_ENABLE;
  767. public static List<String> L2JMOD_MULTILANG_SM_ALLOWED = new ArrayList<>();
  768. public static boolean L2JMOD_MULTILANG_NS_ENABLE;
  769. public static List<String> L2JMOD_MULTILANG_NS_ALLOWED = new ArrayList<>();
  770. public static boolean L2WALKER_PROTECTION;
  771. public static boolean L2JMOD_DEBUG_VOICE_COMMAND;
  772. public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
  773. public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
  774. public static int L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
  775. public static Map<Integer, Integer> L2JMOD_DUALBOX_CHECK_WHITELIST;
  776. public static boolean L2JMOD_ALLOW_CHANGE_PASSWORD;
  777. // --------------------------------------------------
  778. // NPC Settings
  779. // --------------------------------------------------
  780. public static boolean ANNOUNCE_MAMMON_SPAWN;
  781. public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
  782. public static boolean ALT_ATTACKABLE_NPCS;
  783. public static boolean ALT_GAME_VIEWNPC;
  784. public static int MAX_DRIFT_RANGE;
  785. public static boolean DEEPBLUE_DROP_RULES;
  786. public static boolean DEEPBLUE_DROP_RULES_RAID;
  787. public static boolean SHOW_NPC_LVL;
  788. public static boolean SHOW_CREST_WITHOUT_QUEST;
  789. public static boolean ENABLE_RANDOM_ENCHANT_EFFECT;
  790. public static int MIN_NPC_LVL_DMG_PENALTY;
  791. public static Map<Integer, Float> NPC_DMG_PENALTY;
  792. public static Map<Integer, Float> NPC_CRIT_DMG_PENALTY;
  793. public static Map<Integer, Float> NPC_SKILL_DMG_PENALTY;
  794. public static int MIN_NPC_LVL_MAGIC_PENALTY;
  795. public static Map<Integer, Float> NPC_SKILL_CHANCE_PENALTY;
  796. public static int DECAY_TIME_TASK;
  797. public static int DEFAULT_CORPSE_TIME;
  798. public static int SPOILED_CORPSE_EXTEND_TIME;
  799. public static int CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY;
  800. public static boolean GUARD_ATTACK_AGGRO_MOB;
  801. public static boolean ALLOW_WYVERN_UPGRADER;
  802. public static List<Integer> LIST_PET_RENT_NPC;
  803. public static double RAID_HP_REGEN_MULTIPLIER;
  804. public static double RAID_MP_REGEN_MULTIPLIER;
  805. public static double RAID_PDEFENCE_MULTIPLIER;
  806. public static double RAID_MDEFENCE_MULTIPLIER;
  807. public static double RAID_PATTACK_MULTIPLIER;
  808. public static double RAID_MATTACK_MULTIPLIER;
  809. public static double RAID_MINION_RESPAWN_TIMER;
  810. public static Map<Integer, Integer> MINIONS_RESPAWN_TIME;
  811. public static float RAID_MIN_RESPAWN_MULTIPLIER;
  812. public static float RAID_MAX_RESPAWN_MULTIPLIER;
  813. public static boolean RAID_DISABLE_CURSE;
  814. public static int RAID_CHAOS_TIME;
  815. public static int GRAND_CHAOS_TIME;
  816. public static int MINION_CHAOS_TIME;
  817. public static int INVENTORY_MAXIMUM_PET;
  818. public static double PET_HP_REGEN_MULTIPLIER;
  819. public static double PET_MP_REGEN_MULTIPLIER;
  820. public static int DROP_ADENA_MIN_LEVEL_DIFFERENCE;
  821. public static int DROP_ADENA_MAX_LEVEL_DIFFERENCE;
  822. public static double DROP_ADENA_MIN_LEVEL_GAP_CHANCE;
  823. public static int DROP_ITEM_MIN_LEVEL_DIFFERENCE;
  824. public static int DROP_ITEM_MAX_LEVEL_DIFFERENCE;
  825. public static double DROP_ITEM_MIN_LEVEL_GAP_CHANCE;
  826. // --------------------------------------------------
  827. // PvP Settings
  828. // --------------------------------------------------
  829. public static boolean KARMA_DROP_GM;
  830. public static boolean KARMA_AWARD_PK_KILL;
  831. public static int KARMA_PK_LIMIT;
  832. public static String KARMA_NONDROPPABLE_PET_ITEMS;
  833. public static String KARMA_NONDROPPABLE_ITEMS;
  834. public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS;
  835. public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
  836. // --------------------------------------------------
  837. // Rate Settings
  838. // --------------------------------------------------
  839. public static float RATE_XP;
  840. public static float RATE_SP;
  841. public static float RATE_PARTY_XP;
  842. public static float RATE_PARTY_SP;
  843. public static float RATE_HB_TRUST_INCREASE;
  844. public static float RATE_HB_TRUST_DECREASE;
  845. public static float RATE_EXTRACTABLE;
  846. public static int RATE_DROP_MANOR;
  847. public static float RATE_QUEST_DROP;
  848. public static float RATE_QUEST_REWARD;
  849. public static float RATE_QUEST_REWARD_XP;
  850. public static float RATE_QUEST_REWARD_SP;
  851. public static float RATE_QUEST_REWARD_ADENA;
  852. public static boolean RATE_QUEST_REWARD_USE_MULTIPLIERS;
  853. public static float RATE_QUEST_REWARD_POTION;
  854. public static float RATE_QUEST_REWARD_SCROLL;
  855. public static float RATE_QUEST_REWARD_RECIPE;
  856. public static float RATE_QUEST_REWARD_MATERIAL;
  857. public static float RATE_DEATH_DROP_AMOUNT_MULTIPLIER;
  858. public static float RATE_CORPSE_DROP_AMOUNT_MULTIPLIER;
  859. public static float RATE_HERB_DROP_AMOUNT_MULTIPLIER;
  860. public static float RATE_RAID_DROP_AMOUNT_MULTIPLIER;
  861. public static float RATE_DEATH_DROP_CHANCE_MULTIPLIER;
  862. public static float RATE_CORPSE_DROP_CHANCE_MULTIPLIER;
  863. public static float RATE_HERB_DROP_CHANCE_MULTIPLIER;
  864. public static float RATE_RAID_DROP_CHANCE_MULTIPLIER;
  865. public static Map<Integer, Float> RATE_DROP_AMOUNT_MULTIPLIER;
  866. public static Map<Integer, Float> RATE_DROP_CHANCE_MULTIPLIER;
  867. public static float RATE_KARMA_LOST;
  868. public static float RATE_KARMA_EXP_LOST;
  869. public static float RATE_SIEGE_GUARDS_PRICE;
  870. public static float RATE_DROP_COMMON_HERBS;
  871. public static float RATE_DROP_HP_HERBS;
  872. public static float RATE_DROP_MP_HERBS;
  873. public static float RATE_DROP_SPECIAL_HERBS;
  874. public static int PLAYER_DROP_LIMIT;
  875. public static int PLAYER_RATE_DROP;
  876. public static int PLAYER_RATE_DROP_ITEM;
  877. public static int PLAYER_RATE_DROP_EQUIP;
  878. public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
  879. public static float PET_XP_RATE;
  880. public static int PET_FOOD_RATE;
  881. public static float SINEATER_XP_RATE;
  882. public static int KARMA_DROP_LIMIT;
  883. public static int KARMA_RATE_DROP;
  884. public static int KARMA_RATE_DROP_ITEM;
  885. public static int KARMA_RATE_DROP_EQUIP;
  886. public static int KARMA_RATE_DROP_EQUIP_WEAPON;
  887. public static double[] PLAYER_XP_PERCENT_LOST;
  888. // --------------------------------------------------
  889. // Seven Signs Settings
  890. // --------------------------------------------------
  891. public static boolean ALT_GAME_CASTLE_DAWN;
  892. public static boolean ALT_GAME_CASTLE_DUSK;
  893. public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
  894. public static int ALT_FESTIVAL_MIN_PLAYER;
  895. public static int ALT_MAXIMUM_PLAYER_CONTRIB;
  896. public static long ALT_FESTIVAL_MANAGER_START;
  897. public static long ALT_FESTIVAL_LENGTH;
  898. public static long ALT_FESTIVAL_CYCLE_LENGTH;
  899. public static long ALT_FESTIVAL_FIRST_SPAWN;
  900. public static long ALT_FESTIVAL_FIRST_SWARM;
  901. public static long ALT_FESTIVAL_SECOND_SPAWN;
  902. public static long ALT_FESTIVAL_SECOND_SWARM;
  903. public static long ALT_FESTIVAL_CHEST_SPAWN;
  904. public static double ALT_SIEGE_DAWN_GATES_PDEF_MULT;
  905. public static double ALT_SIEGE_DUSK_GATES_PDEF_MULT;
  906. public static double ALT_SIEGE_DAWN_GATES_MDEF_MULT;
  907. public static double ALT_SIEGE_DUSK_GATES_MDEF_MULT;
  908. public static boolean ALT_STRICT_SEVENSIGNS;
  909. public static boolean ALT_SEVENSIGNS_LAZY_UPDATE;
  910. public static int SSQ_DAWN_TICKET_QUANTITY;
  911. public static int SSQ_DAWN_TICKET_PRICE;
  912. public static int SSQ_DAWN_TICKET_BUNDLE;
  913. public static int SSQ_MANORS_AGREEMENT_ID;
  914. public static int SSQ_JOIN_DAWN_ADENA_FEE;
  915. // --------------------------------------------------
  916. // Server Settings
  917. // --------------------------------------------------
  918. public static boolean ENABLE_UPNP;
  919. public static int PORT_GAME;
  920. public static int PORT_LOGIN;
  921. public static String LOGIN_BIND_ADDRESS;
  922. public static int LOGIN_TRY_BEFORE_BAN;
  923. public static int LOGIN_BLOCK_AFTER_BAN;
  924. public static String GAMESERVER_HOSTNAME;
  925. public static String DATABASE_DRIVER;
  926. public static String DATABASE_URL;
  927. public static String DATABASE_LOGIN;
  928. public static String DATABASE_PASSWORD;
  929. public static int DATABASE_MAX_CONNECTIONS;
  930. public static int DATABASE_MAX_IDLE_TIME;
  931. public static int MAXIMUM_ONLINE_USERS;
  932. public static String CNAME_TEMPLATE;
  933. public static String PET_NAME_TEMPLATE;
  934. public static String CLAN_NAME_TEMPLATE;
  935. public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
  936. public static File DATAPACK_ROOT;
  937. public static boolean ACCEPT_ALTERNATE_ID;
  938. public static int REQUEST_ID;
  939. public static boolean RESERVE_HOST_ON_LOGIN = false;
  940. public static List<Integer> PROTOCOL_LIST;
  941. public static boolean LOGIN_SERVER_SCHEDULE_RESTART;
  942. public static long LOGIN_SERVER_SCHEDULE_RESTART_TIME;
  943. // --------------------------------------------------
  944. // CommunityServer Settings
  945. // --------------------------------------------------
  946. public static boolean ENABLE_COMMUNITY_BOARD;
  947. public static String COMMUNITY_SERVER_ADDRESS;
  948. public static int COMMUNITY_SERVER_PORT;
  949. public static byte[] COMMUNITY_SERVER_HEX_ID;
  950. public static int COMMUNITY_SERVER_SQL_DP_ID;
  951. // --------------------------------------------------
  952. // MMO Settings
  953. // --------------------------------------------------
  954. public static int MMO_SELECTOR_SLEEP_TIME;
  955. public static int MMO_MAX_SEND_PER_PASS;
  956. public static int MMO_MAX_READ_PER_PASS;
  957. public static int MMO_HELPER_BUFFER_COUNT;
  958. public static boolean MMO_TCP_NODELAY;
  959. // --------------------------------------------------
  960. // Vitality Settings
  961. // --------------------------------------------------
  962. public static boolean ENABLE_VITALITY;
  963. public static boolean RECOVER_VITALITY_ON_RECONNECT;
  964. public static boolean ENABLE_DROP_VITALITY_HERBS;
  965. public static float RATE_VITALITY_LEVEL_1;
  966. public static float RATE_VITALITY_LEVEL_2;
  967. public static float RATE_VITALITY_LEVEL_3;
  968. public static float RATE_VITALITY_LEVEL_4;
  969. public static float RATE_DROP_VITALITY_HERBS;
  970. public static float RATE_RECOVERY_VITALITY_PEACE_ZONE;
  971. public static float RATE_VITALITY_LOST;
  972. public static float RATE_VITALITY_GAIN;
  973. public static float RATE_RECOVERY_ON_RECONNECT;
  974. public static int STARTING_VITALITY_POINTS;
  975. // --------------------------------------------------
  976. // No classification assigned to the following yet
  977. // --------------------------------------------------
  978. public static int MAX_ITEM_IN_PACKET;
  979. public static boolean CHECK_KNOWN;
  980. public static int GAME_SERVER_LOGIN_PORT;
  981. public static String GAME_SERVER_LOGIN_HOST;
  982. public static List<String> GAME_SERVER_SUBNETS;
  983. public static List<String> GAME_SERVER_HOSTS;
  984. public static int PVP_NORMAL_TIME;
  985. public static int PVP_PVP_TIME;
  986. public static enum IdFactoryType
  987. {
  988. Compaction,
  989. BitSet,
  990. Stack
  991. }
  992. public static IdFactoryType IDFACTORY_TYPE;
  993. public static boolean BAD_ID_CHECKING;
  994. public static double ENCHANT_CHANCE_ELEMENT_STONE;
  995. public static double ENCHANT_CHANCE_ELEMENT_CRYSTAL;
  996. public static double ENCHANT_CHANCE_ELEMENT_JEWEL;
  997. public static double ENCHANT_CHANCE_ELEMENT_ENERGY;
  998. public static int[] ENCHANT_BLACKLIST;
  999. public static int AUGMENTATION_NG_SKILL_CHANCE;
  1000. public static int AUGMENTATION_NG_GLOW_CHANCE;
  1001. public static int AUGMENTATION_MID_SKILL_CHANCE;
  1002. public static int AUGMENTATION_MID_GLOW_CHANCE;
  1003. public static int AUGMENTATION_HIGH_SKILL_CHANCE;
  1004. public static int AUGMENTATION_HIGH_GLOW_CHANCE;
  1005. public static int AUGMENTATION_TOP_SKILL_CHANCE;
  1006. public static int AUGMENTATION_TOP_GLOW_CHANCE;
  1007. public static int AUGMENTATION_BASESTAT_CHANCE;
  1008. public static int AUGMENTATION_ACC_SKILL_CHANCE;
  1009. public static boolean RETAIL_LIKE_AUGMENTATION;
  1010. public static int[] RETAIL_LIKE_AUGMENTATION_NG_CHANCE;
  1011. public static int[] RETAIL_LIKE_AUGMENTATION_MID_CHANCE;
  1012. public static int[] RETAIL_LIKE_AUGMENTATION_HIGH_CHANCE;
  1013. public static int[] RETAIL_LIKE_AUGMENTATION_TOP_CHANCE;
  1014. public static boolean RETAIL_LIKE_AUGMENTATION_ACCESSORY;
  1015. public static int[] AUGMENTATION_BLACKLIST;
  1016. public static boolean ALT_ALLOW_AUGMENT_PVP_ITEMS;
  1017. public static double HP_REGEN_MULTIPLIER;
  1018. public static double MP_REGEN_MULTIPLIER;
  1019. public static double CP_REGEN_MULTIPLIER;
  1020. public static boolean IS_TELNET_ENABLED;
  1021. public static boolean SHOW_LICENCE;
  1022. public static boolean ACCEPT_NEW_GAMESERVER;
  1023. public static int SERVER_ID;
  1024. public static byte[] HEX_ID;
  1025. public static boolean AUTO_CREATE_ACCOUNTS;
  1026. public static boolean FLOOD_PROTECTION;
  1027. public static int FAST_CONNECTION_LIMIT;
  1028. public static int NORMAL_CONNECTION_TIME;
  1029. public static int FAST_CONNECTION_TIME;
  1030. public static int MAX_CONNECTION_PER_IP;
  1031. // GrandBoss Settings
  1032. // Antharas
  1033. public static int ANTHARAS_WAIT_TIME;
  1034. public static int ANTHARAS_SPAWN_INTERVAL;
  1035. public static int ANTHARAS_SPAWN_RANDOM;
  1036. // Valakas
  1037. public static int VALAKAS_WAIT_TIME;
  1038. public static int VALAKAS_SPAWN_INTERVAL;
  1039. public static int VALAKAS_SPAWN_RANDOM;
  1040. // Baium
  1041. public static int BAIUM_SPAWN_INTERVAL;
  1042. public static int BAIUM_SPAWN_RANDOM;
  1043. // Core
  1044. public static int CORE_SPAWN_INTERVAL;
  1045. public static int CORE_SPAWN_RANDOM;
  1046. // Offen
  1047. public static int ORFEN_SPAWN_INTERVAL;
  1048. public static int ORFEN_SPAWN_RANDOM;
  1049. // Queen Ant
  1050. public static int QUEEN_ANT_SPAWN_INTERVAL;
  1051. public static int QUEEN_ANT_SPAWN_RANDOM;
  1052. // Beleth
  1053. public static int BELETH_MIN_PLAYERS;
  1054. public static int BELETH_SPAWN_INTERVAL;
  1055. public static int BELETH_SPAWN_RANDOM;
  1056. // Gracia Seeds Settings
  1057. public static int SOD_TIAT_KILL_COUNT;
  1058. public static long SOD_STAGE_2_LENGTH;
  1059. // chatfilter
  1060. public static ArrayList<String> FILTER_LIST;
  1061. // Email
  1062. public static String EMAIL_SERVERINFO_NAME;
  1063. public static String EMAIL_SERVERINFO_ADDRESS;
  1064. public static boolean EMAIL_SYS_ENABLED;
  1065. public static String EMAIL_SYS_HOST;
  1066. public static int EMAIL_SYS_PORT;
  1067. public static boolean EMAIL_SYS_SMTP_AUTH;
  1068. public static String EMAIL_SYS_FACTORY;
  1069. public static boolean EMAIL_SYS_FACTORY_CALLBACK;
  1070. public static String EMAIL_SYS_USERNAME;
  1071. public static String EMAIL_SYS_PASSWORD;
  1072. public static String EMAIL_SYS_ADDRESS;
  1073. public static String EMAIL_SYS_SELECTQUERY;
  1074. public static String EMAIL_SYS_DBFIELD;
  1075. // Conquerable Halls Settings
  1076. public static int CHS_CLAN_MINLEVEL;
  1077. public static int CHS_MAX_ATTACKERS;
  1078. public static int CHS_MAX_FLAGS_PER_CLAN;
  1079. public static boolean CHS_ENABLE_FAME;
  1080. public static int CHS_FAME_AMOUNT;
  1081. public static int CHS_FAME_FREQUENCY;
  1082. /**
  1083. * This class initializes all global variables for configuration.<br>
  1084. * If the key doesn't appear in properties file, a default value is set by this class. {@link #CONFIGURATION_FILE} (properties file) for configuring your server.
  1085. */
  1086. public static void load()
  1087. {
  1088. if (Server.serverMode == Server.MODE_GAMESERVER)
  1089. {
  1090. FLOOD_PROTECTOR_USE_ITEM = new FloodProtectorConfig("UseItemFloodProtector");
  1091. FLOOD_PROTECTOR_ROLL_DICE = new FloodProtectorConfig("RollDiceFloodProtector");
  1092. FLOOD_PROTECTOR_FIREWORK = new FloodProtectorConfig("FireworkFloodProtector");
  1093. FLOOD_PROTECTOR_ITEM_PET_SUMMON = new FloodProtectorConfig("ItemPetSummonFloodProtector");
  1094. FLOOD_PROTECTOR_HERO_VOICE = new FloodProtectorConfig("HeroVoiceFloodProtector");
  1095. FLOOD_PROTECTOR_GLOBAL_CHAT = new FloodProtectorConfig("GlobalChatFloodProtector");
  1096. FLOOD_PROTECTOR_SUBCLASS = new FloodProtectorConfig("SubclassFloodProtector");
  1097. FLOOD_PROTECTOR_DROP_ITEM = new FloodProtectorConfig("DropItemFloodProtector");
  1098. FLOOD_PROTECTOR_SERVER_BYPASS = new FloodProtectorConfig("ServerBypassFloodProtector");
  1099. FLOOD_PROTECTOR_MULTISELL = new FloodProtectorConfig("MultiSellFloodProtector");
  1100. FLOOD_PROTECTOR_TRANSACTION = new FloodProtectorConfig("TransactionFloodProtector");
  1101. FLOOD_PROTECTOR_MANUFACTURE = new FloodProtectorConfig("ManufactureFloodProtector");
  1102. FLOOD_PROTECTOR_MANOR = new FloodProtectorConfig("ManorFloodProtector");
  1103. FLOOD_PROTECTOR_SENDMAIL = new FloodProtectorConfig("SendMailFloodProtector");
  1104. FLOOD_PROTECTOR_CHARACTER_SELECT = new FloodProtectorConfig("CharacterSelectFloodProtector");
  1105. FLOOD_PROTECTOR_ITEM_AUCTION = new FloodProtectorConfig("ItemAuctionFloodProtector");
  1106. final PropertiesParser serverSettings = new PropertiesParser(CONFIGURATION_FILE);
  1107. ENABLE_UPNP = serverSettings.getBoolean("EnableUPnP", true);
  1108. GAMESERVER_HOSTNAME = serverSettings.getString("GameserverHostname", "*");
  1109. PORT_GAME = serverSettings.getInt("GameserverPort", 7777);
  1110. GAME_SERVER_LOGIN_PORT = serverSettings.getInt("LoginPort", 9014);
  1111. GAME_SERVER_LOGIN_HOST = serverSettings.getString("LoginHost", "127.0.0.1");
  1112. REQUEST_ID = serverSettings.getInt("RequestServerID", 0);
  1113. ACCEPT_ALTERNATE_ID = serverSettings.getBoolean("AcceptAlternateID", true);
  1114. DATABASE_DRIVER = serverSettings.getString("Driver", "com.mysql.jdbc.Driver");
  1115. DATABASE_URL = serverSettings.getString("URL", "jdbc:mysql://localhost/l2jgs");
  1116. DATABASE_LOGIN = serverSettings.getString("Login", "root");
  1117. DATABASE_PASSWORD = serverSettings.getString("Password", "");
  1118. DATABASE_MAX_CONNECTIONS = serverSettings.getInt("MaximumDbConnections", 10);
  1119. DATABASE_MAX_IDLE_TIME = serverSettings.getInt("MaximumDbIdleTime", 0);
  1120. try
  1121. {
  1122. DATAPACK_ROOT = new File(serverSettings.getString("DatapackRoot", ".").replaceAll("\\\\", "/")).getCanonicalFile();
  1123. }
  1124. catch (IOException e)
  1125. {
  1126. _log.log(Level.WARNING, "Error setting datapack root!", e);
  1127. DATAPACK_ROOT = new File(".");
  1128. }
  1129. CNAME_TEMPLATE = serverSettings.getString("CnameTemplate", ".*");
  1130. PET_NAME_TEMPLATE = serverSettings.getString("PetNameTemplate", ".*");
  1131. CLAN_NAME_TEMPLATE = serverSettings.getString("ClanNameTemplate", ".*");
  1132. MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
  1133. MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
  1134. String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "267;268;271;273").split(";");
  1135. PROTOCOL_LIST = new ArrayList<>(protocols.length);
  1136. for (String protocol : protocols)
  1137. {
  1138. try
  1139. {
  1140. PROTOCOL_LIST.add(Integer.parseInt(protocol.trim()));
  1141. }
  1142. catch (NumberFormatException e)
  1143. {
  1144. _log.log(Level.WARNING, "Wrong config protocol version: " + protocol + ". Skipped.");
  1145. }
  1146. }
  1147. // Hosts and Subnets
  1148. IPConfigData ipcd = new IPConfigData();
  1149. GAME_SERVER_SUBNETS = ipcd.getSubnets();
  1150. GAME_SERVER_HOSTS = ipcd.getHosts();
  1151. // Load Community Properties file (if exists)
  1152. final PropertiesParser communityServerSettings = new PropertiesParser(COMMUNITY_CONFIGURATION_FILE);
  1153. ENABLE_COMMUNITY_BOARD = communityServerSettings.getBoolean("EnableCommunityBoard", false);
  1154. COMMUNITY_SERVER_ADDRESS = communityServerSettings.getString("CommunityServerHostname", "localhost");
  1155. COMMUNITY_SERVER_PORT = communityServerSettings.getInt("CommunityServerPort", 9013);
  1156. COMMUNITY_SERVER_HEX_ID = new BigInteger(communityServerSettings.getString("CommunityServerHexId", "0"), 16).toByteArray();
  1157. COMMUNITY_SERVER_SQL_DP_ID = communityServerSettings.getInt("CommunityServerSqlDpId", 200);
  1158. // Load Feature L2Properties file (if exists)
  1159. final PropertiesParser Feature = new PropertiesParser(FEATURE_CONFIG_FILE);
  1160. CH_TELE_FEE_RATIO = Feature.getLong("ClanHallTeleportFunctionFeeRatio", 604800000);
  1161. CH_TELE1_FEE = Feature.getInt("ClanHallTeleportFunctionFeeLvl1", 7000);
  1162. CH_TELE2_FEE = Feature.getInt("ClanHallTeleportFunctionFeeLvl2", 14000);
  1163. CH_SUPPORT_FEE_RATIO = Feature.getLong("ClanHallSupportFunctionFeeRatio", 86400000);
  1164. CH_SUPPORT1_FEE = Feature.getInt("ClanHallSupportFeeLvl1", 2500);
  1165. CH_SUPPORT2_FEE = Feature.getInt("ClanHallSupportFeeLvl2", 5000);
  1166. CH_SUPPORT3_FEE = Feature.getInt("ClanHallSupportFeeLvl3", 7000);
  1167. CH_SUPPORT4_FEE = Feature.getInt("ClanHallSupportFeeLvl4", 11000);
  1168. CH_SUPPORT5_FEE = Feature.getInt("ClanHallSupportFeeLvl5", 21000);
  1169. CH_SUPPORT6_FEE = Feature.getInt("ClanHallSupportFeeLvl6", 36000);
  1170. CH_SUPPORT7_FEE = Feature.getInt("ClanHallSupportFeeLvl7", 37000);
  1171. CH_SUPPORT8_FEE = Feature.getInt("ClanHallSupportFeeLvl8", 52000);
  1172. CH_MPREG_FEE_RATIO = Feature.getLong("ClanHallMpRegenerationFunctionFeeRatio", 86400000);
  1173. CH_MPREG1_FEE = Feature.getInt("ClanHallMpRegenerationFeeLvl1", 2000);
  1174. CH_MPREG2_FEE = Feature.getInt("ClanHallMpRegenerationFeeLvl2", 3750);
  1175. CH_MPREG3_FEE = Feature.getInt("ClanHallMpRegenerationFeeLvl3", 6500);
  1176. CH_MPREG4_FEE = Feature.getInt("ClanHallMpRegenerationFeeLvl4", 13750);
  1177. CH_MPREG5_FEE = Feature.getInt("ClanHallMpRegenerationFeeLvl5", 20000);
  1178. CH_HPREG_FEE_RATIO = Feature.getLong("ClanHallHpRegenerationFunctionFeeRatio", 86400000);
  1179. CH_HPREG1_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl1", 700);
  1180. CH_HPREG2_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl2", 800);
  1181. CH_HPREG3_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl3", 1000);
  1182. CH_HPREG4_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl4", 1166);
  1183. CH_HPREG5_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl5", 1500);
  1184. CH_HPREG6_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl6", 1750);
  1185. CH_HPREG7_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl7", 2000);
  1186. CH_HPREG8_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl8", 2250);
  1187. CH_HPREG9_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl9", 2500);
  1188. CH_HPREG10_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl10", 3250);
  1189. CH_HPREG11_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl11", 3270);
  1190. CH_HPREG12_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl12", 4250);
  1191. CH_HPREG13_FEE = Feature.getInt("ClanHallHpRegenerationFeeLvl13", 5166);
  1192. CH_EXPREG_FEE_RATIO = Feature.getLong("ClanHallExpRegenerationFunctionFeeRatio", 86400000);
  1193. CH_EXPREG1_FEE = Feature.getInt("ClanHallExpRegenerationFeeLvl1", 3000);
  1194. CH_EXPREG2_FEE = Feature.getInt("ClanHallExpRegenerationFeeLvl2", 6000);
  1195. CH_EXPREG3_FEE = Feature.getInt("ClanHallExpRegenerationFeeLvl3", 9000);
  1196. CH_EXPREG4_FEE = Feature.getInt("ClanHallExpRegenerationFeeLvl4", 15000);
  1197. CH_EXPREG5_FEE = Feature.getInt("ClanHallExpRegenerationFeeLvl5", 21000);
  1198. CH_EXPREG6_FEE = Feature.getInt("ClanHallExpRegenerationFeeLvl6", 23330);
  1199. CH_EXPREG7_FEE = Feature.getInt("ClanHallExpRegenerationFeeLvl7", 30000);
  1200. CH_ITEM_FEE_RATIO = Feature.getLong("ClanHallItemCreationFunctionFeeRatio", 86400000);
  1201. CH_ITEM1_FEE = Feature.getInt("ClanHallItemCreationFunctionFeeLvl1", 30000);
  1202. CH_ITEM2_FEE = Feature.getInt("ClanHallItemCreationFunctionFeeLvl2", 70000);
  1203. CH_ITEM3_FEE = Feature.getInt("ClanHallItemCreationFunctionFeeLvl3", 140000);
  1204. CH_CURTAIN_FEE_RATIO = Feature.getLong("ClanHallCurtainFunctionFeeRatio", 604800000);
  1205. CH_CURTAIN1_FEE = Feature.getInt("ClanHallCurtainFunctionFeeLvl1", 2000);
  1206. CH_CURTAIN2_FEE = Feature.getInt("ClanHallCurtainFunctionFeeLvl2", 2500);
  1207. CH_FRONT_FEE_RATIO = Feature.getLong("ClanHallFrontPlatformFunctionFeeRatio", 259200000);
  1208. CH_FRONT1_FEE = Feature.getInt("ClanHallFrontPlatformFunctionFeeLvl1", 1300);
  1209. CH_FRONT2_FEE = Feature.getInt("ClanHallFrontPlatformFunctionFeeLvl2", 4000);
  1210. CH_BUFF_FREE = Feature.getBoolean("AltClanHallMpBuffFree", false);
  1211. SIEGE_HOUR_LIST = new ArrayList<>();
  1212. for (String hour : Feature.getString("SiegeHourList", "").split(","))
  1213. {
  1214. if (Util.isDigit(hour))
  1215. {
  1216. SIEGE_HOUR_LIST.add(Integer.parseInt(hour));
  1217. }
  1218. }
  1219. CS_TELE_FEE_RATIO = Feature.getLong("CastleTeleportFunctionFeeRatio", 604800000);
  1220. CS_TELE1_FEE = Feature.getInt("CastleTeleportFunctionFeeLvl1", 1000);
  1221. CS_TELE2_FEE = Feature.getInt("CastleTeleportFunctionFeeLvl2", 10000);
  1222. CS_SUPPORT_FEE_RATIO = Feature.getLong("CastleSupportFunctionFeeRatio", 604800000);
  1223. CS_SUPPORT1_FEE = Feature.getInt("CastleSupportFeeLvl1", 49000);
  1224. CS_SUPPORT2_FEE = Feature.getInt("CastleSupportFeeLvl2", 120000);
  1225. CS_MPREG_FEE_RATIO = Feature.getLong("CastleMpRegenerationFunctionFeeRatio", 604800000);
  1226. CS_MPREG1_FEE = Feature.getInt("CastleMpRegenerationFeeLvl1", 45000);
  1227. CS_MPREG2_FEE = Feature.getInt("CastleMpRegenerationFeeLvl2", 65000);
  1228. CS_HPREG_FEE_RATIO = Feature.getLong("CastleHpRegenerationFunctionFeeRatio", 604800000);
  1229. CS_HPREG1_FEE = Feature.getInt("CastleHpRegenerationFeeLvl1", 12000);
  1230. CS_HPREG2_FEE = Feature.getInt("CastleHpRegenerationFeeLvl2", 20000);
  1231. CS_EXPREG_FEE_RATIO = Feature.getLong("CastleExpRegenerationFunctionFeeRatio", 604800000);
  1232. CS_EXPREG1_FEE = Feature.getInt("CastleExpRegenerationFeeLvl1", 63000);
  1233. CS_EXPREG2_FEE = Feature.getInt("CastleExpRegenerationFeeLvl2", 70000);
  1234. OUTER_DOOR_UPGRADE_PRICE2 = Feature.getInt("OuterDoorUpgradePriceLvl2", 3000000);
  1235. OUTER_DOOR_UPGRADE_PRICE3 = Feature.getInt("OuterDoorUpgradePriceLvl3", 4000000);
  1236. OUTER_DOOR_UPGRADE_PRICE5 = Feature.getInt("OuterDoorUpgradePriceLvl5", 5000000);
  1237. INNER_DOOR_UPGRADE_PRICE2 = Feature.getInt("InnerDoorUpgradePriceLvl2", 750000);
  1238. INNER_DOOR_UPGRADE_PRICE3 = Feature.getInt("InnerDoorUpgradePriceLvl3", 900000);
  1239. INNER_DOOR_UPGRADE_PRICE5 = Feature.getInt("InnerDoorUpgradePriceLvl5", 1000000);
  1240. WALL_UPGRADE_PRICE2 = Feature.getInt("WallUpgradePriceLvl2", 1600000);
  1241. WALL_UPGRADE_PRICE3 = Feature.getInt("WallUpgradePriceLvl3", 1800000);
  1242. WALL_UPGRADE_PRICE5 = Feature.getInt("WallUpgradePriceLvl5", 2000000);
  1243. TRAP_UPGRADE_PRICE1 = Feature.getInt("TrapUpgradePriceLvl1", 3000000);
  1244. TRAP_UPGRADE_PRICE2 = Feature.getInt("TrapUpgradePriceLvl2", 4000000);
  1245. TRAP_UPGRADE_PRICE3 = Feature.getInt("TrapUpgradePriceLvl3", 5000000);
  1246. TRAP_UPGRADE_PRICE4 = Feature.getInt("TrapUpgradePriceLvl4", 6000000);
  1247. FS_TELE_FEE_RATIO = Feature.getLong("FortressTeleportFunctionFeeRatio", 604800000);
  1248. FS_TELE1_FEE = Feature.getInt("FortressTeleportFunctionFeeLvl1", 1000);
  1249. FS_TELE2_FEE = Feature.getInt("FortressTeleportFunctionFeeLvl2", 10000);
  1250. FS_SUPPORT_FEE_RATIO = Feature.getLong("FortressSupportFunctionFeeRatio", 86400000);
  1251. FS_SUPPORT1_FEE = Feature.getInt("FortressSupportFeeLvl1", 7000);
  1252. FS_SUPPORT2_FEE = Feature.getInt("FortressSupportFeeLvl2", 17000);
  1253. FS_MPREG_FEE_RATIO = Feature.getLong("FortressMpRegenerationFunctionFeeRatio", 86400000);
  1254. FS_MPREG1_FEE = Feature.getInt("FortressMpRegenerationFeeLvl1", 6500);
  1255. FS_MPREG2_FEE = Feature.getInt("FortressMpRegenerationFeeLvl2", 9300);
  1256. FS_HPREG_FEE_RATIO = Feature.getLong("FortressHpRegenerationFunctionFeeRatio", 86400000);
  1257. FS_HPREG1_FEE = Feature.getInt("FortressHpRegenerationFeeLvl1", 2000);
  1258. FS_HPREG2_FEE = Feature.getInt("FortressHpRegenerationFeeLvl2", 3500);
  1259. FS_EXPREG_FEE_RATIO = Feature.getLong("FortressExpRegenerationFunctionFeeRatio", 86400000);
  1260. FS_EXPREG1_FEE = Feature.getInt("FortressExpRegenerationFeeLvl1", 9000);
  1261. FS_EXPREG2_FEE = Feature.getInt("FortressExpRegenerationFeeLvl2", 10000);
  1262. FS_UPDATE_FRQ = Feature.getInt("FortressPeriodicUpdateFrequency", 360);
  1263. FS_BLOOD_OATH_COUNT = Feature.getInt("FortressBloodOathCount", 1);
  1264. FS_MAX_SUPPLY_LEVEL = Feature.getInt("FortressMaxSupplyLevel", 6);
  1265. FS_FEE_FOR_CASTLE = Feature.getInt("FortressFeeForCastle", 25000);
  1266. FS_MAX_OWN_TIME = Feature.getInt("FortressMaximumOwnTime", 168);
  1267. ALT_GAME_CASTLE_DAWN = Feature.getBoolean("AltCastleForDawn", true);
  1268. ALT_GAME_CASTLE_DUSK = Feature.getBoolean("AltCastleForDusk", true);
  1269. ALT_GAME_REQUIRE_CLAN_CASTLE = Feature.getBoolean("AltRequireClanCastle", false);
  1270. ALT_FESTIVAL_MIN_PLAYER = Feature.getInt("AltFestivalMinPlayer", 5);
  1271. ALT_MAXIMUM_PLAYER_CONTRIB = Feature.getInt("AltMaxPlayerContrib", 1000000);
  1272. ALT_FESTIVAL_MANAGER_START = Feature.getLong("AltFestivalManagerStart", 120000);
  1273. ALT_FESTIVAL_LENGTH = Feature.getLong("AltFestivalLength", 1080000);
  1274. ALT_FESTIVAL_CYCLE_LENGTH = Feature.getLong("AltFestivalCycleLength", 2280000);
  1275. ALT_FESTIVAL_FIRST_SPAWN = Feature.getLong("AltFestivalFirstSpawn", 120000);
  1276. ALT_FESTIVAL_FIRST_SWARM = Feature.getLong("AltFestivalFirstSwarm", 300000);
  1277. ALT_FESTIVAL_SECOND_SPAWN = Feature.getLong("AltFestivalSecondSpawn", 540000);
  1278. ALT_FESTIVAL_SECOND_SWARM = Feature.getLong("AltFestivalSecondSwarm", 720000);
  1279. ALT_FESTIVAL_CHEST_SPAWN = Feature.getLong("AltFestivalChestSpawn", 900000);
  1280. ALT_SIEGE_DAWN_GATES_PDEF_MULT = Feature.getDouble("AltDawnGatesPdefMult", 1.1);
  1281. ALT_SIEGE_DUSK_GATES_PDEF_MULT = Feature.getDouble("AltDuskGatesPdefMult", 0.8);
  1282. ALT_SIEGE_DAWN_GATES_MDEF_MULT = Feature.getDouble("AltDawnGatesMdefMult", 1.1);
  1283. ALT_SIEGE_DUSK_GATES_MDEF_MULT = Feature.getDouble("AltDuskGatesMdefMult", 0.8);
  1284. ALT_STRICT_SEVENSIGNS = Feature.getBoolean("StrictSevenSigns", true);
  1285. ALT_SEVENSIGNS_LAZY_UPDATE = Feature.getBoolean("AltSevenSignsLazyUpdate", true);
  1286. SSQ_DAWN_TICKET_QUANTITY = Feature.getInt("SevenSignsDawnTicketQuantity", 300);
  1287. SSQ_DAWN_TICKET_PRICE = Feature.getInt("SevenSignsDawnTicketPrice", 1000);
  1288. SSQ_DAWN_TICKET_BUNDLE = Feature.getInt("SevenSignsDawnTicketBundle", 10);
  1289. SSQ_MANORS_AGREEMENT_ID = Feature.getInt("SevenSignsManorsAgreementId", 6388);
  1290. SSQ_JOIN_DAWN_ADENA_FEE = Feature.getInt("SevenSignsJoinDawnFee", 50000);
  1291. TAKE_FORT_POINTS = Feature.getInt("TakeFortPoints", 200);
  1292. LOOSE_FORT_POINTS = Feature.getInt("LooseFortPoints", 0);
  1293. TAKE_CASTLE_POINTS = Feature.getInt("TakeCastlePoints", 1500);
  1294. LOOSE_CASTLE_POINTS = Feature.getInt("LooseCastlePoints", 3000);
  1295. CASTLE_DEFENDED_POINTS = Feature.getInt("CastleDefendedPoints", 750);
  1296. FESTIVAL_WIN_POINTS = Feature.getInt("FestivalOfDarknessWin", 200);
  1297. HERO_POINTS = Feature.getInt("HeroPoints", 1000);
  1298. ROYAL_GUARD_COST = Feature.getInt("CreateRoyalGuardCost", 5000);
  1299. KNIGHT_UNIT_COST = Feature.getInt("CreateKnightUnitCost", 10000);
  1300. KNIGHT_REINFORCE_COST = Feature.getInt("ReinforceKnightUnitCost", 5000);
  1301. BALLISTA_POINTS = Feature.getInt("KillBallistaPoints", 30);
  1302. BLOODALLIANCE_POINTS = Feature.getInt("BloodAlliancePoints", 500);
  1303. BLOODOATH_POINTS = Feature.getInt("BloodOathPoints", 200);
  1304. KNIGHTSEPAULETTE_POINTS = Feature.getInt("KnightsEpaulettePoints", 20);
  1305. REPUTATION_SCORE_PER_KILL = Feature.getInt("ReputationScorePerKill", 1);
  1306. JOIN_ACADEMY_MIN_REP_SCORE = Feature.getInt("CompleteAcademyMinPoints", 190);
  1307. JOIN_ACADEMY_MAX_REP_SCORE = Feature.getInt("CompleteAcademyMaxPoints", 650);
  1308. RAID_RANKING_1ST = Feature.getInt("1stRaidRankingPoints", 1250);
  1309. RAID_RANKING_2ND = Feature.getInt("2ndRaidRankingPoints", 900);
  1310. RAID_RANKING_3RD = Feature.getInt("3rdRaidRankingPoints", 700);
  1311. RAID_RANKING_4TH = Feature.getInt("4thRaidRankingPoints", 600);
  1312. RAID_RANKING_5TH = Feature.getInt("5thRaidRankingPoints", 450);
  1313. RAID_RANKING_6TH = Feature.getInt("6thRaidRankingPoints", 350);
  1314. RAID_RANKING_7TH = Feature.getInt("7thRaidRankingPoints", 300);
  1315. RAID_RANKING_8TH = Feature.getInt("8thRaidRankingPoints", 200);
  1316. RAID_RANKING_9TH = Feature.getInt("9thRaidRankingPoints", 150);
  1317. RAID_RANKING_10TH = Feature.getInt("10thRaidRankingPoints", 100);
  1318. RAID_RANKING_UP_TO_50TH = Feature.getInt("UpTo50thRaidRankingPoints", 25);
  1319. RAID_RANKING_UP_TO_100TH = Feature.getInt("UpTo100thRaidRankingPoints", 12);
  1320. CLAN_LEVEL_6_COST = Feature.getInt("ClanLevel6Cost", 5000);
  1321. CLAN_LEVEL_7_COST = Feature.getInt("ClanLevel7Cost", 10000);
  1322. CLAN_LEVEL_8_COST = Feature.getInt("ClanLevel8Cost", 20000);
  1323. CLAN_LEVEL_9_COST = Feature.getInt("ClanLevel9Cost", 40000);
  1324. CLAN_LEVEL_10_COST = Feature.getInt("ClanLevel10Cost", 40000);
  1325. CLAN_LEVEL_11_COST = Feature.getInt("ClanLevel11Cost", 75000);
  1326. CLAN_LEVEL_6_REQUIREMENT = Feature.getInt("ClanLevel6Requirement", 30);
  1327. CLAN_LEVEL_7_REQUIREMENT = Feature.getInt("ClanLevel7Requirement", 50);
  1328. CLAN_LEVEL_8_REQUIREMENT = Feature.getInt("ClanLevel8Requirement", 80);
  1329. CLAN_LEVEL_9_REQUIREMENT = Feature.getInt("ClanLevel9Requirement", 120);
  1330. CLAN_LEVEL_10_REQUIREMENT = Feature.getInt("ClanLevel10Requirement", 140);
  1331. CLAN_LEVEL_11_REQUIREMENT = Feature.getInt("ClanLevel11Requirement", 170);
  1332. ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false);
  1333. ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
  1334. // Load Character L2Properties file (if exists)
  1335. final PropertiesParser Character = new PropertiesParser(CHARACTER_CONFIG_FILE);
  1336. ALT_GAME_DELEVEL = Character.getBoolean("Delevel", true);
  1337. DECREASE_SKILL_LEVEL = Character.getBoolean("DecreaseSkillOnDelevel", true);
  1338. ALT_WEIGHT_LIMIT = Character.getDouble("AltWeightLimit", 1);
  1339. RUN_SPD_BOOST = Character.getInt("RunSpeedBoost", 0);
  1340. DEATH_PENALTY_CHANCE = Character.getInt("DeathPenaltyChance", 20);
  1341. RESPAWN_RESTORE_CP = Character.getDouble("RespawnRestoreCP", 0) / 100;
  1342. RESPAWN_RESTORE_HP = Character.getDouble("RespawnRestoreHP", 65) / 100;
  1343. RESPAWN_RESTORE_MP = Character.getDouble("RespawnRestoreMP", 0) / 100;
  1344. HP_REGEN_MULTIPLIER = Character.getDouble("HpRegenMultiplier", 100) / 100;
  1345. MP_REGEN_MULTIPLIER = Character.getDouble("MpRegenMultiplier", 100) / 100;
  1346. CP_REGEN_MULTIPLIER = Character.getDouble("CpRegenMultiplier", 100) / 100;
  1347. ALT_GAME_TIREDNESS = Character.getBoolean("AltGameTiredness", false);
  1348. ENABLE_MODIFY_SKILL_DURATION = Character.getBoolean("EnableModifySkillDuration", false);
  1349. // Create Map only if enabled
  1350. if (ENABLE_MODIFY_SKILL_DURATION)
  1351. {
  1352. String[] propertySplit = Character.getString("SkillDurationList", "").split(";");
  1353. SKILL_DURATION_LIST = new HashMap<>(propertySplit.length);
  1354. for (String skill : propertySplit)
  1355. {
  1356. String[] skillSplit = skill.split(",");
  1357. if (skillSplit.length != 2)
  1358. {
  1359. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillDurationList \"", skill, "\""));
  1360. }
  1361. else
  1362. {
  1363. try
  1364. {
  1365. SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  1366. }
  1367. catch (NumberFormatException nfe)
  1368. {
  1369. if (!skill.isEmpty())
  1370. {
  1371. _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1372. }
  1373. }
  1374. }
  1375. }
  1376. }
  1377. ENABLE_MODIFY_SKILL_REUSE = Character.getBoolean("EnableModifySkillReuse", false);
  1378. // Create Map only if enabled
  1379. if (ENABLE_MODIFY_SKILL_REUSE)
  1380. {
  1381. String[] propertySplit = Character.getString("SkillReuseList", "").split(";");
  1382. SKILL_REUSE_LIST = new HashMap<>(propertySplit.length);
  1383. for (String skill : propertySplit)
  1384. {
  1385. String[] skillSplit = skill.split(",");
  1386. if (skillSplit.length != 2)
  1387. {
  1388. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillReuseList \"", skill, "\""));
  1389. }
  1390. else
  1391. {
  1392. try
  1393. {
  1394. SKILL_REUSE_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  1395. }
  1396. catch (NumberFormatException nfe)
  1397. {
  1398. if (!skill.isEmpty())
  1399. {
  1400. _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
  1401. }
  1402. }
  1403. }
  1404. }
  1405. }
  1406. AUTO_LEARN_SKILLS = Character.getBoolean("AutoLearnSkills", false);
  1407. AUTO_LEARN_FS_SKILLS = Character.getBoolean("AutoLearnForgottenScrollSkills", false);
  1408. AUTO_LOOT_HERBS = Character.getBoolean("AutoLootHerbs", false);
  1409. BUFFS_MAX_AMOUNT = Character.getByte("MaxBuffAmount", (byte) 20);
  1410. TRIGGERED_BUFFS_MAX_AMOUNT = Character.getByte("MaxTriggeredBuffAmount", (byte) 12);
  1411. DANCES_MAX_AMOUNT = Character.getByte("MaxDanceAmount", (byte) 12);
  1412. DANCE_CANCEL_BUFF = Character.getBoolean("DanceCancelBuff", false);
  1413. DANCE_CONSUME_ADDITIONAL_MP = Character.getBoolean("DanceConsumeAdditionalMP", true);
  1414. ALT_STORE_DANCES = Character.getBoolean("AltStoreDances", false);
  1415. AUTO_LEARN_DIVINE_INSPIRATION = Character.getBoolean("AutoLearnDivineInspiration", false);
  1416. ALT_GAME_CANCEL_BOW = Character.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1417. ALT_GAME_CANCEL_CAST = Character.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1418. ALT_GAME_MAGICFAILURES = Character.getBoolean("MagicFailures", true);
  1419. PLAYER_FAKEDEATH_UP_PROTECTION = Character.getInt("PlayerFakeDeathUpProtection", 0);
  1420. STORE_SKILL_COOLTIME = Character.getBoolean("StoreSkillCooltime", true);
  1421. SUBCLASS_STORE_SKILL_COOLTIME = Character.getBoolean("SubclassStoreSkillCooltime", false);
  1422. SUMMON_STORE_SKILL_COOLTIME = Character.getBoolean("SummonStoreSkillCooltime", true);
  1423. ALT_GAME_SHIELD_BLOCKS = Character.getBoolean("AltShieldBlocks", false);
  1424. ALT_PERFECT_SHLD_BLOCK = Character.getInt("AltPerfectShieldBlockRate", 10);
  1425. EFFECT_TICK_RATIO = Character.getLong("EffectTickRatio", 666);
  1426. ALLOW_CLASS_MASTERS = Character.getBoolean("AllowClassMasters", false);
  1427. ALLOW_ENTIRE_TREE = Character.getBoolean("AllowEntireTree", false);
  1428. ALTERNATE_CLASS_MASTER = Character.getBoolean("AlternateClassMaster", false);
  1429. if (ALLOW_CLASS_MASTERS || ALTERNATE_CLASS_MASTER)
  1430. {
  1431. CLASS_MASTER_SETTINGS = new ClassMasterSettings(Character.getString("ConfigClassMaster", ""));
  1432. }
  1433. LIFE_CRYSTAL_NEEDED = Character.getBoolean("LifeCrystalNeeded", true);
  1434. ES_SP_BOOK_NEEDED = Character.getBoolean("EnchantSkillSpBookNeeded", true);
  1435. DIVINE_SP_BOOK_NEEDED = Character.getBoolean("DivineInspirationSpBookNeeded", true);
  1436. ALT_GAME_SKILL_LEARN = Character.getBoolean("AltGameSkillLearn", false);
  1437. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Character.getBoolean("AltSubClassWithoutQuests", false);
  1438. ALT_GAME_SUBCLASS_EVERYWHERE = Character.getBoolean("AltSubclassEverywhere", false);
  1439. RESTORE_SERVITOR_ON_RECONNECT = Character.getBoolean("RestoreServitorOnReconnect", true);
  1440. RESTORE_PET_ON_RECONNECT = Character.getBoolean("RestorePetOnReconnect", true);
  1441. ALLOW_TRANSFORM_WITHOUT_QUEST = Character.getBoolean("AltTransformationWithoutQuest", false);
  1442. FEE_DELETE_TRANSFER_SKILLS = Character.getInt("FeeDeleteTransferSkills", 10000000);
  1443. FEE_DELETE_SUBCLASS_SKILLS = Character.getInt("FeeDeleteSubClassSkills", 10000000);
  1444. ENABLE_VITALITY = Character.getBoolean("EnableVitality", true);
  1445. RECOVER_VITALITY_ON_RECONNECT = Character.getBoolean("RecoverVitalityOnReconnect", true);
  1446. STARTING_VITALITY_POINTS = Character.getInt("StartingVitalityPoints", 20000);
  1447. MAX_BONUS_EXP = Character.getDouble("MaxExpBonus", 3.5);
  1448. MAX_BONUS_SP = Character.getDouble("MaxSpBonus", 3.5);
  1449. MAX_RUN_SPEED = Character.getInt("MaxRunSpeed", 250);
  1450. MAX_PCRIT_RATE = Character.getInt("MaxPCritRate", 500);
  1451. MAX_MCRIT_RATE = Character.getInt("MaxMCritRate", 200);
  1452. MAX_PATK_SPEED = Character.getInt("MaxPAtkSpeed", 1500);
  1453. MAX_MATK_SPEED = Character.getInt("MaxMAtkSpeed", 1999);
  1454. MAX_EVASION = Character.getInt("MaxEvasion", 250);
  1455. MIN_ABNORMAL_STATE_SUCCESS_RATE = Character.getInt("MinAbnormalStateSuccessRate", 10);
  1456. MAX_ABNORMAL_STATE_SUCCESS_RATE = Character.getInt("MaxAbnormalStateSuccessRate", 90);
  1457. MAX_SUBCLASS = Character.getByte("MaxSubclass", (byte) 3);
  1458. BASE_SUBCLASS_LEVEL = Character.getByte("BaseSubclassLevel", (byte) 40);
  1459. MAX_SUBCLASS_LEVEL = Character.getByte("MaxSubclassLevel", (byte) 80);
  1460. MAX_PVTSTORESELL_SLOTS_DWARF = Character.getInt("MaxPvtStoreSellSlotsDwarf", 4);
  1461. MAX_PVTSTORESELL_SLOTS_OTHER = Character.getInt("MaxPvtStoreSellSlotsOther", 3);
  1462. MAX_PVTSTOREBUY_SLOTS_DWARF = Character.getInt("MaxPvtStoreBuySlotsDwarf", 5);
  1463. MAX_PVTSTOREBUY_SLOTS_OTHER = Character.getInt("MaxPvtStoreBuySlotsOther", 4);
  1464. INVENTORY_MAXIMUM_NO_DWARF = Character.getInt("MaximumSlotsForNoDwarf", 80);
  1465. INVENTORY_MAXIMUM_DWARF = Character.getInt("MaximumSlotsForDwarf", 100);
  1466. INVENTORY_MAXIMUM_GM = Character.getInt("MaximumSlotsForGMPlayer", 250);
  1467. INVENTORY_MAXIMUM_QUEST_ITEMS = Character.getInt("MaximumSlotsForQuestItems", 100);
  1468. MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
  1469. WAREHOUSE_SLOTS_DWARF = Character.getInt("MaximumWarehouseSlotsForDwarf", 120);
  1470. WAREHOUSE_SLOTS_NO_DWARF = Character.getInt("MaximumWarehouseSlotsForNoDwarf", 100);
  1471. WAREHOUSE_SLOTS_CLAN = Character.getInt("MaximumWarehouseSlotsForClan", 150);
  1472. ALT_FREIGHT_SLOTS = Character.getInt("MaximumFreightSlots", 200);
  1473. ALT_FREIGHT_PRICE = Character.getInt("FreightPrice", 1000);
  1474. ENCHANT_CHANCE_ELEMENT_STONE = Character.getDouble("EnchantChanceElementStone", 50);
  1475. ENCHANT_CHANCE_ELEMENT_CRYSTAL = Character.getDouble("EnchantChanceElementCrystal", 30);
  1476. ENCHANT_CHANCE_ELEMENT_JEWEL = Character.getDouble("EnchantChanceElementJewel", 20);
  1477. ENCHANT_CHANCE_ELEMENT_ENERGY = Character.getDouble("EnchantChanceElementEnergy", 10);
  1478. String[] notenchantable = Character.getString("EnchantBlackList", "7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296").split(",");
  1479. ENCHANT_BLACKLIST = new int[notenchantable.length];
  1480. for (int i = 0; i < notenchantable.length; i++)
  1481. {
  1482. ENCHANT_BLACKLIST[i] = Integer.parseInt(notenchantable[i]);
  1483. }
  1484. Arrays.sort(ENCHANT_BLACKLIST);
  1485. AUGMENTATION_NG_SKILL_CHANCE = Character.getInt("AugmentationNGSkillChance", 15);
  1486. AUGMENTATION_NG_GLOW_CHANCE = Character.getInt("AugmentationNGGlowChance", 0);
  1487. AUGMENTATION_MID_SKILL_CHANCE = Character.getInt("AugmentationMidSkillChance", 30);
  1488. AUGMENTATION_MID_GLOW_CHANCE = Character.getInt("AugmentationMidGlowChance", 40);
  1489. AUGMENTATION_HIGH_SKILL_CHANCE = Character.getInt("AugmentationHighSkillChance", 45);
  1490. AUGMENTATION_HIGH_GLOW_CHANCE = Character.getInt("AugmentationHighGlowChance", 70);
  1491. AUGMENTATION_TOP_SKILL_CHANCE = Character.getInt("AugmentationTopSkillChance", 60);
  1492. AUGMENTATION_TOP_GLOW_CHANCE = Character.getInt("AugmentationTopGlowChance", 100);
  1493. AUGMENTATION_BASESTAT_CHANCE = Character.getInt("AugmentationBaseStatChance", 1);
  1494. AUGMENTATION_ACC_SKILL_CHANCE = Character.getInt("AugmentationAccSkillChance", 0);
  1495. RETAIL_LIKE_AUGMENTATION = Character.getBoolean("RetailLikeAugmentation", true);
  1496. String[] array = Character.getString("RetailLikeAugmentationNoGradeChance", "55,35,7,3").split(",");
  1497. RETAIL_LIKE_AUGMENTATION_NG_CHANCE = new int[array.length];
  1498. for (int i = 0; i < 4; i++)
  1499. {
  1500. RETAIL_LIKE_AUGMENTATION_NG_CHANCE[i] = Integer.parseInt(array[i]);
  1501. }
  1502. array = Character.getString("RetailLikeAugmentationMidGradeChance", "55,35,7,3").split(",");
  1503. RETAIL_LIKE_AUGMENTATION_MID_CHANCE = new int[array.length];
  1504. for (int i = 0; i < 4; i++)
  1505. {
  1506. RETAIL_LIKE_AUGMENTATION_MID_CHANCE[i] = Integer.parseInt(array[i]);
  1507. }
  1508. array = Character.getString("RetailLikeAugmentationHighGradeChance", "55,35,7,3").split(",");
  1509. RETAIL_LIKE_AUGMENTATION_HIGH_CHANCE = new int[array.length];
  1510. for (int i = 0; i < 4; i++)
  1511. {
  1512. RETAIL_LIKE_AUGMENTATION_HIGH_CHANCE[i] = Integer.parseInt(array[i]);
  1513. }
  1514. array = Character.getString("RetailLikeAugmentationTopGradeChance", "55,35,7,3").split(",");
  1515. RETAIL_LIKE_AUGMENTATION_TOP_CHANCE = new int[array.length];
  1516. for (int i = 0; i < 4; i++)
  1517. {
  1518. RETAIL_LIKE_AUGMENTATION_TOP_CHANCE[i] = Integer.parseInt(array[i]);
  1519. }
  1520. RETAIL_LIKE_AUGMENTATION_ACCESSORY = Character.getBoolean("RetailLikeAugmentationAccessory", true);
  1521. array = Character.getString("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(",");
  1522. AUGMENTATION_BLACKLIST = new int[array.length];
  1523. for (int i = 0; i < array.length; i++)
  1524. {
  1525. AUGMENTATION_BLACKLIST[i] = Integer.parseInt(array[i]);
  1526. }
  1527. Arrays.sort(AUGMENTATION_BLACKLIST);
  1528. ALT_ALLOW_AUGMENT_PVP_ITEMS = Character.getBoolean("AltAllowAugmentPvPItems", false);
  1529. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Character.getBoolean("AltKarmaPlayerCanBeKilledInPeaceZone", false);
  1530. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Character.getBoolean("AltKarmaPlayerCanShop", true);
  1531. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Character.getBoolean("AltKarmaPlayerCanTeleport", true);
  1532. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Character.getBoolean("AltKarmaPlayerCanUseGK", false);
  1533. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Character.getBoolean("AltKarmaPlayerCanTrade", true);
  1534. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Character.getBoolean("AltKarmaPlayerCanUseWareHouse", true);
  1535. MAX_PERSONAL_FAME_POINTS = Character.getInt("MaxPersonalFamePoints", 100000);
  1536. FORTRESS_ZONE_FAME_TASK_FREQUENCY = Character.getInt("FortressZoneFameTaskFrequency", 300);
  1537. FORTRESS_ZONE_FAME_AQUIRE_POINTS = Character.getInt("FortressZoneFameAquirePoints", 31);
  1538. CASTLE_ZONE_FAME_TASK_FREQUENCY = Character.getInt("CastleZoneFameTaskFrequency", 300);
  1539. CASTLE_ZONE_FAME_AQUIRE_POINTS = Character.getInt("CastleZoneFameAquirePoints", 125);
  1540. FAME_FOR_DEAD_PLAYERS = Character.getBoolean("FameForDeadPlayers", true);
  1541. IS_CRAFTING_ENABLED = Character.getBoolean("CraftingEnabled", true);
  1542. CRAFT_MASTERWORK = Character.getBoolean("CraftMasterwork", true);
  1543. DWARF_RECIPE_LIMIT = Character.getInt("DwarfRecipeLimit", 50);
  1544. COMMON_RECIPE_LIMIT = Character.getInt("CommonRecipeLimit", 50);
  1545. ALT_GAME_CREATION = Character.getBoolean("AltGameCreation", false);
  1546. ALT_GAME_CREATION_SPEED = Character.getDouble("AltGameCreationSpeed", 1);
  1547. ALT_GAME_CREATION_XP_RATE = Character.getDouble("AltGameCreationXpRate", 1);
  1548. ALT_GAME_CREATION_SP_RATE = Character.getDouble("AltGameCreationSpRate", 1);
  1549. ALT_GAME_CREATION_RARE_XPSP_RATE = Character.getDouble("AltGameCreationRareXpSpRate", 2);
  1550. ALT_BLACKSMITH_USE_RECIPES = Character.getBoolean("AltBlacksmithUseRecipes", true);
  1551. ALT_CLAN_LEADER_DATE_CHANGE = Character.getInt("AltClanLeaderDateChange", 3);
  1552. if ((ALT_CLAN_LEADER_DATE_CHANGE < 1) || (ALT_CLAN_LEADER_DATE_CHANGE > 7))
  1553. {
  1554. _log.log(Level.WARNING, "Wrong value specified for AltClanLeaderDateChange: " + ALT_CLAN_LEADER_DATE_CHANGE);
  1555. ALT_CLAN_LEADER_DATE_CHANGE = 3;
  1556. }
  1557. ALT_CLAN_LEADER_HOUR_CHANGE = Character.getString("AltClanLeaderHourChange", "00:00:00");
  1558. ALT_CLAN_LEADER_INSTANT_ACTIVATION = Character.getBoolean("AltClanLeaderInstantActivation", false);
  1559. ALT_CLAN_JOIN_DAYS = Character.getInt("DaysBeforeJoinAClan", 1);
  1560. ALT_CLAN_CREATE_DAYS = Character.getInt("DaysBeforeCreateAClan", 10);
  1561. ALT_CLAN_DISSOLVE_DAYS = Character.getInt("DaysToPassToDissolveAClan", 7);
  1562. ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Character.getInt("DaysBeforeJoinAllyWhenLeaved", 1);
  1563. ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Character.getInt("DaysBeforeJoinAllyWhenDismissed", 1);
  1564. ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Character.getInt("DaysBeforeAcceptNewClanWhenDismissed", 1);
  1565. ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Character.getInt("DaysBeforeCreateNewAllyWhenDissolved", 1);
  1566. ALT_MAX_NUM_OF_CLANS_IN_ALLY = Character.getInt("AltMaxNumOfClansInAlly", 3);
  1567. ALT_CLAN_MEMBERS_FOR_WAR = Character.getInt("AltClanMembersForWar", 15);
  1568. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Character.getBoolean("AltMembersCanWithdrawFromClanWH", false);
  1569. REMOVE_CASTLE_CIRCLETS = Character.getBoolean("RemoveCastleCirclets", true);
  1570. ALT_PARTY_RANGE = Character.getInt("AltPartyRange", 1600);
  1571. ALT_PARTY_RANGE2 = Character.getInt("AltPartyRange2", 1400);
  1572. ALT_LEAVE_PARTY_LEADER = Character.getBoolean("AltLeavePartyLeader", false);
  1573. INITIAL_EQUIPMENT_EVENT = Character.getBoolean("InitialEquipmentEvent", false);
  1574. STARTING_ADENA = Character.getLong("StartingAdena", 0);
  1575. STARTING_LEVEL = Character.getByte("StartingLevel", (byte) 1);
  1576. STARTING_SP = Character.getInt("StartingSP", 0);
  1577. MAX_ADENA = Character.getLong("MaxAdena", 99900000000L);
  1578. if (MAX_ADENA < 0)
  1579. {
  1580. MAX_ADENA = Long.MAX_VALUE;
  1581. }
  1582. AUTO_LOOT = Character.getBoolean("AutoLoot", false);
  1583. AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false);
  1584. LOOT_RAIDS_PRIVILEGE_INTERVAL = Character.getInt("RaidLootRightsInterval", 900) * 1000;
  1585. LOOT_RAIDS_PRIVILEGE_CC_SIZE = Character.getInt("RaidLootRightsCCSize", 45);
  1586. UNSTUCK_INTERVAL = Character.getInt("UnstuckInterval", 300);
  1587. TELEPORT_WATCHDOG_TIMEOUT = Character.getInt("TeleportWatchdogTimeout", 0);
  1588. PLAYER_SPAWN_PROTECTION = Character.getInt("PlayerSpawnProtection", 0);
  1589. String[] items = Character.getString("PlayerSpawnProtectionAllowedItems", "0").split(",");
  1590. SPAWN_PROTECTION_ALLOWED_ITEMS = new ArrayList<>(items.length);
  1591. for (String item : items)
  1592. {
  1593. Integer itm = 0;
  1594. try
  1595. {
  1596. itm = Integer.parseInt(item);
  1597. }
  1598. catch (NumberFormatException nfe)
  1599. {
  1600. _log.warning("Player Spawn Protection: Wrong ItemId passed: " + item);
  1601. _log.warning(nfe.getMessage());
  1602. }
  1603. if (itm != 0)
  1604. {
  1605. SPAWN_PROTECTION_ALLOWED_ITEMS.add(itm);
  1606. }
  1607. }
  1608. PLAYER_TELEPORT_PROTECTION = Character.getInt("PlayerTeleportProtection", 0);
  1609. RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true);
  1610. OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true);
  1611. MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50);
  1612. RESTORE_PLAYER_INSTANCE = Character.getBoolean("RestorePlayerInstance", false);
  1613. ALLOW_SUMMON_TO_INSTANCE = Character.getBoolean("AllowSummonToInstance", true);
  1614. EJECT_DEAD_PLAYER_TIME = 1000 * Character.getInt("EjectDeadPlayerTime", 60);
  1615. PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true);
  1616. MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5);
  1617. MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25);
  1618. ALT_GAME_FREE_TELEPORT = Character.getBoolean("AltFreeTeleporting", false);
  1619. DELETE_DAYS = Character.getInt("DeleteCharAfterDays", 7);
  1620. ALT_GAME_EXPONENT_XP = Character.getFloat("AltGameExponentXp", 0);
  1621. ALT_GAME_EXPONENT_SP = Character.getFloat("AltGameExponentSp", 0);
  1622. PARTY_XP_CUTOFF_METHOD = Character.getString("PartyXpCutoffMethod", "highfive");
  1623. PARTY_XP_CUTOFF_PERCENT = Character.getDouble("PartyXpCutoffPercent", 3);
  1624. PARTY_XP_CUTOFF_LEVEL = Character.getInt("PartyXpCutoffLevel", 20);
  1625. final String[] gaps = Character.getString("PartyXpCutoffGaps", "0,9;10,14;15,99").split(";");
  1626. PARTY_XP_CUTOFF_GAPS = new int[gaps.length][2];
  1627. for (int i = 0; i < gaps.length; i++)
  1628. {
  1629. PARTY_XP_CUTOFF_GAPS[i] = new int[]
  1630. {
  1631. Integer.parseInt(gaps[i].split(",")[0]),
  1632. Integer.parseInt(gaps[i].split(",")[1])
  1633. };
  1634. }
  1635. final String[] percents = Character.getString("PartyXpCutoffGapPercent", "100;30;0").split(";");
  1636. PARTY_XP_CUTOFF_GAP_PERCENTS = new int[percents.length];
  1637. for (int i = 0; i < percents.length; i++)
  1638. {
  1639. PARTY_XP_CUTOFF_GAP_PERCENTS[i] = Integer.parseInt(percents[i]);
  1640. }
  1641. DISABLE_TUTORIAL = Character.getBoolean("DisableTutorial", false);
  1642. EXPERTISE_PENALTY = Character.getBoolean("ExpertisePenalty", true);
  1643. STORE_RECIPE_SHOPLIST = Character.getBoolean("StoreRecipeShopList", false);
  1644. STORE_UI_SETTINGS = Character.getBoolean("StoreCharUiSettings", false);
  1645. FORBIDDEN_NAMES = Character.getString("ForbiddenNames", "").split(",");
  1646. SILENCE_MODE_EXCLUDE = Character.getBoolean("SilenceModeExclude", false);
  1647. ALT_VALIDATE_TRIGGER_SKILLS = Character.getBoolean("AltValidateTriggerSkills", false);
  1648. PLAYER_MOVEMENT_BLOCK_TIME = Character.getInt("NpcTalkBlockingTime", 0) * 1000;
  1649. // Load Telnet L2Properties file (if exists)
  1650. final PropertiesParser telnetSettings = new PropertiesParser(TELNET_FILE);
  1651. IS_TELNET_ENABLED = telnetSettings.getBoolean("EnableTelnet", false);
  1652. // MMO
  1653. final PropertiesParser mmoSettings = new PropertiesParser(MMO_CONFIG_FILE);
  1654. MMO_SELECTOR_SLEEP_TIME = mmoSettings.getInt("SleepTime", 20);
  1655. MMO_MAX_SEND_PER_PASS = mmoSettings.getInt("MaxSendPerPass", 12);
  1656. MMO_MAX_READ_PER_PASS = mmoSettings.getInt("MaxReadPerPass", 12);
  1657. MMO_HELPER_BUFFER_COUNT = mmoSettings.getInt("HelperBufferCount", 20);
  1658. MMO_TCP_NODELAY = mmoSettings.getBoolean("TcpNoDelay", false);
  1659. // Load IdFactory L2Properties file (if exists)
  1660. final PropertiesParser IdFactory = new PropertiesParser(ID_CONFIG_FILE);
  1661. IDFACTORY_TYPE = IdFactory.getEnum("IDFactory", IdFactoryType.class, IdFactoryType.BitSet);
  1662. BAD_ID_CHECKING = IdFactory.getBoolean("BadIdChecking", true);
  1663. // Load General L2Properties file (if exists)
  1664. final PropertiesParser General = new PropertiesParser(GENERAL_CONFIG_FILE);
  1665. EVERYBODY_HAS_ADMIN_RIGHTS = General.getBoolean("EverybodyHasAdminRights", false);
  1666. SERVER_LIST_BRACKET = General.getBoolean("ServerListBrackets", false);
  1667. SERVER_LIST_TYPE = getServerTypeId(General.getString("ServerListType", "Normal").split(","));
  1668. SERVER_LIST_AGE = General.getInt("ServerListAge", 0);
  1669. SERVER_GMONLY = General.getBoolean("ServerGMOnly", false);
  1670. GM_HERO_AURA = General.getBoolean("GMHeroAura", false);
  1671. GM_STARTUP_INVULNERABLE = General.getBoolean("GMStartupInvulnerable", false);
  1672. GM_STARTUP_INVISIBLE = General.getBoolean("GMStartupInvisible", false);
  1673. GM_STARTUP_SILENCE = General.getBoolean("GMStartupSilence", false);
  1674. GM_STARTUP_AUTO_LIST = General.getBoolean("GMStartupAutoList", false);
  1675. GM_STARTUP_DIET_MODE = General.getBoolean("GMStartupDietMode", false);
  1676. GM_ITEM_RESTRICTION = General.getBoolean("GMItemRestriction", true);
  1677. GM_SKILL_RESTRICTION = General.getBoolean("GMSkillRestriction", true);
  1678. GM_TRADE_RESTRICTED_ITEMS = General.getBoolean("GMTradeRestrictedItems", false);
  1679. GM_RESTART_FIGHTING = General.getBoolean("GMRestartFighting", true);
  1680. GM_ANNOUNCER_NAME = General.getBoolean("GMShowAnnouncerName", false);
  1681. GM_CRITANNOUNCER_NAME = General.getBoolean("GMShowCritAnnouncerName", false);
  1682. GM_GIVE_SPECIAL_SKILLS = General.getBoolean("GMGiveSpecialSkills", false);
  1683. GM_GIVE_SPECIAL_AURA_SKILLS = General.getBoolean("GMGiveSpecialAuraSkills", false);
  1684. GAMEGUARD_ENFORCE = General.getBoolean("GameGuardEnforce", false);
  1685. GAMEGUARD_PROHIBITACTION = General.getBoolean("GameGuardProhibitAction", false);
  1686. LOG_CHAT = General.getBoolean("LogChat", false);
  1687. LOG_AUTO_ANNOUNCEMENTS = General.getBoolean("LogAutoAnnouncements", false);
  1688. LOG_ITEMS = General.getBoolean("LogItems", false);
  1689. LOG_ITEMS_SMALL_LOG = General.getBoolean("LogItemsSmallLog", false);
  1690. LOG_ITEM_ENCHANTS = General.getBoolean("LogItemEnchants", false);
  1691. LOG_SKILL_ENCHANTS = General.getBoolean("LogSkillEnchants", false);
  1692. GMAUDIT = General.getBoolean("GMAudit", false);
  1693. SKILL_CHECK_ENABLE = General.getBoolean("SkillCheckEnable", false);
  1694. SKILL_CHECK_REMOVE = General.getBoolean("SkillCheckRemove", false);
  1695. SKILL_CHECK_GM = General.getBoolean("SkillCheckGM", true);
  1696. DEBUG = General.getBoolean("Debug", false);
  1697. HTML_ACTION_CACHE_DEBUG = General.getBoolean("HtmlActionCacheDebug", false);
  1698. PACKET_HANDLER_DEBUG = General.getBoolean("PacketHandlerDebug", false);
  1699. DEVELOPER = General.getBoolean("Developer", false);
  1700. ACCEPT_GEOEDITOR_CONN = General.getBoolean("AcceptGeoeditorConn", false);
  1701. ALT_DEV_NO_HANDLERS = General.getBoolean("AltDevNoHandlers", false) || Boolean.getBoolean("nohandlers");
  1702. ALT_DEV_NO_QUESTS = General.getBoolean("AltDevNoQuests", false) || Boolean.getBoolean("noquests");
  1703. ALT_DEV_NO_SPAWNS = General.getBoolean("AltDevNoSpawns", false) || Boolean.getBoolean("nospawns");
  1704. ALT_DEV_SHOW_QUESTS_LOAD_IN_LOGS = General.getBoolean("AltDevShowQuestsLoadInLogs", false);
  1705. ALT_DEV_SHOW_SCRIPTS_LOAD_IN_LOGS = General.getBoolean("AltDevShowScriptsLoadInLogs", false);
  1706. THREAD_P_EFFECTS = General.getInt("ThreadPoolSizeEffects", 10);
  1707. THREAD_P_GENERAL = General.getInt("ThreadPoolSizeGeneral", 13);
  1708. THREAD_E_EVENTS = General.getInt("ThreadPoolSizeEvents", 2);
  1709. IO_PACKET_THREAD_CORE_SIZE = General.getInt("UrgentPacketThreadCoreSize", 2);
  1710. GENERAL_PACKET_THREAD_CORE_SIZE = General.getInt("GeneralPacketThreadCoreSize", 4);
  1711. GENERAL_THREAD_CORE_SIZE = General.getInt("GeneralThreadCoreSize", 4);
  1712. AI_MAX_THREAD = General.getInt("AiMaxThread", 6);
  1713. EVENT_MAX_THREAD = General.getInt("EventsMaxThread", 5);
  1714. CLIENT_PACKET_QUEUE_SIZE = General.getInt("ClientPacketQueueSize", 0);
  1715. if (CLIENT_PACKET_QUEUE_SIZE == 0)
  1716. {
  1717. CLIENT_PACKET_QUEUE_SIZE = MMO_MAX_READ_PER_PASS + 2;
  1718. }
  1719. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = General.getInt("ClientPacketQueueMaxBurstSize", 0);
  1720. if (CLIENT_PACKET_QUEUE_MAX_BURST_SIZE == 0)
  1721. {
  1722. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = MMO_MAX_READ_PER_PASS + 1;
  1723. }
  1724. CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND = General.getInt("ClientPacketQueueMaxPacketsPerSecond", 80);
  1725. CLIENT_PACKET_QUEUE_MEASURE_INTERVAL = General.getInt("ClientPacketQueueMeasureInterval", 5);
  1726. CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND = General.getInt("ClientPacketQueueMaxAveragePacketsPerSecond", 40);
  1727. CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN = General.getInt("ClientPacketQueueMaxFloodsPerMin", 2);
  1728. CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN = General.getInt("ClientPacketQueueMaxOverflowsPerMin", 1);
  1729. CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = General.getInt("ClientPacketQueueMaxUnderflowsPerMin", 1);
  1730. CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = General.getInt("ClientPacketQueueMaxUnknownPerMin", 5);
  1731. DEADLOCK_DETECTOR = General.getBoolean("DeadLockDetector", true);
  1732. DEADLOCK_CHECK_INTERVAL = General.getInt("DeadLockCheckInterval", 20);
  1733. RESTART_ON_DEADLOCK = General.getBoolean("RestartOnDeadlock", false);
  1734. ALLOW_DISCARDITEM = General.getBoolean("AllowDiscardItem", true);
  1735. AUTODESTROY_ITEM_AFTER = General.getInt("AutoDestroyDroppedItemAfter", 600);
  1736. HERB_AUTO_DESTROY_TIME = General.getInt("AutoDestroyHerbTime", 60) * 1000;
  1737. String[] split = General.getString("ListOfProtectedItems", "0").split(",");
  1738. LIST_PROTECTED_ITEMS = new ArrayList<>(split.length);
  1739. for (String id : split)
  1740. {
  1741. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
  1742. }
  1743. DATABASE_CLEAN_UP = General.getBoolean("DatabaseCleanUp", true);
  1744. CONNECTION_CLOSE_TIME = General.getLong("ConnectionCloseTime", 60000);
  1745. CHAR_STORE_INTERVAL = General.getInt("CharacterDataStoreInterval", 15);
  1746. LAZY_ITEMS_UPDATE = General.getBoolean("LazyItemsUpdate", false);
  1747. UPDATE_ITEMS_ON_CHAR_STORE = General.getBoolean("UpdateItemsOnCharStore", false);
  1748. DESTROY_DROPPED_PLAYER_ITEM = General.getBoolean("DestroyPlayerDroppedItem", false);
  1749. DESTROY_EQUIPABLE_PLAYER_ITEM = General.getBoolean("DestroyEquipableItem", false);
  1750. SAVE_DROPPED_ITEM = General.getBoolean("SaveDroppedItem", false);
  1751. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = General.getBoolean("EmptyDroppedItemTableAfterLoad", false);
  1752. SAVE_DROPPED_ITEM_INTERVAL = General.getInt("SaveDroppedItemInterval", 60) * 60000;
  1753. CLEAR_DROPPED_ITEM_TABLE = General.getBoolean("ClearDroppedItemTable", false);
  1754. AUTODELETE_INVALID_QUEST_DATA = General.getBoolean("AutoDeleteInvalidQuestData", false);
  1755. PRECISE_DROP_CALCULATION = General.getBoolean("PreciseDropCalculation", true);
  1756. MULTIPLE_ITEM_DROP = General.getBoolean("MultipleItemDrop", true);
  1757. FORCE_INVENTORY_UPDATE = General.getBoolean("ForceInventoryUpdate", false);
  1758. LAZY_CACHE = General.getBoolean("LazyCache", true);
  1759. CACHE_CHAR_NAMES = General.getBoolean("CacheCharNames", true);
  1760. MIN_NPC_ANIMATION = General.getInt("MinNPCAnimation", 10);
  1761. MAX_NPC_ANIMATION = General.getInt("MaxNPCAnimation", 20);
  1762. MIN_MONSTER_ANIMATION = General.getInt("MinMonsterAnimation", 5);
  1763. MAX_MONSTER_ANIMATION = General.getInt("MaxMonsterAnimation", 20);
  1764. MOVE_BASED_KNOWNLIST = General.getBoolean("MoveBasedKnownlist", false);
  1765. KNOWNLIST_UPDATE_INTERVAL = General.getLong("KnownListUpdateInterval", 1250);
  1766. GRIDS_ALWAYS_ON = General.getBoolean("GridsAlwaysOn", false);
  1767. GRID_NEIGHBOR_TURNON_TIME = General.getInt("GridNeighborTurnOnTime", 1);
  1768. GRID_NEIGHBOR_TURNOFF_TIME = General.getInt("GridNeighborTurnOffTime", 90);
  1769. GEODATA = General.getInt("GeoData", 0);
  1770. GEODATA_DRIVER = General.getString("GeoDataDriver", "com.l2jserver.gameserver.geoengine.NullDriver");
  1771. try
  1772. {
  1773. PATHNODE_DIR = new File(General.getString("PathnodeDirectory", "data/pathnode").replaceAll("\\\\", "/")).getCanonicalFile();
  1774. }
  1775. catch (IOException e)
  1776. {
  1777. _log.log(Level.WARNING, "Error setting pathnode directory!", e);
  1778. PATHNODE_DIR = new File("data/pathnode");
  1779. }
  1780. GEODATA_CELLFINDING = General.getBoolean("CellPathFinding", false);
  1781. PATHFIND_BUFFERS = General.getString("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
  1782. LOW_WEIGHT = General.getFloat("LowWeight", 0.5f);
  1783. MEDIUM_WEIGHT = General.getFloat("MediumWeight", 2);
  1784. HIGH_WEIGHT = General.getFloat("HighWeight", 3);
  1785. ADVANCED_DIAGONAL_STRATEGY = General.getBoolean("AdvancedDiagonalStrategy", true);
  1786. DIAGONAL_WEIGHT = General.getFloat("DiagonalWeight", 0.707f);
  1787. MAX_POSTFILTER_PASSES = General.getInt("MaxPostfilterPasses", 3);
  1788. DEBUG_PATH = General.getBoolean("DebugPath", false);
  1789. FORCE_GEODATA = General.getBoolean("ForceGeodata", true);
  1790. COORD_SYNCHRONIZE = General.getInt("CoordSynchronize", -1);
  1791. String str = General.getString("EnableFallingDamage", "auto");
  1792. ENABLE_FALLING_DAMAGE = "auto".equalsIgnoreCase(str) ? GEODATA > 0 : Boolean.parseBoolean(str);
  1793. PEACE_ZONE_MODE = General.getInt("PeaceZoneMode", 0);
  1794. DEFAULT_GLOBAL_CHAT = General.getString("GlobalChat", "ON");
  1795. DEFAULT_TRADE_CHAT = General.getString("TradeChat", "ON");
  1796. ALLOW_WAREHOUSE = General.getBoolean("AllowWarehouse", true);
  1797. WAREHOUSE_CACHE = General.getBoolean("WarehouseCache", false);
  1798. WAREHOUSE_CACHE_TIME = General.getInt("WarehouseCacheTime", 15);
  1799. ALLOW_REFUND = General.getBoolean("AllowRefund", true);
  1800. ALLOW_MAIL = General.getBoolean("AllowMail", true);
  1801. ALLOW_ATTACHMENTS = General.getBoolean("AllowAttachments", true);
  1802. ALLOW_WEAR = General.getBoolean("AllowWear", true);
  1803. WEAR_DELAY = General.getInt("WearDelay", 5);
  1804. WEAR_PRICE = General.getInt("WearPrice", 10);
  1805. ALLOW_LOTTERY = General.getBoolean("AllowLottery", true);
  1806. ALLOW_RACE = General.getBoolean("AllowRace", true);
  1807. ALLOW_WATER = General.getBoolean("AllowWater", true);
  1808. ALLOW_RENTPET = General.getBoolean("AllowRentPet", false);
  1809. ALLOWFISHING = General.getBoolean("AllowFishing", true);
  1810. ALLOW_MANOR = General.getBoolean("AllowManor", true);
  1811. ALLOW_BOAT = General.getBoolean("AllowBoat", true);
  1812. BOAT_BROADCAST_RADIUS = General.getInt("BoatBroadcastRadius", 20000);
  1813. ALLOW_CURSED_WEAPONS = General.getBoolean("AllowCursedWeapons", true);
  1814. ALLOW_PET_WALKERS = General.getBoolean("AllowPetWalkers", true);
  1815. SERVER_NEWS = General.getBoolean("ShowServerNews", false);
  1816. COMMUNITY_TYPE = General.getInt("CommunityType", 1);
  1817. BBS_SHOW_PLAYERLIST = General.getBoolean("BBSShowPlayerList", false);
  1818. BBS_DEFAULT = General.getString("BBSDefault", "_bbshome");
  1819. SHOW_LEVEL_COMMUNITYBOARD = General.getBoolean("ShowLevelOnCommunityBoard", false);
  1820. SHOW_STATUS_COMMUNITYBOARD = General.getBoolean("ShowStatusOnCommunityBoard", false);
  1821. NAME_PAGE_SIZE_COMMUNITYBOARD = General.getInt("NamePageSizeOnCommunityBoard", 50);
  1822. NAME_PER_ROW_COMMUNITYBOARD = General.getInt("NamePerRowOnCommunityBoard", 5);
  1823. USE_SAY_FILTER = General.getBoolean("UseChatFilter", false);
  1824. CHAT_FILTER_CHARS = General.getString("ChatFilterChars", "^_^");
  1825. String[] propertySplit4 = General.getString("BanChatChannels", "0;1;8;17").trim().split(";");
  1826. BAN_CHAT_CHANNELS = new int[propertySplit4.length];
  1827. try
  1828. {
  1829. int i = 0;
  1830. for (String chatId : propertySplit4)
  1831. {
  1832. BAN_CHAT_CHANNELS[i++] = Integer.parseInt(chatId);
  1833. }
  1834. }
  1835. catch (NumberFormatException nfe)
  1836. {
  1837. _log.log(Level.WARNING, nfe.getMessage(), nfe);
  1838. }
  1839. ALT_MANOR_REFRESH_TIME = General.getInt("AltManorRefreshTime", 20);
  1840. ALT_MANOR_REFRESH_MIN = General.getInt("AltManorRefreshMin", 0);
  1841. ALT_MANOR_APPROVE_TIME = General.getInt("AltManorApproveTime", 4);
  1842. ALT_MANOR_APPROVE_MIN = General.getInt("AltManorApproveMin", 30);
  1843. ALT_MANOR_MAINTENANCE_MIN = General.getInt("AltManorMaintenanceMin", 6);
  1844. ALT_MANOR_SAVE_ALL_ACTIONS = General.getBoolean("AltManorSaveAllActions", false);
  1845. ALT_MANOR_SAVE_PERIOD_RATE = General.getInt("AltManorSavePeriodRate", 2);
  1846. ALT_LOTTERY_PRIZE = General.getLong("AltLotteryPrize", 50000);
  1847. ALT_LOTTERY_TICKET_PRICE = General.getLong("AltLotteryTicketPrice", 2000);
  1848. ALT_LOTTERY_5_NUMBER_RATE = General.getFloat("AltLottery5NumberRate", 0.6f);
  1849. ALT_LOTTERY_4_NUMBER_RATE = General.getFloat("AltLottery4NumberRate", 0.2f);
  1850. ALT_LOTTERY_3_NUMBER_RATE = General.getFloat("AltLottery3NumberRate", 0.2f);
  1851. ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = General.getLong("AltLottery2and1NumberPrize", 200);
  1852. ALT_ITEM_AUCTION_ENABLED = General.getBoolean("AltItemAuctionEnabled", true);
  1853. ALT_ITEM_AUCTION_EXPIRED_AFTER = General.getInt("AltItemAuctionExpiredAfter", 14);
  1854. ALT_ITEM_AUCTION_TIME_EXTENDS_ON_BID = General.getInt("AltItemAuctionTimeExtendsOnBid", 0) * 1000;
  1855. FS_TIME_ATTACK = General.getInt("TimeOfAttack", 50);
  1856. FS_TIME_COOLDOWN = General.getInt("TimeOfCoolDown", 5);
  1857. FS_TIME_ENTRY = General.getInt("TimeOfEntry", 3);
  1858. FS_TIME_WARMUP = General.getInt("TimeOfWarmUp", 2);
  1859. FS_PARTY_MEMBER_COUNT = General.getInt("NumberOfNecessaryPartyMembers", 4);
  1860. if (FS_TIME_ATTACK <= 0)
  1861. {
  1862. FS_TIME_ATTACK = 50;
  1863. }
  1864. if (FS_TIME_COOLDOWN <= 0)
  1865. {
  1866. FS_TIME_COOLDOWN = 5;
  1867. }
  1868. if (FS_TIME_ENTRY <= 0)
  1869. {
  1870. FS_TIME_ENTRY = 3;
  1871. }
  1872. if (FS_TIME_ENTRY <= 0)
  1873. {
  1874. FS_TIME_ENTRY = 3;
  1875. }
  1876. if (FS_TIME_ENTRY <= 0)
  1877. {
  1878. FS_TIME_ENTRY = 3;
  1879. }
  1880. RIFT_MIN_PARTY_SIZE = General.getInt("RiftMinPartySize", 5);
  1881. RIFT_MAX_JUMPS = General.getInt("MaxRiftJumps", 4);
  1882. RIFT_SPAWN_DELAY = General.getInt("RiftSpawnDelay", 10000);
  1883. RIFT_AUTO_JUMPS_TIME_MIN = General.getInt("AutoJumpsDelayMin", 480);
  1884. RIFT_AUTO_JUMPS_TIME_MAX = General.getInt("AutoJumpsDelayMax", 600);
  1885. RIFT_BOSS_ROOM_TIME_MUTIPLY = General.getFloat("BossRoomTimeMultiply", 1.5f);
  1886. RIFT_ENTER_COST_RECRUIT = General.getInt("RecruitCost", 18);
  1887. RIFT_ENTER_COST_SOLDIER = General.getInt("SoldierCost", 21);
  1888. RIFT_ENTER_COST_OFFICER = General.getInt("OfficerCost", 24);
  1889. RIFT_ENTER_COST_CAPTAIN = General.getInt("CaptainCost", 27);
  1890. RIFT_ENTER_COST_COMMANDER = General.getInt("CommanderCost", 30);
  1891. RIFT_ENTER_COST_HERO = General.getInt("HeroCost", 33);
  1892. DEFAULT_PUNISH = IllegalActionPunishmentType.findByName(General.getString("DefaultPunish", "KICK"));
  1893. DEFAULT_PUNISH_PARAM = General.getInt("DefaultPunishParam", 0);
  1894. ONLY_GM_ITEMS_FREE = General.getBoolean("OnlyGMItemsFree", true);
  1895. JAIL_IS_PVP = General.getBoolean("JailIsPvp", false);
  1896. JAIL_DISABLE_CHAT = General.getBoolean("JailDisableChat", true);
  1897. JAIL_DISABLE_TRANSACTION = General.getBoolean("JailDisableTransaction", false);
  1898. CUSTOM_SPAWNLIST_TABLE = General.getBoolean("CustomSpawnlistTable", false);
  1899. SAVE_GMSPAWN_ON_CUSTOM = General.getBoolean("SaveGmSpawnOnCustom", false);
  1900. CUSTOM_NPC_DATA = General.getBoolean("CustomNpcData", false);
  1901. CUSTOM_TELEPORT_TABLE = General.getBoolean("CustomTeleportTable", false);
  1902. CUSTOM_NPCBUFFER_TABLES = General.getBoolean("CustomNpcBufferTables", false);
  1903. CUSTOM_SKILLS_LOAD = General.getBoolean("CustomSkillsLoad", false);
  1904. CUSTOM_ITEMS_LOAD = General.getBoolean("CustomItemsLoad", false);
  1905. CUSTOM_MULTISELL_LOAD = General.getBoolean("CustomMultisellLoad", false);
  1906. CUSTOM_BUYLIST_LOAD = General.getBoolean("CustomBuyListLoad", false);
  1907. ALT_BIRTHDAY_GIFT = General.getInt("AltBirthdayGift", 22187);
  1908. ALT_BIRTHDAY_MAIL_SUBJECT = General.getString("AltBirthdayMailSubject", "Happy Birthday!");
  1909. ALT_BIRTHDAY_MAIL_TEXT = General.getString("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." + EOL + EOL + "Sincerely, Alegria");
  1910. ENABLE_BLOCK_CHECKER_EVENT = General.getBoolean("EnableBlockCheckerEvent", false);
  1911. MIN_BLOCK_CHECKER_TEAM_MEMBERS = General.getInt("BlockCheckerMinTeamMembers", 2);
  1912. if (MIN_BLOCK_CHECKER_TEAM_MEMBERS < 1)
  1913. {
  1914. MIN_BLOCK_CHECKER_TEAM_MEMBERS = 1;
  1915. }
  1916. else if (MIN_BLOCK_CHECKER_TEAM_MEMBERS > 6)
  1917. {
  1918. MIN_BLOCK_CHECKER_TEAM_MEMBERS = 6;
  1919. }
  1920. HBCE_FAIR_PLAY = General.getBoolean("HBCEFairPlay", false);
  1921. HELLBOUND_WITHOUT_QUEST = General.getBoolean("HellboundWithoutQuest", false);
  1922. NORMAL_ENCHANT_COST_MULTIPLIER = General.getInt("NormalEnchantCostMultipiler", 1);
  1923. SAFE_ENCHANT_COST_MULTIPLIER = General.getInt("SafeEnchantCostMultipiler", 5);
  1924. BOTREPORT_ENABLE = General.getBoolean("EnableBotReportButton", false);
  1925. BOTREPORT_RESETPOINT_HOUR = General.getString("BotReportPointsResetHour", "00:00").split(":");
  1926. BOTREPORT_REPORT_DELAY = General.getInt("BotReportDelay", 30) * 60000;
  1927. BOTREPORT_ALLOW_REPORTS_FROM_SAME_CLAN_MEMBERS = General.getBoolean("AllowReportsFromSameClanMembers", false);
  1928. // Load FloodProtector L2Properties file
  1929. final PropertiesParser FloodProtectors = new PropertiesParser(FLOOD_PROTECTOR_FILE);
  1930. loadFloodProtectorConfigs(FloodProtectors);
  1931. // Load NPC L2Properties file (if exists)
  1932. final PropertiesParser NPC = new PropertiesParser(NPC_CONFIG_FILE);
  1933. ANNOUNCE_MAMMON_SPAWN = NPC.getBoolean("AnnounceMammonSpawn", false);
  1934. ALT_MOB_AGRO_IN_PEACEZONE = NPC.getBoolean("AltMobAgroInPeaceZone", true);
  1935. ALT_ATTACKABLE_NPCS = NPC.getBoolean("AltAttackableNpcs", true);
  1936. ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false);
  1937. MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300);
  1938. DEEPBLUE_DROP_RULES = NPC.getBoolean("UseDeepBlueDropRules", true);
  1939. DEEPBLUE_DROP_RULES_RAID = NPC.getBoolean("UseDeepBlueDropRulesRaid", true);
  1940. SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false);
  1941. SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false);
  1942. ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false);
  1943. MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78);
  1944. NPC_DMG_PENALTY = parseConfigLine(NPC.getString("DmgPenaltyForLvLDifferences", "0.7, 0.6, 0.6, 0.55"));
  1945. NPC_CRIT_DMG_PENALTY = parseConfigLine(NPC.getString("CritDmgPenaltyForLvLDifferences", "0.75, 0.65, 0.6, 0.58"));
  1946. NPC_SKILL_DMG_PENALTY = parseConfigLine(NPC.getString("SkillDmgPenaltyForLvLDifferences", "0.8, 0.7, 0.65, 0.62"));
  1947. MIN_NPC_LVL_MAGIC_PENALTY = NPC.getInt("MinNPCLevelForMagicPenalty", 78);
  1948. NPC_SKILL_CHANCE_PENALTY = parseConfigLine(NPC.getString("SkillChancePenaltyForLvLDifferences", "2.5, 3.0, 3.25, 3.5"));
  1949. DECAY_TIME_TASK = NPC.getInt("DecayTimeTask", 5000);
  1950. DEFAULT_CORPSE_TIME = NPC.getInt("DefaultCorpseTime", 7);
  1951. SPOILED_CORPSE_EXTEND_TIME = NPC.getInt("SpoiledCorpseExtendTime", 10);
  1952. CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY = NPC.getInt("CorpseConsumeSkillAllowedTimeBeforeDecay", 2000);
  1953. GUARD_ATTACK_AGGRO_MOB = NPC.getBoolean("GuardAttackAggroMob", false);
  1954. ALLOW_WYVERN_UPGRADER = NPC.getBoolean("AllowWyvernUpgrader", false);
  1955. String[] listPetRentNpc = NPC.getString("ListPetRentNpc", "30827").split(",");
  1956. LIST_PET_RENT_NPC = new ArrayList<>(listPetRentNpc.length);
  1957. for (String id : listPetRentNpc)
  1958. {
  1959. LIST_PET_RENT_NPC.add(Integer.valueOf(id));
  1960. }
  1961. RAID_HP_REGEN_MULTIPLIER = NPC.getDouble("RaidHpRegenMultiplier", 100) / 100;
  1962. RAID_MP_REGEN_MULTIPLIER = NPC.getDouble("RaidMpRegenMultiplier", 100) / 100;
  1963. RAID_PDEFENCE_MULTIPLIER = NPC.getDouble("RaidPDefenceMultiplier", 100) / 100;
  1964. RAID_MDEFENCE_MULTIPLIER = NPC.getDouble("RaidMDefenceMultiplier", 100) / 100;
  1965. RAID_PATTACK_MULTIPLIER = NPC.getDouble("RaidPAttackMultiplier", 100) / 100;
  1966. RAID_MATTACK_MULTIPLIER = NPC.getDouble("RaidMAttackMultiplier", 100) / 100;
  1967. RAID_MIN_RESPAWN_MULTIPLIER = NPC.getFloat("RaidMinRespawnMultiplier", 1.0f);
  1968. RAID_MAX_RESPAWN_MULTIPLIER = NPC.getFloat("RaidMaxRespawnMultiplier", 1.0f);
  1969. RAID_MINION_RESPAWN_TIMER = NPC.getInt("RaidMinionRespawnTime", 300000);
  1970. final String[] propertySplit = NPC.getString("CustomMinionsRespawnTime", "").split(";");
  1971. MINIONS_RESPAWN_TIME = new HashMap<>(propertySplit.length);
  1972. for (String prop : propertySplit)
  1973. {
  1974. String[] propSplit = prop.split(",");
  1975. if (propSplit.length != 2)
  1976. {
  1977. _log.warning(StringUtil.concat("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"", prop, "\""));
  1978. }
  1979. try
  1980. {
  1981. MINIONS_RESPAWN_TIME.put(Integer.valueOf(propSplit[0]), Integer.valueOf(propSplit[1]));
  1982. }
  1983. catch (NumberFormatException nfe)
  1984. {
  1985. if (!prop.isEmpty())
  1986. {
  1987. _log.warning(StringUtil.concat("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"", propSplit[0], "\"", propSplit[1]));
  1988. }
  1989. }
  1990. }
  1991. RAID_DISABLE_CURSE = NPC.getBoolean("DisableRaidCurse", false);
  1992. RAID_CHAOS_TIME = NPC.getInt("RaidChaosTime", 10);
  1993. GRAND_CHAOS_TIME = NPC.getInt("GrandChaosTime", 10);
  1994. MINION_CHAOS_TIME = NPC.getInt("MinionChaosTime", 10);
  1995. INVENTORY_MAXIMUM_PET = NPC.getInt("MaximumSlotsForPet", 12);
  1996. PET_HP_REGEN_MULTIPLIER = NPC.getDouble("PetHpRegenMultiplier", 100) / 100;
  1997. PET_MP_REGEN_MULTIPLIER = NPC.getDouble("PetMpRegenMultiplier", 100) / 100;
  1998. DROP_ADENA_MIN_LEVEL_DIFFERENCE = NPC.getInt("DropAdenaMinLevelDifference", 8);
  1999. DROP_ADENA_MAX_LEVEL_DIFFERENCE = NPC.getInt("DropAdenaMaxLevelDifference", 15);
  2000. DROP_ADENA_MIN_LEVEL_GAP_CHANCE = NPC.getDouble("DropAdenaMinLevelGapChance", 10);
  2001. DROP_ITEM_MIN_LEVEL_DIFFERENCE = NPC.getInt("DropItemMinLevelDifference", 5);
  2002. DROP_ITEM_MAX_LEVEL_DIFFERENCE = NPC.getInt("DropItemMaxLevelDifference", 10);
  2003. DROP_ITEM_MIN_LEVEL_GAP_CHANCE = NPC.getDouble("DropItemMinLevelGapChance", 10);
  2004. // Load Rates L2Properties file (if exists)
  2005. final PropertiesParser RatesSettings = new PropertiesParser(RATES_CONFIG_FILE);
  2006. RATE_XP = RatesSettings.getFloat("RateXp", 1);
  2007. RATE_SP = RatesSettings.getFloat("RateSp", 1);
  2008. RATE_PARTY_XP = RatesSettings.getFloat("RatePartyXp", 1);
  2009. RATE_PARTY_SP = RatesSettings.getFloat("RatePartySp", 1);
  2010. RATE_EXTRACTABLE = RatesSettings.getFloat("RateExtractable", 1);
  2011. RATE_DROP_MANOR = RatesSettings.getInt("RateDropManor", 1);
  2012. RATE_QUEST_DROP = RatesSettings.getFloat("RateQuestDrop", 1);
  2013. RATE_QUEST_REWARD = RatesSettings.getFloat("RateQuestReward", 1);
  2014. RATE_QUEST_REWARD_XP = RatesSettings.getFloat("RateQuestRewardXP", 1);
  2015. RATE_QUEST_REWARD_SP = RatesSettings.getFloat("RateQuestRewardSP", 1);
  2016. RATE_QUEST_REWARD_ADENA = RatesSettings.getFloat("RateQuestRewardAdena", 1);
  2017. RATE_QUEST_REWARD_USE_MULTIPLIERS = RatesSettings.getBoolean("UseQuestRewardMultipliers", false);
  2018. RATE_QUEST_REWARD_POTION = RatesSettings.getFloat("RateQuestRewardPotion", 1);
  2019. RATE_QUEST_REWARD_SCROLL = RatesSettings.getFloat("RateQuestRewardScroll", 1);
  2020. RATE_QUEST_REWARD_RECIPE = RatesSettings.getFloat("RateQuestRewardRecipe", 1);
  2021. RATE_QUEST_REWARD_MATERIAL = RatesSettings.getFloat("RateQuestRewardMaterial", 1);
  2022. RATE_HB_TRUST_INCREASE = RatesSettings.getFloat("RateHellboundTrustIncrease", 1);
  2023. RATE_HB_TRUST_DECREASE = RatesSettings.getFloat("RateHellboundTrustDecrease", 1);
  2024. RATE_VITALITY_LEVEL_1 = RatesSettings.getFloat("RateVitalityLevel1", 1.5f);
  2025. RATE_VITALITY_LEVEL_2 = RatesSettings.getFloat("RateVitalityLevel2", 2);
  2026. RATE_VITALITY_LEVEL_3 = RatesSettings.getFloat("RateVitalityLevel3", 2.5f);
  2027. RATE_VITALITY_LEVEL_4 = RatesSettings.getFloat("RateVitalityLevel4", 3);
  2028. RATE_RECOVERY_VITALITY_PEACE_ZONE = RatesSettings.getFloat("RateRecoveryPeaceZone", 1);
  2029. RATE_VITALITY_LOST = RatesSettings.getFloat("RateVitalityLost", 1);
  2030. RATE_VITALITY_GAIN = RatesSettings.getFloat("RateVitalityGain", 1);
  2031. RATE_RECOVERY_ON_RECONNECT = RatesSettings.getFloat("RateRecoveryOnReconnect", 4);
  2032. RATE_KARMA_LOST = RatesSettings.getFloat("RateKarmaLost", -1);
  2033. if (RATE_KARMA_LOST == -1)
  2034. {
  2035. RATE_KARMA_LOST = RATE_XP;
  2036. }
  2037. RATE_KARMA_EXP_LOST = RatesSettings.getFloat("RateKarmaExpLost", 1);
  2038. RATE_SIEGE_GUARDS_PRICE = RatesSettings.getFloat("RateSiegeGuardsPrice", 1);
  2039. PLAYER_DROP_LIMIT = RatesSettings.getInt("PlayerDropLimit", 3);
  2040. PLAYER_RATE_DROP = RatesSettings.getInt("PlayerRateDrop", 5);
  2041. PLAYER_RATE_DROP_ITEM = RatesSettings.getInt("PlayerRateDropItem", 70);
  2042. PLAYER_RATE_DROP_EQUIP = RatesSettings.getInt("PlayerRateDropEquip", 25);
  2043. PLAYER_RATE_DROP_EQUIP_WEAPON = RatesSettings.getInt("PlayerRateDropEquipWeapon", 5);
  2044. PET_XP_RATE = RatesSettings.getFloat("PetXpRate", 1);
  2045. PET_FOOD_RATE = RatesSettings.getInt("PetFoodRate", 1);
  2046. SINEATER_XP_RATE = RatesSettings.getFloat("SinEaterXpRate", 1);
  2047. KARMA_DROP_LIMIT = RatesSettings.getInt("KarmaDropLimit", 10);
  2048. KARMA_RATE_DROP = RatesSettings.getInt("KarmaRateDrop", 70);
  2049. KARMA_RATE_DROP_ITEM = RatesSettings.getInt("KarmaRateDropItem", 50);
  2050. KARMA_RATE_DROP_EQUIP = RatesSettings.getInt("KarmaRateDropEquip", 40);
  2051. KARMA_RATE_DROP_EQUIP_WEAPON = RatesSettings.getInt("KarmaRateDropEquipWeapon", 10);
  2052. // Initializing table
  2053. PLAYER_XP_PERCENT_LOST = new double[Byte.MAX_VALUE + 1];
  2054. // Default value
  2055. for (int i = 0; i <= Byte.MAX_VALUE; i++)
  2056. {
  2057. PLAYER_XP_PERCENT_LOST[i] = 1.;
  2058. }
  2059. // Now loading into table parsed values
  2060. try
  2061. {
  2062. String[] values = RatesSettings.getString("PlayerXPPercentLost", "0,39-7.0;40,75-4.0;76,76-2.5;77,77-2.0;78,78-1.5").split(";");
  2063. for (String s : values)
  2064. {
  2065. int min;
  2066. int max;
  2067. double val;
  2068. String[] vals = s.split("-");
  2069. String[] mM = vals[0].split(",");
  2070. min = Integer.parseInt(mM[0]);
  2071. max = Integer.parseInt(mM[1]);
  2072. val = Double.parseDouble(vals[1]);
  2073. for (int i = min; i <= max; i++)
  2074. {
  2075. PLAYER_XP_PERCENT_LOST[i] = val;
  2076. }
  2077. }
  2078. }
  2079. catch (Exception e)
  2080. {
  2081. _log.log(Level.WARNING, "Error while loading Player XP percent lost!", e);
  2082. }
  2083. RATE_DEATH_DROP_AMOUNT_MULTIPLIER = RatesSettings.getFloat("DeathDropAmountMultiplier", 1);
  2084. RATE_CORPSE_DROP_AMOUNT_MULTIPLIER = RatesSettings.getFloat("CorpseDropAmountMultiplier", 1);
  2085. RATE_HERB_DROP_AMOUNT_MULTIPLIER = RatesSettings.getFloat("HerbDropAmountMultiplier", 1);
  2086. RATE_RAID_DROP_AMOUNT_MULTIPLIER = RatesSettings.getFloat("RaidDropAmountMultiplier", 1);
  2087. RATE_DEATH_DROP_CHANCE_MULTIPLIER = RatesSettings.getFloat("DeathDropChanceMultiplier", 1);
  2088. RATE_CORPSE_DROP_CHANCE_MULTIPLIER = RatesSettings.getFloat("CorpseDropChanceMultiplier", 1);
  2089. RATE_HERB_DROP_CHANCE_MULTIPLIER = RatesSettings.getFloat("HerbDropChanceMultiplier", 1);
  2090. RATE_RAID_DROP_CHANCE_MULTIPLIER = RatesSettings.getFloat("RaidDropChanceMultiplier", 1);
  2091. String[] dropAmountMultiplier = RatesSettings.getString("DropAmountMultiplierByItemId", "").split(";");
  2092. RATE_DROP_AMOUNT_MULTIPLIER = new HashMap<>(dropAmountMultiplier.length);
  2093. if (!dropAmountMultiplier[0].isEmpty())
  2094. {
  2095. for (String item : dropAmountMultiplier)
  2096. {
  2097. String[] itemSplit = item.split(",");
  2098. if (itemSplit.length != 2)
  2099. {
  2100. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  2101. }
  2102. else
  2103. {
  2104. try
  2105. {
  2106. RATE_DROP_AMOUNT_MULTIPLIER.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
  2107. }
  2108. catch (NumberFormatException nfe)
  2109. {
  2110. if (!item.isEmpty())
  2111. {
  2112. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  2113. }
  2114. }
  2115. }
  2116. }
  2117. }
  2118. String[] dropChanceMultiplier = RatesSettings.getString("DropChanceMultiplierByItemId", "").split(";");
  2119. RATE_DROP_CHANCE_MULTIPLIER = new HashMap<>(dropChanceMultiplier.length);
  2120. if (!dropChanceMultiplier[0].isEmpty())
  2121. {
  2122. for (String item : dropChanceMultiplier)
  2123. {
  2124. String[] itemSplit = item.split(",");
  2125. if (itemSplit.length != 2)
  2126. {
  2127. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  2128. }
  2129. else
  2130. {
  2131. try
  2132. {
  2133. RATE_DROP_CHANCE_MULTIPLIER.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
  2134. }
  2135. catch (NumberFormatException nfe)
  2136. {
  2137. if (!item.isEmpty())
  2138. {
  2139. _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
  2140. }
  2141. }
  2142. }
  2143. }
  2144. }
  2145. // Load L2JMod L2Properties file (if exists)
  2146. final PropertiesParser L2JModSettings = new PropertiesParser(L2JMOD_CONFIG_FILE);
  2147. L2JMOD_CHAMPION_ENABLE = L2JModSettings.getBoolean("ChampionEnable", false);
  2148. L2JMOD_CHAMPION_PASSIVE = L2JModSettings.getBoolean("ChampionPassive", false);
  2149. L2JMOD_CHAMPION_FREQUENCY = L2JModSettings.getInt("ChampionFrequency", 0);
  2150. L2JMOD_CHAMP_TITLE = L2JModSettings.getString("ChampionTitle", "Champion");
  2151. L2JMOD_CHAMP_MIN_LVL = L2JModSettings.getInt("ChampionMinLevel", 20);
  2152. L2JMOD_CHAMP_MAX_LVL = L2JModSettings.getInt("ChampionMaxLevel", 60);
  2153. L2JMOD_CHAMPION_HP = L2JModSettings.getInt("ChampionHp", 7);
  2154. L2JMOD_CHAMPION_HP_REGEN = L2JModSettings.getFloat("ChampionHpRegen", 1);
  2155. L2JMOD_CHAMPION_REWARDS = L2JModSettings.getInt("ChampionRewards", 8);
  2156. L2JMOD_CHAMPION_ADENAS_REWARDS = L2JModSettings.getFloat("ChampionAdenasRewards", 1);
  2157. L2JMOD_CHAMPION_ATK = L2JModSettings.getFloat("ChampionAtk", 1);
  2158. L2JMOD_CHAMPION_SPD_ATK = L2JModSettings.getFloat("ChampionSpdAtk", 1);
  2159. L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = L2JModSettings.getInt("ChampionRewardLowerLvlItemChance", 0);
  2160. L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = L2JModSettings.getInt("ChampionRewardHigherLvlItemChance", 0);
  2161. L2JMOD_CHAMPION_REWARD_ID = L2JModSettings.getInt("ChampionRewardItemID", 6393);
  2162. L2JMOD_CHAMPION_REWARD_QTY = L2JModSettings.getInt("ChampionRewardItemQty", 1);
  2163. L2JMOD_CHAMPION_ENABLE_VITALITY = L2JModSettings.getBoolean("ChampionEnableVitality", false);
  2164. L2JMOD_CHAMPION_ENABLE_IN_INSTANCES = L2JModSettings.getBoolean("ChampionEnableInInstances", false);
  2165. TVT_EVENT_ENABLED = L2JModSettings.getBoolean("TvTEventEnabled", false);
  2166. TVT_EVENT_IN_INSTANCE = L2JModSettings.getBoolean("TvTEventInInstance", false);
  2167. TVT_EVENT_INSTANCE_FILE = L2JModSettings.getString("TvTEventInstanceFile", "coliseum.xml");
  2168. TVT_EVENT_INTERVAL = L2JModSettings.getString("TvTEventInterval", "20:00").split(",");
  2169. TVT_EVENT_PARTICIPATION_TIME = L2JModSettings.getInt("TvTEventParticipationTime", 3600);
  2170. TVT_EVENT_RUNNING_TIME = L2JModSettings.getInt("TvTEventRunningTime", 1800);
  2171. TVT_EVENT_PARTICIPATION_NPC_ID = L2JModSettings.getInt("TvTEventParticipationNpcId", 0);
  2172. L2JMOD_ALLOW_WEDDING = L2JModSettings.getBoolean("AllowWedding", false);
  2173. L2JMOD_WEDDING_PRICE = L2JModSettings.getInt("WeddingPrice", 250000000);
  2174. L2JMOD_WEDDING_PUNISH_INFIDELITY = L2JModSettings.getBoolean("WeddingPunishInfidelity", true);
  2175. L2JMOD_WEDDING_TELEPORT = L2JModSettings.getBoolean("WeddingTeleport", true);
  2176. L2JMOD_WEDDING_TELEPORT_PRICE = L2JModSettings.getInt("WeddingTeleportPrice", 50000);
  2177. L2JMOD_WEDDING_TELEPORT_DURATION = L2JModSettings.getInt("WeddingTeleportDuration", 60);
  2178. L2JMOD_WEDDING_SAMESEX = L2JModSettings.getBoolean("WeddingAllowSameSex", false);
  2179. L2JMOD_WEDDING_FORMALWEAR = L2JModSettings.getBoolean("WeddingFormalWear", true);
  2180. L2JMOD_WEDDING_DIVORCE_COSTS = L2JModSettings.getInt("WeddingDivorceCosts", 20);
  2181. L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = L2JModSettings.getBoolean("EnableWarehouseSortingClan", false);
  2182. L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = L2JModSettings.getBoolean("EnableWarehouseSortingPrivate", false);
  2183. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  2184. {
  2185. TVT_EVENT_ENABLED = false;
  2186. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
  2187. }
  2188. else
  2189. {
  2190. String[] tvtNpcCoords = L2JModSettings.getString("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
  2191. if (tvtNpcCoords.length < 3)
  2192. {
  2193. TVT_EVENT_ENABLED = false;
  2194. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
  2195. }
  2196. else
  2197. {
  2198. TVT_EVENT_REWARDS = new ArrayList<>();
  2199. TVT_DOORS_IDS_TO_OPEN = new ArrayList<>();
  2200. TVT_DOORS_IDS_TO_CLOSE = new ArrayList<>();
  2201. TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[4];
  2202. TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  2203. TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  2204. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(tvtNpcCoords[0]);
  2205. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(tvtNpcCoords[1]);
  2206. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(tvtNpcCoords[2]);
  2207. if (tvtNpcCoords.length == 4)
  2208. {
  2209. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[3] = Integer.parseInt(tvtNpcCoords[3]);
  2210. }
  2211. TVT_EVENT_MIN_PLAYERS_IN_TEAMS = L2JModSettings.getInt("TvTEventMinPlayersInTeams", 1);
  2212. TVT_EVENT_MAX_PLAYERS_IN_TEAMS = L2JModSettings.getInt("TvTEventMaxPlayersInTeams", 20);
  2213. TVT_EVENT_MIN_LVL = L2JModSettings.getByte("TvTEventMinPlayerLevel", (byte) 1);
  2214. TVT_EVENT_MAX_LVL = L2JModSettings.getByte("TvTEventMaxPlayerLevel", (byte) 80);
  2215. TVT_EVENT_RESPAWN_TELEPORT_DELAY = L2JModSettings.getInt("TvTEventRespawnTeleportDelay", 20);
  2216. TVT_EVENT_START_LEAVE_TELEPORT_DELAY = L2JModSettings.getInt("TvTEventStartLeaveTeleportDelay", 20);
  2217. TVT_EVENT_EFFECTS_REMOVAL = L2JModSettings.getInt("TvTEventEffectsRemoval", 0);
  2218. TVT_EVENT_MAX_PARTICIPANTS_PER_IP = L2JModSettings.getInt("TvTEventMaxParticipantsPerIP", 0);
  2219. TVT_ALLOW_VOICED_COMMAND = L2JModSettings.getBoolean("TvTAllowVoicedInfoCommand", false);
  2220. TVT_EVENT_TEAM_1_NAME = L2JModSettings.getString("TvTEventTeam1Name", "Team1");
  2221. tvtNpcCoords = L2JModSettings.getString("TvTEventTeam1Coordinates", "0,0,0").split(",");
  2222. if (tvtNpcCoords.length < 3)
  2223. {
  2224. TVT_EVENT_ENABLED = false;
  2225. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
  2226. }
  2227. else
  2228. {
  2229. TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(tvtNpcCoords[0]);
  2230. TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(tvtNpcCoords[1]);
  2231. TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(tvtNpcCoords[2]);
  2232. TVT_EVENT_TEAM_2_NAME = L2JModSettings.getString("TvTEventTeam2Name", "Team2");
  2233. tvtNpcCoords = L2JModSettings.getString("TvTEventTeam2Coordinates", "0,0,0").split(",");
  2234. if (tvtNpcCoords.length < 3)
  2235. {
  2236. TVT_EVENT_ENABLED = false;
  2237. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
  2238. }
  2239. else
  2240. {
  2241. TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(tvtNpcCoords[0]);
  2242. TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(tvtNpcCoords[1]);
  2243. TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(tvtNpcCoords[2]);
  2244. tvtNpcCoords = L2JModSettings.getString("TvTEventParticipationFee", "0,0").split(",");
  2245. try
  2246. {
  2247. TVT_EVENT_PARTICIPATION_FEE[0] = Integer.parseInt(tvtNpcCoords[0]);
  2248. TVT_EVENT_PARTICIPATION_FEE[1] = Integer.parseInt(tvtNpcCoords[1]);
  2249. }
  2250. catch (NumberFormatException nfe)
  2251. {
  2252. if (tvtNpcCoords.length > 0)
  2253. {
  2254. _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationFee");
  2255. }
  2256. }
  2257. tvtNpcCoords = L2JModSettings.getString("TvTEventReward", "57,100000").split(";");
  2258. for (String reward : tvtNpcCoords)
  2259. {
  2260. String[] rewardSplit = reward.split(",");
  2261. if (rewardSplit.length != 2)
  2262. {
  2263. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  2264. }
  2265. else
  2266. {
  2267. try
  2268. {
  2269. TVT_EVENT_REWARDS.add(new int[]
  2270. {
  2271. Integer.parseInt(rewardSplit[0]),
  2272. Integer.parseInt(rewardSplit[1])
  2273. });
  2274. }
  2275. catch (NumberFormatException nfe)
  2276. {
  2277. if (!reward.isEmpty())
  2278. {
  2279. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
  2280. }
  2281. }
  2282. }
  2283. }
  2284. TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = L2JModSettings.getBoolean("TvTEventTargetTeamMembersAllowed", true);
  2285. TVT_EVENT_SCROLL_ALLOWED = L2JModSettings.getBoolean("TvTEventScrollsAllowed", false);
  2286. TVT_EVENT_POTIONS_ALLOWED = L2JModSettings.getBoolean("TvTEventPotionsAllowed", false);
  2287. TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = L2JModSettings.getBoolean("TvTEventSummonByItemAllowed", false);
  2288. TVT_REWARD_TEAM_TIE = L2JModSettings.getBoolean("TvTRewardTeamTie", false);
  2289. tvtNpcCoords = L2JModSettings.getString("TvTDoorsToOpen", "").split(";");
  2290. for (String door : tvtNpcCoords)
  2291. {
  2292. try
  2293. {
  2294. TVT_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
  2295. }
  2296. catch (NumberFormatException nfe)
  2297. {
  2298. if (!door.isEmpty())
  2299. {
  2300. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"", door, "\""));
  2301. }
  2302. }
  2303. }
  2304. tvtNpcCoords = L2JModSettings.getString("TvTDoorsToClose", "").split(";");
  2305. for (String door : tvtNpcCoords)
  2306. {
  2307. try
  2308. {
  2309. TVT_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
  2310. }
  2311. catch (NumberFormatException nfe)
  2312. {
  2313. if (!door.isEmpty())
  2314. {
  2315. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"", door, "\""));
  2316. }
  2317. }
  2318. }
  2319. tvtNpcCoords = L2JModSettings.getString("TvTEventFighterBuffs", "").split(";");
  2320. if (!tvtNpcCoords[0].isEmpty())
  2321. {
  2322. TVT_EVENT_FIGHTER_BUFFS = new HashMap<>(tvtNpcCoords.length);
  2323. for (String skill : tvtNpcCoords)
  2324. {
  2325. String[] skillSplit = skill.split(",");
  2326. if (skillSplit.length != 2)
  2327. {
  2328. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2329. }
  2330. else
  2331. {
  2332. try
  2333. {
  2334. TVT_EVENT_FIGHTER_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2335. }
  2336. catch (NumberFormatException nfe)
  2337. {
  2338. if (!skill.isEmpty())
  2339. {
  2340. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
  2341. }
  2342. }
  2343. }
  2344. }
  2345. }
  2346. tvtNpcCoords = L2JModSettings.getString("TvTEventMageBuffs", "").split(";");
  2347. if (!tvtNpcCoords[0].isEmpty())
  2348. {
  2349. TVT_EVENT_MAGE_BUFFS = new HashMap<>(tvtNpcCoords.length);
  2350. for (String skill : tvtNpcCoords)
  2351. {
  2352. String[] skillSplit = skill.split(",");
  2353. if (skillSplit.length != 2)
  2354. {
  2355. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2356. }
  2357. else
  2358. {
  2359. try
  2360. {
  2361. TVT_EVENT_MAGE_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  2362. }
  2363. catch (NumberFormatException nfe)
  2364. {
  2365. if (!skill.isEmpty())
  2366. {
  2367. _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
  2368. }
  2369. }
  2370. }
  2371. }
  2372. }
  2373. }
  2374. }
  2375. }
  2376. }
  2377. BANKING_SYSTEM_ENABLED = L2JModSettings.getBoolean("BankingEnabled", false);
  2378. BANKING_SYSTEM_GOLDBARS = L2JModSettings.getInt("BankingGoldbarCount", 1);
  2379. BANKING_SYSTEM_ADENA = L2JModSettings.getInt("BankingAdenaCount", 500000000);
  2380. OFFLINE_TRADE_ENABLE = L2JModSettings.getBoolean("OfflineTradeEnable", false);
  2381. OFFLINE_CRAFT_ENABLE = L2JModSettings.getBoolean("OfflineCraftEnable", false);
  2382. OFFLINE_MODE_IN_PEACE_ZONE = L2JModSettings.getBoolean("OfflineModeInPeaceZone", false);
  2383. OFFLINE_MODE_NO_DAMAGE = L2JModSettings.getBoolean("OfflineModeNoDamage", false);
  2384. OFFLINE_SET_NAME_COLOR = L2JModSettings.getBoolean("OfflineSetNameColor", false);
  2385. OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getString("OfflineNameColor", "808080"));
  2386. OFFLINE_FAME = L2JModSettings.getBoolean("OfflineFame", true);
  2387. RESTORE_OFFLINERS = L2JModSettings.getBoolean("RestoreOffliners", false);
  2388. OFFLINE_MAX_DAYS = L2JModSettings.getInt("OfflineMaxDays", 10);
  2389. OFFLINE_DISCONNECT_FINISHED = L2JModSettings.getBoolean("OfflineDisconnectFinished", true);
  2390. L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = L2JModSettings.getBoolean("EnableManaPotionSupport", false);
  2391. L2JMOD_DISPLAY_SERVER_TIME = L2JModSettings.getBoolean("DisplayServerTime", false);
  2392. WELCOME_MESSAGE_ENABLED = L2JModSettings.getBoolean("ScreenWelcomeMessageEnable", false);
  2393. WELCOME_MESSAGE_TEXT = L2JModSettings.getString("ScreenWelcomeMessageText", "Welcome to L2J server!");
  2394. WELCOME_MESSAGE_TIME = L2JModSettings.getInt("ScreenWelcomeMessageTime", 10) * 1000;
  2395. L2JMOD_ANTIFEED_ENABLE = L2JModSettings.getBoolean("AntiFeedEnable", false);
  2396. L2JMOD_ANTIFEED_DUALBOX = L2JModSettings.getBoolean("AntiFeedDualbox", true);
  2397. L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = L2JModSettings.getBoolean("AntiFeedDisconnectedAsDualbox", true);
  2398. L2JMOD_ANTIFEED_INTERVAL = L2JModSettings.getInt("AntiFeedInterval", 120) * 1000;
  2399. ANNOUNCE_PK_PVP = L2JModSettings.getBoolean("AnnouncePkPvP", false);
  2400. ANNOUNCE_PK_PVP_NORMAL_MESSAGE = L2JModSettings.getBoolean("AnnouncePkPvPNormalMessage", true);
  2401. ANNOUNCE_PK_MSG = L2JModSettings.getString("AnnouncePkMsg", "$killer has slaughtered $target");
  2402. ANNOUNCE_PVP_MSG = L2JModSettings.getString("AnnouncePvpMsg", "$killer has defeated $target");
  2403. L2JMOD_CHAT_ADMIN = L2JModSettings.getBoolean("ChatAdmin", false);
  2404. L2JMOD_MULTILANG_DEFAULT = L2JModSettings.getString("MultiLangDefault", "en");
  2405. L2JMOD_MULTILANG_ENABLE = L2JModSettings.getBoolean("MultiLangEnable", false);
  2406. String[] allowed = L2JModSettings.getString("MultiLangAllowed", L2JMOD_MULTILANG_DEFAULT).split(";");
  2407. L2JMOD_MULTILANG_ALLOWED = new ArrayList<>(allowed.length);
  2408. for (String lang : allowed)
  2409. {
  2410. L2JMOD_MULTILANG_ALLOWED.add(lang);
  2411. }
  2412. if (!L2JMOD_MULTILANG_ALLOWED.contains(L2JMOD_MULTILANG_DEFAULT))
  2413. {
  2414. _log.warning("MultiLang[Config.load()]: default language: " + L2JMOD_MULTILANG_DEFAULT + " is not in allowed list !");
  2415. }
  2416. L2JMOD_HELLBOUND_STATUS = L2JModSettings.getBoolean("HellboundStatus", false);
  2417. L2JMOD_MULTILANG_VOICED_ALLOW = L2JModSettings.getBoolean("MultiLangVoiceCommand", true);
  2418. L2JMOD_MULTILANG_SM_ENABLE = L2JModSettings.getBoolean("MultiLangSystemMessageEnable", false);
  2419. allowed = L2JModSettings.getString("MultiLangSystemMessageAllowed", "").split(";");
  2420. L2JMOD_MULTILANG_SM_ALLOWED = new ArrayList<>(allowed.length);
  2421. for (String lang : allowed)
  2422. {
  2423. if (!lang.isEmpty())
  2424. {
  2425. L2JMOD_MULTILANG_SM_ALLOWED.add(lang);
  2426. }
  2427. }
  2428. L2JMOD_MULTILANG_NS_ENABLE = L2JModSettings.getBoolean("MultiLangNpcStringEnable", false);
  2429. allowed = L2JModSettings.getString("MultiLangNpcStringAllowed", "").split(";");
  2430. L2JMOD_MULTILANG_NS_ALLOWED = new ArrayList<>(allowed.length);
  2431. for (String lang : allowed)
  2432. {
  2433. if (!lang.isEmpty())
  2434. {
  2435. L2JMOD_MULTILANG_NS_ALLOWED.add(lang);
  2436. }
  2437. }
  2438. L2WALKER_PROTECTION = L2JModSettings.getBoolean("L2WalkerProtection", false);
  2439. L2JMOD_DEBUG_VOICE_COMMAND = L2JModSettings.getBoolean("DebugVoiceCommand", false);
  2440. L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP = L2JModSettings.getInt("DualboxCheckMaxPlayersPerIP", 0);
  2441. L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = L2JModSettings.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
  2442. L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = L2JModSettings.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0);
  2443. String[] dualboxCheckWhiteList = L2JModSettings.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
  2444. L2JMOD_DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
  2445. for (String entry : dualboxCheckWhiteList)
  2446. {
  2447. String[] entrySplit = entry.split(",");
  2448. if (entrySplit.length != 2)
  2449. {
  2450. _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid config property -> DualboxCheckWhitelist \"", entry, "\""));
  2451. }
  2452. else
  2453. {
  2454. try
  2455. {
  2456. int num = Integer.parseInt(entrySplit[1]);
  2457. num = num == 0 ? -1 : num;
  2458. L2JMOD_DUALBOX_CHECK_WHITELIST.put(InetAddress.getByName(entrySplit[0]).hashCode(), num);
  2459. }
  2460. catch (UnknownHostException e)
  2461. {
  2462. _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid address -> DualboxCheckWhitelist \"", entrySplit[0], "\""));
  2463. }
  2464. catch (NumberFormatException e)
  2465. {
  2466. _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid number -> DualboxCheckWhitelist \"", entrySplit[1], "\""));
  2467. }
  2468. }
  2469. }
  2470. L2JMOD_ALLOW_CHANGE_PASSWORD = L2JModSettings.getBoolean("AllowChangePassword", false);
  2471. // Load PvP L2Properties file (if exists)
  2472. final PropertiesParser PVPSettings = new PropertiesParser(PVP_CONFIG_FILE);
  2473. KARMA_DROP_GM = PVPSettings.getBoolean("CanGMDropEquipment", false);
  2474. KARMA_AWARD_PK_KILL = PVPSettings.getBoolean("AwardPKKillPVPPoint", false);
  2475. KARMA_PK_LIMIT = PVPSettings.getInt("MinimumPKRequiredToDrop", 5);
  2476. KARMA_NONDROPPABLE_PET_ITEMS = PVPSettings.getString("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
  2477. KARMA_NONDROPPABLE_ITEMS = PVPSettings.getString("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");
  2478. String[] karma = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
  2479. KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[karma.length];
  2480. for (int i = 0; i < karma.length; i++)
  2481. {
  2482. KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(karma[i]);
  2483. }
  2484. karma = KARMA_NONDROPPABLE_ITEMS.split(",");
  2485. KARMA_LIST_NONDROPPABLE_ITEMS = new int[karma.length];
  2486. for (int i = 0; i < karma.length; i++)
  2487. {
  2488. KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(karma[i]);
  2489. }
  2490. // sorting so binarySearch can be used later
  2491. Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
  2492. Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
  2493. PVP_NORMAL_TIME = PVPSettings.getInt("PvPVsNormalTime", 120000);
  2494. PVP_PVP_TIME = PVPSettings.getInt("PvPVsPvPTime", 60000);
  2495. // Load Olympiad L2Properties file (if exists)
  2496. final PropertiesParser Olympiad = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
  2497. ALT_OLY_START_TIME = Olympiad.getInt("AltOlyStartTime", 18);
  2498. ALT_OLY_MIN = Olympiad.getInt("AltOlyMin", 0);
  2499. ALT_OLY_MAX_BUFFS = Olympiad.getInt("AltOlyMaxBuffs", 5);
  2500. ALT_OLY_CPERIOD = Olympiad.getLong("AltOlyCPeriod", 21600000);
  2501. ALT_OLY_BATTLE = Olympiad.getLong("AltOlyBattle", 300000);
  2502. ALT_OLY_WPERIOD = Olympiad.getLong("AltOlyWPeriod", 604800000);
  2503. ALT_OLY_VPERIOD = Olympiad.getLong("AltOlyVPeriod", 86400000);
  2504. ALT_OLY_START_POINTS = Olympiad.getInt("AltOlyStartPoints", 10);
  2505. ALT_OLY_WEEKLY_POINTS = Olympiad.getInt("AltOlyWeeklyPoints", 10);
  2506. ALT_OLY_CLASSED = Olympiad.getInt("AltOlyClassedParticipants", 11);
  2507. ALT_OLY_NONCLASSED = Olympiad.getInt("AltOlyNonClassedParticipants", 11);
  2508. ALT_OLY_TEAMS = Olympiad.getInt("AltOlyTeamsParticipants", 6);
  2509. ALT_OLY_REG_DISPLAY = Olympiad.getInt("AltOlyRegistrationDisplayNumber", 100);
  2510. ALT_OLY_CLASSED_REWARD = parseItemsList(Olympiad.getString("AltOlyClassedReward", "13722,50"));
  2511. ALT_OLY_NONCLASSED_REWARD = parseItemsList(Olympiad.getString("AltOlyNonClassedReward", "13722,40"));
  2512. ALT_OLY_TEAM_REWARD = parseItemsList(Olympiad.getString("AltOlyTeamReward", "13722,85"));
  2513. ALT_OLY_COMP_RITEM = Olympiad.getInt("AltOlyCompRewItem", 13722);
  2514. ALT_OLY_MIN_MATCHES = Olympiad.getInt("AltOlyMinMatchesForPoints", 15);
  2515. ALT_OLY_GP_PER_POINT = Olympiad.getInt("AltOlyGPPerPoint", 1000);
  2516. ALT_OLY_HERO_POINTS = Olympiad.getInt("AltOlyHeroPoints", 200);
  2517. ALT_OLY_RANK1_POINTS = Olympiad.getInt("AltOlyRank1Points", 100);
  2518. ALT_OLY_RANK2_POINTS = Olympiad.getInt("AltOlyRank2Points", 75);
  2519. ALT_OLY_RANK3_POINTS = Olympiad.getInt("AltOlyRank3Points", 55);
  2520. ALT_OLY_RANK4_POINTS = Olympiad.getInt("AltOlyRank4Points", 40);
  2521. ALT_OLY_RANK5_POINTS = Olympiad.getInt("AltOlyRank5Points", 30);
  2522. ALT_OLY_MAX_POINTS = Olympiad.getInt("AltOlyMaxPoints", 10);
  2523. ALT_OLY_DIVIDER_CLASSED = Olympiad.getInt("AltOlyDividerClassed", 5);
  2524. ALT_OLY_DIVIDER_NON_CLASSED = Olympiad.getInt("AltOlyDividerNonClassed", 5);
  2525. ALT_OLY_MAX_WEEKLY_MATCHES = Olympiad.getInt("AltOlyMaxWeeklyMatches", 70);
  2526. ALT_OLY_MAX_WEEKLY_MATCHES_NON_CLASSED = Olympiad.getInt("AltOlyMaxWeeklyMatchesNonClassed", 60);
  2527. ALT_OLY_MAX_WEEKLY_MATCHES_CLASSED = Olympiad.getInt("AltOlyMaxWeeklyMatchesClassed", 30);
  2528. ALT_OLY_MAX_WEEKLY_MATCHES_TEAM = Olympiad.getInt("AltOlyMaxWeeklyMatchesTeam", 10);
  2529. ALT_OLY_LOG_FIGHTS = Olympiad.getBoolean("AltOlyLogFights", false);
  2530. ALT_OLY_SHOW_MONTHLY_WINNERS = Olympiad.getBoolean("AltOlyShowMonthlyWinners", true);
  2531. ALT_OLY_ANNOUNCE_GAMES = Olympiad.getBoolean("AltOlyAnnounceGames", true);
  2532. String[] olyRestrictedItems = Olympiad.getString("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(",");
  2533. LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(olyRestrictedItems.length);
  2534. for (String id : olyRestrictedItems)
  2535. {
  2536. LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
  2537. }
  2538. ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1);
  2539. ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 120);
  2540. final File hexIdFile = new File(HEXID_FILE);
  2541. if (hexIdFile.exists())
  2542. {
  2543. final PropertiesParser hexId = new PropertiesParser(hexIdFile);
  2544. if (hexId.containskey("ServerID") && hexId.containskey("HexID"))
  2545. {
  2546. SERVER_ID = hexId.getInt("ServerID", 1);
  2547. try
  2548. {
  2549. HEX_ID = new BigInteger(hexId.getString("HexID", null), 16).toByteArray();
  2550. }
  2551. catch (Exception e)
  2552. {
  2553. _log.warning("Could not load HexID file (" + HEXID_FILE + "). Hopefully login will give us one.");
  2554. }
  2555. }
  2556. else
  2557. {
  2558. _log.warning("Could not load HexID file (" + HEXID_FILE + "). Hopefully login will give us one.");
  2559. }
  2560. }
  2561. else
  2562. {
  2563. _log.warning("Could not load HexID file (" + HEXID_FILE + "). Hopefully login will give us one.");
  2564. }
  2565. // Grand bosses
  2566. final PropertiesParser GrandBossSettings = new PropertiesParser(GRANDBOSS_CONFIG_FILE);
  2567. ANTHARAS_WAIT_TIME = GrandBossSettings.getInt("AntharasWaitTime", 30);
  2568. ANTHARAS_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfAntharasSpawn", 264);
  2569. ANTHARAS_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfAntharasSpawn", 72);
  2570. VALAKAS_WAIT_TIME = GrandBossSettings.getInt("ValakasWaitTime", 30);
  2571. VALAKAS_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfValakasSpawn", 264);
  2572. VALAKAS_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfValakasSpawn", 72);
  2573. BAIUM_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfBaiumSpawn", 168);
  2574. BAIUM_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfBaiumSpawn", 48);
  2575. CORE_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfCoreSpawn", 60);
  2576. CORE_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfCoreSpawn", 24);
  2577. ORFEN_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfOrfenSpawn", 48);
  2578. ORFEN_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfOrfenSpawn", 20);
  2579. QUEEN_ANT_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfQueenAntSpawn", 36);
  2580. QUEEN_ANT_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfQueenAntSpawn", 17);
  2581. BELETH_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfBelethSpawn", 192);
  2582. BELETH_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfBelethSpawn", 148);
  2583. BELETH_MIN_PLAYERS = GrandBossSettings.getInt("BelethMinPlayers", 36);
  2584. // Gracia Seeds
  2585. final PropertiesParser GraciaSeedsSettings = new PropertiesParser(GRACIASEEDS_CONFIG_FILE);
  2586. // Seed of Destruction
  2587. SOD_TIAT_KILL_COUNT = GraciaSeedsSettings.getInt("TiatKillCountForNextState", 10);
  2588. SOD_STAGE_2_LENGTH = GraciaSeedsSettings.getLong("Stage2Length", 720) * 60000;
  2589. final File chat_filter = new File(CHAT_FILTER_FILE);
  2590. try (FileReader fr = new FileReader(chat_filter);
  2591. BufferedReader br = new BufferedReader(fr);
  2592. LineNumberReader lnr = new LineNumberReader(br))
  2593. {
  2594. FILTER_LIST = new ArrayList<>();
  2595. String line = null;
  2596. while ((line = lnr.readLine()) != null)
  2597. {
  2598. if (line.trim().isEmpty() || (line.charAt(0) == '#'))
  2599. {
  2600. continue;
  2601. }
  2602. FILTER_LIST.add(line.trim());
  2603. }
  2604. _log.info("Loaded " + FILTER_LIST.size() + " Filter Words.");
  2605. }
  2606. catch (Exception e)
  2607. {
  2608. _log.log(Level.WARNING, "Error while loading chat filter words!", e);
  2609. }
  2610. final PropertiesParser ClanHallSiege = new PropertiesParser(CH_SIEGE_FILE);
  2611. CHS_MAX_ATTACKERS = ClanHallSiege.getInt("MaxAttackers", 500);
  2612. CHS_CLAN_MINLEVEL = ClanHallSiege.getInt("MinClanLevel", 4);
  2613. CHS_MAX_FLAGS_PER_CLAN = ClanHallSiege.getInt("MaxFlagsPerClan", 1);
  2614. CHS_ENABLE_FAME = ClanHallSiege.getBoolean("EnableFame", false);
  2615. CHS_FAME_AMOUNT = ClanHallSiege.getInt("FameAmount", 0);
  2616. CHS_FAME_FREQUENCY = ClanHallSiege.getInt("FameFrequency", 0);
  2617. }
  2618. else if (Server.serverMode == Server.MODE_LOGINSERVER)
  2619. {
  2620. final PropertiesParser ServerSettings = new PropertiesParser(LOGIN_CONFIGURATION_FILE);
  2621. ENABLE_UPNP = ServerSettings.getBoolean("EnableUPnP", true);
  2622. GAME_SERVER_LOGIN_HOST = ServerSettings.getString("LoginHostname", "127.0.0.1");
  2623. GAME_SERVER_LOGIN_PORT = ServerSettings.getInt("LoginPort", 9013);
  2624. LOGIN_BIND_ADDRESS = ServerSettings.getString("LoginserverHostname", "*");
  2625. PORT_LOGIN = ServerSettings.getInt("LoginserverPort", 2106);
  2626. try
  2627. {
  2628. DATAPACK_ROOT = new File(ServerSettings.getString("DatapackRoot", ".").replaceAll("\\\\", "/")).getCanonicalFile();
  2629. }
  2630. catch (IOException e)
  2631. {
  2632. _log.log(Level.WARNING, "Error setting datapack root!", e);
  2633. DATAPACK_ROOT = new File(".");
  2634. }
  2635. DEBUG = ServerSettings.getBoolean("Debug", false);
  2636. ACCEPT_NEW_GAMESERVER = ServerSettings.getBoolean("AcceptNewGameServer", true);
  2637. LOGIN_TRY_BEFORE_BAN = ServerSettings.getInt("LoginTryBeforeBan", 5);
  2638. LOGIN_BLOCK_AFTER_BAN = ServerSettings.getInt("LoginBlockAfterBan", 900);
  2639. LOGIN_SERVER_SCHEDULE_RESTART = ServerSettings.getBoolean("LoginRestartSchedule", false);
  2640. LOGIN_SERVER_SCHEDULE_RESTART_TIME = ServerSettings.getLong("LoginRestartTime", 24);
  2641. DATABASE_DRIVER = ServerSettings.getString("Driver", "com.mysql.jdbc.Driver");
  2642. DATABASE_URL = ServerSettings.getString("URL", "jdbc:mysql://localhost/l2jls");
  2643. DATABASE_LOGIN = ServerSettings.getString("Login", "root");
  2644. DATABASE_PASSWORD = ServerSettings.getString("Password", "");
  2645. DATABASE_MAX_CONNECTIONS = ServerSettings.getInt("MaximumDbConnections", 10);
  2646. DATABASE_MAX_IDLE_TIME = ServerSettings.getInt("MaximumDbIdleTime", 0);
  2647. CONNECTION_CLOSE_TIME = ServerSettings.getLong("ConnectionCloseTime", 60000);
  2648. SHOW_LICENCE = ServerSettings.getBoolean("ShowLicence", true);
  2649. AUTO_CREATE_ACCOUNTS = ServerSettings.getBoolean("AutoCreateAccounts", true);
  2650. FLOOD_PROTECTION = ServerSettings.getBoolean("EnableFloodProtection", true);
  2651. FAST_CONNECTION_LIMIT = ServerSettings.getInt("FastConnectionLimit", 15);
  2652. NORMAL_CONNECTION_TIME = ServerSettings.getInt("NormalConnectionTime", 700);
  2653. FAST_CONNECTION_TIME = ServerSettings.getInt("FastConnectionTime", 350);
  2654. MAX_CONNECTION_PER_IP = ServerSettings.getInt("MaxConnectionPerIP", 50);
  2655. // MMO
  2656. final PropertiesParser mmoSettings = new PropertiesParser(MMO_CONFIG_FILE);
  2657. MMO_SELECTOR_SLEEP_TIME = mmoSettings.getInt("SleepTime", 20);
  2658. MMO_MAX_SEND_PER_PASS = mmoSettings.getInt("MaxSendPerPass", 12);
  2659. MMO_MAX_READ_PER_PASS = mmoSettings.getInt("MaxReadPerPass", 12);
  2660. MMO_HELPER_BUFFER_COUNT = mmoSettings.getInt("HelperBufferCount", 20);
  2661. MMO_TCP_NODELAY = mmoSettings.getBoolean("TcpNoDelay", false);
  2662. // Load Telnet L2Properties file (if exists)
  2663. final PropertiesParser telnetSettings = new PropertiesParser(TELNET_FILE);
  2664. IS_TELNET_ENABLED = telnetSettings.getBoolean("EnableTelnet", false);
  2665. // Email
  2666. final PropertiesParser emailSettings = new PropertiesParser(EMAIL_CONFIG_FILE);
  2667. EMAIL_SERVERINFO_NAME = emailSettings.getString("ServerInfoName", "Unconfigured L2J Server");
  2668. EMAIL_SERVERINFO_ADDRESS = emailSettings.getString("ServerInfoAddress", "info@myl2jserver.com");
  2669. EMAIL_SYS_ENABLED = emailSettings.getBoolean("EmailSystemEnabled", false);
  2670. EMAIL_SYS_HOST = emailSettings.getString("SmtpServerHost", "smtp.gmail.com");
  2671. EMAIL_SYS_PORT = emailSettings.getInt("SmtpServerPort", 465);
  2672. EMAIL_SYS_SMTP_AUTH = emailSettings.getBoolean("SmtpAuthRequired", true);
  2673. EMAIL_SYS_FACTORY = emailSettings.getString("SmtpFactory", "javax.net.ssl.SSLSocketFactory");
  2674. EMAIL_SYS_FACTORY_CALLBACK = emailSettings.getBoolean("SmtpFactoryCallback", false);
  2675. EMAIL_SYS_USERNAME = emailSettings.getString("SmtpUsername", "user@gmail.com");
  2676. EMAIL_SYS_PASSWORD = emailSettings.getString("SmtpPassword", "password");
  2677. EMAIL_SYS_ADDRESS = emailSettings.getString("EmailSystemAddress", "noreply@myl2jserver.com");
  2678. EMAIL_SYS_SELECTQUERY = emailSettings.getString("EmailDBSelectQuery", "SELECT value FROM account_data WHERE account_name=? AND var='email_addr'");
  2679. EMAIL_SYS_DBFIELD = emailSettings.getString("EmailDBField", "value");
  2680. }
  2681. else
  2682. {
  2683. _log.severe("Could not Load Config: server mode was not set!");
  2684. }
  2685. }
  2686. /**
  2687. * Set a new value to a config parameter.
  2688. * @param pName the name of the parameter whose value to change
  2689. * @param pValue the new value of the parameter
  2690. * @return {@code true} if the value of the parameter was changed, {@code false} otherwise
  2691. */
  2692. public static boolean setParameterValue(String pName, String pValue)
  2693. {
  2694. switch (pName.trim().toLowerCase())
  2695. {
  2696. // rates.properties
  2697. case "ratexp":
  2698. RATE_XP = Float.parseFloat(pValue);
  2699. break;
  2700. case "ratesp":
  2701. RATE_SP = Float.parseFloat(pValue);
  2702. break;
  2703. case "ratepartyxp":
  2704. RATE_PARTY_XP = Float.parseFloat(pValue);
  2705. break;
  2706. case "rateextractable":
  2707. RATE_EXTRACTABLE = Float.parseFloat(pValue);
  2708. break;
  2709. case "ratedropadena":
  2710. RATE_DROP_AMOUNT_MULTIPLIER.put(Inventory.ADENA_ID, Float.parseFloat(pValue));
  2711. break;
  2712. case "ratedropmanor":
  2713. RATE_DROP_MANOR = Integer.parseInt(pValue);
  2714. break;
  2715. case "ratequestdrop":
  2716. RATE_QUEST_DROP = Float.parseFloat(pValue);
  2717. break;
  2718. case "ratequestreward":
  2719. RATE_QUEST_REWARD = Float.parseFloat(pValue);
  2720. break;
  2721. case "ratequestrewardxp":
  2722. RATE_QUEST_REWARD_XP = Float.parseFloat(pValue);
  2723. break;
  2724. case "ratequestrewardsp":
  2725. RATE_QUEST_REWARD_SP = Float.parseFloat(pValue);
  2726. break;
  2727. case "ratequestrewardadena":
  2728. RATE_QUEST_REWARD_ADENA = Float.parseFloat(pValue);
  2729. break;
  2730. case "usequestrewardmultipliers":
  2731. RATE_QUEST_REWARD_USE_MULTIPLIERS = Boolean.parseBoolean(pValue);
  2732. break;
  2733. case "ratequestrewardpotion":
  2734. RATE_QUEST_REWARD_POTION = Float.parseFloat(pValue);
  2735. break;
  2736. case "ratequestrewardscroll":
  2737. RATE_QUEST_REWARD_SCROLL = Float.parseFloat(pValue);
  2738. break;
  2739. case "ratequestrewardrecipe":
  2740. RATE_QUEST_REWARD_RECIPE = Float.parseFloat(pValue);
  2741. break;
  2742. case "ratequestrewardmaterial":
  2743. RATE_QUEST_REWARD_MATERIAL = Float.parseFloat(pValue);
  2744. break;
  2745. case "ratehellboundtrustincrease":
  2746. RATE_HB_TRUST_INCREASE = Float.parseFloat(pValue);
  2747. break;
  2748. case "ratehellboundtrustdecrease":
  2749. RATE_HB_TRUST_DECREASE = Float.parseFloat(pValue);
  2750. break;
  2751. case "ratevitalitylevel1":
  2752. RATE_VITALITY_LEVEL_1 = Float.parseFloat(pValue);
  2753. break;
  2754. case "ratevitalitylevel2":
  2755. RATE_VITALITY_LEVEL_2 = Float.parseFloat(pValue);
  2756. break;
  2757. case "ratevitalitylevel3":
  2758. RATE_VITALITY_LEVEL_3 = Float.parseFloat(pValue);
  2759. break;
  2760. case "ratevitalitylevel4":
  2761. RATE_VITALITY_LEVEL_4 = Float.parseFloat(pValue);
  2762. break;
  2763. case "raterecoverypeacezone":
  2764. RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(pValue);
  2765. break;
  2766. case "ratevitalitylost":
  2767. RATE_VITALITY_LOST = Float.parseFloat(pValue);
  2768. break;
  2769. case "ratevitalitygain":
  2770. RATE_VITALITY_GAIN = Float.parseFloat(pValue);
  2771. break;
  2772. case "raterecoveryonreconnect":
  2773. RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(pValue);
  2774. break;
  2775. case "ratekarmaexplost":
  2776. RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
  2777. break;
  2778. case "ratesiegeguardsprice":
  2779. RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
  2780. break;
  2781. case "ratecommonherbs":
  2782. RATE_DROP_COMMON_HERBS = Float.parseFloat(pValue);
  2783. break;
  2784. case "ratehpherbs":
  2785. RATE_DROP_HP_HERBS = Float.parseFloat(pValue);
  2786. break;
  2787. case "ratempherbs":
  2788. RATE_DROP_MP_HERBS = Float.parseFloat(pValue);
  2789. break;
  2790. case "ratespecialherbs":
  2791. RATE_DROP_SPECIAL_HERBS = Float.parseFloat(pValue);
  2792. break;
  2793. case "ratevitalityherbs":
  2794. RATE_DROP_VITALITY_HERBS = Float.parseFloat(pValue);
  2795. break;
  2796. case "playerdroplimit":
  2797. PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
  2798. break;
  2799. case "playerratedrop":
  2800. PLAYER_RATE_DROP = Integer.parseInt(pValue);
  2801. break;
  2802. case "playerratedropitem":
  2803. PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2804. break;
  2805. case "playerratedropequip":
  2806. PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2807. break;
  2808. case "playerratedropequipweapon":
  2809. PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2810. break;
  2811. case "petxprate":
  2812. PET_XP_RATE = Float.parseFloat(pValue);
  2813. break;
  2814. case "petfoodrate":
  2815. PET_FOOD_RATE = Integer.parseInt(pValue);
  2816. break;
  2817. case "sineaterxprate":
  2818. SINEATER_XP_RATE = Float.parseFloat(pValue);
  2819. break;
  2820. case "karmadroplimit":
  2821. KARMA_DROP_LIMIT = Integer.parseInt(pValue);
  2822. break;
  2823. case "karmaratedrop":
  2824. KARMA_RATE_DROP = Integer.parseInt(pValue);
  2825. break;
  2826. case "karmaratedropitem":
  2827. KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
  2828. break;
  2829. case "karmaratedropequip":
  2830. KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  2831. break;
  2832. case "karmaratedropequipweapon":
  2833. KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  2834. break;
  2835. case "autodestroydroppeditemafter":
  2836. AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
  2837. break;
  2838. case "destroyplayerdroppeditem":
  2839. DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2840. break;
  2841. case "destroyequipableitem":
  2842. DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(pValue);
  2843. break;
  2844. case "savedroppeditem":
  2845. SAVE_DROPPED_ITEM = Boolean.parseBoolean(pValue);
  2846. break;
  2847. case "emptydroppeditemtableafterload":
  2848. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(pValue);
  2849. break;
  2850. case "savedroppediteminterval":
  2851. SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
  2852. break;
  2853. case "cleardroppeditemtable":
  2854. CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(pValue);
  2855. break;
  2856. case "precisedropcalculation":
  2857. PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
  2858. break;
  2859. case "multipleitemdrop":
  2860. MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
  2861. break;
  2862. case "lowweight":
  2863. LOW_WEIGHT = Float.parseFloat(pValue);
  2864. break;
  2865. case "mediumweight":
  2866. MEDIUM_WEIGHT = Float.parseFloat(pValue);
  2867. break;
  2868. case "highweight":
  2869. HIGH_WEIGHT = Float.parseFloat(pValue);
  2870. break;
  2871. case "advanceddiagonalstrategy":
  2872. ADVANCED_DIAGONAL_STRATEGY = Boolean.parseBoolean(pValue);
  2873. break;
  2874. case "diagonalweight":
  2875. DIAGONAL_WEIGHT = Float.parseFloat(pValue);
  2876. break;
  2877. case "maxpostfilterpasses":
  2878. MAX_POSTFILTER_PASSES = Integer.parseInt(pValue);
  2879. break;
  2880. case "coordsynchronize":
  2881. COORD_SYNCHRONIZE = Integer.parseInt(pValue);
  2882. break;
  2883. case "deletecharafterdays":
  2884. DELETE_DAYS = Integer.parseInt(pValue);
  2885. break;
  2886. case "clientpacketqueuesize":
  2887. CLIENT_PACKET_QUEUE_SIZE = Integer.parseInt(pValue);
  2888. if (CLIENT_PACKET_QUEUE_SIZE == 0)
  2889. {
  2890. CLIENT_PACKET_QUEUE_SIZE = MMO_MAX_READ_PER_PASS + 1;
  2891. }
  2892. break;
  2893. case "clientpacketqueuemaxburstsize":
  2894. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = Integer.parseInt(pValue);
  2895. if (CLIENT_PACKET_QUEUE_MAX_BURST_SIZE == 0)
  2896. {
  2897. CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = MMO_MAX_READ_PER_PASS;
  2898. }
  2899. break;
  2900. case "clientpacketqueuemaxpacketspersecond":
  2901. CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND = Integer.parseInt(pValue);
  2902. break;
  2903. case "clientpacketqueuemeasureinterval":
  2904. CLIENT_PACKET_QUEUE_MEASURE_INTERVAL = Integer.parseInt(pValue);
  2905. break;
  2906. case "clientpacketqueuemaxaveragepacketspersecond":
  2907. CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND = Integer.parseInt(pValue);
  2908. break;
  2909. case "clientpacketqueuemaxfloodspermin":
  2910. CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN = Integer.parseInt(pValue);
  2911. break;
  2912. case "clientpacketqueuemaxoverflowspermin":
  2913. CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN = Integer.parseInt(pValue);
  2914. break;
  2915. case "clientpacketqueuemaxunderflowspermin":
  2916. CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = Integer.parseInt(pValue);
  2917. break;
  2918. case "clientpacketqueuemaxunknownpermin":
  2919. CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = Integer.parseInt(pValue);
  2920. break;
  2921. case "allowdiscarditem":
  2922. ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
  2923. break;
  2924. case "allowrefund":
  2925. ALLOW_REFUND = Boolean.parseBoolean(pValue);
  2926. break;
  2927. case "allowwarehouse":
  2928. ALLOW_WAREHOUSE = Boolean.parseBoolean(pValue);
  2929. break;
  2930. case "allowwear":
  2931. ALLOW_WEAR = Boolean.parseBoolean(pValue);
  2932. break;
  2933. case "weardelay":
  2934. WEAR_DELAY = Integer.parseInt(pValue);
  2935. break;
  2936. case "wearprice":
  2937. WEAR_PRICE = Integer.parseInt(pValue);
  2938. break;
  2939. case "allowwater":
  2940. ALLOW_WATER = Boolean.parseBoolean(pValue);
  2941. break;
  2942. case "allowrentpet":
  2943. ALLOW_RENTPET = Boolean.parseBoolean(pValue);
  2944. break;
  2945. case "boatbroadcastradius":
  2946. BOAT_BROADCAST_RADIUS = Integer.parseInt(pValue);
  2947. break;
  2948. case "allowcursedweapons":
  2949. ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(pValue);
  2950. break;
  2951. case "allowmanor":
  2952. ALLOW_MANOR = Boolean.parseBoolean(pValue);
  2953. break;
  2954. case "allowpetwalkers":
  2955. ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
  2956. break;
  2957. case "communitytype":
  2958. COMMUNITY_TYPE = Integer.parseInt(pValue);
  2959. break;
  2960. case "bbsshowplayerlist":
  2961. BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
  2962. break;
  2963. case "bbsdefault":
  2964. BBS_DEFAULT = pValue;
  2965. break;
  2966. case "showleveloncommunityboard":
  2967. SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  2968. break;
  2969. case "showstatusoncommunityboard":
  2970. SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
  2971. break;
  2972. case "namepagesizeoncommunityboard":
  2973. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
  2974. break;
  2975. case "nameperrowoncommunityboard":
  2976. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
  2977. break;
  2978. case "showservernews":
  2979. SERVER_NEWS = Boolean.parseBoolean(pValue);
  2980. break;
  2981. case "shownpclevel":
  2982. SHOW_NPC_LVL = Boolean.parseBoolean(pValue);
  2983. break;
  2984. case "showcrestwithoutquest":
  2985. SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(pValue);
  2986. break;
  2987. case "forceinventoryupdate":
  2988. FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);
  2989. break;
  2990. case "autodeleteinvalidquestdata":
  2991. AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(pValue);
  2992. break;
  2993. case "maximumonlineusers":
  2994. MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
  2995. break;
  2996. case "peacezonemode":
  2997. PEACE_ZONE_MODE = Integer.parseInt(pValue);
  2998. break;
  2999. case "checkknownlist":
  3000. CHECK_KNOWN = Boolean.parseBoolean(pValue);
  3001. break;
  3002. case "maxdriftrange":
  3003. MAX_DRIFT_RANGE = Integer.parseInt(pValue);
  3004. break;
  3005. case "usedeepbluedroprules":
  3006. DEEPBLUE_DROP_RULES = Boolean.parseBoolean(pValue);
  3007. break;
  3008. case "usedeepbluedroprulesraid":
  3009. DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(pValue);
  3010. break;
  3011. case "guardattackaggromob":
  3012. GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(pValue);
  3013. break;
  3014. case "maximumslotsfornodwarf":
  3015. INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
  3016. break;
  3017. case "maximumslotsfordwarf":
  3018. INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
  3019. break;
  3020. case "maximumslotsforgmplayer":
  3021. INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
  3022. break;
  3023. case "maximumslotsforquestitems":
  3024. INVENTORY_MAXIMUM_QUEST_ITEMS = Integer.parseInt(pValue);
  3025. break;
  3026. case "maximumwarehouseslotsfornodwarf":
  3027. WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
  3028. break;
  3029. case "maximumwarehouseslotsfordwarf":
  3030. WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
  3031. break;
  3032. case "maximumwarehouseslotsforclan":
  3033. WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
  3034. break;
  3035. case "enchantchanceelementstone":
  3036. ENCHANT_CHANCE_ELEMENT_STONE = Double.parseDouble(pValue);
  3037. break;
  3038. case "enchantchanceelementcrystal":
  3039. ENCHANT_CHANCE_ELEMENT_CRYSTAL = Double.parseDouble(pValue);
  3040. break;
  3041. case "enchantchanceelementjewel":
  3042. ENCHANT_CHANCE_ELEMENT_JEWEL = Double.parseDouble(pValue);
  3043. break;
  3044. case "enchantchanceelementenergy":
  3045. ENCHANT_CHANCE_ELEMENT_ENERGY = Double.parseDouble(pValue);
  3046. break;
  3047. case "augmentationngskillchance":
  3048. AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(pValue);
  3049. break;
  3050. case "augmentationngglowchance":
  3051. AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(pValue);
  3052. break;
  3053. case "augmentationmidskillchance":
  3054. AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(pValue);
  3055. break;
  3056. case "augmentationmidglowchance":
  3057. AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(pValue);
  3058. break;
  3059. case "augmentationhighskillchance":
  3060. AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(pValue);
  3061. break;
  3062. case "augmentationhighglowchance":
  3063. AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(pValue);
  3064. break;
  3065. case "augmentationtopskillchance":
  3066. AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(pValue);
  3067. break;
  3068. case "augmentationtopglowchance":
  3069. AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(pValue);
  3070. break;
  3071. case "augmentationbasestatchance":
  3072. AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(pValue);
  3073. break;
  3074. case "hpregenmultiplier":
  3075. HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3076. break;
  3077. case "mpregenmultiplier":
  3078. MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3079. break;
  3080. case "cpregenmultiplier":
  3081. CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3082. break;
  3083. case "raidhpregenmultiplier":
  3084. RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3085. break;
  3086. case "raidmpregenmultiplier":
  3087. RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  3088. break;
  3089. case "raidpdefencemultiplier":
  3090. RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) / 100;
  3091. break;
  3092. case "raidmdefencemultiplier":
  3093. RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) / 100;
  3094. break;
  3095. case "raidpattackmultiplier":
  3096. RAID_PATTACK_MULTIPLIER = Double.parseDouble(pValue) / 100;
  3097. break;
  3098. case "raidmattackmultiplier":
  3099. RAID_MATTACK_MULTIPLIER = Double.parseDouble(pValue) / 100;
  3100. break;
  3101. case "raidminionrespawntime":
  3102. RAID_MINION_RESPAWN_TIMER = Integer.parseInt(pValue);
  3103. break;
  3104. case "raidchaostime":
  3105. RAID_CHAOS_TIME = Integer.parseInt(pValue);
  3106. break;
  3107. case "grandchaostime":
  3108. GRAND_CHAOS_TIME = Integer.parseInt(pValue);
  3109. break;
  3110. case "minionchaostime":
  3111. MINION_CHAOS_TIME = Integer.parseInt(pValue);
  3112. break;
  3113. case "startingadena":
  3114. STARTING_ADENA = Long.parseLong(pValue);
  3115. break;
  3116. case "startinglevel":
  3117. STARTING_LEVEL = Byte.parseByte(pValue);
  3118. break;
  3119. case "startingsp":
  3120. STARTING_SP = Integer.parseInt(pValue);
  3121. break;
  3122. case "unstuckinterval":
  3123. UNSTUCK_INTERVAL = Integer.parseInt(pValue);
  3124. break;
  3125. case "teleportwatchdogtimeout":
  3126. TELEPORT_WATCHDOG_TIMEOUT = Integer.parseInt(pValue);
  3127. break;
  3128. case "playerspawnprotection":
  3129. PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
  3130. break;
  3131. case "playerfakedeathupprotection":
  3132. PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
  3133. break;
  3134. case "restoreplayerinstance":
  3135. RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(pValue);
  3136. break;
  3137. case "allowsummontoinstance":
  3138. ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(pValue);
  3139. break;
  3140. case "partyxpcutoffmethod":
  3141. PARTY_XP_CUTOFF_METHOD = pValue;
  3142. break;
  3143. case "partyxpcutoffpercent":
  3144. PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
  3145. break;
  3146. case "partyxpcutofflevel":
  3147. PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
  3148. break;
  3149. case "respawnrestorecp":
  3150. RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
  3151. break;
  3152. case "respawnrestorehp":
  3153. RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
  3154. break;
  3155. case "respawnrestoremp":
  3156. RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
  3157. break;
  3158. case "maxpvtstoresellslotsdwarf":
  3159. MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(pValue);
  3160. break;
  3161. case "maxpvtstoresellslotsother":
  3162. MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(pValue);
  3163. break;
  3164. case "maxpvtstorebuyslotsdwarf":
  3165. MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(pValue);
  3166. break;
  3167. case "maxpvtstorebuyslotsother":
  3168. MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(pValue);
  3169. break;
  3170. case "storeskillcooltime":
  3171. STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  3172. break;
  3173. case "subclassstoreskillcooltime":
  3174. SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
  3175. break;
  3176. case "announcemammonspawn":
  3177. ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(pValue);
  3178. break;
  3179. case "altgametiredness":
  3180. ALT_GAME_TIREDNESS = Boolean.parseBoolean(pValue);
  3181. break;
  3182. case "enablefallingdamage":
  3183. ENABLE_FALLING_DAMAGE = Boolean.parseBoolean(pValue);
  3184. break;
  3185. case "altgamecreation":
  3186. ALT_GAME_CREATION = Boolean.parseBoolean(pValue);
  3187. break;
  3188. case "altgamecreationspeed":
  3189. ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
  3190. break;
  3191. case "altgamecreationxprate":
  3192. ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
  3193. break;
  3194. case "altgamecreationrarexpsprate":
  3195. ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(pValue);
  3196. break;
  3197. case "altgamecreationsprate":
  3198. ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
  3199. break;
  3200. case "altweightlimit":
  3201. ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
  3202. break;
  3203. case "altblacksmithuserecipes":
  3204. ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(pValue);
  3205. break;
  3206. case "altgameskilllearn":
  3207. ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(pValue);
  3208. break;
  3209. case "removecastlecirclets":
  3210. REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
  3211. break;
  3212. case "reputationscoreperkill":
  3213. REPUTATION_SCORE_PER_KILL = Integer.parseInt(pValue);
  3214. break;
  3215. case "altgamecancelbyhit":
  3216. ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
  3217. ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
  3218. break;
  3219. case "altshieldblocks":
  3220. ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(pValue);
  3221. break;
  3222. case "altperfectshieldblockrate":
  3223. ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
  3224. break;
  3225. case "delevel":
  3226. ALT_GAME_DELEVEL = Boolean.parseBoolean(pValue);
  3227. break;
  3228. case "magicfailures":
  3229. ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(pValue);
  3230. break;
  3231. case "altmobagroinpeacezone":
  3232. ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  3233. break;
  3234. case "altgameexponentxp":
  3235. ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
  3236. break;
  3237. case "altgameexponentsp":
  3238. ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
  3239. break;
  3240. case "allowclassmasters":
  3241. ALLOW_CLASS_MASTERS = Boolean.parseBoolean(pValue);
  3242. break;
  3243. case "allowentiretree":
  3244. ALLOW_ENTIRE_TREE = Boolean.parseBoolean(pValue);
  3245. break;
  3246. case "alternateclassmaster":
  3247. ALTERNATE_CLASS_MASTER = Boolean.parseBoolean(pValue);
  3248. break;
  3249. case "altpartyrange":
  3250. ALT_PARTY_RANGE = Integer.parseInt(pValue);
  3251. break;
  3252. case "altpartyrange2":
  3253. ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
  3254. break;
  3255. case "altleavepartyleader":
  3256. ALT_LEAVE_PARTY_LEADER = Boolean.parseBoolean(pValue);
  3257. break;
  3258. case "craftingenabled":
  3259. IS_CRAFTING_ENABLED = Boolean.parseBoolean(pValue);
  3260. break;
  3261. case "craftmasterwork":
  3262. CRAFT_MASTERWORK = Boolean.parseBoolean(pValue);
  3263. break;
  3264. case "lifecrystalneeded":
  3265. LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
  3266. break;
  3267. case "autoloot":
  3268. AUTO_LOOT = Boolean.parseBoolean(pValue);
  3269. break;
  3270. case "autolootraids":
  3271. AUTO_LOOT_RAIDS = Boolean.parseBoolean(pValue);
  3272. break;
  3273. case "autolootherbs":
  3274. AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);
  3275. break;
  3276. case "altkarmaplayercanbekilledinpeacezone":
  3277. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
  3278. break;
  3279. case "altkarmaplayercanshop":
  3280. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(pValue);
  3281. break;
  3282. case "altkarmaplayercanusegk":
  3283. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(pValue);
  3284. break;
  3285. case "altkarmaplayercanteleport":
  3286. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pValue);
  3287. break;
  3288. case "altkarmaplayercantrade":
  3289. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pValue);
  3290. break;
  3291. case "altkarmaplayercanusewarehouse":
  3292. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pValue);
  3293. break;
  3294. case "maxpersonalfamepoints":
  3295. MAX_PERSONAL_FAME_POINTS = Integer.parseInt(pValue);
  3296. break;
  3297. case "fortresszonefametaskfrequency":
  3298. FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  3299. break;
  3300. case "fortresszonefameaquirepoints":
  3301. FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  3302. break;
  3303. case "castlezonefametaskfrequency":
  3304. CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
  3305. break;
  3306. case "castlezonefameaquirepoints":
  3307. CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
  3308. break;
  3309. case "altcastlefordawn":
  3310. ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(pValue);
  3311. break;
  3312. case "altcastlefordusk":
  3313. ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(pValue);
  3314. break;
  3315. case "altrequireclancastle":
  3316. ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(pValue);
  3317. break;
  3318. case "altfreeteleporting":
  3319. ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(pValue);
  3320. break;
  3321. case "altsubclasswithoutquests":
  3322. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
  3323. break;
  3324. case "altsubclasseverywhere":
  3325. ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(pValue);
  3326. break;
  3327. case "altmemberscanwithdrawfromclanwh":
  3328. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
  3329. break;
  3330. case "dwarfrecipelimit":
  3331. DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
  3332. break;
  3333. case "commonrecipelimit":
  3334. COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
  3335. break;
  3336. case "championenable":
  3337. L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(pValue);
  3338. break;
  3339. case "championfrequency":
  3340. L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
  3341. break;
  3342. case "championminlevel":
  3343. L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
  3344. break;
  3345. case "championmaxlevel":
  3346. L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
  3347. break;
  3348. case "championhp":
  3349. L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
  3350. break;
  3351. case "championhpregen":
  3352. L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
  3353. break;
  3354. case "championrewards":
  3355. L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
  3356. break;
  3357. case "championadenasrewards":
  3358. L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(pValue);
  3359. break;
  3360. case "championatk":
  3361. L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
  3362. break;
  3363. case "championspdatk":
  3364. L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
  3365. break;
  3366. case "championrewardlowerlvlitemchance":
  3367. L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  3368. break;
  3369. case "championrewardhigherlvlitemchance":
  3370. L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
  3371. break;
  3372. case "championrewarditemid":
  3373. L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
  3374. break;
  3375. case "championrewarditemqty":
  3376. L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
  3377. break;
  3378. case "championenableininstances":
  3379. L2JMOD_CHAMPION_ENABLE_IN_INSTANCES = Boolean.parseBoolean(pValue);
  3380. break;
  3381. case "allowwedding":
  3382. L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(pValue);
  3383. break;
  3384. case "weddingprice":
  3385. L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
  3386. break;
  3387. case "weddingpunishinfidelity":
  3388. L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
  3389. break;
  3390. case "weddingteleport":
  3391. L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
  3392. break;
  3393. case "weddingteleportprice":
  3394. L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
  3395. break;
  3396. case "weddingteleportduration":
  3397. L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
  3398. break;
  3399. case "weddingallowsamesex":
  3400. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
  3401. break;
  3402. case "weddingformalwear":
  3403. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
  3404. break;
  3405. case "weddingdivorcecosts":
  3406. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
  3407. break;
  3408. case "tvteventenabled":
  3409. TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  3410. break;
  3411. case "tvteventinterval":
  3412. TVT_EVENT_INTERVAL = pValue.split(",");
  3413. break;
  3414. case "tvteventparticipationtime":
  3415. TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  3416. break;
  3417. case "tvteventrunningtime":
  3418. TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  3419. break;
  3420. case "tvteventparticipationnpcid":
  3421. TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  3422. break;
  3423. case "enablewarehousesortingclan":
  3424. L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
  3425. break;
  3426. case "enablewarehousesortingprivate":
  3427. L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
  3428. break;
  3429. case "enablemanapotionsupport":
  3430. L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(pValue);
  3431. break;
  3432. case "displayservertime":
  3433. L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(pValue);
  3434. break;
  3435. case "antifeedenable":
  3436. L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(pValue);
  3437. break;
  3438. case "antifeeddualbox":
  3439. L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(pValue);
  3440. break;
  3441. case "antifeeddisconnectedasdualbox":
  3442. L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(pValue);
  3443. break;
  3444. case "antifeedinterval":
  3445. L2JMOD_ANTIFEED_INTERVAL = 1000 * Integer.parseInt(pValue);
  3446. break;
  3447. case "cangmdropequipment":
  3448. KARMA_DROP_GM = Boolean.parseBoolean(pValue);
  3449. break;
  3450. case "awardpkkillpvppoint":
  3451. KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pValue);
  3452. break;
  3453. case "minimumpkrequiredtodrop":
  3454. KARMA_PK_LIMIT = Integer.parseInt(pValue);
  3455. break;
  3456. case "pvpvsnormaltime":
  3457. PVP_NORMAL_TIME = Integer.parseInt(pValue);
  3458. break;
  3459. case "pvpvspvptime":
  3460. PVP_PVP_TIME = Integer.parseInt(pValue);
  3461. break;
  3462. case "globalchat":
  3463. DEFAULT_GLOBAL_CHAT = pValue;
  3464. break;
  3465. case "tradechat":
  3466. DEFAULT_TRADE_CHAT = pValue;
  3467. break;
  3468. default:
  3469. try
  3470. {
  3471. // TODO: stupid GB configs...
  3472. if (!pName.startsWith("Interval_") && !pName.startsWith("Random_"))
  3473. {
  3474. pName = pName.toUpperCase();
  3475. }
  3476. Field clazField = Config.class.getField(pName);
  3477. int modifiers = clazField.getModifiers();
  3478. // just in case :)
  3479. if (!Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers) || Modifier.isFinal(modifiers))
  3480. {
  3481. throw new SecurityException("Cannot modify non public, non static or final config!");
  3482. }
  3483. if (clazField.getType() == int.class)
  3484. {
  3485. clazField.setInt(clazField, Integer.parseInt(pValue));
  3486. }
  3487. else if (clazField.getType() == short.class)
  3488. {
  3489. clazField.setShort(clazField, Short.parseShort(pValue));
  3490. }
  3491. else if (clazField.getType() == byte.class)
  3492. {
  3493. clazField.setByte(clazField, Byte.parseByte(pValue));
  3494. }
  3495. else if (clazField.getType() == long.class)
  3496. {
  3497. clazField.setLong(clazField, Long.parseLong(pValue));
  3498. }
  3499. else if (clazField.getType() == float.class)
  3500. {
  3501. clazField.setFloat(clazField, Float.parseFloat(pValue));
  3502. }
  3503. else if (clazField.getType() == double.class)
  3504. {
  3505. clazField.setDouble(clazField, Double.parseDouble(pValue));
  3506. }
  3507. else if (clazField.getType() == boolean.class)
  3508. {
  3509. clazField.setBoolean(clazField, Boolean.parseBoolean(pValue));
  3510. }
  3511. else if (clazField.getType() == String.class)
  3512. {
  3513. clazField.set(clazField, pValue);
  3514. }
  3515. else
  3516. {
  3517. return false;
  3518. }
  3519. }
  3520. catch (NoSuchFieldException e)
  3521. {
  3522. return false;
  3523. }
  3524. catch (Exception e)
  3525. {
  3526. _log.log(Level.WARNING, "", e);
  3527. return false;
  3528. }
  3529. }
  3530. return true;
  3531. }
  3532. /**
  3533. * Save hexadecimal ID of the server in the L2Properties file.<br>
  3534. * Check {@link #HEXID_FILE}.
  3535. * @param serverId the ID of the server whose hexId to save
  3536. * @param hexId the hexadecimal ID to store
  3537. */
  3538. public static void saveHexid(int serverId, String hexId)
  3539. {
  3540. Config.saveHexid(serverId, hexId, HEXID_FILE);
  3541. }
  3542. /**
  3543. * Save hexadecimal ID of the server in the L2Properties file.
  3544. * @param serverId the ID of the server whose hexId to save
  3545. * @param hexId the hexadecimal ID to store
  3546. * @param fileName name of the L2Properties file
  3547. */
  3548. public static void saveHexid(int serverId, String hexId, String fileName)
  3549. {
  3550. try
  3551. {
  3552. Properties hexSetting = new Properties();
  3553. File file = new File(fileName);
  3554. // Create a new empty file only if it doesn't exist
  3555. file.createNewFile();
  3556. try (OutputStream out = new FileOutputStream(file))
  3557. {
  3558. hexSetting.setProperty("ServerID", String.valueOf(serverId));
  3559. hexSetting.setProperty("HexID", hexId);
  3560. hexSetting.store(out, "the hexID to auth into login");
  3561. }
  3562. }
  3563. catch (Exception e)
  3564. {
  3565. _log.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
  3566. _log.warning("Config: " + e.getMessage());
  3567. }
  3568. }
  3569. /**
  3570. * Loads flood protector configurations.
  3571. * @param properties the properties object containing the actual values of the flood protector configs
  3572. */
  3573. private static void loadFloodProtectorConfigs(final PropertiesParser properties)
  3574. {
  3575. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", 4);
  3576. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", 42);
  3577. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", 42);
  3578. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", 16);
  3579. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", 100);
  3580. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", 5);
  3581. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", 20);
  3582. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", 10);
  3583. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", 5);
  3584. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", 1);
  3585. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", 10);
  3586. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANUFACTURE, "Manufacture", 3);
  3587. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANOR, "Manor", 30);
  3588. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SENDMAIL, "SendMail", 100);
  3589. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_CHARACTER_SELECT, "CharacterSelect", 30);
  3590. loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_AUCTION, "ItemAuction", 9);
  3591. }
  3592. /**
  3593. * Loads single flood protector configuration.
  3594. * @param properties properties file reader
  3595. * @param config flood protector configuration instance
  3596. * @param configString flood protector configuration string that determines for which flood protector configuration should be read
  3597. * @param defaultInterval default flood protector interval
  3598. */
  3599. private static void loadFloodProtectorConfig(final PropertiesParser properties, final FloodProtectorConfig config, final String configString, final int defaultInterval)
  3600. {
  3601. config.FLOOD_PROTECTION_INTERVAL = properties.getInt(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval);
  3602. config.LOG_FLOODING = properties.getBoolean(StringUtil.concat("FloodProtector", configString, "LogFlooding"), false);
  3603. config.PUNISHMENT_LIMIT = properties.getInt(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), 0);
  3604. config.PUNISHMENT_TYPE = properties.getString(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
  3605. config.PUNISHMENT_TIME = properties.getInt(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), 0) * 60000;
  3606. }
  3607. public static int getServerTypeId(String[] serverTypes)
  3608. {
  3609. int tType = 0;
  3610. for (String cType : serverTypes)
  3611. {
  3612. switch (cType.trim().toLowerCase())
  3613. {
  3614. case "Normal":
  3615. tType |= 0x01;
  3616. break;
  3617. case "Relax":
  3618. tType |= 0x02;
  3619. break;
  3620. case "Test":
  3621. tType |= 0x04;
  3622. break;
  3623. case "NoLabel":
  3624. tType |= 0x08;
  3625. break;
  3626. case "Restricted":
  3627. tType |= 0x10;
  3628. break;
  3629. case "Event":
  3630. tType |= 0x20;
  3631. break;
  3632. case "Free":
  3633. tType |= 0x40;
  3634. break;
  3635. default:
  3636. break;
  3637. }
  3638. }
  3639. return tType;
  3640. }
  3641. public static final class ClassMasterSettings
  3642. {
  3643. private final Map<Integer, List<ItemHolder>> _claimItems = new HashMap<>(3);
  3644. private final Map<Integer, List<ItemHolder>> _rewardItems = new HashMap<>(3);
  3645. private final Map<Integer, Boolean> _allowedClassChange = new HashMap<>(3);
  3646. public ClassMasterSettings(String configLine)
  3647. {
  3648. parseConfigLine(configLine.trim());
  3649. }
  3650. private void parseConfigLine(String configLine)
  3651. {
  3652. if (configLine.isEmpty())
  3653. {
  3654. return;
  3655. }
  3656. final StringTokenizer st = new StringTokenizer(configLine, ";");
  3657. while (st.hasMoreTokens())
  3658. {
  3659. // get allowed class change
  3660. final int job = Integer.parseInt(st.nextToken());
  3661. _allowedClassChange.put(job, true);
  3662. final List<ItemHolder> requiredItems = new ArrayList<>();
  3663. // parse items needed for class change
  3664. if (st.hasMoreTokens())
  3665. {
  3666. final StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  3667. while (st2.hasMoreTokens())
  3668. {
  3669. final StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  3670. final int itemId = Integer.parseInt(st3.nextToken());
  3671. final int quantity = Integer.parseInt(st3.nextToken());
  3672. requiredItems.add(new ItemHolder(itemId, quantity));
  3673. }
  3674. }
  3675. _claimItems.put(job, requiredItems);
  3676. final List<ItemHolder> rewardItems = new ArrayList<>();
  3677. // parse gifts after class change
  3678. if (st.hasMoreTokens())
  3679. {
  3680. final StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
  3681. while (st2.hasMoreTokens())
  3682. {
  3683. final StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
  3684. final int itemId = Integer.parseInt(st3.nextToken());
  3685. final int quantity = Integer.parseInt(st3.nextToken());
  3686. rewardItems.add(new ItemHolder(itemId, quantity));
  3687. }
  3688. }
  3689. _rewardItems.put(job, rewardItems);
  3690. }
  3691. }
  3692. public boolean isAllowed(int job)
  3693. {
  3694. if ((_allowedClassChange == null) || !_allowedClassChange.containsKey(job))
  3695. {
  3696. return false;
  3697. }
  3698. return _allowedClassChange.get(job);
  3699. }
  3700. public List<ItemHolder> getRewardItems(int job)
  3701. {
  3702. return _rewardItems.get(job);
  3703. }
  3704. public List<ItemHolder> getRequireItems(int job)
  3705. {
  3706. return _claimItems.get(job);
  3707. }
  3708. }
  3709. /**
  3710. * @param line the string line to parse
  3711. * @return a parsed float map
  3712. */
  3713. private static Map<Integer, Float> parseConfigLine(String line)
  3714. {
  3715. String[] propertySplit = line.split(",");
  3716. Map<Integer, Float> ret = new HashMap<>(propertySplit.length);
  3717. int i = 0;
  3718. for (String value : propertySplit)
  3719. {
  3720. ret.put(i++, Float.parseFloat(value));
  3721. }
  3722. return ret;
  3723. }
  3724. /**
  3725. * Parse a config value from its string representation to a two-dimensional int array.<br>
  3726. * The format of the value to be parsed should be as follows: "item1Id,item1Amount;item2Id,item2Amount;...itemNId,itemNAmount".
  3727. * @param line the value of the parameter to parse
  3728. * @return the parsed list or {@code null} if nothing was parsed
  3729. */
  3730. private static int[][] parseItemsList(String line)
  3731. {
  3732. final String[] propertySplit = line.split(";");
  3733. if (propertySplit.length == 0)
  3734. {
  3735. // nothing to do here
  3736. return null;
  3737. }
  3738. int i = 0;
  3739. String[] valueSplit;
  3740. final int[][] result = new int[propertySplit.length][];
  3741. int[] tmp;
  3742. for (String value : propertySplit)
  3743. {
  3744. valueSplit = value.split(",");
  3745. if (valueSplit.length != 2)
  3746. {
  3747. _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid entry -> \"", valueSplit[0], "\", should be itemId,itemNumber. Skipping to the next entry in the list."));
  3748. continue;
  3749. }
  3750. tmp = new int[2];
  3751. try
  3752. {
  3753. tmp[0] = Integer.parseInt(valueSplit[0]);
  3754. }
  3755. catch (NumberFormatException e)
  3756. {
  3757. _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid itemId -> \"", valueSplit[0], "\", value must be an integer. Skipping to the next entry in the list."));
  3758. continue;
  3759. }
  3760. try
  3761. {
  3762. tmp[1] = Integer.parseInt(valueSplit[1]);
  3763. }
  3764. catch (NumberFormatException e)
  3765. {
  3766. _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid item number -> \"", valueSplit[1], "\", value must be an integer. Skipping to the next entry in the list."));
  3767. continue;
  3768. }
  3769. result[i++] = tmp;
  3770. }
  3771. return result;
  3772. }
  3773. private static class IPConfigData extends DocumentParser
  3774. {
  3775. private static final List<String> _subnets = new ArrayList<>(5);
  3776. private static final List<String> _hosts = new ArrayList<>(5);
  3777. public IPConfigData()
  3778. {
  3779. load();
  3780. }
  3781. @Override
  3782. public void load()
  3783. {
  3784. File f = new File(IP_CONFIG_FILE);
  3785. if (f.exists())
  3786. {
  3787. _log.log(Level.INFO, "Network Config: ipconfig.xml exists using manual configuration...");
  3788. parseFile(new File(IP_CONFIG_FILE));
  3789. }
  3790. else
  3791. // Auto configuration...
  3792. {
  3793. _log.log(Level.INFO, "Network Config: ipconfig.xml doesn't exists using automatic configuration...");
  3794. autoIpConfig();
  3795. }
  3796. }
  3797. @Override
  3798. protected void parseDocument()
  3799. {
  3800. NamedNodeMap attrs;
  3801. for (Node n = getCurrentDocument().getFirstChild(); n != null; n = n.getNextSibling())
  3802. {
  3803. if ("gameserver".equalsIgnoreCase(n.getNodeName()))
  3804. {
  3805. for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
  3806. {
  3807. if ("define".equalsIgnoreCase(d.getNodeName()))
  3808. {
  3809. attrs = d.getAttributes();
  3810. _subnets.add(attrs.getNamedItem("subnet").getNodeValue());
  3811. _hosts.add(attrs.getNamedItem("address").getNodeValue());
  3812. if (_hosts.size() != _subnets.size())
  3813. {
  3814. _log.log(Level.WARNING, "Failed to Load " + IP_CONFIG_FILE + " File - subnets does not match server addresses.");
  3815. }
  3816. }
  3817. }
  3818. Node att = n.getAttributes().getNamedItem("address");
  3819. if (att == null)
  3820. {
  3821. _log.log(Level.WARNING, "Failed to load " + IP_CONFIG_FILE + " file - default server address is missing.");
  3822. _hosts.add("127.0.0.1");
  3823. }
  3824. else
  3825. {
  3826. _hosts.add(att.getNodeValue());
  3827. }
  3828. _subnets.add("0.0.0.0/0");
  3829. }
  3830. }
  3831. }
  3832. protected void autoIpConfig()
  3833. {
  3834. String externalIp = "127.0.0.1";
  3835. try
  3836. {
  3837. URL autoIp = new URL("http://ip1.dynupdate.no-ip.com:8245/");
  3838. try (BufferedReader in = new BufferedReader(new InputStreamReader(autoIp.openStream())))
  3839. {
  3840. externalIp = in.readLine();
  3841. }
  3842. }
  3843. catch (IOException e)
  3844. {
  3845. _log.log(Level.INFO, "Network Config: Failed to connect to api.externalip.net please check your internet connection using 127.0.0.1!");
  3846. externalIp = "127.0.0.1";
  3847. }
  3848. try
  3849. {
  3850. Enumeration<NetworkInterface> niList = NetworkInterface.getNetworkInterfaces();
  3851. Subnet sub = new Subnet();
  3852. while (niList.hasMoreElements())
  3853. {
  3854. NetworkInterface ni = niList.nextElement();
  3855. if (!ni.isUp() || ni.isVirtual())
  3856. {
  3857. continue;
  3858. }
  3859. if (!ni.isLoopback() && ((ni.getHardwareAddress() == null) || (ni.getHardwareAddress().length != 6)))
  3860. {
  3861. continue;
  3862. }
  3863. for (InterfaceAddress ia : ni.getInterfaceAddresses())
  3864. {
  3865. if (ia.getAddress() instanceof Inet6Address)
  3866. {
  3867. continue;
  3868. }
  3869. sub.setIPAddress(ia.getAddress().getHostAddress());
  3870. sub.setMaskedBits(ia.getNetworkPrefixLength());
  3871. String subnet = sub.getSubnetAddress() + '/' + sub.getMaskedBits();
  3872. if (!_subnets.contains(subnet) && !subnet.equals("0.0.0.0/0"))
  3873. {
  3874. _subnets.add(subnet);
  3875. _hosts.add(sub.getIPAddress());
  3876. _log.log(Level.INFO, "Network Config: Adding new subnet: " + subnet + " address: " + sub.getIPAddress());
  3877. }
  3878. }
  3879. }
  3880. // External host and subnet
  3881. _hosts.add(externalIp);
  3882. _subnets.add("0.0.0.0/0");
  3883. _log.log(Level.INFO, "Network Config: Adding new subnet: 0.0.0.0/0 address: " + externalIp);
  3884. }
  3885. catch (SocketException e)
  3886. {
  3887. _log.log(Level.INFO, "Network Config: Configuration failed please configure manually using ipconfig.xml", e);
  3888. System.exit(0);
  3889. }
  3890. }
  3891. protected List<String> getSubnets()
  3892. {
  3893. if (_subnets.isEmpty())
  3894. {
  3895. return Arrays.asList("0.0.0.0/0");
  3896. }
  3897. return _subnets;
  3898. }
  3899. protected List<String> getHosts()
  3900. {
  3901. if (_hosts.isEmpty())
  3902. {
  3903. return Arrays.asList("127.0.0.1");
  3904. }
  3905. return _hosts;
  3906. }
  3907. }
  3908. }