Basic data table cleanup.

This commit is contained in:
MobiusDevelopment
2021-05-16 12:01:19 +00:00
parent 84a67bc5a0
commit b513e66c88
58 changed files with 753 additions and 938 deletions

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -463,23 +463,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -520,6 +503,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -463,23 +463,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -520,6 +503,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -463,23 +463,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -520,6 +503,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -463,23 +463,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -520,6 +503,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -464,23 +464,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -521,6 +504,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -466,23 +466,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -523,6 +506,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -466,23 +466,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -523,6 +506,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -466,23 +466,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -523,6 +506,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -64,7 +64,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -478,23 +478,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -535,6 +518,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -64,7 +64,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -478,23 +478,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -535,6 +518,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -36,9 +36,7 @@ import org.l2jmobius.commons.util.PropertiesParser;
import org.l2jmobius.gameserver.cache.CrestCache; import org.l2jmobius.gameserver.cache.CrestCache;
import org.l2jmobius.gameserver.cache.HtmCache; import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager; import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.HeroSkillTable;
import org.l2jmobius.gameserver.data.ItemTable; import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.NobleSkillTable;
import org.l2jmobius.gameserver.data.SchemeBufferTable; import org.l2jmobius.gameserver.data.SchemeBufferTable;
import org.l2jmobius.gameserver.data.SkillTable; import org.l2jmobius.gameserver.data.SkillTable;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable; import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -224,8 +222,6 @@ public class GameServer
} }
SkillTreeTable.getInstance(); SkillTreeTable.getInstance();
SkillSpellbookTable.getInstance(); SkillSpellbookTable.getInstance();
NobleSkillTable.getInstance();
HeroSkillTable.getInstance();
if (!HelperBuffTable.getInstance().isInitialized()) if (!HelperBuffTable.getInstance().isInitialized())
{ {
throw new Exception("Could not initialize the Helper Buff Table."); throw new Exception("Could not initialize the Helper Buff Table.");

View File

@@ -16,100 +16,44 @@
*/ */
package org.l2jmobius.gameserver.data; package org.l2jmobius.gameserver.data;
import java.util.ArrayList; import java.util.Collection;
import java.util.List; import java.util.HashMap;
import java.util.Map;
/** /**
* This class has just one simple function to return the item id of a crown regarding to castleid * This class has just one simple function to return the item id of the crown related to a castle id.
* @author evill33t * @author Mobius
*/ */
public class CrownTable public class CrownTable
{ {
private static List<Integer> _crownList = new ArrayList<>(); public static final int CROWN_OF_THE_LORD = 6841;
public static List<Integer> getCrownList() private static final Map<Integer, Integer> CROWNS = new HashMap<>();
static
{ {
if (_crownList.isEmpty()) CROWNS.put(1, 6838); // Gludio
{ CROWNS.put(2, 6835); // Dion
_crownList.add(6841); // Crown of the lord CROWNS.put(3, 6839); // Giran
_crownList.add(6834); // Innadril CROWNS.put(4, 6837); // Oren
_crownList.add(6835); // Dion CROWNS.put(5, 6840); // Aden
_crownList.add(6836); // Goddard CROWNS.put(6, 6834); // Innadril
_crownList.add(6837); // Oren CROWNS.put(7, 6836); // Goddard
_crownList.add(6838); // Gludio CROWNS.put(8, 8182); // Rune
_crownList.add(6839); // Giran CROWNS.put(9, 8183); // Schuttgart
_crownList.add(6840); // Aden
_crownList.add(8182); // Rune
_crownList.add(8183); // Schuttgart
} }
return _crownList;
public static Collection<Integer> getCrownList()
{
return CROWNS.values();
} }
public static int getCrownId(int castleId) public static int getCrownId(int castleId)
{ {
int crownId = 0; final Integer crownId = CROWNS.get(castleId);
switch (castleId) if (crownId != null)
{ {
// Gludio return crownId.intValue();
case 1:
{
crownId = 6838;
break;
} }
// Dion return 0;
case 2:
{
crownId = 6835;
break;
}
// Giran
case 3:
{
crownId = 6839;
break;
}
// Oren
case 4:
{
crownId = 6837;
break;
}
// Aden
case 5:
{
crownId = 6840;
break;
}
// Innadril
case 6:
{
crownId = 6834;
break;
}
// Goddard
case 7:
{
crownId = 6836;
break;
}
// Rune
case 8:
{
crownId = 8182;
break;
}
// Schuttgart
case 9:
{
crownId = 8183;
break;
}
default:
{
crownId = 0;
break;
}
}
return crownId;
} }
} }

View File

@@ -22,10 +22,6 @@ import java.util.Map;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
/**
* @version $Revision$ $Date$
*/
public class DesireTable public class DesireTable
{ {
public static final DesireType[] DEFAULT_DESIRES = public static final DesireType[] DEFAULT_DESIRES =
@@ -44,69 +40,6 @@ public class DesireTable
DAMAGE DAMAGE
} }
class DesireValue
{
private float _value;
DesireValue()
{
this(0f);
}
DesireValue(Float pValue)
{
_value = pValue;
}
public void addValue(float pValue)
{
_value += pValue;
}
public float getValue()
{
return _value;
}
}
class Desires
{
private final Map<DesireType, DesireValue> _desireTable;
public Desires(DesireType... desireList)
{
_desireTable = new EnumMap<>(DesireType.class);
for (DesireType desire : desireList)
{
_desireTable.put(desire, new DesireValue());
}
}
public DesireValue getDesireValue(DesireType type)
{
return _desireTable.get(type);
}
public void addValue(DesireType type, float value)
{
final DesireValue temp = getDesireValue(type);
if (temp != null)
{
temp.addValue(value);
}
}
public void createDesire(DesireType type)
{
_desireTable.put(type, new DesireValue());
}
public void deleteDesire(DesireType type)
{
_desireTable.remove(type);
}
}
private final Map<WorldObject, Desires> _objectDesireTable; private final Map<WorldObject, Desires> _objectDesireTable;
private final Desires _generalDesires; private final Desires _generalDesires;
private final DesireType[] _desireTypes; private final DesireType[] _desireTypes;
@@ -190,4 +123,67 @@ public class DesireTable
_objectDesireTable.put(object, new Desires(desireList)); _objectDesireTable.put(object, new Desires(desireList));
} }
} }
private class DesireValue
{
private float _value;
DesireValue()
{
this(0f);
}
DesireValue(Float pValue)
{
_value = pValue;
}
public void addValue(float pValue)
{
_value += pValue;
}
public float getValue()
{
return _value;
}
}
private class Desires
{
private final Map<DesireType, DesireValue> _desireTable;
public Desires(DesireType... desireList)
{
_desireTable = new EnumMap<>(DesireType.class);
for (DesireType desire : desireList)
{
_desireTable.put(desire, new DesireValue());
}
}
public DesireValue getDesireValue(DesireType type)
{
return _desireTable.get(type);
}
public void addValue(DesireType type, float value)
{
final DesireValue temp = getDesireValue(type);
if (temp != null)
{
temp.addValue(value);
}
}
public void createDesire(DesireType type)
{
_desireTable.put(type, new DesireValue());
}
public void deleteDesire(DesireType type)
{
_desireTable.remove(type);
}
}
} }

View File

@@ -16,57 +16,34 @@
*/ */
package org.l2jmobius.gameserver.data; package org.l2jmobius.gameserver.data;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.model.Skill; import org.l2jmobius.gameserver.model.Skill;
/** /**
* @author BiTi * @author Mobius
*/ */
public class HeroSkillTable public class HeroSkillTable
{ {
private static final Integer[] HERO_SKILL_IDS = new Integer[] private static final Map<Integer, Skill> HERO_SKILLS = new HashMap<>();
static
{ {
395, HERO_SKILLS.put(395, SkillTable.getInstance().getSkill(395, 1));
396, HERO_SKILLS.put(396, SkillTable.getInstance().getSkill(396, 1));
1374, HERO_SKILLS.put(1374, SkillTable.getInstance().getSkill(1374, 1));
1375, HERO_SKILLS.put(1375, SkillTable.getInstance().getSkill(1375, 1));
1376 HERO_SKILLS.put(1376, SkillTable.getInstance().getSkill(1376, 1));
};
private static Skill[] HERO_SKILLS;
protected HeroSkillTable()
{
HERO_SKILLS = new Skill[5];
HERO_SKILLS[0] = SkillTable.getInstance().getSkill(395, 1);
HERO_SKILLS[1] = SkillTable.getInstance().getSkill(396, 1);
HERO_SKILLS[2] = SkillTable.getInstance().getSkill(1374, 1);
HERO_SKILLS[3] = SkillTable.getInstance().getSkill(1375, 1);
HERO_SKILLS[4] = SkillTable.getInstance().getSkill(1376, 1);
} }
public static Skill[] getHeroSkills() public static Collection<Skill> getHeroSkills()
{ {
return HERO_SKILLS; return HERO_SKILLS.values();
} }
public static boolean isHeroSkill(int skillId) public static boolean isHeroSkill(int skillId)
{ {
for (int id : HERO_SKILL_IDS) return HERO_SKILLS.containsKey(skillId);
{
if (id == skillId)
{
return true;
}
}
return false;
}
public static HeroSkillTable getInstance()
{
return SingletonHolder.INSTANCE;
}
private static class SingletonHolder
{
protected static final HeroSkillTable INSTANCE = new HeroSkillTable();
} }
} }

View File

@@ -49,12 +49,12 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance.ItemLocation;
import org.l2jmobius.gameserver.util.DocumentItem; import org.l2jmobius.gameserver.util.DocumentItem;
/** /**
* @version $Revision: 1.9.2.6.2.9 $ $Date: 2005/04/02 15:57:34 $ * This class serves as a container for all item templates in the game.
*/ */
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static final Logger _logItems = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems; private final Map<Integer, EtcItem> _etcItems;
@@ -189,12 +189,10 @@ public class ItemTable
} }
/** /**
* Create the ItemInstance corresponding to the Item Identifier and quantitiy add logs the activity.<br> * Create the ItemInstance corresponding to the Item Identifier and quantitiy add logs the activity. <b><u>Actions</u>:</b>
* <br>
* <b><u>Actions</u>:</b><br>
* <li>Create and Init the ItemInstance corresponding to the Item Identifier and quantity</li> * <li>Create and Init the ItemInstance corresponding to the Item Identifier and quantity</li>
* <li>Add the ItemInstance object to _allObjects of L2world</li> * <li>Add the ItemInstance object to _allObjects of L2world</li>
* <li>Logs Item creation according to LOGGER settings</li><br> * <li>Logs Item creation according to log settings</li><br>
* @param process : String Identifier of process triggering this action * @param process : String Identifier of process triggering this action
* @param itemId : int Item Identifier of the item to be created * @param itemId : int Item Identifier of the item to be created
* @param count : int Quantity of items to be created for stackable items * @param count : int Quantity of items to be created for stackable items
@@ -231,7 +229,7 @@ public class ItemTable
item.setOwnerId(actor.getObjectId()); item.setOwnerId(actor.getObjectId());
delay = 15000; delay = 15000;
} }
itemLootShedule = ThreadPool.schedule(new resetOwner(item), delay); itemLootShedule = ThreadPool.schedule(new ResetOwner(item), delay);
item.setItemLootShedule(itemLootShedule); item.setItemLootShedule(itemLootShedule);
} }
@@ -254,7 +252,7 @@ public class ItemTable
actor, actor,
reference reference
}); });
_logItems.log(record); LOGGER_ITEMS.log(record);
} }
return item; return item;
} }
@@ -301,14 +299,16 @@ public class ItemTable
/** /**
* Destroys the ItemInstance.<br> * Destroys the ItemInstance.<br>
* <br> * <br>
* <b><u>Actions</u>:</b><br> * <b><u>Actions</u>:</b>
* <ul>
* <li>Sets ItemInstance parameters to be unusable</li> * <li>Sets ItemInstance parameters to be unusable</li>
* <li>Removes the ItemInstance object to _allObjects of L2world</li> * <li>Removes the ItemInstance object to _allObjects of L2world</li>
* <li>Logs Item delettion according to LOGGER settings</li><br> * <li>Logs Item deletion according to log settings</li>
* @param process : String Identifier of process triggering this action * </ul>
* @param item * @param process a string identifier of process triggering this action.
* @param actor : PlayerInstance Player requesting the item destroy * @param item the item instance to be destroyed.
* @param reference : WorldObject Object referencing current action like NPC selling item or previous item in transformation * @param actor the player requesting the item destroy.
* @param reference the object referencing current action like NPC selling item or previous item in transformation.
*/ */
public void destroyItem(String process, ItemInstance item, PlayerInstance actor, WorldObject reference) public void destroyItem(String process, ItemInstance item, PlayerInstance actor, WorldObject reference)
{ {
@@ -345,23 +345,6 @@ public class ItemTable
load(); load();
} }
protected class resetOwner implements Runnable
{
ItemInstance _item;
public resetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -377,10 +360,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
/** protected static class ResetOwner implements Runnable
* Returns instance of ItemTable {
* @return ItemTable ItemInstance _item;
*/
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -28,11 +28,11 @@ import org.l2jmobius.gameserver.model.actor.instance.ControllableMobInstance;
*/ */
public class MobGroupTable public class MobGroupTable
{ {
private final Map<Integer, MobGroup> _groupMap;
public static final int FOLLOW_RANGE = 300; public static final int FOLLOW_RANGE = 300;
public static final int RANDOM_RANGE = 300; public static final int RANDOM_RANGE = 300;
private final Map<Integer, MobGroup> _groupMap;
protected MobGroupTable() protected MobGroupTable()
{ {
_groupMap = new HashMap<>(); _groupMap = new HashMap<>();

View File

@@ -23,33 +23,20 @@ import org.l2jmobius.gameserver.model.Skill;
*/ */
public class NobleSkillTable public class NobleSkillTable
{ {
private static Skill[] _nobleSkills; private static final Skill[] NOBLE_SKILLS = new Skill[]
protected NobleSkillTable()
{ {
_nobleSkills = new Skill[8]; SkillTable.getInstance().getSkill(1323, 1),
_nobleSkills[0] = SkillTable.getInstance().getSkill(1323, 1); SkillTable.getInstance().getSkill(325, 1),
_nobleSkills[1] = SkillTable.getInstance().getSkill(325, 1); SkillTable.getInstance().getSkill(326, 1),
_nobleSkills[2] = SkillTable.getInstance().getSkill(326, 1); SkillTable.getInstance().getSkill(327, 1),
_nobleSkills[3] = SkillTable.getInstance().getSkill(327, 1); SkillTable.getInstance().getSkill(1324, 1),
_nobleSkills[4] = SkillTable.getInstance().getSkill(1324, 1); SkillTable.getInstance().getSkill(1325, 1),
_nobleSkills[5] = SkillTable.getInstance().getSkill(1325, 1); SkillTable.getInstance().getSkill(1326, 1),
_nobleSkills[6] = SkillTable.getInstance().getSkill(1326, 1); SkillTable.getInstance().getSkill(1327, 1)
_nobleSkills[7] = SkillTable.getInstance().getSkill(1327, 1); };
}
public Skill[] GetNobleSkills() public static Skill[] getNobleSkills()
{ {
return _nobleSkills; return NOBLE_SKILLS;
}
public static NobleSkillTable getInstance()
{
return SingletonHolder.INSTANCE;
}
private static class SingletonHolder
{
protected static final NobleSkillTable INSTANCE = new NobleSkillTable();
} }
} }

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -32,6 +32,21 @@ public class SkillTable
{ {
protected static final Logger LOGGER = Logger.getLogger(SkillTable.class.getName()); protected static final Logger LOGGER = Logger.getLogger(SkillTable.class.getName());
private static final WeaponType[] WEAPON_MASKS =
{
WeaponType.ETC,
WeaponType.BOW,
WeaponType.POLE,
WeaponType.DUALFIST,
WeaponType.DUAL,
WeaponType.BLUNT,
WeaponType.SWORD,
WeaponType.DAGGER,
WeaponType.BIGSWORD,
WeaponType.ROD,
WeaponType.BIGBLUNT
};
private final List<File> _skillFiles = new ArrayList<>(); private final List<File> _skillFiles = new ArrayList<>();
private final Map<Integer, Skill> _skills = new HashMap<>(); private final Map<Integer, Skill> _skills = new HashMap<>();
private final boolean _initialized = true; private final boolean _initialized = true;
@@ -39,7 +54,6 @@ public class SkillTable
protected SkillTable() protected SkillTable()
{ {
hashFiles("data/stats/skills", _skillFiles); hashFiles("data/stats/skills", _skillFiles);
reload(); reload();
} }
@@ -51,6 +65,7 @@ public class SkillTable
LOGGER.info("Dir " + dir.getAbsolutePath() + " not exists"); LOGGER.info("Dir " + dir.getAbsolutePath() + " not exists");
return; return;
} }
final File[] files = dir.listFiles(); final File[] files = dir.listFiles();
for (File f : files) for (File f : files)
{ {
@@ -59,6 +74,7 @@ public class SkillTable
hash.add(f); hash.add(f);
} }
} }
final File customfile = new File(Config.DATAPACK_ROOT, dirname + "/custom.xml"); final File customfile = new File(Config.DATAPACK_ROOT, dirname + "/custom.xml");
if (customfile.exists()) if (customfile.exists())
{ {
@@ -73,6 +89,7 @@ public class SkillTable
LOGGER.warning("Skill file not found."); LOGGER.warning("Skill file not found.");
return null; return null;
} }
final DocumentSkill doc = new DocumentSkill(file); final DocumentSkill doc = new DocumentSkill(file);
doc.parse(); doc.parse();
return doc.getSkills(); return doc.getSkills();
@@ -88,6 +105,7 @@ public class SkillTable
{ {
continue; continue;
} }
for (Skill skill : s) for (Skill skill : s)
{ {
allSkills.put(SkillTable.getSkillHashCode(skill), skill); allSkills.put(SkillTable.getSkillHashCode(skill), skill);
@@ -150,21 +168,6 @@ public class SkillTable
return result; return result;
} }
private static final WeaponType[] weaponDbMasks =
{
WeaponType.ETC,
WeaponType.BOW,
WeaponType.POLE,
WeaponType.DUALFIST,
WeaponType.DUAL,
WeaponType.BLUNT,
WeaponType.SWORD,
WeaponType.DAGGER,
WeaponType.BIGSWORD,
WeaponType.ROD,
WeaponType.BIGBLUNT
};
public int calcWeaponsAllowed(int mask) public int calcWeaponsAllowed(int mask)
{ {
if (mask == 0) if (mask == 0)
@@ -173,11 +176,11 @@ public class SkillTable
} }
int weaponsAllowed = 0; int weaponsAllowed = 0;
for (int i = 0; i < weaponDbMasks.length; i++) for (int i = 0; i < WEAPON_MASKS.length; i++)
{ {
if ((mask & (1 << i)) != 0) if ((mask & (1 << i)) != 0)
{ {
weaponsAllowed |= weaponDbMasks[i].mask(); weaponsAllowed |= WEAPON_MASKS[i].mask();
} }
} }

View File

@@ -24,6 +24,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.gameserver.data.CrownTable;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.clan.Clan;
@@ -313,14 +314,14 @@ public class CastleManager
{ {
if (player.isClanLeader()) if (player.isClanLeader())
{ {
final ItemInstance crown = player.getInventory().getItemByItemId(6841); final ItemInstance crown = player.getInventory().getItemByItemId(CrownTable.CROWN_OF_THE_LORD);
if (crown != null) if (crown != null)
{ {
if (crown.isEquipped()) if (crown.isEquipped())
{ {
player.getInventory().unEquipItemInSlotAndRecord(crown.getEquipSlot()); player.getInventory().unEquipItemInSlotAndRecord(crown.getEquipSlot());
} }
player.destroyItemByItemId("CastleCrownRemoval", 6841, 1, player, true); player.destroyItemByItemId("CastleCrownRemoval", CrownTable.CROWN_OF_THE_LORD, 1, player, true);
} }
} }
@@ -345,7 +346,7 @@ public class CastleManager
{ {
statement = con.prepareStatement("DELETE FROM items WHERE owner_id = ? and item_id = ?"); statement = con.prepareStatement("DELETE FROM items WHERE owner_id = ? and item_id = ?");
statement.setInt(1, member.getObjectId()); statement.setInt(1, member.getObjectId());
statement.setInt(2, 6841); statement.setInt(2, CrownTable.CROWN_OF_THE_LORD);
statement.execute(); statement.execute();
statement.close(); statement.close();

View File

@@ -85,9 +85,9 @@ public class CrownManager
if (crownId > 0) if (crownId > 0)
{ {
if (isLeader && (player.getInventory().getItemByItemId(6841) == null)) if (isLeader && (player.getInventory().getItemByItemId(CrownTable.CROWN_OF_THE_LORD) == null))
{ {
player.addItem("Crown", 6841, 1, player, true); player.addItem("Crown", CrownTable.CROWN_OF_THE_LORD, 1, player, true);
player.getInventory().updateDatabase(); player.getInventory().updateDatabase();
} }
@@ -114,7 +114,7 @@ public class CrownManager
continue; continue;
} }
} }
else if ((item.getItemId() == 6841) && isLeader && !alreadyFoundCrown) else if ((item.getItemId() == CrownTable.CROWN_OF_THE_LORD) && isLeader && !alreadyFoundCrown)
{ {
alreadyFoundCrown = true; alreadyFoundCrown = true;
continue; continue;

View File

@@ -11536,14 +11536,14 @@ public class PlayerInstance extends Playable
{ {
if (value) if (value)
{ {
for (Skill s : NobleSkillTable.getInstance().GetNobleSkills()) for (Skill s : NobleSkillTable.getNobleSkills())
{ {
addSkill(s, false); // Dont Save Noble skills to Sql addSkill(s, false); // Dont Save Noble skills to Sql
} }
} }
else else
{ {
for (Skill s : NobleSkillTable.getInstance().GetNobleSkills()) for (Skill s : NobleSkillTable.getNobleSkills())
{ {
super.removeSkill(s); // Just Remove skills without deleting from Sql super.removeSkill(s); // Just Remove skills without deleting from Sql
} }

View File

@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.CrownTable;
import org.l2jmobius.gameserver.data.SkillTable; import org.l2jmobius.gameserver.data.SkillTable;
import org.l2jmobius.gameserver.handler.IItemHandler; import org.l2jmobius.gameserver.handler.IItemHandler;
import org.l2jmobius.gameserver.handler.ItemHandler; import org.l2jmobius.gameserver.handler.ItemHandler;
@@ -231,7 +232,7 @@ public class UseItem implements IClientIncomingPacket
} }
// The Lord's Crown used by castle lords only // The Lord's Crown used by castle lords only
if ((itemId == 6841) && Config.CASTLE_CROWN && ((cl == null) || (cl.getCastleId() == 0) || !player.isClanLeader()) && !player.isGM()) if ((itemId == CrownTable.CROWN_OF_THE_LORD) && Config.CASTLE_CROWN && ((cl == null) || (cl.getCastleId() == 0) || !player.isClanLeader()) && !player.isGM())
{ {
player.sendMessage("You can't equip that."); player.sendMessage("You can't equip that.");
return; return;

View File

@@ -36,9 +36,7 @@ import org.l2jmobius.commons.util.PropertiesParser;
import org.l2jmobius.gameserver.cache.CrestCache; import org.l2jmobius.gameserver.cache.CrestCache;
import org.l2jmobius.gameserver.cache.HtmCache; import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager; import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.HeroSkillTable;
import org.l2jmobius.gameserver.data.ItemTable; import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.NobleSkillTable;
import org.l2jmobius.gameserver.data.SchemeBufferTable; import org.l2jmobius.gameserver.data.SchemeBufferTable;
import org.l2jmobius.gameserver.data.SkillTable; import org.l2jmobius.gameserver.data.SkillTable;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable; import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -229,8 +227,6 @@ public class GameServer
} }
SkillTreeTable.getInstance(); SkillTreeTable.getInstance();
SkillSpellbookTable.getInstance(); SkillSpellbookTable.getInstance();
NobleSkillTable.getInstance();
HeroSkillTable.getInstance();
if (!HelperBuffTable.getInstance().isInitialized()) if (!HelperBuffTable.getInstance().isInitialized())
{ {
throw new Exception("Could not initialize the Helper Buff Table."); throw new Exception("Could not initialize the Helper Buff Table.");

View File

@@ -16,100 +16,44 @@
*/ */
package org.l2jmobius.gameserver.data; package org.l2jmobius.gameserver.data;
import java.util.ArrayList; import java.util.Collection;
import java.util.List; import java.util.HashMap;
import java.util.Map;
/** /**
* This class has just one simple function to return the item id of a crown regarding to castleid * This class has just one simple function to return the item id of the crown related to a castle id.
* @author evill33t * @author Mobius
*/ */
public class CrownTable public class CrownTable
{ {
private static List<Integer> _crownList = new ArrayList<>(); public static final int CROWN_OF_THE_LORD = 6841;
public static List<Integer> getCrownList() private static final Map<Integer, Integer> CROWNS = new HashMap<>();
static
{ {
if (_crownList.isEmpty()) CROWNS.put(1, 6838); // Gludio
{ CROWNS.put(2, 6835); // Dion
_crownList.add(6841); // Crown of the lord CROWNS.put(3, 6839); // Giran
_crownList.add(6834); // Innadril CROWNS.put(4, 6837); // Oren
_crownList.add(6835); // Dion CROWNS.put(5, 6840); // Aden
_crownList.add(6836); // Goddard CROWNS.put(6, 6834); // Innadril
_crownList.add(6837); // Oren CROWNS.put(7, 6836); // Goddard
_crownList.add(6838); // Gludio CROWNS.put(8, 8182); // Rune
_crownList.add(6839); // Giran CROWNS.put(9, 8183); // Schuttgart
_crownList.add(6840); // Aden
_crownList.add(8182); // Rune
_crownList.add(8183); // Schuttgart
} }
return _crownList;
public static Collection<Integer> getCrownList()
{
return CROWNS.values();
} }
public static int getCrownId(int castleId) public static int getCrownId(int castleId)
{ {
int crownId = 0; final Integer crownId = CROWNS.get(castleId);
switch (castleId) if (crownId != null)
{ {
// Gludio return crownId.intValue();
case 1:
{
crownId = 6838;
break;
} }
// Dion return 0;
case 2:
{
crownId = 6835;
break;
}
// Giran
case 3:
{
crownId = 6839;
break;
}
// Oren
case 4:
{
crownId = 6837;
break;
}
// Aden
case 5:
{
crownId = 6840;
break;
}
// Innadril
case 6:
{
crownId = 6834;
break;
}
// Goddard
case 7:
{
crownId = 6836;
break;
}
// Rune
case 8:
{
crownId = 8182;
break;
}
// Schuttgart
case 9:
{
crownId = 8183;
break;
}
default:
{
crownId = 0;
break;
}
}
return crownId;
} }
} }

View File

@@ -22,10 +22,6 @@ import java.util.Map;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
/**
* @version $Revision$ $Date$
*/
public class DesireTable public class DesireTable
{ {
public static final DesireType[] DEFAULT_DESIRES = public static final DesireType[] DEFAULT_DESIRES =
@@ -44,69 +40,6 @@ public class DesireTable
DAMAGE DAMAGE
} }
class DesireValue
{
private float _value;
DesireValue()
{
this(0f);
}
DesireValue(Float pValue)
{
_value = pValue;
}
public void addValue(float pValue)
{
_value += pValue;
}
public float getValue()
{
return _value;
}
}
class Desires
{
private final Map<DesireType, DesireValue> _desireTable;
public Desires(DesireType... desireList)
{
_desireTable = new EnumMap<>(DesireType.class);
for (DesireType desire : desireList)
{
_desireTable.put(desire, new DesireValue());
}
}
public DesireValue getDesireValue(DesireType type)
{
return _desireTable.get(type);
}
public void addValue(DesireType type, float value)
{
final DesireValue temp = getDesireValue(type);
if (temp != null)
{
temp.addValue(value);
}
}
public void createDesire(DesireType type)
{
_desireTable.put(type, new DesireValue());
}
public void deleteDesire(DesireType type)
{
_desireTable.remove(type);
}
}
private final Map<WorldObject, Desires> _objectDesireTable; private final Map<WorldObject, Desires> _objectDesireTable;
private final Desires _generalDesires; private final Desires _generalDesires;
private final DesireType[] _desireTypes; private final DesireType[] _desireTypes;
@@ -190,4 +123,67 @@ public class DesireTable
_objectDesireTable.put(object, new Desires(desireList)); _objectDesireTable.put(object, new Desires(desireList));
} }
} }
private class DesireValue
{
private float _value;
DesireValue()
{
this(0f);
}
DesireValue(Float pValue)
{
_value = pValue;
}
public void addValue(float pValue)
{
_value += pValue;
}
public float getValue()
{
return _value;
}
}
private class Desires
{
private final Map<DesireType, DesireValue> _desireTable;
public Desires(DesireType... desireList)
{
_desireTable = new EnumMap<>(DesireType.class);
for (DesireType desire : desireList)
{
_desireTable.put(desire, new DesireValue());
}
}
public DesireValue getDesireValue(DesireType type)
{
return _desireTable.get(type);
}
public void addValue(DesireType type, float value)
{
final DesireValue temp = getDesireValue(type);
if (temp != null)
{
temp.addValue(value);
}
}
public void createDesire(DesireType type)
{
_desireTable.put(type, new DesireValue());
}
public void deleteDesire(DesireType type)
{
_desireTable.remove(type);
}
}
} }

View File

@@ -16,57 +16,34 @@
*/ */
package org.l2jmobius.gameserver.data; package org.l2jmobius.gameserver.data;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.model.Skill; import org.l2jmobius.gameserver.model.Skill;
/** /**
* @author BiTi * @author Mobius
*/ */
public class HeroSkillTable public class HeroSkillTable
{ {
private static final Integer[] HERO_SKILL_IDS = new Integer[] private static final Map<Integer, Skill> HERO_SKILLS = new HashMap<>();
static
{ {
395, HERO_SKILLS.put(395, SkillTable.getInstance().getSkill(395, 1));
396, HERO_SKILLS.put(396, SkillTable.getInstance().getSkill(396, 1));
1374, HERO_SKILLS.put(1374, SkillTable.getInstance().getSkill(1374, 1));
1375, HERO_SKILLS.put(1375, SkillTable.getInstance().getSkill(1375, 1));
1376 HERO_SKILLS.put(1376, SkillTable.getInstance().getSkill(1376, 1));
};
private static Skill[] HERO_SKILLS;
protected HeroSkillTable()
{
HERO_SKILLS = new Skill[5];
HERO_SKILLS[0] = SkillTable.getInstance().getSkill(395, 1);
HERO_SKILLS[1] = SkillTable.getInstance().getSkill(396, 1);
HERO_SKILLS[2] = SkillTable.getInstance().getSkill(1374, 1);
HERO_SKILLS[3] = SkillTable.getInstance().getSkill(1375, 1);
HERO_SKILLS[4] = SkillTable.getInstance().getSkill(1376, 1);
} }
public static Skill[] getHeroSkills() public static Collection<Skill> getHeroSkills()
{ {
return HERO_SKILLS; return HERO_SKILLS.values();
} }
public static boolean isHeroSkill(int skillId) public static boolean isHeroSkill(int skillId)
{ {
for (int id : HERO_SKILL_IDS) return HERO_SKILLS.containsKey(skillId);
{
if (id == skillId)
{
return true;
}
}
return false;
}
public static HeroSkillTable getInstance()
{
return SingletonHolder.INSTANCE;
}
private static class SingletonHolder
{
protected static final HeroSkillTable INSTANCE = new HeroSkillTable();
} }
} }

View File

@@ -49,12 +49,12 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance.ItemLocation;
import org.l2jmobius.gameserver.util.DocumentItem; import org.l2jmobius.gameserver.util.DocumentItem;
/** /**
* @version $Revision: 1.9.2.6.2.9 $ $Date: 2005/04/02 15:57:34 $ * This class serves as a container for all item templates in the game.
*/ */
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static final Logger _logItems = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems; private final Map<Integer, EtcItem> _etcItems;
@@ -189,12 +189,10 @@ public class ItemTable
} }
/** /**
* Create the ItemInstance corresponding to the Item Identifier and quantitiy add logs the activity.<br> * Create the ItemInstance corresponding to the Item Identifier and quantitiy add logs the activity. <b><u>Actions</u>:</b>
* <br>
* <b><u>Actions</u>:</b><br>
* <li>Create and Init the ItemInstance corresponding to the Item Identifier and quantity</li> * <li>Create and Init the ItemInstance corresponding to the Item Identifier and quantity</li>
* <li>Add the ItemInstance object to _allObjects of L2world</li> * <li>Add the ItemInstance object to _allObjects of L2world</li>
* <li>Logs Item creation according to LOGGER settings</li><br> * <li>Logs Item creation according to log settings</li><br>
* @param process : String Identifier of process triggering this action * @param process : String Identifier of process triggering this action
* @param itemId : int Item Identifier of the item to be created * @param itemId : int Item Identifier of the item to be created
* @param count : int Quantity of items to be created for stackable items * @param count : int Quantity of items to be created for stackable items
@@ -231,7 +229,7 @@ public class ItemTable
item.setOwnerId(actor.getObjectId()); item.setOwnerId(actor.getObjectId());
delay = 15000; delay = 15000;
} }
itemLootShedule = ThreadPool.schedule(new resetOwner(item), delay); itemLootShedule = ThreadPool.schedule(new ResetOwner(item), delay);
item.setItemLootShedule(itemLootShedule); item.setItemLootShedule(itemLootShedule);
} }
@@ -254,7 +252,7 @@ public class ItemTable
actor, actor,
reference reference
}); });
_logItems.log(record); LOGGER_ITEMS.log(record);
} }
return item; return item;
} }
@@ -301,14 +299,16 @@ public class ItemTable
/** /**
* Destroys the ItemInstance.<br> * Destroys the ItemInstance.<br>
* <br> * <br>
* <b><u>Actions</u>:</b><br> * <b><u>Actions</u>:</b>
* <ul>
* <li>Sets ItemInstance parameters to be unusable</li> * <li>Sets ItemInstance parameters to be unusable</li>
* <li>Removes the ItemInstance object to _allObjects of L2world</li> * <li>Removes the ItemInstance object to _allObjects of L2world</li>
* <li>Logs Item delettion according to LOGGER settings</li><br> * <li>Logs Item deletion according to log settings</li>
* @param process : String Identifier of process triggering this action * </ul>
* @param item * @param process a string identifier of process triggering this action.
* @param actor : PlayerInstance Player requesting the item destroy * @param item the item instance to be destroyed.
* @param reference : WorldObject Object referencing current action like NPC selling item or previous item in transformation * @param actor the player requesting the item destroy.
* @param reference the object referencing current action like NPC selling item or previous item in transformation.
*/ */
public void destroyItem(String process, ItemInstance item, PlayerInstance actor, WorldObject reference) public void destroyItem(String process, ItemInstance item, PlayerInstance actor, WorldObject reference)
{ {
@@ -345,23 +345,6 @@ public class ItemTable
load(); load();
} }
protected class resetOwner implements Runnable
{
ItemInstance _item;
public resetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -377,10 +360,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
/** protected static class ResetOwner implements Runnable
* Returns instance of ItemTable {
* @return ItemTable ItemInstance _item;
*/
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -28,11 +28,11 @@ import org.l2jmobius.gameserver.model.actor.instance.ControllableMobInstance;
*/ */
public class MobGroupTable public class MobGroupTable
{ {
private final Map<Integer, MobGroup> _groupMap;
public static final int FOLLOW_RANGE = 300; public static final int FOLLOW_RANGE = 300;
public static final int RANDOM_RANGE = 300; public static final int RANDOM_RANGE = 300;
private final Map<Integer, MobGroup> _groupMap;
protected MobGroupTable() protected MobGroupTable()
{ {
_groupMap = new HashMap<>(); _groupMap = new HashMap<>();

View File

@@ -23,33 +23,20 @@ import org.l2jmobius.gameserver.model.Skill;
*/ */
public class NobleSkillTable public class NobleSkillTable
{ {
private static Skill[] _nobleSkills; private static final Skill[] NOBLE_SKILLS = new Skill[]
protected NobleSkillTable()
{ {
_nobleSkills = new Skill[8]; SkillTable.getInstance().getSkill(1323, 1),
_nobleSkills[0] = SkillTable.getInstance().getSkill(1323, 1); SkillTable.getInstance().getSkill(325, 1),
_nobleSkills[1] = SkillTable.getInstance().getSkill(325, 1); SkillTable.getInstance().getSkill(326, 1),
_nobleSkills[2] = SkillTable.getInstance().getSkill(326, 1); SkillTable.getInstance().getSkill(327, 1),
_nobleSkills[3] = SkillTable.getInstance().getSkill(327, 1); SkillTable.getInstance().getSkill(1324, 1),
_nobleSkills[4] = SkillTable.getInstance().getSkill(1324, 1); SkillTable.getInstance().getSkill(1325, 1),
_nobleSkills[5] = SkillTable.getInstance().getSkill(1325, 1); SkillTable.getInstance().getSkill(1326, 1),
_nobleSkills[6] = SkillTable.getInstance().getSkill(1326, 1); SkillTable.getInstance().getSkill(1327, 1)
_nobleSkills[7] = SkillTable.getInstance().getSkill(1327, 1); };
}
public Skill[] GetNobleSkills() public static Skill[] getNobleSkills()
{ {
return _nobleSkills; return NOBLE_SKILLS;
}
public static NobleSkillTable getInstance()
{
return SingletonHolder.INSTANCE;
}
private static class SingletonHolder
{
protected static final NobleSkillTable INSTANCE = new NobleSkillTable();
} }
} }

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -32,6 +32,21 @@ public class SkillTable
{ {
protected static final Logger LOGGER = Logger.getLogger(SkillTable.class.getName()); protected static final Logger LOGGER = Logger.getLogger(SkillTable.class.getName());
private static final WeaponType[] WEAPON_MASKS =
{
WeaponType.ETC,
WeaponType.BOW,
WeaponType.POLE,
WeaponType.DUALFIST,
WeaponType.DUAL,
WeaponType.BLUNT,
WeaponType.SWORD,
WeaponType.DAGGER,
WeaponType.BIGSWORD,
WeaponType.ROD,
WeaponType.BIGBLUNT
};
private final List<File> _skillFiles = new ArrayList<>(); private final List<File> _skillFiles = new ArrayList<>();
private final Map<Integer, Skill> _skills = new HashMap<>(); private final Map<Integer, Skill> _skills = new HashMap<>();
private final boolean _initialized = true; private final boolean _initialized = true;
@@ -39,7 +54,6 @@ public class SkillTable
protected SkillTable() protected SkillTable()
{ {
hashFiles("data/stats/skills", _skillFiles); hashFiles("data/stats/skills", _skillFiles);
reload(); reload();
} }
@@ -51,6 +65,7 @@ public class SkillTable
LOGGER.info("Dir " + dir.getAbsolutePath() + " not exists"); LOGGER.info("Dir " + dir.getAbsolutePath() + " not exists");
return; return;
} }
final File[] files = dir.listFiles(); final File[] files = dir.listFiles();
for (File f : files) for (File f : files)
{ {
@@ -59,6 +74,7 @@ public class SkillTable
hash.add(f); hash.add(f);
} }
} }
final File customfile = new File(Config.DATAPACK_ROOT, dirname + "/custom.xml"); final File customfile = new File(Config.DATAPACK_ROOT, dirname + "/custom.xml");
if (customfile.exists()) if (customfile.exists())
{ {
@@ -73,6 +89,7 @@ public class SkillTable
LOGGER.warning("Skill file not found."); LOGGER.warning("Skill file not found.");
return null; return null;
} }
final DocumentSkill doc = new DocumentSkill(file); final DocumentSkill doc = new DocumentSkill(file);
doc.parse(); doc.parse();
return doc.getSkills(); return doc.getSkills();
@@ -88,6 +105,7 @@ public class SkillTable
{ {
continue; continue;
} }
for (Skill skill : s) for (Skill skill : s)
{ {
allSkills.put(SkillTable.getSkillHashCode(skill), skill); allSkills.put(SkillTable.getSkillHashCode(skill), skill);
@@ -150,21 +168,6 @@ public class SkillTable
return result; return result;
} }
private static final WeaponType[] weaponDbMasks =
{
WeaponType.ETC,
WeaponType.BOW,
WeaponType.POLE,
WeaponType.DUALFIST,
WeaponType.DUAL,
WeaponType.BLUNT,
WeaponType.SWORD,
WeaponType.DAGGER,
WeaponType.BIGSWORD,
WeaponType.ROD,
WeaponType.BIGBLUNT
};
public int calcWeaponsAllowed(int mask) public int calcWeaponsAllowed(int mask)
{ {
if (mask == 0) if (mask == 0)
@@ -173,11 +176,11 @@ public class SkillTable
} }
int weaponsAllowed = 0; int weaponsAllowed = 0;
for (int i = 0; i < weaponDbMasks.length; i++) for (int i = 0; i < WEAPON_MASKS.length; i++)
{ {
if ((mask & (1 << i)) != 0) if ((mask & (1 << i)) != 0)
{ {
weaponsAllowed |= weaponDbMasks[i].mask(); weaponsAllowed |= WEAPON_MASKS[i].mask();
} }
} }

View File

@@ -24,6 +24,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.gameserver.data.CrownTable;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.clan.Clan;
@@ -313,14 +314,14 @@ public class CastleManager
{ {
if (player.isClanLeader()) if (player.isClanLeader())
{ {
final ItemInstance crown = player.getInventory().getItemByItemId(6841); final ItemInstance crown = player.getInventory().getItemByItemId(CrownTable.CROWN_OF_THE_LORD);
if (crown != null) if (crown != null)
{ {
if (crown.isEquipped()) if (crown.isEquipped())
{ {
player.getInventory().unEquipItemInSlotAndRecord(crown.getEquipSlot()); player.getInventory().unEquipItemInSlotAndRecord(crown.getEquipSlot());
} }
player.destroyItemByItemId("CastleCrownRemoval", 6841, 1, player, true); player.destroyItemByItemId("CastleCrownRemoval", CrownTable.CROWN_OF_THE_LORD, 1, player, true);
} }
} }
@@ -345,7 +346,7 @@ public class CastleManager
{ {
statement = con.prepareStatement("DELETE FROM items WHERE owner_id = ? and item_id = ?"); statement = con.prepareStatement("DELETE FROM items WHERE owner_id = ? and item_id = ?");
statement.setInt(1, member.getObjectId()); statement.setInt(1, member.getObjectId());
statement.setInt(2, 6841); statement.setInt(2, CrownTable.CROWN_OF_THE_LORD);
statement.execute(); statement.execute();
statement.close(); statement.close();

View File

@@ -85,9 +85,9 @@ public class CrownManager
if (crownId > 0) if (crownId > 0)
{ {
if (isLeader && (player.getInventory().getItemByItemId(6841) == null)) if (isLeader && (player.getInventory().getItemByItemId(CrownTable.CROWN_OF_THE_LORD) == null))
{ {
player.addItem("Crown", 6841, 1, player, true); player.addItem("Crown", CrownTable.CROWN_OF_THE_LORD, 1, player, true);
player.getInventory().updateDatabase(); player.getInventory().updateDatabase();
} }
@@ -114,7 +114,7 @@ public class CrownManager
continue; continue;
} }
} }
else if ((item.getItemId() == 6841) && isLeader && !alreadyFoundCrown) else if ((item.getItemId() == CrownTable.CROWN_OF_THE_LORD) && isLeader && !alreadyFoundCrown)
{ {
alreadyFoundCrown = true; alreadyFoundCrown = true;
continue; continue;

View File

@@ -11836,14 +11836,14 @@ public class PlayerInstance extends Playable
{ {
if (value) if (value)
{ {
for (Skill s : NobleSkillTable.getInstance().GetNobleSkills()) for (Skill s : NobleSkillTable.getNobleSkills())
{ {
addSkill(s, false); // Dont Save Noble skills to Sql addSkill(s, false); // Dont Save Noble skills to Sql
} }
} }
else else
{ {
for (Skill s : NobleSkillTable.getInstance().GetNobleSkills()) for (Skill s : NobleSkillTable.getNobleSkills())
{ {
super.removeSkill(s); // Just Remove skills without deleting from Sql super.removeSkill(s); // Just Remove skills without deleting from Sql
} }

View File

@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.CrownTable;
import org.l2jmobius.gameserver.data.SkillTable; import org.l2jmobius.gameserver.data.SkillTable;
import org.l2jmobius.gameserver.handler.IItemHandler; import org.l2jmobius.gameserver.handler.IItemHandler;
import org.l2jmobius.gameserver.handler.ItemHandler; import org.l2jmobius.gameserver.handler.ItemHandler;
@@ -232,7 +233,7 @@ public class UseItem implements IClientIncomingPacket
} }
// The Lord's Crown used by castle lords only // The Lord's Crown used by castle lords only
if ((itemId == 6841) && Config.CASTLE_CROWN && ((cl == null) || (cl.getCastleId() == 0) || !player.isClanLeader()) && !player.isGM()) if ((itemId == CrownTable.CROWN_OF_THE_LORD) && Config.CASTLE_CROWN && ((cl == null) || (cl.getCastleId() == 0) || !player.isClanLeader()) && !player.isGM())
{ {
player.sendMessage("You can't equip that."); player.sendMessage("You can't equip that.");
return; return;

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
public static final Map<String, Integer> SLOTS = new HashMap<>(); public static final Map<String, Integer> SLOTS = new HashMap<>();
static static
@@ -460,23 +460,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -497,6 +480,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
public static final Map<String, Integer> SLOTS = new HashMap<>(); public static final Map<String, Integer> SLOTS = new HashMap<>();
static static
@@ -460,23 +460,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -497,6 +480,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -463,23 +463,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -520,6 +503,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -463,23 +463,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -520,6 +503,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -464,23 +464,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -521,6 +504,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -466,23 +466,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -523,6 +506,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -466,23 +466,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -523,6 +506,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -466,23 +466,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -523,6 +506,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -61,7 +61,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -463,23 +463,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -520,6 +503,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -64,7 +64,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -478,23 +478,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -535,6 +518,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -64,7 +64,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
public class ItemTable public class ItemTable
{ {
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item"); private static final Logger LOGGER_ITEMS = Logger.getLogger("item");
private Item[] _allTemplates; private Item[] _allTemplates;
private final Map<Integer, EtcItem> _etcItems = new HashMap<>(); private final Map<Integer, EtcItem> _etcItems = new HashMap<>();
@@ -478,23 +478,6 @@ public class ItemTable
EnchantItemHPBonusData.getInstance().load(); EnchantItemHPBonusData.getInstance().load();
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public Set<Integer> getAllArmorsId() public Set<Integer> getAllArmorsId()
{ {
return _armors.keySet(); return _armors.keySet();
@@ -535,6 +518,23 @@ public class ItemTable
return _allTemplates.length; return _allTemplates.length;
} }
protected static class ResetOwner implements Runnable
{
ItemInstance _item;
public ResetOwner(ItemInstance item)
{
_item = item;
}
@Override
public void run()
{
_item.setOwnerId(0);
_item.setItemLootShedule(null);
}
}
public static ItemTable getInstance() public static ItemTable getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -229,6 +229,7 @@ public class SchemeBufferTable
return true; return true;
} }
} }
return false; return false;
} }