Search in sources :

Example 1 with MagicOnItemMessage

use of org.apollo.game.message.impl.MagicOnItemMessage in project apollo by apollo-rsps.

the class MagicOnItemMessageDecoder method decode.

@Override
public MagicOnItemMessage decode(GamePacket packet) {
    GamePacketReader reader = new GamePacketReader(packet);
    int spell = (int) reader.getUnsigned(DataType.SHORT);
    int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    int slot = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    int id = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    return new MagicOnItemMessage(interfaceId, id, slot, spell);
}
Also used : GamePacketReader(org.apollo.net.codec.game.GamePacketReader) MagicOnItemMessage(org.apollo.game.message.impl.MagicOnItemMessage)

Example 2 with MagicOnItemMessage

use of org.apollo.game.message.impl.MagicOnItemMessage in project apollo by apollo-rsps.

the class MagicOnItemMessageDecoder method decode.

@Override
public MagicOnItemMessage decode(GamePacket packet) {
    GamePacketReader reader = new GamePacketReader(packet);
    int slot = (int) reader.getUnsigned(DataType.SHORT);
    int id = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    int interfaceId = (int) reader.getUnsigned(DataType.SHORT);
    int spell = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    return new MagicOnItemMessage(interfaceId, id, slot, spell);
}
Also used : GamePacketReader(org.apollo.net.codec.game.GamePacketReader) MagicOnItemMessage(org.apollo.game.message.impl.MagicOnItemMessage)

Aggregations

MagicOnItemMessage (org.apollo.game.message.impl.MagicOnItemMessage)2 GamePacketReader (org.apollo.net.codec.game.GamePacketReader)2