public boolean useUserCommand(int id, L2PcInstance activeChar)
{
if(id != COMMAND_IDS[0] && id != COMMAND_IDS[1] && id != COMMAND_IDS[2])
return false;
L2Clan clan = activeChar.getClan();
if(clan == null)
{
activeChar.sendMessage("You are not in a clan.");
return false;
}
SystemMessage sm;
Connection con = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement statement;
if(id == 88)
{
// Attack List
activeChar.sendPacket(new SystemMessage(SystemMessageId.CLANS_YOU_DECLARED_WAR_ON));
statement = con.prepareStatement("select clan_name,clan_id,ally_id,ally_name from clan_data,clan_wars where clan1=? and clan_id=clan2 and clan2 not in (select clan1 from clan_wars where clan2=?)");
statement.setInt(1, clan.getClanId());
statement.setInt(2, clan.getClanId());
}
else if(id == 89)
{
// Under Attack List
activeChar.sendPacket(new SystemMessage(SystemMessageId.CLANS_THAT_HAVE_DECLARED_WAR_ON_YOU));
statement = con.prepareStatement("select clan_name,clan_id,ally_id,ally_name from clan_data,clan_wars where clan2=? and clan_id=clan1 and clan1 not in (select clan2 from clan_wars where clan1=?)");
statement.setInt(1, clan.getClanId());
statement.setInt(2, clan.getClanId());
}
else
// ID = 90
{
// War List
activeChar.sendPacket(new SystemMessage(SystemMessageId.WAR_LIST));
statement = con.prepareStatement("select clan_name,clan_id,ally_id,ally_name from clan_data,clan_wars where clan1=? and clan_id=clan2 and clan2 in (select clan1 from clan_wars where clan2=?)");
statement.setInt(1, clan.getClanId());
statement.setInt(2, clan.getClanId());
}
ResultSet rset = statement.executeQuery();
while(rset.next())
{