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!

v62 Third Person WK Charges

Initiate Mage
Joined
May 31, 2012
Messages
37
Reaction score
0
If you guys remember back in the pre-bb sources, WK Charges and Critical Throws were always shown only in first person. I've been trying to get WK Charges to show in third person. I'm currently using Valhalla. All of what I've tried with including tinkering with the giveForeignBuff in MaplePacketCreator and MapleStatEffect class all result into the skill disconnecting other players with an error 38. Now I know it's a packet error, but I'm at my ends because I can't figure out what's wrong. I've tried using the same method that Shadow Partner and Soul Arrow use to broadcast their buffs to the other players but it always ends up in error 38 for them. The charges still work perfectly fine for myself however. If anyone could help me out with this, I'd really appreciate it.
 
Custom Title Activated
Member
Joined
Apr 29, 2008
Messages
1,297
Reaction score
509
First one should be in spawnPlayerMapObject, then, it should also be giveForeignBuff. Show us what you have.
 
Upvote 0
Delta
Member
Joined
Apr 4, 2008
Messages
951
Reaction score
305
Critical and WK Charges are server-sided afaik, so if you're getting error 38 I'm assuming you're using the Client Packets? Hence the reason why you're getting error 38, it doesn't directly deal with packets. I've never tinkered with it myself so I'm only going by what you've explained here and what I know off the top of my head.
 
Upvote 0
Initiate Mage
Joined
May 31, 2012
Messages
37
Reaction score
0
First one should be in spawnPlayerMapObject, then, it should also be giveForeignBuff. Show us what you have.

For spawnPlayerMapObject, I have:
Code:
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();
		}
                [B][I]if (chr.getBuffedValue(MapleBuffStat.WK_CHARGE) != null) {
                        buffmask |= MapleBuffStat.WK_CHARGE.getValue();                        
                }[/I] [/B]            
		if (chr.getBuffedValue(MapleBuffStat.MORPH) != null) {
			buffvalue = Integer.valueOf(chr.getBuffedValue(MapleBuffStat.MORPH).intValue());
		}
		mplew.writeInt((int)((buffmask >> 32) & 0xffffffffL));

I removed the coding from the giveForeignBuff however it used to be something like this:
Code:
public static MaplePacket giveForeignBuff(int cid, List<Pair<MapleBuffStat, Integer>> statups, MapleStatEffect effect) {

        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

        mplew.writeShort(SendPacketOpcode.GIVE_FOREIGN_BUFF.getValue());
        mplew.writeInt(cid);
        long mask = getLongMask(statups);
        mplew.writeLong(0);
        mplew.writeLong(mask);
        //mplew.writeShort(0);
        for (Pair<MapleBuffStat, Integer> statup : statups) {
            if (effect.isMorph() && !effect.isPirateMorph()) {
                mplew.write(statup.getRight().byteValue());
[B]            [I]} else if (effect.isWKCharge()) {
                mplew.write(statup.getRight().shortValue());[/I][/B]
            } else {
                mplew.writeShort(statup.getRight().shortValue());
            }
        }
        mplew.writeShort(0); // same as give_buff
        if (effect.isMorph()) {
            mplew.writeShort(0);
        }
        mplew.write(0);

        return mplew.getPacket();
    }

Critical and WK Charges are server-sided afaik, so if you're getting error 38 I'm assuming you're using the Client Packets? Hence the reason why you're getting error 38, it doesn't directly deal with packets. I've never tinkered with it myself so I'm only going by what you've explained here and what I know off the top of my head.

Critical and WK Charges are server sided, however in the pre-bb days their effects (e.g purple critical numbers, wk's elemental charge attack animations) were only client sided. Even though the damage was affected, other players would not be able to know when you hit a critical or when you were using an elemental charge.
 
Upvote 0
Back
Top