41 public static final short CRAWS_UNCHARGED_ID = 22547;
42 public static final short CRAWS_CHARGED_ID = 22550;
43 public static final short ETHER_ID = 21820;
51 public boolean itemOnItem(
Player player, Item first, Item second) {
52 if ((first.getId() != CRAWS_UNCHARGED_ID && second.getId() != CRAWS_UNCHARGED_ID) && (first.getId() != CRAWS_CHARGED_ID && second.getId() != CRAWS_CHARGED_ID)) {
56 if(first.getId() == ETHER_ID || second.getId() == ETHER_ID) {
57 if (first.getId() == CRAWS_UNCHARGED_ID || second.getId() == CRAWS_UNCHARGED_ID) {
58 if(!player.inventory.
contains(ETHER_ID, 1000)) {
62 player.inventory.
remove(ETHER_ID, 1000);
63 player.inventory.
remove(CRAWS_UNCHARGED_ID);
64 player.inventory.
add(CRAWS_CHARGED_ID, 1);
67 System.out.println(
"Recharge craws bow");
68 player.send(
new SendInputAmount(
"How many charges would you like add? (0-"+player.inventory.
computeAmountForId(ETHER_ID)+
")", 10, input -> charge(player, Integer.parseInt(input))));
78 if (item.getId() != CRAWS_CHARGED_ID) {
91 public boolean equipment(
Player player, Item item,
int opcode) {
92 if (item.getId() != CRAWS_CHARGED_ID) {
103 public boolean drop(Player player, Item item) {
104 if (item.getId() != CRAWS_CHARGED_ID) {
108 player.inventory.remove(CRAWS_CHARGED_ID);
109 player.inventory.add(CRAWS_UNCHARGED_ID, 1);
110 player.inventory.add(ETHER_ID, 1000 + player.crawsBowCharges);
111 player.crawsBowCharges = 0;
113 player.message(
"You uncharge your "+
name()+
".");
118 private void check(Player player) {
119 player.message(
"You have " + Utility.formatDigits(player.crawsBowCharges) +
" charges in your "+
name()+
".");
122 private void charge(Player player,
int amount) {
123 if (amount > player.inventory.computeAmountForId(ETHER_ID)) {
124 amount = player.inventory.computeAmountForId(ETHER_ID);
127 player.inventory.remove(ETHER_ID, amount);
128 player.inventory.refresh();
129 player.crawsBowCharges += amount;
130 player.message(
"You added " + amount +
" charges to your "+
name()+
"");
boolean inventory(Player player, Item item, int opcode)