· 10 years ago · Jul 01, 2016, 03:45 AM
1### Eclipse Workspace Patch 1.0
2#P Lisvus_GameServer
3Index: java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java
4===================================================================
5--- java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java (revision 575)
6+++ java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java (working copy)
7@@ -40,464 +40,513 @@
8
9 public class RequestEnchantItem extends ClientBasePacket
10 {
11- protected static final Logger _log = Logger.getLogger(Inventory.class.getName());
12- private static final String _C__58_REQUESTENCHANTITEM = "[C] 58 RequestEnchantItem";
13- private static final int[] crystalScrolls = {731, 732, 949, 950, 953, 954, 957, 958, 961, 962 };
14-
15- private int _objectId;
16- /**
17- * packet type id 0x58
18- *
19- * sample
20- *
21- * 58
22- * c0 d5 00 10 // objectId
23- *
24- * format: cd
25- * @param decrypt
26- */
27- public RequestEnchantItem(ByteBuffer buf, ClientThread client)
28- {
29- super(buf, client);
30- _objectId = 0;
31- try
32- {
33- _objectId = readD();
34- }
35- catch (Exception e) {}
36- }
37-
38- @Override
39- public void runImpl()
40- {
41- L2PcInstance activeChar = getClient().getActiveChar();
42- if (activeChar == null || _objectId == 0)
43- return;
44-
45-
46- if (activeChar.isProcessingTransaction() || activeChar.getPrivateStoreType() != 0)
47- {
48- activeChar.sendPacket(new SystemMessage(1688));
49- activeChar.setActiveEnchantItem(null);
50- activeChar.sendPacket(new EnchantResult(2));
51- return;
52- }
53-
54- L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
55- L2ItemInstance scroll = activeChar.getActiveEnchantItem();
56-
57- if (item == null || scroll == null)
58- {
59- activeChar.setActiveEnchantItem(null);
60- activeChar.sendPacket(new EnchantResult(2));
61- return;
62- }
63-
64- // can't enchant rods and hero weapons
65- if (item.getItem().getItemType() == L2WeaponType.ROD || (!Config.ALLOW_HERO_ENCHANT && item.getItemId() >= 6611 && item.getItemId() <= 6621) || item.getItemId() >= 7816 && item.getItemId() <= 7831)
66- {
67- activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
68- activeChar.setActiveEnchantItem(null);
69- activeChar.sendPacket(new EnchantResult(2));
70- return;
71- }
72-
73- if (item.isWear())
74- {
75- Util.handleIllegalPlayerAction(activeChar,"Player "+activeChar.getName()+" tried to enchant a weared Item", IllegalPlayerAction.PUNISH_KICK);
76- activeChar.setActiveEnchantItem(null);
77- activeChar.sendPacket(new EnchantResult(2));
78- return;
79- }
80-
81- switch (item.getLocation())
82- {
83- case INVENTORY:
84- case PAPERDOLL:
85- {
86- if (item.getOwnerId() != activeChar.getObjectId())
87- {
88- activeChar.setActiveEnchantItem(null);
89- activeChar.sendPacket(new EnchantResult(2));
90- return;
91- }
92- break;
93- }
94- default:
95- {
96- Util.handleIllegalPlayerAction(activeChar,"Player "+activeChar.getName()+" tried to use enchant Exploit!", IllegalPlayerAction.PUNISH_KICKBAN);
97- activeChar.setActiveEnchantItem(null);
98- activeChar.sendPacket(new EnchantResult(2));
99- return;
100- }
101- }
102-
103- if (activeChar.getActiveWarehouse() != null)
104- activeChar.setActiveWarehouse(null);
105-
106- int itemType2 = item.getItem().getType2();
107-
108- boolean blessedScroll = false;
109- boolean enchantItem = false;
110- int crystalId = 0;
111-
112- /** pretty code ;D */
113- switch (item.getItem().getCrystalType())
114- {
115- case L2Item.CRYSTAL_S:
116- crystalId = 1462;
117- switch(scroll.getItemId())
118- {
119- case 959:
120- case 961:
121- case 6577:
122- if (itemType2 == L2Item.TYPE2_WEAPON)
123- enchantItem = true;
124- break;
125- case 960:
126- case 962:
127- case 6578:
128- if (itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
129- enchantItem = true;
130- break;
131- }
132- break;
133- case L2Item.CRYSTAL_A:
134- crystalId = 1461;
135- switch(scroll.getItemId())
136- {
137- case 729:
138- case 731:
139- case 6569:
140- if (itemType2 == L2Item.TYPE2_WEAPON)
141- enchantItem = true;
142- break;
143- case 730:
144- case 732:
145- case 6570:
146- if (itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
147- enchantItem = true;
148-
149- break;
150- }
151- break;
152- case L2Item.CRYSTAL_B:
153- crystalId = 1460;
154- switch(scroll.getItemId())
155- {
156- case 947:
157- case 949:
158- case 6571:
159- if (itemType2 == L2Item.TYPE2_WEAPON)
160- enchantItem = true;
161- break;
162- case 948:
163- case 950:
164- case 6572:
165- if (itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
166- enchantItem = true;
167- break;
168- }
169- break;
170- case L2Item.CRYSTAL_C:
171- crystalId = 1459;
172- switch(scroll.getItemId())
173- {
174- case 951:
175- case 953:
176- case 6573:
177- if (itemType2 == L2Item.TYPE2_WEAPON)
178- enchantItem = true;
179- break;
180- case 952:
181- case 954:
182- case 6574:
183- if (itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
184- enchantItem = true;
185- break;
186- }
187- break;
188- case L2Item.CRYSTAL_D:
189- crystalId = 1458;
190- switch(scroll.getItemId())
191- {
192- case 955:
193- case 957:
194- case 6575:
195- if (itemType2 == L2Item.TYPE2_WEAPON)
196- enchantItem = true;
197- break;
198- case 956:
199- case 958:
200- case 6576:
201- if (itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
202- enchantItem = true;
203- break;
204- }
205- break;
206-
207- }
208-
209-
210- if (!enchantItem)
211- {
212- activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
213- activeChar.setActiveEnchantItem(null);
214- activeChar.sendPacket(new EnchantResult(2));
215- return;
216- }
217-
218- // Get the scroll type - Yesod
219- if (scroll.getItemId() >= 6569 && scroll.getItemId() <= 6578)
220- blessedScroll = true;
221- else
222- {
223- for (int crystalscroll : crystalScrolls)
224- {
225- if (scroll.getItemId() == crystalscroll)
226-
227- blessedScroll = true;
228-
229- break;
230-
231- }
232-
233- }
234-
235- int chance = 0;
236- int maxEnchantLevel = 0;
237-
238- if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
239- {
240- if (blessedScroll)
241- chance = Config.BLESSED_ENCHANT_CHANCE_WEAPON;
242- else
243- chance = Config.ENCHANT_CHANCE_WEAPON;
244- maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
245- }
246- else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
247- {
248- if (blessedScroll)
249- chance = Config.BLESSED_ENCHANT_CHANCE_ARMOR;
250- else
251- chance = Config.ENCHANT_CHANCE_ARMOR;
252- maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
253- }
254- else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
255- {
256- if (blessedScroll)
257- chance = Config.BLESSED_ENCHANT_CHANCE_JEWELRY;
258- else
259- chance = Config.ENCHANT_CHANCE_JEWELRY;
260- maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
261- }
262-
263- if (item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0)
264- {
265- activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
266- activeChar.setActiveEnchantItem(null);
267- activeChar.sendPacket(new EnchantResult(2));
268- return;
269- }
270-
271- scroll = activeChar.getInventory().destroyItem("Enchant", scroll, activeChar, item);
272- if (scroll == null)
273- {
274- activeChar.sendPacket(new SystemMessage(SystemMessage.NOT_ENOUGH_ITEMS));
275- Util.handleIllegalPlayerAction(activeChar,"Player "+activeChar.getName()+" tried to enchant with a scroll he doesnt have", Config.DEFAULT_PUNISH);
276- activeChar.setActiveEnchantItem(null);
277- activeChar.sendPacket(new EnchantResult(2));
278- return;
279- }
280-
281- if (item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX
282- || (item.getItem().getBodyPart() == L2Item.SLOT_FULL_ARMOR
283- && item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX_FULL))
284- chance = 100;
285-
286- boolean failed = false;
287- SystemMessage sm;
288-
289- if (Rnd.get(100) < chance)
290- {
291- synchronized(item)
292- {
293- if (item.getOwnerId() != activeChar.getObjectId())
294- {
295- activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
296- activeChar.setActiveEnchantItem(null);
297- activeChar.sendPacket(new EnchantResult(2));
298- return;
299- }
300-
301- if (item.getLocation() != L2ItemInstance.ItemLocation.INVENTORY && item.getLocation() != L2ItemInstance.ItemLocation.PAPERDOLL)
302- {
303- activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
304- activeChar.setActiveEnchantItem(null);
305- activeChar.sendPacket(new EnchantResult(2));
306- return;
307- }
308-
309- if (item.getEnchantLevel() == 0)
310- {
311- sm = new SystemMessage(SystemMessage.S1_SUCCESSFULLY_ENCHANTED);
312- sm.addItemName(item.getItemId());
313- activeChar.sendPacket(sm);
314- }
315- else
316- {
317- sm = new SystemMessage(SystemMessage.S1_S2_SUCCESSFULLY_ENCHANTED);
318- sm.addNumber(item.getEnchantLevel());
319- sm.addItemName(item.getItemId());
320- activeChar.sendPacket(sm);
321- }
322-
323- if (item.isEquipped())
324- {
325- // Enchant protection: Begin
326- activeChar.getInventory().unEquipItemInSlotAndRecord(item.getEquipSlot());
327-
328- item.setEnchantLevel(item.getEnchantLevel()+1);
329-
330- activeChar.getInventory().equipItemAndRecord(item);
331- // Enchant protection: End
332- }
333- else
334- item.setEnchantLevel(item.getEnchantLevel()+1);
335-
336- item.updateDatabase();
337- }
338- }
339- else
340- {
341- failed = true;
342-
343- if (!blessedScroll)
344- {
345- if (item.getEnchantLevel() > 0)
346- {
347- sm = new SystemMessage(SystemMessage.ENCHANTMENT_FAILED_S1_S2_EVAPORATED);
348- sm.addNumber(item.getEnchantLevel());
349- sm.addItemName(item.getItemId());
350- activeChar.sendPacket(sm);
351- }
352- else
353- {
354- sm = new SystemMessage(SystemMessage.ENCHANTMENT_FAILED_S1_EVAPORATED);
355- sm.addItemName(item.getItemId());
356- activeChar.sendPacket(sm);
357- }
358-
359- if (item.isEquipped())
360- {
361- if (item.getEnchantLevel() > 0)
362- {
363- sm = new SystemMessage(SystemMessage.EQUIPMENT_S1_S2_REMOVED);
364- sm.addNumber(item.getEnchantLevel());
365- sm.addItemName(item.getItemId());
366- activeChar.sendPacket(sm);
367- }
368- else
369- {
370- sm = new SystemMessage(SystemMessage.S1_DISARMED);
371- sm.addItemName(item.getItemId());
372- activeChar.sendPacket(sm);
373- }
374-
375- L2ItemInstance[] unequiped = activeChar.getInventory().unEquipItemInSlotAndRecord(item.getEquipSlot());
376-
377- InventoryUpdate iu = new InventoryUpdate();
378- for (int i = 0; i < unequiped.length; i++)
379- {
380- iu.addModifiedItem(unequiped[i]);
381- }
382- activeChar.sendPacket(iu);
383-
384- activeChar.broadcastUserInfo();
385- }
386-
387-
388- int count = item.getCrystalCount() - (item.getItem().getCrystalCount() +1) / 2;
389- if (count < 1)
390- count = 1;
391-
392-
393- L2ItemInstance destroyItem = activeChar.getInventory().destroyItem("Enchant", item, activeChar, null);
394- if (destroyItem == null)
395- {
396- activeChar.setActiveEnchantItem(null);
397- activeChar.sendPacket(new EnchantResult(2));
398- return;
399- }
400-
401-
402- L2ItemInstance crystals = activeChar.getInventory().addItem("Enchant", crystalId, count, activeChar, destroyItem);
403-
404-
405- sm = new SystemMessage(SystemMessage.EARNED_S2_S1_s);
406- sm.addItemName(crystals.getItemId());
407- sm.addNumber(count);
408- activeChar.sendPacket(sm);
409-
410-
411- if (!Config.FORCE_INVENTORY_UPDATE)
412- {
413- InventoryUpdate iu = new InventoryUpdate();
414- if (destroyItem.getCount() == 0)
415- iu.addRemovedItem(destroyItem);
416- else
417- iu.addModifiedItem(destroyItem);
418- iu.addItem(crystals);
419-
420- activeChar.sendPacket(iu);
421- }
422- else
423- activeChar.sendPacket(new ItemList(activeChar, true));
424-
425-
426- StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
427- su.addAttribute(StatusUpdate.CUR_LOAD, activeChar.getCurrentLoad());
428- activeChar.sendPacket(su);
429-
430-
431- activeChar.broadcastUserInfo();
432-
433-
434-
435- L2World.getInstance().removeObject(destroyItem);
436- activeChar.sendPacket(new EnchantResult(1));
437- }
438- else
439- {
440- activeChar.sendPacket(new SystemMessage(SystemMessage.BLESSED_ENCHANT_FAILED));
441-
442- item.setEnchantLevel(0);
443- item.updateDatabase();
444- activeChar.sendPacket(new EnchantResult(2));
445- }
446- }
447- sm = null;
448-
449- StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
450- su.addAttribute(StatusUpdate.CUR_LOAD, activeChar.getCurrentLoad());
451- activeChar.sendPacket(su);
452-
453- su = null;
454-
455- if (!failed)
456- activeChar.sendPacket(new EnchantResult(0));
457-
458- activeChar.sendPacket(new ItemList(activeChar, false)); //TODO update only the enchanted item
459- activeChar.broadcastUserInfo();
460- activeChar.setActiveEnchantItem(null);
461-
462- }
463-
464- /* (non-Javadoc)
465- * @see net.sf.l2j.gameserver.clientpackets.ClientBasePacket#getType()
466- */
467- public String getType()
468- {
469- return _C__58_REQUESTENCHANTITEM;
470- }
471+ protected static final Logger _log = Logger.getLogger(Inventory.class.getName());
472+ private static final String _C__58_REQUESTENCHANTITEM = "[C] 58 RequestEnchantItem";
473+ private static final int[] crystalScrolls =
474+ {
475+ 731,
476+ 732,
477+ 949,
478+ 950,
479+ 953,
480+ 954,
481+ 957,
482+ 958,
483+ 961,
484+ 962
485+ };
486+
487+ private int _objectId;
488+
489+ /**
490+ * packet type id 0x58 sample 58 c0 d5 00 10 // objectId format: cd
491+ * @param decrypt
492+ */
493+ public RequestEnchantItem(ByteBuffer buf, ClientThread client)
494+ {
495+ super(buf, client);
496+ _objectId = 0;
497+ try
498+ {
499+ _objectId = readD();
500+ }
501+ catch (Exception e)
502+ {
503+ }
504+ }
505+
506+ @Override
507+ public void runImpl()
508+ {
509+ L2PcInstance activeChar = getClient().getActiveChar();
510+ if ((activeChar == null) || (_objectId == 0))
511+ {
512+ return;
513+ }
514+
515+ if (activeChar.isProcessingTransaction() || (activeChar.getPrivateStoreType() != 0))
516+ {
517+ activeChar.sendPacket(new SystemMessage(1688));
518+ activeChar.setActiveEnchantItem(null);
519+ activeChar.sendPacket(new EnchantResult(2));
520+ return;
521+ }
522+
523+ L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
524+ L2ItemInstance scroll = activeChar.getActiveEnchantItem();
525+
526+ if ((item == null) || (scroll == null))
527+ {
528+ activeChar.setActiveEnchantItem(null);
529+ activeChar.sendPacket(new EnchantResult(2));
530+ return;
531+ }
532+
533+ // can't enchant rods and hero weapons
534+ if ((item.getItem().getItemType() == L2WeaponType.ROD) || (!Config.ALLOW_HERO_ENCHANT && (item.getItemId() >= 6611) && (item.getItemId() <= 6621)) || ((item.getItemId() >= 7816) && (item.getItemId() <= 7831)))
535+ {
536+ activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
537+ activeChar.setActiveEnchantItem(null);
538+ activeChar.sendPacket(new EnchantResult(2));
539+ return;
540+ }
541+
542+ if (item.isWear())
543+ {
544+ Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " tried to enchant a weared Item", IllegalPlayerAction.PUNISH_KICK);
545+ activeChar.setActiveEnchantItem(null);
546+ activeChar.sendPacket(new EnchantResult(2));
547+ return;
548+ }
549+
550+ switch (item.getLocation())
551+ {
552+ case INVENTORY:
553+ case PAPERDOLL:
554+ {
555+ if (item.getOwnerId() != activeChar.getObjectId())
556+ {
557+ activeChar.setActiveEnchantItem(null);
558+ activeChar.sendPacket(new EnchantResult(2));
559+ return;
560+ }
561+ break;
562+ }
563+ default:
564+ {
565+ Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " tried to use enchant Exploit!", IllegalPlayerAction.PUNISH_KICKBAN);
566+ activeChar.setActiveEnchantItem(null);
567+ activeChar.sendPacket(new EnchantResult(2));
568+ return;
569+ }
570+ }
571+
572+ if (activeChar.getActiveWarehouse() != null)
573+ {
574+ activeChar.setActiveWarehouse(null);
575+ }
576+
577+ int itemType2 = item.getItem().getType2();
578+
579+ boolean blessedScroll = false;
580+ boolean enchantItem = false;
581+ int crystalId = 0;
582+
583+ /** pretty code ;D */
584+ switch (item.getItem().getCrystalType())
585+ {
586+ case L2Item.CRYSTAL_S:
587+ crystalId = 1462;
588+ switch (scroll.getItemId())
589+ {
590+ case 959:
591+ case 961:
592+ case 6577:
593+ if (itemType2 == L2Item.TYPE2_WEAPON)
594+ {
595+ enchantItem = true;
596+ }
597+ break;
598+ case 960:
599+ case 962:
600+ case 6578:
601+ if ((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
602+ {
603+ enchantItem = true;
604+ }
605+ break;
606+ }
607+ break;
608+ case L2Item.CRYSTAL_A:
609+ crystalId = 1461;
610+ switch (scroll.getItemId())
611+ {
612+ case 729:
613+ case 731:
614+ case 6569:
615+ if (itemType2 == L2Item.TYPE2_WEAPON)
616+ {
617+ enchantItem = true;
618+ }
619+ break;
620+ case 730:
621+ case 732:
622+ case 6570:
623+ if ((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
624+ {
625+ enchantItem = true;
626+ }
627+
628+ break;
629+ }
630+ break;
631+ case L2Item.CRYSTAL_B:
632+ crystalId = 1460;
633+ switch (scroll.getItemId())
634+ {
635+ case 947:
636+ case 949:
637+ case 6571:
638+ if (itemType2 == L2Item.TYPE2_WEAPON)
639+ {
640+ enchantItem = true;
641+ }
642+ break;
643+ case 948:
644+ case 950:
645+ case 6572:
646+ if ((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
647+ {
648+ enchantItem = true;
649+ }
650+ break;
651+ }
652+ break;
653+ case L2Item.CRYSTAL_C:
654+ crystalId = 1459;
655+ switch (scroll.getItemId())
656+ {
657+ case 951:
658+ case 953:
659+ case 6573:
660+ if (itemType2 == L2Item.TYPE2_WEAPON)
661+ {
662+ enchantItem = true;
663+ }
664+ break;
665+ case 952:
666+ case 954:
667+ case 6574:
668+ if ((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
669+ {
670+ enchantItem = true;
671+ }
672+ break;
673+ }
674+ break;
675+ case L2Item.CRYSTAL_D:
676+ crystalId = 1458;
677+ switch (scroll.getItemId())
678+ {
679+ case 955:
680+ case 957:
681+ case 6575:
682+ if (itemType2 == L2Item.TYPE2_WEAPON)
683+ {
684+ enchantItem = true;
685+ }
686+ break;
687+ case 956:
688+ case 958:
689+ case 6576:
690+ if ((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
691+ {
692+ enchantItem = true;
693+ }
694+ break;
695+ }
696+ break;
697+
698+ }
699+
700+ if (!enchantItem)
701+ {
702+ activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
703+ activeChar.setActiveEnchantItem(null);
704+ activeChar.sendPacket(new EnchantResult(2));
705+ return;
706+ }
707+
708+ // Get the scroll type - Yesod
709+ if ((scroll.getItemId() >= 6569) && (scroll.getItemId() <= 6578))
710+ {
711+ blessedScroll = true;
712+ }
713+ else
714+ {
715+ for (int crystalscroll : crystalScrolls)
716+ {
717+ if (scroll.getItemId() == crystalscroll)
718+ {
719+ blessedScroll = true;
720+ }
721+
722+ break;
723+
724+ }
725+
726+ }
727+
728+ int chance = 0;
729+ int maxEnchantLevel = 0;
730+
731+ if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
732+ {
733+ if (blessedScroll)
734+ {
735+ chance = Config.BLESSED_ENCHANT_CHANCE_WEAPON;
736+ }
737+ else
738+ {
739+ chance = Config.ENCHANT_CHANCE_WEAPON;
740+ }
741+ maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
742+ }
743+ else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
744+ {
745+ if (blessedScroll)
746+ {
747+ chance = Config.BLESSED_ENCHANT_CHANCE_ARMOR;
748+ }
749+ else
750+ {
751+ chance = Config.ENCHANT_CHANCE_ARMOR;
752+ }
753+ maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
754+ }
755+ else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
756+ {
757+ if (blessedScroll)
758+ {
759+ chance = Config.BLESSED_ENCHANT_CHANCE_JEWELRY;
760+ }
761+ else
762+ {
763+ chance = Config.ENCHANT_CHANCE_JEWELRY;
764+ }
765+ maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
766+ }
767+
768+ if ((item.getEnchantLevel() >= maxEnchantLevel) && (maxEnchantLevel != 0))
769+ {
770+ activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
771+ activeChar.setActiveEnchantItem(null);
772+ activeChar.sendPacket(new EnchantResult(2));
773+ return;
774+ }
775+
776+ scroll = activeChar.getInventory().destroyItem("Enchant", scroll, activeChar, item);
777+ if (scroll == null)
778+ {
779+ activeChar.sendPacket(new SystemMessage(SystemMessage.NOT_ENOUGH_ITEMS));
780+ Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " tried to enchant with a scroll he doesnt have", Config.DEFAULT_PUNISH);
781+ activeChar.setActiveEnchantItem(null);
782+ activeChar.sendPacket(new EnchantResult(2));
783+ return;
784+ }
785+
786+ if ((item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX) || ((item.getItem().getBodyPart() == L2Item.SLOT_FULL_ARMOR) && (item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX_FULL)))
787+ {
788+ chance = 100;
789+ }
790+
791+ boolean failed = false;
792+ SystemMessage sm;
793+
794+ if (Rnd.get(100) < chance)
795+ {
796+ synchronized (item)
797+ {
798+ if (item.getOwnerId() != activeChar.getObjectId())
799+ {
800+ activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
801+ activeChar.setActiveEnchantItem(null);
802+ activeChar.sendPacket(new EnchantResult(2));
803+ return;
804+ }
805+
806+ if ((item.getLocation() != L2ItemInstance.ItemLocation.INVENTORY) && (item.getLocation() != L2ItemInstance.ItemLocation.PAPERDOLL))
807+ {
808+ activeChar.sendPacket(new SystemMessage(SystemMessage.INAPPROPRIATE_ENCHANT_CONDITION));
809+ activeChar.setActiveEnchantItem(null);
810+ activeChar.sendPacket(new EnchantResult(2));
811+ return;
812+ }
813+
814+ if (item.getEnchantLevel() == 0)
815+ {
816+ sm = new SystemMessage(SystemMessage.S1_SUCCESSFULLY_ENCHANTED);
817+ sm.addItemName(item.getItemId());
818+ activeChar.sendPacket(sm);
819+ }
820+ else
821+ {
822+ sm = new SystemMessage(SystemMessage.S1_S2_SUCCESSFULLY_ENCHANTED);
823+ sm.addNumber(item.getEnchantLevel());
824+ sm.addItemName(item.getItemId());
825+ activeChar.sendPacket(sm);
826+ }
827+
828+ if (item.isEquipped())
829+ {
830+ // Enchant protection: Begin
831+ activeChar.getInventory().unEquipItemInSlotAndRecord(item.getEquipSlot());
832+
833+ item.setEnchantLevel(item.getEnchantLevel() + 1);
834+
835+ activeChar.getInventory().equipItemAndRecord(item);
836+ // Enchant protection: End
837+ }
838+ else
839+ {
840+ item.setEnchantLevel(item.getEnchantLevel() + 1);
841+ }
842+
843+ item.updateDatabase();
844+ }
845+ }
846+ else
847+ {
848+ failed = true;
849+
850+ if (!blessedScroll)
851+ {
852+ if (item.getEnchantLevel() > 0)
853+ {
854+ sm = new SystemMessage(SystemMessage.ENCHANTMENT_FAILED_S1_S2_EVAPORATED);
855+ sm.addNumber(item.getEnchantLevel());
856+ sm.addItemName(item.getItemId());
857+ activeChar.sendPacket(sm);
858+ }
859+ else
860+ {
861+ sm = new SystemMessage(SystemMessage.ENCHANTMENT_FAILED_S1_EVAPORATED);
862+ sm.addItemName(item.getItemId());
863+ activeChar.sendPacket(sm);
864+ }
865+
866+ if (item.isEquipped())
867+ {
868+ if (item.getEnchantLevel() > 0)
869+ {
870+ sm = new SystemMessage(SystemMessage.EQUIPMENT_S1_S2_REMOVED);
871+ sm.addNumber(item.getEnchantLevel());
872+ sm.addItemName(item.getItemId());
873+ activeChar.sendPacket(sm);
874+ }
875+ else
876+ {
877+ sm = new SystemMessage(SystemMessage.S1_DISARMED);
878+ sm.addItemName(item.getItemId());
879+ activeChar.sendPacket(sm);
880+ }
881+
882+ L2ItemInstance[] unequiped = activeChar.getInventory().unEquipItemInSlotAndRecord(item.getEquipSlot());
883+
884+ InventoryUpdate iu = new InventoryUpdate();
885+ for (L2ItemInstance element : unequiped)
886+ {
887+ iu.addModifiedItem(element);
888+ }
889+ activeChar.sendPacket(iu);
890+
891+ activeChar.broadcastUserInfo();
892+ }
893+
894+ int count = item.getCrystalCount() - ((item.getItem().getCrystalCount() + 1) / 2);
895+ if (count < 1)
896+ {
897+ count = 1;
898+ }
899+
900+ L2ItemInstance destroyItem = activeChar.getInventory().destroyItem("Enchant", item, activeChar, null);
901+ if (destroyItem == null)
902+ {
903+ activeChar.setActiveEnchantItem(null);
904+ activeChar.sendPacket(new EnchantResult(2));
905+ return;
906+ }
907+
908+ L2ItemInstance crystals = activeChar.getInventory().addItem("Enchant", crystalId, count, activeChar, destroyItem);
909+
910+ sm = new SystemMessage(SystemMessage.EARNED_S2_S1_s);
911+ sm.addItemName(crystals.getItemId());
912+ sm.addNumber(count);
913+ activeChar.sendPacket(sm);
914+
915+ if (!Config.FORCE_INVENTORY_UPDATE)
916+ {
917+ InventoryUpdate iu = new InventoryUpdate();
918+ if (destroyItem.getCount() == 0)
919+ {
920+ iu.addRemovedItem(destroyItem);
921+ }
922+ else
923+ {
924+ iu.addModifiedItem(destroyItem);
925+ }
926+ iu.addItem(crystals);
927+
928+ activeChar.sendPacket(iu);
929+ }
930+ else
931+ {
932+ activeChar.sendPacket(new ItemList(activeChar, true));
933+ }
934+
935+ StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
936+ su.addAttribute(StatusUpdate.CUR_LOAD, activeChar.getCurrentLoad());
937+ activeChar.sendPacket(su);
938+
939+ activeChar.broadcastUserInfo();
940+
941+ L2World.getInstance().removeObject(destroyItem);
942+ activeChar.sendPacket(new EnchantResult(1));
943+ }
944+ else
945+ {
946+ activeChar.sendPacket(new SystemMessage(SystemMessage.BLESSED_ENCHANT_FAILED));
947+
948+ item.setEnchantLevel(Config.BREAK_ENCHANT);
949+ item.updateDatabase();
950+ }
951+ }
952+ sm = null;
953+
954+ StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
955+ su.addAttribute(StatusUpdate.CUR_LOAD, activeChar.getCurrentLoad());
956+ activeChar.sendPacket(su);
957+
958+ su = null;
959+
960+ if (!failed)
961+ {
962+ activeChar.sendPacket(new EnchantResult(0));
963+ }
964+
965+ activeChar.sendPacket(new ItemList(activeChar, false)); // TODO update only the enchanted item
966+ activeChar.broadcastUserInfo();
967+ activeChar.setActiveEnchantItem(null);
968+
969+ }
970+
971+ /*
972+ * (non-Javadoc)
973+ * @see net.sf.l2j.gameserver.clientpackets.ClientBasePacket#getType()
974+ */
975+ @Override
976+ public String getType()
977+ {
978+ return _C__58_REQUESTENCHANTITEM;
979+ }
980 }
981\ No newline at end of file
982Index: java/net/sf/l2j/Config.java
983===================================================================
984--- java/net/sf/l2j/Config.java (revision 575)
985+++ java/net/sf/l2j/Config.java (working copy)
986@@ -32,10 +32,8 @@
987
988 import gnu.trove.map.hash.TIntIntHashMap;
989 import gnu.trove.map.hash.TIntObjectHashMap;
990-
991 import javolution.util.FastList;
992 import javolution.util.FastMap;
993-
994 import net.sf.l2j.gameserver.model.base.Experience;
995 import net.sf.l2j.gameserver.util.FloodProtectorConfig;
996 import net.sf.l2j.util.StringUtil;
997@@ -43,2763 +41,3304 @@
998 /**
999 * This class contains global server configuration.<br>
1000 * It has static final fields initialized from configuration files.<br>
1001- * It's initialized at the very begin of startup, and later JIT will optimize
1002- * away debug/unused code.
1003- *
1004+ * It's initialized at the very begin of startup, and later JIT will optimize away debug/unused code.
1005 * @author mkizub
1006 */
1007-public final class Config
1008+public final class Config
1009 {
1010- protected static Logger _log = Logger.getLogger(Config.class.getName());
1011- /** Debug/release mode */
1012- public static boolean DEBUG;
1013- /** Enable/disable assertions */
1014- public static boolean ASSERT;
1015- /** Enable/disable code 'in progress' */
1016- public static boolean DEVELOPER;
1017-
1018- /** Set if this server is a test server used for development */
1019- public static boolean TEST_SERVER;
1020-
1021- /** Game Server ports */
1022- public static int PORT_GAME;
1023- /** Login Server port */
1024- public static int PORT_LOGIN;
1025- /** Login Server bind ip */
1026- public static String LOGIN_BIND_ADDRESS;
1027- /** Number of tries of login before ban */
1028- public static int LOGIN_TRY_BEFORE_BAN;
1029- /** Number of seconds the IP ban will last, default 10 minutes */
1030- public static int LOGIN_BLOCK_AFTER_BAN;
1031-
1032- /** Hostname of the Game Server */
1033- public static String GAMESERVER_HOSTNAME;
1034-
1035- // Access to database
1036- /** Driver to access to database */
1037- public static String DATABASE_DRIVER;
1038- /** Path to access to database */
1039- public static String DATABASE_URL;
1040- /** Database login */
1041- public static String DATABASE_LOGIN;
1042- /** Database password */
1043- public static String DATABASE_PASSWORD;
1044- /** Maximum number of connections to the database */
1045- public static int DATABASE_MAX_CONNECTIONS;
1046- /** Time until a connection is closed */
1047- public static long CONNECTION_CLOSE_TIME;
1048-
1049- /** Maximum number of players allowed to play simultaneously on server */
1050- public static int MAXIMUM_ONLINE_USERS;
1051-
1052- // Setting for serverList
1053- /** Displays [] in front of server name ? */
1054- public static boolean SERVER_LIST_BRACKET;
1055- /** Displays a clock next to the server name ? */
1056- public static boolean SERVER_LIST_CLOCK;
1057- /** Display test server in the list of servers ? */
1058- public static boolean SERVER_LIST_TESTSERVER;
1059- /** Set the server as gm only at startup ? */
1060- public static boolean SERVER_GMONLY;
1061-
1062- // Thread pools size
1063- /** Thread pool size effect */
1064- public static int THREAD_P_EFFECTS;
1065- /** Thread pool size general */
1066- public static int THREAD_P_GENERAL;
1067- /** Packet max thread */
1068- public static int GENERAL_PACKET_THREAD_CORE_SIZE;
1069- public static int IO_PACKET_THREAD_CORE_SIZE;
1070- /** General max thread */
1071- public static int GENERAL_THREAD_CORE_SIZE;
1072- /** AI max thread */
1073- public static int AI_MAX_THREAD;
1074-
1075- /** Accept auto-loot ? */
1076- public static boolean AUTO_LOOT;
1077- /** Accept auto-loot for RBs ? */
1078- public static boolean AUTO_LOOT_RAIDS;
1079-
1080- /** Character name template */
1081- public static String CNAME_TEMPLATE;
1082- /** Pet name template */
1083- public static String PET_NAME_TEMPLATE;
1084- /** Maximum number of characters per account */
1085- public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
1086-
1087- /** Global chat state */
1088- public static String DEFAULT_GLOBAL_CHAT;
1089- /** Trade chat state */
1090- public static String DEFAULT_TRADE_CHAT;
1091- /** For test servers - everybody has admin rights */
1092- public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
1093- /** Display server revision */
1094- public static boolean DISPLAY_SERVER_VERSION;
1095- /** Alternative game crafting */
1096- public static boolean ALT_GAME_CREATION;
1097- /** Alternative game crafting speed mutiplier - default 0 (fastest but still not instant) */
1098- public static double ALT_GAME_CREATION_SPEED;
1099- /** Alternative game crafting XP rate multiplier - default 1*/
1100- public static double ALT_GAME_CREATION_XP_RATE;
1101- /** Alternative game crafting SP rate multiplier - default 1*/
1102- public static double ALT_GAME_CREATION_SP_RATE;
1103- /** Check if skills learned by a character are legal */
1104- public static boolean SKILL_CHECK_ENABLE;
1105-
1106- /** Enable modifying skill duration */
1107- public static boolean ENABLE_MODIFY_SKILL_DURATION;
1108- /** Skill duration list */
1109- public static Map<Integer, Integer> SKILL_DURATION_LIST;
1110- /** Block exp/sp command */
1111- public static boolean Boost_EXP_COMMAND;
1112- /** Enable Auto NPC target */
1113- public static boolean AUTO_TARGET_NPC;
1114- /** Enable Real Time */
1115- public static boolean ENABLE_REAL_TIME;
1116-
1117- /** Alternative game skill learning */
1118- public static boolean ALT_GAME_SKILL_LEARN;
1119- /** Alternative auto skill learning */
1120- public static boolean AUTO_LEARN_SKILLS;
1121- /** Alternative auto skill learning for 3rd class */
1122- public static boolean AUTO_LEARN_3RD_SKILLS;
1123- /** Cancel attack bow by hit */
1124- public static boolean ALT_GAME_CANCEL_BOW;
1125- /** Cancel cast by hit */
1126- public static boolean ALT_GAME_CANCEL_CAST;
1127-
1128- /** Alternative game - use tiredness, instead of CP */
1129- public static boolean ALT_GAME_TIREDNESS;
1130-
1131- /** Party Range */
1132- public static int ALT_PARTY_RANGE;
1133- public static int ALT_PARTY_RANGE2;
1134-
1135- /** Alternative Perfect shield defense rate */
1136- public static int ALT_PERFECT_SHLD_BLOCK;
1137-
1138- /** Alternative mob aggro in peaceful zone */
1139- public static boolean ALT_MOB_AGGRO_IN_PEACEZONE;
1140-
1141-
1142- /** Alternative freight modes - Freights can be withdrawed from any village */
1143- public static boolean ALT_GAME_FREIGHTS;
1144- /** Alternative freight modes - Sets the price value for each freightened item */
1145- public static int ALT_GAME_FREIGHT_PRICE;
1146-
1147- /** Alternative gaming - loss of XP on death */
1148- public static boolean ALT_GAME_DELEVEL;
1149-
1150- /** Alternative Weight Limit */
1151- public static double ALT_WEIGHT_LIMIT;
1152-
1153- /** Alternative gaming - magic dmg failures */
1154- public static boolean ALT_GAME_MAGICFAILURES;
1155-
1156- /** Alternative gaming - player must be in a castle-owning clan or ally to sign up for Dawn. */
1157- public static boolean ALT_GAME_REQUIRE_CASTLE_DAWN;
1158-
1159- /** Alternative gaming - allow clan-based castle ownage check rather than ally-based. */
1160- public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
1161-
1162- /** Alternative gaming - allow free teleporting around the world. */
1163- public static boolean ALT_GAME_FREE_TELEPORT;
1164-
1165- /** Disallow recommend character twice or more a day ? */
1166- public static boolean ALT_RECOMMEND;
1167-
1168- /** Alternative gaming - add more or less than 3 sub-classes. */
1169- public static int ALT_MAX_SUBCLASS;
1170-
1171- /** Alternative gaming - allow sub-class addition without quest completion. */
1172- public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
1173-
1174- /** Alternative gaming - allow/disallow tutorial. */
1175- public static boolean ALT_ENABLE_TUTORIAL;
1176-
1177- /** View npc stats/drop by shift-cliking it for nongm-players */
1178- public static boolean ALT_GAME_VIEWNPC;
1179-
1180- /** Minimum number of player to participate in SevenSigns Festival */
1181- public static int ALT_FESTIVAL_MIN_PLAYER;
1182-
1183- /** Maximum of player contrib during Festival */
1184- public static int ALT_MAXIMUM_PLAYER_CONTRIB;
1185-
1186- /** Festival Manager start time. */
1187- public static long ALT_FESTIVAL_MANAGER_START;
1188-
1189- /** Festival Length */
1190- public static long ALT_FESTIVAL_LENGTH;
1191-
1192- /** Festival Cycle Length */
1193- public static long ALT_FESTIVAL_CYCLE_LENGTH;
1194-
1195- /** Festival First Spawn */
1196- public static long ALT_FESTIVAL_FIRST_SPAWN;
1197-
1198- /** Festival First Swarm */
1199- public static long ALT_FESTIVAL_FIRST_SWARM;
1200-
1201- /** Festival Second Spawn */
1202- public static long ALT_FESTIVAL_SECOND_SPAWN;
1203-
1204- /** Festival Second Swarm */
1205- public static long ALT_FESTIVAL_SECOND_SWARM;
1206-
1207- /** Festival Chest Spawn */
1208- public static long ALT_FESTIVAL_CHEST_SPAWN;
1209-
1210- /** Number of members needed to request a clan war */
1211- public static int ALT_CLAN_MEMBERS_FOR_WAR;
1212-
1213- /** Number of days before joining a new clan */
1214- public static int ALT_CLAN_JOIN_DAYS;
1215- /** Number of days before creating a new clan */
1216- public static int ALT_CLAN_CREATE_DAYS;
1217- /** Number of days it takes to dissolve a clan */
1218- public static int ALT_CLAN_DISSOLVE_DAYS;
1219- /** Number of days it takes to dissolve a clan again */
1220- public static int ALT_RECOVERY_PENALTY;
1221-
1222-
1223- /** Number of days before joining a new alliance when clan voluntarily leave an alliance */
1224- public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
1225- /** Number of days before joining a new alliance when clan was dismissed from an alliance */
1226- public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
1227- /** Number of days before accepting a new clan for alliance when clan was dismissed from an alliance */
1228- public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
1229- /** Number of days before creating a new alliance when dissolved an alliance */
1230- public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
1231- /** Maximum number of clans in ally */
1232- public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
1233- /** Minimum number of parties to activate command channel */
1234- public static int ALT_CHANNEL_ACTIVATION_COUNT;
1235-
1236- /** Alternative gaming - all new characters always are newbies. */
1237- public static boolean ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE;
1238-
1239- /** Spell Book needed to learn skill */
1240- public static boolean SP_BOOK_NEEDED;
1241- /** Spell Book needet to enchant skill */
1242- public static boolean ES_SP_BOOK_NEEDED;
1243- /** Logging Chat Window */
1244- public static boolean LOG_CHAT;
1245- /** Logging Item Window */
1246- public static boolean LOG_ITEMS;
1247-
1248- /** Alternative privileges for admin */
1249- public static boolean ALT_PRIVILEGES_ADMIN;
1250- /** Alternative secure check privileges */
1251- public static boolean ALT_PRIVILEGES_SECURE_CHECK;
1252- /** Alternative default level for privileges */
1253- public static int ALT_PRIVILEGES_DEFAULT_LEVEL;
1254-
1255- /** Olympiad Competition Starting time */
1256- public static int ALT_OLY_START_TIME;
1257-
1258- /** Olympiad Minutes */
1259- public static int ALT_OLY_MIN;
1260-
1261- /** Olympiad Competition Period */
1262- public static long ALT_OLY_CPERIOD;
1263-
1264- /** Olympiad Battle Period */
1265- public static long ALT_OLY_BATTLE;
1266-
1267- /** Olympiad Battle Wait */
1268- public static long ALT_OLY_BWAIT;
1269-
1270- /** Olympiad Inital Wait */
1271- public static long ALT_OLY_IWAIT;
1272-
1273- /** Olympiad Weekly Period */
1274- public static long ALT_OLY_WPERIOD;
1275-
1276- /** Olympiad Validation Period */
1277- public static long ALT_OLY_VPERIOD;
1278-
1279- /** Olympiad Base Class */
1280- public static int ALT_OLY_CLASSED;
1281-
1282- /** Olympiad Non Base Class */
1283- public static int ALT_OLY_NONCLASSED;
1284-
1285- /** Olympiad Battle Reward */
1286- public static int ALT_OLY_BATTLE_REWARD_ITEM;
1287-
1288- /** Olympiad Class Based Reward Count */
1289- public static int ALT_OLY_CLASSED_RITEM_C;
1290-
1291- /** Olympiad Non Base Reward Count */
1292- public static int ALT_OLY_NONCLASSED_RITEM_C;
1293-
1294- /** Olympiad Competition Reward */
1295- public static int ALT_OLY_COMP_RITEM;
1296-
1297- /** Olympiad Item Reward */
1298- public static int ALT_OLY_GP_PER_POINT;
1299-
1300- /** Olympiad Min Points For Reward */
1301- public static int ALT_OLY_MIN_POINT_FOR_EXCH;
1302-
1303- /** Olympiad Hero Points */
1304- public static int ALT_OLY_HERO_POINTS;
1305-
1306- /** Manor Refresh Starting time */
1307- public static int ALT_MANOR_REFRESH_TIME;
1308-
1309- /** Manor Refresh Min */
1310- public static int ALT_MANOR_REFRESH_MIN;
1311-
1312- /** Manor Next Period Approve Starting time */
1313- public static int ALT_MANOR_APPROVE_TIME;
1314-
1315- /** Manor Next Period Approve Min */
1316- public static int ALT_MANOR_APPROVE_MIN;
1317-
1318- /** Manor Maintenance Time */
1319- public static int ALT_MANOR_MAINTENANCE_PERIOD;
1320-
1321- /** Manor Save All Actions */
1322- public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
1323-
1324- /** Manor Save Period Rate */
1325- public static int ALT_MANOR_SAVE_PERIOD_RATE;
1326-
1327-
1328- /** Initial Lottery prize */
1329- public static int ALT_LOTTERY_PRIZE;
1330-
1331- /** Lottery Ticket Price */
1332- public static int ALT_LOTTERY_TICKET_PRICE;
1333-
1334- /** What part of jackpot amount should receive characters who pick 5 wining numbers */
1335- public static float ALT_LOTTERY_5_NUMBER_RATE;
1336-
1337- /** What part of jackpot amount should receive characters who pick 4 wining numbers */
1338- public static float ALT_LOTTERY_4_NUMBER_RATE;
1339-
1340- /** What part of jackpot amount should receive characters who pick 3 wining numbers */
1341- public static float ALT_LOTTERY_3_NUMBER_RATE;
1342-
1343- /** How much adena receive characters who pick two or less of the winning number */
1344- public static int ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
1345-
1346- /** Four Sepulcher Settings */
1347- public static int FS_PENDING_TIME;
1348- public static int FS_ENTRY_TIME;
1349- public static int FS_PARTY_MEMBER_COUNT;
1350-
1351- /** Minimum size of a party that may enter dimensional rift */
1352- public static int RIFT_MIN_PARTY_SIZE;
1353-
1354- /** Time in ms the party has to wait until the mobs spawn when entering a room */
1355- public static int RIFT_SPAWN_DELAY;
1356-
1357- /** Amount of random rift jumps before party is ported back */
1358- public static int RIFT_MAX_JUMPS;
1359-
1360- /** Random time between two jumps in dimensional rift - in seconds */
1361- public static int RIFT_AUTO_JUMPS_TIME_MIN;
1362- public static int RIFT_AUTO_JUMPS_TIME_MAX;
1363-
1364- /** Dimensional Fragment cost for entering rift */
1365- public static int RIFT_ENTER_COST_RECRUIT;
1366- public static int RIFT_ENTER_COST_SOLDIER;
1367- public static int RIFT_ENTER_COST_OFFICER;
1368- public static int RIFT_ENTER_COST_CAPTAIN;
1369- public static int RIFT_ENTER_COST_COMMANDER;
1370- public static int RIFT_ENTER_COST_HERO;
1371-
1372- /** Time multiplier for boss room */
1373- public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
1374-
1375- /* **************************************************************************
1376- * GM CONFIG General GM AccessLevel *
1377- ************************************************************************* */
1378- /** General GM access level */
1379- public static int GM_ACCESSLEVEL;
1380- /** General GM Minimal AccessLevel */
1381- public static int GM_MIN;
1382- /** General GM AccessLevel to change announcements */
1383- public static int GM_ANNOUNCE;
1384- /** General GM AccessLevel can /ban /unban */
1385- public static int GM_BAN;
1386- /** General GM AccessLevel can /ban /unban for chat */
1387- public static int GM_BAN_CHAT;
1388- /** General GM AccessLevel can /create_item and /gmshop */
1389- public static int GM_CREATE_ITEM;
1390- /** General GM AccessLevel can /delete */
1391- public static int GM_DELETE;
1392- /** General GM AccessLevel can /kick /disconnect */
1393- public static int GM_KICK;
1394- /** General GM AccessLevel for access to GMMenu */
1395- public static int GM_MENU;
1396- /** General GM AccessLevel to use god mode command */
1397- public static int GM_GODMODE;
1398- /** General GM AccessLevel with character edit rights */
1399- public static int GM_CHAR_EDIT;
1400- /** General GM AccessLevel with edit rights for other characters */
1401- public static int GM_CHAR_EDIT_OTHER;
1402- /** General GM AccessLevel with character view rights */
1403- public static int GM_CHAR_VIEW;
1404- /** General GM AccessLevel with NPC edit rights */
1405- public static int GM_NPC_EDIT;
1406- public static int GM_NPC_VIEW;
1407- /** General GM AccessLevel to teleport to any location */
1408- public static int GM_TELEPORT;
1409- /** General GM AccessLevel to teleport character to any location */
1410- public static int GM_TELEPORT_OTHER;
1411- /** General GM AccessLevel to restart server */
1412- public static int GM_RESTART;
1413- /** General GM AccessLevel for MonsterRace */
1414- public static int GM_MONSTERRACE;
1415- /** General GM AccessLevel to ride Wyvern */
1416- public static int GM_RIDER;
1417- /** General GM AccessLevel to unstuck without 5min delay */
1418- public static int GM_ESCAPE;
1419- /** General GM AccessLevel to resurect fixed after death */
1420- public static int GM_FIXED;
1421- /** General GM AccessLevel to create Path Nodes */
1422- public static int GM_CREATE_NODES;
1423- /** General GM AccessLevel with Enchant rights */
1424- public static int GM_ENCHANT;
1425- /** General GM AccessLevel to close/open Doors */
1426- public static int GM_DOOR;
1427- /** General GM AccessLevel with Resurrection rights */
1428- public static int GM_RES;
1429- /** General GM AccessLevel to attack in the peace zone */
1430- public static int GM_PEACEATTACK;
1431- /** General GM AccessLevel to heal */
1432- public static int GM_HEAL;
1433- /** General GM AccessLevel to unblock IPs detected as hack IPs */
1434- public static int GM_UNBLOCK;
1435- /** General GM AccessLevel to use Cache commands */
1436- public static int GM_CACHE;
1437- /** General GM AccessLevel to use test&st commands */
1438- public static int GM_TALK_BLOCK;
1439- public static int GM_TEST;
1440- /** Disable transaction on AccessLevel **/
1441- public static boolean GM_DISABLE_TRANSACTION;
1442- /** GM transactions disabled from this range */
1443- public static int GM_TRANSACTION_MIN;
1444- /** GM transactions disabled to this range */
1445- public static int GM_TRANSACTION_MAX;
1446-
1447- public static int GM_REPAIR = 75;
1448-
1449- /* Rate control */
1450- /** Rate for eXperience Point rewards */
1451- public static float RATE_XP;
1452- /** Rate for Skill Point rewards */
1453- public static float RATE_SP;
1454- /** Rate for party eXperience Point rewards */
1455- public static float RATE_PARTY_XP;
1456- /** Rate for party Skill Point rewards */
1457- public static float RATE_PARTY_SP;
1458- /** Rate for Quest rewards (XP and SP) */
1459- public static float RATE_QUESTS_REWARD;
1460- /** Rate for drop adena */
1461- public static float RATE_DROP_ADENA;
1462- /** Rate for cost of consumable */
1463- public static float RATE_CONSUMABLE_COST;
1464- /** Rate for dropped items */
1465- public static float RATE_DROP_ITEMS;
1466- /** Rate for dropped items for bosses */
1467- public static float RATE_BOSS_DROP_ITEMS;
1468- /** Rate for spoiled items */
1469- public static float RATE_DROP_SPOIL;
1470- /** Rate for manor items */
1471- public static int RATE_DROP_MANOR;
1472- /** Rate for quest items */
1473- public static float RATE_DROP_QUEST;
1474- /** Rate for karma and experience lose */
1475- public static float RATE_KARMA_EXP_LOST;
1476- /** Rate siege guards prices */
1477- public static float RATE_SIEGE_GUARDS_PRICE;
1478- /*Alternative Xp/Sp rewards, if not 0, then calculated as 2^((mob.level-player.level) / coef),
1479- * A few examples for "AltGameExponentXp = 5." and "AltGameExponentSp = 3."
1480- * diff = 0 (player and mob has the same level), XP bonus rate = 1, SP bonus rate = 1
1481- * diff = 3 (mob is 3 levels above), XP bonus rate = 1.52, SP bonus rate = 2
1482- * diff = 5 (mob is 5 levels above), XP bonus rate = 2, SP bonus rate = 3.17
1483- * diff = -8 (mob is 8 levels below), XP bonus rate = 0.4, SP bonus rate = 0.16 */
1484- /** Alternative eXperience Point rewards */
1485- public static float ALT_GAME_EXPONENT_XP;
1486- /** Alternative Spirit Point rewards */
1487- public static float ALT_GAME_EXPONENT_SP;
1488-
1489- // Player Drop Rate control
1490- /** Limit for player drop */
1491- public static int PLAYER_DROP_LIMIT;
1492- /** Rate for drop */
1493- public static int PLAYER_RATE_DROP;
1494- /** Rate for player's item drop */
1495- public static int PLAYER_RATE_DROP_ITEM;
1496- /** Rate for player's equipment drop */
1497- public static int PLAYER_RATE_DROP_EQUIP;
1498- /** Rate for player's equipment and weapon drop */
1499- public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
1500-
1501+ protected static Logger _log = Logger.getLogger(Config.class.getName());
1502+ /** Debug/release mode */
1503+ public static boolean DEBUG;
1504+ /** Enable/disable assertions */
1505+ public static boolean ASSERT;
1506+ /** Enable/disable code 'in progress' */
1507+ public static boolean DEVELOPER;
1508+
1509+ /** Set if this server is a test server used for development */
1510+ public static boolean TEST_SERVER;
1511+
1512+ /** Game Server ports */
1513+ public static int PORT_GAME;
1514+ /** Login Server port */
1515+ public static int PORT_LOGIN;
1516+ /** Login Server bind ip */
1517+ public static String LOGIN_BIND_ADDRESS;
1518+ /** Number of tries of login before ban */
1519+ public static int LOGIN_TRY_BEFORE_BAN;
1520+ /** Number of seconds the IP ban will last, default 10 minutes */
1521+ public static int LOGIN_BLOCK_AFTER_BAN;
1522+
1523+ /** Hostname of the Game Server */
1524+ public static String GAMESERVER_HOSTNAME;
1525+
1526+ // Access to database
1527+ /** Driver to access to database */
1528+ public static String DATABASE_DRIVER;
1529+ /** Path to access to database */
1530+ public static String DATABASE_URL;
1531+ /** Database login */
1532+ public static String DATABASE_LOGIN;
1533+ /** Database password */
1534+ public static String DATABASE_PASSWORD;
1535+ /** Maximum number of connections to the database */
1536+ public static int DATABASE_MAX_CONNECTIONS;
1537+ /** Time until a connection is closed */
1538+ public static long CONNECTION_CLOSE_TIME;
1539+
1540+ /** Maximum number of players allowed to play simultaneously on server */
1541+ public static int MAXIMUM_ONLINE_USERS;
1542+
1543+ // Setting for serverList
1544+ /** Displays [] in front of server name ? */
1545+ public static boolean SERVER_LIST_BRACKET;
1546+ /** Displays a clock next to the server name ? */
1547+ public static boolean SERVER_LIST_CLOCK;
1548+ /** Display test server in the list of servers ? */
1549+ public static boolean SERVER_LIST_TESTSERVER;
1550+ /** Set the server as gm only at startup ? */
1551+ public static boolean SERVER_GMONLY;
1552+
1553+ // Thread pools size
1554+ /** Thread pool size effect */
1555+ public static int THREAD_P_EFFECTS;
1556+ /** Thread pool size general */
1557+ public static int THREAD_P_GENERAL;
1558+ /** Packet max thread */
1559+ public static int GENERAL_PACKET_THREAD_CORE_SIZE;
1560+ public static int IO_PACKET_THREAD_CORE_SIZE;
1561+ /** General max thread */
1562+ public static int GENERAL_THREAD_CORE_SIZE;
1563+ /** AI max thread */
1564+ public static int AI_MAX_THREAD;
1565+
1566+ /** Accept auto-loot ? */
1567+ public static boolean AUTO_LOOT;
1568+ /** Accept auto-loot for RBs ? */
1569+ public static boolean AUTO_LOOT_RAIDS;
1570+
1571+ /** Character name template */
1572+ public static String CNAME_TEMPLATE;
1573+ /** Pet name template */
1574+ public static String PET_NAME_TEMPLATE;
1575+ /** Maximum number of characters per account */
1576+ public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
1577+
1578+ /** Global chat state */
1579+ public static String DEFAULT_GLOBAL_CHAT;
1580+ /** Trade chat state */
1581+ public static String DEFAULT_TRADE_CHAT;
1582+ /** For test servers - everybody has admin rights */
1583+ public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
1584+ /** Display server revision */
1585+ public static boolean DISPLAY_SERVER_VERSION;
1586+ /** Alternative game crafting */
1587+ public static boolean ALT_GAME_CREATION;
1588+ /** Alternative game crafting speed mutiplier - default 0 (fastest but still not instant) */
1589+ public static double ALT_GAME_CREATION_SPEED;
1590+ /** Alternative game crafting XP rate multiplier - default 1 */
1591+ public static double ALT_GAME_CREATION_XP_RATE;
1592+ /** Alternative game crafting SP rate multiplier - default 1 */
1593+ public static double ALT_GAME_CREATION_SP_RATE;
1594+ /** Check if skills learned by a character are legal */
1595+ public static boolean SKILL_CHECK_ENABLE;
1596+
1597+ /** Enable modifying skill duration */
1598+ public static boolean ENABLE_MODIFY_SKILL_DURATION;
1599+ /** Skill duration list */
1600+ public static Map<Integer, Integer> SKILL_DURATION_LIST;
1601+ /** Block exp/sp command */
1602+ public static boolean Boost_EXP_COMMAND;
1603+ /** Enable Auto NPC target */
1604+ public static boolean AUTO_TARGET_NPC;
1605+ /** Enable Real Time */
1606+ public static boolean ENABLE_REAL_TIME;
1607+
1608+ /** Alternative game skill learning */
1609+ public static boolean ALT_GAME_SKILL_LEARN;
1610+ /** Alternative auto skill learning */
1611+ public static boolean AUTO_LEARN_SKILLS;
1612+ /** Alternative auto skill learning for 3rd class */
1613+ public static boolean AUTO_LEARN_3RD_SKILLS;
1614+ /** Cancel attack bow by hit */
1615+ public static boolean ALT_GAME_CANCEL_BOW;
1616+ /** Cancel cast by hit */
1617+ public static boolean ALT_GAME_CANCEL_CAST;
1618+
1619+ /** Alternative game - use tiredness, instead of CP */
1620+ public static boolean ALT_GAME_TIREDNESS;
1621+
1622+ /** Party Range */
1623+ public static int ALT_PARTY_RANGE;
1624+ public static int ALT_PARTY_RANGE2;
1625+
1626+ /** Alternative Perfect shield defense rate */
1627+ public static int ALT_PERFECT_SHLD_BLOCK;
1628+
1629+ /** Alternative mob aggro in peaceful zone */
1630+ public static boolean ALT_MOB_AGGRO_IN_PEACEZONE;
1631+
1632+ /** Alternative freight modes - Freights can be withdrawed from any village */
1633+ public static boolean ALT_GAME_FREIGHTS;
1634+ /** Alternative freight modes - Sets the price value for each freightened item */
1635+ public static int ALT_GAME_FREIGHT_PRICE;
1636+
1637+ /** Alternative gaming - loss of XP on death */
1638+ public static boolean ALT_GAME_DELEVEL;
1639+
1640+ /** Alternative Weight Limit */
1641+ public static double ALT_WEIGHT_LIMIT;
1642+
1643+ /** Alternative gaming - magic dmg failures */
1644+ public static boolean ALT_GAME_MAGICFAILURES;
1645+
1646+ /** Alternative gaming - player must be in a castle-owning clan or ally to sign up for Dawn. */
1647+ public static boolean ALT_GAME_REQUIRE_CASTLE_DAWN;
1648+
1649+ /** Alternative gaming - allow clan-based castle ownage check rather than ally-based. */
1650+ public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
1651+
1652+ /** Alternative gaming - allow free teleporting around the world. */
1653+ public static boolean ALT_GAME_FREE_TELEPORT;
1654+
1655+ /** Disallow recommend character twice or more a day ? */
1656+ public static boolean ALT_RECOMMEND;
1657+
1658+ /** Alternative gaming - add more or less than 3 sub-classes. */
1659+ public static int ALT_MAX_SUBCLASS;
1660+
1661+ /** Alternative gaming - allow sub-class addition without quest completion. */
1662+ public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
1663+
1664+ /** Alternative gaming - allow/disallow tutorial. */
1665+ public static boolean ALT_ENABLE_TUTORIAL;
1666+
1667+ /** View npc stats/drop by shift-cliking it for nongm-players */
1668+ public static boolean ALT_GAME_VIEWNPC;
1669+
1670+ /** Minimum number of player to participate in SevenSigns Festival */
1671+ public static int ALT_FESTIVAL_MIN_PLAYER;
1672+
1673+ /** Maximum of player contrib during Festival */
1674+ public static int ALT_MAXIMUM_PLAYER_CONTRIB;
1675+
1676+ /** Festival Manager start time. */
1677+ public static long ALT_FESTIVAL_MANAGER_START;
1678+
1679+ /** Festival Length */
1680+ public static long ALT_FESTIVAL_LENGTH;
1681+
1682+ /** Festival Cycle Length */
1683+ public static long ALT_FESTIVAL_CYCLE_LENGTH;
1684+
1685+ /** Festival First Spawn */
1686+ public static long ALT_FESTIVAL_FIRST_SPAWN;
1687+
1688+ /** Festival First Swarm */
1689+ public static long ALT_FESTIVAL_FIRST_SWARM;
1690+
1691+ /** Festival Second Spawn */
1692+ public static long ALT_FESTIVAL_SECOND_SPAWN;
1693+
1694+ /** Festival Second Swarm */
1695+ public static long ALT_FESTIVAL_SECOND_SWARM;
1696+
1697+ /** Festival Chest Spawn */
1698+ public static long ALT_FESTIVAL_CHEST_SPAWN;
1699+
1700+ /** Number of members needed to request a clan war */
1701+ public static int ALT_CLAN_MEMBERS_FOR_WAR;
1702+
1703+ /** Number of days before joining a new clan */
1704+ public static int ALT_CLAN_JOIN_DAYS;
1705+ /** Number of days before creating a new clan */
1706+ public static int ALT_CLAN_CREATE_DAYS;
1707+ /** Number of days it takes to dissolve a clan */
1708+ public static int ALT_CLAN_DISSOLVE_DAYS;
1709+ /** Number of days it takes to dissolve a clan again */
1710+ public static int ALT_RECOVERY_PENALTY;
1711+
1712+ /** Number of days before joining a new alliance when clan voluntarily leave an alliance */
1713+ public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
1714+ /** Number of days before joining a new alliance when clan was dismissed from an alliance */
1715+ public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
1716+ /** Number of days before accepting a new clan for alliance when clan was dismissed from an alliance */
1717+ public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
1718+ /** Number of days before creating a new alliance when dissolved an alliance */
1719+ public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
1720+ /** Maximum number of clans in ally */
1721+ public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
1722+ /** Minimum number of parties to activate command channel */
1723+ public static int ALT_CHANNEL_ACTIVATION_COUNT;
1724+
1725+ /** Alternative gaming - all new characters always are newbies. */
1726+ public static boolean ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE;
1727+
1728+ /** Spell Book needed to learn skill */
1729+ public static boolean SP_BOOK_NEEDED;
1730+ /** Spell Book needet to enchant skill */
1731+ public static boolean ES_SP_BOOK_NEEDED;
1732+ /** Logging Chat Window */
1733+ public static boolean LOG_CHAT;
1734+ /** Logging Item Window */
1735+ public static boolean LOG_ITEMS;
1736+
1737+ /** Alternative privileges for admin */
1738+ public static boolean ALT_PRIVILEGES_ADMIN;
1739+ /** Alternative secure check privileges */
1740+ public static boolean ALT_PRIVILEGES_SECURE_CHECK;
1741+ /** Alternative default level for privileges */
1742+ public static int ALT_PRIVILEGES_DEFAULT_LEVEL;
1743+
1744+ /** Olympiad Competition Starting time */
1745+ public static int ALT_OLY_START_TIME;
1746+
1747+ /** Olympiad Minutes */
1748+ public static int ALT_OLY_MIN;
1749+
1750+ /** Olympiad Competition Period */
1751+ public static long ALT_OLY_CPERIOD;
1752+
1753+ /** Olympiad Battle Period */
1754+ public static long ALT_OLY_BATTLE;
1755+
1756+ /** Olympiad Battle Wait */
1757+ public static long ALT_OLY_BWAIT;
1758+
1759+ /** Olympiad Inital Wait */
1760+ public static long ALT_OLY_IWAIT;
1761+
1762+ /** Olympiad Weekly Period */
1763+ public static long ALT_OLY_WPERIOD;
1764+
1765+ /** Olympiad Validation Period */
1766+ public static long ALT_OLY_VPERIOD;
1767+
1768+ /** Olympiad Base Class */
1769+ public static int ALT_OLY_CLASSED;
1770+
1771+ /** Olympiad Non Base Class */
1772+ public static int ALT_OLY_NONCLASSED;
1773+
1774+ /** Olympiad Battle Reward */
1775+ public static int ALT_OLY_BATTLE_REWARD_ITEM;
1776+
1777+ /** Olympiad Class Based Reward Count */
1778+ public static int ALT_OLY_CLASSED_RITEM_C;
1779+
1780+ /** Olympiad Non Base Reward Count */
1781+ public static int ALT_OLY_NONCLASSED_RITEM_C;
1782+
1783+ /** Olympiad Competition Reward */
1784+ public static int ALT_OLY_COMP_RITEM;
1785+
1786+ /** Olympiad Item Reward */
1787+ public static int ALT_OLY_GP_PER_POINT;
1788+
1789+ /** Olympiad Min Points For Reward */
1790+ public static int ALT_OLY_MIN_POINT_FOR_EXCH;
1791+
1792+ /** Olympiad Hero Points */
1793+ public static int ALT_OLY_HERO_POINTS;
1794+
1795+ /** Manor Refresh Starting time */
1796+ public static int ALT_MANOR_REFRESH_TIME;
1797+
1798+ /** Manor Refresh Min */
1799+ public static int ALT_MANOR_REFRESH_MIN;
1800+
1801+ /** Manor Next Period Approve Starting time */
1802+ public static int ALT_MANOR_APPROVE_TIME;
1803+
1804+ /** Manor Next Period Approve Min */
1805+ public static int ALT_MANOR_APPROVE_MIN;
1806+
1807+ /** Manor Maintenance Time */
1808+ public static int ALT_MANOR_MAINTENANCE_PERIOD;
1809+
1810+ /** Manor Save All Actions */
1811+ public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
1812+
1813+ /** Manor Save Period Rate */
1814+ public static int ALT_MANOR_SAVE_PERIOD_RATE;
1815+
1816+ /** Initial Lottery prize */
1817+ public static int ALT_LOTTERY_PRIZE;
1818+
1819+ /** Lottery Ticket Price */
1820+ public static int ALT_LOTTERY_TICKET_PRICE;
1821+
1822+ /** What part of jackpot amount should receive characters who pick 5 wining numbers */
1823+ public static float ALT_LOTTERY_5_NUMBER_RATE;
1824+
1825+ /** What part of jackpot amount should receive characters who pick 4 wining numbers */
1826+ public static float ALT_LOTTERY_4_NUMBER_RATE;
1827+
1828+ /** What part of jackpot amount should receive characters who pick 3 wining numbers */
1829+ public static float ALT_LOTTERY_3_NUMBER_RATE;
1830+
1831+ /** How much adena receive characters who pick two or less of the winning number */
1832+ public static int ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
1833+
1834+ /** Four Sepulcher Settings */
1835+ public static int FS_PENDING_TIME;
1836+ public static int FS_ENTRY_TIME;
1837+ public static int FS_PARTY_MEMBER_COUNT;
1838+
1839+ /** Minimum size of a party that may enter dimensional rift */
1840+ public static int RIFT_MIN_PARTY_SIZE;
1841+
1842+ /** Time in ms the party has to wait until the mobs spawn when entering a room */
1843+ public static int RIFT_SPAWN_DELAY;
1844+
1845+ /** Amount of random rift jumps before party is ported back */
1846+ public static int RIFT_MAX_JUMPS;
1847+
1848+ /** Random time between two jumps in dimensional rift - in seconds */
1849+ public static int RIFT_AUTO_JUMPS_TIME_MIN;
1850+ public static int RIFT_AUTO_JUMPS_TIME_MAX;
1851+
1852+ /** Dimensional Fragment cost for entering rift */
1853+ public static int RIFT_ENTER_COST_RECRUIT;
1854+ public static int RIFT_ENTER_COST_SOLDIER;
1855+ public static int RIFT_ENTER_COST_OFFICER;
1856+ public static int RIFT_ENTER_COST_CAPTAIN;
1857+ public static int RIFT_ENTER_COST_COMMANDER;
1858+ public static int RIFT_ENTER_COST_HERO;
1859+
1860+ /** Time multiplier for boss room */
1861+ public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
1862+
1863+ /*
1864+ * ************************************************************************** GM CONFIG General GM AccessLevel *
1865+ */
1866+ /** General GM access level */
1867+ public static int GM_ACCESSLEVEL;
1868+ /** General GM Minimal AccessLevel */
1869+ public static int GM_MIN;
1870+ /** General GM AccessLevel to change announcements */
1871+ public static int GM_ANNOUNCE;
1872+ /** General GM AccessLevel can /ban /unban */
1873+ public static int GM_BAN;
1874+ /** General GM AccessLevel can /ban /unban for chat */
1875+ public static int GM_BAN_CHAT;
1876+ /** General GM AccessLevel can /create_item and /gmshop */
1877+ public static int GM_CREATE_ITEM;
1878+ /** General GM AccessLevel can /delete */
1879+ public static int GM_DELETE;
1880+ /** General GM AccessLevel can /kick /disconnect */
1881+ public static int GM_KICK;
1882+ /** General GM AccessLevel for access to GMMenu */
1883+ public static int GM_MENU;
1884+ /** General GM AccessLevel to use god mode command */
1885+ public static int GM_GODMODE;
1886+ /** General GM AccessLevel with character edit rights */
1887+ public static int GM_CHAR_EDIT;
1888+ /** General GM AccessLevel with edit rights for other characters */
1889+ public static int GM_CHAR_EDIT_OTHER;
1890+ /** General GM AccessLevel with character view rights */
1891+ public static int GM_CHAR_VIEW;
1892+ /** General GM AccessLevel with NPC edit rights */
1893+ public static int GM_NPC_EDIT;
1894+ public static int GM_NPC_VIEW;
1895+ /** General GM AccessLevel to teleport to any location */
1896+ public static int GM_TELEPORT;
1897+ /** General GM AccessLevel to teleport character to any location */
1898+ public static int GM_TELEPORT_OTHER;
1899+ /** General GM AccessLevel to restart server */
1900+ public static int GM_RESTART;
1901+ /** General GM AccessLevel for MonsterRace */
1902+ public static int GM_MONSTERRACE;
1903+ /** General GM AccessLevel to ride Wyvern */
1904+ public static int GM_RIDER;
1905+ /** General GM AccessLevel to unstuck without 5min delay */
1906+ public static int GM_ESCAPE;
1907+ /** General GM AccessLevel to resurect fixed after death */
1908+ public static int GM_FIXED;
1909+ /** General GM AccessLevel to create Path Nodes */
1910+ public static int GM_CREATE_NODES;
1911+ /** General GM AccessLevel with Enchant rights */
1912+ public static int GM_ENCHANT;
1913+ /** General GM AccessLevel to close/open Doors */
1914+ public static int GM_DOOR;
1915+ /** General GM AccessLevel with Resurrection rights */
1916+ public static int GM_RES;
1917+ /** General GM AccessLevel to attack in the peace zone */
1918+ public static int GM_PEACEATTACK;
1919+ /** General GM AccessLevel to heal */
1920+ public static int GM_HEAL;
1921+ /** General GM AccessLevel to unblock IPs detected as hack IPs */
1922+ public static int GM_UNBLOCK;
1923+ /** General GM AccessLevel to use Cache commands */
1924+ public static int GM_CACHE;
1925+ /** General GM AccessLevel to use test&st commands */
1926+ public static int GM_TALK_BLOCK;
1927+ public static int GM_TEST;
1928+ /** Disable transaction on AccessLevel **/
1929+ public static boolean GM_DISABLE_TRANSACTION;
1930+ /** GM transactions disabled from this range */
1931+ public static int GM_TRANSACTION_MIN;
1932+ /** GM transactions disabled to this range */
1933+ public static int GM_TRANSACTION_MAX;
1934+
1935+ public static int GM_REPAIR = 75;
1936+
1937+ /* Rate control */
1938+ /** Rate for eXperience Point rewards */
1939+ public static float RATE_XP;
1940+ /** Rate for Skill Point rewards */
1941+ public static float RATE_SP;
1942+ /** Rate for party eXperience Point rewards */
1943+ public static float RATE_PARTY_XP;
1944+ /** Rate for party Skill Point rewards */
1945+ public static float RATE_PARTY_SP;
1946+ /** Rate for Quest rewards (XP and SP) */
1947+ public static float RATE_QUESTS_REWARD;
1948+ /** Rate for drop adena */
1949+ public static float RATE_DROP_ADENA;
1950+ /** Rate for cost of consumable */
1951+ public static float RATE_CONSUMABLE_COST;
1952+ /** Rate for dropped items */
1953+ public static float RATE_DROP_ITEMS;
1954+ /** Rate for dropped items for bosses */
1955+ public static float RATE_BOSS_DROP_ITEMS;
1956+ /** Rate for spoiled items */
1957+ public static float RATE_DROP_SPOIL;
1958+ /** Rate for manor items */
1959+ public static int RATE_DROP_MANOR;
1960+ /** Rate for quest items */
1961+ public static float RATE_DROP_QUEST;
1962+ /** Rate for karma and experience lose */
1963+ public static float RATE_KARMA_EXP_LOST;
1964+ /** Rate siege guards prices */
1965+ public static float RATE_SIEGE_GUARDS_PRICE;
1966+ /*
1967+ * Alternative Xp/Sp rewards, if not 0, then calculated as 2^((mob.level-player.level) / coef), A few examples for "AltGameExponentXp = 5." and "AltGameExponentSp = 3." diff = 0 (player and mob has the same level), XP bonus rate = 1, SP bonus rate = 1 diff = 3 (mob is 3 levels above), XP bonus
1968+ * rate = 1.52, SP bonus rate = 2 diff = 5 (mob is 5 levels above), XP bonus rate = 2, SP bonus rate = 3.17 diff = -8 (mob is 8 levels below), XP bonus rate = 0.4, SP bonus rate = 0.16
1969+ */
1970+ /** Alternative eXperience Point rewards */
1971+ public static float ALT_GAME_EXPONENT_XP;
1972+ /** Alternative Spirit Point rewards */
1973+ public static float ALT_GAME_EXPONENT_SP;
1974+
1975+ // Player Drop Rate control
1976+ /** Limit for player drop */
1977+ public static int PLAYER_DROP_LIMIT;
1978+ /** Rate for drop */
1979+ public static int PLAYER_RATE_DROP;
1980+ /** Rate for player's item drop */
1981+ public static int PLAYER_RATE_DROP_ITEM;
1982+ /** Rate for player's equipment drop */
1983+ public static int PLAYER_RATE_DROP_EQUIP;
1984+ /** Rate for player's equipment and weapon drop */
1985+ public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
1986+
1987 // Pet Rates (Multipliers)
1988- /** Rate for experience rewards of the pet */
1989- public static float PET_XP_RATE;
1990- /** Rate for food consumption of the pet */
1991- public static int PET_FOOD_RATE;
1992- /** Rate for experience rewards of the Sin Eater */
1993- public static float SINEATER_XP_RATE;
1994-
1995- // Karma Drop Rate control
1996- /** Karma drop limit */
1997- public static int KARMA_DROP_LIMIT;
1998- /** Karma drop rate */
1999- public static int KARMA_RATE_DROP;
2000- /** Karma drop rate for item */
2001- public static int KARMA_RATE_DROP_ITEM;
2002- /** Karma drop rate for equipment */
2003- public static int KARMA_RATE_DROP_EQUIP;
2004- /** Karma drop rate for equipment and weapon */
2005- public static int KARMA_RATE_DROP_EQUIP_WEAPON;
2006-
2007- /** Time after which item will auto-destroy */
2008- public static int AUTODESTROY_ITEM_AFTER;
2009- /** List of items that will not be destroyed (seperated by ",") */
2010- public static String PROTECTED_ITEMS;
2011- /** List of items that will not be destroyed */
2012- public static List<Integer> LIST_PROTECTED_ITEMS;
2013-
2014-
2015- /** Update itens owned by this char when storing the char on DB */
2016- public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
2017- /** Update itens only when strictly necessary */
2018- public static boolean LAZY_ITEMS_UPDATE;
2019- /** Auto destroy nonequipable items dropped by players */
2020- public static boolean DESTROY_DROPPED_PLAYER_ITEM;
2021- /** Auto destroy equipable items dropped by players */
2022- public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
2023- /** Save items on ground for restoration on server restart */
2024- public static boolean SAVE_DROPPED_ITEM;
2025- /** Empty table ItemsOnGround after load all items */
2026- public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
2027- /** Time interval to save into db items on ground */
2028- public static int SAVE_DROPPED_ITEM_INTERVAL;
2029- /** Clear all items stored in ItemsOnGround table */
2030- public static boolean CLEAR_DROPPED_ITEM_TABLE;
2031-
2032- /** Accept precise drop calculation ? */
2033- public static boolean PRECISE_DROP_CALCULATION;
2034- /** Accept multi-items drop ? */
2035- public static boolean MULTIPLE_ITEM_DROP;
2036-
2037- /** Coord Synchronization */
2038- public static int COORD_SYNCHRONIZE;
2039- /** Falling Damage */
2040- public static boolean ENABLE_FALLING_DAMAGE;
2041-
2042- /** Period in days after which character is deleted */
2043- public static int DELETE_DAYS;
2044-
2045- /** Datapack root directory */
2046- public static File DATAPACK_ROOT;
2047-
2048- /** Maximum range mobs can randomly go from spawn point */
2049- public static int MAX_DRIFT_RANGE;
2050-
2051- /** Allow fishing ? */
2052- public static boolean ALLOWFISHING;
2053-
2054- /** Jail config **/
2055- public static boolean JAIL_IS_PVP;
2056- public static boolean JAIL_DISABLE_CHAT;
2057-
2058-
2059- /** Allow L2Walker */
2060- public static boolean ALLOW_L2WALKER;
2061-
2062-
2063- /** Allow Manor system */
2064- public static boolean ALLOW_MANOR;
2065-
2066- /** Allow NPC walkers */
2067- public static boolean ALLOW_NPC_WALKERS;
2068-
2069- /** Allow Pet walkers */
2070- public static boolean ALLOW_PET_WALKERS;
2071-
2072- /** Allow Discard item ?*/
2073- public static boolean ALLOW_DISCARDITEM;
2074- /** Allow freight ? */
2075- public static boolean ALLOW_FREIGHT;
2076- /** Allow warehouse ? */
2077- public static boolean ALLOW_WAREHOUSE;
2078- /** Allow warehouse cache? */
2079- public static boolean WAREHOUSE_CACHE;
2080- /** How long store WH datas */
2081- public static int WAREHOUSE_CACHE_TIME;
2082- /** Allow wear ? (try on in shop) */
2083- public static boolean ALLOW_WEAR;
2084- /** Duration of the try on after which items are taken back */
2085- public static int WEAR_DELAY;
2086- /** Price of the try on of one item */
2087- public static int WEAR_PRICE;
2088- /** Allow lottery ? */
2089- public static boolean ALLOW_LOTTERY;
2090- /** Allow race ? */
2091- public static boolean ALLOW_RACE;
2092- /** Allow water ? */
2093- public static boolean ALLOW_WATER;
2094- /** Allow rent pet ? */
2095- public static boolean ALLOW_RENTPET;
2096- /** Allow boat ? */
2097- public static boolean ALLOW_BOAT;
2098-
2099- /** Time after which a packet is considered as lost */
2100- public static int PACKET_LIFETIME;
2101-
2102- /** Detects server deadlocks */
2103- public static boolean DEADLOCK_DETECTOR;
2104- /** Check interval in seconds */
2105- public static int DEADLOCK_CHECK_INTERVAL;
2106- /** Restarts server to remove deadlocks */
2107- public static boolean RESTART_ON_DEADLOCK;
2108-
2109- /** Allow Wyvern Upgrader ? */
2110- public static boolean ALLOW_WYVERN_UPGRADER;
2111-
2112- // protocol revision
2113- /** Minimal protocol revision */
2114- public static int MIN_PROTOCOL_REVISION;
2115- /** Maximal protocol revision */
2116- public static int MAX_PROTOCOL_REVISION;
2117-
2118- // random animation interval
2119- /** Minimal time between 2 animations of a NPC */
2120- public static int MIN_NPC_ANIMATION;
2121- /** Maximal time between 2 animations of a NPC */
2122- public static int MAX_NPC_ANIMATION;
2123- /** Minimal time between animations of a monster */
2124- public static int MIN_MONSTER_ANIMATION;
2125- /** Maximal time between animations of a monster */
2126- public static int MAX_MONSTER_ANIMATION;
2127-
2128- /** Knownlist update time interval */
2129- public static long KNOWNLIST_UPDATE_INTERVAL;
2130-
2131- /** Activate position recorder ? */
2132- public static boolean ACTIVATE_POSITION_RECORDER;
2133- /** Use 3D Map ? */
2134- public static boolean USE_3D_MAP;
2135-
2136- // Community Board
2137- /** Type of community */
2138- public static int COMMUNITY_TYPE;
2139- public static boolean BBS_SHOW_PLAYERLIST;
2140- public static String BBS_DEFAULT;
2141- /** Show level of the community board ? */
2142- public static boolean SHOW_LEVEL_COMMUNITYBOARD;
2143- /** Show status of the community board ? */
2144- public static boolean SHOW_STATUS_COMMUNITYBOARD;
2145- /** Size of the name page on the community board */
2146- public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
2147- /** Name per row on community board */
2148- public static int NAME_PER_ROW_COMMUNITYBOARD;
2149-
2150- // Configuration files
2151- /** Properties file that allows selection of new Classes for storage of World Objects.
2152- * <br>This may help servers with large amounts of players recieving error messages related to
2153- * the <i>L2ObjectHashMap</i> and <i>L2ObejctHashSet</i> classes.*/
2154- /** Properties file for game server (connection and ingame) configurations */
2155- public static final String CONFIGURATION_FILE = "./config/server.properties";
2156- /** Properties file for game server options */
2157- public static final String OPTIONS_FILE = "./config/options.properties";
2158- /** Properties file for login server configurations */
2159- public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
2160- /** Properties file for the ID factory */
2161- public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
2162- /** Properties file for other configurations */
2163- public static final String OTHER_CONFIG_FILE = "./config/other.properties";
2164- /** Properties file for rates configurations */
2165- public static final String RATES_CONFIG_FILE = "./config/rates.properties";
2166- /** Properties file for alternative configurations */
2167- public static final String ALT_SETTINGS_FILE = "./config/altsettings.properties";
2168- /** Properties file for feature configurations */
2169- public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
2170- /** Properties file for custom configurations */
2171- public static final String CUSTOM_CONFIG_FILE = "./config/custom.properties";
2172- /** Properties file for events configurations */
2173- public static final String EVENTS_CONFIG_FILE = "./config/events.properties";
2174- /** Properties file for PVP configurations */
2175- public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
2176- /** Properties file for GM access configurations */
2177- public static final String GM_ACCESS_FILE = "./config/GMAccess.properties";
2178- /** Properties file for Flood Protector configurations */
2179- public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
2180- /** Properties file for telnet configurations */
2181- public static final String TELNET_FILE = "./config/telnet.properties";
2182- /** Properties file for l2j server version configurations */
2183- public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
2184- /** Properties file for l2j datapack version configurations */
2185- public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
2186- /** Properties file for siege configurations */
2187- public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
2188- /** Text file containing hexadecimal value of server ID */
2189- public static final String HEXID_FILE = "./config/hexid.txt";
2190- /** Properties file for alternative configure GM commands access level.<br>
2191- * Note that this file only read if "AltPrivilegesAdmin = True" */
2192- public static final String COMMAND_PRIVILEGES_FILE = "./config/command-privileges.properties";
2193-
2194-
2195- public static int MAX_ITEM_IN_PACKET;
2196-
2197- public static boolean CHECK_KNOWN;
2198-
2199- /** Game Server login port */
2200- public static int GAME_SERVER_LOGIN_PORT;
2201- /** Game Server login Host */
2202- public static String GAME_SERVER_LOGIN_HOST;
2203- /** Internal Hostname */
2204- public static String INTERNAL_HOSTNAME;
2205- /** External Hostname */
2206- public static String EXTERNAL_HOSTNAME;
2207- public static int PATH_NODE_RADIUS;
2208- public static int NEW_NODE_ID;
2209- public static int SELECTED_NODE_ID;
2210- public static int LINKED_NODE_ID;
2211- public static String NEW_NODE_TYPE;
2212-
2213- /** Show L2Monster level and aggro ? */
2214- public static boolean SHOW_NPC_LVL;
2215-
2216- /** Force full item inventory packet to be sent for any item change ?<br>
2217- * <u><i>Note:</i></u> This can increase network traffic*/
2218- public static boolean FORCE_INVENTORY_UPDATE;
2219- /** Disable the use of guards against agressive monsters ? */
2220- public static boolean GUARD_ATTACK_AGGRO_MOB;
2221- /** Allow use of NPC Buffer ?*/
2222- public static boolean NPC_BUFFER_ENABLED;
2223- public static int AIO_BUFF_DURATION;
2224- /** Allow Offline Trade ?*/
2225- public static boolean OFFLINE_TRADE_ENABLE;
2226- /** Allow Offline Craft ?*/
2227- public static boolean OFFLINE_CRAFT_ENABLE;
2228- /** Restore Offliners ?*/
2229- public static boolean RESTORE_OFFLINERS;
2230- /** Max Days for Offline Stores ?*/
2231- public static int OFFLINE_MAX_DAYS;
2232- /** Disconnect shops that finished selling ?*/
2233- public static boolean OFFLINE_DISCONNECT_FINISHED;
2234- /** Allow color for offline mode ?*/
2235- public static boolean OFFLINE_SET_NAME_COLOR;
2236- /** Color for offline mode*/
2237- public static int OFFLINE_NAME_COLOR;
2238- /** Allow teleporting to towns that are under siege ?*/
2239- public static boolean ALLOW_SIEGE_TELEPORT;
2240-
2241- /** Allow players to keep subclass skills ?*/
2242- public static boolean KEEP_SUBCLASS_SKILLS;
2243-
2244- /** Allow use Event Managers for change occupation ?*/
2245- public static boolean ALLOW_CLASS_MASTERS;
2246- public static ClassMasterSettings CLASS_MASTER_SETTINGS;
2247- public static boolean ALLOW_ENTIRE_TREE;
2248- public static boolean ALTERNATE_CLASS_MASTER;
2249-
2250- /** Auto rewarding players */
2251- public static boolean ALLOW_AUTO_REWARDER;
2252- public static int AUTO_REWARD_DELAY;
2253- public static int AUTO_REWARD_ID;
2254- public static int AUTO_REWARD_COUNT;
2255-
2256- /** Custom starting spawn for new characters */
2257- public static boolean CUSTOM_STARTING_SPAWN;
2258- public static int CUSTOM_SPAWN_X;
2259- public static int CUSTOM_SPAWN_Y;
2260- public static int CUSTOM_SPAWN_Z;
2261-
2262- /** Allow players to view all available classes to the same village master */
2263- public static boolean CHANGE_SUBCLASS_EVERYWHERE;
2264-
2265- /** Auto Noblesse status at login */
2266- public static boolean AUTO_NOBLE_STATUS;
2267-
2268- /** Allow enchanting hero items */
2269- public static boolean ALLOW_HERO_ENCHANT;
2270-
2271- /** Allow Dual Box in game */
2272- public static boolean PREVENT_DUAL_BOXING;
2273-
2274- /** Use /block command as an AntiBuff shield */
2275- public static boolean BLOCK_UNWANTED_BUFFS;
2276-
2277- /** Enable custom data tables ?*/
2278- public static boolean CUSTOM_SPAWNLIST_TABLE;
2279- public static boolean SAVE_GMSPAWN_ON_CUSTOM;
2280- public static boolean CUSTOM_NPC_TABLE;
2281- public static boolean CUSTOM_NPC_SKILLS_TABLE;
2282- public static boolean CUSTOM_ITEM_TABLES;
2283- public static boolean CUSTOM_ARMORSETS_TABLE;
2284- public static boolean CUSTOM_TELEPORT_TABLE;
2285- public static boolean CUSTOM_DROPLIST_TABLE;
2286- public static boolean CUSTOM_MERCHANT_TABLES;
2287-
2288- /** Champion Mod */
2289- public static boolean CHAMPION_ENABLE;
2290- public static boolean CHAMPION_PASSIVE;
2291- public static int CHAMPION_FREQUENCY;
2292- public static String CHAMPION_TITLE;
2293- public static int CHAMP_MIN_LVL;
2294- public static int CHAMP_MAX_LVL;
2295- public static int CHAMPION_HP;
2296- public static int CHAMPION_REWARDS;
2297- public static int CHAMPION_ADENAS_REWARDS;
2298- public static float CHAMPION_HP_REGEN;
2299- public static float CHAMPION_ATK;
2300- public static float CHAMPION_SPD_ATK;
2301- public static int CHAMPION_REWARD_LOWER_CHANCE;
2302- public static int CHAMPION_REWARD_HIGHER_CHANCE;
2303- public static int CHAMPION_REWARD_ID;
2304- public static int CHAMPION_REWARD_QTY;
2305-
2306- //--------------------------------------------------
2307- // FloodProtector Settings
2308- //--------------------------------------------------
2309- public static FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM;
2310- public static FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE;
2311- public static FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK;
2312- public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON;
2313- public static FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE;
2314- public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
2315- public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS;
2316- public static FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM;
2317- public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS;
2318- public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
2319- public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
2320- public static FloodProtectorConfig FLOOD_PROTECTOR_MANUFACTURE;
2321- public static FloodProtectorConfig FLOOD_PROTECTOR_MANOR;
2322- public static FloodProtectorConfig FLOOD_PROTECTOR_CHARACTER_SELECT;
2323-
2324- // Server version
2325- /** Server version */
2326- public static String SERVER_VERSION;
2327- /** Date of server build */
2328- public static String SERVER_BUILD_DATE;
2329-
2330- // Datapack version
2331- /** Datapack version */
2332- public static String DATAPACK_VERSION;
2333-
2334- /** Zone Setting */
2335- public static int ZONE_TOWN;
2336-
2337- /** Crafting Enabled? */
2338- public static boolean IS_CRAFTING_ENABLED;
2339-
2340- // Inventory slots limit
2341- /** Maximum inventory slots limits for non dwarf characters */
2342- public static int INVENTORY_MAXIMUM_NO_DWARF;
2343- /** Maximum inventory slots limits for dwarf characters */
2344- public static int INVENTORY_MAXIMUM_DWARF;
2345- /** Maximum inventory slots limits for GM */
2346- public static int INVENTORY_MAXIMUM_GM;
2347- /** Maximum inventory slots limits for pet */
2348- public static int INVENTORY_MAXIMUM_PET;
2349-
2350- // Warehouse slots limits
2351- /** Maximum inventory slots limits for non dwarf warehouse */
2352- public static int WAREHOUSE_SLOTS_NO_DWARF;
2353- /** Maximum inventory slots limits for dwarf warehouse */
2354- public static int WAREHOUSE_SLOTS_DWARF;
2355- /** Maximum inventory slots limits for clan warehouse */
2356- public static int WAREHOUSE_SLOTS_CLAN;
2357- /** Maximum inventory slots limits for freight */
2358- public static int FREIGHT_SLOTS;
2359-
2360- // Spoil Rates
2361- /** Allow spoil on lower level mobs than the character */
2362- public static boolean CAN_SPOIL_LOWER_LEVEL_MOBS;
2363- /** Allow delevel and spoil mob ? */
2364- public static boolean CAN_DELEVEL_AND_SPOIL_MOBS;
2365- /** Maximum level difference between player and mob level */
2366- public static float MAXIMUM_PLAYER_AND_MOB_LEVEL_DIFFERENCE;
2367- /** Base rate for spoil */
2368- public static float BASE_SPOIL_RATE;
2369- /** Minimum spoil rate */
2370- public static float MINIMUM_SPOIL_RATE;
2371- /** Maximum level difference between player and spoil level to allow before decreasing spoil chance */
2372- public static float SPOIL_LEVEL_DIFFERENCE_LIMIT;
2373- /** Spoil level multiplier */
2374- public static float SPOIL_LEVEL_DIFFERENCE_MULTIPLIER;
2375- /** Last level spoil learned */
2376- public static int LAST_LEVEL_SPOIL_IS_LEARNED;
2377-
2378- // Karma System Variables
2379- /** Minimum karma gain/loss */
2380- public static int KARMA_MIN_KARMA;
2381- /** Maximum karma gain/loss */
2382- public static int KARMA_MAX_KARMA;
2383- /** Number to divide the xp recieved by, to calculate karma lost on xp gain/lost */
2384- public static int KARMA_XP_DIVIDER;
2385- /** The Minimum Karma lost if 0 karma is to be removed */
2386- public static int KARMA_LOST_BASE;
2387- /** Can a GM drop item ? */
2388- public static boolean KARMA_DROP_GM;
2389- /** Should award a pvp point for killing a player with karma ? */
2390- public static boolean KARMA_AWARD_PK_KILL;
2391- /** Minimum PK required to drop */
2392- public static int KARMA_PK_LIMIT;
2393-
2394- /** List of pet items that cannot be dropped (seperated by ",") when PVP */
2395- public static String KARMA_NONDROPPABLE_PET_ITEMS;
2396- /** List of items that cannot be dropped (seperated by ",") when PVP*/
2397- public static String KARMA_NONDROPPABLE_ITEMS;
2398- /** List of pet items that cannot be dropped when PVP */
2399- public static List<Integer> KARMA_LIST_NONDROPPABLE_PET_ITEMS;
2400- /** List of items that cannot be dropped when PVP */
2401- public static List<Integer> KARMA_LIST_NONDROPPABLE_ITEMS;
2402-
2403- /** List of items that cannot be dropped (seperated by ",") */
2404- public static String NONDROPPABLE_ITEMS;
2405- /** List of items that cannot be dropped */
2406- public static List<Integer> LIST_NONDROPPABLE_ITEMS;
2407-
2408- /** List of NPCs that rent pets (seperated by ",") */
2409- public static String PET_RENT_NPC;
2410- /** List of NPCs that rent pets */
2411- public static List<Integer> LIST_PET_RENT_NPC;
2412-
2413- /** Duration (in ms) while a player stay in PVP mode after hitting an innocent */
2414- public static int PVP_NORMAL_TIME;
2415- /** Duration (in ms) while a player stay in PVP mode after hitting a purple player */
2416- public static int PVP_PVP_TIME;
2417-
2418- // Karma Punishment
2419- /** Allow player with karma to be killed in peace zone ? */
2420- public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
2421- /** Allow player with karma to shop ? */
2422- public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
2423- /** Allow player with karma to use gatekeepers ? */
2424- public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
2425- /** Allow player with karma to use SOE or Return skill ? */
2426- public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
2427- /** Allow player with karma to trade ? */
2428- public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
2429- /** Allow player with karma to use warehouse ?*/
2430- public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
2431-
2432- /** Enumeration for type of ID Factory */
2433- public static enum IdFactoryType
2434- {
2435- Compaction,
2436- BitSet,
2437- Stack
2438- }
2439-
2440- /** ID Factory type */
2441- public static IdFactoryType IDFACTORY_TYPE;
2442- /** Check for bad ID ? */
2443- public static boolean BAD_ID_CHECKING;
2444+ /** Rate for experience rewards of the pet */
2445+ public static float PET_XP_RATE;
2446+ /** Rate for food consumption of the pet */
2447+ public static int PET_FOOD_RATE;
2448+ /** Rate for experience rewards of the Sin Eater */
2449+ public static float SINEATER_XP_RATE;
2450
2451- /** Enumeration for type of maps object */
2452- public static enum ObjectMapType
2453- {
2454- L2ObjectHashMap,
2455- WorldObjectMap
2456- }
2457-
2458- /** Enumeration for type of set object */
2459- public static enum ObjectSetType
2460- {
2461- L2ObjectHashSet,
2462- WorldObjectSet
2463- }
2464-
2465- /** Type of map object */
2466- public static ObjectMapType MAP_TYPE;
2467- /** Type of set object */
2468- public static ObjectSetType SET_TYPE;
2469-
2470- /**
2471- * Allow lesser effects to be canceled if stronger effects are used when effects of the same stack group are used.<br>
2472- * New effects that are added will be canceled if they are of lesser priority to the old one.
2473- */
2474- public static boolean EFFECT_CANCELING;
2475-
2476- /** Auto-delete invalid quest data ? */
2477- public static boolean AUTODELETE_INVALID_QUEST_DATA;
2478-
2479- /** Chance that an item will succesfully be enchanted */
2480- public static int ENCHANT_CHANCE_WEAPON;
2481- public static int ENCHANT_CHANCE_ARMOR;
2482- public static int ENCHANT_CHANCE_JEWELRY;
2483- public static int BLESSED_ENCHANT_CHANCE_WEAPON;
2484- public static int BLESSED_ENCHANT_CHANCE_ARMOR;
2485- public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
2486- /** Maximum level of enchantment */
2487- public static int ENCHANT_MAX_WEAPON;
2488- public static int ENCHANT_MAX_ARMOR;
2489- public static int ENCHANT_MAX_JEWELRY;
2490- /** maximum level of safe enchantment for normal items*/
2491- public static int ENCHANT_SAFE_MAX;
2492- /** maximum level of safe enchantment for full body armor*/
2493- public static int ENCHANT_SAFE_MAX_FULL;
2494-
2495- // Character multipliers
2496- /** Multiplier for character HP regeneration */
2497- public static double HP_REGEN_MULTIPLIER;
2498- /** Mutilplier for character MP regeneration */
2499- public static double MP_REGEN_MULTIPLIER;
2500- /** Multiplier for character CP regeneration */
2501- public static double CP_REGEN_MULTIPLIER;
2502-
2503- // Raid Boss multipliers
2504- /** Multiplier for Raid boss HP regeneration */
2505- public static double RAID_HP_REGEN_MULTIPLIER;
2506- /** Mulitplier for Raid boss MP regeneration */
2507- public static double RAID_MP_REGEN_MULTIPLIER;
2508- /** Multiplier for Raid boss power defense multiplier */
2509- public static double RAID_PDEFENCE_MULTIPLIER;
2510- /** Multiplier for Raid boss magic defense multiplier */
2511- public static double RAID_MDEFENCE_MULTIPLIER;
2512- /** Raid Boss Minin Spawn Timer */
2513- public static double RAID_MINION_RESPAWN_TIMER;
2514- /** Mulitplier for Raid boss minimum time respawn */
2515- public static float RAID_MIN_RESPAWN_MULTIPLIER;
2516- /** Mulitplier for Raid boss maximum time respawn */
2517- public static float RAID_MAX_RESPAWN_MULTIPLIER;
2518- /** Amount of adenas when starting a new character */
2519- public static int STARTING_ADENA;
2520- /** Starting level of a new character */
2521- public static byte STARTING_LEVEL;
2522- /** Starting level of a new subclass */
2523- public static byte STARTING_SUB_LEVEL;
2524-
2525- /** Maximum character running speed */
2526- public static int MAX_RUN_SPEED;
2527- /** Maximum character Physical Critical Rate */
2528- public static int MAX_PCRIT_RATE;
2529- /** Maximum character Magic Critical Rate */
2530- public static int MAX_MCRIT_RATE;
2531- /** Maximum character Physical Attack Speed */
2532- public static int MAX_PATK_SPEED;
2533- /** Maximum character Magic Attack Speed */
2534- public static int MAX_MATK_SPEED;
2535-
2536-
2537- /** Deep Blue Mobs' Drop Rules Enabled */
2538- public static boolean DEEPBLUE_DROP_RULES;
2539- public static int UNSTUCK_INTERVAL;
2540-
2541- /** Is telnet enabled ? */
2542- public static boolean IS_TELNET_ENABLED;
2543- /** Telnet status port */
2544- public static int TELNET_PORT;
2545-
2546- /** Player Protection control */
2547- public static int PLAYER_SPAWN_PROTECTION;
2548- public static int PLAYER_FAKEDEATH_UP_PROTECTION;
2549-
2550- /** Define Party XP cutoff point method - Possible values: level and percentage */
2551- public static String PARTY_XP_CUTOFF_METHOD;
2552- /** Define the cutoff point value for the "level" method */
2553- public static int PARTY_XP_CUTOFF_LEVEL;
2554- /** Define the cutoff point value for the "percentage" method */
2555- public static double PARTY_XP_CUTOFF_PERCENT;
2556-
2557- /** Percent HP is restore on respawn */
2558- public static double RESPAWN_RESTORE_HP;
2559-
2560- /** Allow randomizing of the respawn point in towns. */
2561- public static boolean RESPAWN_RANDOM_ENABLED;
2562- /** The maximum offset from the base respawn point to allow. */
2563- public static int RESPAWN_RANDOM_MAX_OFFSET;
2564-
2565- /** Maximum number of available slots for pvt stores (sell/buy) - Dwarves */
2566- public static int MAX_PVTSTORE_SLOTS_DWARF;
2567- /** Maximum number of available slots for pvt stores (sell/buy) - Others */
2568- public static int MAX_PVTSTORE_SLOTS_OTHER;
2569-
2570- /** Store skills cooltime on char exit/relogin */
2571- public static boolean STORE_SKILL_COOLTIME;
2572- /** Show licence or not just after login (if false, will directly go to the Server List */
2573+ // Karma Drop Rate control
2574+ /** Karma drop limit */
2575+ public static int KARMA_DROP_LIMIT;
2576+ /** Karma drop rate */
2577+ public static int KARMA_RATE_DROP;
2578+ /** Karma drop rate for item */
2579+ public static int KARMA_RATE_DROP_ITEM;
2580+ /** Karma drop rate for equipment */
2581+ public static int KARMA_RATE_DROP_EQUIP;
2582+ /** Karma drop rate for equipment and weapon */
2583+ public static int KARMA_RATE_DROP_EQUIP_WEAPON;
2584+
2585+ /** Time after which item will auto-destroy */
2586+ public static int AUTODESTROY_ITEM_AFTER;
2587+ /** List of items that will not be destroyed (seperated by ",") */
2588+ public static String PROTECTED_ITEMS;
2589+ /** List of items that will not be destroyed */
2590+ public static List<Integer> LIST_PROTECTED_ITEMS;
2591+
2592+ /** Update itens owned by this char when storing the char on DB */
2593+ public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
2594+ /** Update itens only when strictly necessary */
2595+ public static boolean LAZY_ITEMS_UPDATE;
2596+ /** Auto destroy nonequipable items dropped by players */
2597+ public static boolean DESTROY_DROPPED_PLAYER_ITEM;
2598+ /** Auto destroy equipable items dropped by players */
2599+ public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
2600+ /** Save items on ground for restoration on server restart */
2601+ public static boolean SAVE_DROPPED_ITEM;
2602+ /** Empty table ItemsOnGround after load all items */
2603+ public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
2604+ /** Time interval to save into db items on ground */
2605+ public static int SAVE_DROPPED_ITEM_INTERVAL;
2606+ /** Clear all items stored in ItemsOnGround table */
2607+ public static boolean CLEAR_DROPPED_ITEM_TABLE;
2608+
2609+ /** Accept precise drop calculation ? */
2610+ public static boolean PRECISE_DROP_CALCULATION;
2611+ /** Accept multi-items drop ? */
2612+ public static boolean MULTIPLE_ITEM_DROP;
2613+
2614+ /** Coord Synchronization */
2615+ public static int COORD_SYNCHRONIZE;
2616+ /** Falling Damage */
2617+ public static boolean ENABLE_FALLING_DAMAGE;
2618+
2619+ /** Period in days after which character is deleted */
2620+ public static int DELETE_DAYS;
2621+
2622+ /** Datapack root directory */
2623+ public static File DATAPACK_ROOT;
2624+
2625+ /** Maximum range mobs can randomly go from spawn point */
2626+ public static int MAX_DRIFT_RANGE;
2627+
2628+ /** Allow fishing ? */
2629+ public static boolean ALLOWFISHING;
2630+
2631+ /** Jail config **/
2632+ public static boolean JAIL_IS_PVP;
2633+ public static boolean JAIL_DISABLE_CHAT;
2634+
2635+ /** Allow L2Walker */
2636+ public static boolean ALLOW_L2WALKER;
2637+
2638+ /** Allow Manor system */
2639+ public static boolean ALLOW_MANOR;
2640+
2641+ /** Allow NPC walkers */
2642+ public static boolean ALLOW_NPC_WALKERS;
2643+
2644+ /** Allow Pet walkers */
2645+ public static boolean ALLOW_PET_WALKERS;
2646+
2647+ /** Allow Discard item ? */
2648+ public static boolean ALLOW_DISCARDITEM;
2649+ /** Allow freight ? */
2650+ public static boolean ALLOW_FREIGHT;
2651+ /** Allow warehouse ? */
2652+ public static boolean ALLOW_WAREHOUSE;
2653+ /** Allow warehouse cache? */
2654+ public static boolean WAREHOUSE_CACHE;
2655+ /** How long store WH datas */
2656+ public static int WAREHOUSE_CACHE_TIME;
2657+ /** Allow wear ? (try on in shop) */
2658+ public static boolean ALLOW_WEAR;
2659+ /** Duration of the try on after which items are taken back */
2660+ public static int WEAR_DELAY;
2661+ /** Price of the try on of one item */
2662+ public static int WEAR_PRICE;
2663+ /** Allow lottery ? */
2664+ public static boolean ALLOW_LOTTERY;
2665+ /** Allow race ? */
2666+ public static boolean ALLOW_RACE;
2667+ /** Allow water ? */
2668+ public static boolean ALLOW_WATER;
2669+ /** Allow rent pet ? */
2670+ public static boolean ALLOW_RENTPET;
2671+ /** Allow boat ? */
2672+ public static boolean ALLOW_BOAT;
2673+
2674+ /** Time after which a packet is considered as lost */
2675+ public static int PACKET_LIFETIME;
2676+
2677+ /** Detects server deadlocks */
2678+ public static boolean DEADLOCK_DETECTOR;
2679+ /** Check interval in seconds */
2680+ public static int DEADLOCK_CHECK_INTERVAL;
2681+ /** Restarts server to remove deadlocks */
2682+ public static boolean RESTART_ON_DEADLOCK;
2683+
2684+ /** Allow Wyvern Upgrader ? */
2685+ public static boolean ALLOW_WYVERN_UPGRADER;
2686+
2687+ // protocol revision
2688+ /** Minimal protocol revision */
2689+ public static int MIN_PROTOCOL_REVISION;
2690+ /** Maximal protocol revision */
2691+ public static int MAX_PROTOCOL_REVISION;
2692+
2693+ // random animation interval
2694+ /** Minimal time between 2 animations of a NPC */
2695+ public static int MIN_NPC_ANIMATION;
2696+ /** Maximal time between 2 animations of a NPC */
2697+ public static int MAX_NPC_ANIMATION;
2698+ /** Minimal time between animations of a monster */
2699+ public static int MIN_MONSTER_ANIMATION;
2700+ /** Maximal time between animations of a monster */
2701+ public static int MAX_MONSTER_ANIMATION;
2702+
2703+ /** Knownlist update time interval */
2704+ public static long KNOWNLIST_UPDATE_INTERVAL;
2705+
2706+ /** Activate position recorder ? */
2707+ public static boolean ACTIVATE_POSITION_RECORDER;
2708+ /** Use 3D Map ? */
2709+ public static boolean USE_3D_MAP;
2710+
2711+ // Community Board
2712+ /** Type of community */
2713+ public static int COMMUNITY_TYPE;
2714+ public static boolean BBS_SHOW_PLAYERLIST;
2715+ public static String BBS_DEFAULT;
2716+ /** Show level of the community board ? */
2717+ public static boolean SHOW_LEVEL_COMMUNITYBOARD;
2718+ /** Show status of the community board ? */
2719+ public static boolean SHOW_STATUS_COMMUNITYBOARD;
2720+ /** Size of the name page on the community board */
2721+ public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
2722+ /** Name per row on community board */
2723+ public static int NAME_PER_ROW_COMMUNITYBOARD;
2724+
2725+ // Configuration files
2726+ /**
2727+ * Properties file that allows selection of new Classes for storage of World Objects. <br>
2728+ * This may help servers with large amounts of players recieving error messages related to the <i>L2ObjectHashMap</i> and <i>L2ObejctHashSet</i> classes.
2729+ */
2730+ /** Properties file for game server (connection and ingame) configurations */
2731+ public static final String CONFIGURATION_FILE = "./config/server.properties";
2732+ /** Properties file for game server options */
2733+ public static final String OPTIONS_FILE = "./config/options.properties";
2734+ /** Properties file for login server configurations */
2735+ public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
2736+ /** Properties file for the ID factory */
2737+ public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
2738+ /** Properties file for other configurations */
2739+ public static final String OTHER_CONFIG_FILE = "./config/other.properties";
2740+ /** Properties file for rates configurations */
2741+ public static final String RATES_CONFIG_FILE = "./config/rates.properties";
2742+ /** Properties file for alternative configurations */
2743+ public static final String ALT_SETTINGS_FILE = "./config/altsettings.properties";
2744+ /** Properties file for feature configurations */
2745+ public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
2746+ /** Properties file for custom configurations */
2747+ public static final String CUSTOM_CONFIG_FILE = "./config/custom.properties";
2748+ /** Properties file for events configurations */
2749+ public static final String EVENTS_CONFIG_FILE = "./config/events.properties";
2750+ /** Properties file for PVP configurations */
2751+ public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
2752+ /** Properties file for GM access configurations */
2753+ public static final String GM_ACCESS_FILE = "./config/GMAccess.properties";
2754+ /** Properties file for Flood Protector configurations */
2755+ public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
2756+ /** Properties file for telnet configurations */
2757+ public static final String TELNET_FILE = "./config/telnet.properties";
2758+ /** Properties file for l2j server version configurations */
2759+ public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
2760+ /** Properties file for l2j datapack version configurations */
2761+ public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
2762+ /** Properties file for siege configurations */
2763+ public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
2764+ /** Text file containing hexadecimal value of server ID */
2765+ public static final String HEXID_FILE = "./config/hexid.txt";
2766+ /**
2767+ * Properties file for alternative configure GM commands access level.<br>
2768+ * Note that this file only read if "AltPrivilegesAdmin = True"
2769+ */
2770+ public static final String COMMAND_PRIVILEGES_FILE = "./config/command-privileges.properties";
2771+
2772+ public static int MAX_ITEM_IN_PACKET;
2773+
2774+ public static boolean CHECK_KNOWN;
2775+
2776+ /** Game Server login port */
2777+ public static int GAME_SERVER_LOGIN_PORT;
2778+ /** Game Server login Host */
2779+ public static String GAME_SERVER_LOGIN_HOST;
2780+ /** Internal Hostname */
2781+ public static String INTERNAL_HOSTNAME;
2782+ /** External Hostname */
2783+ public static String EXTERNAL_HOSTNAME;
2784+ public static int PATH_NODE_RADIUS;
2785+ public static int NEW_NODE_ID;
2786+ public static int SELECTED_NODE_ID;
2787+ public static int LINKED_NODE_ID;
2788+ public static String NEW_NODE_TYPE;
2789+
2790+ /** Show L2Monster level and aggro ? */
2791+ public static boolean SHOW_NPC_LVL;
2792+
2793+ /**
2794+ * Force full item inventory packet to be sent for any item change ?<br>
2795+ * <u><i>Note:</i></u> This can increase network traffic
2796+ */
2797+ public static boolean FORCE_INVENTORY_UPDATE;
2798+ /** Disable the use of guards against agressive monsters ? */
2799+ public static boolean GUARD_ATTACK_AGGRO_MOB;
2800+ /** Allow use of NPC Buffer ? */
2801+ public static boolean NPC_BUFFER_ENABLED;
2802+ public static int AIO_BUFF_DURATION;
2803+ /** Allow Offline Trade ? */
2804+ public static boolean OFFLINE_TRADE_ENABLE;
2805+ /** Allow Offline Craft ? */
2806+ public static boolean OFFLINE_CRAFT_ENABLE;
2807+ /** Restore Offliners ? */
2808+ public static boolean RESTORE_OFFLINERS;
2809+ /** Max Days for Offline Stores ? */
2810+ public static int OFFLINE_MAX_DAYS;
2811+ /** Disconnect shops that finished selling ? */
2812+ public static boolean OFFLINE_DISCONNECT_FINISHED;
2813+ /** Allow color for offline mode ? */
2814+ public static boolean OFFLINE_SET_NAME_COLOR;
2815+ /** Color for offline mode */
2816+ public static int OFFLINE_NAME_COLOR;
2817+ /** Break Enchant */
2818+ public static int BREAK_ENCHANT;
2819+ /** Allow teleporting to towns that are under siege ? */
2820+ public static boolean ALLOW_SIEGE_TELEPORT;
2821+
2822+ /** Allow players to keep subclass skills ? */
2823+ public static boolean KEEP_SUBCLASS_SKILLS;
2824+
2825+ /** Allow use Event Managers for change occupation ? */
2826+ public static boolean ALLOW_CLASS_MASTERS;
2827+ public static ClassMasterSettings CLASS_MASTER_SETTINGS;
2828+ public static boolean ALLOW_ENTIRE_TREE;
2829+ public static boolean ALTERNATE_CLASS_MASTER;
2830+
2831+ /** Auto rewarding players */
2832+ public static boolean ALLOW_AUTO_REWARDER;
2833+ public static int AUTO_REWARD_DELAY;
2834+ public static int AUTO_REWARD_ID;
2835+ public static int AUTO_REWARD_COUNT;
2836+
2837+ /** Custom starting spawn for new characters */
2838+ public static boolean CUSTOM_STARTING_SPAWN;
2839+ public static int CUSTOM_SPAWN_X;
2840+ public static int CUSTOM_SPAWN_Y;
2841+ public static int CUSTOM_SPAWN_Z;
2842+
2843+ /** Allow players to view all available classes to the same village master */
2844+ public static boolean CHANGE_SUBCLASS_EVERYWHERE;
2845+
2846+ /** Auto Noblesse status at login */
2847+ public static boolean AUTO_NOBLE_STATUS;
2848+
2849+ /** Allow enchanting hero items */
2850+ public static boolean ALLOW_HERO_ENCHANT;
2851+
2852+ /** Allow Dual Box in game */
2853+ public static boolean PREVENT_DUAL_BOXING;
2854+
2855+ /** Use /block command as an AntiBuff shield */
2856+ public static boolean BLOCK_UNWANTED_BUFFS;
2857+
2858+ /** Enable custom data tables ? */
2859+ public static boolean CUSTOM_SPAWNLIST_TABLE;
2860+ public static boolean SAVE_GMSPAWN_ON_CUSTOM;
2861+ public static boolean CUSTOM_NPC_TABLE;
2862+ public static boolean CUSTOM_NPC_SKILLS_TABLE;
2863+ public static boolean CUSTOM_ITEM_TABLES;
2864+ public static boolean CUSTOM_ARMORSETS_TABLE;
2865+ public static boolean CUSTOM_TELEPORT_TABLE;
2866+ public static boolean CUSTOM_DROPLIST_TABLE;
2867+ public static boolean CUSTOM_MERCHANT_TABLES;
2868+
2869+ /** Champion Mod */
2870+ public static boolean CHAMPION_ENABLE;
2871+ public static boolean CHAMPION_PASSIVE;
2872+ public static int CHAMPION_FREQUENCY;
2873+ public static String CHAMPION_TITLE;
2874+ public static int CHAMP_MIN_LVL;
2875+ public static int CHAMP_MAX_LVL;
2876+ public static int CHAMPION_HP;
2877+ public static int CHAMPION_REWARDS;
2878+ public static int CHAMPION_ADENAS_REWARDS;
2879+ public static float CHAMPION_HP_REGEN;
2880+ public static float CHAMPION_ATK;
2881+ public static float CHAMPION_SPD_ATK;
2882+ public static int CHAMPION_REWARD_LOWER_CHANCE;
2883+ public static int CHAMPION_REWARD_HIGHER_CHANCE;
2884+ public static int CHAMPION_REWARD_ID;
2885+ public static int CHAMPION_REWARD_QTY;
2886+
2887+ // --------------------------------------------------
2888+ // FloodProtector Settings
2889+ // --------------------------------------------------
2890+ public static FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM;
2891+ public static FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE;
2892+ public static FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK;
2893+ public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON;
2894+ public static FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE;
2895+ public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
2896+ public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS;
2897+ public static FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM;
2898+ public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS;
2899+ public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
2900+ public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
2901+ public static FloodProtectorConfig FLOOD_PROTECTOR_MANUFACTURE;
2902+ public static FloodProtectorConfig FLOOD_PROTECTOR_MANOR;
2903+ public static FloodProtectorConfig FLOOD_PROTECTOR_CHARACTER_SELECT;
2904+
2905+ // Server version
2906+ /** Server version */
2907+ public static String SERVER_VERSION;
2908+ /** Date of server build */
2909+ public static String SERVER_BUILD_DATE;
2910+
2911+ // Datapack version
2912+ /** Datapack version */
2913+ public static String DATAPACK_VERSION;
2914+
2915+ /** Zone Setting */
2916+ public static int ZONE_TOWN;
2917+
2918+ /** Crafting Enabled? */
2919+ public static boolean IS_CRAFTING_ENABLED;
2920+
2921+ // Inventory slots limit
2922+ /** Maximum inventory slots limits for non dwarf characters */
2923+ public static int INVENTORY_MAXIMUM_NO_DWARF;
2924+ /** Maximum inventory slots limits for dwarf characters */
2925+ public static int INVENTORY_MAXIMUM_DWARF;
2926+ /** Maximum inventory slots limits for GM */
2927+ public static int INVENTORY_MAXIMUM_GM;
2928+ /** Maximum inventory slots limits for pet */
2929+ public static int INVENTORY_MAXIMUM_PET;
2930+
2931+ // Warehouse slots limits
2932+ /** Maximum inventory slots limits for non dwarf warehouse */
2933+ public static int WAREHOUSE_SLOTS_NO_DWARF;
2934+ /** Maximum inventory slots limits for dwarf warehouse */
2935+ public static int WAREHOUSE_SLOTS_DWARF;
2936+ /** Maximum inventory slots limits for clan warehouse */
2937+ public static int WAREHOUSE_SLOTS_CLAN;
2938+ /** Maximum inventory slots limits for freight */
2939+ public static int FREIGHT_SLOTS;
2940+
2941+ // Spoil Rates
2942+ /** Allow spoil on lower level mobs than the character */
2943+ public static boolean CAN_SPOIL_LOWER_LEVEL_MOBS;
2944+ /** Allow delevel and spoil mob ? */
2945+ public static boolean CAN_DELEVEL_AND_SPOIL_MOBS;
2946+ /** Maximum level difference between player and mob level */
2947+ public static float MAXIMUM_PLAYER_AND_MOB_LEVEL_DIFFERENCE;
2948+ /** Base rate for spoil */
2949+ public static float BASE_SPOIL_RATE;
2950+ /** Minimum spoil rate */
2951+ public static float MINIMUM_SPOIL_RATE;
2952+ /** Maximum level difference between player and spoil level to allow before decreasing spoil chance */
2953+ public static float SPOIL_LEVEL_DIFFERENCE_LIMIT;
2954+ /** Spoil level multiplier */
2955+ public static float SPOIL_LEVEL_DIFFERENCE_MULTIPLIER;
2956+ /** Last level spoil learned */
2957+ public static int LAST_LEVEL_SPOIL_IS_LEARNED;
2958+
2959+ // Karma System Variables
2960+ /** Minimum karma gain/loss */
2961+ public static int KARMA_MIN_KARMA;
2962+ /** Maximum karma gain/loss */
2963+ public static int KARMA_MAX_KARMA;
2964+ /** Number to divide the xp recieved by, to calculate karma lost on xp gain/lost */
2965+ public static int KARMA_XP_DIVIDER;
2966+ /** The Minimum Karma lost if 0 karma is to be removed */
2967+ public static int KARMA_LOST_BASE;
2968+ /** Can a GM drop item ? */
2969+ public static boolean KARMA_DROP_GM;
2970+ /** Should award a pvp point for killing a player with karma ? */
2971+ public static boolean KARMA_AWARD_PK_KILL;
2972+ /** Minimum PK required to drop */
2973+ public static int KARMA_PK_LIMIT;
2974+
2975+ /** List of pet items that cannot be dropped (seperated by ",") when PVP */
2976+ public static String KARMA_NONDROPPABLE_PET_ITEMS;
2977+ /** List of items that cannot be dropped (seperated by ",") when PVP */
2978+ public static String KARMA_NONDROPPABLE_ITEMS;
2979+ /** List of pet items that cannot be dropped when PVP */
2980+ public static List<Integer> KARMA_LIST_NONDROPPABLE_PET_ITEMS;
2981+ /** List of items that cannot be dropped when PVP */
2982+ public static List<Integer> KARMA_LIST_NONDROPPABLE_ITEMS;
2983+
2984+ /** List of items that cannot be dropped (seperated by ",") */
2985+ public static String NONDROPPABLE_ITEMS;
2986+ /** List of items that cannot be dropped */
2987+ public static List<Integer> LIST_NONDROPPABLE_ITEMS;
2988+
2989+ /** List of NPCs that rent pets (seperated by ",") */
2990+ public static String PET_RENT_NPC;
2991+ /** List of NPCs that rent pets */
2992+ public static List<Integer> LIST_PET_RENT_NPC;
2993+
2994+ /** Duration (in ms) while a player stay in PVP mode after hitting an innocent */
2995+ public static int PVP_NORMAL_TIME;
2996+ /** Duration (in ms) while a player stay in PVP mode after hitting a purple player */
2997+ public static int PVP_PVP_TIME;
2998+
2999+ // Karma Punishment
3000+ /** Allow player with karma to be killed in peace zone ? */
3001+ public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
3002+ /** Allow player with karma to shop ? */
3003+ public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
3004+ /** Allow player with karma to use gatekeepers ? */
3005+ public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
3006+ /** Allow player with karma to use SOE or Return skill ? */
3007+ public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
3008+ /** Allow player with karma to trade ? */
3009+ public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
3010+ /** Allow player with karma to use warehouse ? */
3011+ public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
3012+
3013+ /** Enumeration for type of ID Factory */
3014+ public static enum IdFactoryType
3015+ {
3016+ Compaction,
3017+ BitSet,
3018+ Stack
3019+ }
3020+
3021+ /** ID Factory type */
3022+ public static IdFactoryType IDFACTORY_TYPE;
3023+ /** Check for bad ID ? */
3024+ public static boolean BAD_ID_CHECKING;
3025+
3026+ /** Enumeration for type of maps object */
3027+ public static enum ObjectMapType
3028+ {
3029+ L2ObjectHashMap,
3030+ WorldObjectMap
3031+ }
3032+
3033+ /** Enumeration for type of set object */
3034+ public static enum ObjectSetType
3035+ {
3036+ L2ObjectHashSet,
3037+ WorldObjectSet
3038+ }
3039+
3040+ /** Type of map object */
3041+ public static ObjectMapType MAP_TYPE;
3042+ /** Type of set object */
3043+ public static ObjectSetType SET_TYPE;
3044+
3045+ /**
3046+ * Allow lesser effects to be canceled if stronger effects are used when effects of the same stack group are used.<br>
3047+ * New effects that are added will be canceled if they are of lesser priority to the old one.
3048+ */
3049+ public static boolean EFFECT_CANCELING;
3050+
3051+ /** Auto-delete invalid quest data ? */
3052+ public static boolean AUTODELETE_INVALID_QUEST_DATA;
3053+
3054+ /** Chance that an item will succesfully be enchanted */
3055+ public static int ENCHANT_CHANCE_WEAPON;
3056+ public static int ENCHANT_CHANCE_ARMOR;
3057+ public static int ENCHANT_CHANCE_JEWELRY;
3058+ public static int BLESSED_ENCHANT_CHANCE_WEAPON;
3059+ public static int BLESSED_ENCHANT_CHANCE_ARMOR;
3060+ public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
3061+ /** Maximum level of enchantment */
3062+ public static int ENCHANT_MAX_WEAPON;
3063+ public static int ENCHANT_MAX_ARMOR;
3064+ public static int ENCHANT_MAX_JEWELRY;
3065+ /** maximum level of safe enchantment for normal items */
3066+ public static int ENCHANT_SAFE_MAX;
3067+ /** maximum level of safe enchantment for full body armor */
3068+ public static int ENCHANT_SAFE_MAX_FULL;
3069+
3070+ // Character multipliers
3071+ /** Multiplier for character HP regeneration */
3072+ public static double HP_REGEN_MULTIPLIER;
3073+ /** Mutilplier for character MP regeneration */
3074+ public static double MP_REGEN_MULTIPLIER;
3075+ /** Multiplier for character CP regeneration */
3076+ public static double CP_REGEN_MULTIPLIER;
3077+
3078+ // Raid Boss multipliers
3079+ /** Multiplier for Raid boss HP regeneration */
3080+ public static double RAID_HP_REGEN_MULTIPLIER;
3081+ /** Mulitplier for Raid boss MP regeneration */
3082+ public static double RAID_MP_REGEN_MULTIPLIER;
3083+ /** Multiplier for Raid boss power defense multiplier */
3084+ public static double RAID_PDEFENCE_MULTIPLIER;
3085+ /** Multiplier for Raid boss magic defense multiplier */
3086+ public static double RAID_MDEFENCE_MULTIPLIER;
3087+ /** Raid Boss Minin Spawn Timer */
3088+ public static double RAID_MINION_RESPAWN_TIMER;
3089+ /** Mulitplier for Raid boss minimum time respawn */
3090+ public static float RAID_MIN_RESPAWN_MULTIPLIER;
3091+ /** Mulitplier for Raid boss maximum time respawn */
3092+ public static float RAID_MAX_RESPAWN_MULTIPLIER;
3093+ /** Amount of adenas when starting a new character */
3094+ public static int STARTING_ADENA;
3095+ /** Starting level of a new character */
3096+ public static byte STARTING_LEVEL;
3097+ /** Starting level of a new subclass */
3098+ public static byte STARTING_SUB_LEVEL;
3099+
3100+ /** Maximum character running speed */
3101+ public static int MAX_RUN_SPEED;
3102+ /** Maximum character Physical Critical Rate */
3103+ public static int MAX_PCRIT_RATE;
3104+ /** Maximum character Magic Critical Rate */
3105+ public static int MAX_MCRIT_RATE;
3106+ /** Maximum character Physical Attack Speed */
3107+ public static int MAX_PATK_SPEED;
3108+ /** Maximum character Magic Attack Speed */
3109+ public static int MAX_MATK_SPEED;
3110+
3111+ /** Deep Blue Mobs' Drop Rules Enabled */
3112+ public static boolean DEEPBLUE_DROP_RULES;
3113+ public static int UNSTUCK_INTERVAL;
3114+
3115+ /** Is telnet enabled ? */
3116+ public static boolean IS_TELNET_ENABLED;
3117+ /** Telnet status port */
3118+ public static int TELNET_PORT;
3119+
3120+ /** Player Protection control */
3121+ public static int PLAYER_SPAWN_PROTECTION;
3122+ public static int PLAYER_FAKEDEATH_UP_PROTECTION;
3123+
3124+ /** Define Party XP cutoff point method - Possible values: level and percentage */
3125+ public static String PARTY_XP_CUTOFF_METHOD;
3126+ /** Define the cutoff point value for the "level" method */
3127+ public static int PARTY_XP_CUTOFF_LEVEL;
3128+ /** Define the cutoff point value for the "percentage" method */
3129+ public static double PARTY_XP_CUTOFF_PERCENT;
3130+
3131+ /** Percent HP is restore on respawn */
3132+ public static double RESPAWN_RESTORE_HP;
3133+
3134+ /** Allow randomizing of the respawn point in towns. */
3135+ public static boolean RESPAWN_RANDOM_ENABLED;
3136+ /** The maximum offset from the base respawn point to allow. */
3137+ public static int RESPAWN_RANDOM_MAX_OFFSET;
3138+
3139+ /** Maximum number of available slots for pvt stores (sell/buy) - Dwarves */
3140+ public static int MAX_PVTSTORE_SLOTS_DWARF;
3141+ /** Maximum number of available slots for pvt stores (sell/buy) - Others */
3142+ public static int MAX_PVTSTORE_SLOTS_OTHER;
3143+
3144+ /** Store skills cooltime on char exit/relogin */
3145+ public static boolean STORE_SKILL_COOLTIME;
3146+ /** Show licence or not just after login (if false, will directly go to the Server List */
3147 public static boolean SHOW_LICENCE;
3148
3149- /** Default punishment for illegal actions */
3150- public static int DEFAULT_PUNISH;
3151- /** Parameter for default punishment */
3152- public static int DEFAULT_PUNISH_PARAM;
3153-
3154- /** Accept new game server ? */
3155- public static boolean ACCEPT_NEW_GAMESERVER;
3156- /** Hexadecimal ID of the game server */
3157- public static byte[] HEX_ID;
3158- /** Accept alternate ID for server ? */
3159- public static boolean ACCEPT_ALTERNATE_ID;
3160- /** ID for request to the server */
3161- public static int REQUEST_ID;
3162- public static boolean RESERVE_HOST_ON_LOGIN = false;
3163-
3164- public static int MINIMUM_UPDATE_DISTANCE;
3165- public static int KNOWNLIST_FORGET_DELAY;
3166- public static int MINIMUN_UPDATE_TIME;
3167-
3168- public static boolean ANNOUNCE_MAMMON_SPAWN;
3169- public static boolean LAZY_CACHE;
3170-
3171- /** Enable colored name for GM ? */
3172- public static boolean GM_NAME_COLOR_ENABLED;
3173- /** Color of GM name */
3174- public static int GM_NAME_COLOR;
3175- /** Color of admin name */
3176- public static int ADMIN_NAME_COLOR;
3177- /** Place an aura around the GM ? */
3178- public static boolean GM_HERO_AURA;
3179- /** Set the GM invulnerable at startup ? */
3180- public static boolean GM_STARTUP_INVULNERABLE;
3181- /** Set the GM invisible at startup ? */
3182- public static boolean GM_STARTUP_INVISIBLE;
3183- /** Set silence to GM at startup ? */
3184- public static boolean GM_STARTUP_SILENCE;
3185- /** Add GM in the GM list at startup ? */
3186- public static boolean GM_STARTUP_AUTO_LIST;
3187-
3188- /** Allow petition ? */
3189- public static boolean PETITIONING_ALLOWED;
3190- /** Maximum number of petitions per player */
3191- public static int MAX_PETITIONS_PER_PLAYER;
3192- /** Maximum number of petitions pending */
3193- public static int MAX_PETITIONS_PENDING;
3194-
3195-
3196- /** Bypass exploit protection ? */
3197- public static boolean BYPASS_VALIDATION;
3198-
3199- /** Only GM buy items for free**/
3200- public static boolean ONLY_GM_ITEMS_FREE;
3201-
3202- /** GM Audit ?*/
3203- public static boolean GMAUDIT;
3204-
3205- /** Allow auto-create account ? */
3206- public static boolean AUTO_CREATE_ACCOUNTS;
3207-
3208- public static boolean FLOOD_PROTECTION;
3209- public static int FAST_CONNECTION_LIMIT;
3210- public static int NORMAL_CONNECTION_TIME;
3211- public static int FAST_CONNECTION_TIME;
3212- public static int MAX_CONNECTION_PER_IP;
3213-
3214- /** Enforce gameguard query on character login ? */
3215- public static boolean GAMEGUARD_ENFORCE;
3216- /** Don't allow player to perform trade,talk with npc and move until gameguard reply received ? */
3217- public static boolean GAMEGUARD_PROHIBITACTION;
3218-
3219- /** Recipebook limits */
3220- public static int DWARF_RECIPE_LIMIT;
3221- public static int COMMON_RECIPE_LIMIT;
3222-
3223- /** Grid Options */
3224- public static boolean GRIDS_ALWAYS_ON;
3225- public static int GRID_NEIGHBOR_TURNON_TIME;
3226- public static int GRID_NEIGHBOR_TURNOFF_TIME;
3227-
3228- /** Clan Hall function related configs */
3229- public static long CH_TELE_FEE_RATIO;
3230- public static int CH_TELE1_FEE;
3231- public static int CH_TELE2_FEE;
3232- public static long CH_ITEM_FEE_RATIO;
3233- public static int CH_ITEM1_FEE;
3234- public static int CH_ITEM2_FEE;
3235- public static int CH_ITEM3_FEE;
3236- public static long CH_MPREG_FEE_RATIO;
3237- public static int CH_MPREG1_FEE;
3238- public static int CH_MPREG2_FEE;
3239- public static int CH_MPREG3_FEE;
3240- public static int CH_MPREG4_FEE;
3241- public static int CH_MPREG5_FEE;
3242- public static long CH_HPREG_FEE_RATIO;
3243- public static int CH_HPREG1_FEE;
3244- public static int CH_HPREG2_FEE;
3245- public static int CH_HPREG3_FEE;
3246- public static int CH_HPREG4_FEE;
3247- public static int CH_HPREG5_FEE;
3248- public static int CH_HPREG6_FEE;
3249- public static int CH_HPREG7_FEE;
3250- public static int CH_HPREG8_FEE;
3251- public static int CH_HPREG9_FEE;
3252- public static int CH_HPREG10_FEE;
3253- public static int CH_HPREG11_FEE;
3254- public static int CH_HPREG12_FEE;
3255- public static int CH_HPREG13_FEE;
3256- public static long CH_EXPREG_FEE_RATIO;
3257- public static int CH_EXPREG1_FEE;
3258- public static int CH_EXPREG2_FEE;
3259- public static int CH_EXPREG3_FEE;
3260- public static int CH_EXPREG4_FEE;
3261- public static int CH_EXPREG5_FEE;
3262- public static int CH_EXPREG6_FEE;
3263- public static int CH_EXPREG7_FEE;
3264- public static long CH_SUPPORT_FEE_RATIO;
3265- public static int CH_SUPPORT1_FEE;
3266- public static int CH_SUPPORT2_FEE;
3267- public static int CH_SUPPORT3_FEE;
3268- public static int CH_SUPPORT4_FEE;
3269- public static int CH_SUPPORT5_FEE;
3270- public static int CH_SUPPORT6_FEE;
3271- public static int CH_SUPPORT7_FEE;
3272- public static int CH_SUPPORT8_FEE;
3273- public static long CH_CURTAIN_FEE_RATIO;
3274- public static int CH_CURTAIN1_FEE;
3275- public static int CH_CURTAIN2_FEE;
3276- public static long CH_FRONT_FEE_RATIO;
3277- public static int CH_FRONT1_FEE;
3278- public static int CH_FRONT2_FEE;
3279-
3280- /** Castle function related configs */
3281- public static long CS_TELE_FEE_RATIO;
3282- public static int CS_TELE1_FEE;
3283- public static int CS_TELE2_FEE;
3284- public static long CS_MPREG_FEE_RATIO;
3285- public static int CS_MPREG1_FEE;
3286- public static int CS_MPREG2_FEE;
3287- public static int CS_MPREG3_FEE;
3288- public static int CS_MPREG4_FEE;
3289- public static long CS_HPREG_FEE_RATIO;
3290- public static int CS_HPREG1_FEE;
3291- public static int CS_HPREG2_FEE;
3292- public static int CS_HPREG3_FEE;
3293- public static int CS_HPREG4_FEE;
3294- public static int CS_HPREG5_FEE;
3295- public static long CS_EXPREG_FEE_RATIO;
3296- public static int CS_EXPREG1_FEE;
3297- public static int CS_EXPREG2_FEE;
3298- public static int CS_EXPREG3_FEE;
3299- public static int CS_EXPREG4_FEE;
3300- public static long CS_SUPPORT_FEE_RATIO;
3301- public static int CS_SUPPORT1_FEE;
3302- public static int CS_SUPPORT2_FEE;
3303- public static int CS_SUPPORT3_FEE;
3304- public static int CS_SUPPORT4_FEE;
3305-
3306- /** GeoData 0/1/2 */
3307- public static int GEODATA;
3308- public static String GEODATA_DRIVER;
3309-
3310- /** Cell PathFinding */
3311- public static boolean GEODATA_CELLFINDING;
3312- public static File PATHNODE_DIR;
3313- public static String PATHFIND_BUFFERS;
3314- public static float LOW_WEIGHT;
3315- public static float MEDIUM_WEIGHT;
3316- public static float HIGH_WEIGHT;
3317- public static boolean ADVANCED_DIAGONAL_STRATEGY;
3318- public static float DIAGONAL_WEIGHT;
3319- public static int MAX_POSTFILTER_PASSES;
3320- public static boolean DEBUG_PATH;
3321-
3322- /** Force loading GeoData to physical memory */
3323- public static boolean FORCE_GEODATA;
3324- public static boolean ACCEPT_GEOEDITOR_CONN;
3325-
3326- /** Max number of buffs */
3327- public static byte BUFFS_MAX_AMOUNT;
3328-
3329- /** Alt Settings for devs */
3330- public static boolean ALT_DEV_NO_QUESTS;
3331- public static boolean ALT_DEV_NO_SPAWNS;
3332-
3333- /**
3334- * This class initializes all global variables for configuration.<br>
3335- * If key doesn't appear in properties file, a default value is setting on by this class.
3336- * @see CONFIGURATION_FILE (propertie file) for configuring your server.
3337- */
3338- public static void load()
3339- {
3340- if (Server.SERVER_MODE == Server.MODE_GAMESERVER)
3341- {
3342- FLOOD_PROTECTOR_USE_ITEM = new FloodProtectorConfig("UseItemFloodProtector");
3343- FLOOD_PROTECTOR_ROLL_DICE = new FloodProtectorConfig("RollDiceFloodProtector");
3344- FLOOD_PROTECTOR_FIREWORK = new FloodProtectorConfig("FireworkFloodProtector");
3345- FLOOD_PROTECTOR_ITEM_PET_SUMMON = new FloodProtectorConfig("ItemPetSummonFloodProtector");
3346- FLOOD_PROTECTOR_HERO_VOICE = new FloodProtectorConfig("HeroVoiceFloodProtector");
3347- FLOOD_PROTECTOR_GLOBAL_CHAT = new FloodProtectorConfig("GlobalChatFloodProtector");
3348- FLOOD_PROTECTOR_SUBCLASS = new FloodProtectorConfig("SubclassFloodProtector");
3349- FLOOD_PROTECTOR_DROP_ITEM = new FloodProtectorConfig("DropItemFloodProtector");
3350- FLOOD_PROTECTOR_SERVER_BYPASS = new FloodProtectorConfig("ServerBypassFloodProtector");
3351- FLOOD_PROTECTOR_MULTISELL = new FloodProtectorConfig("MultiSellFloodProtector");
3352- FLOOD_PROTECTOR_TRANSACTION = new FloodProtectorConfig("TransactionFloodProtector");
3353- FLOOD_PROTECTOR_MANUFACTURE = new FloodProtectorConfig("ManufactureFloodProtector");
3354- FLOOD_PROTECTOR_MANOR = new FloodProtectorConfig("ManorFloodProtector");
3355- FLOOD_PROTECTOR_CHARACTER_SELECT = new FloodProtectorConfig("CharacterSelectFloodProtector");
3356-
3357- _log.info("Loading Gameserver Configuration Files.");
3358-
3359- Properties serverSettings = new Properties();
3360- try (InputStream is = new FileInputStream(new File(CONFIGURATION_FILE)))
3361- {
3362- serverSettings.load(is);
3363- }
3364- catch (Exception e)
3365- {
3366- e.printStackTrace();
3367- throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
3368- }
3369-
3370- GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
3371- PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
3372-
3373- EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
3374- INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
3375-
3376-
3377- GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
3378- GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");
3379-
3380- REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
3381- ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
3382-
3383- DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
3384- DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
3385- DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
3386- DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
3387- DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
3388- CONNECTION_CLOSE_TIME = Long.parseLong(serverSettings.getProperty("ConnectionCloseTime", "60000"));
3389-
3390- try
3391- {
3392- DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".").replaceAll("\\\\", "/")).getCanonicalFile();
3393- }
3394- catch (Exception e)
3395- {
3396- _log.warning("Error setting datapack root!");
3397- DATAPACK_ROOT = new File(".");
3398- }
3399-
3400- CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
3401- PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
3402-
3403- MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "7"));
3404- MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
3405-
3406- MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
3407- MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
3408-
3409- if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
3410- {
3411- throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
3412- }
3413-
3414- Properties optionsSettings = new Properties();
3415- try (InputStream is = new FileInputStream(new File(OPTIONS_FILE)))
3416- {
3417- optionsSettings.load(is);
3418- }
3419- catch (Exception e)
3420- {
3421- e.printStackTrace();
3422- throw new Error("Failed to Load "+OPTIONS_FILE+" File.");
3423- }
3424-
3425- EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(optionsSettings.getProperty("EverybodyHasAdminRights", "false"));
3426-
3427- DISPLAY_SERVER_VERSION = Boolean.parseBoolean(optionsSettings.getProperty("DisplayServerRevision", "false"));
3428-
3429- DEBUG = Boolean.parseBoolean(optionsSettings.getProperty("Debug", "false"));
3430- ASSERT = Boolean.parseBoolean(optionsSettings.getProperty("Assert", "false"));
3431- DEVELOPER = Boolean.parseBoolean(optionsSettings.getProperty("Developer", "false"));
3432- ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(optionsSettings.getProperty("AcceptGeoeditorConn", "False"));
3433- TEST_SERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
3434- SERVER_LIST_TESTSERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
3435-
3436- SERVER_LIST_BRACKET = Boolean.valueOf(optionsSettings.getProperty("ServerListBrackets", "false"));
3437- SERVER_LIST_CLOCK = Boolean.valueOf(optionsSettings.getProperty("ServerListClock", "false"));
3438- SERVER_GMONLY = Boolean.valueOf(optionsSettings.getProperty("ServerGMOnly", "false"));
3439-
3440- SKILL_CHECK_ENABLE = Boolean.valueOf(optionsSettings.getProperty("SkillCheckEnable", "False"));
3441-
3442- AUTODESTROY_ITEM_AFTER = Integer.parseInt(optionsSettings.getProperty("AutoDestroyDroppedItemAfter", "0"));
3443- PROTECTED_ITEMS = optionsSettings.getProperty("ListOfProtectedItems");
3444- LIST_PROTECTED_ITEMS = new FastList<>();
3445- for (String id : PROTECTED_ITEMS.split(","))
3446- {
3447- LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
3448- }
3449- UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(optionsSettings.getProperty("UpdateItemsOnCharStore", "false"));
3450- LAZY_ITEMS_UPDATE = Boolean.parseBoolean(optionsSettings.getProperty("LazyItemsUpdate", "false"));
3451- DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyPlayerDroppedItem", "false"));
3452- DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyEquipableItem", "false"));
3453- SAVE_DROPPED_ITEM = Boolean.valueOf(optionsSettings.getProperty("SaveDroppedItem", "false"));
3454- EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(optionsSettings.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
3455- SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(optionsSettings.getProperty("SaveDroppedItemInterval", "0"))*60000;
3456- CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(optionsSettings.getProperty("ClearDroppedItemTable", "false"));
3457-
3458-
3459- PRECISE_DROP_CALCULATION = Boolean.valueOf(optionsSettings.getProperty("PreciseDropCalculation", "True"));
3460- MULTIPLE_ITEM_DROP = Boolean.valueOf(optionsSettings.getProperty("MultipleItemDrop", "True"));
3461-
3462- String str = optionsSettings.getProperty("EnableFallingDamage", "auto");
3463- ENABLE_FALLING_DAMAGE = "auto".equalsIgnoreCase(str) ? GEODATA > 0 : Boolean.parseBoolean(str);
3464-
3465- ALLOW_WAREHOUSE = Boolean.valueOf(optionsSettings.getProperty("AllowWarehouse", "True"));
3466- WAREHOUSE_CACHE = Boolean.valueOf(optionsSettings.getProperty("WarehouseCache", "False"));
3467- WAREHOUSE_CACHE_TIME = Integer.parseInt(optionsSettings.getProperty("WarehouseCacheTime", "15"));
3468- ALLOW_FREIGHT = Boolean.valueOf(optionsSettings.getProperty("AllowFreight", "True"));
3469- ALLOW_WEAR = Boolean.valueOf(optionsSettings.getProperty("AllowWear", "False"));
3470- WEAR_DELAY = Integer.parseInt(optionsSettings.getProperty("WearDelay", "5"));
3471- WEAR_PRICE = Integer.parseInt(optionsSettings.getProperty("WearPrice", "10"));
3472- ALLOW_LOTTERY = Boolean.valueOf(optionsSettings.getProperty("AllowLottery", "False"));
3473- ALLOW_RACE = Boolean.valueOf(optionsSettings.getProperty("AllowRace", "False"));
3474- ALLOW_WATER = Boolean.valueOf(optionsSettings.getProperty("AllowWater", "False"));
3475- ALLOW_RENTPET = Boolean.valueOf(optionsSettings.getProperty("AllowRentPet", "False"));
3476- ALLOW_DISCARDITEM = Boolean.valueOf(optionsSettings.getProperty("AllowDiscardItem", "True"));
3477- ALLOWFISHING = Boolean.valueOf(optionsSettings.getProperty("AllowFishing", "True"));
3478- ALLOW_BOAT = Boolean.valueOf(optionsSettings.getProperty("AllowBoat", "False"));
3479-
3480- ALLOW_L2WALKER = Boolean.valueOf(optionsSettings.getProperty("AllowL2Walker", "False"));
3481- ALLOW_MANOR = Boolean.valueOf(optionsSettings.getProperty("AllowManor", "True"));
3482- ALLOW_NPC_WALKERS = Boolean.valueOf(optionsSettings.getProperty("AllowNpcWalkers", "True"));
3483- ALLOW_PET_WALKERS = Boolean.valueOf(optionsSettings.getProperty("AllowPetWalkers", "True"));
3484-
3485- ACTIVATE_POSITION_RECORDER = Boolean.valueOf(optionsSettings.getProperty("ActivatePositionRecorder", "False"));
3486-
3487- DEFAULT_GLOBAL_CHAT = optionsSettings.getProperty("GlobalChat", "ON");
3488- DEFAULT_TRADE_CHAT = optionsSettings.getProperty("TradeChat", "ON");
3489-
3490- LOG_CHAT = Boolean.valueOf(optionsSettings.getProperty("LogChat", "False"));
3491- LOG_ITEMS = Boolean.valueOf(optionsSettings.getProperty("LogItems", "false"));
3492-
3493- GMAUDIT = Boolean.valueOf(optionsSettings.getProperty("GMAudit", "False"));
3494-
3495- COMMUNITY_TYPE = Integer.parseInt(optionsSettings.getProperty("CommunityType", "1"));
3496- BBS_SHOW_PLAYERLIST = Boolean.valueOf(optionsSettings.getProperty("BBSShowPlayerList", "False"));
3497- BBS_DEFAULT = optionsSettings.getProperty("BBSDefault", "_bbshome");
3498- SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowLevelOnCommunityBoard", "False"));
3499- SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowStatusOnCommunityBoard", "True"));
3500- NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePageSizeOnCommunityBoard", "50"));
3501- NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePerRowOnCommunityBoard", "5"));
3502-
3503- ZONE_TOWN = Integer.parseInt(optionsSettings.getProperty("ZoneTown", "0"));
3504-
3505- MAX_DRIFT_RANGE = Integer.parseInt(optionsSettings.getProperty("MaxDriftRange", "300"));
3506-
3507- MIN_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinNPCAnimation", "10"));
3508- MAX_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxNPCAnimation", "20"));
3509-
3510- MIN_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinMonsterAnimation", "5"));
3511- MAX_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxMonsterAnimation", "20"));
3512-
3513- KNOWNLIST_UPDATE_INTERVAL = Long.parseLong(optionsSettings.getProperty("KnownListUpdateInterval", "1250"));
3514-
3515- SHOW_NPC_LVL = Boolean.valueOf(optionsSettings.getProperty("ShowNpcLevel", "False"));
3516-
3517- FORCE_INVENTORY_UPDATE = Boolean.valueOf(optionsSettings.getProperty("ForceInventoryUpdate", "False"));
3518-
3519- AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(optionsSettings.getProperty("AutoDeleteInvalidQuestData", "False"));
3520-
3521-
3522-
3523- THREAD_P_EFFECTS = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeEffects", "6"));
3524- THREAD_P_GENERAL = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeGeneral", "15"));
3525- GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralPacketThreadCoreSize", "4"));
3526- IO_PACKET_THREAD_CORE_SIZE =Integer.parseInt(optionsSettings.getProperty("UrgentPacketThreadCoreSize", "2"));
3527- AI_MAX_THREAD = Integer.parseInt(optionsSettings.getProperty("AiMaxThread", "10"));
3528- GENERAL_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralThreadCoreSize", "4"));
3529-
3530- DELETE_DAYS = Integer.parseInt(optionsSettings.getProperty("DeleteCharAfterDays", "7"));
3531-
3532- DEFAULT_PUNISH = Integer.parseInt(optionsSettings.getProperty("DefaultPunish", "2"));
3533- DEFAULT_PUNISH_PARAM = Integer.parseInt(optionsSettings.getProperty("DefaultPunishParam", "0"));
3534-
3535- LAZY_CACHE = Boolean.valueOf(optionsSettings.getProperty("LazyCache", "False"));
3536-
3537- PACKET_LIFETIME = Integer.parseInt(optionsSettings.getProperty("PacketLifeTime", "0"));
3538-
3539- DEADLOCK_DETECTOR = Boolean.valueOf(optionsSettings.getProperty("DeadLockDetector", "False"));
3540- DEADLOCK_CHECK_INTERVAL = Integer.parseInt(optionsSettings.getProperty("DeadLockCheckInterval", "20"));
3541- RESTART_ON_DEADLOCK = Boolean.valueOf(optionsSettings.getProperty("RestartOnDeadlock", "False"));
3542-
3543- BYPASS_VALIDATION = Boolean.valueOf(optionsSettings.getProperty("BypassValidation", "True"));
3544-
3545-
3546- ONLY_GM_ITEMS_FREE = Boolean.valueOf(optionsSettings.getProperty("OnlyGMItemsFree", "True"));
3547-
3548- GAMEGUARD_ENFORCE = Boolean.valueOf(optionsSettings.getProperty("GameGuardEnforce", "False"));
3549- GAMEGUARD_PROHIBITACTION = Boolean.valueOf(optionsSettings.getProperty("GameGuardProhibitAction", "False"));
3550-
3551- GRIDS_ALWAYS_ON = Boolean.parseBoolean(optionsSettings.getProperty("GridsAlwaysOn", "False"));
3552- GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOnTime", "1"));
3553- GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOffTime", "90"));
3554-
3555-
3556- GEODATA = Integer.parseInt(optionsSettings.getProperty("GeoData", "0"));
3557- GEODATA_DRIVER = optionsSettings.getProperty("GeoDataDriver", "com.l2j.geodriver.GeoDriver");
3558- GEODATA_CELLFINDING = Boolean.parseBoolean(optionsSettings.getProperty("CellPathFinding", "False"));
3559-
3560- try
3561- {
3562- PATHNODE_DIR = new File(optionsSettings.getProperty("PathnodeDirectory", "./data/pathnode").replaceAll("\\\\", "/")).getCanonicalFile();
3563- }
3564- catch (Exception e)
3565- {
3566- _log.warning("Error setting pathnode directory!");
3567- PATHNODE_DIR = new File("./data/pathnode");
3568- }
3569-
3570- PATHFIND_BUFFERS = optionsSettings.getProperty("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
3571- LOW_WEIGHT = Float.parseFloat(optionsSettings.getProperty("LowWeight", "0.5"));
3572- MEDIUM_WEIGHT = Float.parseFloat(optionsSettings.getProperty("MediumWeight", "2"));
3573- HIGH_WEIGHT = Float.parseFloat(optionsSettings.getProperty("HighWeight", "3"));
3574- ADVANCED_DIAGONAL_STRATEGY = Boolean.parseBoolean(optionsSettings.getProperty("AdvancedDiagonalStrategy", "True"));
3575- DIAGONAL_WEIGHT = Float.parseFloat(optionsSettings.getProperty("DiagonalWeight", "0.707"));
3576- MAX_POSTFILTER_PASSES = Integer.parseInt(optionsSettings.getProperty("MaxPostfilterPasses", "3"));
3577- DEBUG_PATH = Boolean.parseBoolean(optionsSettings.getProperty("DebugPath", "False"));
3578- FORCE_GEODATA = Boolean.parseBoolean(optionsSettings.getProperty("ForceGeoData", "True"));
3579- COORD_SYNCHRONIZE = Integer.parseInt(optionsSettings.getProperty("CoordSynchronize", "-1"));
3580-
3581- // ---------------------------------------------------
3582- // Configuration values not found in config files
3583- // ---------------------------------------------------
3584-
3585- USE_3D_MAP = Boolean.valueOf(optionsSettings.getProperty("Use3DMap", "False"));
3586-
3587- PATH_NODE_RADIUS = Integer.parseInt(optionsSettings.getProperty("PathNodeRadius", "50"));
3588- NEW_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
3589- SELECTED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
3590- LINKED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
3591- NEW_NODE_TYPE = optionsSettings.getProperty("NewNodeType", "npc");
3592-
3593- MINIMUM_UPDATE_DISTANCE = Integer.parseInt(optionsSettings.getProperty("MaximumUpdateDistance", "50"));
3594- MINIMUN_UPDATE_TIME = Integer.parseInt(optionsSettings.getProperty("MinimumUpdateTime", "500"));
3595- CHECK_KNOWN = Boolean.valueOf(optionsSettings.getProperty("CheckKnownList", "false"));
3596- KNOWNLIST_FORGET_DELAY = Integer.parseInt(optionsSettings.getProperty("KnownListForgetDelay", "10000"));
3597-
3598- /*
3599- * Load L2J Server Version Properties file (if exists)
3600- */
3601- Properties serverVersion = new Properties();
3602- try (InputStream is = new FileInputStream(new File(SERVER_VERSION_FILE)))
3603- {
3604- serverVersion.load(is);
3605- }
3606- catch (Exception e)
3607- {
3608- //Ignore Properties file if it doesnt exist
3609- SERVER_VERSION = "Unsupported Custom Version.";
3610- SERVER_BUILD_DATE = "Undefined Date.";
3611- }
3612-
3613- SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
3614- SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
3615-
3616- /*
3617- * Load L2J Datapack Version Properties file (if exists)
3618- */
3619- Properties datapackVersion = new Properties();
3620- try (InputStream is = new FileInputStream(new File(DATAPACK_VERSION_FILE)))
3621- {
3622- datapackVersion.load(is);
3623- }
3624- catch (Exception e)
3625- {
3626- //Ignore Properties file if it doesnt exist
3627- DATAPACK_VERSION = "Unsupported Custom Version.";
3628- }
3629-
3630- DATAPACK_VERSION = datapackVersion.getProperty("version", "Unsupported Custom Version.");
3631-
3632- // telnet
3633- Properties telnetSettings = new Properties();
3634- try (InputStream is = new FileInputStream(new File(TELNET_FILE)))
3635- {
3636- telnetSettings.load(is);
3637- }
3638- catch (Exception e)
3639- {
3640- e.printStackTrace();
3641- throw new Error("Failed to Load "+TELNET_FILE+" File.");
3642- }
3643-
3644- IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "False"));
3645- TELNET_PORT = Integer.parseInt(telnetSettings.getProperty("GameStatusPort", "54321"));
3646-
3647- // id factory
3648- Properties idSettings = new Properties();
3649- try (InputStream is = new FileInputStream(new File(ID_CONFIG_FILE)))
3650- {
3651- idSettings.load(is);
3652- }
3653- catch (Exception e)
3654- {
3655- e.printStackTrace();
3656- throw new Error("Failed to Load "+ID_CONFIG_FILE+" File.");
3657- }
3658-
3659- MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
3660- SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
3661- IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
3662- BAD_ID_CHECKING = Boolean.valueOf(idSettings.getProperty("BadIdChecking", "True"));
3663-
3664- // Load FloodProtector Properties file
3665- Properties security = new Properties();
3666- try (InputStream is = new FileInputStream(new File(FLOOD_PROTECTOR_FILE)))
3667- {
3668- security.load(is);
3669- }
3670- catch (Exception e)
3671- {
3672- e.printStackTrace();
3673- throw new Error("Failed to Load "+FLOOD_PROTECTOR_FILE+" File.");
3674- }
3675-
3676- loadFloodProtectorConfigs(security);
3677-
3678- // other
3679- Properties otherSettings = new Properties();
3680- try (InputStream is = new FileInputStream(new File(OTHER_CONFIG_FILE)))
3681- {
3682- otherSettings.load(is);
3683- }
3684- catch (Exception e)
3685- {
3686- e.printStackTrace();
3687- throw new Error("Failed to Load "+OTHER_CONFIG_FILE+" File.");
3688- }
3689-
3690- DEEPBLUE_DROP_RULES = Boolean.parseBoolean(otherSettings.getProperty("UseDeepBlueDropRules", "True"));
3691- GUARD_ATTACK_AGGRO_MOB = Boolean.valueOf(otherSettings.getProperty("GuardAttackAggroMob", "False"));
3692- EFFECT_CANCELING = Boolean.valueOf(otherSettings.getProperty("CancelLesserEffect", "True"));
3693- ALLOW_WYVERN_UPGRADER = Boolean.valueOf(otherSettings.getProperty("AllowWyvernUpgrader", "False"));
3694-
3695- /* Inventory slots limits */
3696- INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForNoDwarf", "80"));
3697- INVENTORY_MAXIMUM_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForDwarf", "100"));
3698- INVENTORY_MAXIMUM_GM = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForGMPlayer", "250"));
3699-
3700- INVENTORY_MAXIMUM_PET = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForPet", "12"));
3701- MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
3702-
3703-
3704- /* Warehouse slots limits */
3705- WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
3706- WAREHOUSE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
3707- WAREHOUSE_SLOTS_CLAN = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForClan", "200"));
3708- FREIGHT_SLOTS = Integer.parseInt(otherSettings.getProperty("MaximumFreightSlots", "20"));
3709-
3710- /* chance to enchant an item over +3 */
3711- ENCHANT_CHANCE_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantChanceWeapon", "68"));
3712- ENCHANT_CHANCE_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantChanceArmor", "52"));
3713- ENCHANT_CHANCE_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantChanceJewelry", "54"));
3714- BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(otherSettings.getProperty("BlessedEnchantChanceWeapon", "68"));
3715- BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(otherSettings.getProperty("BlessedEnchantChanceArmor", "52"));
3716- BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(otherSettings.getProperty("BlessedEnchantChanceJewelry", "54"));
3717- /* limit on enchant */
3718- ENCHANT_MAX_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantMaxWeapon", "25"));
3719- ENCHANT_MAX_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantMaxArmor", "25"));
3720- ENCHANT_MAX_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantMaxJewelry", "25"));
3721- /*limit of safe enchant normal */
3722- ENCHANT_SAFE_MAX = Integer.parseInt(otherSettings.getProperty("EnchantSafeMax", "3"));
3723- /*limit of safe enchant full */
3724- ENCHANT_SAFE_MAX_FULL = Integer.parseInt(otherSettings.getProperty("EnchantSafeMaxFull", "4"));
3725-
3726- /* if different from 100 (ie 100%) heal rate is modified acordingly */
3727- HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("HpRegenMultiplier", "100")) /100;
3728- MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("MpRegenMultiplier", "100")) /100;
3729- CP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("CpRegenMultiplier", "100")) /100;
3730-
3731- RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidHpRegenMultiplier", "100")) /100;
3732- RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidMpRegenMultiplier", "100")) /100;
3733- RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidPDefenceMultiplier", "100")) /100;
3734- RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidMDefenceMultiplier", "100")) /100;
3735- RAID_MINION_RESPAWN_TIMER = Integer.parseInt(otherSettings.getProperty("RaidMinionRespawnTime", "300000"));
3736- RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMinRespawnMultiplier", "1.0"));
3737- RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMaxRespawnMultiplier", "1.0"));
3738-
3739- STARTING_ADENA = Integer.parseInt(otherSettings.getProperty("StartingAdena", "0"));
3740- STARTING_LEVEL = Byte.parseByte(otherSettings.getProperty("StartingLevel", "1"));
3741- if (STARTING_LEVEL > Experience.MAX_LEVEL - 1)
3742- STARTING_LEVEL = Experience.MAX_LEVEL - 1;
3743- STARTING_SUB_LEVEL = Byte.parseByte(otherSettings.getProperty("StartingSubclassLevel", "40"));
3744-
3745- if (STARTING_SUB_LEVEL > Experience.MAX_LEVEL - 1)
3746- STARTING_SUB_LEVEL = Experience.MAX_LEVEL - 1;
3747-
3748- MAX_RUN_SPEED = Integer.parseInt(otherSettings.getProperty("MaxRunSpeed", "250"));
3749- MAX_PCRIT_RATE = Integer.parseInt(otherSettings.getProperty("MaxPCritRate", "500"));
3750- MAX_MCRIT_RATE = Integer.parseInt(otherSettings.getProperty("MaxMCritRate", "300"));
3751- MAX_PATK_SPEED = Integer.parseInt(otherSettings.getProperty("MaxPAtkSpeed", "1500"));
3752- MAX_MATK_SPEED = Integer.parseInt(otherSettings.getProperty("MaxMAtkSpeed", "1999"));
3753-
3754- UNSTUCK_INTERVAL = Integer.parseInt(otherSettings.getProperty("UnstuckInterval", "300"));
3755-
3756- /* Player protection after teleport or login */
3757- PLAYER_SPAWN_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerSpawnProtection", "0"));
3758-
3759- /* Player protection after recovering from fake death (works against mobs only) */
3760- PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerFakeDeathUpProtection", "0"));
3761-
3762- /* Defines some Party XP related values */
3763- PARTY_XP_CUTOFF_METHOD = otherSettings.getProperty("PartyXpCutoffMethod", "percentage");
3764- PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(otherSettings.getProperty("PartyXpCutoffPercent", "3."));
3765- PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(otherSettings.getProperty("PartyXpCutoffLevel", "30"));
3766-
3767- /* Amount of HP that is restored */
3768- RESPAWN_RESTORE_HP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreHP", "70")) / 100;
3769-
3770- RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("RespawnRandomOffset", "True"));
3771- RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(otherSettings.getProperty("RespawnRandomMaxOffset", "20"));
3772-
3773- /* Maximum number of available slots for pvt stores */
3774- MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsDwarf", "5"));
3775- MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsOther", "4"));
3776-
3777- STORE_SKILL_COOLTIME = Boolean.parseBoolean(otherSettings.getProperty("StoreSkillCooltime", "true"));
3778-
3779- PET_RENT_NPC = otherSettings.getProperty("ListPetRentNpc", "7827");
3780- LIST_PET_RENT_NPC = new FastList<>();
3781- for (String id : PET_RENT_NPC.split(","))
3782- {
3783- LIST_PET_RENT_NPC.add(Integer.parseInt(id));
3784- }
3785- NONDROPPABLE_ITEMS = otherSettings.getProperty("ListOfNonDroppableItems", "1147,425,1146,461,10,2368,7,6,2370,2369,5598");
3786-
3787- LIST_NONDROPPABLE_ITEMS = new FastList<>();
3788- for (String id : NONDROPPABLE_ITEMS.split(","))
3789- {
3790- LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
3791- }
3792-
3793- ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(otherSettings.getProperty("AnnounceMammonSpawn", "True"));
3794-
3795- ALT_PRIVILEGES_ADMIN = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesAdmin", "False"));
3796- ALT_PRIVILEGES_SECURE_CHECK = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesSecureCheck", "True"));
3797- ALT_PRIVILEGES_DEFAULT_LEVEL = Integer.parseInt(otherSettings.getProperty("AltPrivilegesDefaultLevel", "100"));
3798-
3799- GM_NAME_COLOR_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("GMNameColorEnabled", "False"));
3800- GM_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("GMNameColor", "FFFF00"));
3801- ADMIN_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("AdminNameColor", "00FF00"));
3802- GM_HERO_AURA = Boolean.parseBoolean(otherSettings.getProperty("GMHeroAura", "True"));
3803- GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvulnerable", "True"));
3804- GM_STARTUP_INVISIBLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvisible", "True"));
3805- GM_STARTUP_SILENCE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupSilence", "True"));
3806- GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(otherSettings.getProperty("GMStartupAutoList", "True"));
3807-
3808- PETITIONING_ALLOWED = Boolean.parseBoolean(otherSettings.getProperty("PetitioningAllowed", "True"));
3809- MAX_PETITIONS_PER_PLAYER = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPerPlayer", "5"));
3810- MAX_PETITIONS_PENDING = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPending", "25"));
3811-
3812- JAIL_IS_PVP = Boolean.valueOf(otherSettings.getProperty("JailIsPvp", "True"));
3813- JAIL_DISABLE_CHAT = Boolean.valueOf(otherSettings.getProperty("JailDisableChat", "True"));
3814-
3815- // rates
3816- Properties ratesSettings = new Properties();
3817- try (InputStream is = new FileInputStream(new File(RATES_CONFIG_FILE)))
3818- {
3819- ratesSettings.load(is);
3820- }
3821- catch (Exception e)
3822- {
3823- e.printStackTrace();
3824- throw new Error("Failed to Load "+RATES_CONFIG_FILE+" File.");
3825- }
3826-
3827- RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
3828- RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
3829- RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
3830- RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
3831- RATE_QUESTS_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestsReward", "1."));
3832- RATE_DROP_ADENA = Float.parseFloat(ratesSettings.getProperty("RateDropAdena", "1."));
3833- RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
3834- RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
3835- RATE_BOSS_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateBossDropItems", "1."));
3836- RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
3837- RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
3838- RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("RateDropQuest", "1."));
3839- RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
3840- RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
3841-
3842- PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
3843- PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
3844- PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
3845- PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
3846- PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
3847-
3848- PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
3849- PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
3850- SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
3851-
3852- KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
3853- KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
3854- KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
3855- KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
3856- KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
3857-
3858- CAN_SPOIL_LOWER_LEVEL_MOBS = Boolean.parseBoolean(ratesSettings.getProperty("CanSpoilLowerLevelMobs", "false"));
3859- CAN_DELEVEL_AND_SPOIL_MOBS = Boolean.parseBoolean(ratesSettings.getProperty("CanDelevelToSpoil", "true"));
3860- MAXIMUM_PLAYER_AND_MOB_LEVEL_DIFFERENCE = Float.parseFloat(ratesSettings.getProperty("MaximumPlayerAndMobLevelDifference", "9."));
3861- BASE_SPOIL_RATE = Float.parseFloat(ratesSettings.getProperty("BasePercentChanceOfSpoilSuccess", "40."));
3862- MINIMUM_SPOIL_RATE = Float.parseFloat(ratesSettings.getProperty("MinimumPercentChanceOfSpoilSuccess", "3."));
3863- SPOIL_LEVEL_DIFFERENCE_LIMIT = Float.parseFloat(ratesSettings.getProperty("SpoilLevelDifferenceLimit", "5."));
3864- SPOIL_LEVEL_DIFFERENCE_MULTIPLIER = Float.parseFloat(ratesSettings.getProperty("SpoilLevelMultiplier", "7."));
3865- LAST_LEVEL_SPOIL_IS_LEARNED = Integer.parseInt(ratesSettings.getProperty("LastLevelSpoilIsLearned", "72"));
3866-
3867- // alternative settings
3868- Properties altSettings = new Properties();
3869- try (InputStream is = new FileInputStream(new File(ALT_SETTINGS_FILE)))
3870- {
3871- altSettings.load(is);
3872- }
3873- catch (Exception e)
3874- {
3875- e.printStackTrace();
3876- throw new Error("Failed to Load "+ALT_SETTINGS_FILE+" File.");
3877- }
3878-
3879- ALT_GAME_TIREDNESS = Boolean.parseBoolean(altSettings.getProperty("AltGameTiredness", "false"));
3880- ALT_GAME_CREATION = Boolean.parseBoolean(altSettings.getProperty("AltGameCreation", "false"));
3881- ALT_GAME_CREATION_SPEED = Double.parseDouble(altSettings.getProperty("AltGameCreationSpeed", "1"));
3882- ALT_GAME_CREATION_XP_RATE = Double.parseDouble(altSettings.getProperty("AltGameCreationRateXp", "1"));
3883- ALT_GAME_CREATION_SP_RATE = Double.parseDouble(altSettings.getProperty("AltGameCreationRateSp", "1"));
3884- ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(altSettings.getProperty("AltGameSkillLearn", "false"));
3885- AUTO_LEARN_SKILLS = Boolean.parseBoolean(altSettings.getProperty("AutoLearnSkills", "false"));
3886- AUTO_LEARN_3RD_SKILLS = Boolean.parseBoolean(altSettings.getProperty("AutoLearn3rdClassSkills", "false"));
3887- ALT_GAME_CANCEL_BOW = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
3888- ALT_GAME_CANCEL_CAST = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
3889- ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(altSettings.getProperty("AltPerfectShieldBlockRate", "5"));
3890- ALT_GAME_DELEVEL = Boolean.parseBoolean(altSettings.getProperty("Delevel", "true"));
3891- ALT_WEIGHT_LIMIT = Double.parseDouble(altSettings.getProperty("AltWeightLimit", "1"));
3892- ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(altSettings.getProperty("MagicFailures", "false"));
3893- ALT_MOB_AGGRO_IN_PEACEZONE = Boolean.parseBoolean(altSettings.getProperty("AltMobAggroInPeaceZone", "true"));
3894- ALT_GAME_EXPONENT_XP = Float.parseFloat(altSettings.getProperty("AltGameExponentXp", "0."));
3895- ALT_GAME_EXPONENT_SP = Float.parseFloat(altSettings.getProperty("AltGameExponentSp", "0."));
3896- ALT_GAME_FREIGHTS = Boolean.parseBoolean(altSettings.getProperty("AltGameFreights", "false"));
3897- ALT_GAME_FREIGHT_PRICE = Integer.parseInt(altSettings.getProperty("AltGameFreightPrice", "1000"));
3898- ALT_PARTY_RANGE = Integer.parseInt(altSettings.getProperty("AltPartyRange", "1600"));
3899- ALT_PARTY_RANGE2 = Integer.parseInt(altSettings.getProperty("AltPartyRange2", "1400"));
3900- IS_CRAFTING_ENABLED = Boolean.parseBoolean(altSettings.getProperty("CraftingEnabled", "true"));
3901- SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("SpBookNeeded", "true"));
3902- ES_SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("EnchantSkillSpBookNeeded","true"));
3903- AUTO_LOOT = Boolean.parseBoolean(altSettings.getProperty("AutoLoot","false"));
3904- AUTO_LOOT_RAIDS = Boolean.parseBoolean(altSettings.getProperty("AutoLootRaids","false"));
3905- ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
3906- ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanShop", "true"));
3907- ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseGK", "false"));
3908- ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTeleport", "true"));
3909- ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTrade", "true"));
3910- ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
3911- ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(altSettings.getProperty("AltFreeTeleporting", "False"));
3912- ALT_RECOMMEND = Boolean.parseBoolean(altSettings.getProperty("AltRecommend", "False"));
3913- ALT_MAX_SUBCLASS = Integer.parseInt(altSettings.getProperty("AltMaxSubClasses", "3"));
3914- ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltSubClassWithoutQuests", "False"));
3915- ALT_ENABLE_TUTORIAL = Boolean.parseBoolean(altSettings.getProperty("AltEnableTutorial", "True"));
3916- ALT_GAME_VIEWNPC = Boolean.parseBoolean(altSettings.getProperty("AltGameViewNpc", "False"));
3917- ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.parseBoolean(altSettings.getProperty("AltNewCharAlwaysIsNewbie", "False"));
3918- DWARF_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("DwarfRecipeLimit","50"));
3919- COMMON_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("CommonRecipeLimit","50"));
3920-
3921- ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(altSettings.getProperty("AltClanMembersForWar", "15"));
3922- ALT_CLAN_JOIN_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAClan", "5"));
3923- ALT_CLAN_CREATE_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateAClan", "10"));
3924-
3925- ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(altSettings.getProperty("DaysToPassToDissolveAClan", "7"));
3926- ALT_RECOVERY_PENALTY = Integer.parseInt(altSettings.getProperty("DaysToPassToDissolveAgain", "7"));
3927-
3928-
3929- ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
3930- ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
3931- ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
3932- ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "10"));
3933- ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(altSettings.getProperty("AltMaxNumOfClansInAlly", "12"));
3934-
3935- ALT_CHANNEL_ACTIVATION_COUNT = Integer.parseInt(altSettings.getProperty("AltChannelActivationCount", "5"));
3936- // Just in case admins set it to less than 2 parties
3937- if (ALT_CHANNEL_ACTIVATION_COUNT < 2)
3938- ALT_CHANNEL_ACTIVATION_COUNT = 2;
3939-
3940- ALT_OLY_START_TIME = Integer.parseInt(altSettings.getProperty("AltOlyStartTime", "20"));
3941- ALT_OLY_MIN = Integer.parseInt(altSettings.getProperty("AltOlyMin","00"));
3942- ALT_OLY_CPERIOD = Long.parseLong(altSettings.getProperty("AltOlyCPeriod","14400000"));
3943- ALT_OLY_BATTLE = Long.parseLong(altSettings.getProperty("AltOlyBattle","180000"));
3944- ALT_OLY_BWAIT = Long.parseLong(altSettings.getProperty("AltOlyBWait","600000"));
3945- ALT_OLY_IWAIT = Long.parseLong(altSettings.getProperty("AltOlyIWait","300000"));
3946- ALT_OLY_WPERIOD = Long.parseLong(altSettings.getProperty("AltOlyWPeriod","604800000"));
3947- ALT_OLY_VPERIOD = Long.parseLong(altSettings.getProperty("AltOlyVPeriod","86400000"));
3948-
3949- ALT_OLY_CLASSED = Integer.parseInt(altSettings.getProperty("AltOlyClassedParticipants","5"));
3950-
3951- ALT_OLY_NONCLASSED = Integer.parseInt(altSettings.getProperty("AltOlyNonClassedParticipants","9"));
3952- ALT_OLY_BATTLE_REWARD_ITEM = Integer.parseInt(altSettings.getProperty("AltOlyBattleRewItem","6651"));
3953- ALT_OLY_CLASSED_RITEM_C = Integer.parseInt(altSettings.getProperty("AltOlyClassedRewItemCount","50"));
3954- ALT_OLY_NONCLASSED_RITEM_C = Integer.parseInt(altSettings.getProperty("AltOlyNonClassedRewItemCount","30"));
3955- ALT_OLY_COMP_RITEM = Integer.parseInt(altSettings.getProperty("AltOlyCompRewItem","6651"));
3956- ALT_OLY_GP_PER_POINT = Integer.parseInt(altSettings.getProperty("AltOlyGPPerPoint","1000"));
3957- ALT_OLY_MIN_POINT_FOR_EXCH = Integer.parseInt(altSettings.getProperty("AltOlyMinPointForExchange","50"));
3958- ALT_OLY_HERO_POINTS = Integer.parseInt(altSettings.getProperty("AltOlyHeroPoints","300"));
3959-
3960-
3961- ALT_MANOR_REFRESH_TIME = Integer.parseInt(altSettings.getProperty("AltManorRefreshTime","20"));
3962- ALT_MANOR_REFRESH_MIN = Integer.parseInt(altSettings.getProperty("AltManorRefreshMin","00"));
3963- ALT_MANOR_APPROVE_TIME = Integer.parseInt(altSettings.getProperty("AltManorApproveTime","6"));
3964- ALT_MANOR_APPROVE_MIN = Integer.parseInt(altSettings.getProperty("AltManorApproveMin","00"));
3965- ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(altSettings.getProperty("AltManorMaintenancePeriod","360000"));
3966- ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(altSettings.getProperty("AltManorSaveAllActions","True"));
3967- ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(altSettings.getProperty("AltManorSavePeriodRate","2"));
3968-
3969- ALT_LOTTERY_PRIZE = Integer.parseInt(altSettings.getProperty("AltLotteryPrize","50000"));
3970- ALT_LOTTERY_TICKET_PRICE = Integer.parseInt(altSettings.getProperty("AltLotteryTicketPrice","2000"));
3971- ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery5NumberRate","0.6"));
3972- ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery4NumberRate","0.2"));
3973- ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery3NumberRate","0.2"));
3974- ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Integer.parseInt(altSettings.getProperty("AltLottery2and1NumberPrize","200"));
3975- BUFFS_MAX_AMOUNT = Byte.parseByte(altSettings.getProperty("maxbuffamount","20"));
3976- ALT_DEV_NO_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoQuests", "False"));
3977- ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoSpawns", "False"));
3978-
3979- // Four Sepulcher Config
3980- FS_PENDING_TIME = Integer.parseInt(altSettings.getProperty("PendingTime", "50"));
3981- FS_ENTRY_TIME = Integer.parseInt(altSettings.getProperty("EntryTime", "5"));
3982- FS_PARTY_MEMBER_COUNT = Integer.parseInt(altSettings.getProperty("NumberOfNecessaryPartyMembers", "4"));
3983-
3984- if (FS_PENDING_TIME <= 0)
3985- FS_PENDING_TIME = 50;
3986- if (FS_ENTRY_TIME <= 0)
3987- FS_ENTRY_TIME = 5;
3988- if (FS_PARTY_MEMBER_COUNT <= 0)
3989- FS_PARTY_MEMBER_COUNT = 4;
3990-
3991- // Dimensional Rift Config
3992- RIFT_MIN_PARTY_SIZE = Integer.parseInt(altSettings.getProperty("RiftMinPartySize", "2"));
3993- RIFT_MAX_JUMPS = Integer.parseInt(altSettings.getProperty("MaxRiftJumps", "4"));
3994- RIFT_SPAWN_DELAY = Integer.parseInt(altSettings.getProperty("RiftSpawnDelay", "10000"));
3995- RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMin", "480"));
3996- RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMax", "600"));
3997- RIFT_ENTER_COST_RECRUIT = Integer.parseInt(altSettings.getProperty("RecruitCost", "18"));
3998- RIFT_ENTER_COST_SOLDIER = Integer.parseInt(altSettings.getProperty("SoldierCost", "21"));
3999- RIFT_ENTER_COST_OFFICER = Integer.parseInt(altSettings.getProperty("OfficerCost", "24"));
4000- RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(altSettings.getProperty("CaptainCost", "27"));
4001- RIFT_ENTER_COST_COMMANDER = Integer.parseInt(altSettings.getProperty("CommanderCost", "30"));
4002- RIFT_ENTER_COST_HERO = Integer.parseInt(altSettings.getProperty("HeroCost", "33"));
4003- RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(altSettings.getProperty("BossRoomTimeMultiply", "1.5"));
4004-
4005- // custom settings
4006- Properties customSettings = new Properties();
4007- try (InputStream is = new FileInputStream(new File(CUSTOM_CONFIG_FILE)))
4008- {
4009- customSettings.load(is);
4010- }
4011- catch (Exception e)
4012- {
4013- e.printStackTrace();
4014- throw new Error("Failed to Load "+CUSTOM_CONFIG_FILE+" File.");
4015- }
4016-
4017- BLOCK_UNWANTED_BUFFS = Boolean.valueOf(customSettings.getProperty("BlockUnwantedBuffs", "false"));
4018-
4019- CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(customSettings.getProperty("CustomSpawnlistTable", "false"));
4020- SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(customSettings.getProperty("SaveGmSpawnOnCustom", "false"));
4021- CUSTOM_NPC_TABLE = Boolean.valueOf(customSettings.getProperty("CustomNpcTable", "false"));
4022- CUSTOM_NPC_SKILLS_TABLE = Boolean.valueOf(customSettings.getProperty("CustomNpcSkillsTable", "false"));
4023- CUSTOM_ITEM_TABLES = Boolean.valueOf(customSettings.getProperty("CustomItemTables", "false"));
4024- CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(customSettings.getProperty("CustomArmorSetsTable", "false"));
4025- CUSTOM_TELEPORT_TABLE = Boolean.valueOf(customSettings.getProperty("CustomTeleportTable", "false"));
4026- CUSTOM_DROPLIST_TABLE = Boolean.valueOf(customSettings.getProperty("CustomDroplistTable", "false"));
4027- CUSTOM_MERCHANT_TABLES = Boolean.valueOf(customSettings.getProperty("CustomMerchantTables", "false"));
4028-
4029- CHAMPION_ENABLE = Boolean.valueOf(customSettings.getProperty("ChampionEnable", "false"));
4030- CHAMPION_PASSIVE = Boolean.valueOf(customSettings.getProperty("ChampionPassive", "false"));
4031- CHAMPION_FREQUENCY = Integer.parseInt(customSettings.getProperty("ChampionFrequency", "0"));
4032- CHAMPION_TITLE = customSettings.getProperty("ChampionTitle", "Champion");
4033- CHAMP_MIN_LVL = Integer.parseInt(customSettings.getProperty("ChampionMinLevel", "20"));
4034- CHAMP_MAX_LVL = Integer.parseInt(customSettings.getProperty("ChampionMaxLevel", "70"));
4035- CHAMPION_HP = Integer.parseInt(customSettings.getProperty("ChampionHp", "8"));
4036- CHAMPION_HP_REGEN = Float.parseFloat(customSettings.getProperty("ChampionHpRegen", "1."));
4037- CHAMPION_REWARDS = Integer.parseInt(customSettings.getProperty("ChampionRewards", "8"));
4038- CHAMPION_ADENAS_REWARDS = Integer.parseInt(customSettings.getProperty("ChampionAdenasRewards", "1"));
4039- CHAMPION_ATK = Float.parseFloat(customSettings.getProperty("ChampionAtk", "1."));
4040- CHAMPION_SPD_ATK = Float.parseFloat(customSettings.getProperty("ChampionSpdAtk", "1."));
4041- CHAMPION_REWARD_LOWER_CHANCE = Integer.parseInt(customSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
4042- CHAMPION_REWARD_HIGHER_CHANCE = Integer.parseInt(customSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
4043- CHAMPION_REWARD_ID = Integer.parseInt(customSettings.getProperty("ChampionRewardItemID", "6393"));
4044- CHAMPION_REWARD_QTY = Integer.parseInt(customSettings.getProperty("ChampionRewardItemQty", "1"));
4045-
4046- ALLOW_AUTO_REWARDER = Boolean.valueOf(customSettings.getProperty("AllowAutoRewarder", "False"));
4047- AUTO_REWARD_DELAY = Integer.parseInt(customSettings.getProperty("AutoRewardDelay", "1200"));
4048- AUTO_REWARD_ID = Integer.parseInt(customSettings.getProperty("AutoRewardID", "57"));
4049- AUTO_REWARD_COUNT = Integer.parseInt(customSettings.getProperty("AutoRewardCount", "1000"));
4050-
4051- CUSTOM_STARTING_SPAWN = Boolean.parseBoolean(customSettings.getProperty("CustomStartingSpawn", "False"));
4052- CUSTOM_SPAWN_X = Integer.parseInt(customSettings.getProperty("CustomSpawnX", ""));
4053- CUSTOM_SPAWN_Y = Integer.parseInt(customSettings.getProperty("CustomSpawnY", ""));
4054- CUSTOM_SPAWN_Z = Integer.parseInt(customSettings.getProperty("CustomSpawnZ", ""));
4055-
4056- ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(customSettings.getProperty("EnableModifySkillDuration", "False"));
4057-
4058- // Create Map only if enabled
4059- if (ENABLE_MODIFY_SKILL_DURATION)
4060- {
4061- SKILL_DURATION_LIST = new FastMap<>();
4062- String[] propertySplit;
4063- propertySplit = customSettings.getProperty("SkillDurationList", "").split(";");
4064- for (String skill : propertySplit)
4065- {
4066- String[] skillSplit = skill.split(",");
4067- if (skillSplit.length != 2)
4068- System.out.println("[SkillDurationList]: invalid config property -> SkillDurationList \"" + skill + "\"");
4069- else
4070- {
4071- try
4072- {
4073- SKILL_DURATION_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
4074- }
4075- catch (NumberFormatException nfe)
4076- {
4077- if (!skill.isEmpty())
4078- System.out.println("[SkillDurationList]: invalid config property -> SkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
4079- }
4080- }
4081- }
4082- }
4083-
4084- Boost_EXP_COMMAND = Boolean.parseBoolean(customSettings.getProperty("SpExpCommand", "False"));
4085- AUTO_TARGET_NPC = Boolean.parseBoolean(customSettings.getProperty("EnableAutoTargetNPC", "False"));
4086- CHANGE_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(customSettings.getProperty("ChooseAllSubClassesEveryWhere", "False"));
4087- AUTO_NOBLE_STATUS = Boolean.parseBoolean(customSettings.getProperty("AutoNoblesseAtLogin", "False"));
4088- ALLOW_HERO_ENCHANT = Boolean.parseBoolean(customSettings.getProperty("AllowEnchantHeroItems", "False"));
4089- PREVENT_DUAL_BOXING = Boolean.parseBoolean(customSettings.getProperty("PreventDualBoxing", "False"));
4090- ENABLE_REAL_TIME = Boolean.parseBoolean(customSettings.getProperty("EnableRealTime", "False"));
4091- NPC_BUFFER_ENABLED = Boolean.valueOf(customSettings.getProperty("NPCBufferEnabled", "False"));
4092- AIO_BUFF_DURATION = Integer.parseInt(customSettings.getProperty("AIOBuffDuration", "0"));
4093- OFFLINE_TRADE_ENABLE = Boolean.valueOf(customSettings.getProperty("OfflineTradeEnable", "false"));
4094- OFFLINE_CRAFT_ENABLE = Boolean.valueOf(customSettings.getProperty("OfflineCraftEnable", "false"));
4095- RESTORE_OFFLINERS = Boolean.parseBoolean(customSettings.getProperty("RestoreOffliners", "True"));
4096- OFFLINE_MAX_DAYS = Integer.parseInt(customSettings.getProperty("OfflineMaxDays", "10"));
4097- OFFLINE_DISCONNECT_FINISHED = Boolean.parseBoolean(customSettings.getProperty("OfflineDisconnectFinished", "true"));
4098- OFFLINE_SET_NAME_COLOR = Boolean.valueOf(customSettings.getProperty("OfflineSetNameColor", "false"));
4099- OFFLINE_NAME_COLOR = Integer.decode("0x" + customSettings.getProperty("OfflineNameColor", "808080"));
4100- ALLOW_SIEGE_TELEPORT = Boolean.valueOf(customSettings.getProperty("AllowSiegeTeleport", "False"));
4101- KEEP_SUBCLASS_SKILLS = Boolean.valueOf(customSettings.getProperty("KeepSubClassSkills", "False"));
4102- ALLOW_CLASS_MASTERS = Boolean.valueOf(customSettings.getProperty("AllowClassMasters", "False"));
4103- ALLOW_ENTIRE_TREE = Boolean.valueOf(customSettings.getProperty("AllowEntireTree", "False"));
4104- ALTERNATE_CLASS_MASTER = Boolean.valueOf(customSettings.getProperty("AlternateClassMaster", "False"));
4105- if (ALLOW_CLASS_MASTERS || ALTERNATE_CLASS_MASTER)
4106- CLASS_MASTER_SETTINGS = new ClassMasterSettings(String.valueOf(customSettings.getProperty("ConfigClassMaster")));
4107-
4108- // Feature settings
4109- Properties Feature = new Properties();
4110- try (InputStream is = new FileInputStream(new File(FEATURE_CONFIG_FILE)))
4111- {
4112- Feature.load(is);
4113- }
4114- catch (Exception e)
4115- {
4116- e.printStackTrace();
4117- throw new Error("Failed to Load "+FEATURE_CONFIG_FILE+" File.");
4118- }
4119-
4120- CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
4121- CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
4122- CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
4123- CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
4124- CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
4125- CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
4126- CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
4127- CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
4128- CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
4129- CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
4130- CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
4131- CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
4132- CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
4133- CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
4134- CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
4135- CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
4136- CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
4137- CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl4", "3270"));
4138- CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl5", "5166"));
4139- CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
4140- CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
4141- CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
4142- CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
4143- CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));
4144-
4145- CH_TELE_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallTeleportFunctionFeeRation", "86400000"));
4146- CH_TELE1_FEE = Integer.valueOf(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "86400000"));
4147- CH_TELE2_FEE = Integer.valueOf(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "86400000"));
4148- CH_SUPPORT_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallSupportFunctionFeeRation", "86400000"));
4149- CH_SUPPORT1_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl1", "86400000"));
4150- CH_SUPPORT2_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl2", "86400000"));
4151- CH_SUPPORT3_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl3", "86400000"));
4152- CH_SUPPORT4_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl4", "86400000"));
4153- CH_SUPPORT5_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl5", "86400000"));
4154- CH_SUPPORT6_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl6", "86400000"));
4155- CH_SUPPORT7_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl7", "86400000"));
4156- CH_SUPPORT8_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl8", "86400000"));
4157- CH_MPREG_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRation", "86400000"));
4158- CH_MPREG1_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "86400000"));
4159- CH_MPREG2_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "86400000"));
4160- CH_MPREG3_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "86400000"));
4161- CH_MPREG4_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "86400000"));
4162- CH_MPREG5_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "86400000"));
4163- CH_HPREG_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRation", "86400000"));
4164- CH_HPREG1_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "86400000"));
4165- CH_HPREG2_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "86400000"));
4166- CH_HPREG3_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "86400000"));
4167- CH_HPREG4_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "86400000"));
4168- CH_HPREG5_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "86400000"));
4169- CH_HPREG6_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "86400000"));
4170- CH_HPREG7_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "86400000"));
4171- CH_HPREG8_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "86400000"));
4172- CH_HPREG9_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "86400000"));
4173- CH_HPREG10_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "86400000"));
4174- CH_HPREG11_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "86400000"));
4175- CH_HPREG12_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "86400000"));
4176- CH_HPREG13_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "86400000"));
4177- CH_EXPREG_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRation", "86400000"));
4178- CH_EXPREG1_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "86400000"));
4179- CH_EXPREG2_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "86400000"));
4180- CH_EXPREG3_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "86400000"));
4181- CH_EXPREG4_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "86400000"));
4182- CH_EXPREG5_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "86400000"));
4183- CH_EXPREG6_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "86400000"));
4184- CH_EXPREG7_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "86400000"));
4185- CH_ITEM_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallItemCreationFunctionFeeRation", "86400000"));
4186- CH_ITEM1_FEE = Integer.valueOf(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "86400000"));
4187- CH_ITEM2_FEE = Integer.valueOf(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "86400000"));
4188- CH_ITEM3_FEE = Integer.valueOf(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "86400000"));
4189- CH_CURTAIN_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallCurtainFunctionFeeRation", "86400000"));
4190- CH_CURTAIN1_FEE = Integer.valueOf(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "86400000"));
4191- CH_CURTAIN2_FEE = Integer.valueOf(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "86400000"));
4192- CH_FRONT_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRation", "86400000"));
4193- CH_FRONT1_FEE = Integer.valueOf(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "86400000"));
4194- CH_FRONT2_FEE = Integer.valueOf(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "86400000"));
4195-
4196- ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltRequireCastleForDawn", "False"));
4197- ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
4198- ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
4199- ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
4200- ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
4201- ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
4202- ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
4203- ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
4204- ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));
4205- ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
4206- ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
4207- ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
4208-
4209- // pvp config
4210- Properties pvpSettings = new Properties();
4211- try (InputStream is = new FileInputStream(new File(PVP_CONFIG_FILE)))
4212- {
4213- pvpSettings.load(is);
4214- }
4215- catch (Exception e)
4216- {
4217- e.printStackTrace();
4218- throw new Error("Failed to Load "+PVP_CONFIG_FILE+" File.");
4219- }
4220-
4221- /* KARMA SYSTEM */
4222- KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
4223- KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
4224- KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
4225- KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
4226-
4227- KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
4228- KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
4229-
4230- KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
4231-
4232- KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650");
4233- 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");
4234-
4235- KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<>();
4236- for (String id : KARMA_NONDROPPABLE_PET_ITEMS.split(","))
4237- {
4238- KARMA_LIST_NONDROPPABLE_PET_ITEMS.add(Integer.parseInt(id));
4239- }
4240-
4241- KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<>();
4242- for (String id : KARMA_NONDROPPABLE_ITEMS.split(","))
4243- {
4244- KARMA_LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
4245- }
4246-
4247- PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "15000"));
4248- PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "30000"));
4249-
4250- // access levels
4251- Properties gmSettings = new Properties();
4252- try (InputStream is = new FileInputStream(new File(GM_ACCESS_FILE)))
4253- {
4254- gmSettings.load(is);
4255- }
4256- catch (Exception e)
4257- {
4258- e.printStackTrace();
4259- throw new Error("Failed to Load "+GM_ACCESS_FILE+" File.");
4260- }
4261-
4262- GM_ACCESSLEVEL = Integer.parseInt(gmSettings.getProperty("GMAccessLevel", "100"));
4263- GM_MIN = Integer.parseInt(gmSettings.getProperty("GMMinLevel", "100"));
4264- GM_ANNOUNCE = Integer.parseInt(gmSettings.getProperty("GMCanAnnounce", "100"));
4265- GM_BAN = Integer.parseInt(gmSettings.getProperty("GMCanBan", "100"));
4266- GM_BAN_CHAT = Integer.parseInt(gmSettings.getProperty("GMCanBanChat", "100"));
4267- GM_CREATE_ITEM = Integer.parseInt(gmSettings.getProperty("GMCanShop", "100"));
4268- GM_DELETE = Integer.parseInt(gmSettings.getProperty("GMCanDelete", "100"));
4269- GM_KICK = Integer.parseInt(gmSettings.getProperty("GMCanKick", "100"));
4270- GM_MENU = Integer.parseInt(gmSettings.getProperty("GMMenu", "100"));
4271- GM_GODMODE = Integer.parseInt(gmSettings.getProperty("GMGodMode", "100"));
4272- GM_CHAR_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditChar", "100"));
4273- GM_CHAR_EDIT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanEditCharOther", "100"));
4274- GM_CHAR_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewChar", "100"));
4275- GM_NPC_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditNPC", "100"));
4276- GM_NPC_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewNPC", "100"));
4277- GM_TELEPORT = Integer.parseInt(gmSettings.getProperty("GMCanTeleport", "100"));
4278- GM_TELEPORT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanTeleportOther", "100"));
4279- GM_RESTART = Integer.parseInt(gmSettings.getProperty("GMCanRestart", "100"));
4280- GM_MONSTERRACE = Integer.parseInt(gmSettings.getProperty("GMMonsterRace", "100"));
4281- GM_RIDER = Integer.parseInt(gmSettings.getProperty("GMRider", "100"));
4282- GM_ESCAPE = Integer.parseInt(gmSettings.getProperty("GMFastUnstuck", "100"));
4283- GM_FIXED = Integer.parseInt(gmSettings.getProperty("GMResurectFixed", "100"));
4284- GM_CREATE_NODES = Integer.parseInt(gmSettings.getProperty("GMCreateNodes", "100"));
4285- GM_ENCHANT = Integer.parseInt(gmSettings.getProperty("GMEnchant", "100"));
4286- GM_DOOR = Integer.parseInt(gmSettings.getProperty("GMDoor", "100"));
4287- GM_RES = Integer.parseInt(gmSettings.getProperty("GMRes", "100"));
4288- GM_PEACEATTACK = Integer.parseInt(gmSettings.getProperty("GMPeaceAttack", "100"));
4289- GM_HEAL = Integer.parseInt(gmSettings.getProperty("GMHeal", "100"));
4290- GM_UNBLOCK = Integer.parseInt(gmSettings.getProperty("GMUnblock", "100"));
4291- GM_CACHE = Integer.parseInt(gmSettings.getProperty("GMCache", "100"));
4292- GM_TALK_BLOCK = Integer.parseInt(gmSettings.getProperty("GMTalkBlock", "100"));
4293- GM_TEST = Integer.parseInt(gmSettings.getProperty("GMTest", "100"));
4294-
4295- String gmTrans = gmSettings.getProperty("GMDisableTransaction", "False");
4296- if (!gmTrans.equalsIgnoreCase("false"))
4297- {
4298- String[] params = gmTrans.split(",");
4299- GM_DISABLE_TRANSACTION = true;
4300- GM_TRANSACTION_MIN = Integer.parseInt(params[0]);
4301- GM_TRANSACTION_MAX = Integer.parseInt(params[1]);
4302- }
4303- else
4304- {
4305- GM_DISABLE_TRANSACTION = false;
4306- }
4307-
4308- Properties Settings = new Properties();
4309- try (InputStream is = new FileInputStream(HEXID_FILE))
4310- {
4311- Settings.load(is);
4312- }
4313- catch (Exception e)
4314- {
4315- _log.warning("Could not load HexID file ("+HEXID_FILE+"). Hopefully login will give us one.");
4316- }
4317- HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
4318- }
4319- else if (Server.SERVER_MODE == Server.MODE_LOGINSERVER)
4320- {
4321- _log.info("Loading LoginServer Configuration Files.");
4322-
4323- Properties serverSettings = new Properties();
4324- try (InputStream is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE)))
4325- {
4326- serverSettings.load(is);
4327- }
4328- catch (Exception e)
4329- {
4330- e.printStackTrace();
4331- throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");
4332- }
4333-
4334- GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname", "*");
4335- GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort", "9014"));
4336-
4337- LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
4338- PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
4339-
4340- DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
4341- DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
4342- ASSERT = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));
4343-
4344- ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
4345- REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
4346- ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));
4347-
4348- LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
4349-
4350- LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
4351- GM_MIN = Integer.parseInt(serverSettings.getProperty("GMMinLevel", "100"));
4352-
4353- try
4354- {
4355- DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".").replaceAll("\\\\", "/")).getCanonicalFile();
4356- }
4357- catch (Exception e)
4358- {
4359- _log.warning("Error setting datapack root!");
4360- DATAPACK_ROOT = new File(".");
4361- }
4362-
4363- INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
4364- EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
4365-
4366- DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
4367- DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
4368- DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
4369- DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
4370- DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
4371- CONNECTION_CLOSE_TIME = Long.parseLong(serverSettings.getProperty("ConnectionCloseTime", "60000"));
4372-
4373- SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
4374- AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));
4375-
4376- FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
4377- FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
4378- NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
4379- FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
4380- MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
4381-
4382- // telnet
4383- Properties telnetSettings = new Properties();
4384- try (InputStream is = new FileInputStream(new File(TELNET_FILE)))
4385- {
4386- telnetSettings.load(is);
4387- }
4388- catch (Exception e)
4389- {
4390- e.printStackTrace();
4391- throw new Error("Failed to Load "+TELNET_FILE+" File.");
4392- }
4393-
4394- IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "False"));
4395- TELNET_PORT = Integer.parseInt(telnetSettings.getProperty("LoginStatusPort", "12345"));
4396- }
4397- else
4398- {
4399- _log.severe("Could not Load Config: server mode was not set");
4400- }
4401- }
4402-
4403- /**
4404- * Set a new value to a game parameter from the admin console.
4405- * @param pName (String) : name of the parameter to change
4406- * @param pValue (String) : new value of the parameter
4407- * @return boolean : true if modification has been made
4408- * @link useAdminCommand
4409- */
4410- public static boolean setParameterValue(String pName, String pValue)
4411- {
4412- // Server settings
4413- if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
4414- else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
4415- else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
4416- else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
4417- else if (pName.equalsIgnoreCase("RateQuestsReward")) RATE_QUESTS_REWARD = Float.parseFloat(pValue);
4418- else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ADENA = Float.parseFloat(pValue);
4419- else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
4420- else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
4421- else if (pName.equalsIgnoreCase("RateBossDropItems")) RATE_BOSS_DROP_ITEMS = Float.parseFloat(pValue);
4422- else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
4423- else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
4424- else if (pName.equalsIgnoreCase("RateDropQuest")) RATE_DROP_QUEST = Float.parseFloat(pValue);
4425- else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
4426- else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
4427-
4428- else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
4429- else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
4430- else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
4431- else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
4432- else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
4433-
4434- else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
4435- else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
4436- else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
4437- else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
4438- else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
4439-
4440- else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
4441- else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(pValue);
4442- else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(pValue);
4443- else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.valueOf(pValue);
4444- else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(pValue);
4445- else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
4446- else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(pValue);
4447-
4448- else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.valueOf(pValue);
4449- else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.valueOf(pValue);
4450- else if (pName.equalsIgnoreCase("LowWeight")) LOW_WEIGHT = Float.parseFloat(pValue);
4451- else if (pName.equalsIgnoreCase("MediumWeight")) MEDIUM_WEIGHT = Float.parseFloat(pValue);
4452- else if (pName.equalsIgnoreCase("HighWeight")) HIGH_WEIGHT = Float.parseFloat(pValue);
4453- else if (pName.equalsIgnoreCase("AdvancedDiagonalStrategy")) ADVANCED_DIAGONAL_STRATEGY= Boolean.parseBoolean(pValue);
4454- else if (pName.equalsIgnoreCase("DiagonalWeight")) DIAGONAL_WEIGHT = Float.parseFloat(pValue);
4455- else if (pName.equalsIgnoreCase("MaxPostfilterPasses")) MAX_POSTFILTER_PASSES = Integer.parseInt(pValue);
4456- else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
4457- else if (pName.equalsIgnoreCase("EnableFallingDamage")) ENABLE_FALLING_DAMAGE = Boolean.parseBoolean(pValue);
4458- else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
4459-
4460- else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.valueOf(pValue);
4461- else if (pName.equalsIgnoreCase("AllowFreight")) ALLOW_FREIGHT = Boolean.valueOf(pValue);
4462- else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.valueOf(pValue);
4463- else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.valueOf(pValue);
4464- else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
4465- else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
4466- else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.valueOf(pValue);
4467- else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.valueOf(pValue);
4468- else if (pName.equalsIgnoreCase("AllowBoat")) ALLOW_BOAT = Boolean.valueOf(pValue);
4469- else if (pName.equalsIgnoreCase("AllowL2Walker")) ALLOW_L2WALKER = Boolean.valueOf(pValue);
4470- else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.valueOf(pValue);
4471- else if (pName.equalsIgnoreCase("AllowNpcWalkers")) ALLOW_NPC_WALKERS = Boolean.valueOf(pValue);
4472- else if (pName.equalsIgnoreCase("AllowPetWalkers")) ALLOW_PET_WALKERS = Boolean.valueOf(pValue);
4473- else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.valueOf(pValue);
4474-
4475- else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = Integer.parseInt(pValue);
4476- else if (pName.equalsIgnoreCase("BBSShowPlayerList")) BBS_SHOW_PLAYERLIST = Boolean.valueOf(pValue);
4477- else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
4478- else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(pValue);
4479- else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(pValue);
4480- else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
4481- else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
4482-
4483- else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.valueOf(pValue);
4484-
4485- else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.valueOf(pValue);
4486-
4487- else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(pValue);
4488-
4489- else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
4490-
4491- else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);
4492-
4493-
4494- else if (pName.equalsIgnoreCase("MaximumUpdateDistance")) MINIMUM_UPDATE_DISTANCE = Integer.parseInt(pValue);
4495- else if (pName.equalsIgnoreCase("MinimumUpdateTime")) MINIMUN_UPDATE_TIME = Integer.parseInt(pValue);
4496- else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.valueOf(pValue);
4497- else if (pName.equalsIgnoreCase("KnownListForgetDelay")) KNOWNLIST_FORGET_DELAY = Integer.parseInt(pValue);
4498-
4499- // Other settings
4500- else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.valueOf(pValue);
4501- else if (pName.equalsIgnoreCase("GuardAttackAggroMob")) GUARD_ATTACK_AGGRO_MOB = Boolean.valueOf(pValue);
4502- else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.valueOf(pValue);
4503- else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
4504- else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
4505- else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
4506-
4507- else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
4508- else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
4509- else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
4510- else if (pName.equalsIgnoreCase("MaximumFreightSlots")) FREIGHT_SLOTS = Integer.parseInt(pValue);
4511-
4512- else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
4513- else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
4514- else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
4515- else if (pName.equalsIgnoreCase("BlessedEnchantChanceWeapon")) BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
4516- else if (pName.equalsIgnoreCase("BlessedEnchantChanceArmor")) BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
4517- else if (pName.equalsIgnoreCase("BlessedEnchantChanceJewelry")) BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
4518- else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
4519- else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
4520- else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
4521- else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
4522- else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
4523-
4524- else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
4525- else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
4526- else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
4527-
4528- else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
4529- else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
4530- else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier")) RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
4531- else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier")) RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
4532- else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
4533-
4534- else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Integer.parseInt(pValue);
4535- else if (pName.equalsIgnoreCase("StartingLevel")) STARTING_LEVEL = Byte.parseByte(pValue);
4536- else if (pName.equalsIgnoreCase("StartingSubclassLevel")) STARTING_SUB_LEVEL = Byte.parseByte(pValue);
4537- else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
4538-
4539- else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
4540- else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
4541-
4542- else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
4543- else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
4544- else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
4545-
4546- else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
4547-
4548- else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsDwarf")) MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(pValue);
4549- else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsOther")) MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(pValue);
4550-
4551- else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.valueOf(pValue);
4552- else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.valueOf(pValue);
4553-
4554- // Spoil settings
4555- else if (pName.equalsIgnoreCase("CanSpoilLowerLevelMobs")) CAN_SPOIL_LOWER_LEVEL_MOBS = Boolean.valueOf(pValue);
4556- else if (pName.equalsIgnoreCase("CanDelevelToSpoil")) CAN_DELEVEL_AND_SPOIL_MOBS = Boolean.valueOf(pValue);
4557-
4558- else if (pName.equalsIgnoreCase("MaximumPlayerAndMobLevelDifference")) MAXIMUM_PLAYER_AND_MOB_LEVEL_DIFFERENCE = Float.parseFloat(pValue);
4559- else if (pName.equalsIgnoreCase("BasePercentChanceOfSpoilSuccess")) BASE_SPOIL_RATE = Float.parseFloat(pValue);
4560- else if (pName.equalsIgnoreCase("MinimumPercentChanceOfSpoilSuccess")) MINIMUM_SPOIL_RATE = Float.parseFloat(pValue);
4561- else if (pName.equalsIgnoreCase("SpoilLevelDifferenceLimit")) SPOIL_LEVEL_DIFFERENCE_LIMIT = Float.parseFloat(pValue);
4562- else if (pName.equalsIgnoreCase("SpoilLevelMultiplier")) SPOIL_LEVEL_DIFFERENCE_MULTIPLIER = Float.parseFloat(pValue);
4563-
4564- else if (pName.equalsIgnoreCase("LastLevelSpoilIsLearned")) LAST_LEVEL_SPOIL_IS_LEARNED = Integer.parseInt(pValue);
4565-
4566- // Alternative settings
4567- else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.valueOf(pValue);
4568- else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.valueOf(pValue);
4569- else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
4570- else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
4571- else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
4572- else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.valueOf(pValue);
4573- else if (pName.equalsIgnoreCase("AutoLearnSkills")) AUTO_LEARN_SKILLS = Boolean.valueOf(pValue);
4574- else if (pName.equalsIgnoreCase("AutoLearn3rdClassSkills")) AUTO_LEARN_3RD_SKILLS = Boolean.valueOf(pValue);
4575-
4576- else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
4577- {
4578- ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
4579- ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
4580- }
4581-
4582-
4583- else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
4584- else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.valueOf(pValue);
4585- else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.valueOf(pValue);
4586-
4587- else if (pName.equalsIgnoreCase("AltMobAggroInPeaceZone")) ALT_MOB_AGGRO_IN_PEACEZONE = Boolean.valueOf(pValue);
4588-
4589- else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
4590- else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
4591-
4592- else if (pName.equalsIgnoreCase("AllowSiegeTeleport")) ALLOW_SIEGE_TELEPORT = Boolean.valueOf(pValue);
4593-
4594- else if (pName.equalsIgnoreCase("AllowClassMasters")) ALLOW_CLASS_MASTERS = Boolean.valueOf(pValue);
4595- else if (pName.equalsIgnoreCase("AllowEntireTree")) ALLOW_ENTIRE_TREE = Boolean.valueOf(pValue);
4596- else if (pName.equalsIgnoreCase("AlternateClassMaster")) ALTERNATE_CLASS_MASTER = Boolean.valueOf(pValue);
4597- else if (pName.equalsIgnoreCase("AltGameFreights")) ALT_GAME_FREIGHTS = Boolean.valueOf(pValue);
4598- else if (pName.equalsIgnoreCase("AltGameFreightPrice")) ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue);
4599- else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
4600- else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
4601- else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.valueOf(pValue);
4602- else if (pName.equalsIgnoreCase("EnchantSkillSpBookNeeded")) ES_SP_BOOK_NEEDED = Boolean.valueOf(pValue);
4603- else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.valueOf(pValue);
4604- else if (pName.equalsIgnoreCase("AutoLootRaids")) AUTO_LOOT_RAIDS = Boolean.valueOf(pValue);
4605-
4606- else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(pValue);
4607- else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(pValue);
4608- else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(pValue);
4609- else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(pValue);
4610- else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(pValue);
4611- else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(pValue);
4612- else if (pName.equalsIgnoreCase("AltRequireCastleForDawn")) ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.valueOf(pValue);
4613- else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.valueOf(pValue);
4614- else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.valueOf(pValue);
4615- else if (pName.equalsIgnoreCase("AltMaxSubClasses")) ALT_MAX_SUBCLASS = Integer.parseInt(pValue);
4616- else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.valueOf(pValue);
4617- else if (pName.equalsIgnoreCase("AltEnableTutorial")) ALT_ENABLE_TUTORIAL = Boolean.valueOf(pValue);
4618- else if (pName.equalsIgnoreCase("AltNewCharAlwaysIsNewbie")) ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.valueOf(pValue);
4619- else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
4620- else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
4621-
4622- else if (pName.equalsIgnoreCase("ChampionEnable")) CHAMPION_ENABLE = Boolean.valueOf(pValue);
4623- else if (pName.equalsIgnoreCase("ChampionPassive")) CHAMPION_PASSIVE = Boolean.valueOf(pValue);
4624- else if (pName.equalsIgnoreCase("ChampionFrequency")) CHAMPION_FREQUENCY = Integer.parseInt(pValue);
4625- else if (pName.equalsIgnoreCase("ChampionTitle")) CHAMPION_TITLE = pValue;
4626- else if (pName.equalsIgnoreCase("ChampionMinLevel")) CHAMP_MIN_LVL = Integer.parseInt(pValue);
4627- else if (pName.equalsIgnoreCase("ChampionMaxLevel")) CHAMP_MAX_LVL = Integer.parseInt(pValue);
4628- else if (pName.equalsIgnoreCase("ChampionHp")) CHAMPION_HP = Integer.parseInt(pValue);
4629- else if (pName.equalsIgnoreCase("ChampionHpRegen")) CHAMPION_HP_REGEN = Float.parseFloat(pValue);
4630- else if (pName.equalsIgnoreCase("ChampionRewards")) CHAMPION_REWARDS = Integer.parseInt(pValue);
4631- else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) CHAMPION_ADENAS_REWARDS = Integer.parseInt(pValue);
4632- else if (pName.equalsIgnoreCase("ChampionAtk")) CHAMPION_ATK = Float.parseFloat(pValue);
4633- else if (pName.equalsIgnoreCase("ChampionSpdAtk")) CHAMPION_SPD_ATK = Float.parseFloat(pValue);
4634- else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance")) CHAMPION_REWARD_LOWER_CHANCE = Integer.parseInt(pValue);
4635- else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance")) CHAMPION_REWARD_HIGHER_CHANCE = Integer.parseInt(pValue);
4636- else if (pName.equalsIgnoreCase("ChampionRewardItemID")) CHAMPION_REWARD_ID = Integer.parseInt(pValue);
4637- else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
4638-
4639- // PvP settings
4640- else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
4641- else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
4642- else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
4643- else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);
4644-
4645- else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.valueOf(pValue);
4646- else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.valueOf(pValue);
4647- else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);
4648-
4649- else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
4650- else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
4651- else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
4652- else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
4653- else return false;
4654- return true;
4655- }
4656-
4657- /**
4658- * Save hexadecimal ID of the server in the properties file.
4659- * @param string (String) : hexadecimal ID of the server to store
4660- * @see HEXID_FILE
4661- * @see saveHexid(String string, String fileName)
4662- * @link LoginServerThread
4663- */
4664- public static void saveHexid(String string)
4665- {
4666- saveHexid(string,HEXID_FILE);
4667- }
4668-
4669- /**
4670- * Save hexadecimal ID of the server in the properties file.
4671- * @param string (String) : hexadecimal ID of the server to store
4672- * @param fileName (String) : name of the properties file
4673- */
4674- public static void saveHexid(String string, String fileName)
4675- {
4676- try
4677- {
4678- Properties hexSetting = new Properties();
4679- File file = new File(fileName);
4680- // Create a new empty file only if it doesn't exist
4681- file.createNewFile();
4682-
4683- try (OutputStream out = new FileOutputStream(file))
4684- {
4685- hexSetting.setProperty("HexID",string);
4686- hexSetting.store(out,"the hexID to auth into login");
4687- }
4688- }
4689- catch (Exception e)
4690- {
4691- _log.warning("Failed to save hex id to "+fileName+" File.");
4692- e.printStackTrace();
4693- }
4694- }
4695-
4696- /**
4697- * Loads flood protector configurations.
4698- */
4699- private static void loadFloodProtectorConfigs(final Properties properties)
4700- {
4701- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4");
4702- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
4703- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42");
4704- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16");
4705- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100");
4706- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", "5");
4707- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20");
4708- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10");
4709- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
4710- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1");
4711- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", "10");
4712- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANUFACTURE, "Manufacture", "3");
4713- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANOR, "Manor", "30");
4714- loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_CHARACTER_SELECT, "CharacterSelect", "30");
4715- }
4716-
4717- /**
4718- * Loads single flood protector configuration.
4719- *
4720- * @param properties
4721- * Properties file reader
4722- * @param config
4723- * flood protector configuration instance
4724- * @param configString
4725- * flood protector configuration string that determines for which flood protector
4726- * configuration should be read
4727- * @param defaultInterval
4728- * default flood protector interval
4729- */
4730- private static void loadFloodProtectorConfig(final Properties properties, final FloodProtectorConfig config, final String configString, final String defaultInterval)
4731- {
4732- config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval));
4733- config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False"));
4734- config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0"));
4735- config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
4736- config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0"));
4737- }
4738-
4739- public static class ClassMasterSettings
4740- {
4741- private final TIntObjectHashMap<TIntIntHashMap> _claimItems;
4742- private final TIntObjectHashMap<TIntIntHashMap> _rewardItems;
4743- private final TIntObjectHashMap<Boolean> _allowedClassChange;
4744-
4745- public ClassMasterSettings(String _configLine)
4746- {
4747- _claimItems = new TIntObjectHashMap<>(3);
4748- _rewardItems = new TIntObjectHashMap<>(3);
4749- _allowedClassChange = new TIntObjectHashMap<>(3);
4750- if (_configLine != null)
4751- parseConfigLine(_configLine.trim());
4752- }
4753-
4754- private void parseConfigLine(String _configLine)
4755- {
4756- StringTokenizer st = new StringTokenizer(_configLine, ";");
4757-
4758- while (st.hasMoreTokens())
4759- {
4760- // get allowed class change
4761- int job = Integer.parseInt(st.nextToken());
4762-
4763- _allowedClassChange.put(job, true);
4764-
4765- TIntIntHashMap _items = new TIntIntHashMap();
4766- // parse items needed for class change
4767- if (st.hasMoreTokens())
4768- {
4769- StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
4770-
4771- while (st2.hasMoreTokens())
4772- {
4773- StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
4774- int _itemId = Integer.parseInt(st3.nextToken());
4775- int _quantity = Integer.parseInt(st3.nextToken());
4776- _items.put(_itemId, _quantity);
4777- }
4778- }
4779-
4780- _claimItems.put(job, _items);
4781-
4782- _items = new TIntIntHashMap();
4783- // parse gifts after class change
4784- if (st.hasMoreTokens())
4785- {
4786- StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
4787-
4788- while (st2.hasMoreTokens())
4789- {
4790- StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
4791- int _itemId = Integer.parseInt(st3.nextToken());
4792- int _quantity = Integer.parseInt(st3.nextToken());
4793- _items.put(_itemId, _quantity);
4794- }
4795- }
4796-
4797- _rewardItems.put(job, _items);
4798- }
4799- }
4800-
4801- public boolean isAllowed(int job)
4802- {
4803- if (_allowedClassChange == null)
4804- return false;
4805-
4806- if (_allowedClassChange.containsKey(job))
4807- return _allowedClassChange.get(job);
4808-
4809- return false;
4810- }
4811-
4812- public TIntIntHashMap getRewardItems(int job)
4813- {
4814- if (_rewardItems.containsKey(job))
4815- return _rewardItems.get(job);
4816-
4817- return null;
4818- }
4819-
4820- public TIntIntHashMap getRequireItems(int job)
4821- {
4822- if (_claimItems.containsKey(job))
4823- return _claimItems.get(job);
4824-
4825- return null;
4826- }
4827- }
4828+ /** Default punishment for illegal actions */
4829+ public static int DEFAULT_PUNISH;
4830+ /** Parameter for default punishment */
4831+ public static int DEFAULT_PUNISH_PARAM;
4832+
4833+ /** Accept new game server ? */
4834+ public static boolean ACCEPT_NEW_GAMESERVER;
4835+ /** Hexadecimal ID of the game server */
4836+ public static byte[] HEX_ID;
4837+ /** Accept alternate ID for server ? */
4838+ public static boolean ACCEPT_ALTERNATE_ID;
4839+ /** ID for request to the server */
4840+ public static int REQUEST_ID;
4841+ public static boolean RESERVE_HOST_ON_LOGIN = false;
4842+
4843+ public static int MINIMUM_UPDATE_DISTANCE;
4844+ public static int KNOWNLIST_FORGET_DELAY;
4845+ public static int MINIMUN_UPDATE_TIME;
4846+
4847+ public static boolean ANNOUNCE_MAMMON_SPAWN;
4848+ public static boolean LAZY_CACHE;
4849+
4850+ /** Enable colored name for GM ? */
4851+ public static boolean GM_NAME_COLOR_ENABLED;
4852+ /** Color of GM name */
4853+ public static int GM_NAME_COLOR;
4854+ /** Color of admin name */
4855+ public static int ADMIN_NAME_COLOR;
4856+ /** Place an aura around the GM ? */
4857+ public static boolean GM_HERO_AURA;
4858+ /** Set the GM invulnerable at startup ? */
4859+ public static boolean GM_STARTUP_INVULNERABLE;
4860+ /** Set the GM invisible at startup ? */
4861+ public static boolean GM_STARTUP_INVISIBLE;
4862+ /** Set silence to GM at startup ? */
4863+ public static boolean GM_STARTUP_SILENCE;
4864+ /** Add GM in the GM list at startup ? */
4865+ public static boolean GM_STARTUP_AUTO_LIST;
4866+
4867+ /** Allow petition ? */
4868+ public static boolean PETITIONING_ALLOWED;
4869+ /** Maximum number of petitions per player */
4870+ public static int MAX_PETITIONS_PER_PLAYER;
4871+ /** Maximum number of petitions pending */
4872+ public static int MAX_PETITIONS_PENDING;
4873+
4874+ /** Bypass exploit protection ? */
4875+ public static boolean BYPASS_VALIDATION;
4876+
4877+ /** Only GM buy items for free **/
4878+ public static boolean ONLY_GM_ITEMS_FREE;
4879+
4880+ /** GM Audit ? */
4881+ public static boolean GMAUDIT;
4882+
4883+ /** Allow auto-create account ? */
4884+ public static boolean AUTO_CREATE_ACCOUNTS;
4885+
4886+ public static boolean FLOOD_PROTECTION;
4887+ public static int FAST_CONNECTION_LIMIT;
4888+ public static int NORMAL_CONNECTION_TIME;
4889+ public static int FAST_CONNECTION_TIME;
4890+ public static int MAX_CONNECTION_PER_IP;
4891+
4892+ /** Enforce gameguard query on character login ? */
4893+ public static boolean GAMEGUARD_ENFORCE;
4894+ /** Don't allow player to perform trade,talk with npc and move until gameguard reply received ? */
4895+ public static boolean GAMEGUARD_PROHIBITACTION;
4896+
4897+ /** Recipebook limits */
4898+ public static int DWARF_RECIPE_LIMIT;
4899+ public static int COMMON_RECIPE_LIMIT;
4900+
4901+ /** Grid Options */
4902+ public static boolean GRIDS_ALWAYS_ON;
4903+ public static int GRID_NEIGHBOR_TURNON_TIME;
4904+ public static int GRID_NEIGHBOR_TURNOFF_TIME;
4905+
4906+ /** Clan Hall function related configs */
4907+ public static long CH_TELE_FEE_RATIO;
4908+ public static int CH_TELE1_FEE;
4909+ public static int CH_TELE2_FEE;
4910+ public static long CH_ITEM_FEE_RATIO;
4911+ public static int CH_ITEM1_FEE;
4912+ public static int CH_ITEM2_FEE;
4913+ public static int CH_ITEM3_FEE;
4914+ public static long CH_MPREG_FEE_RATIO;
4915+ public static int CH_MPREG1_FEE;
4916+ public static int CH_MPREG2_FEE;
4917+ public static int CH_MPREG3_FEE;
4918+ public static int CH_MPREG4_FEE;
4919+ public static int CH_MPREG5_FEE;
4920+ public static long CH_HPREG_FEE_RATIO;
4921+ public static int CH_HPREG1_FEE;
4922+ public static int CH_HPREG2_FEE;
4923+ public static int CH_HPREG3_FEE;
4924+ public static int CH_HPREG4_FEE;
4925+ public static int CH_HPREG5_FEE;
4926+ public static int CH_HPREG6_FEE;
4927+ public static int CH_HPREG7_FEE;
4928+ public static int CH_HPREG8_FEE;
4929+ public static int CH_HPREG9_FEE;
4930+ public static int CH_HPREG10_FEE;
4931+ public static int CH_HPREG11_FEE;
4932+ public static int CH_HPREG12_FEE;
4933+ public static int CH_HPREG13_FEE;
4934+ public static long CH_EXPREG_FEE_RATIO;
4935+ public static int CH_EXPREG1_FEE;
4936+ public static int CH_EXPREG2_FEE;
4937+ public static int CH_EXPREG3_FEE;
4938+ public static int CH_EXPREG4_FEE;
4939+ public static int CH_EXPREG5_FEE;
4940+ public static int CH_EXPREG6_FEE;
4941+ public static int CH_EXPREG7_FEE;
4942+ public static long CH_SUPPORT_FEE_RATIO;
4943+ public static int CH_SUPPORT1_FEE;
4944+ public static int CH_SUPPORT2_FEE;
4945+ public static int CH_SUPPORT3_FEE;
4946+ public static int CH_SUPPORT4_FEE;
4947+ public static int CH_SUPPORT5_FEE;
4948+ public static int CH_SUPPORT6_FEE;
4949+ public static int CH_SUPPORT7_FEE;
4950+ public static int CH_SUPPORT8_FEE;
4951+ public static long CH_CURTAIN_FEE_RATIO;
4952+ public static int CH_CURTAIN1_FEE;
4953+ public static int CH_CURTAIN2_FEE;
4954+ public static long CH_FRONT_FEE_RATIO;
4955+ public static int CH_FRONT1_FEE;
4956+ public static int CH_FRONT2_FEE;
4957+
4958+ /** Castle function related configs */
4959+ public static long CS_TELE_FEE_RATIO;
4960+ public static int CS_TELE1_FEE;
4961+ public static int CS_TELE2_FEE;
4962+ public static long CS_MPREG_FEE_RATIO;
4963+ public static int CS_MPREG1_FEE;
4964+ public static int CS_MPREG2_FEE;
4965+ public static int CS_MPREG3_FEE;
4966+ public static int CS_MPREG4_FEE;
4967+ public static long CS_HPREG_FEE_RATIO;
4968+ public static int CS_HPREG1_FEE;
4969+ public static int CS_HPREG2_FEE;
4970+ public static int CS_HPREG3_FEE;
4971+ public static int CS_HPREG4_FEE;
4972+ public static int CS_HPREG5_FEE;
4973+ public static long CS_EXPREG_FEE_RATIO;
4974+ public static int CS_EXPREG1_FEE;
4975+ public static int CS_EXPREG2_FEE;
4976+ public static int CS_EXPREG3_FEE;
4977+ public static int CS_EXPREG4_FEE;
4978+ public static long CS_SUPPORT_FEE_RATIO;
4979+ public static int CS_SUPPORT1_FEE;
4980+ public static int CS_SUPPORT2_FEE;
4981+ public static int CS_SUPPORT3_FEE;
4982+ public static int CS_SUPPORT4_FEE;
4983+
4984+ /** GeoData 0/1/2 */
4985+ public static int GEODATA;
4986+ public static String GEODATA_DRIVER;
4987+
4988+ /** Cell PathFinding */
4989+ public static boolean GEODATA_CELLFINDING;
4990+ public static File PATHNODE_DIR;
4991+ public static String PATHFIND_BUFFERS;
4992+ public static float LOW_WEIGHT;
4993+ public static float MEDIUM_WEIGHT;
4994+ public static float HIGH_WEIGHT;
4995+ public static boolean ADVANCED_DIAGONAL_STRATEGY;
4996+ public static float DIAGONAL_WEIGHT;
4997+ public static int MAX_POSTFILTER_PASSES;
4998+ public static boolean DEBUG_PATH;
4999+
5000+ /** Force loading GeoData to physical memory */
5001+ public static boolean FORCE_GEODATA;
5002+ public static boolean ACCEPT_GEOEDITOR_CONN;
5003+
5004+ /** Max number of buffs */
5005+ public static byte BUFFS_MAX_AMOUNT;
5006+
5007+ /** Alt Settings for devs */
5008+ public static boolean ALT_DEV_NO_QUESTS;
5009+ public static boolean ALT_DEV_NO_SPAWNS;
5010+
5011+ /**
5012+ * This class initializes all global variables for configuration.<br>
5013+ * If key doesn't appear in properties file, a default value is setting on by this class.
5014+ * @see CONFIGURATION_FILE (propertie file) for configuring your server.
5015+ */
5016+ public static void load()
5017+ {
5018+ if (Server.SERVER_MODE == Server.MODE_GAMESERVER)
5019+ {
5020+ FLOOD_PROTECTOR_USE_ITEM = new FloodProtectorConfig("UseItemFloodProtector");
5021+ FLOOD_PROTECTOR_ROLL_DICE = new FloodProtectorConfig("RollDiceFloodProtector");
5022+ FLOOD_PROTECTOR_FIREWORK = new FloodProtectorConfig("FireworkFloodProtector");
5023+ FLOOD_PROTECTOR_ITEM_PET_SUMMON = new FloodProtectorConfig("ItemPetSummonFloodProtector");
5024+ FLOOD_PROTECTOR_HERO_VOICE = new FloodProtectorConfig("HeroVoiceFloodProtector");
5025+ FLOOD_PROTECTOR_GLOBAL_CHAT = new FloodProtectorConfig("GlobalChatFloodProtector");
5026+ FLOOD_PROTECTOR_SUBCLASS = new FloodProtectorConfig("SubclassFloodProtector");
5027+ FLOOD_PROTECTOR_DROP_ITEM = new FloodProtectorConfig("DropItemFloodProtector");
5028+ FLOOD_PROTECTOR_SERVER_BYPASS = new FloodProtectorConfig("ServerBypassFloodProtector");
5029+ FLOOD_PROTECTOR_MULTISELL = new FloodProtectorConfig("MultiSellFloodProtector");
5030+ FLOOD_PROTECTOR_TRANSACTION = new FloodProtectorConfig("TransactionFloodProtector");
5031+ FLOOD_PROTECTOR_MANUFACTURE = new FloodProtectorConfig("ManufactureFloodProtector");
5032+ FLOOD_PROTECTOR_MANOR = new FloodProtectorConfig("ManorFloodProtector");
5033+ FLOOD_PROTECTOR_CHARACTER_SELECT = new FloodProtectorConfig("CharacterSelectFloodProtector");
5034+
5035+ _log.info("Loading Gameserver Configuration Files.");
5036+
5037+ Properties serverSettings = new Properties();
5038+ try (InputStream is = new FileInputStream(new File(CONFIGURATION_FILE)))
5039+ {
5040+ serverSettings.load(is);
5041+ }
5042+ catch (Exception e)
5043+ {
5044+ e.printStackTrace();
5045+ throw new Error("Failed to Load " + CONFIGURATION_FILE + " File.");
5046+ }
5047+
5048+ GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
5049+ PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
5050+
5051+ EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
5052+ INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
5053+
5054+ GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort", "9014"));
5055+ GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost", "127.0.0.1");
5056+
5057+ REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID", "0"));
5058+ ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID", "True"));
5059+
5060+ DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
5061+ DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
5062+ DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
5063+ DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
5064+ DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
5065+ CONNECTION_CLOSE_TIME = Long.parseLong(serverSettings.getProperty("ConnectionCloseTime", "60000"));
5066+
5067+ try
5068+ {
5069+ DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".").replaceAll("\\\\", "/")).getCanonicalFile();
5070+ }
5071+ catch (Exception e)
5072+ {
5073+ _log.warning("Error setting datapack root!");
5074+ DATAPACK_ROOT = new File(".");
5075+ }
5076+
5077+ CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
5078+ PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
5079+
5080+ MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "7"));
5081+ MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
5082+
5083+ MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
5084+ MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
5085+
5086+ if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
5087+ {
5088+ throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
5089+ }
5090+
5091+ Properties optionsSettings = new Properties();
5092+ try (InputStream is = new FileInputStream(new File(OPTIONS_FILE)))
5093+ {
5094+ optionsSettings.load(is);
5095+ }
5096+ catch (Exception e)
5097+ {
5098+ e.printStackTrace();
5099+ throw new Error("Failed to Load " + OPTIONS_FILE + " File.");
5100+ }
5101+
5102+ EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(optionsSettings.getProperty("EverybodyHasAdminRights", "false"));
5103+
5104+ DISPLAY_SERVER_VERSION = Boolean.parseBoolean(optionsSettings.getProperty("DisplayServerRevision", "false"));
5105+
5106+ DEBUG = Boolean.parseBoolean(optionsSettings.getProperty("Debug", "false"));
5107+ ASSERT = Boolean.parseBoolean(optionsSettings.getProperty("Assert", "false"));
5108+ DEVELOPER = Boolean.parseBoolean(optionsSettings.getProperty("Developer", "false"));
5109+ ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(optionsSettings.getProperty("AcceptGeoeditorConn", "False"));
5110+ TEST_SERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
5111+ SERVER_LIST_TESTSERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
5112+
5113+ SERVER_LIST_BRACKET = Boolean.valueOf(optionsSettings.getProperty("ServerListBrackets", "false"));
5114+ SERVER_LIST_CLOCK = Boolean.valueOf(optionsSettings.getProperty("ServerListClock", "false"));
5115+ SERVER_GMONLY = Boolean.valueOf(optionsSettings.getProperty("ServerGMOnly", "false"));
5116+
5117+ SKILL_CHECK_ENABLE = Boolean.valueOf(optionsSettings.getProperty("SkillCheckEnable", "False"));
5118+
5119+ AUTODESTROY_ITEM_AFTER = Integer.parseInt(optionsSettings.getProperty("AutoDestroyDroppedItemAfter", "0"));
5120+ PROTECTED_ITEMS = optionsSettings.getProperty("ListOfProtectedItems");
5121+ LIST_PROTECTED_ITEMS = new FastList<>();
5122+ for (String id : PROTECTED_ITEMS.split(","))
5123+ {
5124+ LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
5125+ }
5126+ UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(optionsSettings.getProperty("UpdateItemsOnCharStore", "false"));
5127+ LAZY_ITEMS_UPDATE = Boolean.parseBoolean(optionsSettings.getProperty("LazyItemsUpdate", "false"));
5128+ DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyPlayerDroppedItem", "false"));
5129+ DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyEquipableItem", "false"));
5130+ SAVE_DROPPED_ITEM = Boolean.valueOf(optionsSettings.getProperty("SaveDroppedItem", "false"));
5131+ EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(optionsSettings.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
5132+ SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(optionsSettings.getProperty("SaveDroppedItemInterval", "0")) * 60000;
5133+ CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(optionsSettings.getProperty("ClearDroppedItemTable", "false"));
5134+
5135+ PRECISE_DROP_CALCULATION = Boolean.valueOf(optionsSettings.getProperty("PreciseDropCalculation", "True"));
5136+ MULTIPLE_ITEM_DROP = Boolean.valueOf(optionsSettings.getProperty("MultipleItemDrop", "True"));
5137+
5138+ String str = optionsSettings.getProperty("EnableFallingDamage", "auto");
5139+ ENABLE_FALLING_DAMAGE = "auto".equalsIgnoreCase(str) ? GEODATA > 0 : Boolean.parseBoolean(str);
5140+
5141+ ALLOW_WAREHOUSE = Boolean.valueOf(optionsSettings.getProperty("AllowWarehouse", "True"));
5142+ WAREHOUSE_CACHE = Boolean.valueOf(optionsSettings.getProperty("WarehouseCache", "False"));
5143+ WAREHOUSE_CACHE_TIME = Integer.parseInt(optionsSettings.getProperty("WarehouseCacheTime", "15"));
5144+ ALLOW_FREIGHT = Boolean.valueOf(optionsSettings.getProperty("AllowFreight", "True"));
5145+ ALLOW_WEAR = Boolean.valueOf(optionsSettings.getProperty("AllowWear", "False"));
5146+ WEAR_DELAY = Integer.parseInt(optionsSettings.getProperty("WearDelay", "5"));
5147+ WEAR_PRICE = Integer.parseInt(optionsSettings.getProperty("WearPrice", "10"));
5148+ ALLOW_LOTTERY = Boolean.valueOf(optionsSettings.getProperty("AllowLottery", "False"));
5149+ ALLOW_RACE = Boolean.valueOf(optionsSettings.getProperty("AllowRace", "False"));
5150+ ALLOW_WATER = Boolean.valueOf(optionsSettings.getProperty("AllowWater", "False"));
5151+ ALLOW_RENTPET = Boolean.valueOf(optionsSettings.getProperty("AllowRentPet", "False"));
5152+ ALLOW_DISCARDITEM = Boolean.valueOf(optionsSettings.getProperty("AllowDiscardItem", "True"));
5153+ ALLOWFISHING = Boolean.valueOf(optionsSettings.getProperty("AllowFishing", "True"));
5154+ ALLOW_BOAT = Boolean.valueOf(optionsSettings.getProperty("AllowBoat", "False"));
5155+
5156+ ALLOW_L2WALKER = Boolean.valueOf(optionsSettings.getProperty("AllowL2Walker", "False"));
5157+ ALLOW_MANOR = Boolean.valueOf(optionsSettings.getProperty("AllowManor", "True"));
5158+ ALLOW_NPC_WALKERS = Boolean.valueOf(optionsSettings.getProperty("AllowNpcWalkers", "True"));
5159+ ALLOW_PET_WALKERS = Boolean.valueOf(optionsSettings.getProperty("AllowPetWalkers", "True"));
5160+
5161+ ACTIVATE_POSITION_RECORDER = Boolean.valueOf(optionsSettings.getProperty("ActivatePositionRecorder", "False"));
5162+
5163+ DEFAULT_GLOBAL_CHAT = optionsSettings.getProperty("GlobalChat", "ON");
5164+ DEFAULT_TRADE_CHAT = optionsSettings.getProperty("TradeChat", "ON");
5165+
5166+ LOG_CHAT = Boolean.valueOf(optionsSettings.getProperty("LogChat", "False"));
5167+ LOG_ITEMS = Boolean.valueOf(optionsSettings.getProperty("LogItems", "false"));
5168+
5169+ GMAUDIT = Boolean.valueOf(optionsSettings.getProperty("GMAudit", "False"));
5170+
5171+ COMMUNITY_TYPE = Integer.parseInt(optionsSettings.getProperty("CommunityType", "1"));
5172+ BBS_SHOW_PLAYERLIST = Boolean.valueOf(optionsSettings.getProperty("BBSShowPlayerList", "False"));
5173+ BBS_DEFAULT = optionsSettings.getProperty("BBSDefault", "_bbshome");
5174+ SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowLevelOnCommunityBoard", "False"));
5175+ SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowStatusOnCommunityBoard", "True"));
5176+ NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePageSizeOnCommunityBoard", "50"));
5177+ NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePerRowOnCommunityBoard", "5"));
5178+
5179+ ZONE_TOWN = Integer.parseInt(optionsSettings.getProperty("ZoneTown", "0"));
5180+
5181+ MAX_DRIFT_RANGE = Integer.parseInt(optionsSettings.getProperty("MaxDriftRange", "300"));
5182+
5183+ MIN_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinNPCAnimation", "10"));
5184+ MAX_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxNPCAnimation", "20"));
5185+
5186+ MIN_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinMonsterAnimation", "5"));
5187+ MAX_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxMonsterAnimation", "20"));
5188+
5189+ KNOWNLIST_UPDATE_INTERVAL = Long.parseLong(optionsSettings.getProperty("KnownListUpdateInterval", "1250"));
5190+
5191+ SHOW_NPC_LVL = Boolean.valueOf(optionsSettings.getProperty("ShowNpcLevel", "False"));
5192+
5193+ FORCE_INVENTORY_UPDATE = Boolean.valueOf(optionsSettings.getProperty("ForceInventoryUpdate", "False"));
5194+
5195+ AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(optionsSettings.getProperty("AutoDeleteInvalidQuestData", "False"));
5196+
5197+ THREAD_P_EFFECTS = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeEffects", "6"));
5198+ THREAD_P_GENERAL = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeGeneral", "15"));
5199+ GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralPacketThreadCoreSize", "4"));
5200+ IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("UrgentPacketThreadCoreSize", "2"));
5201+ AI_MAX_THREAD = Integer.parseInt(optionsSettings.getProperty("AiMaxThread", "10"));
5202+ GENERAL_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralThreadCoreSize", "4"));
5203+
5204+ DELETE_DAYS = Integer.parseInt(optionsSettings.getProperty("DeleteCharAfterDays", "7"));
5205+
5206+ DEFAULT_PUNISH = Integer.parseInt(optionsSettings.getProperty("DefaultPunish", "2"));
5207+ DEFAULT_PUNISH_PARAM = Integer.parseInt(optionsSettings.getProperty("DefaultPunishParam", "0"));
5208+
5209+ LAZY_CACHE = Boolean.valueOf(optionsSettings.getProperty("LazyCache", "False"));
5210+
5211+ PACKET_LIFETIME = Integer.parseInt(optionsSettings.getProperty("PacketLifeTime", "0"));
5212+
5213+ DEADLOCK_DETECTOR = Boolean.valueOf(optionsSettings.getProperty("DeadLockDetector", "False"));
5214+ DEADLOCK_CHECK_INTERVAL = Integer.parseInt(optionsSettings.getProperty("DeadLockCheckInterval", "20"));
5215+ RESTART_ON_DEADLOCK = Boolean.valueOf(optionsSettings.getProperty("RestartOnDeadlock", "False"));
5216+
5217+ BYPASS_VALIDATION = Boolean.valueOf(optionsSettings.getProperty("BypassValidation", "True"));
5218+
5219+ ONLY_GM_ITEMS_FREE = Boolean.valueOf(optionsSettings.getProperty("OnlyGMItemsFree", "True"));
5220+
5221+ GAMEGUARD_ENFORCE = Boolean.valueOf(optionsSettings.getProperty("GameGuardEnforce", "False"));
5222+ GAMEGUARD_PROHIBITACTION = Boolean.valueOf(optionsSettings.getProperty("GameGuardProhibitAction", "False"));
5223+
5224+ GRIDS_ALWAYS_ON = Boolean.parseBoolean(optionsSettings.getProperty("GridsAlwaysOn", "False"));
5225+ GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOnTime", "1"));
5226+ GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOffTime", "90"));
5227+
5228+ GEODATA = Integer.parseInt(optionsSettings.getProperty("GeoData", "0"));
5229+ GEODATA_DRIVER = optionsSettings.getProperty("GeoDataDriver", "com.l2j.geodriver.GeoDriver");
5230+ GEODATA_CELLFINDING = Boolean.parseBoolean(optionsSettings.getProperty("CellPathFinding", "False"));
5231+
5232+ try
5233+ {
5234+ PATHNODE_DIR = new File(optionsSettings.getProperty("PathnodeDirectory", "./data/pathnode").replaceAll("\\\\", "/")).getCanonicalFile();
5235+ }
5236+ catch (Exception e)
5237+ {
5238+ _log.warning("Error setting pathnode directory!");
5239+ PATHNODE_DIR = new File("./data/pathnode");
5240+ }
5241+
5242+ PATHFIND_BUFFERS = optionsSettings.getProperty("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
5243+ LOW_WEIGHT = Float.parseFloat(optionsSettings.getProperty("LowWeight", "0.5"));
5244+ MEDIUM_WEIGHT = Float.parseFloat(optionsSettings.getProperty("MediumWeight", "2"));
5245+ HIGH_WEIGHT = Float.parseFloat(optionsSettings.getProperty("HighWeight", "3"));
5246+ ADVANCED_DIAGONAL_STRATEGY = Boolean.parseBoolean(optionsSettings.getProperty("AdvancedDiagonalStrategy", "True"));
5247+ DIAGONAL_WEIGHT = Float.parseFloat(optionsSettings.getProperty("DiagonalWeight", "0.707"));
5248+ MAX_POSTFILTER_PASSES = Integer.parseInt(optionsSettings.getProperty("MaxPostfilterPasses", "3"));
5249+ DEBUG_PATH = Boolean.parseBoolean(optionsSettings.getProperty("DebugPath", "False"));
5250+ FORCE_GEODATA = Boolean.parseBoolean(optionsSettings.getProperty("ForceGeoData", "True"));
5251+ COORD_SYNCHRONIZE = Integer.parseInt(optionsSettings.getProperty("CoordSynchronize", "-1"));
5252+
5253+ // ---------------------------------------------------
5254+ // Configuration values not found in config files
5255+ // ---------------------------------------------------
5256+
5257+ USE_3D_MAP = Boolean.valueOf(optionsSettings.getProperty("Use3DMap", "False"));
5258+
5259+ PATH_NODE_RADIUS = Integer.parseInt(optionsSettings.getProperty("PathNodeRadius", "50"));
5260+ NEW_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
5261+ SELECTED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
5262+ LINKED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
5263+ NEW_NODE_TYPE = optionsSettings.getProperty("NewNodeType", "npc");
5264+
5265+ MINIMUM_UPDATE_DISTANCE = Integer.parseInt(optionsSettings.getProperty("MaximumUpdateDistance", "50"));
5266+ MINIMUN_UPDATE_TIME = Integer.parseInt(optionsSettings.getProperty("MinimumUpdateTime", "500"));
5267+ CHECK_KNOWN = Boolean.valueOf(optionsSettings.getProperty("CheckKnownList", "false"));
5268+ KNOWNLIST_FORGET_DELAY = Integer.parseInt(optionsSettings.getProperty("KnownListForgetDelay", "10000"));
5269+
5270+ /*
5271+ * Load L2J Server Version Properties file (if exists)
5272+ */
5273+ Properties serverVersion = new Properties();
5274+ try (InputStream is = new FileInputStream(new File(SERVER_VERSION_FILE)))
5275+ {
5276+ serverVersion.load(is);
5277+ }
5278+ catch (Exception e)
5279+ {
5280+ // Ignore Properties file if it doesnt exist
5281+ SERVER_VERSION = "Unsupported Custom Version.";
5282+ SERVER_BUILD_DATE = "Undefined Date.";
5283+ }
5284+
5285+ SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
5286+ SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
5287+
5288+ /*
5289+ * Load L2J Datapack Version Properties file (if exists)
5290+ */
5291+ Properties datapackVersion = new Properties();
5292+ try (InputStream is = new FileInputStream(new File(DATAPACK_VERSION_FILE)))
5293+ {
5294+ datapackVersion.load(is);
5295+ }
5296+ catch (Exception e)
5297+ {
5298+ // Ignore Properties file if it doesnt exist
5299+ DATAPACK_VERSION = "Unsupported Custom Version.";
5300+ }
5301+
5302+ DATAPACK_VERSION = datapackVersion.getProperty("version", "Unsupported Custom Version.");
5303+
5304+ // telnet
5305+ Properties telnetSettings = new Properties();
5306+ try (InputStream is = new FileInputStream(new File(TELNET_FILE)))
5307+ {
5308+ telnetSettings.load(is);
5309+ }
5310+ catch (Exception e)
5311+ {
5312+ e.printStackTrace();
5313+ throw new Error("Failed to Load " + TELNET_FILE + " File.");
5314+ }
5315+
5316+ IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "False"));
5317+ TELNET_PORT = Integer.parseInt(telnetSettings.getProperty("GameStatusPort", "54321"));
5318+
5319+ // id factory
5320+ Properties idSettings = new Properties();
5321+ try (InputStream is = new FileInputStream(new File(ID_CONFIG_FILE)))
5322+ {
5323+ idSettings.load(is);
5324+ }
5325+ catch (Exception e)
5326+ {
5327+ e.printStackTrace();
5328+ throw new Error("Failed to Load " + ID_CONFIG_FILE + " File.");
5329+ }
5330+
5331+ MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
5332+ SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
5333+ IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
5334+ BAD_ID_CHECKING = Boolean.valueOf(idSettings.getProperty("BadIdChecking", "True"));
5335+
5336+ // Load FloodProtector Properties file
5337+ Properties security = new Properties();
5338+ try (InputStream is = new FileInputStream(new File(FLOOD_PROTECTOR_FILE)))
5339+ {
5340+ security.load(is);
5341+ }
5342+ catch (Exception e)
5343+ {
5344+ e.printStackTrace();
5345+ throw new Error("Failed to Load " + FLOOD_PROTECTOR_FILE + " File.");
5346+ }
5347+
5348+ loadFloodProtectorConfigs(security);
5349+
5350+ // other
5351+ Properties otherSettings = new Properties();
5352+ try (InputStream is = new FileInputStream(new File(OTHER_CONFIG_FILE)))
5353+ {
5354+ otherSettings.load(is);
5355+ }
5356+ catch (Exception e)
5357+ {
5358+ e.printStackTrace();
5359+ throw new Error("Failed to Load " + OTHER_CONFIG_FILE + " File.");
5360+ }
5361+
5362+ DEEPBLUE_DROP_RULES = Boolean.parseBoolean(otherSettings.getProperty("UseDeepBlueDropRules", "True"));
5363+ GUARD_ATTACK_AGGRO_MOB = Boolean.valueOf(otherSettings.getProperty("GuardAttackAggroMob", "False"));
5364+ EFFECT_CANCELING = Boolean.valueOf(otherSettings.getProperty("CancelLesserEffect", "True"));
5365+ ALLOW_WYVERN_UPGRADER = Boolean.valueOf(otherSettings.getProperty("AllowWyvernUpgrader", "False"));
5366+
5367+ /* Inventory slots limits */
5368+ INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForNoDwarf", "80"));
5369+ INVENTORY_MAXIMUM_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForDwarf", "100"));
5370+ INVENTORY_MAXIMUM_GM = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForGMPlayer", "250"));
5371+
5372+ INVENTORY_MAXIMUM_PET = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForPet", "12"));
5373+ MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
5374+
5375+ /* Warehouse slots limits */
5376+ WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
5377+ WAREHOUSE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
5378+ WAREHOUSE_SLOTS_CLAN = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForClan", "200"));
5379+ FREIGHT_SLOTS = Integer.parseInt(otherSettings.getProperty("MaximumFreightSlots", "20"));
5380+
5381+ /* chance to enchant an item over +3 */
5382+ ENCHANT_CHANCE_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantChanceWeapon", "68"));
5383+ ENCHANT_CHANCE_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantChanceArmor", "52"));
5384+ ENCHANT_CHANCE_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantChanceJewelry", "54"));
5385+ BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(otherSettings.getProperty("BlessedEnchantChanceWeapon", "68"));
5386+ BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(otherSettings.getProperty("BlessedEnchantChanceArmor", "52"));
5387+ BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(otherSettings.getProperty("BlessedEnchantChanceJewelry", "54"));
5388+ /* limit on enchant */
5389+ ENCHANT_MAX_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantMaxWeapon", "25"));
5390+ ENCHANT_MAX_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantMaxArmor", "25"));
5391+ ENCHANT_MAX_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantMaxJewelry", "25"));
5392+ /* limit of safe enchant normal */
5393+ ENCHANT_SAFE_MAX = Integer.parseInt(otherSettings.getProperty("EnchantSafeMax", "3"));
5394+ /* limit of safe enchant full */
5395+ ENCHANT_SAFE_MAX_FULL = Integer.parseInt(otherSettings.getProperty("EnchantSafeMaxFull", "4"));
5396+
5397+ /* if different from 100 (ie 100%) heal rate is modified acordingly */
5398+ HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("HpRegenMultiplier", "100")) / 100;
5399+ MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("MpRegenMultiplier", "100")) / 100;
5400+ CP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("CpRegenMultiplier", "100")) / 100;
5401+
5402+ RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidHpRegenMultiplier", "100")) / 100;
5403+ RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidMpRegenMultiplier", "100")) / 100;
5404+ RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidPDefenceMultiplier", "100")) / 100;
5405+ RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidMDefenceMultiplier", "100")) / 100;
5406+ RAID_MINION_RESPAWN_TIMER = Integer.parseInt(otherSettings.getProperty("RaidMinionRespawnTime", "300000"));
5407+ RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMinRespawnMultiplier", "1.0"));
5408+ RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMaxRespawnMultiplier", "1.0"));
5409+
5410+ STARTING_ADENA = Integer.parseInt(otherSettings.getProperty("StartingAdena", "0"));
5411+ STARTING_LEVEL = Byte.parseByte(otherSettings.getProperty("StartingLevel", "1"));
5412+ if (STARTING_LEVEL > (Experience.MAX_LEVEL - 1))
5413+ {
5414+ STARTING_LEVEL = Experience.MAX_LEVEL - 1;
5415+ }
5416+ STARTING_SUB_LEVEL = Byte.parseByte(otherSettings.getProperty("StartingSubclassLevel", "40"));
5417+
5418+ if (STARTING_SUB_LEVEL > (Experience.MAX_LEVEL - 1))
5419+ {
5420+ STARTING_SUB_LEVEL = Experience.MAX_LEVEL - 1;
5421+ }
5422+
5423+ MAX_RUN_SPEED = Integer.parseInt(otherSettings.getProperty("MaxRunSpeed", "250"));
5424+ MAX_PCRIT_RATE = Integer.parseInt(otherSettings.getProperty("MaxPCritRate", "500"));
5425+ MAX_MCRIT_RATE = Integer.parseInt(otherSettings.getProperty("MaxMCritRate", "300"));
5426+ MAX_PATK_SPEED = Integer.parseInt(otherSettings.getProperty("MaxPAtkSpeed", "1500"));
5427+ MAX_MATK_SPEED = Integer.parseInt(otherSettings.getProperty("MaxMAtkSpeed", "1999"));
5428+
5429+ UNSTUCK_INTERVAL = Integer.parseInt(otherSettings.getProperty("UnstuckInterval", "300"));
5430+
5431+ /* Player protection after teleport or login */
5432+ PLAYER_SPAWN_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerSpawnProtection", "0"));
5433+
5434+ /* Player protection after recovering from fake death (works against mobs only) */
5435+ PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerFakeDeathUpProtection", "0"));
5436+
5437+ /* Defines some Party XP related values */
5438+ PARTY_XP_CUTOFF_METHOD = otherSettings.getProperty("PartyXpCutoffMethod", "percentage");
5439+ PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(otherSettings.getProperty("PartyXpCutoffPercent", "3."));
5440+ PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(otherSettings.getProperty("PartyXpCutoffLevel", "30"));
5441+
5442+ /* Amount of HP that is restored */
5443+ RESPAWN_RESTORE_HP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreHP", "70")) / 100;
5444+
5445+ RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("RespawnRandomOffset", "True"));
5446+ RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(otherSettings.getProperty("RespawnRandomMaxOffset", "20"));
5447+
5448+ /* Maximum number of available slots for pvt stores */
5449+ MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsDwarf", "5"));
5450+ MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsOther", "4"));
5451+
5452+ STORE_SKILL_COOLTIME = Boolean.parseBoolean(otherSettings.getProperty("StoreSkillCooltime", "true"));
5453+
5454+ PET_RENT_NPC = otherSettings.getProperty("ListPetRentNpc", "7827");
5455+ LIST_PET_RENT_NPC = new FastList<>();
5456+ for (String id : PET_RENT_NPC.split(","))
5457+ {
5458+ LIST_PET_RENT_NPC.add(Integer.parseInt(id));
5459+ }
5460+ NONDROPPABLE_ITEMS = otherSettings.getProperty("ListOfNonDroppableItems", "1147,425,1146,461,10,2368,7,6,2370,2369,5598");
5461+
5462+ LIST_NONDROPPABLE_ITEMS = new FastList<>();
5463+ for (String id : NONDROPPABLE_ITEMS.split(","))
5464+ {
5465+ LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
5466+ }
5467+
5468+ ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(otherSettings.getProperty("AnnounceMammonSpawn", "True"));
5469+
5470+ ALT_PRIVILEGES_ADMIN = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesAdmin", "False"));
5471+ ALT_PRIVILEGES_SECURE_CHECK = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesSecureCheck", "True"));
5472+ ALT_PRIVILEGES_DEFAULT_LEVEL = Integer.parseInt(otherSettings.getProperty("AltPrivilegesDefaultLevel", "100"));
5473+
5474+ GM_NAME_COLOR_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("GMNameColorEnabled", "False"));
5475+ GM_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("GMNameColor", "FFFF00"));
5476+ ADMIN_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("AdminNameColor", "00FF00"));
5477+ GM_HERO_AURA = Boolean.parseBoolean(otherSettings.getProperty("GMHeroAura", "True"));
5478+ GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvulnerable", "True"));
5479+ GM_STARTUP_INVISIBLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvisible", "True"));
5480+ GM_STARTUP_SILENCE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupSilence", "True"));
5481+ GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(otherSettings.getProperty("GMStartupAutoList", "True"));
5482+
5483+ PETITIONING_ALLOWED = Boolean.parseBoolean(otherSettings.getProperty("PetitioningAllowed", "True"));
5484+ MAX_PETITIONS_PER_PLAYER = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPerPlayer", "5"));
5485+ MAX_PETITIONS_PENDING = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPending", "25"));
5486+
5487+ JAIL_IS_PVP = Boolean.valueOf(otherSettings.getProperty("JailIsPvp", "True"));
5488+ JAIL_DISABLE_CHAT = Boolean.valueOf(otherSettings.getProperty("JailDisableChat", "True"));
5489+
5490+ // rates
5491+ Properties ratesSettings = new Properties();
5492+ try (InputStream is = new FileInputStream(new File(RATES_CONFIG_FILE)))
5493+ {
5494+ ratesSettings.load(is);
5495+ }
5496+ catch (Exception e)
5497+ {
5498+ e.printStackTrace();
5499+ throw new Error("Failed to Load " + RATES_CONFIG_FILE + " File.");
5500+ }
5501+
5502+ RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
5503+ RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
5504+ RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
5505+ RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
5506+ RATE_QUESTS_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestsReward", "1."));
5507+ RATE_DROP_ADENA = Float.parseFloat(ratesSettings.getProperty("RateDropAdena", "1."));
5508+ RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
5509+ RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
5510+ RATE_BOSS_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateBossDropItems", "1."));
5511+ RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
5512+ RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
5513+ RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("RateDropQuest", "1."));
5514+ RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
5515+ RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
5516+
5517+ PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
5518+ PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
5519+ PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
5520+ PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
5521+ PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
5522+
5523+ PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
5524+ PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
5525+ SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
5526+
5527+ KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
5528+ KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
5529+ KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
5530+ KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
5531+ KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
5532+
5533+ CAN_SPOIL_LOWER_LEVEL_MOBS = Boolean.parseBoolean(ratesSettings.getProperty("CanSpoilLowerLevelMobs", "false"));
5534+ CAN_DELEVEL_AND_SPOIL_MOBS = Boolean.parseBoolean(ratesSettings.getProperty("CanDelevelToSpoil", "true"));
5535+ MAXIMUM_PLAYER_AND_MOB_LEVEL_DIFFERENCE = Float.parseFloat(ratesSettings.getProperty("MaximumPlayerAndMobLevelDifference", "9."));
5536+ BASE_SPOIL_RATE = Float.parseFloat(ratesSettings.getProperty("BasePercentChanceOfSpoilSuccess", "40."));
5537+ MINIMUM_SPOIL_RATE = Float.parseFloat(ratesSettings.getProperty("MinimumPercentChanceOfSpoilSuccess", "3."));
5538+ SPOIL_LEVEL_DIFFERENCE_LIMIT = Float.parseFloat(ratesSettings.getProperty("SpoilLevelDifferenceLimit", "5."));
5539+ SPOIL_LEVEL_DIFFERENCE_MULTIPLIER = Float.parseFloat(ratesSettings.getProperty("SpoilLevelMultiplier", "7."));
5540+ LAST_LEVEL_SPOIL_IS_LEARNED = Integer.parseInt(ratesSettings.getProperty("LastLevelSpoilIsLearned", "72"));
5541+
5542+ // alternative settings
5543+ Properties altSettings = new Properties();
5544+ try (InputStream is = new FileInputStream(new File(ALT_SETTINGS_FILE)))
5545+ {
5546+ altSettings.load(is);
5547+ }
5548+ catch (Exception e)
5549+ {
5550+ e.printStackTrace();
5551+ throw new Error("Failed to Load " + ALT_SETTINGS_FILE + " File.");
5552+ }
5553+
5554+ ALT_GAME_TIREDNESS = Boolean.parseBoolean(altSettings.getProperty("AltGameTiredness", "false"));
5555+ ALT_GAME_CREATION = Boolean.parseBoolean(altSettings.getProperty("AltGameCreation", "false"));
5556+ ALT_GAME_CREATION_SPEED = Double.parseDouble(altSettings.getProperty("AltGameCreationSpeed", "1"));
5557+ ALT_GAME_CREATION_XP_RATE = Double.parseDouble(altSettings.getProperty("AltGameCreationRateXp", "1"));
5558+ ALT_GAME_CREATION_SP_RATE = Double.parseDouble(altSettings.getProperty("AltGameCreationRateSp", "1"));
5559+ ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(altSettings.getProperty("AltGameSkillLearn", "false"));
5560+ AUTO_LEARN_SKILLS = Boolean.parseBoolean(altSettings.getProperty("AutoLearnSkills", "false"));
5561+ AUTO_LEARN_3RD_SKILLS = Boolean.parseBoolean(altSettings.getProperty("AutoLearn3rdClassSkills", "false"));
5562+ ALT_GAME_CANCEL_BOW = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
5563+ ALT_GAME_CANCEL_CAST = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
5564+ ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(altSettings.getProperty("AltPerfectShieldBlockRate", "5"));
5565+ ALT_GAME_DELEVEL = Boolean.parseBoolean(altSettings.getProperty("Delevel", "true"));
5566+ ALT_WEIGHT_LIMIT = Double.parseDouble(altSettings.getProperty("AltWeightLimit", "1"));
5567+ ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(altSettings.getProperty("MagicFailures", "false"));
5568+ ALT_MOB_AGGRO_IN_PEACEZONE = Boolean.parseBoolean(altSettings.getProperty("AltMobAggroInPeaceZone", "true"));
5569+ ALT_GAME_EXPONENT_XP = Float.parseFloat(altSettings.getProperty("AltGameExponentXp", "0."));
5570+ ALT_GAME_EXPONENT_SP = Float.parseFloat(altSettings.getProperty("AltGameExponentSp", "0."));
5571+ ALT_GAME_FREIGHTS = Boolean.parseBoolean(altSettings.getProperty("AltGameFreights", "false"));
5572+ ALT_GAME_FREIGHT_PRICE = Integer.parseInt(altSettings.getProperty("AltGameFreightPrice", "1000"));
5573+ ALT_PARTY_RANGE = Integer.parseInt(altSettings.getProperty("AltPartyRange", "1600"));
5574+ ALT_PARTY_RANGE2 = Integer.parseInt(altSettings.getProperty("AltPartyRange2", "1400"));
5575+ IS_CRAFTING_ENABLED = Boolean.parseBoolean(altSettings.getProperty("CraftingEnabled", "true"));
5576+ SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("SpBookNeeded", "true"));
5577+ ES_SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("EnchantSkillSpBookNeeded", "true"));
5578+ AUTO_LOOT = Boolean.parseBoolean(altSettings.getProperty("AutoLoot", "false"));
5579+ AUTO_LOOT_RAIDS = Boolean.parseBoolean(altSettings.getProperty("AutoLootRaids", "false"));
5580+ ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
5581+ ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanShop", "true"));
5582+ ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseGK", "false"));
5583+ ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTeleport", "true"));
5584+ ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTrade", "true"));
5585+ ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
5586+ ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(altSettings.getProperty("AltFreeTeleporting", "False"));
5587+ ALT_RECOMMEND = Boolean.parseBoolean(altSettings.getProperty("AltRecommend", "False"));
5588+ ALT_MAX_SUBCLASS = Integer.parseInt(altSettings.getProperty("AltMaxSubClasses", "3"));
5589+ ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltSubClassWithoutQuests", "False"));
5590+ ALT_ENABLE_TUTORIAL = Boolean.parseBoolean(altSettings.getProperty("AltEnableTutorial", "True"));
5591+ ALT_GAME_VIEWNPC = Boolean.parseBoolean(altSettings.getProperty("AltGameViewNpc", "False"));
5592+ ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.parseBoolean(altSettings.getProperty("AltNewCharAlwaysIsNewbie", "False"));
5593+ DWARF_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("DwarfRecipeLimit", "50"));
5594+ COMMON_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("CommonRecipeLimit", "50"));
5595+
5596+ ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(altSettings.getProperty("AltClanMembersForWar", "15"));
5597+ ALT_CLAN_JOIN_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAClan", "5"));
5598+ ALT_CLAN_CREATE_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateAClan", "10"));
5599+
5600+ ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(altSettings.getProperty("DaysToPassToDissolveAClan", "7"));
5601+ ALT_RECOVERY_PENALTY = Integer.parseInt(altSettings.getProperty("DaysToPassToDissolveAgain", "7"));
5602+
5603+ ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
5604+ ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
5605+ ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
5606+ ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "10"));
5607+ ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(altSettings.getProperty("AltMaxNumOfClansInAlly", "12"));
5608+
5609+ ALT_CHANNEL_ACTIVATION_COUNT = Integer.parseInt(altSettings.getProperty("AltChannelActivationCount", "5"));
5610+ // Just in case admins set it to less than 2 parties
5611+ if (ALT_CHANNEL_ACTIVATION_COUNT < 2)
5612+ {
5613+ ALT_CHANNEL_ACTIVATION_COUNT = 2;
5614+ }
5615+
5616+ ALT_OLY_START_TIME = Integer.parseInt(altSettings.getProperty("AltOlyStartTime", "20"));
5617+ ALT_OLY_MIN = Integer.parseInt(altSettings.getProperty("AltOlyMin", "00"));
5618+ ALT_OLY_CPERIOD = Long.parseLong(altSettings.getProperty("AltOlyCPeriod", "14400000"));
5619+ ALT_OLY_BATTLE = Long.parseLong(altSettings.getProperty("AltOlyBattle", "180000"));
5620+ ALT_OLY_BWAIT = Long.parseLong(altSettings.getProperty("AltOlyBWait", "600000"));
5621+ ALT_OLY_IWAIT = Long.parseLong(altSettings.getProperty("AltOlyIWait", "300000"));
5622+ ALT_OLY_WPERIOD = Long.parseLong(altSettings.getProperty("AltOlyWPeriod", "604800000"));
5623+ ALT_OLY_VPERIOD = Long.parseLong(altSettings.getProperty("AltOlyVPeriod", "86400000"));
5624+
5625+ ALT_OLY_CLASSED = Integer.parseInt(altSettings.getProperty("AltOlyClassedParticipants", "5"));
5626+
5627+ ALT_OLY_NONCLASSED = Integer.parseInt(altSettings.getProperty("AltOlyNonClassedParticipants", "9"));
5628+ ALT_OLY_BATTLE_REWARD_ITEM = Integer.parseInt(altSettings.getProperty("AltOlyBattleRewItem", "6651"));
5629+ ALT_OLY_CLASSED_RITEM_C = Integer.parseInt(altSettings.getProperty("AltOlyClassedRewItemCount", "50"));
5630+ ALT_OLY_NONCLASSED_RITEM_C = Integer.parseInt(altSettings.getProperty("AltOlyNonClassedRewItemCount", "30"));
5631+ ALT_OLY_COMP_RITEM = Integer.parseInt(altSettings.getProperty("AltOlyCompRewItem", "6651"));
5632+ ALT_OLY_GP_PER_POINT = Integer.parseInt(altSettings.getProperty("AltOlyGPPerPoint", "1000"));
5633+ ALT_OLY_MIN_POINT_FOR_EXCH = Integer.parseInt(altSettings.getProperty("AltOlyMinPointForExchange", "50"));
5634+ ALT_OLY_HERO_POINTS = Integer.parseInt(altSettings.getProperty("AltOlyHeroPoints", "300"));
5635+
5636+ ALT_MANOR_REFRESH_TIME = Integer.parseInt(altSettings.getProperty("AltManorRefreshTime", "20"));
5637+ ALT_MANOR_REFRESH_MIN = Integer.parseInt(altSettings.getProperty("AltManorRefreshMin", "00"));
5638+ ALT_MANOR_APPROVE_TIME = Integer.parseInt(altSettings.getProperty("AltManorApproveTime", "6"));
5639+ ALT_MANOR_APPROVE_MIN = Integer.parseInt(altSettings.getProperty("AltManorApproveMin", "00"));
5640+ ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(altSettings.getProperty("AltManorMaintenancePeriod", "360000"));
5641+ ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(altSettings.getProperty("AltManorSaveAllActions", "True"));
5642+ ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(altSettings.getProperty("AltManorSavePeriodRate", "2"));
5643+
5644+ ALT_LOTTERY_PRIZE = Integer.parseInt(altSettings.getProperty("AltLotteryPrize", "50000"));
5645+ ALT_LOTTERY_TICKET_PRICE = Integer.parseInt(altSettings.getProperty("AltLotteryTicketPrice", "2000"));
5646+ ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery5NumberRate", "0.6"));
5647+ ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery4NumberRate", "0.2"));
5648+ ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery3NumberRate", "0.2"));
5649+ ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Integer.parseInt(altSettings.getProperty("AltLottery2and1NumberPrize", "200"));
5650+ BUFFS_MAX_AMOUNT = Byte.parseByte(altSettings.getProperty("maxbuffamount", "20"));
5651+ ALT_DEV_NO_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoQuests", "False"));
5652+ ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoSpawns", "False"));
5653+
5654+ // Four Sepulcher Config
5655+ FS_PENDING_TIME = Integer.parseInt(altSettings.getProperty("PendingTime", "50"));
5656+ FS_ENTRY_TIME = Integer.parseInt(altSettings.getProperty("EntryTime", "5"));
5657+ FS_PARTY_MEMBER_COUNT = Integer.parseInt(altSettings.getProperty("NumberOfNecessaryPartyMembers", "4"));
5658+
5659+ if (FS_PENDING_TIME <= 0)
5660+ {
5661+ FS_PENDING_TIME = 50;
5662+ }
5663+ if (FS_ENTRY_TIME <= 0)
5664+ {
5665+ FS_ENTRY_TIME = 5;
5666+ }
5667+ if (FS_PARTY_MEMBER_COUNT <= 0)
5668+ {
5669+ FS_PARTY_MEMBER_COUNT = 4;
5670+ }
5671+
5672+ // Dimensional Rift Config
5673+ RIFT_MIN_PARTY_SIZE = Integer.parseInt(altSettings.getProperty("RiftMinPartySize", "2"));
5674+ RIFT_MAX_JUMPS = Integer.parseInt(altSettings.getProperty("MaxRiftJumps", "4"));
5675+ RIFT_SPAWN_DELAY = Integer.parseInt(altSettings.getProperty("RiftSpawnDelay", "10000"));
5676+ RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMin", "480"));
5677+ RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMax", "600"));
5678+ RIFT_ENTER_COST_RECRUIT = Integer.parseInt(altSettings.getProperty("RecruitCost", "18"));
5679+ RIFT_ENTER_COST_SOLDIER = Integer.parseInt(altSettings.getProperty("SoldierCost", "21"));
5680+ RIFT_ENTER_COST_OFFICER = Integer.parseInt(altSettings.getProperty("OfficerCost", "24"));
5681+ RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(altSettings.getProperty("CaptainCost", "27"));
5682+ RIFT_ENTER_COST_COMMANDER = Integer.parseInt(altSettings.getProperty("CommanderCost", "30"));
5683+ RIFT_ENTER_COST_HERO = Integer.parseInt(altSettings.getProperty("HeroCost", "33"));
5684+ RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(altSettings.getProperty("BossRoomTimeMultiply", "1.5"));
5685+
5686+ // custom settings
5687+ Properties customSettings = new Properties();
5688+ try (InputStream is = new FileInputStream(new File(CUSTOM_CONFIG_FILE)))
5689+ {
5690+ customSettings.load(is);
5691+ }
5692+ catch (Exception e)
5693+ {
5694+ e.printStackTrace();
5695+ throw new Error("Failed to Load " + CUSTOM_CONFIG_FILE + " File.");
5696+ }
5697+
5698+ BLOCK_UNWANTED_BUFFS = Boolean.valueOf(customSettings.getProperty("BlockUnwantedBuffs", "false"));
5699+
5700+ CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(customSettings.getProperty("CustomSpawnlistTable", "false"));
5701+ SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(customSettings.getProperty("SaveGmSpawnOnCustom", "false"));
5702+ CUSTOM_NPC_TABLE = Boolean.valueOf(customSettings.getProperty("CustomNpcTable", "false"));
5703+ CUSTOM_NPC_SKILLS_TABLE = Boolean.valueOf(customSettings.getProperty("CustomNpcSkillsTable", "false"));
5704+ CUSTOM_ITEM_TABLES = Boolean.valueOf(customSettings.getProperty("CustomItemTables", "false"));
5705+ CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(customSettings.getProperty("CustomArmorSetsTable", "false"));
5706+ CUSTOM_TELEPORT_TABLE = Boolean.valueOf(customSettings.getProperty("CustomTeleportTable", "false"));
5707+ CUSTOM_DROPLIST_TABLE = Boolean.valueOf(customSettings.getProperty("CustomDroplistTable", "false"));
5708+ CUSTOM_MERCHANT_TABLES = Boolean.valueOf(customSettings.getProperty("CustomMerchantTables", "false"));
5709+
5710+ CHAMPION_ENABLE = Boolean.valueOf(customSettings.getProperty("ChampionEnable", "false"));
5711+ CHAMPION_PASSIVE = Boolean.valueOf(customSettings.getProperty("ChampionPassive", "false"));
5712+ CHAMPION_FREQUENCY = Integer.parseInt(customSettings.getProperty("ChampionFrequency", "0"));
5713+ CHAMPION_TITLE = customSettings.getProperty("ChampionTitle", "Champion");
5714+ CHAMP_MIN_LVL = Integer.parseInt(customSettings.getProperty("ChampionMinLevel", "20"));
5715+ CHAMP_MAX_LVL = Integer.parseInt(customSettings.getProperty("ChampionMaxLevel", "70"));
5716+ CHAMPION_HP = Integer.parseInt(customSettings.getProperty("ChampionHp", "8"));
5717+ CHAMPION_HP_REGEN = Float.parseFloat(customSettings.getProperty("ChampionHpRegen", "1."));
5718+ CHAMPION_REWARDS = Integer.parseInt(customSettings.getProperty("ChampionRewards", "8"));
5719+ CHAMPION_ADENAS_REWARDS = Integer.parseInt(customSettings.getProperty("ChampionAdenasRewards", "1"));
5720+ CHAMPION_ATK = Float.parseFloat(customSettings.getProperty("ChampionAtk", "1."));
5721+ CHAMPION_SPD_ATK = Float.parseFloat(customSettings.getProperty("ChampionSpdAtk", "1."));
5722+ CHAMPION_REWARD_LOWER_CHANCE = Integer.parseInt(customSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
5723+ CHAMPION_REWARD_HIGHER_CHANCE = Integer.parseInt(customSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
5724+ CHAMPION_REWARD_ID = Integer.parseInt(customSettings.getProperty("ChampionRewardItemID", "6393"));
5725+ CHAMPION_REWARD_QTY = Integer.parseInt(customSettings.getProperty("ChampionRewardItemQty", "1"));
5726+
5727+ ALLOW_AUTO_REWARDER = Boolean.valueOf(customSettings.getProperty("AllowAutoRewarder", "False"));
5728+ AUTO_REWARD_DELAY = Integer.parseInt(customSettings.getProperty("AutoRewardDelay", "1200"));
5729+ AUTO_REWARD_ID = Integer.parseInt(customSettings.getProperty("AutoRewardID", "57"));
5730+ AUTO_REWARD_COUNT = Integer.parseInt(customSettings.getProperty("AutoRewardCount", "1000"));
5731+
5732+ CUSTOM_STARTING_SPAWN = Boolean.parseBoolean(customSettings.getProperty("CustomStartingSpawn", "False"));
5733+ CUSTOM_SPAWN_X = Integer.parseInt(customSettings.getProperty("CustomSpawnX", ""));
5734+ CUSTOM_SPAWN_Y = Integer.parseInt(customSettings.getProperty("CustomSpawnY", ""));
5735+ CUSTOM_SPAWN_Z = Integer.parseInt(customSettings.getProperty("CustomSpawnZ", ""));
5736+
5737+ ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(customSettings.getProperty("EnableModifySkillDuration", "False"));
5738+
5739+ // Create Map only if enabled
5740+ if (ENABLE_MODIFY_SKILL_DURATION)
5741+ {
5742+ SKILL_DURATION_LIST = new FastMap<>();
5743+ String[] propertySplit;
5744+ propertySplit = customSettings.getProperty("SkillDurationList", "").split(";");
5745+ for (String skill : propertySplit)
5746+ {
5747+ String[] skillSplit = skill.split(",");
5748+ if (skillSplit.length != 2)
5749+ {
5750+ System.out.println("[SkillDurationList]: invalid config property -> SkillDurationList \"" + skill + "\"");
5751+ }
5752+ else
5753+ {
5754+ try
5755+ {
5756+ SKILL_DURATION_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
5757+ }
5758+ catch (NumberFormatException nfe)
5759+ {
5760+ if (!skill.isEmpty())
5761+ {
5762+ System.out.println("[SkillDurationList]: invalid config property -> SkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
5763+ }
5764+ }
5765+ }
5766+ }
5767+ }
5768+
5769+ Boost_EXP_COMMAND = Boolean.parseBoolean(customSettings.getProperty("SpExpCommand", "False"));
5770+ AUTO_TARGET_NPC = Boolean.parseBoolean(customSettings.getProperty("EnableAutoTargetNPC", "False"));
5771+ CHANGE_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(customSettings.getProperty("ChooseAllSubClassesEveryWhere", "False"));
5772+ AUTO_NOBLE_STATUS = Boolean.parseBoolean(customSettings.getProperty("AutoNoblesseAtLogin", "False"));
5773+ ALLOW_HERO_ENCHANT = Boolean.parseBoolean(customSettings.getProperty("AllowEnchantHeroItems", "False"));
5774+ PREVENT_DUAL_BOXING = Boolean.parseBoolean(customSettings.getProperty("PreventDualBoxing", "False"));
5775+ ENABLE_REAL_TIME = Boolean.parseBoolean(customSettings.getProperty("EnableRealTime", "False"));
5776+ NPC_BUFFER_ENABLED = Boolean.valueOf(customSettings.getProperty("NPCBufferEnabled", "False"));
5777+ AIO_BUFF_DURATION = Integer.parseInt(customSettings.getProperty("AIOBuffDuration", "0"));
5778+ OFFLINE_TRADE_ENABLE = Boolean.valueOf(customSettings.getProperty("OfflineTradeEnable", "false"));
5779+ OFFLINE_CRAFT_ENABLE = Boolean.valueOf(customSettings.getProperty("OfflineCraftEnable", "false"));
5780+ RESTORE_OFFLINERS = Boolean.parseBoolean(customSettings.getProperty("RestoreOffliners", "True"));
5781+ OFFLINE_MAX_DAYS = Integer.parseInt(customSettings.getProperty("OfflineMaxDays", "10"));
5782+ OFFLINE_DISCONNECT_FINISHED = Boolean.parseBoolean(customSettings.getProperty("OfflineDisconnectFinished", "true"));
5783+ OFFLINE_SET_NAME_COLOR = Boolean.valueOf(customSettings.getProperty("OfflineSetNameColor", "false"));
5784+ OFFLINE_NAME_COLOR = Integer.decode("0x" + customSettings.getProperty("OfflineNameColor", "808080"));
5785+ BREAK_ENCHANT = Integer.valueOf(customSettings.getProperty("BreakEnchant", "0"));
5786+ ALLOW_SIEGE_TELEPORT = Boolean.valueOf(customSettings.getProperty("AllowSiegeTeleport", "False"));
5787+ KEEP_SUBCLASS_SKILLS = Boolean.valueOf(customSettings.getProperty("KeepSubClassSkills", "False"));
5788+ ALLOW_CLASS_MASTERS = Boolean.valueOf(customSettings.getProperty("AllowClassMasters", "False"));
5789+ ALLOW_ENTIRE_TREE = Boolean.valueOf(customSettings.getProperty("AllowEntireTree", "False"));
5790+ ALTERNATE_CLASS_MASTER = Boolean.valueOf(customSettings.getProperty("AlternateClassMaster", "False"));
5791+ if (ALLOW_CLASS_MASTERS || ALTERNATE_CLASS_MASTER)
5792+ {
5793+ CLASS_MASTER_SETTINGS = new ClassMasterSettings(String.valueOf(customSettings.getProperty("ConfigClassMaster")));
5794+ }
5795+
5796+ // Feature settings
5797+ Properties Feature = new Properties();
5798+ try (InputStream is = new FileInputStream(new File(FEATURE_CONFIG_FILE)))
5799+ {
5800+ Feature.load(is);
5801+ }
5802+ catch (Exception e)
5803+ {
5804+ e.printStackTrace();
5805+ throw new Error("Failed to Load " + FEATURE_CONFIG_FILE + " File.");
5806+ }
5807+
5808+ CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
5809+ CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
5810+ CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
5811+ CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
5812+ CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
5813+ CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
5814+ CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
5815+ CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
5816+ CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
5817+ CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
5818+ CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
5819+ CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
5820+ CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
5821+ CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
5822+ CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
5823+ CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
5824+ CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
5825+ CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl4", "3270"));
5826+ CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl5", "5166"));
5827+ CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
5828+ CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
5829+ CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
5830+ CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
5831+ CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));
5832+
5833+ CH_TELE_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallTeleportFunctionFeeRation", "86400000"));
5834+ CH_TELE1_FEE = Integer.valueOf(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "86400000"));
5835+ CH_TELE2_FEE = Integer.valueOf(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "86400000"));
5836+ CH_SUPPORT_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallSupportFunctionFeeRation", "86400000"));
5837+ CH_SUPPORT1_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl1", "86400000"));
5838+ CH_SUPPORT2_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl2", "86400000"));
5839+ CH_SUPPORT3_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl3", "86400000"));
5840+ CH_SUPPORT4_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl4", "86400000"));
5841+ CH_SUPPORT5_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl5", "86400000"));
5842+ CH_SUPPORT6_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl6", "86400000"));
5843+ CH_SUPPORT7_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl7", "86400000"));
5844+ CH_SUPPORT8_FEE = Integer.valueOf(Feature.getProperty("ClanHallSupportFeeLvl8", "86400000"));
5845+ CH_MPREG_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRation", "86400000"));
5846+ CH_MPREG1_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "86400000"));
5847+ CH_MPREG2_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "86400000"));
5848+ CH_MPREG3_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "86400000"));
5849+ CH_MPREG4_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "86400000"));
5850+ CH_MPREG5_FEE = Integer.valueOf(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "86400000"));
5851+ CH_HPREG_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRation", "86400000"));
5852+ CH_HPREG1_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "86400000"));
5853+ CH_HPREG2_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "86400000"));
5854+ CH_HPREG3_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "86400000"));
5855+ CH_HPREG4_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "86400000"));
5856+ CH_HPREG5_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "86400000"));
5857+ CH_HPREG6_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "86400000"));
5858+ CH_HPREG7_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "86400000"));
5859+ CH_HPREG8_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "86400000"));
5860+ CH_HPREG9_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "86400000"));
5861+ CH_HPREG10_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "86400000"));
5862+ CH_HPREG11_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "86400000"));
5863+ CH_HPREG12_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "86400000"));
5864+ CH_HPREG13_FEE = Integer.valueOf(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "86400000"));
5865+ CH_EXPREG_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRation", "86400000"));
5866+ CH_EXPREG1_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "86400000"));
5867+ CH_EXPREG2_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "86400000"));
5868+ CH_EXPREG3_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "86400000"));
5869+ CH_EXPREG4_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "86400000"));
5870+ CH_EXPREG5_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "86400000"));
5871+ CH_EXPREG6_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "86400000"));
5872+ CH_EXPREG7_FEE = Integer.valueOf(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "86400000"));
5873+ CH_ITEM_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallItemCreationFunctionFeeRation", "86400000"));
5874+ CH_ITEM1_FEE = Integer.valueOf(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "86400000"));
5875+ CH_ITEM2_FEE = Integer.valueOf(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "86400000"));
5876+ CH_ITEM3_FEE = Integer.valueOf(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "86400000"));
5877+ CH_CURTAIN_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallCurtainFunctionFeeRation", "86400000"));
5878+ CH_CURTAIN1_FEE = Integer.valueOf(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "86400000"));
5879+ CH_CURTAIN2_FEE = Integer.valueOf(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "86400000"));
5880+ CH_FRONT_FEE_RATIO = Long.valueOf(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRation", "86400000"));
5881+ CH_FRONT1_FEE = Integer.valueOf(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "86400000"));
5882+ CH_FRONT2_FEE = Integer.valueOf(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "86400000"));
5883+
5884+ ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltRequireCastleForDawn", "False"));
5885+ ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
5886+ ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
5887+ ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
5888+ ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
5889+ ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
5890+ ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
5891+ ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
5892+ ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));
5893+ ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
5894+ ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
5895+ ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
5896+
5897+ // pvp config
5898+ Properties pvpSettings = new Properties();
5899+ try (InputStream is = new FileInputStream(new File(PVP_CONFIG_FILE)))
5900+ {
5901+ pvpSettings.load(is);
5902+ }
5903+ catch (Exception e)
5904+ {
5905+ e.printStackTrace();
5906+ throw new Error("Failed to Load " + PVP_CONFIG_FILE + " File.");
5907+ }
5908+
5909+ /* KARMA SYSTEM */
5910+ KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
5911+ KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
5912+ KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
5913+ KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
5914+
5915+ KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
5916+ KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
5917+
5918+ KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
5919+
5920+ KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650");
5921+ 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");
5922+
5923+ KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<>();
5924+ for (String id : KARMA_NONDROPPABLE_PET_ITEMS.split(","))
5925+ {
5926+ KARMA_LIST_NONDROPPABLE_PET_ITEMS.add(Integer.parseInt(id));
5927+ }
5928+
5929+ KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<>();
5930+ for (String id : KARMA_NONDROPPABLE_ITEMS.split(","))
5931+ {
5932+ KARMA_LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
5933+ }
5934+
5935+ PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "15000"));
5936+ PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "30000"));
5937+
5938+ // access levels
5939+ Properties gmSettings = new Properties();
5940+ try (InputStream is = new FileInputStream(new File(GM_ACCESS_FILE)))
5941+ {
5942+ gmSettings.load(is);
5943+ }
5944+ catch (Exception e)
5945+ {
5946+ e.printStackTrace();
5947+ throw new Error("Failed to Load " + GM_ACCESS_FILE + " File.");
5948+ }
5949+
5950+ GM_ACCESSLEVEL = Integer.parseInt(gmSettings.getProperty("GMAccessLevel", "100"));
5951+ GM_MIN = Integer.parseInt(gmSettings.getProperty("GMMinLevel", "100"));
5952+ GM_ANNOUNCE = Integer.parseInt(gmSettings.getProperty("GMCanAnnounce", "100"));
5953+ GM_BAN = Integer.parseInt(gmSettings.getProperty("GMCanBan", "100"));
5954+ GM_BAN_CHAT = Integer.parseInt(gmSettings.getProperty("GMCanBanChat", "100"));
5955+ GM_CREATE_ITEM = Integer.parseInt(gmSettings.getProperty("GMCanShop", "100"));
5956+ GM_DELETE = Integer.parseInt(gmSettings.getProperty("GMCanDelete", "100"));
5957+ GM_KICK = Integer.parseInt(gmSettings.getProperty("GMCanKick", "100"));
5958+ GM_MENU = Integer.parseInt(gmSettings.getProperty("GMMenu", "100"));
5959+ GM_GODMODE = Integer.parseInt(gmSettings.getProperty("GMGodMode", "100"));
5960+ GM_CHAR_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditChar", "100"));
5961+ GM_CHAR_EDIT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanEditCharOther", "100"));
5962+ GM_CHAR_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewChar", "100"));
5963+ GM_NPC_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditNPC", "100"));
5964+ GM_NPC_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewNPC", "100"));
5965+ GM_TELEPORT = Integer.parseInt(gmSettings.getProperty("GMCanTeleport", "100"));
5966+ GM_TELEPORT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanTeleportOther", "100"));
5967+ GM_RESTART = Integer.parseInt(gmSettings.getProperty("GMCanRestart", "100"));
5968+ GM_MONSTERRACE = Integer.parseInt(gmSettings.getProperty("GMMonsterRace", "100"));
5969+ GM_RIDER = Integer.parseInt(gmSettings.getProperty("GMRider", "100"));
5970+ GM_ESCAPE = Integer.parseInt(gmSettings.getProperty("GMFastUnstuck", "100"));
5971+ GM_FIXED = Integer.parseInt(gmSettings.getProperty("GMResurectFixed", "100"));
5972+ GM_CREATE_NODES = Integer.parseInt(gmSettings.getProperty("GMCreateNodes", "100"));
5973+ GM_ENCHANT = Integer.parseInt(gmSettings.getProperty("GMEnchant", "100"));
5974+ GM_DOOR = Integer.parseInt(gmSettings.getProperty("GMDoor", "100"));
5975+ GM_RES = Integer.parseInt(gmSettings.getProperty("GMRes", "100"));
5976+ GM_PEACEATTACK = Integer.parseInt(gmSettings.getProperty("GMPeaceAttack", "100"));
5977+ GM_HEAL = Integer.parseInt(gmSettings.getProperty("GMHeal", "100"));
5978+ GM_UNBLOCK = Integer.parseInt(gmSettings.getProperty("GMUnblock", "100"));
5979+ GM_CACHE = Integer.parseInt(gmSettings.getProperty("GMCache", "100"));
5980+ GM_TALK_BLOCK = Integer.parseInt(gmSettings.getProperty("GMTalkBlock", "100"));
5981+ GM_TEST = Integer.parseInt(gmSettings.getProperty("GMTest", "100"));
5982+
5983+ String gmTrans = gmSettings.getProperty("GMDisableTransaction", "False");
5984+ if (!gmTrans.equalsIgnoreCase("false"))
5985+ {
5986+ String[] params = gmTrans.split(",");
5987+ GM_DISABLE_TRANSACTION = true;
5988+ GM_TRANSACTION_MIN = Integer.parseInt(params[0]);
5989+ GM_TRANSACTION_MAX = Integer.parseInt(params[1]);
5990+ }
5991+ else
5992+ {
5993+ GM_DISABLE_TRANSACTION = false;
5994+ }
5995+
5996+ Properties Settings = new Properties();
5997+ try (InputStream is = new FileInputStream(HEXID_FILE))
5998+ {
5999+ Settings.load(is);
6000+ }
6001+ catch (Exception e)
6002+ {
6003+ _log.warning("Could not load HexID file (" + HEXID_FILE + "). Hopefully login will give us one.");
6004+ }
6005+ HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
6006+ }
6007+ else if (Server.SERVER_MODE == Server.MODE_LOGINSERVER)
6008+ {
6009+ _log.info("Loading LoginServer Configuration Files.");
6010+
6011+ Properties serverSettings = new Properties();
6012+ try (InputStream is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE)))
6013+ {
6014+ serverSettings.load(is);
6015+ }
6016+ catch (Exception e)
6017+ {
6018+ e.printStackTrace();
6019+ throw new Error("Failed to Load " + CONFIGURATION_FILE + " File.");
6020+ }
6021+
6022+ GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname", "*");
6023+ GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort", "9014"));
6024+
6025+ LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
6026+ PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
6027+
6028+ DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
6029+ DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
6030+ ASSERT = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));
6031+
6032+ ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer", "True"));
6033+ REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID", "0"));
6034+ ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID", "True"));
6035+
6036+ LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
6037+
6038+ LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
6039+ GM_MIN = Integer.parseInt(serverSettings.getProperty("GMMinLevel", "100"));
6040+
6041+ try
6042+ {
6043+ DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".").replaceAll("\\\\", "/")).getCanonicalFile();
6044+ }
6045+ catch (Exception e)
6046+ {
6047+ _log.warning("Error setting datapack root!");
6048+ DATAPACK_ROOT = new File(".");
6049+ }
6050+
6051+ INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
6052+ EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
6053+
6054+ DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
6055+ DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
6056+ DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
6057+ DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
6058+ DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
6059+ CONNECTION_CLOSE_TIME = Long.parseLong(serverSettings.getProperty("ConnectionCloseTime", "60000"));
6060+
6061+ SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
6062+ AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts", "True"));
6063+
6064+ FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection", "True"));
6065+ FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit", "15"));
6066+ NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime", "700"));
6067+ FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime", "350"));
6068+ MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP", "50"));
6069+
6070+ // telnet
6071+ Properties telnetSettings = new Properties();
6072+ try (InputStream is = new FileInputStream(new File(TELNET_FILE)))
6073+ {
6074+ telnetSettings.load(is);
6075+ }
6076+ catch (Exception e)
6077+ {
6078+ e.printStackTrace();
6079+ throw new Error("Failed to Load " + TELNET_FILE + " File.");
6080+ }
6081+
6082+ IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "False"));
6083+ TELNET_PORT = Integer.parseInt(telnetSettings.getProperty("LoginStatusPort", "12345"));
6084+ }
6085+ else
6086+ {
6087+ _log.severe("Could not Load Config: server mode was not set");
6088+ }
6089+ }
6090+
6091+ /**
6092+ * Set a new value to a game parameter from the admin console.
6093+ * @param pName (String) : name of the parameter to change
6094+ * @param pValue (String) : new value of the parameter
6095+ * @return boolean : true if modification has been made
6096+ * @link useAdminCommand
6097+ */
6098+ public static boolean setParameterValue(String pName, String pValue)
6099+ {
6100+ // Server settings
6101+ if (pName.equalsIgnoreCase("RateXp"))
6102+ {
6103+ RATE_XP = Float.parseFloat(pValue);
6104+ }
6105+ else if (pName.equalsIgnoreCase("RateSp"))
6106+ {
6107+ RATE_SP = Float.parseFloat(pValue);
6108+ }
6109+ else if (pName.equalsIgnoreCase("RatePartyXp"))
6110+ {
6111+ RATE_PARTY_XP = Float.parseFloat(pValue);
6112+ }
6113+ else if (pName.equalsIgnoreCase("RatePartySp"))
6114+ {
6115+ RATE_PARTY_SP = Float.parseFloat(pValue);
6116+ }
6117+ else if (pName.equalsIgnoreCase("RateQuestsReward"))
6118+ {
6119+ RATE_QUESTS_REWARD = Float.parseFloat(pValue);
6120+ }
6121+ else if (pName.equalsIgnoreCase("RateDropAdena"))
6122+ {
6123+ RATE_DROP_ADENA = Float.parseFloat(pValue);
6124+ }
6125+ else if (pName.equalsIgnoreCase("RateConsumableCost"))
6126+ {
6127+ RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
6128+ }
6129+ else if (pName.equalsIgnoreCase("RateDropItems"))
6130+ {
6131+ RATE_DROP_ITEMS = Float.parseFloat(pValue);
6132+ }
6133+ else if (pName.equalsIgnoreCase("RateBossDropItems"))
6134+ {
6135+ RATE_BOSS_DROP_ITEMS = Float.parseFloat(pValue);
6136+ }
6137+ else if (pName.equalsIgnoreCase("RateDropSpoil"))
6138+ {
6139+ RATE_DROP_SPOIL = Float.parseFloat(pValue);
6140+ }
6141+ else if (pName.equalsIgnoreCase("RateDropManor"))
6142+ {
6143+ RATE_DROP_MANOR = Integer.parseInt(pValue);
6144+ }
6145+ else if (pName.equalsIgnoreCase("RateDropQuest"))
6146+ {
6147+ RATE_DROP_QUEST = Float.parseFloat(pValue);
6148+ }
6149+ else if (pName.equalsIgnoreCase("RateKarmaExpLost"))
6150+ {
6151+ RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
6152+ }
6153+ else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice"))
6154+ {
6155+ RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
6156+ }
6157+ else if (pName.equalsIgnoreCase("PlayerDropLimit"))
6158+ {
6159+ PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
6160+ }
6161+ else if (pName.equalsIgnoreCase("PlayerRateDrop"))
6162+ {
6163+ PLAYER_RATE_DROP = Integer.parseInt(pValue);
6164+ }
6165+ else if (pName.equalsIgnoreCase("PlayerRateDropItem"))
6166+ {
6167+ PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
6168+ }
6169+ else if (pName.equalsIgnoreCase("PlayerRateDropEquip"))
6170+ {
6171+ PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
6172+ }
6173+ else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon"))
6174+ {
6175+ PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
6176+ }
6177+ else if (pName.equalsIgnoreCase("KarmaDropLimit"))
6178+ {
6179+ KARMA_DROP_LIMIT = Integer.parseInt(pValue);
6180+ }
6181+ else if (pName.equalsIgnoreCase("KarmaRateDrop"))
6182+ {
6183+ KARMA_RATE_DROP = Integer.parseInt(pValue);
6184+ }
6185+ else if (pName.equalsIgnoreCase("KarmaRateDropItem"))
6186+ {
6187+ KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
6188+ }
6189+ else if (pName.equalsIgnoreCase("KarmaRateDropEquip"))
6190+ {
6191+ KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
6192+ }
6193+ else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon"))
6194+ {
6195+ KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
6196+ }
6197+ else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter"))
6198+ {
6199+ AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
6200+ }
6201+ else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem"))
6202+ {
6203+ DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(pValue);
6204+ }
6205+ else if (pName.equalsIgnoreCase("DestroyEquipableItem"))
6206+ {
6207+ DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(pValue);
6208+ }
6209+ else if (pName.equalsIgnoreCase("SaveDroppedItem"))
6210+ {
6211+ SAVE_DROPPED_ITEM = Boolean.valueOf(pValue);
6212+ }
6213+ else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad"))
6214+ {
6215+ EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(pValue);
6216+ }
6217+ else if (pName.equalsIgnoreCase("SaveDroppedItemInterval"))
6218+ {
6219+ SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
6220+ }
6221+ else if (pName.equalsIgnoreCase("ClearDroppedItemTable"))
6222+ {
6223+ CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(pValue);
6224+ }
6225+ else if (pName.equalsIgnoreCase("PreciseDropCalculation"))
6226+ {
6227+ PRECISE_DROP_CALCULATION = Boolean.valueOf(pValue);
6228+ }
6229+ else if (pName.equalsIgnoreCase("MultipleItemDrop"))
6230+ {
6231+ MULTIPLE_ITEM_DROP = Boolean.valueOf(pValue);
6232+ }
6233+ else if (pName.equalsIgnoreCase("LowWeight"))
6234+ {
6235+ LOW_WEIGHT = Float.parseFloat(pValue);
6236+ }
6237+ else if (pName.equalsIgnoreCase("MediumWeight"))
6238+ {
6239+ MEDIUM_WEIGHT = Float.parseFloat(pValue);
6240+ }
6241+ else if (pName.equalsIgnoreCase("HighWeight"))
6242+ {
6243+ HIGH_WEIGHT = Float.parseFloat(pValue);
6244+ }
6245+ else if (pName.equalsIgnoreCase("AdvancedDiagonalStrategy"))
6246+ {
6247+ ADVANCED_DIAGONAL_STRATEGY = Boolean.parseBoolean(pValue);
6248+ }
6249+ else if (pName.equalsIgnoreCase("DiagonalWeight"))
6250+ {
6251+ DIAGONAL_WEIGHT = Float.parseFloat(pValue);
6252+ }
6253+ else if (pName.equalsIgnoreCase("MaxPostfilterPasses"))
6254+ {
6255+ MAX_POSTFILTER_PASSES = Integer.parseInt(pValue);
6256+ }
6257+ else if (pName.equalsIgnoreCase("CoordSynchronize"))
6258+ {
6259+ COORD_SYNCHRONIZE = Integer.parseInt(pValue);
6260+ }
6261+ else if (pName.equalsIgnoreCase("EnableFallingDamage"))
6262+ {
6263+ ENABLE_FALLING_DAMAGE = Boolean.parseBoolean(pValue);
6264+ }
6265+ else if (pName.equalsIgnoreCase("DeleteCharAfterDays"))
6266+ {
6267+ DELETE_DAYS = Integer.parseInt(pValue);
6268+ }
6269+ else if (pName.equalsIgnoreCase("AllowDiscardItem"))
6270+ {
6271+ ALLOW_DISCARDITEM = Boolean.valueOf(pValue);
6272+ }
6273+ else if (pName.equalsIgnoreCase("AllowFreight"))
6274+ {
6275+ ALLOW_FREIGHT = Boolean.valueOf(pValue);
6276+ }
6277+ else if (pName.equalsIgnoreCase("AllowWarehouse"))
6278+ {
6279+ ALLOW_WAREHOUSE = Boolean.valueOf(pValue);
6280+ }
6281+ else if (pName.equalsIgnoreCase("AllowWear"))
6282+ {
6283+ ALLOW_WEAR = Boolean.valueOf(pValue);
6284+ }
6285+ else if (pName.equalsIgnoreCase("WearDelay"))
6286+ {
6287+ WEAR_DELAY = Integer.parseInt(pValue);
6288+ }
6289+ else if (pName.equalsIgnoreCase("WearPrice"))
6290+ {
6291+ WEAR_PRICE = Integer.parseInt(pValue);
6292+ }
6293+ else if (pName.equalsIgnoreCase("AllowWater"))
6294+ {
6295+ ALLOW_WATER = Boolean.valueOf(pValue);
6296+ }
6297+ else if (pName.equalsIgnoreCase("AllowRentPet"))
6298+ {
6299+ ALLOW_RENTPET = Boolean.valueOf(pValue);
6300+ }
6301+ else if (pName.equalsIgnoreCase("AllowBoat"))
6302+ {
6303+ ALLOW_BOAT = Boolean.valueOf(pValue);
6304+ }
6305+ else if (pName.equalsIgnoreCase("AllowL2Walker"))
6306+ {
6307+ ALLOW_L2WALKER = Boolean.valueOf(pValue);
6308+ }
6309+ else if (pName.equalsIgnoreCase("AllowManor"))
6310+ {
6311+ ALLOW_MANOR = Boolean.valueOf(pValue);
6312+ }
6313+ else if (pName.equalsIgnoreCase("AllowNpcWalkers"))
6314+ {
6315+ ALLOW_NPC_WALKERS = Boolean.valueOf(pValue);
6316+ }
6317+ else if (pName.equalsIgnoreCase("AllowPetWalkers"))
6318+ {
6319+ ALLOW_PET_WALKERS = Boolean.valueOf(pValue);
6320+ }
6321+ else if (pName.equalsIgnoreCase("BypassValidation"))
6322+ {
6323+ BYPASS_VALIDATION = Boolean.valueOf(pValue);
6324+ }
6325+ else if (pName.equalsIgnoreCase("CommunityType"))
6326+ {
6327+ COMMUNITY_TYPE = Integer.parseInt(pValue);
6328+ }
6329+ else if (pName.equalsIgnoreCase("BBSShowPlayerList"))
6330+ {
6331+ BBS_SHOW_PLAYERLIST = Boolean.valueOf(pValue);
6332+ }
6333+ else if (pName.equalsIgnoreCase("BBSDefault"))
6334+ {
6335+ BBS_DEFAULT = pValue;
6336+ }
6337+ else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard"))
6338+ {
6339+ SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(pValue);
6340+ }
6341+ else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard"))
6342+ {
6343+ SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(pValue);
6344+ }
6345+ else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard"))
6346+ {
6347+ NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
6348+ }
6349+ else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard"))
6350+ {
6351+ NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
6352+ }
6353+ else if (pName.equalsIgnoreCase("ShowNpcLevel"))
6354+ {
6355+ SHOW_NPC_LVL = Boolean.valueOf(pValue);
6356+ }
6357+ else if (pName.equalsIgnoreCase("ForceInventoryUpdate"))
6358+ {
6359+ FORCE_INVENTORY_UPDATE = Boolean.valueOf(pValue);
6360+ }
6361+ else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData"))
6362+ {
6363+ AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(pValue);
6364+ }
6365+ else if (pName.equalsIgnoreCase("MaximumOnlineUsers"))
6366+ {
6367+ MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
6368+ }
6369+ else if (pName.equalsIgnoreCase("ZoneTown"))
6370+ {
6371+ ZONE_TOWN = Integer.parseInt(pValue);
6372+ }
6373+ else if (pName.equalsIgnoreCase("MaximumUpdateDistance"))
6374+ {
6375+ MINIMUM_UPDATE_DISTANCE = Integer.parseInt(pValue);
6376+ }
6377+ else if (pName.equalsIgnoreCase("MinimumUpdateTime"))
6378+ {
6379+ MINIMUN_UPDATE_TIME = Integer.parseInt(pValue);
6380+ }
6381+ else if (pName.equalsIgnoreCase("CheckKnownList"))
6382+ {
6383+ CHECK_KNOWN = Boolean.valueOf(pValue);
6384+ }
6385+ else if (pName.equalsIgnoreCase("KnownListForgetDelay"))
6386+ {
6387+ KNOWNLIST_FORGET_DELAY = Integer.parseInt(pValue);
6388+ }
6389+ else if (pName.equalsIgnoreCase("UseDeepBlueDropRules"))
6390+ {
6391+ DEEPBLUE_DROP_RULES = Boolean.valueOf(pValue);
6392+ }
6393+ else if (pName.equalsIgnoreCase("GuardAttackAggroMob"))
6394+ {
6395+ GUARD_ATTACK_AGGRO_MOB = Boolean.valueOf(pValue);
6396+ }
6397+ else if (pName.equalsIgnoreCase("CancelLesserEffect"))
6398+ {
6399+ EFFECT_CANCELING = Boolean.valueOf(pValue);
6400+ }
6401+ else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf"))
6402+ {
6403+ INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
6404+ }
6405+ else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf"))
6406+ {
6407+ INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
6408+ }
6409+ else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer"))
6410+ {
6411+ INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
6412+ }
6413+ else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf"))
6414+ {
6415+ WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
6416+ }
6417+ else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf"))
6418+ {
6419+ WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
6420+ }
6421+ else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan"))
6422+ {
6423+ WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
6424+ }
6425+ else if (pName.equalsIgnoreCase("MaximumFreightSlots"))
6426+ {
6427+ FREIGHT_SLOTS = Integer.parseInt(pValue);
6428+ }
6429+ else if (pName.equalsIgnoreCase("EnchantChanceWeapon"))
6430+ {
6431+ ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
6432+ }
6433+ else if (pName.equalsIgnoreCase("EnchantChanceArmor"))
6434+ {
6435+ ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
6436+ }
6437+ else if (pName.equalsIgnoreCase("EnchantChanceJewelry"))
6438+ {
6439+ ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
6440+ }
6441+ else if (pName.equalsIgnoreCase("BlessedEnchantChanceWeapon"))
6442+ {
6443+ BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
6444+ }
6445+ else if (pName.equalsIgnoreCase("BlessedEnchantChanceArmor"))
6446+ {
6447+ BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
6448+ }
6449+ else if (pName.equalsIgnoreCase("BlessedEnchantChanceJewelry"))
6450+ {
6451+ BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
6452+ }
6453+ else if (pName.equalsIgnoreCase("EnchantMaxWeapon"))
6454+ {
6455+ ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
6456+ }
6457+ else if (pName.equalsIgnoreCase("EnchantMaxArmor"))
6458+ {
6459+ ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
6460+ }
6461+ else if (pName.equalsIgnoreCase("EnchantMaxJewelry"))
6462+ {
6463+ ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
6464+ }
6465+ else if (pName.equalsIgnoreCase("EnchantSafeMax"))
6466+ {
6467+ ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
6468+ }
6469+ else if (pName.equalsIgnoreCase("EnchantSafeMaxFull"))
6470+ {
6471+ ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
6472+ }
6473+ else if (pName.equalsIgnoreCase("HpRegenMultiplier"))
6474+ {
6475+ HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
6476+ }
6477+ else if (pName.equalsIgnoreCase("MpRegenMultiplier"))
6478+ {
6479+ MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
6480+ }
6481+ else if (pName.equalsIgnoreCase("CpRegenMultiplier"))
6482+ {
6483+ CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
6484+ }
6485+ else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier"))
6486+ {
6487+ RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
6488+ }
6489+ else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier"))
6490+ {
6491+ RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
6492+ }
6493+ else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier"))
6494+ {
6495+ RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) / 100;
6496+ }
6497+ else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier"))
6498+ {
6499+ RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) / 100;
6500+ }
6501+ else if (pName.equalsIgnoreCase("RaidMinionRespawnTime"))
6502+ {
6503+ RAID_MINION_RESPAWN_TIMER = Integer.parseInt(pValue);
6504+ }
6505+ else if (pName.equalsIgnoreCase("StartingAdena"))
6506+ {
6507+ STARTING_ADENA = Integer.parseInt(pValue);
6508+ }
6509+ else if (pName.equalsIgnoreCase("StartingLevel"))
6510+ {
6511+ STARTING_LEVEL = Byte.parseByte(pValue);
6512+ }
6513+ else if (pName.equalsIgnoreCase("StartingSubclassLevel"))
6514+ {
6515+ STARTING_SUB_LEVEL = Byte.parseByte(pValue);
6516+ }
6517+ else if (pName.equalsIgnoreCase("UnstuckInterval"))
6518+ {
6519+ UNSTUCK_INTERVAL = Integer.parseInt(pValue);
6520+ }
6521+ else if (pName.equalsIgnoreCase("PlayerSpawnProtection"))
6522+ {
6523+ PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
6524+ }
6525+ else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection"))
6526+ {
6527+ PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
6528+ }
6529+ else if (pName.equalsIgnoreCase("PartyXpCutoffMethod"))
6530+ {
6531+ PARTY_XP_CUTOFF_METHOD = pValue;
6532+ }
6533+ else if (pName.equalsIgnoreCase("PartyXpCutoffPercent"))
6534+ {
6535+ PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
6536+ }
6537+ else if (pName.equalsIgnoreCase("PartyXpCutoffLevel"))
6538+ {
6539+ PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
6540+ }
6541+ else if (pName.equalsIgnoreCase("RespawnRestoreHP"))
6542+ {
6543+ RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
6544+ }
6545+ else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsDwarf"))
6546+ {
6547+ MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(pValue);
6548+ }
6549+ else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsOther"))
6550+ {
6551+ MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(pValue);
6552+ }
6553+ else if (pName.equalsIgnoreCase("StoreSkillCooltime"))
6554+ {
6555+ STORE_SKILL_COOLTIME = Boolean.valueOf(pValue);
6556+ }
6557+ else if (pName.equalsIgnoreCase("AnnounceMammonSpawn"))
6558+ {
6559+ ANNOUNCE_MAMMON_SPAWN = Boolean.valueOf(pValue);
6560+ }
6561+ else if (pName.equalsIgnoreCase("CanSpoilLowerLevelMobs"))
6562+ {
6563+ CAN_SPOIL_LOWER_LEVEL_MOBS = Boolean.valueOf(pValue);
6564+ }
6565+ else if (pName.equalsIgnoreCase("CanDelevelToSpoil"))
6566+ {
6567+ CAN_DELEVEL_AND_SPOIL_MOBS = Boolean.valueOf(pValue);
6568+ }
6569+ else if (pName.equalsIgnoreCase("MaximumPlayerAndMobLevelDifference"))
6570+ {
6571+ MAXIMUM_PLAYER_AND_MOB_LEVEL_DIFFERENCE = Float.parseFloat(pValue);
6572+ }
6573+ else if (pName.equalsIgnoreCase("BasePercentChanceOfSpoilSuccess"))
6574+ {
6575+ BASE_SPOIL_RATE = Float.parseFloat(pValue);
6576+ }
6577+ else if (pName.equalsIgnoreCase("MinimumPercentChanceOfSpoilSuccess"))
6578+ {
6579+ MINIMUM_SPOIL_RATE = Float.parseFloat(pValue);
6580+ }
6581+ else if (pName.equalsIgnoreCase("SpoilLevelDifferenceLimit"))
6582+ {
6583+ SPOIL_LEVEL_DIFFERENCE_LIMIT = Float.parseFloat(pValue);
6584+ }
6585+ else if (pName.equalsIgnoreCase("SpoilLevelMultiplier"))
6586+ {
6587+ SPOIL_LEVEL_DIFFERENCE_MULTIPLIER = Float.parseFloat(pValue);
6588+ }
6589+ else if (pName.equalsIgnoreCase("LastLevelSpoilIsLearned"))
6590+ {
6591+ LAST_LEVEL_SPOIL_IS_LEARNED = Integer.parseInt(pValue);
6592+ }
6593+ else if (pName.equalsIgnoreCase("AltGameTiredness"))
6594+ {
6595+ ALT_GAME_TIREDNESS = Boolean.valueOf(pValue);
6596+ }
6597+ else if (pName.equalsIgnoreCase("AltGameCreation"))
6598+ {
6599+ ALT_GAME_CREATION = Boolean.valueOf(pValue);
6600+ }
6601+ else if (pName.equalsIgnoreCase("AltGameCreationSpeed"))
6602+ {
6603+ ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
6604+ }
6605+ else if (pName.equalsIgnoreCase("AltGameCreationXpRate"))
6606+ {
6607+ ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
6608+ }
6609+ else if (pName.equalsIgnoreCase("AltGameCreationSpRate"))
6610+ {
6611+ ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
6612+ }
6613+ else if (pName.equalsIgnoreCase("AltGameSkillLearn"))
6614+ {
6615+ ALT_GAME_SKILL_LEARN = Boolean.valueOf(pValue);
6616+ }
6617+ else if (pName.equalsIgnoreCase("AutoLearnSkills"))
6618+ {
6619+ AUTO_LEARN_SKILLS = Boolean.valueOf(pValue);
6620+ }
6621+ else if (pName.equalsIgnoreCase("AutoLearn3rdClassSkills"))
6622+ {
6623+ AUTO_LEARN_3RD_SKILLS = Boolean.valueOf(pValue);
6624+ }
6625+ else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
6626+ {
6627+ ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
6628+ ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
6629+ }
6630+
6631+ else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate"))
6632+ {
6633+ ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
6634+ }
6635+ else if (pName.equalsIgnoreCase("Delevel"))
6636+ {
6637+ ALT_GAME_DELEVEL = Boolean.valueOf(pValue);
6638+ }
6639+ else if (pName.equalsIgnoreCase("MagicFailures"))
6640+ {
6641+ ALT_GAME_MAGICFAILURES = Boolean.valueOf(pValue);
6642+ }
6643+ else if (pName.equalsIgnoreCase("AltMobAggroInPeaceZone"))
6644+ {
6645+ ALT_MOB_AGGRO_IN_PEACEZONE = Boolean.valueOf(pValue);
6646+ }
6647+ else if (pName.equalsIgnoreCase("AltGameExponentXp"))
6648+ {
6649+ ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
6650+ }
6651+ else if (pName.equalsIgnoreCase("AltGameExponentSp"))
6652+ {
6653+ ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
6654+ }
6655+ else if (pName.equalsIgnoreCase("AllowSiegeTeleport"))
6656+ {
6657+ ALLOW_SIEGE_TELEPORT = Boolean.valueOf(pValue);
6658+ }
6659+ else if (pName.equalsIgnoreCase("AllowClassMasters"))
6660+ {
6661+ ALLOW_CLASS_MASTERS = Boolean.valueOf(pValue);
6662+ }
6663+ else if (pName.equalsIgnoreCase("AllowEntireTree"))
6664+ {
6665+ ALLOW_ENTIRE_TREE = Boolean.valueOf(pValue);
6666+ }
6667+ else if (pName.equalsIgnoreCase("AlternateClassMaster"))
6668+ {
6669+ ALTERNATE_CLASS_MASTER = Boolean.valueOf(pValue);
6670+ }
6671+ else if (pName.equalsIgnoreCase("AltGameFreights"))
6672+ {
6673+ ALT_GAME_FREIGHTS = Boolean.valueOf(pValue);
6674+ }
6675+ else if (pName.equalsIgnoreCase("AltGameFreightPrice"))
6676+ {
6677+ ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue);
6678+ }
6679+ else if (pName.equalsIgnoreCase("AltPartyRange"))
6680+ {
6681+ ALT_PARTY_RANGE = Integer.parseInt(pValue);
6682+ }
6683+ else if (pName.equalsIgnoreCase("AltPartyRange2"))
6684+ {
6685+ ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
6686+ }
6687+ else if (pName.equalsIgnoreCase("CraftingEnabled"))
6688+ {
6689+ IS_CRAFTING_ENABLED = Boolean.valueOf(pValue);
6690+ }
6691+ else if (pName.equalsIgnoreCase("EnchantSkillSpBookNeeded"))
6692+ {
6693+ ES_SP_BOOK_NEEDED = Boolean.valueOf(pValue);
6694+ }
6695+ else if (pName.equalsIgnoreCase("AutoLoot"))
6696+ {
6697+ AUTO_LOOT = Boolean.valueOf(pValue);
6698+ }
6699+ else if (pName.equalsIgnoreCase("AutoLootRaids"))
6700+ {
6701+ AUTO_LOOT_RAIDS = Boolean.valueOf(pValue);
6702+ }
6703+ else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone"))
6704+ {
6705+ ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(pValue);
6706+ }
6707+ else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop"))
6708+ {
6709+ ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(pValue);
6710+ }
6711+ else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK"))
6712+ {
6713+ ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(pValue);
6714+ }
6715+ else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport"))
6716+ {
6717+ ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(pValue);
6718+ }
6719+ else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade"))
6720+ {
6721+ ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(pValue);
6722+ }
6723+ else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse"))
6724+ {
6725+ ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(pValue);
6726+ }
6727+ else if (pName.equalsIgnoreCase("AltRequireCastleForDawn"))
6728+ {
6729+ ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.valueOf(pValue);
6730+ }
6731+ else if (pName.equalsIgnoreCase("AltRequireClanCastle"))
6732+ {
6733+ ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.valueOf(pValue);
6734+ }
6735+ else if (pName.equalsIgnoreCase("AltFreeTeleporting"))
6736+ {
6737+ ALT_GAME_FREE_TELEPORT = Boolean.valueOf(pValue);
6738+ }
6739+ else if (pName.equalsIgnoreCase("AltMaxSubClasses"))
6740+ {
6741+ ALT_MAX_SUBCLASS = Integer.parseInt(pValue);
6742+ }
6743+ else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests"))
6744+ {
6745+ ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.valueOf(pValue);
6746+ }
6747+ else if (pName.equalsIgnoreCase("AltEnableTutorial"))
6748+ {
6749+ ALT_ENABLE_TUTORIAL = Boolean.valueOf(pValue);
6750+ }
6751+ else if (pName.equalsIgnoreCase("AltNewCharAlwaysIsNewbie"))
6752+ {
6753+ ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.valueOf(pValue);
6754+ }
6755+ else if (pName.equalsIgnoreCase("DwarfRecipeLimit"))
6756+ {
6757+ DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
6758+ }
6759+ else if (pName.equalsIgnoreCase("CommonRecipeLimit"))
6760+ {
6761+ COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
6762+ }
6763+ else if (pName.equalsIgnoreCase("ChampionEnable"))
6764+ {
6765+ CHAMPION_ENABLE = Boolean.valueOf(pValue);
6766+ }
6767+ else if (pName.equalsIgnoreCase("ChampionPassive"))
6768+ {
6769+ CHAMPION_PASSIVE = Boolean.valueOf(pValue);
6770+ }
6771+ else if (pName.equalsIgnoreCase("ChampionFrequency"))
6772+ {
6773+ CHAMPION_FREQUENCY = Integer.parseInt(pValue);
6774+ }
6775+ else if (pName.equalsIgnoreCase("ChampionTitle"))
6776+ {
6777+ CHAMPION_TITLE = pValue;
6778+ }
6779+ else if (pName.equalsIgnoreCase("ChampionMinLevel"))
6780+ {
6781+ CHAMP_MIN_LVL = Integer.parseInt(pValue);
6782+ }
6783+ else if (pName.equalsIgnoreCase("ChampionMaxLevel"))
6784+ {
6785+ CHAMP_MAX_LVL = Integer.parseInt(pValue);
6786+ }
6787+ else if (pName.equalsIgnoreCase("ChampionHp"))
6788+ {
6789+ CHAMPION_HP = Integer.parseInt(pValue);
6790+ }
6791+ else if (pName.equalsIgnoreCase("ChampionHpRegen"))
6792+ {
6793+ CHAMPION_HP_REGEN = Float.parseFloat(pValue);
6794+ }
6795+ else if (pName.equalsIgnoreCase("ChampionRewards"))
6796+ {
6797+ CHAMPION_REWARDS = Integer.parseInt(pValue);
6798+ }
6799+ else if (pName.equalsIgnoreCase("ChampionAdenasRewards"))
6800+ {
6801+ CHAMPION_ADENAS_REWARDS = Integer.parseInt(pValue);
6802+ }
6803+ else if (pName.equalsIgnoreCase("ChampionAtk"))
6804+ {
6805+ CHAMPION_ATK = Float.parseFloat(pValue);
6806+ }
6807+ else if (pName.equalsIgnoreCase("ChampionSpdAtk"))
6808+ {
6809+ CHAMPION_SPD_ATK = Float.parseFloat(pValue);
6810+ }
6811+ else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance"))
6812+ {
6813+ CHAMPION_REWARD_LOWER_CHANCE = Integer.parseInt(pValue);
6814+ }
6815+ else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance"))
6816+ {
6817+ CHAMPION_REWARD_HIGHER_CHANCE = Integer.parseInt(pValue);
6818+ }
6819+ else if (pName.equalsIgnoreCase("ChampionRewardItemID"))
6820+ {
6821+ CHAMPION_REWARD_ID = Integer.parseInt(pValue);
6822+ }
6823+ else if (pName.equalsIgnoreCase("ChampionRewardItemQty"))
6824+ {
6825+ CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
6826+ }
6827+ else if (pName.equalsIgnoreCase("MinKarma"))
6828+ {
6829+ KARMA_MIN_KARMA = Integer.parseInt(pValue);
6830+ }
6831+ else if (pName.equalsIgnoreCase("MaxKarma"))
6832+ {
6833+ KARMA_MAX_KARMA = Integer.parseInt(pValue);
6834+ }
6835+ else if (pName.equalsIgnoreCase("XPDivider"))
6836+ {
6837+ KARMA_XP_DIVIDER = Integer.parseInt(pValue);
6838+ }
6839+ else if (pName.equalsIgnoreCase("BaseKarmaLost"))
6840+ {
6841+ KARMA_LOST_BASE = Integer.parseInt(pValue);
6842+ }
6843+ else if (pName.equalsIgnoreCase("CanGMDropEquipment"))
6844+ {
6845+ KARMA_DROP_GM = Boolean.valueOf(pValue);
6846+ }
6847+ else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint"))
6848+ {
6849+ KARMA_AWARD_PK_KILL = Boolean.valueOf(pValue);
6850+ }
6851+ else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop"))
6852+ {
6853+ KARMA_PK_LIMIT = Integer.parseInt(pValue);
6854+ }
6855+ else if (pName.equalsIgnoreCase("PvPVsNormalTime"))
6856+ {
6857+ PVP_NORMAL_TIME = Integer.parseInt(pValue);
6858+ }
6859+ else if (pName.equalsIgnoreCase("PvPVsPvPTime"))
6860+ {
6861+ PVP_PVP_TIME = Integer.parseInt(pValue);
6862+ }
6863+ else if (pName.equalsIgnoreCase("GlobalChat"))
6864+ {
6865+ DEFAULT_GLOBAL_CHAT = pValue;
6866+ }
6867+ else if (pName.equalsIgnoreCase("TradeChat"))
6868+ {
6869+ DEFAULT_TRADE_CHAT = pValue;
6870+ }
6871+ else
6872+ {
6873+ return false;
6874+ }
6875+ return true;
6876+ }
6877+
6878+ /**
6879+ * Save hexadecimal ID of the server in the properties file.
6880+ * @param string (String) : hexadecimal ID of the server to store
6881+ * @see HEXID_FILE
6882+ * @see saveHexid(String string, String fileName)
6883+ * @link LoginServerThread
6884+ */
6885+ public static void saveHexid(String string)
6886+ {
6887+ saveHexid(string, HEXID_FILE);
6888+ }
6889+
6890+ /**
6891+ * Save hexadecimal ID of the server in the properties file.
6892+ * @param string (String) : hexadecimal ID of the server to store
6893+ * @param fileName (String) : name of the properties file
6894+ */
6895+ public static void saveHexid(String string, String fileName)
6896+ {
6897+ try
6898+ {
6899+ Properties hexSetting = new Properties();
6900+ File file = new File(fileName);
6901+ // Create a new empty file only if it doesn't exist
6902+ file.createNewFile();
6903+
6904+ try (OutputStream out = new FileOutputStream(file))
6905+ {
6906+ hexSetting.setProperty("HexID", string);
6907+ hexSetting.store(out, "the hexID to auth into login");
6908+ }
6909+ }
6910+ catch (Exception e)
6911+ {
6912+ _log.warning("Failed to save hex id to " + fileName + " File.");
6913+ e.printStackTrace();
6914+ }
6915+ }
6916+
6917+ /**
6918+ * Loads flood protector configurations.
6919+ */
6920+ private static void loadFloodProtectorConfigs(final Properties properties)
6921+ {
6922+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4");
6923+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
6924+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42");
6925+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16");
6926+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100");
6927+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", "5");
6928+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20");
6929+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10");
6930+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
6931+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1");
6932+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", "10");
6933+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANUFACTURE, "Manufacture", "3");
6934+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANOR, "Manor", "30");
6935+ loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_CHARACTER_SELECT, "CharacterSelect", "30");
6936+ }
6937+
6938+ /**
6939+ * Loads single flood protector configuration.
6940+ * @param properties Properties file reader
6941+ * @param config flood protector configuration instance
6942+ * @param configString flood protector configuration string that determines for which flood protector configuration should be read
6943+ * @param defaultInterval default flood protector interval
6944+ */
6945+ private static void loadFloodProtectorConfig(final Properties properties, final FloodProtectorConfig config, final String configString, final String defaultInterval)
6946+ {
6947+ config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval));
6948+ config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False"));
6949+ config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0"));
6950+ config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
6951+ config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0"));
6952+ }
6953+
6954+ public static class ClassMasterSettings
6955+ {
6956+ private final TIntObjectHashMap<TIntIntHashMap> _claimItems;
6957+ private final TIntObjectHashMap<TIntIntHashMap> _rewardItems;
6958+ private final TIntObjectHashMap<Boolean> _allowedClassChange;
6959+
6960+ public ClassMasterSettings(String _configLine)
6961+ {
6962+ _claimItems = new TIntObjectHashMap<>(3);
6963+ _rewardItems = new TIntObjectHashMap<>(3);
6964+ _allowedClassChange = new TIntObjectHashMap<>(3);
6965+ if (_configLine != null)
6966+ {
6967+ parseConfigLine(_configLine.trim());
6968+ }
6969+ }
6970+
6971+ private void parseConfigLine(String _configLine)
6972+ {
6973+ StringTokenizer st = new StringTokenizer(_configLine, ";");
6974+
6975+ while (st.hasMoreTokens())
6976+ {
6977+ // get allowed class change
6978+ int job = Integer.parseInt(st.nextToken());
6979+
6980+ _allowedClassChange.put(job, true);
6981+
6982+ TIntIntHashMap _items = new TIntIntHashMap();
6983+ // parse items needed for class change
6984+ if (st.hasMoreTokens())
6985+ {
6986+ StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
6987+
6988+ while (st2.hasMoreTokens())
6989+ {
6990+ StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
6991+ int _itemId = Integer.parseInt(st3.nextToken());
6992+ int _quantity = Integer.parseInt(st3.nextToken());
6993+ _items.put(_itemId, _quantity);
6994+ }
6995+ }
6996+
6997+ _claimItems.put(job, _items);
6998+
6999+ _items = new TIntIntHashMap();
7000+ // parse gifts after class change
7001+ if (st.hasMoreTokens())
7002+ {
7003+ StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");
7004+
7005+ while (st2.hasMoreTokens())
7006+ {
7007+ StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
7008+ int _itemId = Integer.parseInt(st3.nextToken());
7009+ int _quantity = Integer.parseInt(st3.nextToken());
7010+ _items.put(_itemId, _quantity);
7011+ }
7012+ }
7013+
7014+ _rewardItems.put(job, _items);
7015+ }
7016+ }
7017+
7018+ public boolean isAllowed(int job)
7019+ {
7020+ if (_allowedClassChange == null)
7021+ {
7022+ return false;
7023+ }
7024+
7025+ if (_allowedClassChange.containsKey(job))
7026+ {
7027+ return _allowedClassChange.get(job);
7028+ }
7029+
7030+ return false;
7031+ }
7032+
7033+ public TIntIntHashMap getRewardItems(int job)
7034+ {
7035+ if (_rewardItems.containsKey(job))
7036+ {
7037+ return _rewardItems.get(job);
7038+ }
7039+
7040+ return null;
7041+ }
7042+
7043+ public TIntIntHashMap getRequireItems(int job)
7044+ {
7045+ if (_claimItems.containsKey(job))
7046+ {
7047+ return _claimItems.get(job);
7048+ }
7049+
7050+ return null;
7051+ }
7052+ }
7053 }
7054\ No newline at end of file
7055Index: java/config/custom.properties
7056===================================================================
7057--- java/config/custom.properties (revision 575)
7058+++ java/config/custom.properties (working copy)
7059@@ -245,4 +245,7 @@
7060 OfflineSetNameColor = False
7061
7062 # Color of the name in offline mode (if OfflineSetNameColor = True)
7063-OfflineNameColor = 808080
7064\ No newline at end of file
7065+OfflineNameColor = 808080
7066+
7067+# Enchant after break with blessed scroll.
7068+BreakEnchant = 0
7069\ No newline at end of file