Search in sources :

Example 6 with MapleBuffStat

use of client.MapleBuffStat in project HeavenMS by ronancpl.

the class MaplePacketCreator method writeLongMaskFromList.

private static void writeLongMaskFromList(final MaplePacketLittleEndianWriter mplew, List<MapleBuffStat> statups) {
    long firstmask = 0;
    long secondmask = 0;
    for (MapleBuffStat statup : statups) {
        if (statup.isFirst()) {
            firstmask |= statup.getValue();
        } else {
            secondmask |= statup.getValue();
        }
    }
    mplew.writeLong(firstmask);
    mplew.writeLong(secondmask);
}
Also used : MapleBuffStat(client.MapleBuffStat)

Example 7 with MapleBuffStat

use of client.MapleBuffStat in project HeavenMS by ronancpl.

the class MaplePacketCreator method givePirateBuff.

public static byte[] givePirateBuff(List<Pair<MapleBuffStat, Integer>> statups, int buffid, int duration) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    boolean infusion = buffid == Buccaneer.SPEED_INFUSION || buffid == ThunderBreaker.SPEED_INFUSION || buffid == Corsair.SPEED_INFUSION;
    mplew.writeShort(SendOpcode.GIVE_BUFF.getValue());
    writeLongMask(mplew, statups);
    mplew.writeShort(0);
    for (Pair<MapleBuffStat, Integer> stat : statups) {
        mplew.writeInt(stat.getRight().shortValue());
        mplew.writeInt(buffid);
        mplew.skip(infusion ? 10 : 5);
        mplew.writeShort(duration);
    }
    mplew.skip(3);
    return mplew.getPacket();
}
Also used : MapleBuffStat(client.MapleBuffStat) MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 8 with MapleBuffStat

use of client.MapleBuffStat in project HeavenMS by ronancpl.

the class MaplePacketCreator method giveForeignBuff.

public static byte[] giveForeignBuff(int cid, List<Pair<MapleBuffStat, Integer>> statups) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.GIVE_FOREIGN_BUFF.getValue());
    mplew.writeInt(cid);
    writeLongMask(mplew, statups);
    for (Pair<MapleBuffStat, Integer> statup : statups) {
        mplew.writeShort(statup.getRight().shortValue());
    }
    mplew.writeInt(0);
    mplew.writeShort(0);
    return mplew.getPacket();
}
Also used : MapleBuffStat(client.MapleBuffStat) MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Aggregations

MapleBuffStat (client.MapleBuffStat)8 MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)4 Pair (tools.Pair)3 Point (java.awt.Point)2 List (java.util.List)2 MapleStatEffect (server.MapleStatEffect)2 MapleCharacter (client.MapleCharacter)1 MapleMount (client.MapleMount)1 Skill (client.Skill)1 Item (client.inventory.Item)1 MaplePet (client.inventory.MaplePet)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 SpawnPoint (server.life.SpawnPoint)1 MonsterCarnival (server.partyquest.MonsterCarnival)1 MonsterCarnivalParty (server.partyquest.MonsterCarnivalParty)1