|
@@ -45,6 +45,8 @@ import com.l2jserver.gameserver.instancemanager.SiegeManager;
|
|
import com.l2jserver.gameserver.instancemanager.TerritoryWarManager;
|
|
import com.l2jserver.gameserver.instancemanager.TerritoryWarManager;
|
|
import com.l2jserver.gameserver.instancemanager.TerritoryWarManager.Territory;
|
|
import com.l2jserver.gameserver.instancemanager.TerritoryWarManager.Territory;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
|
|
|
+import com.l2jserver.gameserver.model.interfaces.IIdentifiable;
|
|
|
|
+import com.l2jserver.gameserver.model.interfaces.INamable;
|
|
import com.l2jserver.gameserver.model.itemcontainer.ClanWarehouse;
|
|
import com.l2jserver.gameserver.model.itemcontainer.ClanWarehouse;
|
|
import com.l2jserver.gameserver.model.itemcontainer.ItemContainer;
|
|
import com.l2jserver.gameserver.model.itemcontainer.ItemContainer;
|
|
import com.l2jserver.gameserver.model.skills.L2Skill;
|
|
import com.l2jserver.gameserver.model.skills.L2Skill;
|
|
@@ -77,7 +79,7 @@ import com.l2jserver.gameserver.scripting.scriptengine.listeners.clan.ClanCreati
|
|
import com.l2jserver.gameserver.scripting.scriptengine.listeners.clan.ClanMembershipListener;
|
|
import com.l2jserver.gameserver.scripting.scriptengine.listeners.clan.ClanMembershipListener;
|
|
import com.l2jserver.gameserver.util.Util;
|
|
import com.l2jserver.gameserver.util.Util;
|
|
|
|
|
|
-public class L2Clan
|
|
|
|
|
|
+public class L2Clan implements IIdentifiable, INamable
|
|
{
|
|
{
|
|
private static final Logger _log = Logger.getLogger(L2Clan.class.getName());
|
|
private static final Logger _log = Logger.getLogger(L2Clan.class.getName());
|
|
|
|
|
|
@@ -218,7 +220,8 @@ public class L2Clan
|
|
/**
|
|
/**
|
|
* @return Returns the clanId.
|
|
* @return Returns the clanId.
|
|
*/
|
|
*/
|
|
- public int getClanId()
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public int getId()
|
|
{
|
|
{
|
|
return _clanId;
|
|
return _clanId;
|
|
}
|
|
}
|
|
@@ -362,6 +365,7 @@ public class L2Clan
|
|
/**
|
|
/**
|
|
* @return the clan name.
|
|
* @return the clan name.
|
|
*/
|
|
*/
|
|
|
|
+ @Override
|
|
public String getName()
|
|
public String getName()
|
|
{
|
|
{
|
|
return _name;
|
|
return _name;
|
|
@@ -749,7 +753,7 @@ public class L2Clan
|
|
_forum = forum.getChildByName(_name);
|
|
_forum = forum.getChildByName(_name);
|
|
if (_forum == null)
|
|
if (_forum == null)
|
|
{
|
|
{
|
|
- _forum = ForumsBBSManager.getInstance().createNewForum(_name, ForumsBBSManager.getInstance().getForumByName("ClanRoot"), Forum.CLAN, Forum.CLANMEMBERONLY, getClanId());
|
|
|
|
|
|
+ _forum = ForumsBBSManager.getInstance().createNewForum(_name, ForumsBBSManager.getInstance().getForumByName("ClanRoot"), Forum.CLAN, Forum.CLANMEMBERONLY, getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -895,7 +899,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET blood_alliance_count=? WHERE clan_id=?"))
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET blood_alliance_count=? WHERE clan_id=?"))
|
|
{
|
|
{
|
|
ps.setInt(1, getBloodAllianceCount());
|
|
ps.setInt(1, getBloodAllianceCount());
|
|
- ps.setInt(2, getClanId());
|
|
|
|
|
|
+ ps.setInt(2, getId());
|
|
ps.execute();
|
|
ps.execute();
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -939,7 +943,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET blood_oath_count=? WHERE clan_id=?"))
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET blood_oath_count=? WHERE clan_id=?"))
|
|
{
|
|
{
|
|
ps.setInt(1, getBloodOathCount());
|
|
ps.setInt(1, getBloodOathCount());
|
|
- ps.setInt(2, getClanId());
|
|
|
|
|
|
+ ps.setInt(2, getId());
|
|
ps.execute();
|
|
ps.execute();
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -957,7 +961,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET reputation_score=? WHERE clan_id=?"))
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET reputation_score=? WHERE clan_id=?"))
|
|
{
|
|
{
|
|
ps.setInt(1, getReputationScore());
|
|
ps.setInt(1, getReputationScore());
|
|
- ps.setInt(2, getClanId());
|
|
|
|
|
|
+ ps.setInt(2, getId());
|
|
ps.execute();
|
|
ps.execute();
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -994,11 +998,11 @@ public class L2Clan
|
|
ps.setLong(7, getCharPenaltyExpiryTime());
|
|
ps.setLong(7, getCharPenaltyExpiryTime());
|
|
ps.setLong(8, getDissolvingExpiryTime());
|
|
ps.setLong(8, getDissolvingExpiryTime());
|
|
ps.setInt(9, getNewLeaderId());
|
|
ps.setInt(9, getNewLeaderId());
|
|
- ps.setInt(10, getClanId());
|
|
|
|
|
|
+ ps.setInt(10, getId());
|
|
ps.execute();
|
|
ps.execute();
|
|
if (Config.DEBUG)
|
|
if (Config.DEBUG)
|
|
{
|
|
{
|
|
- _log.fine("New clan leader saved in db: " + getClanId());
|
|
|
|
|
|
+ _log.fine("New clan leader saved in db: " + getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -1027,7 +1031,7 @@ public class L2Clan
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
PreparedStatement ps = con.prepareStatement(INSERT_CLAN_DATA))
|
|
PreparedStatement ps = con.prepareStatement(INSERT_CLAN_DATA))
|
|
{
|
|
{
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
ps.setString(2, getName());
|
|
ps.setString(2, getName());
|
|
ps.setInt(3, getLevel());
|
|
ps.setInt(3, getLevel());
|
|
ps.setInt(4, getCastleId());
|
|
ps.setInt(4, getCastleId());
|
|
@@ -1043,7 +1047,7 @@ public class L2Clan
|
|
ps.execute();
|
|
ps.execute();
|
|
if (Config.DEBUG)
|
|
if (Config.DEBUG)
|
|
{
|
|
{
|
|
- _log.fine("New clan saved in db: " + getClanId());
|
|
|
|
|
|
+ _log.fine("New clan saved in db: " + getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -1071,7 +1075,7 @@ public class L2Clan
|
|
ps1.execute();
|
|
ps1.execute();
|
|
if (Config.DEBUG)
|
|
if (Config.DEBUG)
|
|
{
|
|
{
|
|
- _log.fine("clan member removed in db: " + getClanId());
|
|
|
|
|
|
+ _log.fine("clan member removed in db: " + getId());
|
|
}
|
|
}
|
|
// Remove apprentice.
|
|
// Remove apprentice.
|
|
ps2.setInt(1, member.getObjectId());
|
|
ps2.setInt(1, member.getObjectId());
|
|
@@ -1091,7 +1095,7 @@ public class L2Clan
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
PreparedStatement ps = con.prepareStatement(SELECT_CLAN_DATA))
|
|
PreparedStatement ps = con.prepareStatement(SELECT_CLAN_DATA))
|
|
{
|
|
{
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
try (ResultSet clanData = ps.executeQuery())
|
|
try (ResultSet clanData = ps.executeQuery())
|
|
{
|
|
{
|
|
if (clanData.next())
|
|
if (clanData.next())
|
|
@@ -1129,7 +1133,7 @@ public class L2Clan
|
|
|
|
|
|
try (PreparedStatement select = con.prepareStatement("SELECT char_name,level,classid,charId,title,power_grade,subpledge,apprentice,sponsor,sex,race FROM characters WHERE clanid=?"))
|
|
try (PreparedStatement select = con.prepareStatement("SELECT char_name,level,classid,charId,title,power_grade,subpledge,apprentice,sponsor,sex,race FROM characters WHERE clanid=?"))
|
|
{
|
|
{
|
|
- select.setInt(1, getClanId());
|
|
|
|
|
|
+ select.setInt(1, getId());
|
|
try (ResultSet clanMember = select.executeQuery())
|
|
try (ResultSet clanMember = select.executeQuery())
|
|
{
|
|
{
|
|
L2ClanMember member = null;
|
|
L2ClanMember member = null;
|
|
@@ -1171,7 +1175,7 @@ public class L2Clan
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
PreparedStatement ps = con.prepareStatement("SELECT enabled,notice FROM clan_notices WHERE clan_id=?"))
|
|
PreparedStatement ps = con.prepareStatement("SELECT enabled,notice FROM clan_notices WHERE clan_id=?"))
|
|
{
|
|
{
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
try (ResultSet noticeData = ps.executeQuery())
|
|
try (ResultSet noticeData = ps.executeQuery())
|
|
{
|
|
{
|
|
while (noticeData.next())
|
|
while (noticeData.next())
|
|
@@ -1202,7 +1206,7 @@ public class L2Clan
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_notices (clan_id,notice,enabled) values (?,?,?) ON DUPLICATE KEY UPDATE notice=?,enabled=?"))
|
|
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_notices (clan_id,notice,enabled) values (?,?,?) ON DUPLICATE KEY UPDATE notice=?,enabled=?"))
|
|
{
|
|
{
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
ps.setString(2, notice);
|
|
ps.setString(2, notice);
|
|
if (enabled)
|
|
if (enabled)
|
|
{
|
|
{
|
|
@@ -1262,7 +1266,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("SELECT skill_id,skill_level,sub_pledge_id FROM clan_skills WHERE clan_id=?"))
|
|
PreparedStatement ps = con.prepareStatement("SELECT skill_id,skill_level,sub_pledge_id FROM clan_skills WHERE clan_id=?"))
|
|
{
|
|
{
|
|
// Retrieve all skills of this L2PcInstance from the database
|
|
// Retrieve all skills of this L2PcInstance from the database
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
try (ResultSet rset = ps.executeQuery())
|
|
try (ResultSet rset = ps.executeQuery())
|
|
{
|
|
{
|
|
// Go though the recordset of this SQL query
|
|
// Go though the recordset of this SQL query
|
|
@@ -1390,7 +1394,7 @@ public class L2Clan
|
|
{
|
|
{
|
|
ps.setInt(1, newSkill.getLevel());
|
|
ps.setInt(1, newSkill.getLevel());
|
|
ps.setInt(2, oldSkill.getId());
|
|
ps.setInt(2, oldSkill.getId());
|
|
- ps.setInt(3, getClanId());
|
|
|
|
|
|
+ ps.setInt(3, getId());
|
|
ps.execute();
|
|
ps.execute();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1398,7 +1402,7 @@ public class L2Clan
|
|
{
|
|
{
|
|
try (PreparedStatement ps = con.prepareStatement("INSERT INTO clan_skills (clan_id,skill_id,skill_level,skill_name,sub_pledge_id) VALUES (?,?,?,?,?)"))
|
|
try (PreparedStatement ps = con.prepareStatement("INSERT INTO clan_skills (clan_id,skill_id,skill_level,skill_name,sub_pledge_id) VALUES (?,?,?,?,?)"))
|
|
{
|
|
{
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
ps.setInt(2, newSkill.getId());
|
|
ps.setInt(2, newSkill.getId());
|
|
ps.setInt(3, newSkill.getLevel());
|
|
ps.setInt(3, newSkill.getLevel());
|
|
ps.setString(4, newSkill.getName());
|
|
ps.setString(4, newSkill.getName());
|
|
@@ -1641,7 +1645,7 @@ public class L2Clan
|
|
@Override
|
|
@Override
|
|
public String toString()
|
|
public String toString()
|
|
{
|
|
{
|
|
- return getName() + "[" + getClanId() + "]";
|
|
|
|
|
|
+ return getName() + "[" + getId() + "]";
|
|
}
|
|
}
|
|
|
|
|
|
public ItemContainer getWarehouse()
|
|
public ItemContainer getWarehouse()
|
|
@@ -1669,7 +1673,7 @@ public class L2Clan
|
|
}
|
|
}
|
|
if (!_atWarWith.isEmpty())
|
|
if (!_atWarWith.isEmpty())
|
|
{
|
|
{
|
|
- if (_atWarWith.contains(clan.getClanId()))
|
|
|
|
|
|
+ if (_atWarWith.contains(clan.getId()))
|
|
{
|
|
{
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -1691,7 +1695,7 @@ public class L2Clan
|
|
|
|
|
|
public void setEnemyClan(L2Clan clan)
|
|
public void setEnemyClan(L2Clan clan)
|
|
{
|
|
{
|
|
- Integer id = clan.getClanId();
|
|
|
|
|
|
+ Integer id = clan.getId();
|
|
_atWarWith.add(id);
|
|
_atWarWith.add(id);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1702,7 +1706,7 @@ public class L2Clan
|
|
|
|
|
|
public void setAttackerClan(L2Clan clan)
|
|
public void setAttackerClan(L2Clan clan)
|
|
{
|
|
{
|
|
- Integer id = clan.getClanId();
|
|
|
|
|
|
+ Integer id = clan.getId();
|
|
_atWarAttackers.add(id);
|
|
_atWarAttackers.add(id);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1713,13 +1717,13 @@ public class L2Clan
|
|
|
|
|
|
public void deleteEnemyClan(L2Clan clan)
|
|
public void deleteEnemyClan(L2Clan clan)
|
|
{
|
|
{
|
|
- Integer id = clan.getClanId();
|
|
|
|
|
|
+ Integer id = clan.getId();
|
|
_atWarWith.remove(id);
|
|
_atWarWith.remove(id);
|
|
}
|
|
}
|
|
|
|
|
|
public void deleteAttackerClan(L2Clan clan)
|
|
public void deleteAttackerClan(L2Clan clan)
|
|
{
|
|
{
|
|
- Integer id = clan.getClanId();
|
|
|
|
|
|
+ Integer id = clan.getId();
|
|
_atWarAttackers.remove(id);
|
|
_atWarAttackers.remove(id);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1856,7 +1860,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("SELECT sub_pledge_id,name,leader_id FROM clan_subpledges WHERE clan_id=?"))
|
|
PreparedStatement ps = con.prepareStatement("SELECT sub_pledge_id,name,leader_id FROM clan_subpledges WHERE clan_id=?"))
|
|
{
|
|
{
|
|
// Retrieve all subpledges of this clan from the database
|
|
// Retrieve all subpledges of this clan from the database
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
try (ResultSet rset = ps.executeQuery())
|
|
try (ResultSet rset = ps.executeQuery())
|
|
{
|
|
{
|
|
while (rset.next())
|
|
while (rset.next())
|
|
@@ -1960,7 +1964,7 @@ public class L2Clan
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
|
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_subpledges (clan_id,sub_pledge_id,name,leader_id) values (?,?,?,?)"))
|
|
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_subpledges (clan_id,sub_pledge_id,name,leader_id) values (?,?,?,?)"))
|
|
{
|
|
{
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
ps.setInt(2, pledgeType);
|
|
ps.setInt(2, pledgeType);
|
|
ps.setString(3, subPledgeName);
|
|
ps.setString(3, subPledgeName);
|
|
ps.setInt(4, pledgeType != -1 ? leaderId : 0);
|
|
ps.setInt(4, pledgeType != -1 ? leaderId : 0);
|
|
@@ -1986,7 +1990,7 @@ public class L2Clan
|
|
|
|
|
|
if (Config.DEBUG)
|
|
if (Config.DEBUG)
|
|
{
|
|
{
|
|
- _log.fine("New sub_clan saved in db: " + getClanId() + "; " + pledgeType);
|
|
|
|
|
|
+ _log.fine("New sub_clan saved in db: " + getId() + "; " + pledgeType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -2036,12 +2040,12 @@ public class L2Clan
|
|
{
|
|
{
|
|
ps.setInt(1, getSubPledge(pledgeType).getLeaderId());
|
|
ps.setInt(1, getSubPledge(pledgeType).getLeaderId());
|
|
ps.setString(2, getSubPledge(pledgeType).getName());
|
|
ps.setString(2, getSubPledge(pledgeType).getName());
|
|
- ps.setInt(3, getClanId());
|
|
|
|
|
|
+ ps.setInt(3, getId());
|
|
ps.setInt(4, pledgeType);
|
|
ps.setInt(4, pledgeType);
|
|
ps.execute();
|
|
ps.execute();
|
|
if (Config.DEBUG)
|
|
if (Config.DEBUG)
|
|
{
|
|
{
|
|
- _log.fine("Subpledge updated in db: " + getClanId());
|
|
|
|
|
|
+ _log.fine("Subpledge updated in db: " + getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -2056,7 +2060,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("SELECT privs,rank,party FROM clan_privs WHERE clan_id=?"))
|
|
PreparedStatement ps = con.prepareStatement("SELECT privs,rank,party FROM clan_privs WHERE clan_id=?"))
|
|
{
|
|
{
|
|
// Retrieve all skills of this L2PcInstance from the database
|
|
// Retrieve all skills of this L2PcInstance from the database
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
// _log.warning("clanPrivs restore for ClanId : "+getClanId());
|
|
// _log.warning("clanPrivs restore for ClanId : "+getClanId());
|
|
try (ResultSet rset = ps.executeQuery())
|
|
try (ResultSet rset = ps.executeQuery())
|
|
{
|
|
{
|
|
@@ -2111,7 +2115,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?"))
|
|
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?"))
|
|
{
|
|
{
|
|
// Retrieve all skills of this L2PcInstance from the database
|
|
// Retrieve all skills of this L2PcInstance from the database
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
ps.setInt(2, rank);
|
|
ps.setInt(2, rank);
|
|
ps.setInt(3, 0);
|
|
ps.setInt(3, 0);
|
|
ps.setInt(4, privs);
|
|
ps.setInt(4, privs);
|
|
@@ -2148,7 +2152,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
|
|
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
|
|
{
|
|
{
|
|
// Retrieve all skills of this L2PcInstance from the database
|
|
// Retrieve all skills of this L2PcInstance from the database
|
|
- ps.setInt(1, getClanId());
|
|
|
|
|
|
+ ps.setInt(1, getId());
|
|
ps.setInt(2, rank);
|
|
ps.setInt(2, rank);
|
|
ps.setInt(3, 0);
|
|
ps.setInt(3, 0);
|
|
ps.setInt(4, privs);
|
|
ps.setInt(4, privs);
|
|
@@ -2272,7 +2276,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET auction_bid_at=? WHERE clan_id=?"))
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET auction_bid_at=? WHERE clan_id=?"))
|
|
{
|
|
{
|
|
ps.setInt(1, id);
|
|
ps.setInt(1, id);
|
|
- ps.setInt(2, getClanId());
|
|
|
|
|
|
+ ps.setInt(2, getId());
|
|
ps.execute();
|
|
ps.execute();
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -2433,7 +2437,7 @@ public class L2Clan
|
|
activeChar.sendPacket(SystemMessageId.OPPOSING_CLAN_IS_PARTICIPATING_IN_SIEGE);
|
|
activeChar.sendPacket(SystemMessageId.OPPOSING_CLAN_IS_PARTICIPATING_IN_SIEGE);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- if (leaderClan.isAtWarWith(targetClan.getClanId()))
|
|
|
|
|
|
+ if (leaderClan.isAtWarWith(targetClan.getId()))
|
|
{
|
|
{
|
|
activeChar.sendPacket(SystemMessageId.MAY_NOT_ALLY_CLAN_BATTLE);
|
|
activeChar.sendPacket(SystemMessageId.MAY_NOT_ALLY_CLAN_BATTLE);
|
|
return false;
|
|
return false;
|
|
@@ -2540,7 +2544,7 @@ public class L2Clan
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- setAllyId(getClanId());
|
|
|
|
|
|
+ setAllyId(getId());
|
|
setAllyName(allyName.trim());
|
|
setAllyName(allyName.trim());
|
|
setAllyPenaltyExpiryTime(0, 0);
|
|
setAllyPenaltyExpiryTime(0, 0);
|
|
updateClanInDB();
|
|
updateClanInDB();
|
|
@@ -2561,7 +2565,7 @@ public class L2Clan
|
|
player.sendPacket(SystemMessageId.NO_CURRENT_ALLIANCES);
|
|
player.sendPacket(SystemMessageId.NO_CURRENT_ALLIANCES);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (!player.isClanLeader() || (getClanId() != getAllyId()))
|
|
|
|
|
|
+ if (!player.isClanLeader() || (getId() != getAllyId()))
|
|
{
|
|
{
|
|
player.sendPacket(SystemMessageId.FEATURE_ONLY_FOR_ALLIANCE_LEADER);
|
|
player.sendPacket(SystemMessageId.FEATURE_ONLY_FOR_ALLIANCE_LEADER);
|
|
return;
|
|
return;
|
|
@@ -2577,7 +2581,7 @@ public class L2Clan
|
|
long currentTime = System.currentTimeMillis();
|
|
long currentTime = System.currentTimeMillis();
|
|
for (L2Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
|
|
for (L2Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
|
|
{
|
|
{
|
|
- if (clan.getClanId() != getClanId())
|
|
|
|
|
|
+ if (clan.getId() != getId())
|
|
{
|
|
{
|
|
clan.setAllyId(0);
|
|
clan.setAllyId(0);
|
|
clan.setAllyName(null);
|
|
clan.setAllyName(null);
|
|
@@ -2804,7 +2808,7 @@ public class L2Clan
|
|
boolean hasTerritory = false;
|
|
boolean hasTerritory = false;
|
|
for (Territory terr : TerritoryWarManager.getInstance().getAllTerritories())
|
|
for (Territory terr : TerritoryWarManager.getInstance().getAllTerritories())
|
|
{
|
|
{
|
|
- if (terr.getOwnerClan().getClanId() == getClanId())
|
|
|
|
|
|
+ if (terr.getOwnerClan().getId() == getId())
|
|
{
|
|
{
|
|
hasTerritory = true;
|
|
hasTerritory = true;
|
|
break;
|
|
break;
|
|
@@ -2848,7 +2852,7 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET clan_level = ? WHERE clan_id = ?"))
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET clan_level = ? WHERE clan_id = ?"))
|
|
{
|
|
{
|
|
ps.setInt(1, level);
|
|
ps.setInt(1, level);
|
|
- ps.setInt(2, getClanId());
|
|
|
|
|
|
+ ps.setInt(2, getId());
|
|
ps.execute();
|
|
ps.execute();
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -2902,12 +2906,12 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET crest_id = ? WHERE clan_id = ?"))
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET crest_id = ? WHERE clan_id = ?"))
|
|
{
|
|
{
|
|
ps.setInt(1, crestId);
|
|
ps.setInt(1, crestId);
|
|
- ps.setInt(2, getClanId());
|
|
|
|
|
|
+ ps.setInt(2, getId());
|
|
ps.executeUpdate();
|
|
ps.executeUpdate();
|
|
}
|
|
}
|
|
catch (SQLException e)
|
|
catch (SQLException e)
|
|
{
|
|
{
|
|
- _log.log(Level.WARNING, "Could not update crest for clan " + getName() + " [" + getClanId() + "] : " + e.getMessage(), e);
|
|
|
|
|
|
+ _log.log(Level.WARNING, "Could not update crest for clan " + getName() + " [" + getId() + "] : " + e.getMessage(), e);
|
|
}
|
|
}
|
|
|
|
|
|
for (L2PcInstance member : getOnlineMembers(0))
|
|
for (L2PcInstance member : getOnlineMembers(0))
|
|
@@ -2924,7 +2928,7 @@ public class L2Clan
|
|
public void changeAllyCrest(int crestId, boolean onlyThisClan)
|
|
public void changeAllyCrest(int crestId, boolean onlyThisClan)
|
|
{
|
|
{
|
|
String sqlStatement = "UPDATE clan_data SET ally_crest_id = ? WHERE clan_id = ?";
|
|
String sqlStatement = "UPDATE clan_data SET ally_crest_id = ? WHERE clan_id = ?";
|
|
- int allyId = getClanId();
|
|
|
|
|
|
+ int allyId = getId();
|
|
if (!onlyThisClan)
|
|
if (!onlyThisClan)
|
|
{
|
|
{
|
|
if (getAllyCrestId() != 0)
|
|
if (getAllyCrestId() != 0)
|
|
@@ -2985,12 +2989,12 @@ public class L2Clan
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET crest_large_id = ? WHERE clan_id = ?"))
|
|
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET crest_large_id = ? WHERE clan_id = ?"))
|
|
{
|
|
{
|
|
ps.setInt(1, crestId);
|
|
ps.setInt(1, crestId);
|
|
- ps.setInt(2, getClanId());
|
|
|
|
|
|
+ ps.setInt(2, getId());
|
|
ps.executeUpdate();
|
|
ps.executeUpdate();
|
|
}
|
|
}
|
|
catch (SQLException e)
|
|
catch (SQLException e)
|
|
{
|
|
{
|
|
- _log.log(Level.WARNING, "Could not update large crest for clan " + getName() + " [" + getClanId() + "] : " + e.getMessage(), e);
|
|
|
|
|
|
+ _log.log(Level.WARNING, "Could not update large crest for clan " + getName() + " [" + getId() + "] : " + e.getMessage(), e);
|
|
}
|
|
}
|
|
|
|
|
|
for (L2PcInstance member : getOnlineMembers(0))
|
|
for (L2PcInstance member : getOnlineMembers(0))
|