cancelAuction();
}
public boolean CanBid(L2Player bidder)
{
L2Clan bidder_clan = bidder.getClan();
if(bidder_clan == null || bidder_clan.getLeaderId() != bidder.getObjectId() || bidder_clan.getLevel() < getMinClanLevel())
{
if(getMinClanLevel() == 2)
{
bidder.sendPacket(Msg.ONLY_A_CLAN_LEADER_WHOSE_CLAN_IS_OF_LEVEL_2_OR_HIGHER_IS_ALLOWED_TO_PARTICIPATE_IN_A_CLAN_HALL_AUCTION);
}
else
{
bidder.sendMessage(new CustomMessage("l2p.gameserver.model.entity.Auction.MinClanLevel", bidder).addNumber(getMinClanLevel()));
}
return false;
}
if(bidder_clan.getHasHideout() > 0)
{
bidder.sendPacket(Msg.YOU_CANNOT_PARTICIPATE_IN_AN_AUCTION);
return false;
}
if(bidder_clan.getAuctionBiddedAt() > 0 && bidder_clan.getAuctionBiddedAt() != getId())
{
bidder.sendPacket(Msg.SINCE_YOU_HAVE_ALREADY_SUBMITTED_A_BID_YOU_ARE_NOT_ALLOWED_TO_PARTICIPATE_IN_ANOTHER_AUCTION_AT_THIS_TIME);
return false;
}
for(Auction auction : AuctionManager.getInstance().getAuctions())
{
if(!equals(auction) && auction.getBidders().containsKey(bidder_clan.getClanId()))
{
bidder.sendPacket(Msg.SINCE_YOU_HAVE_ALREADY_SUBMITTED_A_BID_YOU_ARE_NOT_ALLOWED_TO_PARTICIPATE_IN_ANOTHER_AUCTION_AT_THIS_TIME);
return false;
}
}
if(bidder_clan.getMembersCount() < getMinClanMembers())
{
bidder.sendMessage(new CustomMessage("l2p.gameserver.model.entity.Auction.MinClanMembers", bidder).addNumber(getMinClanMembers()));
return false;
}
if(getMinClanMembersAvgLevel() > 1)
{
float avg_level = 0;
int avg_level_count = 0;
for(L2ClanMember member : bidder_clan.getMembers())
{
if(member != null)
{
avg_level += member.getLevel();
avg_level_count++;