Цитата:
Сообщение от Mantra
user info же?
|
да
https://bitbucket.org/_dev_/netpro/s...ets/?at=master
Код:
@Override
protected void writeImpl(PacketBody body)
{
body.D(_activeChar.getObjectId());
body.D(_initSize);
body.H(23);
body.B(_masks);
if (containsMask(UserInfoType.RELATION))
{
body.D(_relation);
}
if (containsMask(UserInfoType.BASIC_INFO))
{
body.H(16 + (_activeChar.getName().length() * 2));
body.CS(_activeChar.getName());
body.C(_activeChar.isGM() ? 0x01 : 0x00);
body.C(_activeChar.getRace().ordinal());
body.C(_activeChar.getAppearance().getSex() ? 0x01 : 0x00);
body.D(_activeChar.getInitialClassId());
body.D(_activeChar.getClassId().getId());
body.C(_activeChar.getLevel());
}
if (containsMask(UserInfoType.BASE_STATS))
{
body.H(18);
body.H(_activeChar.getSTR());
body.H(_activeChar.getDEX());
body.H(_activeChar.getCON());
body.H(_activeChar.getINT());
body.H(_activeChar.getWIT());
body.H(_activeChar.getMEN());
body.H(_activeChar.getLUC());
body.H(_activeChar.getCHA());
}
if (containsMask(UserInfoType.MAX_HPCPMP))
{
body.H(14);
body.D(_activeChar.getMaxHp());
body.D(_activeChar.getMaxMp());
body.D(_activeChar.getMaxCp());
}
if (containsMask(UserInfoType.CURRENT_HPMPCP_EXP_SP))
{
body.H(38);
body.D((int) Math.round(_activeChar.getCurrentHp()));
body.D((int) Math.round(_activeChar.getCurrentMp()));
body.D((int) Math.round(_activeChar.getCurrentCp()));
body.Q(_activeChar.getSp());
body.Q(_activeChar.getExp());
body.F((float) (_activeChar.getExp() - ExperienceData.getInstance().getExpForLevel(_activeChar.getLevel())) / (ExperienceData.getInstance().getExpForLevel(_activeChar.getLevel() + 1) - ExperienceData.getInstance().getExpForLevel(_activeChar.getLevel())));
}
if (containsMask(UserInfoType.ENCHANTLEVEL))
{
body.H(4);
body.C(_enchantLevel);
body.C(_armorEnchant);
}
if (containsMask(UserInfoType.APPAREANCE))
{
body.H(15);
body.D(_activeChar.getVisualHair());
body.D(_activeChar.getVisualHairColor());
body.D(_activeChar.getVisualFace());
body.C(_activeChar.isHairAccessoryEnabled() ? 0x01 : 0x00);
}
if (containsMask(UserInfoType.STATUS))
{
body.H(6);
body.C(_activeChar.getMountType().ordinal());
body.C(_activeChar.getPrivateStoreType().getId());
body.C(_activeChar.hasDwarvenCraft() || (_activeChar.getSkillLevel(248) > 0) ? 1 : 0);
body.C(_activeChar.getAbilityPointsUsed());
}
if (containsMask(UserInfoType.STATS))
{
body.H(56);
if (_activeChar.getActiveWeaponItem() != null)
{
final L2Weapon weaponItem = _activeChar.getActiveWeaponItem();
if (weaponItem.getItemType() == WeaponType.POLE)
{
body.H(80);
}
else if (weaponItem.getItemType() == WeaponType.BOW)
{
body.H(500);
}
else if (weaponItem.getItemType() == WeaponType.CROSSBOW)
{
body.H(400);
}
else
{
body.H(40);
}
}
else
{
body.H(0);
}
body.D((int) _activeChar.getPAtk(null));
body.D((int) _activeChar.getPAtkSpd());
body.D((int) _activeChar.getPDef(null));
body.D(_activeChar.getEvasionRate(null));
body.D(_activeChar.getAccuracy());
body.D(_activeChar.getCriticalHit(null, null));
body.D((int) _activeChar.getMAtk(null, null));
body.D(_activeChar.getMAtkSpd());
body.D((int) _activeChar.getPAtkSpd()); // Seems like atk speed - 1
body.D(_activeChar.getMagicEvasionRate(null));
body.D((int) _activeChar.getMDef(null, null));
body.D(_activeChar.getMagicAccuracy());
body.D(_activeChar.getMCriticalHit(null, null));
}
if (containsMask(UserInfoType.ELEMENTALS))
{
body.H(14);
body.H(_activeChar.getDefenseElementValue(Elementals.FIRE));
body.H(_activeChar.getDefenseElementValue(Elementals.WATER));
body.H(_activeChar.getDefenseElementValue(Elementals.WIND));
body.H(_activeChar.getDefenseElementValue(Elementals.EARTH));
body.H(_activeChar.getDefenseElementValue(Elementals.HOLY));
body.H(_activeChar.getDefenseElementValue(Elementals.DARK));
}
if (containsMask(UserInfoType.POSITION))
{
body.H(18);
body.D(_activeChar.getX());
body.D(_activeChar.getY());
body.D(_activeChar.getZ());
body.D(_activeChar.isInVehicle() ? _activeChar.getVehicle().getObjectId() : 0);
}
if (containsMask(UserInfoType.SPEED))
{
body.H(18);
body.H(_runSpd);
body.H(_walkSpd);
body.H(_swimRunSpd);
body.H(_swimWalkSpd);
body.H(_flRunSpd);
body.H(_flWalkSpd);
body.H(_flyRunSpd);
body.H(_flyWalkSpd);
}
if (containsMask(UserInfoType.MULTIPLIER))
{
body.H(18);
body.F(_moveMultiplier);
body.F(_activeChar.getAttackSpeedMultiplier());
}
if (containsMask(UserInfoType.COL_RADIUS_HEIGHT))
{
body.H(18);
body.F(_activeChar.getCollisionRadius());
body.F(_activeChar.getCollisionHeight());
}
if (containsMask(UserInfoType.ATK_ELEMENTAL))
{
body.H(5);
final byte attackAttribute = _activeChar.getAttackElement();
body.C(attackAttribute);
body.H(_activeChar.getAttackElementValue(attackAttribute));
}
if (containsMask(UserInfoType.CLAN))
{
body.H(32 + (_title.length() * 2));
body.CS(_title);
body.H(_activeChar.getPledgeType());
body.D(_activeChar.getClanId());
body.D(_activeChar.getClanCrestLargeId());
body.D(_activeChar.getClanCrestId());
body.D(_activeChar.getClanPrivileges().getBitmask());
body.C(_activeChar.isClanLeader() ? 1 : 0);
body.D(_activeChar.getAllyId());
body.D(_activeChar.getAllyCrestId());
body.C(_activeChar.isInPartyMatchRoom() ? 0x01 : 0x00);
}
if (containsMask(UserInfoType.SOCIAL))
{
body.H(22);
body.C(_activeChar.getPvpFlag());
body.D(_activeChar.getReputation());
body.C(_activeChar.isNoble() ? 0x01 : 0x00);
body.C(_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) ? 1 : 0);
body.C(_activeChar.getPledgeClass());
body.D(_activeChar.getPkKills());
body.D(_activeChar.getPvpKills());
body.H(_activeChar.getRecomLeft());
body.H(_activeChar.getRecomHave());
}
if (containsMask(UserInfoType.VITA_FAME))
{
body.H(15);
body.D(_activeChar.getVitalityPoints());
body.C(0x00); // Vita Bonus
body.D(_activeChar.getFame());
body.D(_activeChar.getRaidPoints());
}
if (containsMask(UserInfoType.SLOTS))
{
body.H(9);
body.C(_activeChar.getInventory().getTalismanSlots()); // Confirmed
body.C(_activeChar.getInventory().getBroochJewelSlots()); // Confirmed
body.C(_activeChar.getTeam().getId()); // Confirmed
body.C(0x00); // (1 = Red, 2 = White, 3 = White Pink) dotted ring on the floor
body.C(0x00);
body.C(0x00);
body.C(0x00);
}
if (containsMask(UserInfoType.MOVEMENTS))
{
body.H(4);
body.C(_activeChar.isInsideZone(ZoneId.WATER) ? 1 : _activeChar.isFlyingMounted() ? 2 : 0);
body.C(_activeChar.isRunning() ? 0x01 : 0x00);
}
if (containsMask(UserInfoType.COLOR))
{
body.H(10);
body.D(_activeChar.getAppearance().getNameColor());
body.D(_activeChar.getAppearance().getTitleColor());
}
if (containsMask(UserInfoType.INVENTORY_LIMIT))
{
body.H(9);
body.H(0x00);
body.H(0x00);
body.H(_activeChar.getInventoryLimit());
body.C(_activeChar.isCursedWeaponEquipped() ? CursedWeaponsManager.getInstance().getLevel(_activeChar.getCursedWeaponEquippedId()) : 0);
}
if (containsMask(UserInfoType.UNK_3))
{
body.H(9);
body.C(0x01);
body.H(0x00);
body.D(0x00);
}
}