player.sendMessage("You can't declare war. You are not clan leader.");
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
L2Clan clan = ClanTable.getInstance().getClanByName(_pledgeName);
if (clan == null)
{
SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_WAR_CANNOT_DECLARED_CLAN_NOT_EXIST);
player.sendPacket(sm);
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
else if (_clan.getAllyId() == clan.getAllyId() && _clan.getAllyId() != 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_WAR_AGAINST_A_ALLIED_CLAN_NOT_WORK);
player.sendPacket(sm);
player.sendPacket(ActionFailed.STATIC_PACKET);
sm = null;
return;
}
else if (clan.getLevel() < 3 || clan.getMembersCount() < Config.ALT_CLAN_MEMBERS_FOR_WAR)
{
SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_WAR_DECLARED_IF_CLAN_LVL3_OR_15_MEMBER);
player.sendPacket(sm);
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
else if (_clan.isAtWarWith(clan.getClanId()))
{
SystemMessage sm = new SystemMessage(SystemMessageId.ALREADY_AT_WAR_WITH_S1_WAIT_5_DAYS); // msg id 628
sm.addString(clan.getName());
player.sendPacket(sm);
player.sendPacket(ActionFailed.STATIC_PACKET);
sm = null;
return;
}
// _log.warning("RequestStartPledgeWar, leader: " + clan.getLeaderName() + " clan: "+ _clan.getName());
// L2PcInstance leader = L2World.getInstance().getPlayer(clan.getLeaderName());
// if(leader == null)
// return;
// if(leader != null && leader.isOnline() == 0)
// {
// player.sendMessage("Clan leader isn't online.");
// player.sendPacket(ActionFailed.STATIC_PACKET);
// return;
// }
// if (leader.isProcessingRequest())
// {
// SystemMessage sm = new SystemMessage(SystemMessage.S1_IS_BUSY_TRY_LATER);
// sm.addString(leader.getName());
// player.sendPacket(sm);
// return;
// }
// if (leader.isTransactionInProgress())
// {
// SystemMessage sm = new SystemMessage(SystemMessage.S1_IS_BUSY_TRY_LATER);
// sm.addString(leader.getName());
// player.sendPacket(sm);
// return;
// }
// leader.setTransactionRequester(player);
// player.setTransactionRequester(leader);
// leader.sendPacket(new StartPledgeWar(_clan.getName(),player.getName()));
ClanTable.getInstance().storeclanswars(player.getClanId(), clan.getClanId());
for (L2PcInstance cha : L2World.getInstance().getAllPlayers())
{
if (cha.getClan() == player.getClan() || cha.getClan() == clan)
{
cha.broadcastUserInfo();