Proper clan specialty data holder.
This commit is contained in:
parent
b8cb4750b0
commit
a6388b2df9
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/ClanMasteryData.xsd">
|
||||
<clan mastery="50000" level="1" previous="0" />
|
||||
<clan mastery="50001" level="2" previous="50000" />
|
||||
</list>
|
24
L2J_Mobius_5.0_Salvation/dist/game/data/ClanSpecialtyData.xml
vendored
Normal file
24
L2J_Mobius_5.0_Salvation/dist/game/data/ClanSpecialtyData.xml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/ClanSpecialtyData.xsd">
|
||||
<clan specialty="1" skilId="1" skillLevel="1" clanLevel="5" />
|
||||
<clan specialty="2" skilId="1" skillLevel="1" clanLevel="6" previousSpecialty="1" />
|
||||
<clan specialty="3" skilId="1" skillLevel="1" clanLevel="7" previousSpecialty="2" />
|
||||
<clan specialty="4" skilId="1" skillLevel="1" clanLevel="8" previousSpecialty="3" />
|
||||
<clan specialty="5" skilId="1" skillLevel="1" clanLevel="9" previousSpecialty="4" />
|
||||
<clan specialty="6" skilId="1" skillLevel="1" clanLevel="10" previousSpecialty="5" />
|
||||
<clan specialty="7" skilId="1" skillLevel="1" clanLevel="10" previousSpecialty="6" />
|
||||
<clan specialty="8" skilId="1" skillLevel="1" clanLevel="8" previousSpecialty="3" />
|
||||
<clan specialty="9" skilId="1" skillLevel="1" clanLevel="9" previousSpecialty="8" />
|
||||
<clan specialty="10" skilId="1" skillLevel="1" clanLevel="10" previousSpecialty="9" />
|
||||
<clan specialty="11" skilId="1" skillLevel="1" clanLevel="10" previousSpecialty="10" />
|
||||
<clan specialty="12" skilId="1" skillLevel="1" clanLevel="11" previousSpecialty="7" previousSpecialtyAlt="11" />
|
||||
<clan specialty="13" skilId="1" skillLevel="1" clanLevel="11" previousSpecialty="12" />
|
||||
<clan specialty="14" skilId="1" skillLevel="1" clanLevel="12" previousSpecialty="12" />
|
||||
<clan specialty="15" skilId="1" skillLevel="1" clanLevel="13" previousSpecialty="14" />
|
||||
<clan specialty="16" skilId="1" skillLevel="1" clanLevel="13" previousSpecialty="15" />
|
||||
<clan specialty="17" skilId="1" skillLevel="1" clanLevel="12" previousSpecialty="12" />
|
||||
<clan specialty="18" skilId="1" skillLevel="1" clanLevel="13" previousSpecialty="17" />
|
||||
<clan specialty="19" skilId="1" skillLevel="1" clanLevel="13" previousSpecialty="18" />
|
||||
<clan specialty="20" skilId="1" skillLevel="1" clanLevel="14" previousSpecialty="15" previousSpecialtyAlt="18" />
|
||||
<clan specialty="21" skilId="1" skillLevel="1" clanLevel="15" previousSpecialty="20" />
|
||||
</list>
|
@ -6,9 +6,12 @@
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:int" name="mastery" use="required"/>
|
||||
<xs:attribute type="xs:int" name="level" use="required"/>
|
||||
<xs:attribute type="xs:int" name="previous" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="specialty" use="optional"/>
|
||||
<xs:attribute type="xs:short" name="skilId" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="skillLevel" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="clanLevel" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="previousSpecialty" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="previousSpecialtyAlt" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
@ -50,9 +50,9 @@ import com.l2jmobius.gameserver.data.xml.impl.BeautyShopData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.CategoryData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanMasteryData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanRewardData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanShopData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanSpecialtyData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClassListData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.CubicData;
|
||||
@ -307,7 +307,7 @@ public class GameServer
|
||||
ClanHallData.getInstance();
|
||||
ClanHallAuctionManager.getInstance();
|
||||
ClanEntryManager.getInstance();
|
||||
ClanMasteryData.getInstance();
|
||||
ClanSpecialtyData.getInstance();
|
||||
ClanShopData.getInstance();
|
||||
|
||||
printSection("Geodata");
|
||||
|
@ -25,19 +25,19 @@ import org.w3c.dom.Document;
|
||||
|
||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.holders.ClanMasteryHolder;
|
||||
import com.l2jmobius.gameserver.model.holders.ClanSpecialtyHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ClanMasteryData implements IGameXmlReader
|
||||
public class ClanSpecialtyData implements IGameXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(ClanMasteryData.class.getName());
|
||||
private static Logger LOGGER = Logger.getLogger(ClanSpecialtyData.class.getName());
|
||||
|
||||
private final List<ClanMasteryHolder> _clanMasteryData = new ArrayList<>();
|
||||
private final List<ClanSpecialtyHolder> _clanSpecialtyData = new ArrayList<>();
|
||||
|
||||
protected ClanMasteryData()
|
||||
protected ClanSpecialtyData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@ -45,10 +45,10 @@ public class ClanMasteryData implements IGameXmlReader
|
||||
@Override
|
||||
public void load()
|
||||
{
|
||||
_clanMasteryData.clear();
|
||||
_clanSpecialtyData.clear();
|
||||
|
||||
parseDatapackFile("data/ClanMasteryData.xml");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _clanMasteryData.size() + " clan masteries.");
|
||||
parseDatapackFile("data/ClanSpecialtyData.xml");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _clanSpecialtyData.size() + " clan specialties.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -57,34 +57,37 @@ public class ClanMasteryData implements IGameXmlReader
|
||||
forEach(doc, "list", listNode -> forEach(listNode, "clan", clanNode ->
|
||||
{
|
||||
final StatsSet set = new StatsSet(parseAttributes(clanNode));
|
||||
final int mastery = set.getInt("mastery");
|
||||
final int level = set.getInt("level");
|
||||
final int previous = set.getInt("previous");
|
||||
final int id = set.getInt("specialty");
|
||||
final int skillId = set.getInt("skilId");
|
||||
final int skillLevel = set.getInt("skillLevel");
|
||||
final int clanLevel = set.getInt("clanLevel");
|
||||
final int previousSpecialty = set.getInt("previousSpecialty");
|
||||
final int previousSpecialtyAlt = set.getInt("previousSpecialtyAlt");
|
||||
|
||||
final Skill skill = SkillData.getInstance().getSkill(mastery, level);
|
||||
final Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel);
|
||||
if (skill == null)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Could not create clan mastery, skill id " + mastery + " with level " + level + " does not exist.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Could not create clan specialty, skill id " + skillId + " with level " + skillLevel + " does not exist.");
|
||||
}
|
||||
else
|
||||
{
|
||||
_clanMasteryData.add(new ClanMasteryHolder(skill, previous));
|
||||
_clanSpecialtyData.add(new ClanSpecialtyHolder(id, skill, clanLevel, previousSpecialty, previousSpecialtyAlt));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public List<ClanMasteryHolder> getMasteries()
|
||||
public List<ClanSpecialtyHolder> getSpecialties()
|
||||
{
|
||||
return _clanMasteryData;
|
||||
return _clanSpecialtyData;
|
||||
}
|
||||
|
||||
public static ClanMasteryData getInstance()
|
||||
public static ClanSpecialtyData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final ClanMasteryData _instance = new ClanMasteryData();
|
||||
protected static final ClanSpecialtyData _instance = new ClanSpecialtyData();
|
||||
}
|
||||
}
|
@ -21,15 +21,26 @@ import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ClanMasteryHolder
|
||||
public class ClanSpecialtyHolder
|
||||
{
|
||||
private final int _id;
|
||||
private final Skill _skill;
|
||||
private final int _previousSkillId;
|
||||
private final int _clanLevel;
|
||||
private final int _previousSpecialty;
|
||||
private final int _previousSpecialtyAlt;
|
||||
|
||||
public ClanMasteryHolder(Skill skill, int previousSkillId)
|
||||
public ClanSpecialtyHolder(int id, Skill skill, int clanLevel, int previousSpecialty, int previousSpecialtyAlt)
|
||||
{
|
||||
_id = id;
|
||||
_skill = skill;
|
||||
_previousSkillId = previousSkillId;
|
||||
_clanLevel = clanLevel;
|
||||
_previousSpecialty = previousSpecialty;
|
||||
_previousSpecialtyAlt = previousSpecialtyAlt;
|
||||
}
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
public Skill getSkill()
|
||||
@ -37,8 +48,18 @@ public class ClanMasteryHolder
|
||||
return _skill;
|
||||
}
|
||||
|
||||
public int getPreviousSkillId()
|
||||
public int getClanLevel()
|
||||
{
|
||||
return _previousSkillId;
|
||||
return _clanLevel;
|
||||
}
|
||||
|
||||
public int getPreviousSpecialty()
|
||||
{
|
||||
return _previousSpecialty;
|
||||
}
|
||||
|
||||
public int getPreviousSpecialtyAlt()
|
||||
{
|
||||
return _previousSpecialtyAlt;
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/ClanMasteryData.xsd">
|
||||
<clan mastery="50000" level="1" previous="0" />
|
||||
<clan mastery="50001" level="2" previous="50000" />
|
||||
</list>
|
24
L2J_Mobius_5.5_EtinasFate/dist/game/data/ClanSpecialtyData.xml
vendored
Normal file
24
L2J_Mobius_5.5_EtinasFate/dist/game/data/ClanSpecialtyData.xml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/ClanSpecialtyData.xsd">
|
||||
<clan specialty="1" skilId="1" skillLevel="1" clanLevel="5" />
|
||||
<clan specialty="2" skilId="1" skillLevel="1" clanLevel="6" previousSpecialty="1" />
|
||||
<clan specialty="3" skilId="1" skillLevel="1" clanLevel="7" previousSpecialty="2" />
|
||||
<clan specialty="4" skilId="1" skillLevel="1" clanLevel="8" previousSpecialty="3" />
|
||||
<clan specialty="5" skilId="1" skillLevel="1" clanLevel="9" previousSpecialty="4" />
|
||||
<clan specialty="6" skilId="1" skillLevel="1" clanLevel="10" previousSpecialty="5" />
|
||||
<clan specialty="7" skilId="1" skillLevel="1" clanLevel="10" previousSpecialty="6" />
|
||||
<clan specialty="8" skilId="1" skillLevel="1" clanLevel="8" previousSpecialty="3" />
|
||||
<clan specialty="9" skilId="1" skillLevel="1" clanLevel="9" previousSpecialty="8" />
|
||||
<clan specialty="10" skilId="1" skillLevel="1" clanLevel="10" previousSpecialty="9" />
|
||||
<clan specialty="11" skilId="1" skillLevel="1" clanLevel="10" previousSpecialty="10" />
|
||||
<clan specialty="12" skilId="1" skillLevel="1" clanLevel="11" previousSpecialty="7" previousSpecialtyAlt="11" />
|
||||
<clan specialty="13" skilId="1" skillLevel="1" clanLevel="11" previousSpecialty="12" />
|
||||
<clan specialty="14" skilId="1" skillLevel="1" clanLevel="12" previousSpecialty="12" />
|
||||
<clan specialty="15" skilId="1" skillLevel="1" clanLevel="13" previousSpecialty="14" />
|
||||
<clan specialty="16" skilId="1" skillLevel="1" clanLevel="13" previousSpecialty="15" />
|
||||
<clan specialty="17" skilId="1" skillLevel="1" clanLevel="12" previousSpecialty="12" />
|
||||
<clan specialty="18" skilId="1" skillLevel="1" clanLevel="13" previousSpecialty="17" />
|
||||
<clan specialty="19" skilId="1" skillLevel="1" clanLevel="13" previousSpecialty="18" />
|
||||
<clan specialty="20" skilId="1" skillLevel="1" clanLevel="14" previousSpecialty="15" previousSpecialtyAlt="18" />
|
||||
<clan specialty="21" skilId="1" skillLevel="1" clanLevel="15" previousSpecialty="20" />
|
||||
</list>
|
@ -6,9 +6,12 @@
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:int" name="mastery" use="required"/>
|
||||
<xs:attribute type="xs:int" name="level" use="required"/>
|
||||
<xs:attribute type="xs:int" name="previous" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="specialty" use="optional"/>
|
||||
<xs:attribute type="xs:short" name="skilId" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="skillLevel" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="clanLevel" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="previousSpecialty" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="previousSpecialtyAlt" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
@ -50,9 +50,9 @@ import com.l2jmobius.gameserver.data.xml.impl.BeautyShopData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.CategoryData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanMasteryData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanRewardData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanShopData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanSpecialtyData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClassListData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.CubicData;
|
||||
@ -307,7 +307,7 @@ public class GameServer
|
||||
ClanHallData.getInstance();
|
||||
ClanHallAuctionManager.getInstance();
|
||||
ClanEntryManager.getInstance();
|
||||
ClanMasteryData.getInstance();
|
||||
ClanSpecialtyData.getInstance();
|
||||
ClanShopData.getInstance();
|
||||
|
||||
printSection("Geodata");
|
||||
|
@ -25,19 +25,19 @@ import org.w3c.dom.Document;
|
||||
|
||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.holders.ClanMasteryHolder;
|
||||
import com.l2jmobius.gameserver.model.holders.ClanSpecialtyHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ClanMasteryData implements IGameXmlReader
|
||||
public class ClanSpecialtyData implements IGameXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(ClanMasteryData.class.getName());
|
||||
private static Logger LOGGER = Logger.getLogger(ClanSpecialtyData.class.getName());
|
||||
|
||||
private final List<ClanMasteryHolder> _clanMasteryData = new ArrayList<>();
|
||||
private final List<ClanSpecialtyHolder> _clanSpecialtyData = new ArrayList<>();
|
||||
|
||||
protected ClanMasteryData()
|
||||
protected ClanSpecialtyData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@ -45,10 +45,10 @@ public class ClanMasteryData implements IGameXmlReader
|
||||
@Override
|
||||
public void load()
|
||||
{
|
||||
_clanMasteryData.clear();
|
||||
_clanSpecialtyData.clear();
|
||||
|
||||
parseDatapackFile("data/ClanMasteryData.xml");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _clanMasteryData.size() + " clan masteries.");
|
||||
parseDatapackFile("data/ClanSpecialtyData.xml");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _clanSpecialtyData.size() + " clan specialties.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -57,34 +57,37 @@ public class ClanMasteryData implements IGameXmlReader
|
||||
forEach(doc, "list", listNode -> forEach(listNode, "clan", clanNode ->
|
||||
{
|
||||
final StatsSet set = new StatsSet(parseAttributes(clanNode));
|
||||
final int mastery = set.getInt("mastery");
|
||||
final int level = set.getInt("level");
|
||||
final int previous = set.getInt("previous");
|
||||
final int id = set.getInt("specialty");
|
||||
final int skillId = set.getInt("skilId");
|
||||
final int skillLevel = set.getInt("skillLevel");
|
||||
final int clanLevel = set.getInt("clanLevel");
|
||||
final int previousSpecialty = set.getInt("previousSpecialty");
|
||||
final int previousSpecialtyAlt = set.getInt("previousSpecialtyAlt");
|
||||
|
||||
final Skill skill = SkillData.getInstance().getSkill(mastery, level);
|
||||
final Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel);
|
||||
if (skill == null)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Could not create clan mastery, skill id " + mastery + " with level " + level + " does not exist.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Could not create clan specialty, skill id " + skillId + " with level " + skillLevel + " does not exist.");
|
||||
}
|
||||
else
|
||||
{
|
||||
_clanMasteryData.add(new ClanMasteryHolder(skill, previous));
|
||||
_clanSpecialtyData.add(new ClanSpecialtyHolder(id, skill, clanLevel, previousSpecialty, previousSpecialtyAlt));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public List<ClanMasteryHolder> getMasteries()
|
||||
public List<ClanSpecialtyHolder> getSpecialties()
|
||||
{
|
||||
return _clanMasteryData;
|
||||
return _clanSpecialtyData;
|
||||
}
|
||||
|
||||
public static ClanMasteryData getInstance()
|
||||
public static ClanSpecialtyData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final ClanMasteryData _instance = new ClanMasteryData();
|
||||
protected static final ClanSpecialtyData _instance = new ClanSpecialtyData();
|
||||
}
|
||||
}
|
@ -21,15 +21,26 @@ import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ClanMasteryHolder
|
||||
public class ClanSpecialtyHolder
|
||||
{
|
||||
private final int _id;
|
||||
private final Skill _skill;
|
||||
private final int _previousSkillId;
|
||||
private final int _clanLevel;
|
||||
private final int _previousSpecialty;
|
||||
private final int _previousSpecialtyAlt;
|
||||
|
||||
public ClanMasteryHolder(Skill skill, int previousSkillId)
|
||||
public ClanSpecialtyHolder(int id, Skill skill, int clanLevel, int previousSpecialty, int previousSpecialtyAlt)
|
||||
{
|
||||
_id = id;
|
||||
_skill = skill;
|
||||
_previousSkillId = previousSkillId;
|
||||
_clanLevel = clanLevel;
|
||||
_previousSpecialty = previousSpecialty;
|
||||
_previousSpecialtyAlt = previousSpecialtyAlt;
|
||||
}
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
public Skill getSkill()
|
||||
@ -37,8 +48,18 @@ public class ClanMasteryHolder
|
||||
return _skill;
|
||||
}
|
||||
|
||||
public int getPreviousSkillId()
|
||||
public int getClanLevel()
|
||||
{
|
||||
return _previousSkillId;
|
||||
return _clanLevel;
|
||||
}
|
||||
|
||||
public int getPreviousSpecialty()
|
||||
{
|
||||
return _previousSpecialty;
|
||||
}
|
||||
|
||||
public int getPreviousSpecialtyAlt()
|
||||
{
|
||||
return _previousSpecialtyAlt;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user