Config.java 171 KB

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