Sync with L2jServer HighFive Jul 25th 2015.

This commit is contained in:
MobiusDev
2015-07-26 10:59:25 +00:00
parent 83854bc5e5
commit 1fc14085f5
161 changed files with 2288 additions and 2181 deletions

View File

@@ -24,7 +24,7 @@ import java.sql.ResultSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.commons.database.pool.impl.ConnectionFactory;
import com.l2jserver.gameserver.handler.IUserCommandHandler;
import com.l2jserver.gameserver.model.L2Clan;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
@@ -64,57 +64,53 @@ public class ClanWarsList implements IUserCommandHandler
return false;
}
try (Connection con = L2DatabaseFactory.getInstance().getConnection())
String query;
// Attack List
if (id == 88)
{
String query;
// Attack List
if (id == 88)
{
activeChar.sendPacket(SystemMessageId.CLANS_YOU_VE_DECLARED_WAR_ON);
query = ATTACK_LIST;
}
// Under Attack List
else if (id == 89)
{
activeChar.sendPacket(SystemMessageId.CLANS_THAT_HAVE_DECLARED_WAR_ON_YOU);
query = UNDER_ATTACK_LIST;
}
// War List
else
{
activeChar.sendPacket(SystemMessageId.CLAN_WAR_LIST);
query = WAR_LIST;
}
activeChar.sendPacket(SystemMessageId.CLANS_YOU_VE_DECLARED_WAR_ON);
query = ATTACK_LIST;
}
// Under Attack List
else if (id == 89)
{
activeChar.sendPacket(SystemMessageId.CLANS_THAT_HAVE_DECLARED_WAR_ON_YOU);
query = UNDER_ATTACK_LIST;
}
// War List
else
{
activeChar.sendPacket(SystemMessageId.CLAN_WAR_LIST);
query = WAR_LIST;
}
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement(query))
{
ps.setInt(1, clan.getId());
ps.setInt(2, clan.getId());
try (PreparedStatement ps = con.prepareStatement(query))
SystemMessage sm;
try (ResultSet rs = ps.executeQuery())
{
ps.setInt(1, clan.getId());
ps.setInt(2, clan.getId());
SystemMessage sm;
try (ResultSet rs = ps.executeQuery())
while (rs.next())
{
String clanName;
int ally_id;
while (rs.next())
String clanName = rs.getString("clan_name");
int allyId = rs.getInt("ally_id");
if (allyId > 0)
{
clanName = rs.getString("clan_name");
ally_id = rs.getInt("ally_id");
if (ally_id > 0)
{
// Target With Ally
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_S2_ALLIANCE);
sm.addString(clanName);
sm.addString(rs.getString("ally_name"));
}
else
{
// Target Without Ally
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_NO_ALLIANCE_EXISTS);
sm.addString(clanName);
}
activeChar.sendPacket(sm);
// Target With Ally
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_S2_ALLIANCE);
sm.addString(clanName);
sm.addString(rs.getString("ally_name"));
}
else
{
// Target Without Ally
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_NO_ALLIANCE_EXISTS);
sm.addString(clanName);
}
activeChar.sendPacket(sm);
}
}
activeChar.sendPacket(SystemMessageId.EMPTY3);