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!

Understanding Buffstats

XQS

Newbie Spellweaver
Joined
Apr 29, 2013
Messages
12
Reaction score
7
HexTool.writeBytesFromString("lol");
 
Last edited:
Joined
Jun 5, 2010
Messages
567
Reaction score
598
They are actually 8 integers and not longs)
for (Pair<MapleBuffStat, Integer> statup : statups) { has to be written in a specific order, so statup can't be randomly populated. The way I do it is to sort it every time, but that's a lot more costly than if you just fill it correctly beforehand.
Another tidbit is that stats like available ap, and str/dex and debuffs (like seal, weaken) are also done this way.

Everything else looks good and I know this will help people since I've gotten around 3-5 questions about this in the past.
 
Custom Title Activated
Loyal Member
Joined
Jun 30, 2008
Messages
3,451
Reaction score
1,616
This is how Nexon does it (Rev121 MoopleDEV):
PHP:
/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
		       Matthias Butz <matze@odinms.de>
		       Jan Christian Meyer <vimes@odinms.de>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation version 3 as published by
    the Free Software Foundation. You may not use, modify or distribute
    this program under any other version of the GNU Affero General Public
    License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
package client;

public enum MapleBuffStat {
    PAD(0, 0),
    PDD(1, 0),
    MAD(2, 0),
    MDD(3, 0),
    ACC(4, 0),
    EVA(5, 0),
    CRAFT(6, 0),
    SPEED(7, 0),
    JUMP(8, 0),
    MAGIC_GUARD(9, 0),
    DARK_SIGHT(10, 0),
    BOOSTER(11, 0),
    POWER_GUARD(12, 0),
    MAX_HP(13, 0),
    MAX_MP(14, 0),
    INVINCIBLE(15, 0),
    SOUL_ARROW(16, 0),
    STUN(17, 0),
    POISON(18, 0),
    SEAL(19, 0),
    DARKNESS(20, 0),
    COMBO_COUNTER(21, 0),
    WEAPON_CHARGE(22, 0),
    DRAGON_BLOOD(23, 0),
    HOLY_SYMBOL(24, 0),
    MESO_UP(25, 0),
    SHADOW_PARTNER(26, 0),
    PICK_POCKET(27, 0),
    MESO_GUARD(28, 0),
    THAW(29, 0),
    WEAKNESS(30, 0),
    CURSE(31, 0),    
    
    SLOW(0, 1),
    MORPH(1, 1),
    REGEN(2, 1),
    BASIC_STAT_UP(3, 1),
    STANCE(4, 1),
    SHARP_EYES(5, 1),
    MANA_REFLECTION(6, 1),
    ATTRACT(7, 1),
    SPIRIT_JAVELIN(8, 1),
    INFINITY(9, 1),
    HOLY_SHIELD(10, 1),
    HAMSTRING(11, 1),
    BLIND(12, 1),
    CONCENTRATION(13, 1),
    BAN_MAP(14, 1),
    MAX_LEVEL_BUFF(15, 1),
    MESO_UP_BY_ITEM(16, 1),
    GHOST(17, 1),
    BARRIER(18, 1),
    REVERSE_INPUT(19, 1),
    ITEM_UP_BY_ITEM(20, 1),
    RESPECT_P_IMMUNE(21, 1),
    RESPECT_M_IMMUNE(22, 1),
    DEFENSE_ATT(23, 1),
    DEFENSE_STATE(24, 1),
    INC_EFFECT_HP_POTION(25, 1),
    INC_EFFECT_MP_POTION(26, 1),
    DOJANG_BERSERK(27, 1),
    DOJANG_INVINCIBLE(28, 1),
    SPARK(29, 1),
    DOJANG_SHIELD(30, 1),
    SOUL_MASTER_FINAL(31, 1),
    
    WIND_BREAKER_FINAL(0, 2),
    ELEMENTAL_RESET(1, 2),
    WIND_WALK(2, 2),
    EVENT_RATE(3, 2),
    COMBO_ABILITY_BUFF(4, 2),
    COMBO_DRAIN(5, 2),
    COMBO_BARRIER(6, 2),
    BODY_PRESSURE(7, 2),
    SMART_KNOCKBACK(8, 2),
    REPEAT_EFFECT(9, 2),
    EXP_BUFF_RATE(10, 2),
    STOP_PORTION(11, 2),
    STOP_MOTION(12, 2),
    FEAR(13, 2),
    FROZEN(14, 2),
    ASSIST_CHARGE(15, 2),
    ENRAGE(16, 2),
    BEHOLDER(17, 2),
    ENERGY_CHARGE(18, 2),
    DASH_SPEED(19, 2),
    DASH_JUMP(20, 2),
    RIDE_VEHICLE(21, 2),
    PARTY_BOOSTER(22, 2),
    GUIDED_BULLET(23, 2),
    ZOMBIFY(24, 2),
    
    PUPPET(30, 3),//fuckyou
    SUMMON(30, 3),//fuckyou
    ;
    private final int i;
    private final int position;

    private MapleBuffStat(int i, int position ) {
        this.i = 1 << i;
        this.position = position;
    }

    public int getValue() {
        return i;
    }

    public int getPosition() {
        return position;
    }
}
PHP:
    private static void writeMask(final MaplePacketLittleEndianWriter mplew, List<Pair<MapleBuffStat, Integer>> statups) {
        int[] mask = new int[4];
        for (Pair<MapleBuffStat, Integer> statup : statups) {
            mask[statup.getLeft().getPosition()] |= statup.getLeft().getValue();
        }
        for (int i = 3; i >= 0; i--) {
            mplew.writeInt(mask[i]);
        }
    }
Nexon actually shifts way higher.. they have UINT320 (nowadays 360 if I am not mistaken) for it.

And giveBuff is actually just a really long method with 'if' for every buffstat lol.
 

XQS

Newbie Spellweaver
Joined
Apr 29, 2013
Messages
12
Reaction score
7
They are actually 8 integers and not longs)
for (Pair<MapleBuffStat, Integer> statup : statups) { has to be written in a specific order, so statup can't be randomly populated. The way I do it is to sort it every time, but that's a lot more costly than if you just fill it correctly beforehand.
Another tidbit is that stats like available ap, and str/dex and debuffs (like seal, weaken) are also done this way.

Everything else looks good and I know this will help people since I've gotten around 3-5 questions about this in the past.

Could you explain more about the sorting? I still don't quite understand why the order matters because I thought you would get the same mask either way.

Also, does this mean I can create my own custom buffs using the WATK, WDEF, etc. buffstats?
 
Custom Title Activated
Loyal Member
Joined
Jun 30, 2008
Messages
3,451
Reaction score
1,616
Could you explain more about the sorting? I still don't quite understand why the order matters because I thought you would get the same mask either way.

Also, does this mean I can create my own custom buffs using the WATK, WDEF, etc. buffstats?
Yes, you can make your own buffs with the Buffstats you have.
 
<3
Joined
Feb 4, 2011
Messages
481
Reaction score
123
Never mind. I got it. Thanks for sharing this. However, your wording for conversion confused me a bit. But I get it now.
 
Last edited:
Joined
Nov 9, 2012
Messages
608
Reaction score
164
So what you are trying to say is
Code:
00 00 00 00 
00 00 00 00 

00 00 00 00 
00 00 00 00 

00 00 00 00 
00 00 00 00 

00 04 00 00 
00 00 00 00 

00 00 00 00 
00 00 00 00 

00 00 00 00 
00 00 00 00 

00 01 00 00 
00 19 12 42 
00 0F 00 00 
00 68 3A A3 
02 58 1B 00 
00 00 00 00 
00
What I believe to be Shadow Meld's buffstat would be (0x400, 2)?
 
Back
Top