public void sendDuelAccept() {
Player with = player.getWishToDuel();
if (with == null) { // This shouldn't happen
return;
}
RSCPacketBuilder s = new RSCPacketBuilder();
s.setID(147);
s.addLong(with.getUsernameHash());
s.addByte((byte) with.getDuelOffer().size());
for (InvItem item : with.getDuelOffer()) {
s.addShort(item.id);
s.addInt(item.amount);
}
s.addByte((byte) player.getDuelOffer().size());
for (InvItem item : player.getDuelOffer()) {
s.addShort(item.id);
s.addInt(item.amount);
}
s.addByte((byte) (player.getDuelSetting(0) ? 1 : 0)); // duelCantRetreat
// = data[i7++]
// & 0xff;
s.addByte((byte) (player.getDuelSetting(1) ? 1 : 0)); // duelUseMagic =
// data[i7++] &
// 0xff;
s.addByte((byte) (player.getDuelSetting(2) ? 1 : 0)); // duelUsePrayer =
// data[i7++] &
// 0xff;
s.addByte((byte) (player.getDuelSetting(3) ? 1 : 0)); // duelUseWeapons
// = data[i7++]
// & 0xff;
packets.add(s.toPacket());
}