• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

LeaderMS v.62 | The Best Brazil MapleStory | GMS-like

Experienced Elementalist
Joined
Jul 8, 2014
Messages
263
Reaction score
33
I've picked through this source since it's been released, and have watched the responses subsequently following. LeaderMS accomplished a lot, and this source is a great example of how their team developed and fine tuned their source to suit their specific needs. It's ashamed most of you though you could just download this and have a server up and running within a day. I've been hosting servers on and off for almost 8 years now, and it is not quite that simple. Working PQ's, Boats, Quests, it's all code that already exists publicly if you spend some time looking for it. Even with all that, until you're experienced adequately running a server, controlling an economy, keeping the gameplay balanced, handling issues before they explode out of proportion, you're doomed to fail. I have failed more than once, learned from my mistakes, and was passionate enough about my ambitions to take my players advise and try again, again, and then again. Long story short, only 1 or 2 servers using this source will actually establish themselves as reputable, the rest of you will be on the bottom, collecting hackers and accidental clicks of boredom.

What's worse is how many of you still want everything spoon-fed, and you can't even Google what the difference is between public and private void, yet alone fathom the interconnectedness & delicate intricacies that make-up the core architecture every source derived from the original Odin source code.

I'd like to thank some of the people I consider veterans for everything they have taught me, through "tough love", figure it out yourself attitudes, and other tactics that were actually educational at the end of the day, and suggest everyone else realize you're about 10 years late to the development community, and you should be grateful people are willing to answer questions as obvious as:

interface is where you put your ip
 
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
What Verison Of Java should i use for this?

Java JDK 4 of course!!111

..unless you're serious. v62 sources originated with JDK 6, though JDK 7 is more "new" and still has compatibility over 8. Switching to Java 8 would cause the famous importPackage errors and such. If you're no newbie and can fix all of these errors, then it doesn't matter what version of Java you're using.
 
Experienced Elementalist
Joined
Mar 28, 2015
Messages
237
Reaction score
69
Which One for a 64 bit system? There's like several.
Lol, don't listen to Chunkarama, he's a troll. I tried installing 1.4 once, but it was just impossible to find the right download. If you use the superior, and more stable (1.4 and all above are unstable beta versions) Java SE 1.3, you won't have to worry about confusing download options. Just go to Java Archive Downloads - Java SE 1.3 hit ctrl+f and search for "vintage windows". You will find there is only one option, now, if you have trouble pressing the "Accept License Agreement" button, shoot me a pm and I will guide you through it step-by-step.
 
(O_o(o_O(O_O)o_O)O_o)
Loyal Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
Lol, don't listen to Chunkarama, he's a troll. I tried installing 1.4 once, but it was just impossible to find the right download. If you use the superior, and more stable (1.4 and all above are unstable beta versions) Java SE 1.3, you won't have to worry about confusing download options. Just go to Java Archive Downloads - Java SE 1.3 hit ctrl+f and search for "vintage windows". You will find there is only one option, now, if you have trouble pressing the "Accept License Agreement" button, shoot me a pm and I will guide you through it step-by-step.

I still prefer the 1.4+ beta versions, I agree it's harder to work with because it's unstable, but you still have access to the developper console, which comes with nifty commands.

And no jokes, last time i tried to install java, i actually did have trouble clicking the license agreement button, it kept claiming I did not press it.
 
(O_o(o_O(O_O)o_O)O_o)
Loyal Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
Please post your working spawnPlayer func for CPQ.

Plz code your own spawnplayer, or edit it to work. Use either IDA, trial and error, or another source.

I wouldn't mind if the other guy posts it, but I want to encourage you to give it a shot yourself. It's really not that hard to do!
(especially since GabrielSin pointed out exactly where to edit.)
 
Newbie Spellweaver
Joined
Sep 14, 2013
Messages
87
Reaction score
4
Plz code your own spawnplayer, or edit it to work. Use either IDA, trial and error, or another source.

I wouldn't mind if the other guy posts it, but I want to encourage you to give it a shot yourself. It's really not that hard to do!
(especially since @GabrielSin pointed out exactly where to edit.)
I dont know where to edit.
This is my spawnPlayerMapObject function. Please teach me where need edit?
Code:
public static MaplePacket spawnPlayerMapobject(MapleCharacter chr) {
        // 62 00 24 46 32 00 05 00 42 65 79 61 6E 00 00 00 00 00 00 00 00 00 00
        // 00 00 00 00 00 00 00 00 20 4E 00 00 00 44 75 00 00 01 2A 4A 0F 00 04
        // 60 BF 0F 00 05 A2 05 10 00 07 2B 5C 10 00 09 E7 D0 10 00 0B 39 53 14
        // 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        // DE 01 73 FF 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
        // 00 00 00 00
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();


        mplew.writeShort(SendPacketOpcode.SPAWN_PLAYER.getValue());
        mplew.writeInt(chr.getId());
        mplew.writeMapleAsciiString(chr.getName());       
        if (chr.getGuildId() <= 0) {
            mplew.writeMapleAsciiString("");
            mplew.write(new byte[6]);
        } else {
            MapleGuildSummary gs = chr.getClient().getChannelServer().getGuildSummary(chr.getGuildId());


            if (gs != null) {
                mplew.writeMapleAsciiString(gs.getName());
                mplew.writeShort(gs.getLogoBG());
                mplew.write(gs.getLogoBGColor());
                mplew.writeShort(gs.getLogo());
                mplew.write(gs.getLogoColor());
            } else {
                mplew.writeMapleAsciiString("");
                mplew.write(new byte[6]);
            }
        }
        mplew.writeInt(0);
        mplew.writeInt(1);
        if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
            mplew.write(2);
        } else {
            mplew.write(0);
        }
        mplew.writeShort(0);
        mplew.write(0xF8);
        long 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 (chr.getBuffedValue(MapleBuffStat.SOULARROW) != null) {
            buffmask |= MapleBuffStat.SOULARROW.getValue();
        }
        if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
            buffvalue = Integer.valueOf(chr.getBuffedValue(MapleBuffStat.MORPH).intValue());
        }
        mplew.writeInt((int) ((buffmask >> 32) & 0xffffffffL));
        if (buffvalue != null) {
            if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
                mplew.writeShort(buffvalue);
            } else {
                mplew.write(buffvalue.byteValue());
            }
        }
        mplew.writeInt((int) (buffmask & 0xffffffffL));
        int CHAR_MAGIC_SPAWN = new Random().nextInt();
        mplew.writeInt(0);
        mplew.writeShort(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeLong(0);
        mplew.writeShort(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeLong(0);
        mplew.writeShort(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeShort(0);
        MapleMount mount = chr.getMount();
        boolean showMount = false;
        if (chr.getBuffedValue(MapleBuffStat.MONSTER_RIDING) != null) {
            if (mount != null) {
                if (mount.isActive()) {
                    if (chr.getInventory(MapleInventoryType.EQUIPPED).getItem((byte) -19) != null) {
                        mplew.writeInt(mount.getItemId());
                        mplew.writeInt(mount.getSkillId());
                        mplew.writeInt(0x2D4DFC2A);
                        showMount = true;
                    }
                } else {
                    mplew.writeInt(1932000);
                    mplew.writeInt(5221006);
                    mplew.writeInt(0x2D4DFC2A);
                    showMount = true;
                }
            }
        }
        if (!showMount) {
            mplew.writeInt(0);
            mplew.writeInt(0);
            mplew.writeInt(CHAR_MAGIC_SPAWN);
        }
        mplew.writeLong(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeLong(0);
        mplew.writeInt(0);
        mplew.writeShort(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeInt(0);
        mplew.write(0x40);
        mplew.write(1);
        addCharLook(mplew, chr, false);
        mplew.writeInt(0);
        mplew.writeInt(chr.getItemEffect());
        mplew.writeInt(chr.getChair());
        mplew.writeShort(chr.getPosition().x);
        mplew.writeShort(chr.getPosition().y);
        mplew.write(chr.getStance());
        mplew.writeInt(0);
        mplew.writeInt(1);
        mplew.writeLong(0);
        IPlayerInteractionManager ipim = chr.getInteraction();
        if (ipim != null && ipim.isOwner(chr)) {
            if (ipim.getShopType() == 2 || ipim.getShopType() == 3 || ipim.getShopType() == 4) {
                addAnnounceBox(mplew, ipim);
            }
        }
        mplew.write(0); // hmmmmm..
        if (chr.getChalkboard() != null) {
            mplew.write(1);
            mplew.writeMapleAsciiString(chr.getChalkboard());
        } else {
            mplew.write(0);
        }
        MapleInventory iv = chr.getInventory(MapleInventoryType.EQUIPPED);
        Collection<IItem> equippedC = iv.list();
        List<Item> equipped = new ArrayList<Item>(equippedC.size());
        for (IItem item : equippedC) {
            equipped.add((Item) item);
        }
        Collections.sort(equipped);
        List<MapleRing> rings = new ArrayList<MapleRing>();
        for (Item item : equipped) {
            if (((IEquip) item).getRingId() > -1) {
                rings.add(MapleRing.loadFromDb(((IEquip) item).getRingId()));
            }
        }
        Collections.sort(rings);
        // [01] [07 6C 31 00] [00 00 00 00] [08 6C 31 00] [00 00 00 00] [C1 F7 10 00] [01] [3B 13 32 00] [00 00 00 00] [3C 13 32 00] [00 00 00 00] [E0 FA 10 00] 00 00
        if (rings.size() > 0) {
            mplew.write(0);
            for (MapleRing ring : rings) {
                mplew.write(1);
                mplew.writeInt(ring.getRingId());
                mplew.writeInt(0);
                mplew.writeInt(ring.getPartnerRingId());
                mplew.writeInt(0);
                mplew.writeInt(ring.getItemId());
            }
            mplew.writeShort(0);
        } else {
            mplew.writeInt(0);
        }
        return mplew.getPacket();
    }
 
(O_o(o_O(O_O)o_O)O_o)
Loyal Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
I dont know where to edit.
This is my spawnPlayerMapObject function. Please teach me where need edit?
Code:
public static MaplePacket spawnPlayerMapobject(MapleCharacter chr) {
        // 62 00 24 46 32 00 05 00 42 65 79 61 6E 00 00 00 00 00 00 00 00 00 00
        // 00 00 00 00 00 00 00 00 20 4E 00 00 00 44 75 00 00 01 2A 4A 0F 00 04
        // 60 BF 0F 00 05 A2 05 10 00 07 2B 5C 10 00 09 E7 D0 10 00 0B 39 53 14
        // 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        // DE 01 73 FF 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
        // 00 00 00 00
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();


        mplew.writeShort(SendPacketOpcode.SPAWN_PLAYER.getValue());
        mplew.writeInt(chr.getId());
        mplew.writeMapleAsciiString(chr.getName());       
        if (chr.getGuildId() <= 0) {
            mplew.writeMapleAsciiString("");
            mplew.write(new byte[6]);
        } else {
            MapleGuildSummary gs = chr.getClient().getChannelServer().getGuildSummary(chr.getGuildId());


            if (gs != null) {
                mplew.writeMapleAsciiString(gs.getName());
                mplew.writeShort(gs.getLogoBG());
                mplew.write(gs.getLogoBGColor());
                mplew.writeShort(gs.getLogo());
                mplew.write(gs.getLogoColor());
            } else {
                mplew.writeMapleAsciiString("");
                mplew.write(new byte[6]);
            }
        }
        mplew.writeInt(0);
        mplew.writeInt(1);
        if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
            mplew.write(2);
        } else {
            mplew.write(0);
        }
        mplew.writeShort(0);
        mplew.write(0xF8);
        long 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 (chr.getBuffedValue(MapleBuffStat.SOULARROW) != null) {
            buffmask |= MapleBuffStat.SOULARROW.getValue();
        }
        if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
            buffvalue = Integer.valueOf(chr.getBuffedValue(MapleBuffStat.MORPH).intValue());
        }
        mplew.writeInt((int) ((buffmask >> 32) & 0xffffffffL));
        if (buffvalue != null) {
            if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
                mplew.writeShort(buffvalue);
            } else {
                mplew.write(buffvalue.byteValue());
            }
        }
        mplew.writeInt((int) (buffmask & 0xffffffffL));
        int CHAR_MAGIC_SPAWN = new Random().nextInt();
        mplew.writeInt(0);
        mplew.writeShort(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeLong(0);
        mplew.writeShort(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeLong(0);
        mplew.writeShort(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeShort(0);
        MapleMount mount = chr.getMount();
        boolean showMount = false;
        if (chr.getBuffedValue(MapleBuffStat.MONSTER_RIDING) != null) {
            if (mount != null) {
                if (mount.isActive()) {
                    if (chr.getInventory(MapleInventoryType.EQUIPPED).getItem((byte) -19) != null) {
                        mplew.writeInt(mount.getItemId());
                        mplew.writeInt(mount.getSkillId());
                        mplew.writeInt(0x2D4DFC2A);
                        showMount = true;
                    }
                } else {
                    mplew.writeInt(1932000);
                    mplew.writeInt(5221006);
                    mplew.writeInt(0x2D4DFC2A);
                    showMount = true;
                }
            }
        }
        if (!showMount) {
            mplew.writeInt(0);
            mplew.writeInt(0);
            mplew.writeInt(CHAR_MAGIC_SPAWN);
        }
        mplew.writeLong(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeLong(0);
        mplew.writeInt(0);
        mplew.writeShort(0);
        mplew.writeInt(CHAR_MAGIC_SPAWN);
        mplew.writeInt(0);
        mplew.write(0x40);
        mplew.write(1);
        addCharLook(mplew, chr, false);
        mplew.writeInt(0);
        mplew.writeInt(chr.getItemEffect());
        mplew.writeInt(chr.getChair());
        mplew.writeShort(chr.getPosition().x);
        mplew.writeShort(chr.getPosition().y);
        mplew.write(chr.getStance());
        mplew.writeInt(0);
        mplew.writeInt(1);
        mplew.writeLong(0);
        IPlayerInteractionManager ipim = chr.getInteraction();
        if (ipim != null && ipim.isOwner(chr)) {
            if (ipim.getShopType() == 2 || ipim.getShopType() == 3 || ipim.getShopType() == 4) {
                addAnnounceBox(mplew, ipim);
            }
        }
        mplew.write(0); // hmmmmm..
        if (chr.getChalkboard() != null) {
            mplew.write(1);
            mplew.writeMapleAsciiString(chr.getChalkboard());
        } else {
            mplew.write(0);
        }
        MapleInventory iv = chr.getInventory(MapleInventoryType.EQUIPPED);
        Collection<IItem> equippedC = iv.list();
        List<Item> equipped = new ArrayList<Item>(equippedC.size());
        for (IItem item : equippedC) {
            equipped.add((Item) item);
        }
        Collections.sort(equipped);
        List<MapleRing> rings = new ArrayList<MapleRing>();
        for (Item item : equipped) {
            if (((IEquip) item).getRingId() > -1) {
                rings.add(MapleRing.loadFromDb(((IEquip) item).getRingId()));
            }
        }
        Collections.sort(rings);
        // [01] [07 6C 31 00] [00 00 00 00] [08 6C 31 00] [00 00 00 00] [C1 F7 10 00] [01] [3B 13 32 00] [00 00 00 00] [3C 13 32 00] [00 00 00 00] [E0 FA 10 00] 00 00
        if (rings.size() > 0) {
            mplew.write(0);
            for (MapleRing ring : rings) {
                mplew.write(1);
                mplew.writeInt(ring.getRingId());
                mplew.writeInt(0);
                mplew.writeInt(ring.getPartnerRingId());
                mplew.writeInt(0);
                mplew.writeInt(ring.getItemId());
            }
            mplew.writeShort(0);
        } else {
            mplew.writeInt(0);
        }
        return mplew.getPacket();
    }

Well, i actually doubt it's in spawnplayer, but if you errorlog you can find out. Whatever packet it is, it's at the wrong lenght. Or you're not sending the right stuff at all.

Only way to find out is by comparing with a sniff or comparison. If you use IDA you can find the expected length and make sure you send that. It's all comparing and finding what's missing.

I couldn't possibly know where exactly to edit in your case.
 
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
@Novak it's in spawnplayer (a portion anyways -- the two teams displayed under your name where guild would be). you don't see it because he's missing bytes (that packet looks pathetic; they could just be written wrong at bottom). there should be a byte (or, well, a few) at the bottom of the packet for the team. byte 0 for red and byte 1 for blue iirc. v62 had berserk and it had rings and it had carnival byte, i'm pretty sure that's been there since like v55..
 
Newbie Spellweaver
Joined
Sep 14, 2013
Messages
87
Reaction score
4
Well, i actually doubt it's in spawnplayer, but if you errorlog you can find out. Whatever packet it is, it's at the wrong lenght. Or you're not sending the right stuff at all.

Only way to find out is by comparing with a sniff or comparison. If you use IDA you can find the expected length and make sure you send that. It's all comparing and finding what's missing.

I couldn't possibly know where exactly to edit in your case.
When d.c i got no error in bat file.
 
(O_o(o_O(O_O)o_O)O_o)
Loyal Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
When d.c i got no error in bat file.

Yeah because no error printing is currently enabled.
Though chunkarama perfectly explained that it's the last few bytres at the bottom of the spawnPlayerMapObject packet. Where information about the team has to be sent. Again, even v55 sources should have those bytes properly, and you can def. take a peek into other v62 for how it's done.
 
Joined
Apr 25, 2010
Messages
479
Reaction score
49
SpawnPlayer use:

Code:
public static MaplePacket spawnPlayerMapobject(MapleCharacter chr) {
		MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
		mplew.writeShort(SendPacketOpcode.SPAWN_PLAYER.getValue());
		mplew.writeInt(chr.getId());
		mplew.writeMapleAsciiString(chr.getName());
		if (!chr.getMap().isWarMap()) {
			if (chr.getGuildId() <= 0) {
				mplew.writeMapleAsciiString("");
				mplew.write(new byte[6]);
			} else {
				MapleGuildSummary gs = chr.getClient().getChannelServer().getGuildSummary(chr.getGuildId());

				if (gs != null) {
					mplew.writeMapleAsciiString(gs.getName());
					mplew.writeShort(gs.getLogoBG());
					mplew.write(gs.getLogoBGColor());
					mplew.writeShort(gs.getLogo());
					mplew.write(gs.getLogoColor());
				} else {
					mplew.writeMapleAsciiString("");
					mplew.write(new byte[6]);
				}
			}
		} else {
			if (true) {
				mplew.writeMapleAsciiString("Team Red");
				mplew.writeShort(1000); //bg
				mplew.write(1); //bg color
				mplew.writeShort(9026); //logo
				mplew.write(6); //logo color
			} else {
				mplew.writeMapleAsciiString("Team Blue");
				mplew.writeShort(1000); //bg
				mplew.write(11); //bg color
				mplew.writeShort(9026); //logo
				mplew.write(6); //logo color
			}
		}
		mplew.writeInt(0);
		mplew.writeInt(1);
		if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
			mplew.write(2);
		} else {
			mplew.write(0);
		}
		mplew.writeShort(0);
		mplew.write(0xF8);
		long 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 (chr.getBuffedValue(MapleBuffStat.SOULARROW) != null) {
			buffmask |= MapleBuffStat.SOULARROW.getValue();
		}
		if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
			buffvalue = Integer.valueOf(chr.getBuffedValue(MapleBuffStat.MORPH).intValue());
		}
		mplew.writeInt((int)((buffmask >> 32) & 0xffffffffL));
		if (buffvalue != null) {
			if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
				mplew.writeShort(buffvalue);
			} else {
				mplew.write(buffvalue.byteValue());
			}
		}
		mplew.writeInt((int)(buffmask & 0xffffffffL));
		int CHAR_MAGIC_SPAWN = new Random().nextInt();
		mplew.writeInt(0);
		mplew.writeShort(0);
		mplew.writeInt(CHAR_MAGIC_SPAWN);
		mplew.writeLong(0);
		mplew.writeShort(0);
		mplew.writeInt(CHAR_MAGIC_SPAWN);
		mplew.writeLong(0);
		mplew.writeShort(0);
		mplew.writeInt(CHAR_MAGIC_SPAWN);
		mplew.writeShort(0);
        MapleMount mount = chr.getMount();
		if (chr.getBuffedValue(MapleBuffStat.MONSTER_RIDING) != null) {
			if (chr.hasBattleShip()) {
				mplew.writeInt(1932000);
				mplew.writeInt(5221006);
			} else if (mount != null) {
				if (chr.getInventory(MapleInventoryType.EQUIPPED).getItem((byte) -19) != null) {
					mplew.writeInt(mount.getItemId());
					mplew.writeInt(mount.getSkillId());
				}
			}
			mplew.writeInt(0x2D4DFC2A);
        } else {
            mplew.writeLong(0);
            mplew.writeInt(CHAR_MAGIC_SPAWN);
        }
		mplew.writeLong(0);
		mplew.writeInt(CHAR_MAGIC_SPAWN);
		mplew.writeLong(0);
		mplew.writeInt(0);
		mplew.writeShort(0);
		mplew.writeInt(CHAR_MAGIC_SPAWN);
		mplew.writeInt(0);
		mplew.write(0x40);
		mplew.write(1);
		addCharLook(mplew, chr, false);
		mplew.writeInt(0);
		mplew.writeInt(chr.getItemEffect());
		mplew.writeInt(chr.getChair());
		mplew.writeShort(chr.getPosition().x);
		mplew.writeShort(chr.getPosition().y);
		mplew.write(chr.getStance());
		mplew.writeInt(0);
		mplew.writeInt(1);
		mplew.writeLong(0);
        IPlayerInteractionManager ipim = chr.getInteraction();
        if (ipim != null && ipim.isOwner(chr)) {
            if (ipim.getShopType() == 2 || ipim.getShopType() == 3 || ipim.getShopType() == 4) {
                addAnnounceBox(mplew, ipim);
            }
        } else {
            mplew.write(0);
        }
		mplew.writeShort(0);
		MapleInventory iv = chr.getInventory(MapleInventoryType.EQUIPPED);
		Collection<IItem> equippedC = iv.list();
		List<Item> equipped = new ArrayList<Item>(equippedC.size());
		for (IItem item : equippedC) {
			equipped.add((Item) item);
		}
		Collections.sort(equipped);
		List<MapleRing> rings = new ArrayList<MapleRing>();
		for (Item item : equipped) {
			if (((IEquip) item).getRingId() > -1) {
				rings.add(MapleRing.loadFromDb(((IEquip) item).getRingId()));
			}
		}
		Collections.sort(rings);
		if (rings.size() > 0) {
			mplew.write(0);
			for (MapleRing ring : rings) {
				if (ring != null) {
					mplew.write(1);
					mplew.writeInt(ring.getRingId());
					mplew.writeInt(0);
					mplew.writeInt(ring.getPartnerRingId());
					mplew.writeInt(0);
					mplew.writeInt(ring.getItemId());
				}
			}
			mplew.writeShort(0);
		} else {
			mplew.writeInt(0);
		}

		return mplew.getPacket();
	}
 
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
@GabrielSin your packet is so off (like most sources) so if you're asking for the last byte in your SpawnPlayer it is in your rings.

The current structure (of v83 at least) is like so:

PHP:
CUser.EncodeCoupleInfo(mplew, pUser);
        CUser.EncodeFriendshipInfo(mplew, pUser);
        CUser.EncodeMarriageInfo(mplew, pUser);
        CUser.EncodeNewYearCardInfo(mplew, pUser);
        int mask = 0;
        if (pUser.getCharacterData().characterStat.nJob >= 2200) {
            mask |= 0x2;
        } else if (pUser.getCharacterData().characterStat.nJob == 132) {
            mask |= 0x1;
        }/* else {//v95
            mask |= 0x4;
        }*/
        mplew.write(mask);// nBerserk and GetDragon masks
        mplew.write(pUser.getTeam());

So, replace:
Code:
} else {
			mplew.writeInt(0);
		}

with:
Code:
} else {
			mplew.writeShort(0);
		}
mplew.write(0);
mplew.write(chr.getTeam());

and that should be the proper bytes.
 
Newbie Spellweaver
Joined
Jul 19, 2015
Messages
6
Reaction score
0
I've tried this source, Carnival PQ isn't working properly.
 
Back
Top