public static byte[] giveBuff2(int buffid, int bufflength, Map<MapleBuffStat, Integer> statups, MapleStatEffect effect) {
            MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

            mplew.writeShort(SendPacketOpcode.GIVE_BUFF.getValue());
            PacketHelper.writeBuffMask(mplew, statups);//48
            boolean stacked = false;
            boolean isAura = false;
            boolean isCombo = false;
            int stackLength = 0;
            for (Map.Entry<MapleBuffStat, Integer> stat : statups.entrySet()) {
                if ((stat.getKey()).canStack()) {
                    if (stat.getKey() != MapleBuffStat.DAMAGE_CAP_INCREASE) {
                        stackLength++;
                    }
                }
            }
            for (Map.Entry<MapleBuffStat, Integer> stat : statups.entrySet()) {
                isAura = GameConstants.isAuraBuff(stat.getKey());
                if (stat.getKey() == MapleBuffStat.COMBO) {
                    isCombo = true;
                }
                if ((stat.getKey()).canStack()) {
                    if (!stacked) {
                        mplew.writeZeroBytes(4);
                        mplew.write(0);
                        boolean specialStackBuff = GameConstants.isSpecialStackBuff(stat.getKey());
                        if (specialStackBuff) {
                            mplew.writeZeroBytes(1); //not sure where this part comes
                        }
                        if (stackLength > 0) {
                            //mplew.writeInt(stackLength); //stack length
                        }
                        stacked = true;
                    }
                    //if (stat.getKey() == MapleBuffStat.DAMAGE_CAP_INCREASE) {
                    mplew.writeInt(1);
                    //}
                    mplew.writeInt(buffid);
                    if (buffid != 23111004) {
                        mplew.writeInt(bufflength);
                    }
                    if (!GameConstants.isValuelessBuff(buffid)) {
                        if (buffid == 2321005) {//advanced bless
                            mplew.writeInt(stat.getValue());
                            mplew.writeInt(240000);
                        } else {
                            mplew.writeInt(stat.getValue());
                            mplew.writeInt(262643804); //unknown 
                        }
                    }
                    if (stat.getKey() == MapleBuffStat.DAMAGE_CAP_INCREASE) {
                        mplew.writeInt(1000);
                    }
                } else {
                    boolean specialBuff = GameConstants.isSpecialBuff(stat.getKey());
                    if (specialBuff) {
                        mplew.writeInt(stat.getValue());
                    } else {
                        if (buffid == 61101002 || buffid == 61120007) {
                            mplew.writeShort(stat.getValue() % 10);
                        } else {
                            mplew.writeShort(stat.getValue());
                        }
                    }
                    mplew.writeInt(buffid);
                    mplew.writeInt(bufflength);
                }
                if (buffid == 31011001) {// Overload Release?? idk
                    mplew.writeInt(effect.getDuration());
                }
                if (statups.containsKey(MapleBuffStat.TEMPEST_BLADES)) {
                    mplew.writeZeroBytes(5);
                    mplew.writeInt(buffid == 61101002 ? 1 : 2);
                    mplew.writeInt(buffid == 61101002 ? 3 : 5);
                    mplew.writeInt(stat.getValue() / 100); //weapon
                    mplew.writeInt(buffid == 61101002 ? 3 : 5);
                    if (buffid == 61120007) {
                        mplew.writeZeroBytes(8);
                    }
                }
            }
            if (buffid == 24121004) {// Priere D'Aria
                mplew.writeZeroBytes(3);
                mplew.writeShort(0);
                mplew.write(0);
            }
            if (!isAura) {
                if (buffid == 23111004) {//ignis roar
                    mplew.write(0);
                    mplew.writeShort(750);
                } else {
                    mplew.writeShort(0);
                    if (effect != null) {
                        if (effect.isDivineShield()) {
                            mplew.writeInt(effect.getEnhancedWatk());
                        } else if (effect.getCharColor() > 0) {
                            mplew.writeInt(effect.getCharColor());
                        } else if (effect.isInflation()) {
                            mplew.writeInt(effect.getInflation());
                        }
                    }
                }
            }
            if (buffid == 23111004) {//ignis roar
                mplew.write(0);
                mplew.writeShort(1000);
            } else {
                mplew.writeShort(0);

            }

            if (statups.containsKey(MapleBuffStat.MAPLE_WARRIOR)) {
                mplew.write(HexTool.getByteArrayFromHexString("00 E8 03 00 00 00 13 00 00 00 00"));
                return mplew.getPacket();
            }

            if (statups.containsKey(MapleBuffStat.TEMPEST_BLADES)) { //this too
                mplew.writeShort(0);
            }
            if (statups.containsKey(MapleBuffStat.KAISER_COMBO)) { //this too
                mplew.writeZeroBytes(8);
            }

            if (true) { //this part doesnt always come
                if (buffid != 23111004) {//ignis roar 
                    mplew.writeShort(0);
                }
                mplew.write(0);
                mplew.write(0);
                if (buffid == 2311007 || buffid == 2111007 || buffid == 2211007 || buffid == 23111004 || buffid == 1201007) {//teleport mastery
                    mplew.write(1);
                } else {
                    mplew.write(effect != null && effect.isShadow());
                }
                if (isAura || statups.containsKey(MapleBuffStat.TEMPEST_BLADES)) {
                    mplew.writeInt(0);
                }
            }

            //new v142
            mplew.writeShort(0);
            mplew.write(0);
            mplew.write(0);
            mplew.write(0);
            mplew.writeZeroBytes(30);
//            System.err.println("\u001B[34m buff " + mplew.toString());
            return mplew.getPacket();
        }