1package com.runehive.content.teleport;
3import com.runehive.content.activity.impl.barrows.Barrows;
4import com.runehive.content.activity.impl.godwars.GodwarsActivity;
5import com.runehive.content.activity.impl.warriorguild.WarriorGuild;
6import com.runehive.content.activity.inferno.Inferno;
7import com.runehive.content.dialogue.DialogueFactory;
8import com.runehive.content.skill.impl.magic.teleport.TeleportType;
9import com.runehive.content.skill.impl.magic.teleport.Teleportation;
10import com.runehive.game.world.entity.mob.player.Player;
11import com.runehive.game.world.entity.mob.player.PlayerRight;
12import com.runehive.game.world.items.Item;
13import com.runehive.game.world.position.Position;
14import com.runehive.net.packet.out.*;
15import com.runehive.util.Utility;
17import java.util.ArrayList;
28 private static final String[]
TITLES = {
"Favorites",
"Minigames",
"Skilling",
"Monster Killing",
"Player Killing",
"Boss Killing"};
37 open(player, type, 0);
44 if (player.
attributes.
get(
"TELEPORT_INDEX_KEY", Integer.class) ==
null)
46 int size = teleports.size();
47 for (
int index = 0,
string = 58009; index < 6; index++) {
48 String color =
"<col=" + (type.ordinal() == index ?
"ffffff" :
"ff9933") +
">";
52 for (
int index = 0,
string = 58052; index < (size < 9 ? 9 : size); index++,
string += 2) {
58 String prefex = teleportIndex == index ?
"<col=ffffff>" :
"</col>";
65 display(player, teleports.get(teleportIndex));
78 for (
int index = 0, count = 0; index <
teleport.getDisplay().length; index++, count++) {
79 if (
teleport.getDisplay()[index] == -1) {
98 player.
send(
new SendString(
"You do not have any teleport selected", 58032));
115 open(player, type, index);
116 if (index < teleports.size()) {
117 display(player, teleports.get(index));
124 player.
send(
new SendMessage(
"You can't teleport past 20 wilderness!"));
131 player.
send(
new SendMessage(
"You have not selected a destination to teleport to!"));
135 if (
teleport.getName() ==
"Inferno") {
151 player.
send(
new SendMessage(
"You have not selected a teleport to favorite!"));
156 int index = player.
attributes.
get(
"TELEPORT_INDEX_KEY", Integer.class);
170 player.
send(
new SendMessage(
"You have " + (isFavorite ?
"" :
"un-") +
"favorited the " +
teleport.getName() +
" teleport."));
172 open(player, type, index);
179 player.
message(
"You are currently under the affects of a teleblock spell and can not teleport!");
189 player.
message(
true,
"You have teleported to the Catherby farming area.");
190 },
"Ardougne", () -> {
192 player.
message(
true,
"You have teleported to the Ardougne farming area.");
193 },
"Falador", () -> {
195 player.
message(
true,
"You have teleported to the Falador farming area.");
196 },
"Phasmatys", () -> {
198 player.
message(
true,
"You have teleported to the Phasmatys farming area.");
202 factory.
sendOption(
"Gnome agility course (Level 1 agility req.)", () -> {
204 player.
send(
new SendMessage(
"You have teleported to the Gnome agility course.",
true));
205 },
"Barbarian agility course (Level 35 agility req.)", () -> {
207 player.
send(
new SendMessage(
"You have teleported to the Barbarian agility course.",
true));
208 },
"Wilderness agility course (Level 49 agility req.)", () -> {
210 player.
send(
new SendMessage(
"You have teleported to the Wilderness agility course.",
true));
211 },
"Rooftop courses", () -> {
214 player.
send(
new SendMessage(
"You have teleported to the Seer's Village rooftop agility course.",
true));
215 },
"Ardougne rooftop course (Level 90 agility req.)", () -> {
217 player.
send(
new SendMessage(
"You have teleported to the Ardougne rooftop agility course.",
true));
219 },
"Nevermind", factory::clear).execute();
224 player.
send(
new SendMessage(
"You have teleported to the varrock mining area.",
true));
225 },
"Falador", () -> {
227 player.
send(
new SendMessage(
"You have teleported to the falador mining area.",
true));
228 },
"Rune Essence", () -> {
230 player.
send(
new SendMessage(
"You have teleported to the rune essence mining area.",
true));
231 },
"Shilo Village", () -> {
233 player.
send(
new SendMessage(
"You have teleported to the shilo village mining area.",
true));
234 },
"Nevermind", factory::clear).execute();
239 player.
send(
new SendMessage(
"You have teleported to the abyss area.",
true));
240 },
"Astral Altar", () -> {
242 player.
send(
new SendMessage(
"You have teleported to the astral altar.",
true));
243 },
"Wrath Altar", () -> {
245 player.
send(
new SendMessage(
"You have teleported to the wrath altar.",
true));
246 },
"Ournia Altar", () -> {
248 player.
send(
new SendMessage(
"You have teleported to the ournia altar.",
true));
249 },
"Nevermind", factory::clear).execute();
254 player.
send(
new SendMessage(
"You have teleported to the camelot woodcutting area.",
true));
255 },
"Woodcutting Guild", () -> {
257 player.
send(
new SendMessage(
"You have teleported to the woodcutting guild.",
true));
258 },
"Nevermind", factory::clear).execute();
264 player.
send(
new SendMessage(
"You have teleported to the puro puro hunter area.",
true));
265 },
"Nevermind", factory::clear).execute();
270 player.
send(
new SendMessage(
"You have teleported to the catherby fishing area.",
true));
271 },
"Fishing Guild", () -> {
274 player.
send(
new SendMessage(
"You have teleported to the fishing guild.",
true));
276 player.
send(
new SendMessage(
"You need 68 fishing to access the fishing guild."));
279 },
"Nevermind", factory::clear).execute();
310 List<Teleport> list =
new ArrayList<>();
312 if (t.getType() == type) list.add(t);
319 int base_button = -7484;
320 int ordinal = Math.abs((base_button - button) / 2);
static Barrows create(Player player)
Handles the godwars activity.
static GodwarsActivity create(Player player)
Creates the godwars activity for the player.
This class handles the warrior's guild activity.
static WarriorGuild create(Player player)
Handes creating a new warrior guild activity for the player.
static Inferno create(Player player)
Represents a factory class that contains important functions for building dialogues.
final DialogueFactory sendStatement(String... lines)
Appends a StatementDialogue to the current dialogue chain.
final DialogueFactory sendOption(String option1, Runnable action1, String option2, Runnable action2)
Appends the OptionDialogue onto the current dialogue chain.
Handles a player teleporting.
static boolean teleport(Player player, Position position)
Handles teleporting to various locations around OS Royale.
static void click(Player player, int button)
Handles clicking teleport buttons on the itemcontainer.
static void teleport(Player player)
Handles teleporting to the destination.
static int getOrdinal(int button)
Gets the ordinal of a teleport based on the list ordinal.
static void display(Player player, Teleport teleport)
Displays all the teleport text on the itemcontainer.
static void open(Player player)
Opens the teleport itemcontainer.
static void open(Player player, TeleportType type, int teleportIndex)
Opens the teleport itemcontainer to a certain teleportNoChecks type.
static final String[] TITLES
Holds the teleport titles names.
static void open(Player player, TeleportType type)
Opens the teleport itemcontainer.
static void favorite(Player player)
Handles favorite a teleport.
static void special(Player player, Teleport teleport)
Handles special case TELEPORT.
static List< Teleport > getTeleports(TeleportType type)
Gets a list of teleports based off the teleport type.
final SkillManager skills
final GenericAttributes attributes
void open(int identification)
Opens an interface for the player.
This class represents a character controlled by a player.
List< Teleport > favoriteTeleport
void message(String message)
DialogueFactory dialogueFactory
final InterfaceManager interfaceManager
void send(OutgoingPacket encoder)
int getLevel(int id)
Gets the level of a skill.
The container class that represents an item that can be interacted with.
final void setAmount(int amount)
Sets the quantity of this item.
Represents a single tile on the game world.
The OutgoingPacket responsible for changing settings on a client.
The OutgoingPacket that sends a message to a Players chatbox in the client.
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.
public< K, E > E get(K key)
Gets a generic attribute.
public< K, E > void set(K key, E attribute)
Sets a generic attribute.
FAVORITES
Favorite teleport.
Holds all the player right data.
static boolean isAdministrator(Player player)
Checks if the player is a privileged member.