Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package server.model.players.content.command.impl;
- import lombok.Getter;
- import server.Config;
- import server.model.Position;
- import server.model.minigames.weapongame.WeaponMinigame;
- import server.model.players.DonatorRights;
- import server.model.players.Player;
- import server.model.players.PlayerRights;
- import server.model.players.Requirements;
- import server.model.players.content.command.Command;
- import server.model.players.content.command.CommandContainer;
- import server.model.players.content.command.CommandEntry;
- import server.model.players.content.dialogue.SimpleDialogues;
- import server.model.players.content.quests.Quests;
- import server.model.players.content.quests.impl.TurtleDonationQuest;
- import server.model.players.content.quests.impl.zeus.ZeusInstance;
- import server.model.players.content.raid.two.RaidsTwoDifficulty;
- import server.model.players.content.world_boss.WorldBossHandler;
- import server.util.Misc;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.List;
- import java.util.Optional;
- public class TeleportCommandExecutor implements CommandContainer {
- enum Location {
- RAIDS_ONE(new Position(2577, 2502, 0), "raids1", "raidsone", "raid1", "raidone"),
- RAIDS_TWO(new Position(1563, 10017, 0), "raids2", "raidstwo", "raid2", "raidtwo"),
- EVIL_WISE_OLD_MAN(new Position(3194, 3876, 0), "ewom", "evilman"),
- ZEUS(new Position(2873, 3546, 0)),
- PUMMELLER(new Position(2742, 5103, 4), "pummel"),
- QUEEN_BLACK_DRAGON(new Position(1441, 6363, 1), "qbd", "queendragon", "qdragon"),
- GAMBLING_NPC(new Position(2396, 3495, 16), "npcgamble"),
- CERBERUS(new Position(3100, 3930, 4)),
- CORPOREAL_BEAST(new Position(3304, 9375, 0), "corp", "corpbeast", "cbeast"),
- MONEY_ZONE(new Position(2728, 9690, 0), "mzone"),
- HOME(new Position(2751, 2745, 0)),
- SHOPS(new Position(2751, 2784, 0), "shop", "shopping"),
- AUCTIONEER(new Position(2772, 2772, 0), "auction"),
- PRESTIGE_ZONE(new Position(3541, 9866, 0), "prestige"),
- VORAGO_CAVE(new Position(2776, 2734, 0), "omen"),
- LUCKY_KNIGHTS(new Position(3234, 9570, 0), "luckyknight", "lknight"),
- KRIL_TSUTSAROTH(new Position(3284, 2818, 0), "kril"),
- HANK_THE_TANK(new Position(2772, 9341, 0), "hank"),
- DIABLO(new Position(2475, 5214, 0)),
- TORMENTED_DEMON(new Position(2712, 9813, 0), "tds", "td"),
- TZHAAR(new Position(2445, 5177, 0)),
- TERROR_BIRD_BOSS(new Position(2762, 9312, 0), "terror", "tbb", "terrorbird"),
- ALTAR(new Position(2727, 2774, 0)),
- MARKET(new Position(2037, 4526, 0)),
- GUARDIAN(new Position(2742, 2725, 0)),
- SLAYER_MASTER(new Position(2766, 2725, 0), "slayer"),
- SLAYER_TOWER(new Position(3428, 3538, 0)),
- FROST_DRAGONS(new Position(3056, 9563, 0), "frosts"),
- TRAINING_AREA(new Position(2716, 2750, 0), "train"),
- ;
- @Getter Position position;
- @Getter String[] aliases;
- Location(Position position, String... aliases) {
- this.position = position;
- this.aliases = aliases;
- }
- }
- @Override
- public List<Command> execute() {
- List<Command> commands = new ArrayList<>();
- for (Location location : Location.values()) {
- commands.add(new Command(location.name().replaceAll("_", " ").toLowerCase(),
- Optional.of(String.format("Teleport to the %s location.", Misc.formatString(location.name())))) {
- @Override
- public void execute(Player player, CommandEntry command) {
- player.getPacketSender().spellTeleport(location.getPosition());
- player.sendMessage("Successfully teleported to the %s location.", Misc.formatString(location.name()));
- }
- @Override
- public List<String> getAliases() {
- return Arrays.asList(location.getAliases());
- }
- });
- }
- commands.add(new Command("worldboss", Optional.of("Teleport you to the world boss if available.")) {
- @Override
- public void execute(Player player, CommandEntry command) {
- Position position = WorldBossHandler.get().getTeleportPosition();
- if (position == null) {
- player.sendMessage("The world boss is currently inactive for another " + WorldBossHandler.get().timeRemaining() + ".");
- return;
- }
- player.getPacketSender().spellTeleport(position.getX(), position.getY(), position.getZ());
- player.sendMessage("Successfully teleported to the World Boss.");
- }
- });
- commands.add(new Command("christmas", Optional.of("Teleport to the Christmas location.")) {
- @Override
- public void execute(Player player, CommandEntry command) {
- if (Config.CHRISTMAS_ENABLED) {
- player.getPacketSender().spellTeleport(2397, 3488, 4);
- player.sendMessage("Successfully teleported to the Christmas event location.");
- } else {
- player.sendMessage("You may only do this when Christmas event is enabled.");
- }
- }
- @Override
- public boolean isHidden(Player player) {
- return !Config.CHRISTMAS_ENABLED;
- }
- });
- commands.add(new Command("skeletons", Optional.of("Teleport to the Halloween Skeleton location.")) {
- @Override
- public void execute(Player player, CommandEntry command) {
- if (Requirements.meetsRequirements(player, 0, "HALLOWEEN", false, PlayerRights.PLAYER)) {
- player.getPacketSender().spellTeleport(3561, 9784, 0);
- player.sendMessage("Successfully teleported to the Halloween Skeleton location.");
- }
- }
- @Override
- public boolean isHidden(Player player) {
- return Requirements.meetsRequirements(player, 0, "HALLOWEEN", false, PlayerRights.PLAYER, false);
- }
- });
- commands.add(new Command("halloween", Optional.of("Teleport to the Halloween location.")) {
- @Override
- public void execute(Player player, CommandEntry command) {
- if (Config.HALLOWEEN_EVENT_ENABLED) {
- player.getPacketSender().spellTeleport(1863, 5244, 0);
- player.sendMessage("Successfully teleported to the Halloween location.");
- }
- }
- @Override
- public boolean isHidden(Player player) {
- return !Config.HALLOWEEN_EVENT_ENABLED;
- }
- });
- commands.add(new Command("turtle", Optional.of("Teleport to the Diablo location.")) {
- @Override
- public void execute(Player player, CommandEntry command) {
- if (player.getQuestStage(Quests.TURTLE_DONATION) == 0) {
- new TurtleDonationQuest(player).incrementStage();
- }
- player.getPacketSender().spellTeleport(2762, 9312, 0);
- player.sendMessage("Successfully teleported to the Diablo location.");
- }
- @Override
- public List<String> getAliases() {
- return Arrays.asList("turtlezone", "turtles", "tzone");
- }
- });
- return commands;
- }
- @Override
- public PlayerRights getBasePlayerRights() {
- return PlayerRights.PLAYER;
- }
- @Override
- public DonatorRights getBaseDonatorRights() {
- return DonatorRights.NONE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment