1package com.runehive.content.collectionlog;
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.game.world.items.Item;
5import com.runehive.game.world.items.ItemDefinition;
6import com.runehive.net.packet.out.SendConfig;
7import com.runehive.net.packet.out.SendItemOnInterface;
8import com.runehive.net.packet.out.SendMessage;
9import com.runehive.net.packet.out.SendString;
11import java.util.ArrayList;
18 public static final int KC_ID = 44518;
21 private ArrayList<CollectionLogItem>
log;
24 log =
new ArrayList<>();
27 public ArrayList<CollectionLogItem>
getLog() {
46 player.collectionLogPageOpen = page;
59 for (
int i = 0; i < list.size(); ++i, index += 2) {
63 if (cli.getData() == selected) {
64 if (cli.hasClaimed()) {
70 player.
send(
new SendString(color > 0 ?
"@gre@" + list.get(i).getName() : list.get(i).getName(), index));
73 for(
int i = list.size(); i < 17; i++, index += 2)
84 ArrayList<Item> items =
new ArrayList<>();
87 int total = itemIds ==
null ? 0 : itemIds.length;
89 if (itemIds !=
null) {
90 for (
int i : itemIds) {
96 for (
Item gi : items) {
97 if (gi.getAmount() > 0) {
102 String colorCode = obtained >= total ?
"65280" : obtained > 0 ?
"FFFF00" :
"FF0000";
108 outcome = selected.
getName() +
" kills: <col=FFFFFF>" + counter +
"</col>";
110 outcome = selected.
getCounterText() +
": <col=FFFFFF>" + counter +
"</col>";
116 player.collectionLogView = selected;
121 if (
slot > list.size() - 1) {
134 if (button >= -21013 && button < -20915) {
144 if (i.getData() == data) {
145 return i.getCounter();
153 if (cli.getData() == data) {
154 for (
int i = 0; i < cli.getItems().size(); ++i) {
155 if (cli.getItems().get(i).getId() == item) {
156 return cli.getItems().get(i).getAmount();
169 for(
int npc : data.getNpcIds()) {
171 logItem(player, data, itemId, amount);
179 boolean valid =
false;
190 if (cli.getData() == data) {
191 cli.addItem(item, amount);
209 for(
int npc : data.getNpcIds()) {
220 if (cli.getData() == data) {
221 cli.setCounter(cli.getCounter() + 1);
static int getCounter(CollectionLog cl, CollectionLogData data)
static final int ITEM_CONTAINER
static int getLogItemAmount(Player player, CollectionLogData data, int item)
static void open(Player player)
ArrayList< CollectionLogItem > getLog()
static void sendButtons(Player player, CollectionLogPage page)
static void checkItemDrop(Player player, int npcId, int itemId, int amount)
static void logItem(Player player, CollectionLogData data, int item, int amount)
static void selectLog(Player player, CollectionLogData selected, int slot)
static final int INTERFACE_ID
static void increaseCounter(Player player, CollectionLogData data)
static void onNpcKill(Player player, int npcId)
static boolean clickButton(Player player, int button)
ArrayList< CollectionLogItem > log
static final int OBTAINED_ID
static void loadPage(Player player, CollectionLogPage page)
static void selectLogButton(Player player, int slot)
void setCounter(int count)
void addItem(int item, int amount)
static void save(Player player)
void open(int identification)
Opens an interface for the player.
This class represents a character controlled by a player.
final InterfaceManager interfaceManager
CollectionLogData collectionLogView
void send(OutgoingPacket encoder)
CollectionLog getCollectionLog()
CollectionLogPage collectionLogPageOpen
Represents all of an in-game Item's attributes.
static ItemDefinition get(int id)
Gets an item definition.
String getName()
Gets the item name.
The container class that represents an item that can be interacted with.
The OutgoingPacket responsible for changing settings on a client.
The OutgoingPacket that sends a message to a Players chatbox in the client.
The OutgoingPacket that sends a string to a Players itemcontainer in the client.
static ArrayList< CollectionLogData > getPageList(CollectionLogPage page)
CollectionCategory getType()
static CollectionLogPage forButton(int button)