BBMAXI 14 Опубликовано 21 ноября, 2010 Смена цвета ника клан лидера Index: L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 1434) +++ L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -1659,6 +1659,21 @@ { return !_recomChars.contains(target.getObjectId()); } + + public int getNameColor() + { + if ((getAppearance().getNameColor() == 0xFFFFFF) && (getClan() != null)) + { + if (getClan().getHasCastle() > 0) + { + if (isClanLeader()) + return 0xFFFF00; //TODO: fill in Lord's Color + else + return 0xFF33FF; //TODO: fill in Member's Color + } + } + return getAppearance().getNameColor(); + } /** * Set the exp of the L2PcInstance before a death Index: L2_GameServer_It/java/net/sf/l2j/gameserver/model/L2Clan.java =================================================================== --- L2_GameServer_It/java/net/sf/l2j/gameserver/model/L2Clan.java (revision 1434) +++ L2_GameServer_It/java/net/sf/l2j/gameserver/model/L2Clan.java (working copy) @@ -34,6 +34,7 @@ import net.sf.l2j.gameserver.datatables.SkillTable; import net.sf.l2j.gameserver.instancemanager.CastleManager; import net.sf.l2j.gameserver.instancemanager.SiegeManager; +import net.sf.l2j.gameserver.model.L2World; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.serverpackets.ItemList; @@ -580,6 +581,24 @@ public void setHasCastle(int hasCastle) { _hasCastle = hasCastle; + // Force online clan members to re-broadcast their info + // because castle status has changed. This is due to + // new custom name color changes related to a clan's + // castle (if any). + // This is expected to be an expensive operation though + // considering how often this is called it should not + // be too bad (called rarely). + for (L2ClanMember clanMember: _members.values()) + { + L2PcInstance player = null; + try + { + player = L2World.getInstance().getPlayer(clanMember.getName()); + } + catch(Exception e) {} + if (player != null) + player.broadcastUserInfo(); + } } /** * @param hasHideout The hasHideout to set. Index: L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/CharInfo.java =================================================================== --- L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/CharInfo.java (revision 1434) +++ L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/CharInfo.java (working copy) @@ -332,7 +332,7 @@ writeD(_activeChar.GetFishy()); writeD(_activeChar.GetFishz()); - writeD(_activeChar.getAppearance().getNameColor()); + writeD(_activeChar.getNameColor()); writeD(0x00); // isRunning() as in UserInfo? Index: L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/UserInfo.java =================================================================== --- L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/UserInfo.java (revision 1434) +++ L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/UserInfo.java (working copy) @@ -300,7 +300,7 @@ writeD(_activeChar.GetFishx()); //fishing x writeD(_activeChar.GetFishy()); //fishing y writeD(_activeChar.GetFishz()); //fishing z - writeD(_activeChar.getAppearance().getNameColor()); + writeD(_activeChar.getNameColor()); //new c5 writeC(_activeChar.isRunning() ? 0x01 : 0x00); //changes the Speed display on Status Window Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты