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
{
Connection con = null;
PreparedStatement statement = null;
ResultSet rset = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
statement = con.prepareStatement(GET_CLAN_NAME);
statement.setString(1, name);
rset = statement.executeQuery();
if (rset.next())
{
String clanName = rset.getString("clan_name");
if (clanName != null)
{
L2Clan clan = ClanTable.getInstance().getClanByName(clanName);
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);
}