public static byte[] giveBuff(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;
            for (Map.Entry<MapleBuffStat, Integer> stat : statups.entrySet()) {
                isAura = GameConstants.isAuraBuff(stat.getKey());
                if (!stat.getKey().canStack()) {
                    boolean specialBuff = GameConstants.isSpecialBuff(stat.getKey());
                    if (specialBuff) {
                        mplew.writeInt(stat.getValue());
                    } else {
                        mplew.writeShort(stat.getValue());
                    }
                    mplew.writeInt(buffid);
                    mplew.writeInt(bufflength);
                    if (stat.getKey() == MapleBuffStat.HOLY_SHIELD) {
                        mplew.writeInt(0);
                    }
                    if (stat.getKey() == MapleBuffStat.TEMPEST_BLADES) {
                        mplew.writeZeroBytes(5);
                        mplew.writeInt(buffid == 61101002 ? 1 : 2);
                        mplew.writeInt(buffid == 61101002 ? 3 : 5);
                        mplew.writeInt(effect.getWeapon()); //weapon
                        mplew.writeInt(buffid == 61101002 ? 3 : 5);
                        if (buffid == 61120007) {
                            mplew.writeZeroBytes(8);
                        }
                    }
                }
            }
            for (Map.Entry<MapleBuffStat, Integer> stat : statups.entrySet()) {
                if (stat.getKey().canStack()) {
                    if (!stacked) {
                        mplew.writeZeroBytes(5);
                        mplew.writeZeroBytes(4); //new v143?
                        if (GameConstants.isSpecialStackBuff(stat.getKey())) {
                            mplew.writeZeroBytes(1); //not sure where this part comes
                        }
                        stacked = true;
                    }

                    mplew.writeInt(1); //amount of the same buffstat
                    //for each of the same buffstats:
                    mplew.writeInt(buffid);
                    mplew.writeInt(stat.getValue());
                    mplew.writeInt(Integer.MAX_VALUE); //some kind of time
                    mplew.writeInt(0);
                    mplew.writeInt(bufflength);
                    if (stat.getKey() == MapleBuffStat.DAMAGE_CAP_INCREASE) {
                        mplew.writeInt(1000);
                    }
                }
            }
            if (buffid == 24121004) {// Priere D'Aria
                mplew.writeZeroBytes(3);
                mplew.writeShort(0);
                mplew.write(0);
            }
            if (!isAura) {
                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());
                    }
                }
            }
            mplew.writeShort(0);

             //make sure no dc incase not enough length

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