use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method moveMonster.
public static byte[] moveMonster(int oid, boolean skillPossible, int skill, int skillId, int skillLevel, int pOption, Point startPos, List<LifeMovementFragment> moves) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.MOVE_MONSTER.getValue());
mplew.writeInt(oid);
mplew.write(0);
mplew.writeBool(skillPossible);
mplew.write(skill);
mplew.write(skillId);
mplew.write(skillLevel);
mplew.writeShort(pOption);
mplew.writePos(startPos);
serializeMovementList(mplew, moves);
return mplew.getPacket();
}
use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method partyStatusMessage.
/**
* 23: 'Char' have denied request to the party.
*
* @param message
* @param charname
* @return
*/
public static byte[] partyStatusMessage(int message, String charname) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.PARTY_OPERATION.getValue());
mplew.write(message);
mplew.writeMapleAsciiString(charname);
return mplew.getPacket();
}
use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method MTSConfirmBuy.
public static byte[] MTSConfirmBuy() {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.MTS_OPERATION.getValue());
mplew.write(0x33);
return mplew.getPacket();
}
use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method getScrollEffect.
public static byte[] getScrollEffect(int chr, ScrollResult scrollSuccess, boolean legendarySpirit) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.SHOW_SCROLL_EFFECT.getValue());
mplew.writeInt(chr);
switch(scrollSuccess) {
case SUCCESS:
mplew.writeShort(1);
mplew.writeShort(legendarySpirit ? 1 : 0);
break;
case FAIL:
mplew.writeShort(0);
mplew.writeShort(legendarySpirit ? 1 : 0);
break;
case CURSE:
mplew.write(0);
mplew.write(1);
mplew.writeShort(legendarySpirit ? 1 : 0);
break;
}
return mplew.getPacket();
}
use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method showPet.
public static byte[] showPet(MapleCharacter chr, MaplePet pet, boolean remove, boolean hunger) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.SPAWN_PET.getValue());
mplew.writeInt(chr.getId());
mplew.write(chr.getPetIndex(pet));
if (remove) {
mplew.write(0);
mplew.write(hunger ? 1 : 0);
} else {
addPetInfo(mplew, pet, true);
}
return mplew.getPacket();
}
Aggregations