@Override protected final void writeImpl() { writeC(0x96); writeS(_activeChar.getName()); writeD(_clan.getClanId()); writeD(0x00); writeS(_clan.getName()); writeS(_clan.getLeaderName()); writeD(_clan.getCrestId()); // -> no, it's no longer used (nuocnam) fix by game writeD(_clan.getLevel()); writeD(_clan.getCastleId()); writeD(_clan.getHideoutId()); writeD(_clan.getFortId()); writeD(_clan.getRank()); writeD(_clan.getReputationScore()); writeD(0x00); writeD(0x00); writeD(_clan.getAllyId()); // c2 writeS(_clan.getAllyName()); // c2 writeD(_clan.getAllyCrestId()); // c2 writeD(_clan.isAtWar() ? 1 : 0); // c3 writeD(0x00); // T3 Unknown writeD(_clan.getMembers().length); for (L2ClanMember member : _clan.getMembers()) { if (member != null) { writeS(member.getName()); writeD(member.getLevel()); writeD(member.getClassId()); writeD(member.getSex() ? 1 : 0); writeD(member.getRaceOrdinal()); writeD(member.isOnline() ? member.getObjectId() : 0); writeD(member.getSponsor() != 0 ? 1 : 0); } } }
@Override protected final void writeImpl() { writeC(0x00); writeD(_charObjId); writeD(_canTeleport ? 0x01 : 0); if (_canTeleport && (_clan != null) && !_isJailed) { boolean isInCastleDefense = false; boolean isInFortDefense = false; L2SiegeClan siegeClan = null; Castle castle = CastleManager.getInstance().getCastle(_activeChar); Fort fort = FortManager.getInstance().getFort(_activeChar); SiegableHall hall = CHSiegeManager.getInstance().getNearbyClanHall(_activeChar); if ((castle != null) && castle.getSiege().getIsInProgress()) { // siege in progress siegeClan = castle.getSiege().getAttackerClan(_clan); if ((siegeClan == null) && castle.getSiege().checkIsDefender(_clan)) { isInCastleDefense = true; } } else if ((fort != null) && fort.getSiege().getIsInProgress()) { // siege in progress siegeClan = fort.getSiege().getAttackerClan(_clan); if ((siegeClan == null) && fort.getSiege().checkIsDefender(_clan)) { isInFortDefense = true; } } writeD(_clan.getHideoutId() > 0 ? 0x01 : 0x00); // 6d 01 00 00 00 - to hide away writeD( (_clan.getCastleId() > 0) || isInCastleDefense ? 0x01 : 0x00); // 6d 02 00 00 00 - to castle writeD( (TerritoryWarManager.getInstance().getFlagForClan(_clan) != null) || ((siegeClan != null) && !isInCastleDefense && !isInFortDefense && !siegeClan.getFlag().isEmpty()) || ((hall != null) && hall.getSiege().checkIsAttacker(_clan)) ? 0x01 : 0x00); // 6d 03 00 00 00 - to siege HQ writeD(_sweepable ? 0x01 : 0x00); // sweepable (blue glow) writeD(_access.allowFixedRes() ? 0x01 : 0x00); // 6d 04 00 00 00 - to FIXED writeD( (_clan.getFortId() > 0) || isInFortDefense ? 0x01 : 0x00); // 6d 05 00 00 00 - to fortress } else { writeD(0x00); // 6d 01 00 00 00 - to hide away writeD(0x00); // 6d 02 00 00 00 - to castle writeD(0x00); // 6d 03 00 00 00 - to siege HQ writeD(_sweepable ? 0x01 : 0x00); // sweepable (blue glow) writeD(_access.allowFixedRes() ? 0x01 : 0x00); // 6d 04 00 00 00 - to FIXED writeD(0x00); // 6d 05 00 00 00 - to fortress } // TODO: protocol 152 // @formatter:off /* * writeC(0); //show die animation * writeD(0); //agathion ress button * writeD(0); //additional free space */ // @formatter:on }