1package com.runehive.content.itemaction.impl;
3import com.runehive.content.ItemCreation;
4import com.runehive.content.itemaction.ItemAction;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.game.world.items.Item;
7import com.runehive.util.Items;
8import com.runehive.util.Utility;
10import java.math.RoundingMode;
11import java.text.DecimalFormat;
16 private static final DecimalFormat
FORMATTER =
new DecimalFormat(
"#.#");
19 FORMATTER.setRoundingMode(RoundingMode.FLOOR);
24 return "Trident of the Seas";
35 player.
message(
"You must empty your trident charges before doing this.");
42 player.
message(
"Your Trident of the Seas is already fully charged.");
46 int id1 = first.
getId();
47 int id2 = second.
getId();
50 if (id2 != 560 && id2 != 562 && id2 != 554 && id2 != 995)
54 if (id1 != 560 && id1 != 562 && id1 != 554 && id1 != 995)
62 if (death >= 1 && chaos >= 1 && fire >= 5 && coins >= 10) {
64 int minC = coins / 10;
65 int charges = Math.min(Math.min(death, chaos), Math.min(minF, minC));
79 player.tridentSeasCharges += charges;
80 player.
message(
"You added " + charges +
" charges to your Trident of the Seas");
83 player.
message(
"You need at least 1 x death rune, 1 x chaos rune, 5 x fire runes and 10gp for one charge.",
"Your Trident of the Seas can hold ");
127 player.
message(
"You don't have enough inventory space to uncharge your trident.");
135 player.tridentSeasCharges = 0;
136 player.
message(
"You uncharge your trident.");
Handles creating items with the use item packet listener.
Handles executing an item action.
String name()
The name of the action.
boolean equipment(Player player, Item item, int opcode)
boolean itemOnItem(Player player, Item first, Item second)
static final short TRIDENT_ID
static void uncharge(Player player)
static void check(Player player)
boolean inventory(Player player, Item item, int opcode)
The execution method of the action.
static final short CHARGE_LIMIT
static final DecimalFormat FORMATTER
This class represents a character controlled by a player.
final Inventory inventory
void message(String message)
The container class that represents an item that can be interacted with.
final int getId()
Gets the identification of this item.
final int computeAmountForId(int id)
Computes the total quantity of the Items in this container with id.
boolean remove(Item item)
Attempts to withdraw item from this container.
boolean add(Item item)
Attempts to deposit item into this container.
final boolean hasCapacityFor(Item... item)
Determines if this container has the capacity for item.
void refresh()
Refreshes the players inventory.
Handles miscellaneous methods.
static String formatDigits(final int amount)
Formats digits for integers.
static Optional< CreationData > forItems(Item first, Item second)
Handles finding the creation data based off the items used.