1package com.runehive.content.simulator;
3import com.runehive.game.world.entity.mob.npc.definition.NpcDefinition;
4import com.runehive.game.world.entity.mob.npc.drop.NpcDropManager;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.net.packet.out.SendScrollbar;
7import com.runehive.net.packet.out.SendString;
8import com.runehive.net.packet.out.SendTooltip;
9import com.runehive.util.Utility;
11import java.util.ArrayList;
14import static com.runehive.content.simulator.Simulation.BLOOD_MONEY_CHEST;
24 private static final int[]
DEFAULT = {3080};
40 for (
int index = 0,
string = 26851; index <
CUSTOM_SIMULATIONS.length; index++,
string++) {
48 List<String> npc =
new ArrayList<>();
49 List<Integer> button =
new ArrayList<>();
53 if (definition ==
null)
58 if (!definition.
getName().toLowerCase().contains(context.toLowerCase())) {
61 if (npc.contains(definition.
getName()))
64 button.add(definition.
getId());
66 int size = npc.size() < 14 ? 14 : npc.size();
67 for (
int index = 0,
string = 26851 +
CUSTOM_SIMULATIONS.length; index < size; index++,
string++) {
68 String name = index >= npc.size() ?
"" : npc.get(index);
69 player.
send(
new SendTooltip(name.isEmpty() ?
"" :
"Open drop simulator for " + name,
string));
78 simulation.
execute(player,
id, amount);
This class simulates drops of an npc and places it on an itemcontainer.
static final int[] DEFAULT
The default NPCs that will have their drops simulated.
static void drawList(Player player, String context)
Handles drawing the lsit of npcs based off the search context.
static void simulate(Player player, Simulation simulation, int id, int amount)
Handles displaying the simulated drops.
static void open(Player player)
Handles opening the drop simulator itemcontainer.
static final Simulation[] CUSTOM_SIMULATIONS
final GenericAttributes attributes
Contains the npc definitions.
static NpcDefinition get(int id)
Gets a npc definition from the definition array.
static final NpcDefinition[] DEFINITIONS
The array of npc definitions.
The manager class which holds the static entries of drop tables and has a method to execute a drop ta...
static final Map< Integer, NpcDropTable > NPC_DROPS
The collection of npc ids by their representative drop tables.
void open(int identification)
Opens an interface for the player.
This class represents a character controlled by a player.
final InterfaceManager interfaceManager
void send(OutgoingPacket encoder)
The OutgoingPacket that sends a string to a Players itemcontainer in the client.
Handles miscellaneous methods.
static< T > T randomElement(Collection< T > collection)
Picks a random element out of any array type.
static String formatEnum(final String string)
Formats name of enum.
public< K, E > void set(K key, E attribute)
Sets a generic attribute.
Created by Daniel on 2018-02-03.
void execute(Player player, int id, int amount)