Config.java 150 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License as published by
  4. * the Free Software Foundation; either version 2, or (at your option)
  5. * any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software
  14. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  15. * 02111-1307, USA.
  16. *
  17. * http://www.gnu.org/copyleft/gpl.html
  18. */
  19. package net.sf.l2j;
  20. import java.io.File;
  21. import java.io.FileInputStream;
  22. import java.io.FileOutputStream;
  23. import java.io.InputStream;
  24. import java.io.OutputStream;
  25. import java.math.BigInteger;
  26. import java.util.List;
  27. import java.util.Properties;
  28. import java.util.logging.Logger;
  29. import javolution.util.FastList;
  30. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  31. /**
  32. * This class contains global server configuration.<br>
  33. * It has static final fields initialized from configuration files.<br>
  34. * It's initialized at the very begin of startup, and later JIT will optimize
  35. * away debug/unused code.
  36. *
  37. * @author mkizub
  38. */
  39. public final class Config
  40. {
  41. protected static final Logger _log = Logger.getLogger(Config.class.getName());
  42. /** Debug/release mode */
  43. public static boolean DEBUG;
  44. /** Enable/disable assertions */
  45. public static boolean ASSERT;
  46. /** Enable/disable code 'in progress' */
  47. public static boolean DEVELOPER;
  48. /** Set if this server is a test server used for development */
  49. public static boolean TEST_SERVER;
  50. /** Game Server ports */
  51. public static int PORT_GAME;
  52. /** Login Server port */
  53. public static int PORT_LOGIN;
  54. /** Login Server bind ip */
  55. public static String LOGIN_BIND_ADDRESS;
  56. /** Number of login tries before IP ban gets activated, default 10*/
  57. public static int LOGIN_TRY_BEFORE_BAN;
  58. /** Number of seconds the IP ban will last, default 10 minutes */
  59. public static int LOGIN_BLOCK_AFTER_BAN;
  60. /** Hostname of the Game Server */
  61. public static String GAMESERVER_HOSTNAME;
  62. // Access to database
  63. /** Driver to access to database */
  64. public static String DATABASE_DRIVER;
  65. /** Path to access to database */
  66. public static String DATABASE_URL;
  67. /** Database login */
  68. public static String DATABASE_LOGIN;
  69. /** Database password */
  70. public static String DATABASE_PASSWORD;
  71. /** Maximum number of connections to the database */
  72. public static int DATABASE_MAX_CONNECTIONS;
  73. /** Maximum number of players allowed to play simultaneously on server */
  74. public static int MAXIMUM_ONLINE_USERS;
  75. // Setting for serverList
  76. /** Displays [] in front of server name ? */
  77. public static boolean SERVER_LIST_BRACKET;
  78. /** Displays a clock next to the server name ? */
  79. public static boolean SERVER_LIST_CLOCK;
  80. /** Display test server in the list of servers ? */
  81. public static boolean SERVER_LIST_TESTSERVER;
  82. /** Set the server as gm only at startup ? */
  83. public static boolean SERVER_GMONLY;
  84. // Thread pools size
  85. /** Thread pool size effect */
  86. public static int THREAD_P_EFFECTS;
  87. /** Thread pool size general */
  88. public static int THREAD_P_GENERAL;
  89. /** Packet max thread */
  90. public static int GENERAL_PACKET_THREAD_CORE_SIZE;
  91. public static int IO_PACKET_THREAD_CORE_SIZE;
  92. /** General max thread */
  93. public static int GENERAL_THREAD_CORE_SIZE;
  94. /** AI max thread */
  95. public static int AI_MAX_THREAD;
  96. /** Accept auto-loot ? */
  97. public static boolean AUTO_LOOT;
  98. public static boolean AUTO_LOOT_HERBS;
  99. /** Character name template */
  100. public static String CNAME_TEMPLATE;
  101. /** Pet name template */
  102. public static String PET_NAME_TEMPLATE;
  103. /** Maximum number of characters per account */
  104. public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
  105. /** Global chat state */
  106. public static String DEFAULT_GLOBAL_CHAT;
  107. /** Trade chat state */
  108. public static String DEFAULT_TRADE_CHAT;
  109. /** For test servers - everybody has admin rights */
  110. public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
  111. /** Alternative game crafting */
  112. public static boolean ALT_GAME_CREATION;
  113. /** Alternative game crafting speed mutiplier - default 0 (fastest but still not instant) */
  114. public static double ALT_GAME_CREATION_SPEED;
  115. /** Alternative game crafting XP rate multiplier - default 1*/
  116. public static double ALT_GAME_CREATION_XP_RATE;
  117. /** Alternative game crafting SP rate multiplier - default 1*/
  118. public static double ALT_GAME_CREATION_SP_RATE;
  119. /** Alternative setting to blacksmith use of recipes to craft - default true*/
  120. public static boolean ALT_BLACKSMITH_USE_RECIPES;
  121. /** Remove Castle circlets after clan lose his castle? - default true*/
  122. public static boolean REMOVE_CASTLE_CIRCLETS;
  123. /** Alternative game weight limit multiplier - default 1*/
  124. public static double ALT_WEIGHT_LIMIT;
  125. /** Alternative game skill learning */
  126. public static boolean ALT_GAME_SKILL_LEARN;
  127. /** Alternative auto skill learning */
  128. public static boolean AUTO_LEARN_SKILLS;
  129. /** Cancel attack bow by hit */
  130. public static boolean ALT_GAME_CANCEL_BOW;
  131. /** Cancel cast by hit */
  132. public static boolean ALT_GAME_CANCEL_CAST;
  133. /** Alternative game - use tiredness, instead of CP */
  134. public static boolean ALT_GAME_TIREDNESS;
  135. public static int ALT_PARTY_RANGE;
  136. public static int ALT_PARTY_RANGE2;
  137. /** Alternative shield defence */
  138. public static boolean ALT_GAME_SHIELD_BLOCKS;
  139. /** Alternative Perfect shield defence rate */
  140. public static int ALT_PERFECT_SHLD_BLOCK;
  141. /** Alternative game mob ATTACK AI */
  142. public static boolean ALT_GAME_MOB_ATTACK_AI;
  143. public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
  144. /** Alternative freight modes - Freights can be withdrawed from any village */
  145. public static boolean ALT_GAME_FREIGHTS;
  146. /** Alternative freight modes - Sets the price value for each freightened item */
  147. public static int ALT_GAME_FREIGHT_PRICE;
  148. /** Fast or slow multiply coefficient for skill hit time */
  149. public static float ALT_GAME_SKILL_HIT_RATE;
  150. /** Alternative gameing - loss of XP on death */
  151. public static boolean ALT_GAME_DELEVEL;
  152. /** Alternative gameing - magic dmg failures */
  153. public static boolean ALT_GAME_MAGICFAILURES;
  154. /** Alternative gaming - player must be in a castle-owning clan or ally to sign up for Dawn. */
  155. public static boolean ALT_GAME_REQUIRE_CASTLE_DAWN;
  156. /** Alternative gaming - allow clan-based castle ownage check rather than ally-based. */
  157. public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
  158. /** Alternative gaming - allow free teleporting around the world. */
  159. public static boolean ALT_GAME_FREE_TELEPORT;
  160. /** Disallow recommend character twice or more a day ? */
  161. public static boolean ALT_RECOMMEND;
  162. /** Alternative gaming - allow sub-class addition without quest completion. */
  163. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  164. /** View npc stats/drop by shift-cliking it for nongm-players */
  165. public static boolean ALT_GAME_VIEWNPC;
  166. /** Minimum number of player to participate in SevenSigns Festival */
  167. public static int ALT_FESTIVAL_MIN_PLAYER;
  168. /** Maximum of player contrib during Festival */
  169. public static int ALT_MAXIMUM_PLAYER_CONTRIB;
  170. /** Festival Manager start time. */
  171. public static long ALT_FESTIVAL_MANAGER_START;
  172. /** Festival Length */
  173. public static long ALT_FESTIVAL_LENGTH;
  174. /** Festival Cycle Length */
  175. public static long ALT_FESTIVAL_CYCLE_LENGTH;
  176. /** Festival First Spawn */
  177. public static long ALT_FESTIVAL_FIRST_SPAWN;
  178. /** Festival First Swarm */
  179. public static long ALT_FESTIVAL_FIRST_SWARM;
  180. /** Festival Second Spawn */
  181. public static long ALT_FESTIVAL_SECOND_SPAWN;
  182. /** Festival Second Swarm */
  183. public static long ALT_FESTIVAL_SECOND_SWARM;
  184. /** Festival Chest Spawn */
  185. public static long ALT_FESTIVAL_CHEST_SPAWN;
  186. /** Number of members needed to request a clan war */
  187. public static int ALT_CLAN_MEMBERS_FOR_WAR;
  188. /** Number of days before joining a new clan */
  189. public static int ALT_CLAN_JOIN_DAYS;
  190. /** Number of days before creating a new clan */
  191. public static int ALT_CLAN_CREATE_DAYS;
  192. /** Number of days it takes to dissolve a clan */
  193. public static int ALT_CLAN_DISSOLVE_DAYS;
  194. /** Number of days before joining a new alliance when clan voluntarily leave an alliance */
  195. public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
  196. /** Number of days before joining a new alliance when clan was dismissed from an alliance */
  197. public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
  198. /** Number of days before accepting a new clan for alliance when clan was dismissed from an alliance */
  199. public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
  200. /** Number of days before creating a new alliance when dissolved an alliance */
  201. public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
  202. /** Alternative gaming - all new characters always are newbies. */
  203. public static boolean ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE;
  204. /** Alternative gaming - clan members with see privilege can also withdraw from clan warehouse. */
  205. public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
  206. /** Alternative gaming - Castle Shield can be equiped by all clan members if they own a castle. - default True */
  207. public static boolean CASTLE_SHIELD;
  208. /** Alternative gaming - Clan Hall Shield can be equiped by all clan members if they own a clan hall. - default True */
  209. public static boolean CLANHALL_SHIELD;
  210. /** Alternative gaming - Apella armors can be equiped only by clan members if their class is Baron or higher - default True */
  211. public static boolean APELLA_ARMORS;
  212. /** Alternative gaming - Clan Oath Armors can be equiped only by clan members - default True */
  213. public static boolean OATH_ARMORS;
  214. /** Alternative gaming - Castle Crown can be equiped only by castle lord - default True */
  215. public static boolean CASTLE_CROWN;
  216. /** Alternative gaming - Castle Circlets can be equiped only by clan members if they own a castle - default True */
  217. public static boolean CASTLE_CIRCLETS;
  218. /** Maximum number of clans in ally */
  219. public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
  220. /** Life Crystal needed to learn clan skill */
  221. public static boolean LIFE_CRYSTAL_NEEDED;
  222. /** Spell Book needed to learn skill */
  223. public static boolean SP_BOOK_NEEDED;
  224. /** Spell Book needet to enchant skill */
  225. public static boolean ES_SP_BOOK_NEEDED;
  226. /** Logging Chat Window */
  227. public static boolean LOG_CHAT;
  228. /** Logging Item Window */
  229. public static boolean LOG_ITEMS;
  230. /** Alternative privileges for admin */
  231. public static boolean ALT_PRIVILEGES_ADMIN;
  232. /** Alternative secure check privileges */
  233. public static boolean ALT_PRIVILEGES_SECURE_CHECK;
  234. /** Alternative default level for privileges */
  235. public static int ALT_PRIVILEGES_DEFAULT_LEVEL;
  236. /** Olympiad Competition Starting time */
  237. public static int ALT_OLY_START_TIME;
  238. /** Olympiad Minutes */
  239. public static int ALT_OLY_MIN;
  240. /** Olympiad Competition Period */
  241. public static long ALT_OLY_CPERIOD;
  242. /** Olympiad Battle Period */
  243. public static long ALT_OLY_BATTLE;
  244. /** Olympiad Battle Wait */
  245. public static long ALT_OLY_BWAIT;
  246. /** Olympiad Inital Wait */
  247. public static long ALT_OLY_IWAIT;
  248. /** Olympaid Weekly Period */
  249. public static long ALT_OLY_WPERIOD;
  250. /** Olympaid Validation Period */
  251. public static long ALT_OLY_VPERIOD;
  252. /** Manor Refresh Starting time */
  253. public static int ALT_MANOR_REFRESH_TIME;
  254. /** Manor Refresh Min */
  255. public static int ALT_MANOR_REFRESH_MIN;
  256. /** Manor Next Period Approve Starting time */
  257. public static int ALT_MANOR_APPROVE_TIME;
  258. /** Manor Next Period Approve Min */
  259. public static int ALT_MANOR_APPROVE_MIN;
  260. /** Manor Maintenance Time */
  261. public static int ALT_MANOR_MAINTENANCE_PERIOD;
  262. /** Manor Save All Actions */
  263. public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
  264. /** Manor Save Period Rate */
  265. public static int ALT_MANOR_SAVE_PERIOD_RATE;
  266. /** Initial Lottery prize */
  267. public static int ALT_LOTTERY_PRIZE;
  268. /** Lottery Ticket Price */
  269. public static int ALT_LOTTERY_TICKET_PRICE;
  270. /** What part of jackpot amount should receive characters who pick 5 wining numbers */
  271. public static float ALT_LOTTERY_5_NUMBER_RATE;
  272. /** What part of jackpot amount should receive characters who pick 4 wining numbers */
  273. public static float ALT_LOTTERY_4_NUMBER_RATE;
  274. /** What part of jackpot amount should receive characters who pick 3 wining numbers */
  275. public static float ALT_LOTTERY_3_NUMBER_RATE;
  276. /** How much adena receive characters who pick two or less of the winning number */
  277. public static int ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
  278. /** Minimum siz e of a party that may enter dimensional rift */
  279. public static int RIFT_MIN_PARTY_SIZE;
  280. /** Time in ms the party has to wait until the mobs spawn when entering a room */
  281. public static int RIFT_SPAWN_DELAY;
  282. /** Amount of random rift jumps before party is ported back */
  283. public static int RIFT_MAX_JUMPS;
  284. /** Random time between two jumps in dimensional rift - in seconds */
  285. public static int RIFT_AUTO_JUMPS_TIME_MIN;
  286. public static int RIFT_AUTO_JUMPS_TIME_MAX;
  287. /** Dimensional Fragment cost for entering rift */
  288. public static int RIFT_ENTER_COST_RECRUIT;
  289. public static int RIFT_ENTER_COST_SOLDIER;
  290. public static int RIFT_ENTER_COST_OFFICER;
  291. public static int RIFT_ENTER_COST_CAPTAIN;
  292. public static int RIFT_ENTER_COST_COMMANDER;
  293. public static int RIFT_ENTER_COST_HERO;
  294. /** time multiplier for boss room */
  295. public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
  296. /* **************************************************************************
  297. * GM CONFIG General GM AccessLevel *
  298. ************************************************************************* */
  299. /** General GM access level */
  300. public static int GM_ACCESSLEVEL;
  301. /** General GM Minimal AccessLevel */
  302. public static int GM_MIN;
  303. /** Minimum privileges level for a GM to do Alt+G*/
  304. public static int GM_ALTG_MIN_LEVEL;
  305. /** General GM AccessLevel to change announcements */
  306. public static int GM_ANNOUNCE;
  307. /** General GM AccessLevel can /ban /unban */
  308. public static int GM_BAN;
  309. /** General GM AccessLevel can /ban /unban for chat */
  310. public static int GM_BAN_CHAT;
  311. /** General GM AccessLevel can /create_item and /gmshop */
  312. public static int GM_CREATE_ITEM;
  313. /** General GM AccessLevel can /delete */
  314. public static int GM_DELETE;
  315. /** General GM AccessLevel can /kick /disconnect */
  316. public static int GM_KICK;
  317. /** General GM AccessLevel for access to GMMenu */
  318. public static int GM_MENU;
  319. /** General GM AccessLevel to use god mode command */
  320. public static int GM_GODMODE;
  321. /** General GM AccessLevel with character edit rights */
  322. public static int GM_CHAR_EDIT;
  323. /** General GM AccessLevel with edit rights for other characters */
  324. public static int GM_CHAR_EDIT_OTHER;
  325. /** General GM AccessLevel with character view rights */
  326. public static int GM_CHAR_VIEW;
  327. /** General GM AccessLevel with NPC edit rights */
  328. public static int GM_NPC_EDIT;
  329. public static int GM_NPC_VIEW;
  330. /** General GM AccessLevel to teleport to any location */
  331. public static int GM_TELEPORT;
  332. /** General GM AccessLevel to teleport character to any location */
  333. public static int GM_TELEPORT_OTHER;
  334. /** General GM AccessLevel to restart server */
  335. public static int GM_RESTART;
  336. /** General GM AccessLevel for MonsterRace */
  337. public static int GM_MONSTERRACE;
  338. /** General GM AccessLevel to ride Wyvern */
  339. public static int GM_RIDER;
  340. /** General GM AccessLevel to unstuck without 5min delay */
  341. public static int GM_ESCAPE;
  342. /** General GM AccessLevel to resurect fixed after death */
  343. public static int GM_FIXED;
  344. /** General GM AccessLevel to create Path Nodes */
  345. public static int GM_CREATE_NODES;
  346. /** General GM AccessLevel with Enchant rights */
  347. public static int GM_ENCHANT;
  348. /** General GM AccessLevel to close/open Doors */
  349. public static int GM_DOOR;
  350. /** General GM AccessLevel with Resurrection rights */
  351. public static int GM_RES;
  352. /** General GM AccessLevel to attack in the peace zone */
  353. public static int GM_PEACEATTACK;
  354. /** General GM AccessLevel to heal */
  355. public static int GM_HEAL;
  356. /** General GM AccessLevel to unblock IPs detected as hack IPs */
  357. public static int GM_UNBLOCK;
  358. /** General GM AccessLevel to use Cache commands */
  359. public static int GM_CACHE;
  360. /** General GM AccessLevel to use test&st commands */
  361. public static int GM_TALK_BLOCK;
  362. public static int GM_TEST;
  363. /** Disable transaction on AccessLevel **/
  364. public static boolean GM_DISABLE_TRANSACTION;
  365. /** GM transactions disabled from this range */
  366. public static int GM_TRANSACTION_MIN;
  367. /** GM transactions disabled to this range */
  368. public static int GM_TRANSACTION_MAX;
  369. /** Minimum level to allow a GM giving damage */
  370. public static int GM_CAN_GIVE_DAMAGE;
  371. /** Minimum level to don't give Exp/Sp in party */
  372. public static int GM_DONT_TAKE_EXPSP;
  373. /** Minimum level to don't take aggro */
  374. public static int GM_DONT_TAKE_AGGRO;
  375. public static int GM_REPAIR = 75;
  376. /* Rate control */
  377. /** Rate for eXperience Point rewards */
  378. public static float RATE_XP;
  379. /** Rate for Skill Point rewards */
  380. public static float RATE_SP;
  381. /** Rate for party eXperience Point rewards */
  382. public static float RATE_PARTY_XP;
  383. /** Rate for party Skill Point rewards */
  384. public static float RATE_PARTY_SP;
  385. /** Rate for Quest rewards (XP and SP) */
  386. public static float RATE_QUESTS_REWARD;
  387. /** Rate for drop adena */
  388. public static float RATE_DROP_ADENA;
  389. /** Rate for cost of consumable */
  390. public static float RATE_CONSUMABLE_COST;
  391. /** Rate for dropped items */
  392. public static float RATE_DROP_ITEMS;
  393. /** Rate for spoiled items */
  394. public static float RATE_DROP_SPOIL;
  395. /** Rate for manored items */
  396. public static int RATE_DROP_MANOR;
  397. /** Rate for quest items */
  398. public static float RATE_DROP_QUEST;
  399. /** Rate for karma and experience lose */
  400. public static float RATE_KARMA_EXP_LOST;
  401. /** Rate siege guards prices */
  402. public static float RATE_SIEGE_GUARDS_PRICE;
  403. /*Alternative Xp/Sp rewards, if not 0, then calculated as 2^((mob.level-player.level) / coef),
  404. * A few examples for "AltGameExponentXp = 5." and "AltGameExponentSp = 3."
  405. * diff = 0 (player and mob has the same level), XP bonus rate = 1, SP bonus rate = 1
  406. * diff = 3 (mob is 3 levels above), XP bonus rate = 1.52, SP bonus rate = 2
  407. * diff = 5 (mob is 5 levels above), XP bonus rate = 2, SP bonus rate = 3.17
  408. * diff = -8 (mob is 8 levels below), XP bonus rate = 0.4, SP bonus rate = 0.16 */
  409. /** Alternative eXperience Point rewards */
  410. public static float ALT_GAME_EXPONENT_XP;
  411. /** Alternative Spirit Point rewards */
  412. public static float ALT_GAME_EXPONENT_SP;
  413. /** Rate Common herbs */
  414. public static float RATE_DROP_COMMON_HERBS;
  415. /** Rate MP/HP herbs */
  416. public static float RATE_DROP_MP_HP_HERBS;
  417. /** Rate Common herbs */
  418. public static float RATE_DROP_GREATER_HERBS;
  419. /** Rate Common herbs */
  420. public static float RATE_DROP_SUPERIOR_HERBS;
  421. /** Rate Common herbs */
  422. public static float RATE_DROP_SPECIAL_HERBS;
  423. // Player Drop Rate control
  424. /** Limit for player drop */
  425. public static int PLAYER_DROP_LIMIT;
  426. /** Rate for drop */
  427. public static int PLAYER_RATE_DROP;
  428. /** Rate for player's item drop */
  429. public static int PLAYER_RATE_DROP_ITEM;
  430. /** Rate for player's equipment drop */
  431. public static int PLAYER_RATE_DROP_EQUIP;
  432. /** Rate for player's equipment and weapon drop */
  433. public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
  434. // Pet Rates (Multipliers)
  435. /** Rate for experience rewards of the pet */
  436. public static float PET_XP_RATE;
  437. /** Rate for food consumption of the pet */
  438. public static int PET_FOOD_RATE;
  439. /** Rate for experience rewards of the Sin Eater */
  440. public static float SINEATER_XP_RATE;
  441. // Karma Drop Rate control
  442. /** Karma drop limit */
  443. public static int KARMA_DROP_LIMIT;
  444. /** Karma drop rate */
  445. public static int KARMA_RATE_DROP;
  446. /** Karma drop rate for item */
  447. public static int KARMA_RATE_DROP_ITEM;
  448. /** Karma drop rate for equipment */
  449. public static int KARMA_RATE_DROP_EQUIP;
  450. /** Karma drop rate for equipment and weapon */
  451. public static int KARMA_RATE_DROP_EQUIP_WEAPON;
  452. /** Time after which item will auto-destroy */
  453. public static int AUTODESTROY_ITEM_AFTER;
  454. /** Auto destroy herb time */
  455. public static int HERB_AUTO_DESTROY_TIME;
  456. /** List of items that will not be destroyed (seperated by ",") */
  457. public static String PROTECTED_ITEMS;
  458. /** List of items that will not be destroyed */
  459. public static List<Integer> LIST_PROTECTED_ITEMS = new FastList<Integer>();
  460. /** Auto destroy nonequipable items dropped by players */
  461. public static boolean DESTROY_DROPPED_PLAYER_ITEM;
  462. /** Auto destroy equipable items dropped by players */
  463. public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
  464. /** Save items on ground for restoration on server restart */
  465. public static boolean SAVE_DROPPED_ITEM;
  466. /** Empty table ItemsOnGround after load all items */
  467. public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
  468. /** Time interval to save into db items on ground */
  469. public static int SAVE_DROPPED_ITEM_INTERVAL;
  470. /** Clear all items stored in ItemsOnGround table */
  471. public static boolean CLEAR_DROPPED_ITEM_TABLE;
  472. /** Accept precise drop calculation ? */
  473. public static boolean PRECISE_DROP_CALCULATION;
  474. /** Accept multi-items drop ? */
  475. public static boolean MULTIPLE_ITEM_DROP;
  476. /** This is setting of experimental Client <--> Server Player coordinates synchronization<br>
  477. * <b><u>Valeurs :</u></b>
  478. * <li>0 - no synchronization at all</li>
  479. * <li>1 - parcial synchronization Client --> Server only * using this option it is difficult for players
  480. * to bypass obstacles</li>
  481. * <li>2 - parcial synchronization Server --> Client only</li>
  482. * <li>3 - full synchronization Client <--> Server</li>
  483. * <li>-1 - Old system: will synchronize Z only</li>
  484. */
  485. public static int COORD_SYNCHRONIZE;
  486. /** Period in days after which character is deleted */
  487. public static int DELETE_DAYS;
  488. /** Datapack root directory */
  489. public static File DATAPACK_ROOT;
  490. /** Maximum range mobs can randomly go from spawn point */
  491. public static int MAX_DRIFT_RANGE;
  492. /** Allow fishing ? */
  493. public static boolean ALLOWFISHING;
  494. /** Allow Manor system */
  495. public static boolean ALLOW_MANOR;
  496. /** Jail config **/
  497. public static boolean JAIL_IS_PVP;
  498. public static boolean JAIL_DISABLE_CHAT;
  499. /** Enumeration describing values for Allowing the use of L2Walker client */
  500. public static enum L2WalkerAllowed
  501. {
  502. True,
  503. False,
  504. GM
  505. }
  506. /** Allow the use of L2Walker client ? */
  507. public static L2WalkerAllowed ALLOW_L2WALKER_CLIENT;
  508. /** Auto-ban client that use L2Walker ? */
  509. public static boolean AUTOBAN_L2WALKER_ACC;
  510. /** Revision of L2Walker */
  511. public static int L2WALKER_REVISION;
  512. /** FloodProtector initial capacity */
  513. public static int FLOODPROTECTOR_INITIALSIZE;
  514. /** Allow Discard item ?*/
  515. public static boolean ALLOW_DISCARDITEM;
  516. /** Allow freight ? */
  517. public static boolean ALLOW_FREIGHT;
  518. /** Allow warehouse ? */
  519. public static boolean ALLOW_WAREHOUSE;
  520. /** Allow warehouse cache? */
  521. public static boolean WAREHOUSE_CACHE;
  522. /** How long store WH datas */
  523. public static int WAREHOUSE_CACHE_TIME;
  524. /** Allow wear ? (try on in shop) */
  525. public static boolean ALLOW_WEAR;
  526. /** Duration of the try on after which items are taken back */
  527. public static int WEAR_DELAY;
  528. /** Price of the try on of one item */
  529. public static int WEAR_PRICE;
  530. /** Allow lottery ? */
  531. public static boolean ALLOW_LOTTERY;
  532. /** Allow race ? */
  533. public static boolean ALLOW_RACE;
  534. /** Allow water ? */
  535. public static boolean ALLOW_WATER;
  536. /** Allow rent pet ? */
  537. public static boolean ALLOW_RENTPET;
  538. /** Allow boat ? */
  539. public static boolean ALLOW_BOAT;
  540. /** Allow cursed weapons ? */
  541. public static boolean ALLOW_CURSED_WEAPONS;
  542. //WALKER NPC
  543. public static boolean ALLOW_NPC_WALKERS;
  544. /** Time after which a packet is considered as lost */
  545. public static int PACKET_LIFETIME;
  546. // Pets
  547. /** Speed of Weverns */
  548. public static int WYVERN_SPEED;
  549. /** Speed of Striders */
  550. public static int STRIDER_SPEED;
  551. /** Allow Wyvern Upgrader ? */
  552. public static boolean ALLOW_WYVERN_UPGRADER;
  553. // protocol revision
  554. /** Minimal protocol revision */
  555. public static int MIN_PROTOCOL_REVISION;
  556. /** Maximal protocol revision */
  557. public static int MAX_PROTOCOL_REVISION;
  558. // random animation interval
  559. /** Minimal time between 2 animations of a NPC */
  560. public static int MIN_NPC_ANIMATION;
  561. /** Maximal time between 2 animations of a NPC */
  562. public static int MAX_NPC_ANIMATION;
  563. /** Minimal time between animations of a MONSTER */
  564. public static int MIN_MONSTER_ANIMATION;
  565. /** Maximal time between animations of a MONSTER */
  566. public static int MAX_MONSTER_ANIMATION;
  567. /** Activate position recorder ? */
  568. public static boolean ACTIVATE_POSITION_RECORDER;
  569. /** Use 3D Map ? */
  570. public static boolean USE_3D_MAP;
  571. // Community Board
  572. /** Type of community */
  573. public static String COMMUNITY_TYPE;
  574. public static String BBS_DEFAULT;
  575. /** Show level of the community board ? */
  576. public static boolean SHOW_LEVEL_COMMUNITYBOARD;
  577. /** Show status of the community board ? */
  578. public static boolean SHOW_STATUS_COMMUNITYBOARD;
  579. /** Size of the name page on the community board */
  580. public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
  581. /** Name per row on community board */
  582. public static int NAME_PER_ROW_COMMUNITYBOARD;
  583. // Configuration files
  584. /** Properties file that allows selection of new Classes for storage of World Objects.
  585. * <br>This may help servers with large amounts of players recieving error messages related to
  586. * the <i>L2ObjectHashMap</i> and <i>L2ObejctHashSet</i> classes.*/
  587. /** Properties file for game server (connection and ingame) configurations */
  588. public static final String CONFIGURATION_FILE = "./config/server.properties";
  589. /** Properties file for game server options */
  590. public static final String OPTIONS_FILE = "./config/options.properties";
  591. /** Properties file for login server configurations */
  592. public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
  593. /** Properties file for the ID factory */
  594. public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
  595. /** Properties file for other configurations */
  596. public static final String OTHER_CONFIG_FILE = "./config/other.properties";
  597. /** Properties file for rates configurations */
  598. public static final String RATES_CONFIG_FILE = "./config/rates.properties";
  599. /** Properties file for alternative configuration */
  600. public static final String ALT_SETTINGS_FILE = "./config/altsettings.properties";
  601. /** Properties file for PVP configurations */
  602. public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
  603. /** Properties file for GM access configurations */
  604. public static final String GM_ACCESS_FILE = "./config/GMAccess.properties";
  605. /** Properties file for telnet configuration */
  606. public static final String TELNET_FILE = "./config/telnet.properties";
  607. /** Properties file for l2j server version configurations */
  608. public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
  609. /** Properties file for l2j datapack version configurations */
  610. public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
  611. /** Properties file for siege configuration */
  612. public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
  613. /** XML file for banned IP */
  614. public static final String BANNED_IP_XML = "./config/banned.xml";
  615. /** Text file containing hexadecimal value of server ID */
  616. public static final String HEXID_FILE = "./config/hexid.txt";
  617. /** Properties file for alternative configure GM commands access level.<br>
  618. * Note that this file only read if "AltPrivilegesAdmin = True" */
  619. public static final String COMMAND_PRIVILEGES_FILE = "./config/command-privileges.properties";
  620. /** Properties file for AI configurations */
  621. public static final String AI_FILE = "./config/ai.properties";
  622. /** Properties file for 7 Signs Festival */
  623. public static final String SEVENSIGNS_FILE = "./config/sevensigns.properties";
  624. public static final String CLANHALL_CONFIG_FILE = "./config/clanhall.properties";
  625. public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
  626. public static int MAX_ITEM_IN_PACKET;
  627. public static boolean CHECK_KNOWN;
  628. /** Game Server login port */
  629. public static int GAME_SERVER_LOGIN_PORT;
  630. /** Game Server login Host */
  631. public static String GAME_SERVER_LOGIN_HOST;
  632. /** Internal Hostname */
  633. public static String INTERNAL_HOSTNAME;
  634. /** External Hostname */
  635. public static String EXTERNAL_HOSTNAME;
  636. public static int PATH_NODE_RADIUS;
  637. public static int NEW_NODE_ID;
  638. public static int SELECTED_NODE_ID;
  639. public static int LINKED_NODE_ID;
  640. public static String NEW_NODE_TYPE;
  641. /** Show "data/html/servnews.htm" whenever a character enters world.*/
  642. public static boolean SERVER_NEWS;
  643. /** Show L2Monster level and aggro ? */
  644. public static boolean SHOW_NPC_LVL;
  645. /** Force full item inventory packet to be sent for any item change ?<br>
  646. * <u><i>Note:</i></u> This can increase network traffic*/
  647. public static boolean FORCE_INVENTORY_UPDATE;
  648. /** Disable the use of guards against agressive monsters ? */
  649. public static boolean ALLOW_GUARDS;
  650. /** Allow use Event Managers for change occupation ?*/
  651. public static boolean ALLOW_CLASS_MASTERS;
  652. /** Time between 2 updates of IP */
  653. public static int IP_UPDATE_TIME;
  654. // Server version
  655. /** Server version */
  656. public static String SERVER_VERSION;
  657. /** Date of server build */
  658. public static String SERVER_BUILD_DATE;
  659. // Datapack version
  660. /** Datapack version */
  661. public static String DATAPACK_VERSION;
  662. /** Zone Setting */
  663. public static int ZONE_TOWN;
  664. /** Crafting Enabled? */
  665. public static boolean IS_CRAFTING_ENABLED;
  666. // Inventory slots limit
  667. /** Maximum inventory slots limits for non dwarf characters */
  668. public static int INVENTORY_MAXIMUM_NO_DWARF;
  669. /** Maximum inventory slots limits for dwarf characters */
  670. public static int INVENTORY_MAXIMUM_DWARF;
  671. /** Maximum inventory slots limits for GM */
  672. public static int INVENTORY_MAXIMUM_GM;
  673. // Warehouse slots limits
  674. /** Maximum inventory slots limits for non dwarf warehouse */
  675. public static int WAREHOUSE_SLOTS_NO_DWARF;
  676. /** Maximum inventory slots limits for dwarf warehouse */
  677. public static int WAREHOUSE_SLOTS_DWARF;
  678. /** Maximum inventory slots limits for clan warehouse */
  679. public static int WAREHOUSE_SLOTS_CLAN;
  680. /** Maximum inventory slots limits for freight */
  681. public static int FREIGHT_SLOTS;
  682. // Karma System Variables
  683. /** Minimum karma gain/loss */
  684. public static int KARMA_MIN_KARMA;
  685. /** Maximum karma gain/loss */
  686. public static int KARMA_MAX_KARMA;
  687. /** Number to divide the xp recieved by, to calculate karma lost on xp gain/lost */
  688. public static int KARMA_XP_DIVIDER;
  689. /** The Minimum Karma lost if 0 karma is to be removed */
  690. public static int KARMA_LOST_BASE;
  691. /** Can a GM drop item ? */
  692. public static boolean KARMA_DROP_GM;
  693. /** Should award a pvp point for killing a player with karma ? */
  694. public static boolean KARMA_AWARD_PK_KILL;
  695. /** Minimum PK required to drop */
  696. public static int KARMA_PK_LIMIT;
  697. /** List of pet items that cannot be dropped (seperated by ",") when PVP */
  698. public static String KARMA_NONDROPPABLE_PET_ITEMS;
  699. /** List of items that cannot be dropped (seperated by ",") when PVP*/
  700. public static String KARMA_NONDROPPABLE_ITEMS;
  701. /** List of pet items that cannot be dropped when PVP */
  702. public static List<Integer> KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<Integer>();
  703. /** List of items that cannot be dropped when PVP */
  704. public static List<Integer> KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  705. /** List of items that cannot be dropped (seperated by ",") */
  706. public static String NONDROPPABLE_ITEMS;
  707. /** List of items that cannot be dropped */
  708. public static List<Integer> LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  709. /** List of NPCs that rent pets (seperated by ",") */
  710. public static String PET_RENT_NPC;
  711. /** List of NPCs that rent pets */
  712. public static List<Integer> LIST_PET_RENT_NPC = new FastList<Integer>();
  713. /** Duration (in ms) while a player stay in PVP mode after hitting an innocent */
  714. public static int PVP_NORMAL_TIME;
  715. /** Duration (in ms) while a player stay in PVP mode after hitting a purple player */
  716. public static int PVP_PVP_TIME;
  717. // Karma Punishment
  718. /** Allow player with karma to be killed in peace zone ? */
  719. public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
  720. /** Allow player with karma to shop ? */
  721. public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
  722. /** Allow player with karma to use gatekeepers ? */
  723. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
  724. /** Allow player with karma to use SOE or Return skill ? */
  725. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
  726. /** Allow player with karma to trade ? */
  727. public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
  728. /** Allow player with karma to use warehouse ?*/
  729. public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
  730. /**define L2JMODS */
  731. /** Champion Mod*/
  732. public static boolean L2JMOD_CHAMPION_ENABLE;
  733. public static int L2JMOD_CHAMPION_FREQUENCY;
  734. public static int L2JMOD_CHAMP_MIN_LVL;
  735. public static int L2JMOD_CHAMP_MAX_LVL;
  736. public static int L2JMOD_CHAMPION_HP;
  737. public static int L2JMOD_CHAMPION_REWARDS;
  738. public static int L2JMOD_CHAMPION_ADENAS_REWARDS;
  739. public static float L2JMOD_CHAMPION_HP_REGEN;
  740. public static float L2JMOD_CHAMPION_ATK;
  741. public static float L2JMOD_CHAMPION_SPD_ATK;
  742. public static int L2JMOD_CHAMPION_REWARD;
  743. public static int L2JMOD_CHAMPION_REWARD_ID;
  744. public static int L2JMOD_CHAMPION_REWARD_QTY;
  745. /** Team vs. Team Event Engine */
  746. public static boolean TVT_EVENT_ENABLED;
  747. public static int TVT_EVENT_INTERVAL;
  748. public static int TVT_EVENT_PARTICIPATION_TIME;
  749. public static int TVT_EVENT_RUNNING_TIME;
  750. public static int TVT_EVENT_PARTICIPATION_NPC_ID;
  751. public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
  752. public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
  753. public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
  754. public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
  755. public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
  756. public static String TVT_EVENT_TEAM_1_NAME;
  757. public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
  758. public static String TVT_EVENT_TEAM_2_NAME;
  759. public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
  760. public static List<int[]> TVT_EVENT_REWARDS = new FastList<int[]>();
  761. public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  762. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  763. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  764. public static List<Integer> TVT_EVENT_DOOR_IDS = new FastList<Integer>();
  765. public static byte TVT_EVENT_MIN_LVL;
  766. public static byte TVT_EVENT_MAX_LVL;
  767. /** L2JMOD Wedding system */
  768. public static boolean L2JMOD_ALLOW_WEDDING;
  769. public static int L2JMOD_WEDDING_PRICE;
  770. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  771. public static boolean L2JMOD_WEDDING_TELEPORT;
  772. public static int L2JMOD_WEDDING_TELEPORT_PRICE;
  773. public static int L2JMOD_WEDDING_TELEPORT_DURATION;
  774. public static boolean L2JMOD_WEDDING_SAMESEX;
  775. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  776. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  777. // Packet information
  778. /** Count the amount of packets per minute ? */
  779. public static boolean COUNT_PACKETS = false;
  780. /** Dump packet count ? */
  781. public static boolean DUMP_PACKET_COUNTS = false;
  782. /** Time interval between 2 dumps */
  783. public static int DUMP_INTERVAL_SECONDS = 60;
  784. /** Enumeration for type of ID Factory */
  785. public static enum IdFactoryType
  786. {
  787. Compaction,
  788. BitSet,
  789. Stack
  790. }
  791. /** ID Factory type */
  792. public static IdFactoryType IDFACTORY_TYPE;
  793. /** Check for bad ID ? */
  794. public static boolean BAD_ID_CHECKING;
  795. /** Enumeration for type of maps object */
  796. public static enum ObjectMapType
  797. {
  798. L2ObjectHashMap,
  799. WorldObjectMap
  800. }
  801. /** Enumeration for type of set object */
  802. public static enum ObjectSetType
  803. {
  804. L2ObjectHashSet,
  805. WorldObjectSet
  806. }
  807. /** Type of map object */
  808. public static ObjectMapType MAP_TYPE;
  809. /** Type of set object */
  810. public static ObjectSetType SET_TYPE;
  811. /**
  812. * Allow lesser effects to be canceled if stronger effects are used when effects of the same stack group are used.<br>
  813. * New effects that are added will be canceled if they are of lesser priority to the old one.
  814. */
  815. public static boolean EFFECT_CANCELING;
  816. /** Auto-delete invalid quest data ? */
  817. public static boolean AUTODELETE_INVALID_QUEST_DATA;
  818. /** Chance that an item will succesfully be enchanted */
  819. public static int ENCHANT_CHANCE_WEAPON;
  820. public static int ENCHANT_CHANCE_ARMOR;
  821. public static int ENCHANT_CHANCE_JEWELRY;
  822. /** Maximum level of enchantment */
  823. public static int ENCHANT_MAX_WEAPON;
  824. public static int ENCHANT_MAX_ARMOR;
  825. public static int ENCHANT_MAX_JEWELRY;
  826. /** maximum level of safe enchantment for normal items*/
  827. public static int ENCHANT_SAFE_MAX;
  828. /** maximum level of safe enchantment for full body armor*/
  829. public static int ENCHANT_SAFE_MAX_FULL;
  830. // Character multipliers
  831. /** Multiplier for character HP regeneration */
  832. public static double HP_REGEN_MULTIPLIER;
  833. /** Mutilplier for character MP regeneration */
  834. public static double MP_REGEN_MULTIPLIER;
  835. /** Multiplier for character CP regeneration */
  836. public static double CP_REGEN_MULTIPLIER;
  837. // Raid Boss multipliers
  838. /** Multiplier for Raid boss HP regeneration */
  839. public static double RAID_HP_REGEN_MULTIPLIER;
  840. /** Mulitplier for Raid boss MP regeneration */
  841. public static double RAID_MP_REGEN_MULTIPLIER;
  842. /** Multiplier for Raid boss defense multiplier */
  843. public static double RAID_DEFENCE_MULTIPLIER;
  844. /** Raid Boss Minin Spawn Timer */
  845. public static double RAID_MINION_RESPAWN_TIMER;
  846. /** Mulitplier for Raid boss minimum time respawn */
  847. public static float RAID_MIN_RESPAWN_MULTIPLIER;
  848. /** Mulitplier for Raid boss maximum time respawn */
  849. public static float RAID_MAX_RESPAWN_MULTIPLIER;
  850. /** Amount of adenas when starting a new character */
  851. public static int STARTING_ADENA;
  852. /** Deep Blue Mobs' Drop Rules Enabled */
  853. public static boolean DEEPBLUE_DROP_RULES;
  854. public static int UNSTUCK_INTERVAL;
  855. /** Is telnet enabled ? */
  856. public static boolean IS_TELNET_ENABLED;
  857. /** Death Penalty chance */
  858. public static int DEATH_PENALTY_CHANCE;
  859. /** Player Protection control */
  860. public static int PLAYER_SPAWN_PROTECTION;
  861. public static int PLAYER_FAKEDEATH_UP_PROTECTION;
  862. /** Define Party XP cutoff point method - Possible values: level and percentage */
  863. public static String PARTY_XP_CUTOFF_METHOD;
  864. /** Define the cutoff point value for the "level" method */
  865. public static int PARTY_XP_CUTOFF_LEVEL;
  866. /** Define the cutoff point value for the "percentage" method */
  867. public static double PARTY_XP_CUTOFF_PERCENT;
  868. /** Percent CP is restore on respawn */
  869. public static double RESPAWN_RESTORE_CP;
  870. /** Percent HP is restore on respawn */
  871. public static double RESPAWN_RESTORE_HP;
  872. /** Percent MP is restore on respawn */
  873. public static double RESPAWN_RESTORE_MP;
  874. /** Allow randomizing of the respawn point in towns. */
  875. public static boolean RESPAWN_RANDOM_ENABLED;
  876. /** The maximum offset from the base respawn point to allow. */
  877. public static int RESPAWN_RANDOM_MAX_OFFSET;
  878. /** Maximum number of available slots for pvt stores (sell/buy) - Dwarves */
  879. public static int MAX_PVTSTORE_SLOTS_DWARF;
  880. /** Maximum number of available slots for pvt stores (sell/buy) - Others */
  881. public static int MAX_PVTSTORE_SLOTS_OTHER;
  882. /** Store skills cooltime on char exit/relogin */
  883. public static boolean STORE_SKILL_COOLTIME;
  884. /** Show licence or not just after login (if false, will directly go to the Server List */
  885. public static boolean SHOW_LICENCE;
  886. /** Force GameGuard authorization in loginserver */
  887. public static boolean FORCE_GGAUTH;
  888. /** Default punishment for illegal actions */
  889. public static int DEFAULT_PUNISH;
  890. /** Parameter for default punishment */
  891. public static int DEFAULT_PUNISH_PARAM;
  892. /** Accept new game server ? */
  893. public static boolean ACCEPT_NEW_GAMESERVER;
  894. /** Server ID used with the HexID */
  895. public static int SERVER_ID;
  896. /** Hexadecimal ID of the game server */
  897. public static byte[] HEX_ID;
  898. /** Accept alternate ID for server ? */
  899. public static boolean ACCEPT_ALTERNATE_ID;
  900. /** ID for request to the server */
  901. public static int REQUEST_ID;
  902. public static boolean RESERVE_HOST_ON_LOGIN = false;
  903. public static int MINIMUM_UPDATE_DISTANCE;
  904. public static int KNOWNLIST_FORGET_DELAY;
  905. public static int MINIMUN_UPDATE_TIME;
  906. public static boolean ANNOUNCE_MAMMON_SPAWN;
  907. public static boolean LAZY_CACHE;
  908. /** Enable colored name for GM ? */
  909. public static boolean GM_NAME_COLOR_ENABLED;
  910. /** Color of GM name */
  911. public static int GM_NAME_COLOR;
  912. /** Color of admin name */
  913. public static int ADMIN_NAME_COLOR;
  914. /** Place an aura around the GM ? */
  915. public static boolean GM_HERO_AURA;
  916. /** Set the GM invulnerable at startup ? */
  917. public static boolean GM_STARTUP_INVULNERABLE;
  918. /** Set the GM invisible at startup ? */
  919. public static boolean GM_STARTUP_INVISIBLE;
  920. /** Set silence to GM at startup ? */
  921. public static boolean GM_STARTUP_SILENCE;
  922. /** Add GM in the GM list at startup ? */
  923. public static boolean GM_STARTUP_AUTO_LIST;
  924. /** Change the way admin panel is shown */
  925. public static String GM_ADMIN_MENU_STYLE;
  926. /** Allow petition ? */
  927. public static boolean PETITIONING_ALLOWED;
  928. /** Maximum number of petitions per player */
  929. public static int MAX_PETITIONS_PER_PLAYER;
  930. /** Maximum number of petitions pending */
  931. public static int MAX_PETITIONS_PENDING;
  932. /** Bypass exploit protection ? */
  933. public static boolean BYPASS_VALIDATION;
  934. /** Only GM buy items for free**/
  935. public static boolean ONLY_GM_ITEMS_FREE;
  936. /** GM Audit ?*/
  937. public static boolean GMAUDIT;
  938. /** Allow auto-create account ? */
  939. public static boolean AUTO_CREATE_ACCOUNTS;
  940. public static boolean FLOOD_PROTECTION;
  941. public static int FAST_CONNECTION_LIMIT;
  942. public static int NORMAL_CONNECTION_TIME;
  943. public static int FAST_CONNECTION_TIME;
  944. public static int MAX_CONNECTION_PER_IP;
  945. /** Enforce gameguard query on character login ? */
  946. public static boolean GAMEGUARD_ENFORCE;
  947. /** Don't allow player to perform trade,talk with npc and move until gameguard reply received ? */
  948. public static boolean GAMEGUARD_PROHIBITACTION;
  949. /** Recipebook limits */
  950. public static int DWARF_RECIPE_LIMIT;
  951. public static int COMMON_RECIPE_LIMIT;
  952. /** Grid Options */
  953. public static boolean GRIDS_ALWAYS_ON;
  954. public static int GRID_NEIGHBOR_TURNON_TIME;
  955. public static int GRID_NEIGHBOR_TURNOFF_TIME;
  956. /** Clan Hall function related configs*/
  957. public static long CH_TELE_FEE_RATIO;
  958. public static int CH_TELE1_FEE;
  959. public static int CH_TELE2_FEE;
  960. public static long CH_ITEM_FEE_RATIO;
  961. public static int CH_ITEM1_FEE;
  962. public static int CH_ITEM2_FEE;
  963. public static int CH_ITEM3_FEE;
  964. public static long CH_MPREG_FEE_RATIO;
  965. public static int CH_MPREG1_FEE;
  966. public static int CH_MPREG2_FEE;
  967. public static int CH_MPREG3_FEE;
  968. public static int CH_MPREG4_FEE;
  969. public static int CH_MPREG5_FEE;
  970. public static long CH_HPREG_FEE_RATIO;
  971. public static int CH_HPREG1_FEE;
  972. public static int CH_HPREG2_FEE;
  973. public static int CH_HPREG3_FEE;
  974. public static int CH_HPREG4_FEE;
  975. public static int CH_HPREG5_FEE;
  976. public static int CH_HPREG6_FEE;
  977. public static int CH_HPREG7_FEE;
  978. public static int CH_HPREG8_FEE;
  979. public static int CH_HPREG9_FEE;
  980. public static int CH_HPREG10_FEE;
  981. public static int CH_HPREG11_FEE;
  982. public static int CH_HPREG12_FEE;
  983. public static int CH_HPREG13_FEE;
  984. public static long CH_EXPREG_FEE_RATIO;
  985. public static int CH_EXPREG1_FEE;
  986. public static int CH_EXPREG2_FEE;
  987. public static int CH_EXPREG3_FEE;
  988. public static int CH_EXPREG4_FEE;
  989. public static int CH_EXPREG5_FEE;
  990. public static int CH_EXPREG6_FEE;
  991. public static int CH_EXPREG7_FEE;
  992. public static long CH_SUPPORT_FEE_RATIO;
  993. public static int CH_SUPPORT1_FEE;
  994. public static int CH_SUPPORT2_FEE;
  995. public static int CH_SUPPORT3_FEE;
  996. public static int CH_SUPPORT4_FEE;
  997. public static int CH_SUPPORT5_FEE;
  998. public static int CH_SUPPORT6_FEE;
  999. public static int CH_SUPPORT7_FEE;
  1000. public static int CH_SUPPORT8_FEE;
  1001. public static long CH_CURTAIN_FEE_RATIO;
  1002. public static int CH_CURTAIN1_FEE;
  1003. public static int CH_CURTAIN2_FEE;
  1004. public static long CH_FRONT_FEE_RATIO;
  1005. public static int CH_FRONT1_FEE;
  1006. public static int CH_FRONT2_FEE;
  1007. /** GeoData 0/1/2 */
  1008. public static int GEODATA;
  1009. /** Force loading GeoData to psychical memory */
  1010. public static boolean FORCE_GEODATA;
  1011. public static boolean ACCEPT_GEOEDITOR_CONN;
  1012. /** Max amount of buffs */
  1013. public static byte BUFFS_MAX_AMOUNT;
  1014. /** Alt Settings for devs */
  1015. public static boolean ALT_DEV_NO_QUESTS;
  1016. public static boolean ALT_DEV_NO_SPAWNS;
  1017. /**
  1018. * This class initializes all global variables for configuration.<br>
  1019. * If key doesn't appear in properties file, a default value is setting on by this class.
  1020. * @see CONFIGURATION_FILE (propertie file) for configuring your server.
  1021. */
  1022. public static void load()
  1023. {
  1024. if(Server.serverMode == Server.MODE_GAMESERVER)
  1025. {
  1026. _log.info("loading gameserver config");
  1027. try {
  1028. Properties serverSettings = new Properties();
  1029. InputStream is = new FileInputStream(new File(CONFIGURATION_FILE));
  1030. serverSettings.load(is);
  1031. is.close();
  1032. GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
  1033. PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
  1034. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
  1035. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
  1036. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
  1037. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");
  1038. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  1039. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  1040. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  1041. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  1042. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  1043. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  1044. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  1045. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
  1046. CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
  1047. PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
  1048. MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
  1049. MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
  1050. MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
  1051. MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
  1052. if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
  1053. {
  1054. throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
  1055. }
  1056. }
  1057. catch (Exception e)
  1058. {
  1059. e.printStackTrace();
  1060. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  1061. }
  1062. try
  1063. {
  1064. Properties optionsSettings = new Properties();
  1065. InputStream is = new FileInputStream(new File(OPTIONS_FILE));
  1066. optionsSettings.load(is);
  1067. is.close();
  1068. EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(optionsSettings.getProperty("EverybodyHasAdminRights", "false"));
  1069. DEBUG = Boolean.parseBoolean(optionsSettings.getProperty("Debug", "false"));
  1070. ASSERT = Boolean.parseBoolean(optionsSettings.getProperty("Assert", "false"));
  1071. DEVELOPER = Boolean.parseBoolean(optionsSettings.getProperty("Developer", "false"));
  1072. TEST_SERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
  1073. SERVER_LIST_TESTSERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
  1074. SERVER_LIST_BRACKET = Boolean.valueOf(optionsSettings.getProperty("ServerListBrackets", "false"));
  1075. SERVER_LIST_CLOCK = Boolean.valueOf(optionsSettings.getProperty("ServerListClock", "false"));
  1076. SERVER_GMONLY = Boolean.valueOf(optionsSettings.getProperty("ServerGMOnly", "false"));
  1077. AUTODESTROY_ITEM_AFTER = Integer.parseInt(optionsSettings.getProperty("AutoDestroyDroppedItemAfter", "0"));
  1078. HERB_AUTO_DESTROY_TIME = Integer.parseInt(optionsSettings.getProperty("AutoDestroyHerbTime","15"))*1000;
  1079. PROTECTED_ITEMS = optionsSettings.getProperty("ListOfProtectedItems");
  1080. LIST_PROTECTED_ITEMS = new FastList<Integer>();
  1081. for (String id : PROTECTED_ITEMS.split(",")) {
  1082. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
  1083. }
  1084. DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyPlayerDroppedItem", "false"));
  1085. DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyEquipableItem", "false"));
  1086. SAVE_DROPPED_ITEM = Boolean.valueOf(optionsSettings.getProperty("SaveDroppedItem", "false"));
  1087. EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(optionsSettings.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
  1088. SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(optionsSettings.getProperty("SaveDroppedItemInterval", "0"))*60000;
  1089. CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(optionsSettings.getProperty("ClearDroppedItemTable", "false"));
  1090. PRECISE_DROP_CALCULATION = Boolean.valueOf(optionsSettings.getProperty("PreciseDropCalculation", "True"));
  1091. MULTIPLE_ITEM_DROP = Boolean.valueOf(optionsSettings.getProperty("MultipleItemDrop", "True"));
  1092. COORD_SYNCHRONIZE = Integer.parseInt(optionsSettings.getProperty("CoordSynchronize", "-1"));
  1093. ONLY_GM_ITEMS_FREE = Boolean.valueOf(optionsSettings.getProperty("OnlyGMItemsFree", "True"));
  1094. ALLOW_WAREHOUSE = Boolean.valueOf(optionsSettings.getProperty("AllowWarehouse", "True"));
  1095. WAREHOUSE_CACHE = Boolean.valueOf(optionsSettings.getProperty("WarehouseCache", "False"));
  1096. WAREHOUSE_CACHE_TIME = Integer.parseInt(optionsSettings.getProperty("WarehouseCacheTime", "15"));
  1097. ALLOW_FREIGHT = Boolean.valueOf(optionsSettings.getProperty("AllowFreight", "True"));
  1098. ALLOW_WEAR = Boolean.valueOf(optionsSettings.getProperty("AllowWear", "False"));
  1099. WEAR_DELAY = Integer.parseInt(optionsSettings.getProperty("WearDelay", "5"));
  1100. WEAR_PRICE = Integer.parseInt(optionsSettings.getProperty("WearPrice", "10"));
  1101. ALLOW_LOTTERY = Boolean.valueOf(optionsSettings.getProperty("AllowLottery", "False"));
  1102. ALLOW_RACE = Boolean.valueOf(optionsSettings.getProperty("AllowRace", "False"));
  1103. ALLOW_WATER = Boolean.valueOf(optionsSettings.getProperty("AllowWater", "False"));
  1104. ALLOW_RENTPET = Boolean.valueOf(optionsSettings.getProperty("AllowRentPet", "False"));
  1105. FLOODPROTECTOR_INITIALSIZE = Integer.parseInt(optionsSettings.getProperty("FloodProtectorInitialSize", "50"));
  1106. ALLOW_DISCARDITEM = Boolean.valueOf(optionsSettings.getProperty("AllowDiscardItem", "True"));
  1107. ALLOWFISHING = Boolean.valueOf(optionsSettings.getProperty("AllowFishing", "False"));
  1108. ALLOW_MANOR = Boolean.parseBoolean(optionsSettings.getProperty("AllowManor", "False"));
  1109. ALLOW_BOAT = Boolean.valueOf(optionsSettings.getProperty("AllowBoat", "False"));
  1110. ALLOW_NPC_WALKERS = Boolean.valueOf(optionsSettings.getProperty("AllowNpcWalkers", "true"));
  1111. ALLOW_CURSED_WEAPONS = Boolean.valueOf(optionsSettings.getProperty("AllowCursedWeapons", "False"));
  1112. ALLOW_L2WALKER_CLIENT = L2WalkerAllowed.valueOf(optionsSettings.getProperty("AllowL2Walker", "False"));
  1113. L2WALKER_REVISION = Integer.parseInt(optionsSettings.getProperty("L2WalkerRevision", "537"));
  1114. AUTOBAN_L2WALKER_ACC = Boolean.valueOf(optionsSettings.getProperty("AutobanL2WalkerAcc", "False"));
  1115. ACTIVATE_POSITION_RECORDER = Boolean.valueOf(optionsSettings.getProperty("ActivatePositionRecorder", "False"));
  1116. DEFAULT_GLOBAL_CHAT = optionsSettings.getProperty("GlobalChat", "ON");
  1117. DEFAULT_TRADE_CHAT = optionsSettings.getProperty("TradeChat", "ON");
  1118. LOG_CHAT = Boolean.valueOf(optionsSettings.getProperty("LogChat", "false"));
  1119. LOG_ITEMS = Boolean.valueOf(optionsSettings.getProperty("LogItems", "false"));
  1120. GMAUDIT = Boolean.valueOf(optionsSettings.getProperty("GMAudit", "False"));
  1121. COMMUNITY_TYPE = optionsSettings.getProperty("CommunityType", "old").toLowerCase();
  1122. BBS_DEFAULT = optionsSettings.getProperty("BBSDefault", "_bbshome");
  1123. SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowLevelOnCommunityBoard", "False"));
  1124. SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowStatusOnCommunityBoard", "True"));
  1125. NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePageSizeOnCommunityBoard", "50"));
  1126. NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePerRowOnCommunityBoard", "5"));
  1127. ZONE_TOWN = Integer.parseInt(optionsSettings.getProperty("ZoneTown", "0"));
  1128. MAX_DRIFT_RANGE = Integer.parseInt(optionsSettings.getProperty("MaxDriftRange", "300"));
  1129. MIN_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinNPCAnimation", "10"));
  1130. MAX_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxNPCAnimation", "20"));
  1131. MIN_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinMonsterAnimation", "5"));
  1132. MAX_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxMonsterAnimation", "20"));
  1133. SERVER_NEWS = Boolean.valueOf(optionsSettings.getProperty("ShowServerNews", "False"));
  1134. SHOW_NPC_LVL = Boolean.valueOf(optionsSettings.getProperty("ShowNpcLevel", "False"));
  1135. FORCE_INVENTORY_UPDATE = Boolean.valueOf(optionsSettings.getProperty("ForceInventoryUpdate", "False"));
  1136. AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(optionsSettings.getProperty("AutoDeleteInvalidQuestData", "False"));
  1137. THREAD_P_EFFECTS = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeEffects", "6"));
  1138. THREAD_P_GENERAL = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeGeneral", "15"));
  1139. GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralPacketThreadCoreSize", "4"));
  1140. IO_PACKET_THREAD_CORE_SIZE =Integer.parseInt(optionsSettings.getProperty("UrgentPacketThreadCoreSize", "2"));
  1141. AI_MAX_THREAD = Integer.parseInt(optionsSettings.getProperty("AiMaxThread", "10"));
  1142. GENERAL_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralThreadCoreSize", "4"));
  1143. DELETE_DAYS = Integer.parseInt(optionsSettings.getProperty("DeleteCharAfterDays", "7"));
  1144. DEFAULT_PUNISH = Integer.parseInt(optionsSettings.getProperty("DefaultPunish", "2"));
  1145. DEFAULT_PUNISH_PARAM = Integer.parseInt(optionsSettings.getProperty("DefaultPunishParam", "0"));
  1146. LAZY_CACHE = Boolean.valueOf(optionsSettings.getProperty("LazyCache", "False"));
  1147. PACKET_LIFETIME = Integer.parseInt(optionsSettings.getProperty("PacketLifeTime", "0"));
  1148. BYPASS_VALIDATION = Boolean.valueOf(optionsSettings.getProperty("BypassValidation", "True"));
  1149. GAMEGUARD_ENFORCE = Boolean.valueOf(optionsSettings.getProperty("GameGuardEnforce", "False"));
  1150. GAMEGUARD_PROHIBITACTION = Boolean.valueOf(optionsSettings.getProperty("GameGuardProhibitAction", "False"));
  1151. GRIDS_ALWAYS_ON = Boolean.parseBoolean(optionsSettings.getProperty("GridsAlwaysOn", "False"));
  1152. GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOnTime", "30"));
  1153. GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOffTime", "300"));
  1154. GEODATA = Integer.parseInt(optionsSettings.getProperty("GeoData", "0"));
  1155. FORCE_GEODATA = Boolean.parseBoolean(optionsSettings.getProperty("ForceGeoData", "True"));
  1156. ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(optionsSettings.getProperty("AcceptGeoeditorConn", "False"));
  1157. // ---------------------------------------------------
  1158. // Configuration values not found in config files
  1159. // ---------------------------------------------------
  1160. USE_3D_MAP = Boolean.valueOf(optionsSettings.getProperty("Use3DMap", "False"));
  1161. PATH_NODE_RADIUS = Integer.parseInt(optionsSettings.getProperty("PathNodeRadius", "50"));
  1162. NEW_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
  1163. SELECTED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
  1164. LINKED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
  1165. NEW_NODE_TYPE = optionsSettings.getProperty("NewNodeType", "npc");
  1166. COUNT_PACKETS = Boolean.valueOf(optionsSettings.getProperty("CountPacket", "false"));
  1167. DUMP_PACKET_COUNTS = Boolean.valueOf(optionsSettings.getProperty("DumpPacketCounts", "false"));
  1168. DUMP_INTERVAL_SECONDS = Integer.parseInt(optionsSettings.getProperty("PacketDumpInterval", "60"));
  1169. MINIMUM_UPDATE_DISTANCE = Integer.parseInt(optionsSettings.getProperty("MaximumUpdateDistance", "50"));
  1170. MINIMUN_UPDATE_TIME = Integer.parseInt(optionsSettings.getProperty("MinimumUpdateTime", "500"));
  1171. CHECK_KNOWN = Boolean.valueOf(optionsSettings.getProperty("CheckKnownList", "false"));
  1172. KNOWNLIST_FORGET_DELAY = Integer.parseInt(optionsSettings.getProperty("KnownListForgetDelay", "10000"));
  1173. }
  1174. catch (Exception e)
  1175. {
  1176. e.printStackTrace();
  1177. throw new Error("Failed to Load "+OPTIONS_FILE+" File.");
  1178. }
  1179. /*
  1180. * Load L2J Server Version Properties file (if exists)
  1181. */
  1182. try
  1183. {
  1184. Properties serverVersion = new Properties();
  1185. InputStream is = new FileInputStream(new File(SERVER_VERSION_FILE));
  1186. serverVersion.load(is);
  1187. is.close();
  1188. SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1189. SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
  1190. }
  1191. catch (Exception e)
  1192. {
  1193. //Ignore Properties file if it doesnt exist
  1194. SERVER_VERSION = "Unsupported Custom Version.";
  1195. SERVER_BUILD_DATE = "Undefined Date.";
  1196. }
  1197. /*
  1198. * Load L2J Datapack Version Properties file (if exists)
  1199. */
  1200. try
  1201. {
  1202. Properties serverVersion = new Properties();
  1203. InputStream is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
  1204. serverVersion.load(is);
  1205. is.close();
  1206. DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
  1207. }
  1208. catch (Exception e)
  1209. {
  1210. //Ignore Properties file if it doesnt exist
  1211. DATAPACK_VERSION = "Unsupported Custom Version.";
  1212. }
  1213. // telnet
  1214. try
  1215. {
  1216. Properties telnetSettings = new Properties();
  1217. InputStream is = new FileInputStream(new File(TELNET_FILE));
  1218. telnetSettings.load(is);
  1219. is.close();
  1220. IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "false"));
  1221. }
  1222. catch (Exception e)
  1223. {
  1224. e.printStackTrace();
  1225. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1226. }
  1227. // id factory
  1228. try
  1229. {
  1230. Properties idSettings = new Properties();
  1231. InputStream is = new FileInputStream(new File(ID_CONFIG_FILE));
  1232. idSettings.load(is);
  1233. is.close();
  1234. MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
  1235. SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
  1236. IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
  1237. BAD_ID_CHECKING = Boolean.valueOf(idSettings.getProperty("BadIdChecking", "True"));
  1238. }
  1239. catch (Exception e)
  1240. {
  1241. e.printStackTrace();
  1242. throw new Error("Failed to Load "+ID_CONFIG_FILE+" File.");
  1243. }
  1244. // other
  1245. try
  1246. {
  1247. Properties otherSettings = new Properties();
  1248. InputStream is = new FileInputStream(new File(OTHER_CONFIG_FILE));
  1249. otherSettings.load(is);
  1250. is.close();
  1251. DEEPBLUE_DROP_RULES = Boolean.parseBoolean(otherSettings.getProperty("UseDeepBlueDropRules", "True"));
  1252. ALLOW_GUARDS = Boolean.valueOf(otherSettings.getProperty("AllowGuards", "False"));
  1253. EFFECT_CANCELING = Boolean.valueOf(otherSettings.getProperty("CancelLesserEffect", "True"));
  1254. WYVERN_SPEED = Integer.parseInt(otherSettings.getProperty("WyvernSpeed", "100"));
  1255. STRIDER_SPEED = Integer.parseInt(otherSettings.getProperty("StriderSpeed", "80"));
  1256. ALLOW_WYVERN_UPGRADER = Boolean.valueOf(otherSettings.getProperty("AllowWyvernUpgrader", "False"));
  1257. /* Inventory slots limits */
  1258. INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForNoDwarf", "80"));
  1259. INVENTORY_MAXIMUM_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForDwarf", "100"));
  1260. INVENTORY_MAXIMUM_GM = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForGMPlayer", "250"));
  1261. MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
  1262. /* Inventory slots limits */
  1263. WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
  1264. WAREHOUSE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
  1265. WAREHOUSE_SLOTS_CLAN = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForClan", "150"));
  1266. FREIGHT_SLOTS = Integer.parseInt(otherSettings.getProperty("MaximumFreightSlots", "20"));
  1267. /* chance to enchant an item over +3 */
  1268. ENCHANT_CHANCE_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantChanceWeapon", "68"));
  1269. ENCHANT_CHANCE_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantChanceArmor", "52"));
  1270. ENCHANT_CHANCE_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantChanceJewelry", "54"));
  1271. /* limit on enchant */
  1272. ENCHANT_MAX_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantMaxWeapon", "255"));
  1273. ENCHANT_MAX_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantMaxArmor", "255"));
  1274. ENCHANT_MAX_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantMaxJewelry", "255"));
  1275. /*limit of safe enchant normal */
  1276. ENCHANT_SAFE_MAX = Integer.parseInt(otherSettings.getProperty("EnchantSafeMax", "3"));
  1277. /*limit of safe enchant full */
  1278. ENCHANT_SAFE_MAX_FULL = Integer.parseInt(otherSettings.getProperty("EnchantSafeMaxFull", "4"));
  1279. /* if different from 100 (ie 100%) heal rate is modified acordingly */
  1280. HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("HpRegenMultiplier", "100")) /100;
  1281. MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("MpRegenMultiplier", "100")) /100;
  1282. CP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("CpRegenMultiplier", "100")) /100;
  1283. RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidHpRegenMultiplier", "100")) /100;
  1284. RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidMpRegenMultiplier", "100")) /100;
  1285. RAID_DEFENCE_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidDefenceMultiplier", "100")) /100;
  1286. RAID_MINION_RESPAWN_TIMER = Integer.parseInt(otherSettings.getProperty("RaidMinionRespawnTime", "300000"));
  1287. RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMinRespawnMultiplier", "1.0"));
  1288. RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMaxRespawnMultiplier", "1.0"));
  1289. STARTING_ADENA = Integer.parseInt(otherSettings.getProperty("StartingAdena", "100"));
  1290. UNSTUCK_INTERVAL = Integer.parseInt(otherSettings.getProperty("UnstuckInterval", "300"));
  1291. /* Player protection after teleport or login */
  1292. PLAYER_SPAWN_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerSpawnProtection", "0"));
  1293. /* Player protection after recovering from fake death (works against mobs only) */
  1294. PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerFakeDeathUpProtection", "0"));
  1295. /* Defines some Party XP related values */
  1296. PARTY_XP_CUTOFF_METHOD = otherSettings.getProperty("PartyXpCutoffMethod", "percentage");
  1297. PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(otherSettings.getProperty("PartyXpCutoffPercent", "3."));
  1298. PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(otherSettings.getProperty("PartyXpCutoffLevel", "30"));
  1299. /* Amount of HP, MP, and CP is restored */
  1300. RESPAWN_RESTORE_CP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreCP", "0")) / 100;
  1301. RESPAWN_RESTORE_HP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreHP", "70")) / 100;
  1302. RESPAWN_RESTORE_MP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreMP", "70")) / 100;
  1303. RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("RespawnRandomInTown", "False"));
  1304. RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(otherSettings.getProperty("RespawnRandomMaxOffset", "50"));
  1305. /* Maximum number of available slots for pvt stores */
  1306. MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsDwarf", "5"));
  1307. MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsOther", "4"));
  1308. STORE_SKILL_COOLTIME = Boolean.parseBoolean(otherSettings.getProperty("StoreSkillCooltime", "true"));
  1309. PET_RENT_NPC = otherSettings.getProperty("ListPetRentNpc", "30827");
  1310. LIST_PET_RENT_NPC = new FastList<Integer>();
  1311. for (String id : PET_RENT_NPC.split(",")) {
  1312. LIST_PET_RENT_NPC.add(Integer.parseInt(id));
  1313. }
  1314. NONDROPPABLE_ITEMS = otherSettings.getProperty("ListOfNonDroppableItems", "1147,425,1146,461,10,2368,7,6,2370,2369,5598");
  1315. LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  1316. for (String id : NONDROPPABLE_ITEMS.split(",")) {
  1317. LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
  1318. }
  1319. ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(otherSettings.getProperty("AnnounceMammonSpawn", "True"));
  1320. ALT_PRIVILEGES_ADMIN = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesAdmin", "False"));
  1321. ALT_PRIVILEGES_SECURE_CHECK = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesSecureCheck", "True"));
  1322. ALT_PRIVILEGES_DEFAULT_LEVEL = Integer.parseInt(otherSettings.getProperty("AltPrivilegesDefaultLevel", "100"));
  1323. GM_NAME_COLOR_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("GMNameColorEnabled", "False"));
  1324. GM_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("GMNameColor", "FFFF00"));
  1325. ADMIN_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("AdminNameColor", "00FF00"));
  1326. GM_HERO_AURA = Boolean.parseBoolean(otherSettings.getProperty("GMHeroAura", "True"));
  1327. GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvulnerable", "True"));
  1328. GM_STARTUP_INVISIBLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvisible", "True"));
  1329. GM_STARTUP_SILENCE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupSilence", "True"));
  1330. GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(otherSettings.getProperty("GMStartupAutoList", "True"));
  1331. GM_ADMIN_MENU_STYLE = otherSettings.getProperty("GMAdminMenuStyle", "modern");
  1332. PETITIONING_ALLOWED = Boolean.parseBoolean(otherSettings.getProperty("PetitioningAllowed", "True"));
  1333. MAX_PETITIONS_PER_PLAYER = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPerPlayer", "5"));
  1334. MAX_PETITIONS_PENDING = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPending", "25"));
  1335. JAIL_IS_PVP = Boolean.valueOf(otherSettings.getProperty("JailIsPvp", "True"));
  1336. JAIL_DISABLE_CHAT = Boolean.valueOf(otherSettings.getProperty("JailDisableChat", "True"));
  1337. DEATH_PENALTY_CHANCE = Integer.parseInt(otherSettings.getProperty("DeathPenaltyChance", "20"));
  1338. }
  1339. catch (Exception e)
  1340. {
  1341. e.printStackTrace();
  1342. throw new Error("Failed to Load "+OTHER_CONFIG_FILE+" File.");
  1343. }
  1344. // rates
  1345. try
  1346. {
  1347. Properties ratesSettings = new Properties();
  1348. InputStream is = new FileInputStream(new File(RATES_CONFIG_FILE));
  1349. ratesSettings.load(is);
  1350. is.close();
  1351. RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
  1352. RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
  1353. RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
  1354. RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
  1355. RATE_QUESTS_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestsReward", "1."));
  1356. RATE_DROP_ADENA = Float.parseFloat(ratesSettings.getProperty("RateDropAdena", "1."));
  1357. RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
  1358. RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
  1359. RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
  1360. RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
  1361. RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("RateDropQuest", "1."));
  1362. RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
  1363. RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
  1364. RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "15."));
  1365. RATE_DROP_MP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpMpHerbs", "10."));
  1366. RATE_DROP_GREATER_HERBS = Float.parseFloat(ratesSettings.getProperty("RateGreaterHerbs", "4."));
  1367. RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSuperiorHerbs", "0.8"))*10;
  1368. RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "0.2"))*10;
  1369. PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
  1370. PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
  1371. PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
  1372. PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
  1373. PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
  1374. PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
  1375. PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
  1376. SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
  1377. KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
  1378. KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
  1379. KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
  1380. KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
  1381. KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
  1382. }
  1383. catch (Exception e) {
  1384. e.printStackTrace();
  1385. throw new Error("Failed to Load "+RATES_CONFIG_FILE+" File.");
  1386. }
  1387. // alternative settings
  1388. try
  1389. {
  1390. Properties altSettings = new Properties();
  1391. InputStream is = new FileInputStream(new File(ALT_SETTINGS_FILE));
  1392. altSettings.load(is);
  1393. is.close();
  1394. ALT_GAME_TIREDNESS = Boolean.parseBoolean(altSettings.getProperty("AltGameTiredness", "false"));
  1395. ALT_GAME_CREATION = Boolean.parseBoolean(altSettings.getProperty("AltGameCreation", "false"));
  1396. ALT_GAME_CREATION_SPEED = Double.parseDouble(altSettings.getProperty("AltGameCreationSpeed", "1"));
  1397. ALT_GAME_CREATION_XP_RATE=Double.parseDouble(altSettings.getProperty("AltGameCreationRateXp", "1"));
  1398. ALT_GAME_CREATION_SP_RATE=Double.parseDouble(altSettings.getProperty("AltGameCreationRateSp", "1"));
  1399. ALT_WEIGHT_LIMIT =Double.parseDouble(altSettings.getProperty("AltWeightLimit", "1"));
  1400. ALT_BLACKSMITH_USE_RECIPES=Boolean.parseBoolean(altSettings.getProperty("AltBlacksmithUseRecipes", "true"));
  1401. ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(altSettings.getProperty("AltGameSkillLearn", "false"));
  1402. AUTO_LEARN_SKILLS = Boolean.parseBoolean(altSettings.getProperty("AutoLearnSkills", "false"));
  1403. ALT_GAME_CANCEL_BOW = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1404. ALT_GAME_CANCEL_CAST = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
  1405. ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(altSettings.getProperty("AltShieldBlocks", "false"));
  1406. ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(altSettings.getProperty("AltPerfectShieldBlockRate", "10"));
  1407. ALT_GAME_DELEVEL = Boolean.parseBoolean(altSettings.getProperty("Delevel", "true"));
  1408. ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(altSettings.getProperty("MagicFailures", "false"));
  1409. ALT_GAME_MOB_ATTACK_AI = Boolean.parseBoolean(altSettings.getProperty("AltGameMobAttackAI", "false"));
  1410. ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(altSettings.getProperty("AltMobAgroInPeaceZone", "true"));
  1411. ALT_GAME_EXPONENT_XP = Float.parseFloat(altSettings.getProperty("AltGameExponentXp", "0."));
  1412. ALT_GAME_EXPONENT_SP = Float.parseFloat(altSettings.getProperty("AltGameExponentSp", "0."));
  1413. ALLOW_CLASS_MASTERS = Boolean.valueOf(altSettings.getProperty("AllowClassMasters", "False"));
  1414. ALT_GAME_FREIGHTS = Boolean.parseBoolean(altSettings.getProperty("AltGameFreights", "false"));
  1415. ALT_GAME_FREIGHT_PRICE = Integer.parseInt(altSettings.getProperty("AltGameFreightPrice", "1000"));
  1416. ALT_PARTY_RANGE = Integer.parseInt(altSettings.getProperty("AltPartyRange", "1600"));
  1417. ALT_PARTY_RANGE2 = Integer.parseInt(altSettings.getProperty("AltPartyRange2", "1400"));
  1418. REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(altSettings.getProperty("RemoveCastleCirclets", "true"));
  1419. IS_CRAFTING_ENABLED = Boolean.parseBoolean(altSettings.getProperty("CraftingEnabled", "true"));
  1420. LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(altSettings.getProperty("LifeCrystalNeeded", "true"));
  1421. SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("SpBookNeeded", "true"));
  1422. ES_SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("EnchantSkillSpBookNeeded","true"));
  1423. AUTO_LOOT = altSettings.getProperty("AutoLoot").equalsIgnoreCase("True");
  1424. AUTO_LOOT_HERBS = altSettings.getProperty("AutoLootHerbs").equalsIgnoreCase("True");
  1425. ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
  1426. ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanShop", "true"));
  1427. ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseGK", "false"));
  1428. ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTeleport", "true"));
  1429. ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTrade", "true"));
  1430. ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
  1431. ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(altSettings.getProperty("AltFreeTeleporting", "False"));
  1432. ALT_RECOMMEND = Boolean.parseBoolean(altSettings.getProperty("AltRecommend", "False"));
  1433. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltSubClassWithoutQuests", "False"));
  1434. ALT_GAME_VIEWNPC = Boolean.parseBoolean(altSettings.getProperty("AltGameViewNpc", "False"));
  1435. ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.parseBoolean(altSettings.getProperty("AltNewCharAlwaysIsNewbie", "False"));
  1436. ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(altSettings.getProperty("AltMembersCanWithdrawFromClanWH", "False"));
  1437. ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(altSettings.getProperty("AltMaxNumOfClansInAlly", "3"));
  1438. DWARF_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("DwarfRecipeLimit","50"));
  1439. COMMON_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("CommonRecipeLimit","50"));
  1440. ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(altSettings.getProperty("AltClanMembersForWar", "15"));
  1441. ALT_CLAN_JOIN_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAClan", "5"));
  1442. ALT_CLAN_CREATE_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateAClan", "10"));
  1443. ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(altSettings.getProperty("DaysToPassToDissolveAClan", "7"));
  1444. ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
  1445. ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
  1446. ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
  1447. ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "10"));
  1448. CASTLE_SHIELD = Boolean.parseBoolean(altSettings.getProperty("CastleShieldRestriction", "True"));
  1449. CLANHALL_SHIELD = Boolean.parseBoolean(altSettings.getProperty("ClanHallShieldRestriction", "True"));
  1450. APELLA_ARMORS = Boolean.parseBoolean(altSettings.getProperty("ApellaArmorsRestriction", "True"));
  1451. OATH_ARMORS = Boolean.parseBoolean(altSettings.getProperty("OathArmorsRestriction", "True"));
  1452. CASTLE_CROWN = Boolean.parseBoolean(altSettings.getProperty("CastleLordsCrownRestriction", "True"));
  1453. CASTLE_CIRCLETS = Boolean.parseBoolean(altSettings.getProperty("CastleCircletsRestriction", "True"));
  1454. ALT_OLY_START_TIME = Integer.parseInt(altSettings.getProperty("AltOlyStartTime", "18"));
  1455. ALT_OLY_MIN = Integer.parseInt(altSettings.getProperty("AltOlyMin","00"));
  1456. ALT_OLY_CPERIOD = Long.parseLong(altSettings.getProperty("AltOlyCPeriod","21600000"));
  1457. ALT_OLY_BATTLE = Long.parseLong(altSettings.getProperty("AltOlyBattle","360000"));
  1458. ALT_OLY_BWAIT = Long.parseLong(altSettings.getProperty("AltOlyBWait","600000"));
  1459. ALT_OLY_IWAIT = Long.parseLong(altSettings.getProperty("AltOlyIWait","300000"));
  1460. ALT_OLY_WPERIOD = Long.parseLong(altSettings.getProperty("AltOlyWPeriod","604800000"));
  1461. ALT_OLY_VPERIOD = Long.parseLong(altSettings.getProperty("AltOlyVPeriod","86400000"));
  1462. ALT_MANOR_REFRESH_TIME = Integer.parseInt(altSettings.getProperty("AltManorRefreshTime","20"));
  1463. ALT_MANOR_REFRESH_MIN = Integer.parseInt(altSettings.getProperty("AltManorRefreshMin","00"));
  1464. ALT_MANOR_APPROVE_TIME = Integer.parseInt(altSettings.getProperty("AltManorApproveTime","6"));
  1465. ALT_MANOR_APPROVE_MIN = Integer.parseInt(altSettings.getProperty("AltManorApproveMin","00"));
  1466. ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(altSettings.getProperty("AltManorMaintenancePeriod","360000"));
  1467. ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(altSettings.getProperty("AltManorSaveAllActions","false"));
  1468. ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(altSettings.getProperty("AltManorSavePeriodRate","2"));
  1469. ALT_LOTTERY_PRIZE = Integer.parseInt(altSettings.getProperty("AltLotteryPrize","50000"));
  1470. ALT_LOTTERY_TICKET_PRICE = Integer.parseInt(altSettings.getProperty("AltLotteryTicketPrice","2000"));
  1471. ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery5NumberRate","0.6"));
  1472. ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery4NumberRate","0.2"));
  1473. ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery3NumberRate","0.2"));
  1474. ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Integer.parseInt(altSettings.getProperty("AltLottery2and1NumberPrize","200"));
  1475. BUFFS_MAX_AMOUNT = Byte.parseByte(altSettings.getProperty("maxbuffamount","24"));
  1476. ALT_DEV_NO_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoQuests", "False"));
  1477. ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoSpawns", "False"));
  1478. // Dimensional Rift Config
  1479. RIFT_MIN_PARTY_SIZE = Integer.parseInt(altSettings.getProperty("RiftMinPartySize", "5"));
  1480. RIFT_MAX_JUMPS = Integer.parseInt(altSettings.getProperty("MaxRiftJumps", "4"));
  1481. RIFT_SPAWN_DELAY = Integer.parseInt(altSettings.getProperty("RiftSpawnDelay", "10000"));
  1482. RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMin", "480"));
  1483. RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMax", "600"));
  1484. RIFT_ENTER_COST_RECRUIT = Integer.parseInt(altSettings.getProperty("RecruitCost", "18"));
  1485. RIFT_ENTER_COST_SOLDIER = Integer.parseInt(altSettings.getProperty("SoldierCost", "21"));
  1486. RIFT_ENTER_COST_OFFICER = Integer.parseInt(altSettings.getProperty("OfficerCost", "24"));
  1487. RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(altSettings.getProperty("CaptainCost", "27"));
  1488. RIFT_ENTER_COST_COMMANDER = Integer.parseInt(altSettings.getProperty("CommanderCost", "30"));
  1489. RIFT_ENTER_COST_HERO = Integer.parseInt(altSettings.getProperty("HeroCost", "33"));
  1490. RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(altSettings.getProperty("BossRoomTimeMultiply", "1.5"));
  1491. }
  1492. catch (Exception e)
  1493. {
  1494. e.printStackTrace();
  1495. throw new Error("Failed to Load "+ALT_SETTINGS_FILE+" File.");
  1496. }
  1497. // Seven Signs Config
  1498. try
  1499. {
  1500. Properties SevenSettings = new Properties();
  1501. InputStream is = new FileInputStream(new File(SEVENSIGNS_FILE));
  1502. SevenSettings.load(is);
  1503. is.close();
  1504. ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.parseBoolean(SevenSettings.getProperty("AltRequireCastleForDawn", "False"));
  1505. ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(SevenSettings.getProperty("AltRequireClanCastle", "False"));
  1506. ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(SevenSettings.getProperty("AltFestivalMinPlayer", "5"));
  1507. ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(SevenSettings.getProperty("AltMaxPlayerContrib", "1000000"));
  1508. ALT_FESTIVAL_MANAGER_START = Long.parseLong(SevenSettings.getProperty("AltFestivalManagerStart", "120000"));
  1509. ALT_FESTIVAL_LENGTH = Long.parseLong(SevenSettings.getProperty("AltFestivalLength", "1080000"));
  1510. ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(SevenSettings.getProperty("AltFestivalCycleLength", "2280000"));
  1511. ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(SevenSettings.getProperty("AltFestivalFirstSpawn", "120000"));
  1512. ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(SevenSettings.getProperty("AltFestivalFirstSwarm", "300000"));
  1513. ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(SevenSettings.getProperty("AltFestivalSecondSpawn", "540000"));
  1514. ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(SevenSettings.getProperty("AltFestivalSecondSwarm", "720000"));
  1515. ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(SevenSettings.getProperty("AltFestivalChestSpawn", "900000"));
  1516. }
  1517. catch (Exception e)
  1518. {
  1519. e.printStackTrace();
  1520. throw new Error("Failed to Load "+SEVENSIGNS_FILE+" File.");
  1521. }
  1522. // clanhall settings
  1523. try
  1524. {
  1525. Properties clanhallSettings = new Properties();
  1526. InputStream is = new FileInputStream(new File(CLANHALL_CONFIG_FILE));
  1527. clanhallSettings.load(is);
  1528. is.close();
  1529. CH_TELE_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallTeleportFunctionFeeRation", "86400000"));
  1530. CH_TELE1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallTeleportFunctionFeeLvl1", "86400000"));
  1531. CH_TELE2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallTeleportFunctionFeeLvl2", "86400000"));
  1532. CH_SUPPORT_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallSupportFunctionFeeRation", "86400000"));
  1533. CH_SUPPORT1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl1", "86400000"));
  1534. CH_SUPPORT2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl2", "86400000"));
  1535. CH_SUPPORT3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl3", "86400000"));
  1536. CH_SUPPORT4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl4", "86400000"));
  1537. CH_SUPPORT5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl5", "86400000"));
  1538. CH_SUPPORT6_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl6", "86400000"));
  1539. CH_SUPPORT7_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl7", "86400000"));
  1540. CH_SUPPORT8_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl8", "86400000"));
  1541. CH_MPREG_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFunctionFeeRation", "86400000"));
  1542. CH_MPREG1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl1", "86400000"));
  1543. CH_MPREG2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl2", "86400000"));
  1544. CH_MPREG3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl3", "86400000"));
  1545. CH_MPREG4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl4", "86400000"));
  1546. CH_MPREG5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl5", "86400000"));
  1547. CH_HPREG_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFunctionFeeRation", "86400000"));
  1548. CH_HPREG1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl1", "86400000"));
  1549. CH_HPREG2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl2", "86400000"));
  1550. CH_HPREG3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl3", "86400000"));
  1551. CH_HPREG4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl4", "86400000"));
  1552. CH_HPREG5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl5", "86400000"));
  1553. CH_HPREG6_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl6", "86400000"));
  1554. CH_HPREG7_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl7", "86400000"));
  1555. CH_HPREG8_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl8", "86400000"));
  1556. CH_HPREG9_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl9", "86400000"));
  1557. CH_HPREG10_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl10", "86400000"));
  1558. CH_HPREG11_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl11", "86400000"));
  1559. CH_HPREG12_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl12", "86400000"));
  1560. CH_HPREG13_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl13", "86400000"));
  1561. CH_EXPREG_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFunctionFeeRation", "86400000"));
  1562. CH_EXPREG1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl1", "86400000"));
  1563. CH_EXPREG2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl2", "86400000"));
  1564. CH_EXPREG3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl3", "86400000"));
  1565. CH_EXPREG4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl4", "86400000"));
  1566. CH_EXPREG5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl5", "86400000"));
  1567. CH_EXPREG6_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl6", "86400000"));
  1568. CH_EXPREG7_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl7", "86400000"));
  1569. CH_ITEM_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeRation", "86400000"));
  1570. CH_ITEM1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeLvl1", "86400000"));
  1571. CH_ITEM2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeLvl2", "86400000"));
  1572. CH_ITEM3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeLvl3", "86400000"));
  1573. CH_CURTAIN_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallCurtainFunctionFeeRation", "86400000"));
  1574. CH_CURTAIN1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallCurtainFunctionFeeLvl1", "86400000"));
  1575. CH_CURTAIN2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallCurtainFunctionFeeLvl2", "86400000"));
  1576. CH_FRONT_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallFrontPlatformFunctionFeeRation", "86400000"));
  1577. CH_FRONT1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "86400000"));
  1578. CH_FRONT2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "86400000"));
  1579. }
  1580. catch (Exception e)
  1581. {
  1582. e.printStackTrace();
  1583. throw new Error("Failed to Load "+CLANHALL_CONFIG_FILE+" File.");
  1584. }
  1585. try
  1586. {
  1587. Properties L2JModSettings = new Properties();
  1588. InputStream is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
  1589. L2JModSettings.load(is);
  1590. is.close();
  1591. L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
  1592. L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
  1593. L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
  1594. L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
  1595. L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
  1596. L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
  1597. L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
  1598. L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
  1599. L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
  1600. L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
  1601. L2JMOD_CHAMPION_REWARD = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItem", "0"));
  1602. L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
  1603. L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
  1604. TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
  1605. TVT_EVENT_INTERVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventInterval", "18000"));
  1606. TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
  1607. TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
  1608. TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
  1609. /** L2JMOD Wedding system */
  1610. L2JMOD_ALLOW_WEDDING = Boolean.valueOf(L2JModSettings.getProperty("AllowWedding", "False"));
  1611. L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
  1612. L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
  1613. L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
  1614. L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
  1615. L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
  1616. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
  1617. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
  1618. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
  1619. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  1620. {
  1621. TVT_EVENT_ENABLED = false;
  1622. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
  1623. }
  1624. else
  1625. {
  1626. String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
  1627. if (propertySplit.length < 3)
  1628. {
  1629. TVT_EVENT_ENABLED = false;
  1630. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
  1631. }
  1632. else
  1633. {
  1634. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1635. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1636. TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1637. TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
  1638. TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
  1639. TVT_EVENT_MIN_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
  1640. TVT_EVENT_MAX_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
  1641. TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
  1642. TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
  1643. TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
  1644. propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
  1645. if (propertySplit.length < 3)
  1646. {
  1647. TVT_EVENT_ENABLED = false;
  1648. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
  1649. }
  1650. else
  1651. {
  1652. TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1653. TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1654. TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1655. TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
  1656. propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
  1657. if (propertySplit.length < 3)
  1658. {
  1659. TVT_EVENT_ENABLED= false;
  1660. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
  1661. }
  1662. else
  1663. {
  1664. TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
  1665. TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
  1666. TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
  1667. propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
  1668. for (String reward : propertySplit)
  1669. {
  1670. String[] rewardSplit = reward.split(",");
  1671. if (rewardSplit.length != 2)
  1672. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
  1673. else
  1674. {
  1675. try
  1676. {
  1677. TVT_EVENT_REWARDS.add(new int[]{Integer.valueOf(rewardSplit[0]), Integer.valueOf(rewardSplit[1])});
  1678. }
  1679. catch (NumberFormatException nfe)
  1680. {
  1681. if (!reward.equals(""))
  1682. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
  1683. }
  1684. }
  1685. }
  1686. TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
  1687. TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
  1688. TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
  1689. propertySplit = L2JModSettings.getProperty("TvTEventDoorsCloseOpenOnStartEnd", "").split(";");
  1690. for (String door : propertySplit)
  1691. {
  1692. try
  1693. {
  1694. TVT_EVENT_DOOR_IDS.add(Integer.valueOf(door));
  1695. }
  1696. catch (NumberFormatException nfe)
  1697. {
  1698. if (!door.equals(""))
  1699. System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventDoorsCloseOpenOnStartEnd \"" + door + "\"");
  1700. }
  1701. }
  1702. }
  1703. }
  1704. }
  1705. }
  1706. }
  1707. catch (Exception e)
  1708. {
  1709. e.printStackTrace();
  1710. throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File.");
  1711. }
  1712. // pvp config
  1713. try
  1714. {
  1715. Properties pvpSettings = new Properties();
  1716. InputStream is = new FileInputStream(new File(PVP_CONFIG_FILE));
  1717. pvpSettings.load(is);
  1718. is.close();
  1719. /* KARMA SYSTEM */
  1720. KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
  1721. KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
  1722. KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
  1723. KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
  1724. KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
  1725. KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
  1726. KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
  1727. KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650");
  1728. 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");
  1729. KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<Integer>();
  1730. for (String id : KARMA_NONDROPPABLE_PET_ITEMS.split(",")) {
  1731. KARMA_LIST_NONDROPPABLE_PET_ITEMS.add(Integer.parseInt(id));
  1732. }
  1733. KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
  1734. for (String id : KARMA_NONDROPPABLE_ITEMS.split(",")) {
  1735. KARMA_LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
  1736. }
  1737. PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "15000"));
  1738. PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "30000"));
  1739. }
  1740. catch (Exception e)
  1741. {
  1742. e.printStackTrace();
  1743. throw new Error("Failed to Load "+PVP_CONFIG_FILE+" File.");
  1744. }
  1745. // access levels
  1746. try
  1747. {
  1748. Properties gmSettings = new Properties();
  1749. InputStream is = new FileInputStream(new File(GM_ACCESS_FILE));
  1750. gmSettings.load(is);
  1751. is.close();
  1752. GM_ACCESSLEVEL = Integer.parseInt(gmSettings.getProperty("GMAccessLevel", "100"));
  1753. GM_MIN = Integer.parseInt(gmSettings.getProperty("GMMinLevel", "100"));
  1754. GM_ALTG_MIN_LEVEL = Integer.parseInt(gmSettings.getProperty("GMCanAltG", "100"));
  1755. GM_ANNOUNCE = Integer.parseInt(gmSettings.getProperty("GMCanAnnounce", "100"));
  1756. GM_BAN = Integer.parseInt(gmSettings.getProperty("GMCanBan", "100"));
  1757. GM_BAN_CHAT = Integer.parseInt(gmSettings.getProperty("GMCanBanChat", "100"));
  1758. GM_CREATE_ITEM = Integer.parseInt(gmSettings.getProperty("GMCanShop", "100"));
  1759. GM_DELETE = Integer.parseInt(gmSettings.getProperty("GMCanDelete", "100"));
  1760. GM_KICK = Integer.parseInt(gmSettings.getProperty("GMCanKick", "100"));
  1761. GM_MENU = Integer.parseInt(gmSettings.getProperty("GMMenu", "100"));
  1762. GM_GODMODE = Integer.parseInt(gmSettings.getProperty("GMGodMode", "100"));
  1763. GM_CHAR_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditChar", "100"));
  1764. GM_CHAR_EDIT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanEditCharOther", "100"));
  1765. GM_CHAR_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewChar", "100"));
  1766. GM_NPC_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditNPC", "100"));
  1767. GM_NPC_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewNPC", "100"));
  1768. GM_TELEPORT = Integer.parseInt(gmSettings.getProperty("GMCanTeleport", "100"));
  1769. GM_TELEPORT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanTeleportOther", "100"));
  1770. GM_RESTART = Integer.parseInt(gmSettings.getProperty("GMCanRestart", "100"));
  1771. GM_MONSTERRACE = Integer.parseInt(gmSettings.getProperty("GMMonsterRace", "100"));
  1772. GM_RIDER = Integer.parseInt(gmSettings.getProperty("GMRider", "100"));
  1773. GM_ESCAPE = Integer.parseInt(gmSettings.getProperty("GMFastUnstuck", "100"));
  1774. GM_FIXED = Integer.parseInt(gmSettings.getProperty("GMResurectFixed", "100"));
  1775. GM_CREATE_NODES = Integer.parseInt(gmSettings.getProperty("GMCreateNodes", "100"));
  1776. GM_ENCHANT = Integer.parseInt(gmSettings.getProperty("GMEnchant", "100"));
  1777. GM_DOOR = Integer.parseInt(gmSettings.getProperty("GMDoor", "100"));
  1778. GM_RES = Integer.parseInt(gmSettings.getProperty("GMRes", "100"));
  1779. GM_PEACEATTACK = Integer.parseInt(gmSettings.getProperty("GMPeaceAttack", "100"));
  1780. GM_HEAL = Integer.parseInt(gmSettings.getProperty("GMHeal", "100"));
  1781. GM_UNBLOCK = Integer.parseInt(gmSettings.getProperty("GMUnblock", "100"));
  1782. GM_CACHE = Integer.parseInt(gmSettings.getProperty("GMCache", "100"));
  1783. GM_TALK_BLOCK = Integer.parseInt(gmSettings.getProperty("GMTalkBlock", "100"));
  1784. GM_TEST = Integer.parseInt(gmSettings.getProperty("GMTest", "100"));
  1785. String gmTrans = gmSettings.getProperty("GMDisableTransaction", "False");
  1786. if (!gmTrans.equalsIgnoreCase("false"))
  1787. {
  1788. String[] params = gmTrans.split(",");
  1789. GM_DISABLE_TRANSACTION = true;
  1790. GM_TRANSACTION_MIN = Integer.parseInt(params[0]);
  1791. GM_TRANSACTION_MAX = Integer.parseInt(params[1]);
  1792. }
  1793. else
  1794. {
  1795. GM_DISABLE_TRANSACTION = false;
  1796. }
  1797. GM_CAN_GIVE_DAMAGE = Integer.parseInt(gmSettings.getProperty("GMCanGiveDamage", "90"));
  1798. GM_DONT_TAKE_AGGRO = Integer.parseInt(gmSettings.getProperty("GMDontTakeAggro", "90"));
  1799. GM_DONT_TAKE_EXPSP = Integer.parseInt(gmSettings.getProperty("GMDontGiveExpSp", "90"));
  1800. }
  1801. catch (Exception e)
  1802. {
  1803. e.printStackTrace();
  1804. throw new Error("Failed to Load "+GM_ACCESS_FILE+" File.");
  1805. }
  1806. try
  1807. {
  1808. Properties Settings = new Properties();
  1809. InputStream is = new FileInputStream(HEXID_FILE);
  1810. Settings.load(is);
  1811. is.close();
  1812. SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
  1813. HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
  1814. }
  1815. catch (Exception e)
  1816. {
  1817. _log.warning("Could not load HexID file ("+HEXID_FILE+"). Hopefully login will give us one.");
  1818. }
  1819. }
  1820. else if(Server.serverMode == Server.MODE_LOGINSERVER)
  1821. {
  1822. _log.info("loading login config");
  1823. try
  1824. {
  1825. Properties serverSettings = new Properties();
  1826. InputStream is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
  1827. serverSettings.load(is);
  1828. is.close();
  1829. GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");
  1830. GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));
  1831. LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
  1832. PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
  1833. DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
  1834. DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
  1835. ASSERT = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));
  1836. ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
  1837. REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
  1838. ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
  1839. LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
  1840. LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
  1841. GM_MIN = Integer.parseInt(serverSettings.getProperty("GMMinLevel", "100"));
  1842. DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); //FIXME: in login?
  1843. INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
  1844. EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
  1845. DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
  1846. DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
  1847. DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
  1848. DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
  1849. DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
  1850. SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
  1851. IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime","15"));
  1852. FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "false"));
  1853. AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));
  1854. FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
  1855. FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
  1856. NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
  1857. FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
  1858. MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
  1859. }
  1860. catch (Exception e)
  1861. {
  1862. e.printStackTrace();
  1863. throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
  1864. }
  1865. // telnet
  1866. try
  1867. {
  1868. Properties telnetSettings = new Properties();
  1869. InputStream is = new FileInputStream(new File(TELNET_FILE));
  1870. telnetSettings.load(is);
  1871. is.close();
  1872. IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "false"));
  1873. }
  1874. catch (Exception e)
  1875. {
  1876. e.printStackTrace();
  1877. throw new Error("Failed to Load "+TELNET_FILE+" File.");
  1878. }
  1879. }
  1880. else
  1881. {
  1882. _log.severe("Could not Load Config: server mode was not set");
  1883. }
  1884. }
  1885. /**
  1886. * Set a new value to a game parameter from the admin console.
  1887. * @param pName (String) : name of the parameter to change
  1888. * @param pValue (String) : new value of the parameter
  1889. * @return boolean : true if modification has been made
  1890. * @link useAdminCommand
  1891. */
  1892. public static boolean setParameterValue(String pName, String pValue)
  1893. {
  1894. // Server settings
  1895. if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
  1896. else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
  1897. else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
  1898. else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
  1899. else if (pName.equalsIgnoreCase("RateQuestsReward")) RATE_QUESTS_REWARD = Float.parseFloat(pValue);
  1900. else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ADENA = Float.parseFloat(pValue);
  1901. else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
  1902. else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
  1903. else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
  1904. else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
  1905. else if (pName.equalsIgnoreCase("RateDropQuest")) RATE_DROP_QUEST = Float.parseFloat(pValue);
  1906. else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
  1907. else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
  1908. else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
  1909. else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
  1910. else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
  1911. else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  1912. else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  1913. else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
  1914. else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
  1915. else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
  1916. else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
  1917. else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
  1918. else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
  1919. else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(pValue);
  1920. else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(pValue);
  1921. else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.valueOf(pValue);
  1922. else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(pValue);
  1923. else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
  1924. else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(pValue);
  1925. else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.valueOf(pValue);
  1926. else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.valueOf(pValue);
  1927. else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
  1928. else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
  1929. else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.valueOf(pValue);
  1930. else if (pName.equalsIgnoreCase("AllowFreight")) ALLOW_FREIGHT = Boolean.valueOf(pValue);
  1931. else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.valueOf(pValue);
  1932. else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.valueOf(pValue);
  1933. else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
  1934. else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
  1935. else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.valueOf(pValue);
  1936. else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.valueOf(pValue);
  1937. else if (pName.equalsIgnoreCase("AllowBoat")) ALLOW_BOAT = Boolean.valueOf(pValue);
  1938. else if (pName.equalsIgnoreCase("AllowCursedWeapons")) ALLOW_CURSED_WEAPONS = Boolean.valueOf(pValue);
  1939. else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.valueOf(pValue);
  1940. else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.valueOf(pValue);
  1941. else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = pValue.toLowerCase();
  1942. else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
  1943. else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(pValue);
  1944. else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(pValue);
  1945. else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
  1946. else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
  1947. else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.valueOf(pValue);
  1948. else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.valueOf(pValue);
  1949. else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.valueOf(pValue);
  1950. else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(pValue);
  1951. else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
  1952. else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);
  1953. else if (pName.equalsIgnoreCase("MaximumUpdateDistance")) MINIMUM_UPDATE_DISTANCE = Integer.parseInt(pValue);
  1954. else if (pName.equalsIgnoreCase("MinimumUpdateTime")) MINIMUN_UPDATE_TIME = Integer.parseInt(pValue);
  1955. else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.valueOf(pValue);
  1956. else if (pName.equalsIgnoreCase("KnownListForgetDelay")) KNOWNLIST_FORGET_DELAY = Integer.parseInt(pValue);
  1957. // Other settings
  1958. else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.valueOf(pValue);
  1959. else if (pName.equalsIgnoreCase("AllowGuards")) ALLOW_GUARDS = Boolean.valueOf(pValue);
  1960. else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.valueOf(pValue);
  1961. else if (pName.equalsIgnoreCase("WyvernSpeed")) WYVERN_SPEED = Integer.parseInt(pValue);
  1962. else if (pName.equalsIgnoreCase("StriderSpeed")) STRIDER_SPEED = Integer.parseInt(pValue);
  1963. else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
  1964. else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
  1965. else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
  1966. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
  1967. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
  1968. else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
  1969. else if (pName.equalsIgnoreCase("MaximumFreightSlots")) FREIGHT_SLOTS = Integer.parseInt(pValue);
  1970. else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
  1971. else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
  1972. else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
  1973. else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
  1974. else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
  1975. else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
  1976. else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
  1977. else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
  1978. else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1979. else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1980. else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1981. else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1982. else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  1983. else if (pName.equalsIgnoreCase("RaidDefenceMultiplier")) RAID_DEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
  1984. else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
  1985. else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Integer.parseInt(pValue);
  1986. else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
  1987. else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
  1988. else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
  1989. else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
  1990. else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
  1991. else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
  1992. else if (pName.equalsIgnoreCase("RespawnRestoreCP")) RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
  1993. else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
  1994. else if (pName.equalsIgnoreCase("RespawnRestoreMP")) RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
  1995. else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsDwarf")) MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(pValue);
  1996. else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsOther")) MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(pValue);
  1997. else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.valueOf(pValue);
  1998. else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.valueOf(pValue);
  1999. // Alternative settings
  2000. else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.valueOf(pValue);
  2001. else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.valueOf(pValue);
  2002. else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
  2003. else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
  2004. else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
  2005. else if (pName.equalsIgnoreCase("AltWeightLimit")) ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
  2006. else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes")) ALT_BLACKSMITH_USE_RECIPES = Boolean.valueOf(pValue);
  2007. else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.valueOf(pValue);
  2008. else if (pName.equalsIgnoreCase("RemoveCastleCirclets")) REMOVE_CASTLE_CIRCLETS = Boolean.valueOf(pValue);
  2009. else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
  2010. {
  2011. ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
  2012. ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
  2013. }
  2014. else if (pName.equalsIgnoreCase("AltShieldBlocks")) ALT_GAME_SHIELD_BLOCKS = Boolean.valueOf(pValue);
  2015. else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
  2016. else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.valueOf(pValue);
  2017. else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.valueOf(pValue);
  2018. else if (pName.equalsIgnoreCase("AltGameMobAttackAI")) ALT_GAME_MOB_ATTACK_AI = Boolean.valueOf(pValue);
  2019. else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone")) ALT_MOB_AGRO_IN_PEACEZONE = Boolean.valueOf(pValue);
  2020. else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
  2021. else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
  2022. else if (pName.equalsIgnoreCase("AllowClassMasters")) ALLOW_CLASS_MASTERS = Boolean.valueOf(pValue);
  2023. else if (pName.equalsIgnoreCase("AltGameFreights")) ALT_GAME_FREIGHTS = Boolean.valueOf(pValue);
  2024. else if (pName.equalsIgnoreCase("AltGameFreightPrice")) ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue);
  2025. else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
  2026. else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
  2027. else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.valueOf(pValue);
  2028. else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.valueOf(pValue);
  2029. else if (pName.equalsIgnoreCase("SpBookNeeded")) SP_BOOK_NEEDED = Boolean.valueOf(pValue);
  2030. else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.valueOf(pValue);
  2031. else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.valueOf(pValue);
  2032. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(pValue);
  2033. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(pValue);
  2034. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(pValue);
  2035. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(pValue);
  2036. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(pValue);
  2037. else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(pValue);
  2038. else if (pName.equalsIgnoreCase("AltRequireCastleForDawn")) ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.valueOf(pValue);
  2039. else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.valueOf(pValue);
  2040. else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.valueOf(pValue);
  2041. else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.valueOf(pValue);
  2042. else if (pName.equalsIgnoreCase("AltNewCharAlwaysIsNewbie")) ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.valueOf(pValue);
  2043. else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.valueOf(pValue);
  2044. else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
  2045. else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
  2046. else if (pName.equalsIgnoreCase("CastleShieldRestriction")) CASTLE_SHIELD = Boolean.valueOf(pValue);
  2047. else if (pName.equalsIgnoreCase("ClanHallShieldRestriction")) CLANHALL_SHIELD = Boolean.valueOf(pValue);
  2048. else if (pName.equalsIgnoreCase("ApellaArmorsRestriction")) APELLA_ARMORS = Boolean.valueOf(pValue);
  2049. else if (pName.equalsIgnoreCase("OathArmorsRestriction")) OATH_ARMORS = Boolean.valueOf(pValue);
  2050. else if (pName.equalsIgnoreCase("CastleLordsCrownRestriction")) CASTLE_CROWN = Boolean.valueOf(pValue);
  2051. else if (pName.equalsIgnoreCase("CastleCircletsRestriction")) CASTLE_CIRCLETS = Boolean.valueOf(pValue);
  2052. //ChampionMobs L2JMOD
  2053. else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE = Boolean.valueOf(pValue);
  2054. else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
  2055. else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
  2056. else if (pName.equalsIgnoreCase("ChampionMaxLevel")) L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
  2057. else if (pName.equalsIgnoreCase("ChampionHp")) L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
  2058. else if (pName.equalsIgnoreCase("ChampionHpRegen")) L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
  2059. else if (pName.equalsIgnoreCase("ChampionRewards")) L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
  2060. else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(pValue);
  2061. else if (pName.equalsIgnoreCase("ChampionAtk")) L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
  2062. else if (pName.equalsIgnoreCase("ChampionSpdAtk")) L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
  2063. else if (pName.equalsIgnoreCase("ChampionRewardItem")) L2JMOD_CHAMPION_REWARD = Integer.parseInt(pValue);
  2064. else if (pName.equalsIgnoreCase("ChampionRewardItemID")) L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
  2065. else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
  2066. // L2JMOD Wedding System
  2067. else if (pName.equalsIgnoreCase("AllowWedding")) L2JMOD_ALLOW_WEDDING = Boolean.valueOf(pValue);
  2068. else if (pName.equalsIgnoreCase("WeddingPrice")) L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
  2069. else if (pName.equalsIgnoreCase("WeddingPunishInfidelity")) L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
  2070. else if (pName.equalsIgnoreCase("WeddingTeleport")) L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
  2071. else if (pName.equalsIgnoreCase("WeddingTeleportPrice")) L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
  2072. else if (pName.equalsIgnoreCase("WeddingTeleportDuration")) L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
  2073. else if (pName.equalsIgnoreCase("WeddingAllowSameSex")) L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
  2074. else if (pName.equalsIgnoreCase("WeddingFormalWear")) L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
  2075. else if (pName.equalsIgnoreCase("WeddingDivorceCosts")) L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
  2076. else if (pName.equalsIgnoreCase("TvTEventEnabled")) TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  2077. else if (pName.equalsIgnoreCase("TvTEventInterval")) TVT_EVENT_INTERVAL = Integer.parseInt(pValue);
  2078. else if (pName.equalsIgnoreCase("TvTEventParticipationTime")) TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  2079. else if (pName.equalsIgnoreCase("TvTEventRunningTime")) TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  2080. else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId")) TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  2081. // PvP settings
  2082. else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
  2083. else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
  2084. else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
  2085. else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);
  2086. else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.valueOf(pValue);
  2087. else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.valueOf(pValue);
  2088. else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);
  2089. else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
  2090. else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
  2091. else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
  2092. else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
  2093. else if (pName.equalsIgnoreCase("MenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
  2094. else return false;
  2095. return true;
  2096. }
  2097. /**
  2098. * Allow the player to use L2Walker ?
  2099. * @param player (L2PcInstance) : Player trying to use L2Walker
  2100. * @return boolean : true if (L2Walker allowed as a general rule) or (L2Walker client allowed for GM and
  2101. * player is a GM)
  2102. */
  2103. public static boolean allowL2Walker(L2PcInstance player)
  2104. {
  2105. return (ALLOW_L2WALKER_CLIENT == L2WalkerAllowed.True ||
  2106. (ALLOW_L2WALKER_CLIENT == L2WalkerAllowed.GM && player != null && player.isGM()));
  2107. }
  2108. // it has no instances
  2109. private Config() {}
  2110. /**
  2111. * Save hexadecimal ID of the server in the properties file.
  2112. * @param string (String) : hexadecimal ID of the server to store
  2113. * @see HEXID_FILE
  2114. * @see saveHexid(String string, String fileName)
  2115. * @link LoginServerThread
  2116. */
  2117. public static void saveHexid(int serverId, String string)
  2118. {
  2119. Config.saveHexid(serverId, string, HEXID_FILE);
  2120. }
  2121. /**
  2122. * Save hexadecimal ID of the server in the properties file.
  2123. * @param hexId (String) : hexadecimal ID of the server to store
  2124. * @param fileName (String) : name of the properties file
  2125. */
  2126. public static void saveHexid(int serverId, String hexId, String fileName)
  2127. {
  2128. try
  2129. {
  2130. Properties hexSetting = new Properties();
  2131. File file = new File(fileName);
  2132. //Create a new empty file only if it doesn't exist
  2133. file.createNewFile();
  2134. OutputStream out = new FileOutputStream(file);
  2135. hexSetting.setProperty("ServerID",String.valueOf(serverId));
  2136. hexSetting.setProperty("HexID",hexId);
  2137. hexSetting.store(out,"the hexID to auth into login");
  2138. out.close();
  2139. }
  2140. catch (Exception e)
  2141. {
  2142. _log.warning("Failed to save hex id to "+fileName+" File.");
  2143. e.printStackTrace();
  2144. }
  2145. }
  2146. }