54 private static final String[] DEFAULT = {
71 public static void open(
Player player) {
73 List<Integer> key = player.attributes.get(
"DROP_DISPLAY_KEY", List.class);
74 display(player, NpcDropManager.NPC_DROPS.get(key.get(0)));
75 player.interfaceManager.
open(54500);
78 public static void search(
Player player, String context, DropType type) {
79 context = context.trim().toLowerCase();
80 List<String> npc =
new ArrayList<>();
81 List<Integer> integer =
new ArrayList<>();
82 for (Map.Entry<Integer,
NpcDropTable> drop : NpcDropManager.NPC_DROPS.entrySet()) {
87 if (type == DropType.NPC) {
88 if (name.toLowerCase().contains(context)) {
89 if (!npc.contains(name)) {
91 integer.add(definition.
npcIds[0]);
94 }
else if (type == DropType.ITEM) {
97 if (itemName.toLowerCase().contains(context)) {
98 if (!npc.contains(name)) {
100 integer.add(definition.
npcIds[0]);
107 if (integer.isEmpty()) {
112 int size = npc.size() < 10 ? 10 : npc.size();
113 for (
int index = 0,
string = 54516; index < size; index++,
string += 2) {
116 String name = index >= npc.size() ?
"" : npc.get(index);
117 player.send(
new SendTooltip(name.isEmpty() ?
"" :
"View drop table of <col=ff9933>" + name,
string));
118 player.send(
new SendString(name,
string + 1));
121 player.attributes.set(
"DROP_DISPLAY_KEY", integer);
123 display(player, NpcDropManager.NPC_DROPS.get(0));
127 int size = definition ==
null ? 9 : definition.drops.length < 9 ? 9 : definition.
drops.length;
128 player.send(
new SendScrollbar(54550, definition ==
null ? 350 : (size * 32)));
129 player.send(
new SendString(definition ==
null ?
"" :
"Drops: " + definition.
drops.length, 54514));
131 for (
int index = 0,
string = 54552; index < size; index++) {
132 boolean valid = definition !=
null && (index < definition.drops.length && (
NpcDefinition.
get(definition.
npcIds[0]) !=
null));
134 Item item = valid ?
new Item(drop.
id, drop.
maximum) :
null;
137 player.send(
new SendString(!valid ?
"" : item.getName(),
string));
144 player.send(
new SendString(!valid ?
"" : drop.
type.toString(),
string));
final DialogueFactory sendStatement(String... lines)
final DialogueFactory execute()