Siege skill related additions.
Thanks to dontknowdontcare.
This commit is contained in:
@ -184,10 +184,9 @@ public class SkillData implements IXmlReader
|
||||
|
||||
/**
|
||||
* @param addNoble
|
||||
* @param hasCastle
|
||||
* @return an array with siege skills. If addNoble == true, will add also Advanced headquarters.
|
||||
*/
|
||||
public List<Skill> getSiegeSkills(boolean addNoble, boolean hasCastle)
|
||||
public List<Skill> getSiegeSkills(boolean addNoble)
|
||||
{
|
||||
final List<Skill> temp = new LinkedList<>();
|
||||
temp.add(_skills.get(getSkillHashCode(CommonSkill.IMPRIT_OF_LIGHT.getId(), 1)));
|
||||
@ -197,11 +196,9 @@ public class SkillData implements IXmlReader
|
||||
{
|
||||
temp.add(_skills.get(getSkillHashCode(326, 1))); // Build Advanced Headquarters
|
||||
}
|
||||
if (hasCastle)
|
||||
{
|
||||
temp.add(_skills.get(getSkillHashCode(844, 1))); // Outpost Construction
|
||||
temp.add(_skills.get(getSkillHashCode(845, 1))); // Outpost Demolition
|
||||
}
|
||||
temp.add(_skills.get(getSkillHashCode(15283, 1))); // Summon Jacquard
|
||||
temp.add(_skills.get(getSkillHashCode(15284, 1))); // Summon Brakel
|
||||
temp.add(_skills.get(getSkillHashCode(15285, 1))); // Summon Loken
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@ import java.io.InputStream;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
@ -60,7 +61,7 @@ public class FortSiegeManager
|
||||
private int _siegeLength = 60; // Time in minute. Changeable in fortsiege.properties
|
||||
private int _countDownLength = 10; // Time in minute. Changeable in fortsiege.properties
|
||||
private int _suspiciousMerchantRespawnDelay = 180; // Time in minute. Changeable in fortsiege.properties
|
||||
private List<FortSiege> _sieges;
|
||||
private final Map<Integer, FortSiege> _sieges = new ConcurrentHashMap<>();
|
||||
|
||||
protected FortSiegeManager()
|
||||
{
|
||||
@ -255,18 +256,19 @@ public class FortSiegeManager
|
||||
return _countDownLength;
|
||||
}
|
||||
|
||||
public List<FortSiege> getSieges()
|
||||
public Collection<FortSiege> getSieges()
|
||||
{
|
||||
if (_sieges == null)
|
||||
{
|
||||
_sieges = new CopyOnWriteArrayList<>();
|
||||
}
|
||||
return _sieges;
|
||||
return _sieges.values();
|
||||
}
|
||||
|
||||
public FortSiege getSiege(int fortId)
|
||||
{
|
||||
return _sieges.get(fortId);
|
||||
}
|
||||
|
||||
public void addSiege(FortSiege fortSiege)
|
||||
{
|
||||
getSieges().add(fortSiege);
|
||||
_sieges.put(fortSiege.getFort().getResidenceId(), fortSiege);
|
||||
}
|
||||
|
||||
public boolean isCombat(int itemId)
|
||||
|
@ -20,6 +20,7 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@ -64,7 +65,7 @@ public class SiegeManager
|
||||
|
||||
public void addSiegeSkills(Player character)
|
||||
{
|
||||
for (Skill sk : SkillData.getInstance().getSiegeSkills(character.getNobleLevel() > 0, character.getClan().getCastleId() > 0))
|
||||
for (Skill sk : SkillData.getInstance().getSiegeSkills(character.getNobleLevel() > 0))
|
||||
{
|
||||
character.addSkill(sk, false);
|
||||
}
|
||||
@ -110,7 +111,7 @@ public class SiegeManager
|
||||
|
||||
public void removeSiegeSkills(Player character)
|
||||
{
|
||||
for (Skill sk : SkillData.getInstance().getSiegeSkills(character.getNobleLevel() > 0, character.getClan().getCastleId() > 0))
|
||||
for (Skill sk : SkillData.getInstance().getSiegeSkills(character.getNobleLevel() > 0))
|
||||
{
|
||||
character.removeSkill(sk);
|
||||
}
|
||||
@ -263,7 +264,7 @@ public class SiegeManager
|
||||
return _bloodAllianceReward;
|
||||
}
|
||||
|
||||
public List<Siege> getSieges()
|
||||
public Collection<Siege> getSieges()
|
||||
{
|
||||
final List<Siege> sieges = new LinkedList<>();
|
||||
for (Castle castle : CastleManager.getInstance().getCastles())
|
||||
@ -272,6 +273,18 @@ public class SiegeManager
|
||||
}
|
||||
return sieges;
|
||||
}
|
||||
|
||||
public Siege getSiege(int castleId)
|
||||
{
|
||||
for (Castle castle : CastleManager.getInstance().getCastles())
|
||||
{
|
||||
if (castle.getResidenceId() == castleId)
|
||||
{
|
||||
return castle.getSiege();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void loadTrapUpgrade(int castleId)
|
||||
{
|
||||
|
Reference in New Issue
Block a user