Перейти к содержанию
Авторизация  
nerosermax

Проблема Со Всеми R Пухами

Рекомендуемые сообщения

Картинки все скажут

 

Так себя вижу: Одетый и с Р пухой

 

post-8417-0-82894300-1376812000_thumb.jpg

 

 

Так меня видят другие персонажы

 

post-8417-0-74522800-1376812016_thumb.jpg

 

 

В чем проблема? Я весь CharInfo перерыл.

Изменено пользователем nerosermax

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

ну для начала сказал бы какие конкретно у тебя хроники, а во вторых - привел бы код своего CharInfo

  • Upvote 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Глори дай

 

package lineage2.gameserver.network.serverpackets;
import javolution.util.FastList;
import lineage2.gameserver.Config;
import lineage2.gameserver.instancemanager.CursedWeaponsManager;
import lineage2.gameserver.instancemanager.ReflectionManager;
import lineage2.gameserver.model.Creature;
import lineage2.gameserver.model.Player;
import lineage2.gameserver.model.base.TeamType;
import lineage2.gameserver.model.instances.DecoyInstance;
import lineage2.gameserver.model.items.Inventory;
import lineage2.gameserver.model.items.PcInventory;
import lineage2.gameserver.model.matching.MatchingRoom;
import lineage2.gameserver.model.pledge.Alliance;
import lineage2.gameserver.model.pledge.Clan;
import lineage2.gameserver.skills.effects.EffectCubic;
import lineage2.gameserver.utils.Location;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CharInfo extends L2GameServerPacket
{
private static final Logger _log = LoggerFactory.getLogger(CharInfo.class);
private int[][] _inv;
private int _mAtkSpd, _pAtkSpd;
private int _runSpd, _walkSpd, _swimSpd, _flRunSpd, _flWalkSpd, _flyRunSpd, _flyWalkSpd;
private Location _loc, _fishLoc;
private String _name, _title;
private int _objId, _race, _sex, base_class, pvp_flag, karma, rec_have;
private double speed_move, speed_atack, col_radius, col_height;
private int hair_style, hair_color, face;
private int clan_id, clan_crest_id, large_clan_crest_id, ally_id, ally_crest_id, class_id;
private int _sit, _run, _combat, _dead, private_store, _enchant;
private int _noble, _hero, _fishing, mount_type;
private int plg_class, pledge_type, clan_rep_score, cw_level, mount_id;
private int _nameColor, _title_color, _transform, _agathion, _clanBoatObjectId;
private EffectCubic[] cubics;
private boolean _isPartyRoomLeader, _isFlying;
private TeamType _team;
private int curHP, maxHP, curMP, maxMP, curCP;
public CharInfo(Player cha)
{
 this((Creature) cha);
}
public CharInfo(DecoyInstance cha)
{
 this((Creature) cha);
}
public CharInfo(Creature cha)
{
 if (cha == null)
 {
  System.out.println("CharInfo: cha is null!");
  Thread.dumpStack();
  return;
 }
 if (cha.isInvisible())
  return;
 if (cha.isDeleted())
  return;
 Player player = cha.getPlayer();
 if (player == null)
  return;
 if (player.isInBoat())
 {
  _loc = player.getInBoatPosition();
  if (player.isClanAirShipDriver())
   _clanBoatObjectId = player.getBoat().getBoatId();
 }
 if (_loc == null)
  _loc = cha.getLoc();
 _objId = cha.getObjectId();
 // Проклятое оружие и трансформации для ТВ скрывают имя и все остальные
 // опознавательные знаки
 if (player.getTransformationName() != null || (player.getReflection() == ReflectionManager.GIRAN_HARBOR || player.getReflection() == ReflectionManager.PARNASSUS)
	  && player.getPrivateStoreType() != Player.STORE_PRIVATE_NONE)
 {
  _name = player.getTransformationName() != null ? player.getTransformationName() : player.getName();
  _title = "";
  clan_id = 0;
  clan_crest_id = 0;
  ally_id = 0;
  ally_crest_id = 0;
  large_clan_crest_id = 0;
  if (player.isCursedWeaponEquipped())
   cw_level = CursedWeaponsManager.getInstance().getLevel(player.getCursedWeaponEquippedId());
 }
 else
 {
  _name = player.getName();
  if (player.getPrivateStoreType() != Player.STORE_PRIVATE_NONE)
   _title = "";
  else if (!player.isConnected())
  {
   _title = "NO CARRIER";
   _title_color = 255;
  }
  else
  {
   _title = player.getTitle();
   _title_color = player.getTitleColor();
  }
  Clan clan = player.getClan();
  Alliance alliance = clan == null ? null : clan.getAlliance();
  //
  clan_id = clan == null ? 0 : clan.getClanId();
  clan_crest_id = clan == null ? 0 : clan.getCrestId();
  large_clan_crest_id = clan == null ? 0 : clan.getCrestLargeId();
  //
  ally_id = alliance == null ? 0 : alliance.getAllyId();
  ally_crest_id = alliance == null ? 0 : alliance.getAllyCrestId();
  cw_level = 0;
 }
 if (player.isMounted())
 {
  _enchant = 0;
  mount_id = player.getMountNpcId() + 1000000;
  mount_type = player.getMountType();
 }
 else
 {
  _enchant = player.getEnchantEffect();
  mount_id = 0;
  mount_type = 0;
 }
 _inv = new int[inventory.PAPERDOLL_MAX][2];
 for (int PAPERDOLL_ID : PAPERDOLL_ORDER)
 {
  _inv[PAPERDOLL_ID][0] = player.getInventory().getPaperdollItemId(PAPERDOLL_ID);
  _inv[PAPERDOLL_ID][1] = player.getInventory().getPaperdollAugmentationId(PAPERDOLL_ID);
 }
 _mAtkSpd = player.getMAtkSpd();
 _pAtkSpd = player.getPAtkSpd();
 speed_move = player.getMovementSpeedMultiplier();
 _runSpd = (int) (player.getRunSpeed() / speed_move);
 _walkSpd = (int) (player.getWalkSpeed() / speed_move);
 _flRunSpd = 0; // TODO
 _flWalkSpd = 0; // TODO
 if (player.isFlying())
 {
  _flyRunSpd = _runSpd;
  _flyWalkSpd = _walkSpd;
 }
 else
 {
  _flyRunSpd = 0;
  _flyWalkSpd = 0;
 }
 _swimSpd = player.getSwimSpeed();
 _race = player.getRace().ordinal();
 _sex = player.getSex();
 base_class = player.getBaseClassId();
 pvp_flag = player.getPvpFlag();
 karma = player.getKarma();
 speed_atack = player.getAttackSpeedMultiplier();
 col_radius = player.getColRadius();
 col_height = player.getColHeight();
 hair_style = player.getHairStyle();
 hair_color = player.getHairColor();
 face = player.getFace();
 if (clan_id > 0 && player.getClan() != null)
  clan_rep_score = player.getClan().getReputationScore();
 else
  clan_rep_score = 0;
 _sit = player.isSitting() ? 0 : 1; // standing = 1 sitting = 0
 _run = player.isRunning() ? 1 : 0; // running = 1 walking = 0
 _combat = player.isInCombat() ? 1 : 0;
 _dead = player.isAlikeDead() ? 1 : 0;
 private_store = player.isInObserverMode() ? Player.STORE_OBSERVING_GAMES : player.getPrivateStoreType();
 cubics = player.getCubics().toArray(new EffectCubic[player.getCubics().size()]);
 rec_have = player.isGM() ? 0 : player.getRecomHave();
 class_id = player.getClassId().getId();
 _team = player.getTeam();
 _noble = player.isNoble() ? 1 : 0; // 0x01: symbol on char menu ctrl+I
 _hero = player.isHero() || player.isGM() && Config.GM_HERO_AURA ? 1 : 0; // 0x01:
 // Hero
 // Aura
 _fishing = player.isFishing() ? 1 : 0;
 _fishLoc = player.getFishLoc();
 _nameColor = player.getNameColor(); // New C5
 plg_class = player.getPledgeClass();
 pledge_type = player.getPledgeType();
 _transform = player.getTransformation();
 _agathion = player.getAgathionId();
 _isPartyRoomLeader = player.getMatchingRoom() != null && player.getMatchingRoom().getType() == MatchingRoom.PARTY_MATCHING && player.getMatchingRoom().getLeader() == player;
 _isFlying = player.isInFlyingTransform();
 curCP = (int) player.getCurrentCp();
 curHP = (int) player.getCurrentHp();
 maxHP = player.getMaxHp();
 curMP = (int) player.getCurrentMp();
 maxMP = player.getMaxMp();
}
@Override
protected final void writeImpl()
{
 Player activeChar = getClient().getActiveChar();
 if (activeChar == null)
  return;
 if (_objId == 0)
  return;
 if (activeChar.getObjectId() == _objId)
 {
  _log.error("You cant send CharInfo about his character to active user!!!");
  return;
 }
 writeC(0x31);
 writeD(_loc.x);
 writeD(_loc.y);
 writeD(_loc.z + Config.CLIENT_Z_SHIFT);
 writeD(_clanBoatObjectId);
 writeD(_objId);
 writeS(_name);
 writeD(_race);
 writeD(_sex);
 writeD(base_class);
 for (int PAPERDOLL_ID : PAPERDOLL_ORDER)
  writeD(_inv[PAPERDOLL_ID][0]);
 for (int PAPERDOLL_ID : PAPERDOLL_ORDER)
  writeD(_inv[PAPERDOLL_ID][1]);
 writeD(0x01); // TODO talisman count(VISTALL)
 writeD(0x00); // TODO cloak status(VISTALL)
 writeD(pvp_flag);
 writeD(karma);
 writeD(0); // Tauti
 writeD(0); // Tauti
 writeD(0); // Tauti
 writeD(0); // Tauti
 writeD(0); // Tauti
 writeD(0); // Tauti
 writeD(0); // Tauti
 writeD(0); // Tauti
 writeD(0); // Tauti
 writeD(_mAtkSpd);
 writeD(_pAtkSpd);
 writeD(0x00);
 writeD(_runSpd);
 writeD(_walkSpd);
 writeD(_swimSpd);
 writeD(_swimSpd);
 writeD(_flRunSpd);
 writeD(_flWalkSpd);
 writeD(_flyRunSpd);
 writeD(_flyWalkSpd);
 writeF(speed_move); // _cha.getProperMultiplier()
 writeF(speed_atack); // _cha.getAttackSpeedMultiplier()
 writeF(col_radius);
 writeF(col_height);
 writeD(hair_style);
 writeD(hair_color);
 writeD(face);
 writeS(_title);
 writeD(clan_id);
 writeD(clan_crest_id);
 writeD(ally_id);
 writeD(ally_crest_id);
 writeC(_sit);
 writeC(_run);
 writeC(_combat);
 writeC(_dead);
 writeC(0x00); // is invisible
 writeC(mount_type); // 1-on Strider, 2-on Wyvern, 3-on Great Wolf, 0-no
 // mount
 writeC(private_store);
 writeH(cubics.length);
 for (EffectCubic cubic : cubics)
  writeH(cubic == null ? 0 : cubic.getId());
 writeC(_isPartyRoomLeader ? 0x01 : 0x00); // find party members
 writeC(_isFlying ? 0x02 : 0x00);
 writeH(rec_have);
 writeD(mount_id);
 writeD(class_id);
 writeD(0x00);
 writeC(_enchant);
 writeC(_team.ordinal()); // team circle around feet 1 = Blue, 2 = red
 writeD(large_clan_crest_id);
 writeC(_noble);
 writeC(_hero);
 writeC(_fishing);
 writeD(_fishLoc.x);
 writeD(_fishLoc.y);
 writeD(_fishLoc.z);
 writeD(_nameColor);
 writeD(_loc.h);
 writeD(plg_class);
 writeD(pledge_type);
 writeD(_title_color);
 writeD(cw_level);
 writeD(clan_rep_score);
 writeD(_transform);
 writeD(_agathion);
 writeD(0x01); // T2
 writeD(0x00);// Unknown1 (GOD)
 writeD(0x00);// Unknown2 (GOD)
 writeD(0x00);// Unknown3 (GOD)
 writeD(curCP);
 writeD(curHP);
 writeD(maxHP);
 writeD(curMP);
 writeD(maxMP);
 writeD(0x00);
 writeD(0x00);// Unknown9 (GOD)
 writeC(0x00);// Unknown10 (GOD)

 writeC(0x00); // Tauti
}
public static final int[] PAPERDOLL_ORDER = { Inventory.PAPERDOLL_UNDER, Inventory.PAPERDOLL_HEAD, Inventory.PAPERDOLL_RHAND, Inventory.PAPERDOLL_LHAND, Inventory.PAPERDOLL_GLOVES,
	 Inventory.PAPERDOLL_CHEST, Inventory.PAPERDOLL_LEGS, Inventory.PAPERDOLL_FEET, Inventory.PAPERDOLL_BACK, Inventory.PAPERDOLL_LRHAND, Inventory.PAPERDOLL_HAIR, Inventory.PAPERDOLL_DHAIR,
	 Inventory.PAPERDOLL_RBRACELET, Inventory.PAPERDOLL_LBRACELET, Inventory.PAPERDOLL_DECO1, Inventory.PAPERDOLL_DECO2, Inventory.PAPERDOLL_DECO3, Inventory.PAPERDOLL_DECO4,
	 Inventory.PAPERDOLL_DECO5, Inventory.PAPERDOLL_DECO6, Inventory.PAPERDOLL_BELT };
}

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

ну для начала у тебя пвп-флаг и карма шлются не на своем месте, во вторых не шлется внешний вид предметов, в третьих (хоть это к данной ситуации и не относится) - у тебя в пакете не реализована отсылка абнормалов по новому, т.е. так как они шлются с таути и далее

  • Upvote 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Хорошо а если так?

package lineage2.gameserver.network.serverpackets;
import javolution.util.FastList;
import lineage2.gameserver.Config;
import lineage2.gameserver.instancemanager.CursedWeaponsManager;
import lineage2.gameserver.instancemanager.ReflectionManager;
import lineage2.gameserver.model.Creature;
import lineage2.gameserver.model.Player;
import lineage2.gameserver.model.base.TeamType;
import lineage2.gameserver.model.instances.DecoyInstance;
import lineage2.gameserver.model.items.Inventory;
import lineage2.gameserver.model.items.PcInventory;
import lineage2.gameserver.model.matching.MatchingRoom;
import lineage2.gameserver.model.pledge.Alliance;
import lineage2.gameserver.model.pledge.Clan;
import lineage2.gameserver.skills.effects.EffectCubic;
import lineage2.gameserver.utils.Location;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CharInfo extends L2GameServerPacket
{
private static final Logger _log = LoggerFactory.getLogger(CharInfo.class);
private int[][] _inv;
private int _mAtkSpd, _pAtkSpd;
private int _runSpd, _walkSpd, _swimSpd, _flRunSpd, _flWalkSpd, _flyRunSpd, _flyWalkSpd;
private Location _loc, _fishLoc;
private String _name, _title;
private int _objId, _race, _sex, base_class, pvp_flag, karma, rec_have;
private double speed_move, speed_atack, col_radius, col_height;
private int hair_style, hair_color, face;
private int clan_id, clan_crest_id, large_clan_crest_id, ally_id, ally_crest_id, class_id;
private int _sit, _run, _combat, _dead, private_store, _enchant;
private int _noble, _hero, _fishing, mount_type;
private int plg_class, pledge_type, clan_rep_score, cw_level, mount_id;
private int _nameColor, _title_color, _transform, _agathion, _clanBoatObjectId;
private EffectCubic[] cubics;
private boolean _isPartyRoomLeader, _isFlying;
private TeamType _team;
private int curHP, maxHP, curMP, maxMP, curCP;
private FastList<Integer> _aveList;
private PcInventory inv;
public CharInfo(Player cha)
{
 this((Creature) cha);
}
public CharInfo(DecoyInstance cha)
{
 this((Creature) cha);
}
public CharInfo(Creature cha)
{
 if (cha == null)
 {
  System.out.println("CharInfo: cha is null!");
  Thread.dumpStack();
  return;
 }
 if (cha.isInvisible())
  return;
 if (cha.isDeleted())
  return;
 Player player = cha.getPlayer();
 if (player == null)
  return;
 if (player.isInBoat())
 {
  _loc = player.getInBoatPosition();
  if (player.isClanAirShipDriver())
   _clanBoatObjectId = player.getBoat().getBoatId();
 }
 if (_loc == null)
  _loc = cha.getLoc();
 _objId = cha.getObjectId();
 if (player.getTransformationName() != null || (player.getReflection() == ReflectionManager.GIRAN_HARBOR || player.getReflection() == ReflectionManager.PARNASSUS)
	  && player.getPrivateStoreType() != Player.STORE_PRIVATE_NONE)
 {
  _name = player.getTransformationName() != null ? player.getTransformationName() : player.getName();
  _title = "";
  clan_id = 0;
  clan_crest_id = 0;
  ally_id = 0;
  ally_crest_id = 0;
  large_clan_crest_id = 0;
  if (player.isCursedWeaponEquipped())
   cw_level = CursedWeaponsManager.getInstance().getLevel(player.getCursedWeaponEquippedId());
 }
 else
 {
  _name = player.getName();
  if (player.getPrivateStoreType() != Player.STORE_PRIVATE_NONE)
   _title = "";
  else if (!player.isConnected())
  {
   _title = "NO CARRIER";
   _title_color = 255;
  }
  else
  {
   _title = player.getTitle();
   _title_color = player.getTitleColor();
  }
  Clan clan = player.getClan();
  Alliance alliance = clan == null ? null : clan.getAlliance();
  //
  clan_id = clan == null ? 0 : clan.getClanId();
  clan_crest_id = clan == null ? 0 : clan.getCrestId();
  large_clan_crest_id = clan == null ? 0 : clan.getCrestLargeId();
  //
  ally_id = alliance == null ? 0 : alliance.getAllyId();
  ally_crest_id = alliance == null ? 0 : alliance.getAllyCrestId();
  cw_level = 0;
 }
 if (player.isMounted())
 {
  _enchant = 0;
  mount_id = player.getMountNpcId() + 1000000;
  mount_type = player.getMountType();
 }
 else
 {
  _enchant = player.getEnchantEffect();
  mount_id = 0;
  mount_type = 0;
 }
 _inv = new int[inventory.PAPERDOLL_MAX][2];
 for (int PAPERDOLL_ID : PAPERDOLL_ORDER)
 {
  _inv[PAPERDOLL_ID][0] = player.getInventory().getPaperdollItemId(PAPERDOLL_ID);
  _inv[PAPERDOLL_ID][1] = player.getInventory().getPaperdollAugmentationId(PAPERDOLL_ID);
 }
 _mAtkSpd = player.getMAtkSpd();
 _pAtkSpd = player.getPAtkSpd();

 speed_move = player.getMovementSpeedMultiplier();
 _runSpd = (int) (player.getRunSpeed() / speed_move);
 _walkSpd = (int) (player.getWalkSpeed() / speed_move);
 _flRunSpd = 0; // TODO
 _flWalkSpd = 0; // TODO
 if (player.isFlying())
 {
  _flyRunSpd = _runSpd;
  _flyWalkSpd = _walkSpd;
 }
 else
 {
  _flyRunSpd = 0;
  _flyWalkSpd = 0;
 }
 _swimSpd = player.getSwimSpeed();
 _race = player.getRace().ordinal();
 _sex = player.getSex();
 base_class = player.getBaseClassId();
 pvp_flag = player.getPvpFlag();
 karma = player.getKarma();
 speed_atack = player.getAttackSpeedMultiplier();
 col_radius = player.getColRadius();
 col_height = player.getColHeight();
 hair_style = player.getHairStyle();
 hair_color = player.getHairColor();
 face = player.getFace();
 if (clan_id > 0 && player.getClan() != null)
  clan_rep_score = player.getClan().getReputationScore();
 else
  clan_rep_score = 0;
 _sit = player.isSitting() ? 0 : 1; // standing = 1 sitting = 0
 _run = player.isRunning() ? 1 : 0; // running = 1 walking = 0
 _combat = player.isInCombat() ? 1 : 0;
 _dead = player.isAlikeDead() ? 1 : 0;
 private_store = player.isInObserverMode() ? Player.STORE_OBSERVING_GAMES : player.getPrivateStoreType();
 cubics = player.getCubics().toArray(new EffectCubic[player.getCubics().size()]);
 rec_have = player.isGM() ? 0 : player.getRecomHave();
 class_id = player.getClassId().getId();
 _team = player.getTeam();
 _noble = player.isNoble() ? 1 : 0; // 0x01: symbol on char menu ctrl+I
 _hero = player.isHero() || player.isGM() && Config.GM_HERO_AURA ? 1 : 0; // 0x01:
 // Hero
 // Aura
 _fishing = player.isFishing() ? 1 : 0;
 _fishLoc = player.getFishLoc();
 _nameColor = player.getNameColor(); // New C5
 plg_class = player.getPledgeClass();
 pledge_type = player.getPledgeType();
 _transform = player.getTransformation();
 _agathion = player.getAgathionId();
 _isPartyRoomLeader = player.getMatchingRoom() != null && player.getMatchingRoom().getType() == MatchingRoom.PARTY_MATCHING && player.getMatchingRoom().getLeader() == player;
 _isFlying = player.isInFlyingTransform();
 curCP = (int) player.getCurrentCp();
 curHP = (int) player.getCurrentHp();
 maxHP = player.getMaxHp();
 curMP = (int) player.getCurrentMp();
 maxMP = player.getMaxMp();
 _aveList = player.getAveList();
 inv = player.getInventory();
}
@Override
protected final void writeImpl()
{
 Player activeChar = getClient().getActiveChar();

 if (activeChar == null)
 {
  return;
 }

 if (_objId == 0)
 {
  return;
 }

 if (activeChar.getObjectId() == _objId)
 {
  _log.error("You cant send CharInfo about his character to active user!!!");
  return;
 }
 writeC(0x31);
 writeD(_loc.x);
 writeD(_loc.y);
 writeD(_loc.z + Config.CLIENT_Z_SHIFT);
 writeD(_clanBoatObjectId);
 writeD(_objId);
 writeS(_name);
 writeD(_race);
 writeD(_sex);
 writeD(base_class);
 for (int PAPERDOLL_ID : PAPERDOLL_ORDER)
 {
  writeD(_inv[PAPERDOLL_ID][0]);
 }
 for (int PAPERDOLL_ID : PAPERDOLL_ORDER)
 {
  writeD(_inv[PAPERDOLL_ID][1]);
 }
 writeD(0x01);    // TODO talisman count(VISTALL)
 writeD(0x00);    // TODO cloak status(VISTALL)

 writeD(pvp_flag);
 writeD(karma);
 writeD(inv.getVisualItemId(Inventory.PAPERDOLL_RHAND)); // Tauti
 writeD(inv.getVisualItemId(Inventory.PAPERDOLL_LHAND)); // Tauti
 writeD(0); // Tauti
 writeD(inv.getVisualItemId(Inventory.PAPERDOLL_GLOVES)); // Tauti
 writeD(inv.getVisualItemId(Inventory.PAPERDOLL_CHEST)); // Tauti
 writeD(inv.getVisualItemId(Inventory.PAPERDOLL_LEGS)); // Tauti
 writeD(inv.getVisualItemId(Inventory.PAPERDOLL_FEET)); // Tauti
 writeD(inv.getVisualItemId(Inventory.PAPERDOLL_HAIR)); // Tauti
 writeD(inv.getVisualItemId(Inventory.PAPERDOLL_DHAIR)); // Tauti
 writeD(_mAtkSpd);
 writeD(_pAtkSpd);
 writeD(0x00);
 writeD(_runSpd);
 writeD(_walkSpd);
 writeD(_swimSpd);
 writeD(_swimSpd);
 writeD(_flRunSpd);
 writeD(_flWalkSpd);
 writeD(_flyRunSpd);
 writeD(_flyWalkSpd);

 writeF(speed_move); // _cha.getProperMultiplier()
 writeF(speed_atack); // _cha.getAttackSpeedMultiplier()
 writeF(col_radius);
 writeF(col_height);
 writeD(hair_style);
 writeD(hair_color);
 writeD(face);
 writeS(_title);
 writeD(clan_id);
 writeD(clan_crest_id);
 writeD(ally_id);
 writeD(ally_crest_id);
 writeC(_sit);
 writeC(_run);
 writeC(_combat);
 writeC(_dead);
 writeC(0x00); // is invisible
 writeC(mount_type); // 1-on Strider, 2-on Wyvern, 3-on Great Wolf, 0-no mount
 writeC(private_store);
 writeH(cubics.length);
 for (EffectCubic cubic : cubics)
 {
  writeH(cubic == null ? 0 : cubic.getId());
 }
 writeC(_isPartyRoomLeader ? 0x01 : 0x00); // find party members
 writeC(_isFlying ? 0x02 : 0x00);
 writeH(rec_have);
 writeD(mount_id);
 writeD(class_id);
 writeD(0x00);    // special effects? circles around player...
 writeC(_enchant);
 writeC(_team.ordinal()); // team circle around feet 1 = Blue, 2 = red
 writeD(large_clan_crest_id);
 writeC(_noble);
 writeC(_hero);
 writeC(_fishing);
 writeD(_fishLoc.x);
 writeD(_fishLoc.y);
 writeD(_fishLoc.z);
 writeD(_nameColor);
 writeD(_loc.h);
 writeD(plg_class);
 writeD(pledge_type);
 writeD(_title_color);
 writeD(cw_level);
 writeD(clan_rep_score);
 writeD(_transform);
 writeD(_agathion);
 writeD(0x01);    // T2
 writeD(0x00);
 writeD(0x00);
 writeD(0x00);
 writeD(curCP);
 writeD(curHP);
 writeD(maxHP);
 writeD(curMP);
 writeD(maxMP);
 writeD(0x00);
 writeD(0x00);
 writeC(0x00);
 if (_aveList != null)
 {
  writeD(_aveList.size());
  for (int i : _aveList)
  {
   writeD(i);
  }
 }
 else
 {
  writeD(0x00);
 }

 writeC(0x00);
}
public static final int[] PAPERDOLL_ORDER = { Inventory.PAPERDOLL_UNDER, Inventory.PAPERDOLL_HEAD, Inventory.PAPERDOLL_RHAND, Inventory.PAPERDOLL_LHAND, Inventory.PAPERDOLL_GLOVES,
	 Inventory.PAPERDOLL_CHEST, Inventory.PAPERDOLL_LEGS, Inventory.PAPERDOLL_FEET, Inventory.PAPERDOLL_BACK, Inventory.PAPERDOLL_LRHAND, Inventory.PAPERDOLL_HAIR, Inventory.PAPERDOLL_DHAIR,
	 Inventory.PAPERDOLL_RBRACELET, Inventory.PAPERDOLL_LBRACELET, Inventory.PAPERDOLL_DECO1, Inventory.PAPERDOLL_DECO2, Inventory.PAPERDOLL_DECO3, Inventory.PAPERDOLL_DECO4,
	 Inventory.PAPERDOLL_DECO5, Inventory.PAPERDOLL_DECO6, Inventory.PAPERDOLL_BELT };
}

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

ну для начала у тебя пвп-флаг и карма шлются не на своем месте, во вторых не шлется внешний вид предметов, в третьих (хоть это к данной ситуации и не относится) - у тебя в пакете не реализована отсылка абнормалов по новому, т.е. так как они шлются с таути и далее

 

У тебя нет примера нормального кода?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для больших текстов юзайте spoiler]

надоело листать овер 900000 строк

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

package l2p.gameserver.network.serverpackets;

import l2p.gameserver.Config;
import l2p.gameserver.instancemanager.CursedWeaponsManager;
import l2p.gameserver.instancemanager.ReflectionManager;
import l2p.gameserver.model.Creature;
import l2p.gameserver.model.Player;
import l2p.gameserver.model.base.TeamType;
import l2p.gameserver.model.instances.DecoyInstance;
import l2p.gameserver.model.items.Inventory;
import l2p.gameserver.model.items.PcInventory;
import l2p.gameserver.model.matching.MatchingRoom;
import l2p.gameserver.model.pledge.Alliance;
import l2p.gameserver.model.pledge.Clan;
import l2p.gameserver.skills.effects.EffectCubic;
import l2p.gameserver.utils.Location;

public class CharInfo extends L2GameServerPacket
{
private int[][] _inv;
private int _mAtkSpd, _pAtkSpd;
private int _swimWalkSpd, _swimRunSpd, _runSpd, _walkSpd, _flRunSpd, _flWalkSpd, _flyRunSpd, _flyWalkSpd;
private Location _loc, _fishLoc;
private String _name, _title;
private int _objId, _race, _sex, _baseClass, _pvpFlag, _karma, _recomHave;
private double _moveSpdMul, _pAtkSpdMul, _colRadius, _colHeight;
private int _hairStyle, _hairColor, _face;
private int _clanId, _clanCrestId, _largeClanCrestId, _allyId, _allyCrestId, _classId;
private int _isSitting, _isRunning, _combat, _dead, _privateStore, _enchant;
private int _noble, _hero, _fishing, _mountType;
private int _pledgeClass, _pledgeType, _clanRepScore, _cursedWeaponLevel, _mountId;
private int _nameColor, _titleColor, _transform, _agathion, _clanBoatObjectId;
private EffectCubic[] _cubics;
private boolean _isPartyRoomLeader, _isFlying;
private TeamType _team;
private int _maxCP, _maxHP, _maxMP, _curCP, _curHP, _curMP;
private int[] _abnormalEffects;

public CharInfo(Player cha)
{
	this((Creature) cha);
}

public CharInfo(DecoyInstance cha)
{
	this((Creature) cha);
}

public CharInfo(Creature cha)
{
	if (cha == null)
	{
		System.out.println("CharInfo: cha is null!");
		Thread.dumpStack();
		return;
	}

	if (cha.isInvisible() || cha.isDeleted())
		return;

	Player player = cha.getPlayer();

	if (player == null)
		return;

	if (player.isInBoat())
	{
		_loc = player.getInBoatPosition();

		if (player.isClanAirShipDriver())
			_clanBoatObjectId = player.getBoat().getObjectId();
	}

	if (_loc == null)
		_loc = cha.getLoc();

	_objId = cha.getObjectId();

	// Проклятое оружие и трансформации для ТВ скрывают имя и все остальные опознавательные знаки
	if (player.getTransformationName() != null || (player.getReflection() == ReflectionManager.GIRAN_HARBOR || player.getReflection() == ReflectionManager.PARNASSUS) && player.getPrivateStoreType() != Player.STORE_PRIVATE_NONE)
	{
		_name = player.getTransformationName() != null ? player.getTransformationName() : player.getName();
		_title = "";
		_clanId = 0;
		_clanCrestId = 0;
		_allyId = 0;
		_allyCrestId = 0;
		_largeClanCrestId = 0;

		if (player.isCursedWeaponEquipped())
			_cursedWeaponLevel = CursedWeaponsManager.getInstance().getLevel(player.getCursedWeaponEquippedId());
	}
	else
	{
		_name = player.getName();

		if (player.getPrivateStoreType() != Player.STORE_PRIVATE_NONE)
			_title = "";

		else if (!player.isConnected())
		{
			_title = "NO CARRIER";
			_titleColor = 255;
		}
		else
		{
			_title = player.getTitle();
			_titleColor = player.getTitleColor();
		}

		Clan clan = player.getClan();
		Alliance alliance = clan == null ? null : clan.getAlliance();
		_clanId = clan == null ? 0 : clan.getClanId();
		_clanCrestId = clan == null ? 0 : clan.getCrestId();
		_largeClanCrestId = clan == null ? 0 : clan.getCrestLargeId();
		_allyId = alliance == null ? 0 : alliance.getAllyId();
		_allyCrestId = alliance == null ? 0 : alliance.getAllyCrestId();
		_cursedWeaponLevel = 0;
	}

	if (player.isMounted())
	{
		_enchant = 0;
		_mountId = player.getMountNpcId() + 1000000;
		_mountType = player.getMountType();
	}
	else
	{
		_enchant = player.getEnchantEffect();
		_mountId = 0;
		_mountType = 0;
	}

	_inv = new int[PcInventory.PAPERDOLL_MAX][3];

	for (int slot : PAPERDOLL_ORDER)
	{
		_inv[slot][0] = player.getInventory().getPaperdollItemId(slot);
		_inv[slot][1] = player.getInventory().getPaperdollAugmentationId(slot);
		_inv[slot][2] = player.getInventory().getPaperdollItemAppearanceId(slot);
	}

	_mAtkSpd = player.getMAtkSpd();
	_pAtkSpd = player.getPAtkSpd();
	_pAtkSpdMul = player.getAttackSpeedMultiplier();
	_moveSpdMul = player.getMovementSpeedMultiplier();
	_runSpd = (int) (player.getRunSpeed() / _moveSpdMul);
	_walkSpd = (int) (player.getWalkSpeed() / _moveSpdMul);

	_flRunSpd = 0; // TODO
	_flWalkSpd = 0; // TODO

	if (player.isFlying())
	{
		_flyRunSpd = _runSpd;
		_flyWalkSpd = _walkSpd;
	}
	else
	{
		_flyRunSpd = 0;
		_flyWalkSpd = 0;
	}

	_race = player.getRace().ordinal();
	_swimRunSpd = player.getSwimRunSpeed();
	_swimWalkSpd = player.getSwimWalkSpeed();
	_sex = player.getSex().ordinal();
	_baseClass = player.getBaseClassId();
	_pvpFlag = player.getPvpFlag();
	_karma = player.getKarma();
	_colRadius = player.getColRadius();
	_colHeight = player.getColHeight();
	_hairStyle = player.getNewHairStyle() > 0 ? player.getNewHairStyle() : player.getHairStyle();
	_hairColor = player.getNewHairColor() > 0 ? player.getNewHairColor() : player.getHairColor();
	_face = player.getNewFace() > 0 ? player.getNewFace() : player.getFace();

	if (_clanId > 0 && player.getClan() != null)
		_clanRepScore = player.getClan().getReputationScore();
	else
		_clanRepScore = 0;

	_isSitting = player.isSitting() ? 0 : 1;
	_isRunning = player.isRunning() ? 1 : 0;
	_combat = player.isInCombat() ? 1 : 0;
	_dead = player.isAlikeDead() ? 1 : 0;
	_privateStore = player.isInObserverMode() ? Player.STORE_OBSERVING_GAMES : player.getPrivateStoreType();
	_cubics = player.getCubics().toArray(new EffectCubic[player.getCubics().size()]);
	_recomHave = player.isGM() ? 0 : player.getRecomHave();
	_classId = player.getClassId().getId();
	_team = player.getTeam();
	_noble = player.isNoble() ? 1 : 0;
	_hero = player.isHero() || player.isGM() && Config.GM_HERO_AURA ? 1 : 0;
	_fishing = player.isFishing() ? 1 : 0;
	_fishLoc = player.getFishLoc();
	_nameColor = player.getNameColor();
	_pledgeClass = player.getPledgeClass().ordinal();
	_pledgeType = player.getPledgeType();
	_transform = player.getTransformation();
	_agathion = player.getAgathionId();
	_isPartyRoomLeader = player.getMatchingRoom() != null && player.getMatchingRoom().getType() == MatchingRoom.PARTY_MATCHING && player.getMatchingRoom().getLeader() == player;
	_isFlying = player.isInFlyingTransform();
	_curCP = (int) player.getCurrentCp();
	_curHP = (int) player.getCurrentHp();
	_curMP = (int) player.getCurrentMp();
	_maxCP = player.getMaxCp();
	_maxHP = player.getMaxHp();
	_maxMP = player.getMaxMp();
	_abnormalEffects = !cha.isPlayerClone() ? player.getAbnormalEffects().toArray() : new int[0];
}

@Override
protected final void writeImpl()
{
	Player player = getClient().getActiveChar();

	if (player == null)
		return;

	if (_objId == 0)
		return;

	if (player.getObjectId() == _objId)
	{
		_log.error("You cant send CharInfo about his character to active user!!!");
		return;
	}

	writeC(0x31);
	writeD(_loc.x);
	writeD(_loc.y);
	writeD(_loc.z + Config.CLIENT_Z_SHIFT);
	writeD(_clanBoatObjectId);
	writeD(_objId);
	writeS(_name);
	writeD(_race);
	writeD(_sex);
	writeD(_baseClass);

	for (int slot : PAPERDOLL_ORDER)
		writeD(_inv[slot][0]);

	for (int slot : PAPERDOLL_ORDER)
		writeD(_inv[slot][1]);

	writeD(0x00); // TODO talisman count
	writeD(0x01); // TODO cloak status

	for (int slot : Inventory.PAPERDOLL_DISPLAY_ID_ORDER_2)
		writeD(_inv[slot][2]);

	writeD(_pvpFlag);
	writeD(_karma);
	writeD(_mAtkSpd);
	writeD(_pAtkSpd);
	writeD(0x00);	// Unknown
	writeD(_runSpd);
	writeD(_walkSpd);
	writeD(_swimRunSpd);
	writeD(_swimWalkSpd);
	writeD(_flRunSpd);
	writeD(_flWalkSpd);
	writeD(_flyRunSpd);
	writeD(_flyWalkSpd);

	writeF(_moveSpdMul);
	writeF(_pAtkSpdMul);
	writeF(_colRadius);
	writeF(_colHeight);
	writeD(_hairStyle);
	writeD(_hairColor);
	writeD(_face);
	writeS(_title);
	writeD(_clanId);
	writeD(_clanCrestId);
	writeD(_allyId);
	writeD(_allyCrestId);

	writeC(_isSitting);
	writeC(_isRunning);
	writeC(_combat);
	writeC(_dead);
	writeC(0x00); // is invisible
	writeC(_mountType); // 1-on Strider, 2-on Wyvern, 3-on Great Wolf, 0-no mount
	writeC(_privateStore);
	writeH(_cubics.length);

	for (EffectCubic cubic : _cubics)
		writeH(cubic == null ? 0 : cubic.getId());

	writeC(_isPartyRoomLeader ? 0x01 : 0x00); // find party members
	writeC(_isFlying ? 0x02 : 0x00);
	writeH(_recomHave);
	writeD(_mountId);
	writeD(_classId);
	writeD(0x00);
	writeC(_enchant);

	writeC(_team.ordinal()); // team circle around feet 1 = Blue, 2 = red

	writeD(_largeClanCrestId);
	writeC(_noble);
	writeC(_hero);

	writeC(_fishing);
	writeD(_fishLoc.x);
	writeD(_fishLoc.y);
	writeD(_fishLoc.z);

	writeD(_nameColor);
	writeD(_loc.h);
	writeD(_pledgeClass);
	writeD(_pledgeType);
	writeD(_titleColor);
	writeD(_cursedWeaponLevel);
	writeD(_clanRepScore);
	writeD(_transform);
	writeD(_agathion);

	writeD(0x01); // T2

	writeD(0x00); // Unknown (Tauti)
	writeD(0x00); // Unknown (Tauti)
	writeD(_maxCP);
	writeD(_curCP);
	writeD(_maxHP);
	writeD(_curHP);
	writeD(_maxMP);
	writeD(_curMP);
	writeD(0x00); // Unknown (Tauti)
	writeD(0x00); // Unknown (Tauti)
	writeC(0x00); // Unknown (Tauti)

	writeDD(_abnormalEffects, true);
	writeC(0x00); // Unknown (Tauti)
}

public static final int[] PAPERDOLL_ORDER = {
	Inventory.PAPERDOLL_UNDER,
	Inventory.PAPERDOLL_HEAD,
	Inventory.PAPERDOLL_RHAND,
	Inventory.PAPERDOLL_LHAND,
	Inventory.PAPERDOLL_GLOVES,
	Inventory.PAPERDOLL_CHEST,
	Inventory.PAPERDOLL_LEGS,
	Inventory.PAPERDOLL_FEET,
	Inventory.PAPERDOLL_BACK,
	Inventory.PAPERDOLL_LRHAND,
	Inventory.PAPERDOLL_HAIR,
	Inventory.PAPERDOLL_DHAIR,
	Inventory.PAPERDOLL_RBRACELET,
	Inventory.PAPERDOLL_LBRACELET,
	Inventory.PAPERDOLL_DECO1,
	Inventory.PAPERDOLL_DECO2,
	Inventory.PAPERDOLL_DECO3,
	Inventory.PAPERDOLL_DECO4,
	Inventory.PAPERDOLL_DECO5,
	Inventory.PAPERDOLL_DECO6,
	Inventory.PAPERDOLL_BELT };
}

Изменено пользователем Gaikotsu
  • Upvote 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

а ты что, просто мой вариант взял и запихнул?

ну дак там тебе придется переделывать для начала много чего: внешний вид вещей у меня хранится по другому; абнормалы хранятся по другому; ну и еще и условия для инфы о прическах/цвете волос/лице - ибо так-то пакет у меня от линдвиора.

ты просто сделай сравнение по тому, в какой последовательности у тебя и у меня отсылаются данные в пакете и поймешь что у тебя не там шлется.

Изменено пользователем Gaikotsu
  • Upvote 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×
×
  • Создать...