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);
}
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();
}
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();
}
Aggregations