iu = new InventoryUpdate();
iu.addRemovedItem(item);
player.sendPacket(iu);
}
player.sendPacket(new UserInfo(player));
player.broadcastUserInfo();
} catch (NullPointerException e) {}
}
}
if (newHeroes.size() == 0)
{
_heroes.clear();
return;
}
Map<Integer, StatsSet> heroes = new FastMap<Integer, StatsSet>();
for (StatsSet hero : newHeroes)
{
int charId = hero.getInteger(Olympiad.CHAR_ID);
if (_completeHeroes != null && _completeHeroes.containsKey(charId))
{
StatsSet oldHero = _completeHeroes.get(charId);
int count = oldHero.getInteger(COUNT);
oldHero.set(COUNT, count + 1);
oldHero.set(PLAYED, 1);
heroes.put(charId, oldHero);
}
else
{
StatsSet newHero = new StatsSet();
newHero.set(Olympiad.CHAR_NAME, hero.getString(Olympiad.CHAR_NAME));
newHero.set(Olympiad.CLASS_ID, hero.getInteger(Olympiad.CLASS_ID));
newHero.set(COUNT, 1);
newHero.set(PLAYED, 1);
heroes.put(charId, newHero);
}
}
deleteItemsInDb();
_heroes.clear();
_heroes.putAll(heroes);
heroes.clear();
updateHeroes(false);
for (StatsSet hero : _heroes.values())
{
String name = hero.getString(Olympiad.CHAR_NAME);
L2PcInstance player = L2World.getInstance().getPlayer(name);
if (player != null)
{
player.setHero(true);
L2Clan clan = player.getClan();
if (clan != null)
{
clan.setReputationScore(clan.getReputationScore()+1000, true);
clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_BECAME_HERO_AND_GAINED_S2_REPUTATION_POINTS);
sm.addString(name);
sm.addNumber(1000);
clan.broadcastToOnlineMembers(sm);
}
player.sendPacket(new UserInfo(player));
player.broadcastUserInfo();
}
else
{