RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
RingOfDueling.java
1//package com.osroyale.content.itemaction.impl;
2//
3//import com.osroyale.net.packet.out.SendMessage;
4//import com.osroyale.net.packet.out.SendMessage.MessageColor;
5//import com.osroyale.game.world.entity.mob.player.Player;
6//import com.osroyale.content.itemaction.ItemAction;
7//import com.osroyale.content.itemaction.ItemActionType;
8//import com.osroyale.content.skill.impl.magic.teleport.Teleportation;
9//import com.osroyale.game.world.items.Item;
10//import com.osroyale.game.world.location.Position;
11//import com.osroyale.util.Utility;
12//
14// * Handles the ring of dueling action.
15// *
16// * @author Daniel
17// */
33
34//public class RingOfDueling extends ItemAction {
35//
36// @Override
37// public String name() {
38// return "ring of dueling";
39// }
40//
41// @Override
42// public String message(Item item) {
43// return "You rub the ring...";
44// }
45//
46// @Override
47// public int delay() {
48// return 1;
49// }
50//
51// @Override
52// public void execute(Player player, Item item, ItemActionType type, int opcode) {
53// player.attributes.set("ITEM_ACTION_KEY", charges(item));
54// player.dialogueFactory.sendOption("Al Kahrid Duel Arena.", () -> {
55// teleport(player, item, new Position(3314, 3235), type);
56// }, "Castle Wars Arena.", () -> {
57// teleport(player, item, new Position(2441, 3088), type);
58// }, "Clan Wars Arena", () -> {
59// teleport(player, item, new Position(3390, 3162), type);
60// }, "Nowhere.", () -> {
61// player.interfaceManager.close();
62// }).execute();
63// }
64//
65// public Item[] items() {
66// return new Item[] { new Item(2566), new Item(2564), new Item(2562), new Item(2560), new Item(2558), new Item(2556), new Item(2554), new Item(2552) };
67// };
68//
69// public int charges(Item item) {
70// int charge = 0;
71// for (int index = 0; index < items().length; index++) {
72// if (item.getId() == items()[index].getId()) {
73// charge = index;
74// break;
75// }
76// }
77// return charge;
78// }
79//
80// public void teleport(Player player, Item item, Position position, ItemActionType type) {
81// int charge = (player.attributes.get("ITEM_ACTION_KEY", Integer.class)) - 1;
82//
83// if (type == ItemActionType.EQUIPMENT) {
84// if (charges(item) == 0) {
85// player.equipment.remove(item);
86// } else {
87// player.equipment.replace(item.getId(), items()[charge].getId(), true);
88// }
89// } else if (type == ItemActionType.INVENTORY) {
90// if (charges(item) == 0) {
91// player.inventory.remove(item);
92// } else {
93// player.inventory.replace(item.getId(), items()[charge].getId(), true);
94// }
95// }
96//
97// Teleportation.teleport(player, position);
98// player.send(new SendMessage(charge == 0 || charge == -1 ? "Your " + name() + " crumbles to dust." : "Your " + name() + " has " + Utility.convertWord(charge).toLowerCase() + "charge" + (charge == 1 ? "" : "s") + " remaining.", MessageColor.DARK_PURPLE));
99// }
100//}