Untitled

mail@pastecode.io avatar
unknown
java
a year ago
3.9 kB
9
Indexable
Never
        public static MaplePacket getCharInfo(MapleCharacter chr) {
		MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
		mplew.write(SendPacketOpcode.WARP_TO_MAP.getValue());
                
                /* this shit is all right */
		mplew.writeInt(chr.getClient().getChannel() - 1); //channel
		mplew.write(0); // character portal counter
		mplew.write(1); // is connecting
                
		mplew.writeInt(new Random().nextInt());
                mplew.writeInt(new Random().nextInt());
                mplew.writeInt(new Random().nextInt());
                mplew.writeInt(new Random().nextInt());
                /* */
                
                mplew.write(0xFF);
                mplew.write(0xFF);

                mplew.writeInt(chr.getId());
                mplew.writeAsciiString(chr.getName(), 13);
                mplew.write(chr.getGender());
                mplew.write(chr.getSkinColor().getId());
                mplew.writeInt(chr.getFace());
                mplew.writeInt(chr.getHair());
                
                mplew.writeLong(0); // Pet Cash ID
                
                mplew.write(chr.getLevel());
                mplew.writeShort(chr.getJob().getId());
                mplew.writeShort(chr.getStr());
                mplew.writeShort(chr.getDex());
                mplew.writeShort(chr.getInt());
                mplew.writeShort(chr.getLuk());
                mplew.writeShort(chr.getHp());
                mplew.writeShort(chr.getMaxHp());
                mplew.writeShort(chr.getMp());
                mplew.writeShort(chr.getMaxMp());
                mplew.writeShort(chr.getRemainingAp());
                mplew.writeShort(chr.getRemainingSp());
                mplew.writeInt(chr.getExp());
                mplew.writeShort(chr.getFame());
                
                mplew.writeInt(chr.getMapId());
                mplew.write(chr.getInitialSpawnpoint());
                
                mplew.write(chr.getBuddylist().getCapacity()); 
                mplew.writeInt(chr.getMeso());
                
                //Todo - make these the real numbers
		mplew.write(100); // equip slots
		mplew.write(100); // use slots
		mplew.write(100); // set-up slots
		mplew.write(100); // etc slots
		mplew.write(100); // cash slots
                
		//addItemInfo
		mplew.write(0);
                //addItemInfo
		mplew.write(0); 
                //addItemInfo
		mplew.write(0);
                //addItemInfo
		mplew.write(0);
                //addItemInfo
		mplew.write(0); 
                //addItemInfo
		mplew.write(0);          
                
                mplew.write(0); // skill record
                mplew.write(0); // skill cooldown
                        
                // Quests //
                mplew.write(0); // quest record
                mplew.write(0); // quest complete
                
                //friendship
                mplew.write(0);
                mplew.write(0);
                
                //couple
                mplew.write(0);
                mplew.write(0);
                
                //map transfer
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                
                //map transfer ex
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                mplew.writeInt(0);
                
		return mplew.getPacket();
	}