Jump to content
Sign in to follow this  
Fuzenseth

[Dementhium] - Teleportation System

Recommended Posts

This is a base.

Picture
[img]http://puu.sh/9ZDB0/60bb7fe955.jpg[/img]





Create new file called WorldTeleport to org.dementhium.content
[CODE]package org.dementhium.content;

import org.dementhium.model.player.Player;
import org.dementhium.net.ActionSender;

/**
*
* @author Fuzen Seth
* [MENTION=98951]infor[/MENTION]mation World teleportation system.
* [MENTION=3199]Sin[/MENTION]ce 6.7.2014
*/
public class WorldTeleport {

/**
* Singleton.
*/
private static final WorldTeleport worldTeleport = new WorldTeleport();
/**
* The interface id of the menu.
*/
private static final int MENU_INTERFACE = 72;


/**
* Contains component id and text the to send.
* @author JazzyYaYaYa
*
*/
public enum MenuText {
TRAINING(31, "Training Areas"), MINIGAMES(32, "Minigames"),
SKILLS(33, "Skilling Areas"), BOSS_AREAS(35, "Boss Areas"),
SLAYER(36, "Slayer Areas");;

private int buttonId;
private String message;

private MenuText(int buttonId, String message) {
this.buttonId = buttonId;
this.message = message;
}

public int getButtonId() {
return buttonId;
}

public void setButtonId(int buttonId) {
this.buttonId = buttonId;
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

}
/**
* Open the world teleportation menu.
* [MENTION=75098]Para[/MENTION]m player
*/
public void openMenu(Player player) {
for (int text = 0; text < 56; text++)
ActionSender.sendString(player, 72, text, "");
ActionSender.sendString(player, MENU_INTERFACE, 55, "Select a teleportation type");
for (MenuText menuText : MenuText.values())
ActionSender.sendString(player, MENU_INTERFACE, menuText.getButtonId(), menuText.getMessage());
ActionSender.sendInterface(player, MENU_INTERFACE);
}

public static WorldTeleport getWorldteleport() {
return worldTeleport;
}

public static int getMenuInterface() {
return MENU_INTERFACE;
}

}
[/CODE]

Share this post


Link to post
Share on other sites
Ummm that's it and where do I create the file?

Share this post


Link to post
Share on other sites
package org.dementhium.content;

Share this post


Link to post
Share on other sites
Not really a "system" is a class which handles buttons for teleportation. By not add the tileX/Y to the enum for when the button is clicked? use the worldtile constructor, not sure how it works on this revision though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×