@Override
protected void loadData()
{
_type = ResidenceType.Fortress;
ThreadConnection con = null;
FiltredPreparedStatement statement = null;
ResultSet rs = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
statement = con.prepareStatement("SELECT * FROM `forts` WHERE `id` = ?");
statement.setInt(1, _id);
rs = statement.executeQuery();
while(rs.next())
{
_name = rs.getString("name");
_siegeDate = rs.getInt("siegeDate");
_lastSiegeDate = rs.getInt("lastSiegeDate");
_state = rs.getInt("state");
if(_state == 0)
{
_state = 1;
}
_castleId = rs.getInt("castleId");
setOwnDate(rs.getInt("ownDate"));
StringTokenizer st = new StringTokenizer(rs.getString("skills"), ";");
while(st.hasMoreTokens())
{
L2Skill skill = SkillTable.getInstance().getInfo(Integer.valueOf(st.nextToken()), Integer.valueOf(st.nextToken()));
if(skill != null)
{
_skills.add(skill);
}
}
}
DatabaseUtils.closeDatabaseSR(statement, rs);
statement = con.prepareStatement("SELECT `clan_id` FROM `clan_data` WHERE hasFortress = ?");
statement.setInt(1, _id);
rs = statement.executeQuery();
while(rs.next())
{
_ownerId = rs.getInt("clan_id");
}
_zone = ZoneManager.getInstance().getZoneByIndex(ZoneType.Fortress, getId(), true);