1package com.runehive.net.packet.in;
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.game.world.entity.mob.player.PlayerRight;
5import com.runehive.game.world.items.Item;
6import com.runehive.game.world.items.containers.inventory.Inventory;
7import com.runehive.game.world.items.containers.pricechecker.PriceType;
8import com.runehive.net.packet.GamePacket;
9import com.runehive.net.packet.PacketListener;
10import com.runehive.net.packet.PacketListenerMeta;
11import com.runehive.net.packet.out.SendMessage;
12import com.runehive.util.MessageColor;
13import com.runehive.util.Utility;
14import org.jire.runehiveps.defs.ItemDef;
15import org.jire.runehiveps.defs.ItemDefLoader;
16import org.jire.runehiveps.event.item.ItemExamineEvent;
17import org.jire.runehiveps.event.npc.NpcExamineEvent;
18import org.jire.runehiveps.event.object.ObjectExamineEvent;
29 private static final int NPC = 1;
30 private static final int ITEM = 2;
35 final int type =
packet.readByte(
false);
42 int npcId =
packet.readShort(
false);
43 player.
getEvents().interact(player,
new NpcExamineEvent(npcId));
47 int itemId =
packet.readShort(
false);
48 player.
getEvents().interact(player,
new ItemExamineEvent(itemId));
52 int objectId =
packet.readShort(
false);
53 player.
getEvents().interact(player,
new ObjectExamineEvent(objectId));
61 int interfaceId =
packet.readShort();
62 int itemId =
packet.readShort();
69 player.settings.clientWidth = interfaceId;
70 player.settings.clientHeight = itemId;
74 switch (interfaceId) {
77 if (item ==
null || item.
getId() != itemId)
return;
79 if (itemDef !=
null) {
80 String examine = itemDef.getExamine();
81 if (!
"null".equals(examine))
86 message +=
"Item: <col=A52929>" + item.
getName() +
"</col> ";
94 if (!player.
attributes.
has(
"DROP_SIMULATOR_SORTED_LIST"))
return;
96 if (slot < 0 || slot >= items.length)
return;
100 message +=
"Item: <col=A52929>" + item.
getName() +
"</col> ";
final GenericAttributes attributes
This class represents a character controlled by a player.
final Inventory inventory
void send(OutgoingPacket encoder)
The container class that represents an item that can be interacted with.
final int getId()
Gets the identification of this item.
final int getAmount()
Gets the quantity of this item.
int getValue(PriceType type)
Gets the value for this item.
final Item get(int index)
Gets the Item located on index.
An ItemContainer implementation that manages the inventory for a Player.
static final int INVENTORY_DISPLAY_ID
The inventory item display widget identifier.
Represents a single game packet.
Handles the in examine packet.
static final int INTERFACE
static void handleInterfaceExamine(Player player, GamePacket packet)
void handlePacket(Player player, GamePacket packet)
Handles the packet that has just been received.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Handles miscellaneous methods.
static String formatDigits(final int amount)
Formats digits for integers.
public< K, E > E get(K key)
Gets a generic attribute.
public< K > boolean has(K key)
Checks if a key is in the list of generic attribute.
Holds all the player right data.
static boolean isDeveloper(Player player)
Checks if the player has developer status.
HIGH_ALCH_VALUE
The high alchemy price type.
VALUE
The value price type.
Holds an enum of colors for ease.