Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

odinMS v28 - SpawnPlayerMapObject

Newbie Spellweaver
Joined
Aug 28, 2008
Messages
19
Reaction score
0
Whats going on everyone, I've been working on a v.28 odin source for pure nostalgia.
I have gotten login pretty much done.
I can enter the game, and getCharInfo seems to work correctly.
I spawn, but the game crashes. I figure its something to do with addCharLook or Buffstats.
What I'm asking pretty much is how do i go about updating this.
I have ida, I've looked at the structure and figured that the userPoolEnterField is
Code:
 0x50
.

So here is the packet:
Code:
public static MaplePacket spawnPlayerMapobject(MapleCharacter chr) {
		MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
		mplew.write(0x50);
		mplew.writeInt(chr.getId());
		mplew.writeMapleAsciiString(chr.getName());

                int buffmask = 0;
		Integer buffvalue = null;
                
                if (chr.getBuffedValue(MapleBuffStat.DARKSIGHT) != null && !chr.isHidden()) {
                    buffmask |= MapleBuffStat.DARKSIGHT.getValue();
		}
                if (chr.getBuffedValue(MapleBuffStat.COMBO) != null) {
                    buffmask |= MapleBuffStat.COMBO.getValue();
                    buffvalue = Integer.valueOf(chr.getBuffedValue(MapleBuffStat.COMBO).intValue());
		}
                if (chr.getBuffedValue(MapleBuffStat.SHADOWPARTNER) != null) {
                    buffmask |= MapleBuffStat.SHADOWPARTNER.getValue();
		}
                
                if (buffvalue != null) {
                    mplew.write(buffvalue.byteValue());
		}
                
                addCharLook(mplew, chr, true);
                mplew.writeInt(0); // [10/28/2014 8:25:40 PM] Justin: IncMaxMemberNumCost
                mplew.writeInt(chr.getItemEffect()); // TODO: Fix Chocolate Hearts (This is Cash Effect not Hearts)
                mplew.writeInt(chr.getChair());
                mplew.writeShort(chr.getPosition().x);
                mplew.writeShort(chr.getPosition().y);
                mplew.write(chr.getStance());
                mplew.writeShort(0); // FH
                
                // Pets
                if (chr.getPet(0) != null) {
                    mplew.write(1);
                    MaplePet pet = chr.getPet(0);
                    mplew.writeInt(pet.getItemId());
                    mplew.writeMapleAsciiString(pet.getName());
                    mplew.writeLong(pet.getUniqueId());
                    mplew.writeShort(pet.getPos().x);
                    mplew.writeShort(pet.getPos().y);
                    mplew.write(pet.getStance());
                    mplew.writeShort(pet.getFh());
                } else {
                    mplew.write(0);
                }
                
                // Mini Game & Interaction Boxes
                if (chr.getPlayerShop() != null && chr.getPlayerShop().isOwner(chr)) {
                    addShopBox(mplew, chr.getPlayerShop());
		} else if ((MapleMiniGame) chr.getInteraction() != null) {
                    addAnnounceBox(mplew, chr.getInteraction());
                } else {
                    mplew.write(0);
		}
                
                // Rings
                List<MapleRing> rings = getRing(chr);
                mplew.write(rings.size());
                for (MapleRing ring : rings) { 
                    mplew.writeInt(ring.getRingId());
                    mplew.writeInt(0);
                    mplew.writeInt(ring.getPartnerRingId());
                    mplew.writeInt(0);
                    mplew.writeInt(ring.getItemId());
                }
		return mplew.getPacket();
	}

when I remove this if statement.
Code:
if (buffvalue != null) {
                    mplew.write(buffvalue.byteValue());
		}
and have it as just,
Code:
 mplew.write(buffvalue.byteValue());
I can get ingame and spawn, but it throws an error which points to the statement saying
that PlayerLoggedInHandler is null.
I have tried messing with this packet for about a week with no progress.
Can someone give me any sort of insight on reading the structure with the v28 idb cause
I'm stumped but determined, thanks ~!
 
Newbie Spellweaver
Joined
Aug 28, 2008
Messages
19
Reaction score
0
hi, I completed v28 myself few years ago.

header is 0x4E also and this packet is missing guild data

after "mplew.writeShort(0); // FH" is another boolean for bShowAdminEffect

Hey dude, big fucken thanks for the info man, glad someone responded :)
 
Upvote 0
Back
Top