RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SendKillFeed.java
1package com.osroyale.net.packet.out;
2
3import com.osroyale.game.world.entity.mob.Mob;
4import com.osroyale.game.world.entity.mob.player.Player;
5import com.osroyale.net.packet.OutgoingPacket;
6import com.osroyale.net.packet.PacketType;
7
34
35public final class SendKillFeed extends OutgoingPacket {
36
37 private static final int OPCODE = 173;
38
39 private final int killerId;
40 private final int victimId;
41
42 public SendKillFeed(final int killerId,
43 final int victimId) {
44 super(OPCODE, PacketType.FIXED, 4);
45 this.killerId = killerId;
46 this.victimId = victimId;
47 }
48
49 public SendKillFeed(final Mob killer,
50 final Mob victim) {
51 this(
52 SendEntityFeed.getOpponent(killer),
53 SendEntityFeed.getOpponent(victim)
54 );
55 }
56
57 @Override
58 public boolean encode(final Player player) {
59 final int killerId = this.killerId;
60 final int victimId = this.victimId;
61 if (killerId == -1 || victimId == -1) {
62 return false;
63 }
64 builder.writeShort(killerId)
65 .writeShort(victimId);
66 return true;
67 }
68
69}