package com.argon.item.impl;
import java.awt.Color;
import com.argon.player.Client;
import com.argon.player.plugin.impl.ColoredMessage;
import com.argon.player.plugin.impl.ColoredMessage.Colours;
public class TeleportCrystal {
//Item id of the crystal that's being used.
public static final int CRYSTAL = 0;
/**
* Saves the teleport location.
* [MENTION=75098]Para[/MENTION]m player
*/
public static final void saveLocation(Client player) {
player.crystalX = player.absX;
player.crystalY = player.absY;
player.crystalPlane = player.heightLevel;
player.sendMessage(player, "You have saved the current position to the teleport crystal.");
player.getPA().closeInterfaces();
}
/**
* Teleback.
* [MENTION=75098]Para[/MENTION]m player
* [MENTION=75098]Para[/MENTION]m id
*/
public static final void teleport(Client player) {
if (player.isTeleporting || player.isDead)
return;
else if (player.crystalX == 0) {
player.sendMessage("In order to use teleport crystal you have to save a location to it.");
player.getPA().closeInterfaces();
return;
}
player.getItems().deleteItem(CRYSTAL, 1);
player.getItems().addItem(CRYSTAL + 1, 1);
player.sendMessage(player, "Your teleport crystal has lost a charge.");
player.getPA().spellTeleport(player.crystalX, player.crystalY, player.crystalPlane);
player.getPA().closeInterfaces();
}
private static boolean checkAll(Client player) {
if (player.isDead || player.inDuel || player.inNMZ() || player.inCwGame
|| player.inTrade || player.inFightCaves() || player.inPcBoat() || player.inPcGame())
return false;
else if (player.isTeleporting || player.isDead)
return false;
return true;
}
/**
* Does the player have a teleportation crystal?
* [MENTION=75098]Para[/MENTION]m id
* [MENTION=184045]return[/MENTION]
*/
public static final boolean contains(int id) {
for (int i = 6099; i < 6102; i++)
if (id == i)
return true;
return false;
}
}
Copyright © 2026, NextGenUpdate.
All Rights Reserved.