Code:
package server.model.players.packets;
import server.Config;
import server.Connection;
import server.Server;
import server.model.players.PlayerSave;
import server.model.players.Player;
import server.model.players.Client;
import server.model.players.PacketType;
import server.model.players.PlayerHandler;
import server.util.Misc;
import server.model.minigames.lottery;
import java.util.Locale;
import java.io.*;
/**
* Commands
**/
public class Commands implements PacketType
{
@Override
public void processPacket(Client c, int packetType, int packetSize)
{
String playerCommand = c.getInStream().readString();
if (!playerCommand.startsWith("/"))
{
c.getPA().writeCommandLog(playerCommand);
}
if (playerCommand.startsWith("report") && playerCommand.length() > 7) {
try {
BufferedWriter report = new BufferedWriter(new FileWriter("./Data/bans/Reports.txt", true));
String Report = playerCommand.substring(7);
try {
report.newLine();
report.write(c.playerName + ": " + Report);
c.sendMessage("You have successfully submitted your report.");
} finally {
report.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
if (playerCommand.equals("staffzone") && (c.playerRights >= 1)) {
c.getPA().startTeleport(2012, 4751, 0, "modern");
c.sendMessage("Welcome to the Staff zone!");
}
if (playerCommand.equals("chill") && (c.playerRights >= 0)) {
c.getPA().startTeleport(2705, 9187, 1, "modern");
c.sendMessage("Welcome to the Chill zone");
}
if (playerCommand.equals("home") && (c.playerRights >= 0)) {
c.getPA().startTeleport(2844, 10209, 0, "modern");
}
if (playerCommand.equals("train") && (c.playerRights >= 0)) {
c.getPA().startTeleport(2683, 3725, 0, "modern");
}
if (playerCommand.equals("lottery")) {
c.sendMessage("The Lottery Fund is currently at <col=255>" + c.lotteryFund + "</col>m.");
}
if(playerCommand.equalsIgnoreCase("collect")){
if(c.playerCollect > 0){
c.sendMessage("You succesfully collected <col=255>"+c.playerCollect+"</col> Dragon Tokens.");
c.getItems().addItem(7478, c.playerCollect);
c.playerCollect = 0;
}else{
c.sendMessage("<shad=6071134>You dont have anything to collect.</col>");
}
}
if(playerCommand.equalsIgnoreCase("myshop")){
if(c.absX > 3074 && c.absX < 3107 && c.absY > 3472 && c.absY < 3506){
c.getShops().openPlayerShop(c);
}else
c.sendMessage("<shad=6081134>You can only view your shops at home.</col>");
}
if (playerCommand.startsWith("kdr")) {
double KDR = ((double)c.KC)/((double)c.DC);
c.forcedChat("My Kill/Death ratio is "+c.KC+"/"+c.DC+"; "+KDR+".");
}
if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
if (c.clanId >= 0) {
System.out.println(playerCommand);
playerCommand = playerCommand.substring(1).toLowerCase(Locale.ENGLISH);
Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
} else {
if (c.clanId != -1)
c.clanId = -1;
c.sendMessage("You are not in a clan.");
}
return;
}
if (Config.SERVER_DEBUG)
Misc.println(c.playerName+" playerCommand: "+playerCommand);
if (c.playerRights >= 0)
playerCommands(c, playerCommand);
if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 3)
moderatorCommands(c, playerCommand);
if (c.playerRights == 2 || c.playerRights == 3)
administratorCommands(c, playerCommand);
if (c.playerRights == 3)
ownerCommands(c, playerCommand);
if (c.playerRights == 7)
SupportCommands(c, playerCommand);
if (c.playerRights == 4)
DonatorCommands(c, playerCommand);
}
public void playerCommands(Client c, String playerCommand)
{
if(playerCommand.startsWith("withdraw")) {
String[] cAmount = playerCommand.split(" ");
int amount = Integer.parseInt(cAmount[1]);
if (c.inWild()) {
c.sendMessage("You cannot do this in the wilderness");
c.getPA().sendFrame126(""+c.MoneyCash+"", 8135);
return;
}
if (amount < 1) {
return;
}
if(amount == 0) {
c.sendMessage("Why would I withdraw no coins?");
return;
}
if(c.MoneyCash == 0) {
c.sendMessage("You don't have any cash in the bag.");
c.getPA().sendFrame126(""+c.MoneyCash+"", 8135);
return;
}
if(c.MoneyCash < amount) {
if(amount == 1) {
c.sendMessage("You withdraw 1 coin.");
} else {
c.sendMessage("You withdraw "+c.MoneyCash+" coins.");
}
c.getItems().addItem(995, c.MoneyCash);
c.MoneyCash = 0;
c.getPA().sendFrame126(""+c.MoneyCash+"", 8134);
c.getPA().sendFrame126(""+c.MoneyCash+"", 8135);
return;
}
if(c.MoneyCash != 0) {
if(amount == 1) {
c.sendMessage("You withdraw 1 coin.");
} else {
c.sendMessage("You withdraw "+amount+" coins.");
}
c.MoneyCash -= amount;
c.getItems().addItem(995, amount);
c.getPA().sendFrame126(""+c.MoneyCash+"", 8135);
if(c.MoneyCash > 99999 && c.MoneyCash <= 999999) {
c.getPA().sendFrame126(""+c.MoneyCash/1000+"K", 8134);
} else if(c.MoneyCash > 999999 && c.MoneyCash <= 2147483647) {
c.getPA().sendFrame126(""+c.MoneyCash/1000000+"M", 8134);
} else {
c.getPA().sendFrame126(""+c.MoneyCash+"", 8134);
}
c.getPA().sendFrame126(""+c.MoneyCash+"", 8135);
}
}
if (playerCommand.equals("rest")) {
c.startAnimation(5713);
}
if (playerCommand.startsWith("pkp") || playerCommand.startsWith("PKP") || playerCommand.startsWith("Pkp")) {
c.sendMessage("You have <col=1532693>" + c.pkPoints + "</col> Pk points");
}
if (playerCommand.equals("vote")) {
c.getPA().sendFrame126("www.runelocus.com/toplist/vote-29190.html", 12000);
c.sendMessage("Please vote every 12 hours!");
}
if (playerCommand.equals("forums")) {
c.getPA().sendFrame126("www.alchemize.site50.net/", 12000);
c.sendMessage("Welcome! Please register!!");
}
if (playerCommand.startsWith("settitle") && c.isDonator == 1) {
String[] args = playerCommand.split(" ");
if (args.length == 2) {
int titleId = Integer.parseInt(args[1]);
c.playerTitle = titleId;
c.getPA().requestUpdates();
}
if (c.playerTitle == 1) {
c.sendMessage("You have set your title to: <col=12273152>Lord</col>.");
return;
} else if (c.playerTitle == 2) {
c.sendMessage("You have set your title to: <col=12273152>Sir</col>.");
return;
} else if (c.playerTitle == 3) {
c.sendMessage("You have set your title to: <col=12273152>Lionheart</col>.");
return;
} else if (c.playerTitle == 4) {
c.sendMessage("You have set your title to: <col=9044149>Donator</col>.");
return;
} else if (c.playerTitle == 5) {
c.sendMessage("You have set your title to: <col=12273152>Bandito</col>.");
return;
} else if (c.playerTitle == 6) {
c.sendMessage("You have set your title to: <col=12273152>King</col>.");
return;
} else if (c.playerTitle == 7) {
c.sendMessage("You have set your title to: <col=12273152>Big Cheese</col>.");
return;
} else if (c.playerTitle == 8) {
c.sendMessage("You have set your title to: <col=12273152>Wunderkind</col>.");
return;
} else if (c.playerTitle == 9) {
c.sendMessage("You have set your title to: <col=12273152>Crusader</col>.");
return;
} else if (c.playerTitle == 10) {
c.sendMessage("You have set your title to: <col=9044149>Overlord</col>.");
return;
} else if (c.playerTitle == 11 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>****Bear</col>.");
return;
} else if (c.playerTitle == 11 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>****Bear</col>.");
return;
} else if (c.playerTitle == 12) {
c.sendMessage("You have set your title to: <col=12320768>Count</col>.");
return;
} else if (c.playerTitle == 13 && c.playerLevel[0] == 99 && c.playerLevel[1] == 99 && c.playerLevel[2] == 99 && c.playerLevel[3] == 99 && c.playerLevel[4] == 99 && c.playerLevel[5] == 99 && c.playerLevel[6] == 99 && c.playerLevel[7] == 99 && c.playerLevel[8] == 99 && c.playerLevel[9] == 99 && c.playerLevel[10] == 99 && c.playerLevel[11] == 99 && c.playerLevel[12] == 99 && c.playerLevel[13] == 99 && c.playerLevel[14] == 99 && c.playerLevel[15] == 99 && c.playerLevel[16] == 99 && c.playerLevel[17] == 99 && c.playerLevel[18] == 99 && c.playerLevel[19] == 99 && c.playerLevel[20] == 99 && c.playerLevel[21] == 99 && c.playerLevel[22] == 99) {
c.sendMessage("You have set your title to: <col=12320768>Legend</col>.");
return;
} else if (c.playerTitle == 14) {
c.sendMessage("You have set your title to: <col=12320768>Hell Raiser</col>.");
return;
} else if (c.playerTitle == 15) {
c.sendMessage("You have set your title to: <col=9044149>Baron</col>.");
return;
} else if (c.playerTitle == 16) {
c.sendMessage("You have set your title to: <col=12273152>Duke</col>.");
return;
} else if (c.playerTitle == 17) {
c.sendMessage("You have set your title to: <col=12273152>Lady</col>.");
return;
} else if (c.playerTitle == 18) {
c.sendMessage("You have set your title to: <col=12273152>The Great</col>.");
return;
} else if (c.playerTitle == 19) {
c.sendMessage("You have set your title to: <col=12273152>Dudette</col>.");
return;
} else if (c.playerTitle == 20) {
c.sendMessage("You have set your title to: <col=12273152>Baroness</col>.");
return;
} else if (c.playerTitle == 21) {
c.sendMessage("You have set your title to: <col=12273152>Countess</col>.");
return;
} else if (c.playerTitle == 22) {
c.sendMessage("You have set your title to: <col=12273152>Overlordess</col>.");
return;
} else if (c.playerTitle == 23) {
c.sendMessage("You have set your title to: <col=12273152>Duchess</col>.");
return;
} else if (c.playerTitle == 24) {
c.sendMessage("You have set your title to: <col=12273152>Queen</col>.");
return;
} else if (c.playerTitle == 25) {
c.sendMessage("You have set your title to: <col=12320768>Private</col>.");
return;
} else if (c.playerTitle == 29 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12273152>Super</col>.");
return;
} else if (c.playerTitle == 30) {
c.sendMessage("You have set your title to: <col=12320768>Royal</col>.");
return;
} else if (c.playerTitle == 32 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Support</col>.");
return;
} else if (c.playerTitle == 33) {
c.sendMessage("You have set your title to: <col=12320768>Donator</col>.");
return;
} else if (c.playerTitle == 34 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>Nerd</col>.");
return;
} else if (c.playerTitle == 34 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>Nerd</col>.");
return;
} else if (c.playerTitle == 35) {
c.sendMessage("You have set your title to: <col=12320768>Master</col>.");
return;
} else if (c.playerTitle == 36) {
c.sendMessage("You have set your title to: <col=12273152>Miss</col>.");
return;
} else if (c.playerTitle == 37) {
c.sendMessage("You have set your title to: <col=12273152>The Awesome</col>.");
return;
} else if (c.playerTitle == 38) {
c.sendMessage("You have set your title to: <col=12273152>The Real</col>.");
return;
} else if (c.playerTitle == 39) {
c.sendMessage("You have set your title to: <col=12273152>The Untouchable</col>.");
return;
} else if (c.playerTitle == 40) {
c.sendMessage("You have set your title to: <col=12273152>Outrageous</col>.");
return;
} else if (c.playerTitle == 41 && c.playerLevel[16] == 99) {
c.sendMessage("You have set your title to: <col=12273152>Athlete</col>.");
return;
} else if (c.playerTitle == 42) {
c.sendMessage("You have set your title to: <col=9044149>The</col>.");
return;
} else if (c.playerTitle == 43) {
c.sendMessage("You have set your title to: <col=12273152>Junior</col>.");
return;
} else if (c.playerTitle == 44) {
c.sendMessage("You have set your title to: <col=12273152>Mr</col>.");
return;
} else if (c.playerTitle == 45) {
c.sendMessage("You have set your title to: <col=12273152>Mrs</col>.");
return;
} else if (c.playerTitle == 46) {
c.sendMessage("You have set your title to: <col=9044149>Esquire</col>.");
return;
} else if (c.playerTitle == 47) {
c.sendMessage("You have set your title to: <col=12273152>Ms</col>.");
return;
} else if (c.playerTitle == 48) {
c.sendMessage("You have set your title to: <col=12273152>Doctor</col>.");
return;
} else if (c.playerTitle == 49) {
c.sendMessage("You have set your title to: <col=12320768>The Adorable</col>.");
return;
} else if (c.playerTitle == 50) {
c.sendMessage("You have set your title to: <col=12273152>Cheerful</col>.");
return;
} else if (c.playerTitle == 51) {
c.sendMessage("You have set your title to: <col=9044149>Grumpy</col>.");
return;
} else if (c.playerTitle == 52 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Assassin</col>.");
return;
} else if (c.playerTitle == 52 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Assassin</col>.");
return;
} else if (c.playerTitle == 53) {
c.sendMessage("You have set your title to: <col=9044149>Cute</col>.");
return;
} else if (c.playerTitle == 54 && c.KC == 100) {
c.sendMessage("You have set your title to: <col=12320768>PKer</col>.");
return;
} else if (c.playerTitle == 55 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Horny</col>.");
return;
} else if (c.playerTitle == 55 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Horny</col>.");
return;
} else if (c.playerTitle == 56 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Kinky</col>.");
return;
} else if (c.playerTitle == 56 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Kinky</col>.");
return;
} else if (c.playerTitle == 57 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Black</col>.");
return;
} else if (c.playerTitle == 57 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Black</col>.");
return;
} else if (c.playerTitle == 58 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12273152>***y</col>.");
return;
} else if (c.playerTitle == 58 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12273152>***y</col>.");
return;
} else if (c.playerTitle == 59 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12273152>Otaku</col>.");
return;
} else if (c.playerTitle == 59 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12273152>Otaku</col>.");
return;
} else if (c.playerTitle == 60) {
c.sendMessage("You have set your title to: <col=12320768>Dicer</col>.");
return;
} else if (c.playerTitle == 61 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>Derp</col>.");
return;
} else if (c.playerTitle == 61 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>Derp</col>.");
return;
} else if (c.playerTitle == 62 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Monster</col>.");
return;
} else if (c.playerTitle == 62 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Monster</col>.");
return;
} else if (c.playerTitle == 63 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>RedBull</col>.");
return;
} else if (c.playerTitle == 63 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>RedBull</col>.");
return;
} else if (c.playerTitle == 64 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>Noz</col>.");
return;
} else if (c.playerTitle == 64 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>Noz</col>.");
return;
} else if (c.playerTitle == 65 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Stoner</col>.");
return;
} else if (c.playerTitle == 65 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Stoner</col>.");
return;
} else if (c.playerTitle == 66 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Weed</col>.");
return;
} else if (c.playerTitle == 66 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Weed</col>.");
return;
} else if (c.playerTitle == 67 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Kush</col>.");
return;
} else if (c.playerTitle == 67 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Kush</col>.");
return;
} else if (c.playerTitle == 68) {
c.sendMessage("You have set your title to: <col=12273152>Skiller</col>.");
return;
} else if (c.playerTitle == 69 && c.playerLevel[10] == 99) {
c.sendMessage("You have set your title to: <col=9044149>MasterBaiter</col>.");
return;
} else if (c.playerTitle == 70) {
c.sendMessage("You have set your title to: <col=9044149>Sergeant</col>.");
return;
} else if (c.playerTitle == 71) {
c.sendMessage("You have set your title to: <col=9044149>Lieutenant</col>.");
return;
} else if (c.playerTitle == 72) {
c.sendMessage("You have set your title to: <col=9044149>Commander</col>.");
return;
} else if (c.playerTitle == 73) {
c.sendMessage("You have set your title to: <col=9044149>Private</col>.");
return;
} else if (c.playerTitle == 74 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>God</col>.");
return;
} else if (c.playerTitle == 75 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>Demon</col>.");
return;
} else if (c.playerTitle == 76 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12273152>Troll</col>.");
return;
} else if (c.playerTitle == 77 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>Satan</col>.");
return;
} else if (c.playerTitle == 78 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>HeadMod</col>.");
return;
} else if (c.playerTitle == 79 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>HeadAdmin</col>.");
return;
} else if (c.playerTitle == 80 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Founder</col>.");
return;
} else if (c.playerTitle == 81 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>CoOwner</col>.");
return;
} else if (c.playerTitle == 82 && c.playerName.equalsIgnoreCase("Die fly3")) {
c.sendMessage("You have set your title to: <col=12320768>Co</col>.");
return;
} else if (c.playerTitle == 83 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>GFXer</col>.");
return;
} else if (c.playerTitle == 84) {
c.sendMessage("You have set your title to: <col=12273152>Spartan</col>.");
return;
} else if (c.playerTitle == 85 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12273152>Skiller</col>.");
return;
} else if (c.playerTitle == 85 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12273152>Skiller</col>.");
return;
} else if (c.playerTitle == 85 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=16743680>Skiller</col>.");
return;
} else if (c.playerTitle == 86) {
c.sendMessage("You have set your title to: <col=9044149>The Mystical</col>.");
return;
} else if (c.playerTitle == 87) {
c.sendMessage("You have set your title to: <col=12320768>Super Saiyan</col>.");
return;
} else if (c.playerTitle == 88) {
c.sendMessage("You have set your title to: <col=12320768>SSJ</col>.");
return;
} else if (c.playerTitle == 89) {
c.sendMessage("You have set your title to: <col=12320768>SSJ2</col>.");
return;
} else if (c.playerTitle == 90) {
c.sendMessage("You have set your title to: <col=12320768>SSJ3</col>.");
return;
} else if (c.playerTitle == 91) {
c.sendMessage("You have set your title to: <col=12320768>SSJ4</col>.");
return;
} else if (c.playerTitle == 92 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>Kyuubi</col>.");
return;
} else if (c.playerTitle == 93 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12273152>Minato</col>.");
return;
} else if (c.playerTitle == 94 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Hokage</col>.");
return;
} else if (c.playerTitle == 95 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Raikage</col>.");
return;
} else if (c.playerTitle == 96 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Kazekage</col>.");
return;
} else if (c.playerTitle == 97 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Kawaii</col>.");
return;
} else if (c.playerTitle == 97 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=16743680>Kawaii</col>.");
return;
} else if (c.playerTitle == 98) {
c.sendMessage("You have set your title to: <col=12273152>Yolo</col>.");
return;
} else if (c.playerTitle == 99 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>TryHard</col>.");
return;
} else if (c.playerTitle == 100 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=12320768>The Epic</col>.");
return;
} else if (c.playerTitle == 26 && c.playerRights >= 1) {
c.sendMessage("You have set your title to: <col=9044149>Mod</col>.");
return;
} else if (c.playerTitle == 27 && c.playerRights >= 2) {
c.sendMessage("You have set your title to: <col=9044149>Admin</col>.");
return;
} else if (c.playerTitle == 28 && c.playerRights == 3) {
c.sendMessage("You have set your title to: <col=9044149>Owner</col>.");
return;
} else if (c.playerTitle == 31 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Veteran</col>.");
return;
} else if (c.playerTitle == 31 && c.playerName.equalsIgnoreCase("Matt")) {
c.sendMessage("You have set your title to: <col=9044149>Veteran</col>.");
return;
} else {
c.sendMessage("You do not have this title unlocked. Your title has been reset.");
c.playerTitle = 0;
return;
}
}
/*if(playerCommand.startsWith("mytitles") && c.isDonator == 1) {
c.getPA().showInterface(8134);
c.getPA().sendFrame126("@cya@Alchemize Player Titles:", 8144);
c.getPA().sendFrame126("1.Lord:@gre@ Unlocked", 8145);
c.getPA().sendFrame126("2.Sir:@gre@ Unlocked", 8146);
c.getPA().sendFrame126("3.Lionheart:@gre@ Unlocked", 8147);
c.getPA().sendFrame126("4.Donator:@gre@ Unlocked", 8148);
c.getPA().sendFrame126("5.Bandito:@gre@ Unlocked", 8149);
c.getPA().sendFrame126("6.King:@gre@ Unlocked", 8150);
c.getPA().sendFrame126("7.Big Cheese:@gre@ Unlocked", 8151);
c.getPA().sendFrame126("8.Wunderkind:@gre@ Unlocked", 8152);
c.getPA().sendFrame126("9.Crusader:@gre@ Unlocked", 8153);
c.getPA().sendFrame126("10.Overlord:@gre@ Unlocked", 8154);
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("11.****Bear:@gre@ Unlocked", 8155);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("11.****Bear:@gre@ Unlocked", 8155);
} else {
c.getPA().sendFrame126("11.****Bear:@red@ Locked", 8155);
}
c.getPA().sendFrame126("12.Count:@gre@ Unlocked", 8156);
if (c.playerLevel[0] == 99 && c.playerLevel[1] == 99 && c.playerLevel[2] == 99 && c.playerLevel[3] == 99 && c.playerLevel[4] == 99 && c.playerLevel[5] == 99 && c.playerLevel[6] == 99 && c.playerLevel[7] == 99 && c.playerLevel[8] == 99 && c.playerLevel[9] == 99 && c.playerLevel[10] == 99 && c.playerLevel[11] == 99 && c.playerLevel[12] == 99 && c.playerLevel[13] == 99 && c.playerLevel[14] == 99 && c.playerLevel[15] == 99 && c.playerLevel[16] == 99 && c.playerLevel[17] == 99 && c.playerLevel[18] == 99 && c.playerLevel[19] == 99 && c.playerLevel[20] == 99 && c.playerLevel[21] == 99 && c.playerLevel[22] == 99) {
c.getPA().sendFrame126("13.Legend:@gre@ Unlocked", 8157);
} else {
c.getPA().sendFrame126("13.Legend:@gre@ Locked", 8157);
}
c.getPA().sendFrame126("14.Hell Raiser:@gre@ Unlocked", 8158);
c.getPA().sendFrame126("15.Baron:@gre@ Unlocked", 8159);
c.getPA().sendFrame126("16.Duke:@gre@ Unlocked", 8160);
c.getPA().sendFrame126("17.Lady:@gre@ Unlocked", 13606);
c.getPA().sendFrame126("18.TheGreat:@gre@ Unlocked", 8161);
c.getPA().sendFrame126("19.Dudette:@gre@ Unlocked", 8162);
c.getPA().sendFrame126("20.Baroness:@gre@ Unlocked", 8163);
c.getPA().sendFrame126("21.Countess:@gre@ Unlocked", 8164);
c.getPA().sendFrame126("22.Overlordess:@gre@ Unlocked", 8165);
c.getPA().sendFrame126("23.Duchess:@gre@ Unlocked", 8166);
c.getPA().sendFrame126("24.Queen:@gre@ Unlocked", 8167);
c.getPA().sendFrame126("25.Private:@gre@ Unlocked", 8168);
if (c.playerRights == 1) {
c.getPA().sendFrame126("26.Mod:@gre@ Unlocked", 8169);
} else {
c.getPA().sendFrame126("26.Mod:@red@ Not happening.", 8169);
}
if (c.playerRights == 2) {
c.getPA().sendFrame126("27.Admin:@gre@ Unlocked", 8170);
} else {
c.getPA().sendFrame126("27.Admin:@red@ Not happening.", 8170);
}
if (c.playerRights == 3) {
c.getPA().sendFrame126("28.Owner:@gre@ Unlocked", 8171);
} else {
c.getPA().sendFrame126("28.Owner:@red@ Not happening.", 8171);
}
c.getPA().sendFrame126("29.Super:@gre@ Unlocked", 8172);
c.getPA().sendFrame126("30.Royal:@gre@ Unlocked", 8173);
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("31.Veteran:@gre@ Unlocked", 8174);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("31.Veteran:@gre@ Unlocked", 8174);
} else {
c.getPA().sendFrame126("31.Veteran:@red@ Too new", 8174);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("32.Support:@gre@ Unlocked", 8175);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("32.Support:@gre@ Unlocked", 8175);
} else {
c.getPA().sendFrame126("32.Support:@red@ Not Qualified", 8175);
}
c.getPA().sendFrame126("33.Donator:@gre@ Unlocked", 8176);
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("34.Nerd:@gre@ Unlocked", 8177);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("34.Nerd:@gre@ Unlocked", 8177);
} else {
c.getPA().sendFrame126("34.Nerd:@red@ Locked", 8177);
}
c.getPA().sendFrame126("35.Master:@gre@ Unlocked", 8178);
c.getPA().sendFrame126("36.Miss:@gre@ Unlocked", 8179);
c.getPA().sendFrame126("37.The Awesome:@gre@ Unlocked", 8180);
c.getPA().sendFrame126("38.The Real:@gre@ Unlocked", 8181);
c.getPA().sendFrame126("39.The Untouchable:@gre@ Unlocked", 8182);
c.getPA().sendFrame126("40.Outrageous:@gre@ Unlocked", 8183);
if (c.playerLevel[16] == 99) {
c.getPA().sendFrame126("41.Athlete:@gre@ Unlocked", 8184);
} else {
c.getPA().sendFrame126("41.Athlete:@red@ Locked", 8184);
}
c.getPA().sendFrame126("42.The:@gre@ Unlocked", 8185);
c.getPA().sendFrame126("43.Junior:@gre@ Unlocked", 8186);
c.getPA().sendFrame126("44.Mr:@gre@ Unlocked", 8187);
c.getPA().sendFrame126("45.Mrs:@gre@ Unlocked", 8188);
c.getPA().sendFrame126("46.Esquire:@gre@ Unlocked", 8189);
c.getPA().sendFrame126("47.Ms:@gre@ Unlocked", 8190);
c.getPA().sendFrame126("48.Doctor:@gre@ Unlocked", 8191);
c.getPA().sendFrame126("49.The Adorable:@gre@ Unlocked", 8192);
c.getPA().sendFrame126("50.Cheerful:@gre@ Unlocked", 8193);
return;
}
if(playerCommand.startsWith("mytitles2") && c.isDonator == 1) {
c.getPA().showInterface(8134);
c.getPA().sendFrame126("@cya@Alchemize Player Titles:", 8144);
c.getPA().sendFrame126("51.Grumpy:@gre@ Unlocked", 8194);
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("52.Assassin:@gre@ Unlocked", 8195);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("52.Assassin:@gre@ Unlocked", 8195);
} else {
c.getPA().sendFrame126("52.Assassin:@red@ Locked", 8195);
}
c.getPA().sendFrame126("53.Cute:@gre@ Unlocked", 8196);
if (c.KC == 100) {
c.getPA().sendFrame126("54.PKer:@gre@ Unlocked", 8197);
} else {
c.getPA().sendFrame126("54.PKer:@red@ Locked", 8197);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("55.Horny:@gre@ Unlocked", 8198);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("55.Horny:@gre@ Unlocked", 8198);
} else {
c.getPA().sendFrame126("55.Horny:@red@ Locked", 8198);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("56.Kinky:@gre@ Unlocked", 8199);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("56.Kinky:@gre@ Unlocked", 8199);
} else {
c.getPA().sendFrame126("56.Kinky:@red@ Locked", 8199);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("57.Black:@gre@ Unlocked", 8200);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("57.Black:@gre@ Unlocked", 8200);
} else {
c.getPA().sendFrame126("57.Black:@red@ Locked", 8200);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("58.***y:@gre@ Unlocked", 8201);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("58.***y:@gre@ Unlocked", 8201);
} else {
c.getPA().sendFrame126("58.***y:@red@ Locked", 8201);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("59.Otaku:@gre@ Unlocked", 8202);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("59.Otaku:@gre@ Unlocked", 8202);
} else {
c.getPA().sendFrame126("59.Otaku:@red@ Locked", 8202);
}
c.getPA().sendFrame126("60.Dicer:@gre@ Unlocked", 8203);
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("61.Derp:@gre@ Unlocked", 8204);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("61.Derp:@gre@ Unlocked", 8204);
} else {
c.getPA().sendFrame126("61.Derp:@red@ Locked", 8204);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("62.Monster:@gre@ Unlocked", 8145);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("62.Monster:@gre@ Unlocked", 8145);
} else {
c.getPA().sendFrame126("62.Monster:@red@ Locked", 8145);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("63.RedBull:@gre@ Unlocked", 8146);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("63.RedBull:@gre@ Unlocked", 8146);
} else {
c.getPA().sendFrame126("63.RedBull:@red@ Locked", 8146);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("64.Noz:@gre@ Unlocked", 8147);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("64.Noz:@gre@ Unlocked", 8147);
} else {
c.getPA().sendFrame126("64.Noz:@red@ Locked", 8147);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("65.Stoner:@gre@ Unlocked", 8148);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("65.Stoner:@gre@ Unlocked", 8148);
} else {
c.getPA().sendFrame126("65.Stoner:@red@ Locked", 8148);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("66.Weed:@gre@ Unlocked", 8149);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("66.Weed:@gre@ Unlocked", 8149);
} else {
c.getPA().sendFrame126("66.Weed:@red@ Locked", 8149);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("67.Kush:@gre@ Unlocked", 8150);
} else if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("67.Kush:@gre@ Unlocked", 8150);
} else {
c.getPA().sendFrame126("67.Kush:@red@ Locked", 8150);
}
c.getPA().sendFrame126("68.Skiller:@gre@ Unlocked", 8151);
if (c.playerLevel[10] == 99) {
c.getPA().sendFrame126("69.MasterBaiter:@gre@ Unlocked", 8152);
} else {
c.getPA().sendFrame126("69.MasterBaiter:@red@ Locked", 8152);
}
c.getPA().sendFrame126("70.Sergeant:@gre@ Unlocked", 8153);
c.getPA().sendFrame126("71.Lieutenant:@gre@ Unlocked", 8154);
c.getPA().sendFrame126("72.Commander:@gre@ Unlocked", 8155);
c.getPA().sendFrame126("73.Private:@gre@ Unlocked", 8156);
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("74.God:@gre@ Unlocked", 8157);
} else {
c.getPA().sendFrame126("74.God:@red@ Locked", 8157);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("75.Demon:@gre@ Unlocked", 8158);
} else {
c.getPA().sendFrame126("75.Demon:@red@ Locked", 8158);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("76.Troll:@gre@ Unlocked", 8159);
} else {
c.getPA().sendFrame126("76.Troll:@red@ Locked", 8159);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("77.Satan:@gre@ Unlocked", 8160);
} else {
c.getPA().sendFrame126("77.Satan:@red@ Locked", 8160);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("78.HeadMod:@gre@ Unlocked", 8161);
} else {
c.getPA().sendFrame126("78.HeadMod:@red@ Locked", 8161);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("79.HeadAdmin:@gre@ Unlocked", 8162);
} else {
c.getPA().sendFrame126("79.HeadAdmin:@red@ Locked", 8162);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("80.Founder:@gre@ Unlocked", 8163);
} else {
c.getPA().sendFrame126("80.Founder:@red@ Locked", 8163);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("81.CoOwner:@gre@ Unlocked", 8164);
} else {
c.getPA().sendFrame126("81.CoOwner:@red@ Locked", 8164);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("82.Co:@gre@ Unlocked", 8165);
} else {
c.getPA().sendFrame126("82.Co:@red@ Locked", 8165);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("83.GFXer:@gre@ Unlocked", 8166);
} else {
c.getPA().sendFrame126("83.GFXer:@red@ Locked", 8166);
}
c.getPA().sendFrame126("84.Spartan:@gre@ Unlocked", 8167);
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("85.Respected:@gre@ Unlocked", 8168);
} else {
c.getPA().sendFrame126("85.Respected:@red@ Locked", 8168);
}
if (c.playerName.equalsIgnoreCase("Dylan")) {
c.getPA().sendFrame126("85.Respected:@gre@ Unlocked", 8168);
} else {
c.getPA().sendFrame126("85.Respected:@red@ Locked", 8168);
}
if (c.playerName.equalsIgnoreCase("Kenny")) {
c.getPA().sendFrame126("85.Respected:@gre@ Unlocked", 8168);
} else {
c.getPA().sendFrame126("85.Respected:@red@ Locked", 8168);
}
c.getPA().sendFrame126("86.The Mystical:@gre@ Unlocked", 8169);
c.getPA().sendFrame126("87.Super Saiyan:@gre@ Unlocked", 8170);
c.getPA().sendFrame126("88.SSJ:@gre@ Unlocked", 8171);
c.getPA().sendFrame126("89.SSJ2:@gre@ Unlocked", 8172);
c.getPA().sendFrame126("90.SSJ3:@gre@ Unlocked", 8173);
c.getPA().sendFrame126("91.SSJ4:@gre@ Unlocked", 8174);
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("92.Kyuubi:@gre@ Unlocked", 8175);
} else {
c.getPA().sendFrame126("92.Kyuubi:@red@ Locked", 8175);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("93.Minato:@gre@ Unlocked", 8176);
} else {
c.getPA().sendFrame126("93.Minato:@red@ Locked", 8176);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("94.Hokage:@gre@ Unlocked", 8177);
} else {
c.getPA().sendFrame126("94.Hokage:@red@ Locked", 8177);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("95.Raikage:@gre@ Unlocked", 8178);
} else {
c.getPA().sendFrame126("95.Raikage:@red@ Locked", 8178);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("96.Kazekage:@gre@ Unlocked", 8179);
} else {
c.getPA().sendFrame126("96.Kazekage:@red@ Locked", 8179);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("97.Kawaii:@gre@ Unlocked", 8180);
} else {
c.getPA().sendFrame126("97.Kawaii:@red@ Locked", 8180);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("97.Kawaii:@gre@ Unlocked", 8180);
} else {
c.getPA().sendFrame126("97.Kawaii:@red@ Locked", 8180);
}
c.getPA().sendFrame126("98.Yolo:@gre@ Unlocked", 8181);
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("99.TryHard:@gre@ Unlocked", 8182);
} else {
c.getPA().sendFrame126("99.TryHard:@red@ Locked", 8182);
}
if (c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().sendFrame126("100.The Epic:@gre@ Unlocked", 8183);
} else {
c.getPA().sendFrame126("100.The Epic:@red@ Locked", 8183);
}
return;
}*/
if (playerCommand.equalsIgnoreCase("players")) {
c.sendMessage("There are currently "+PlayerHandler.getPlayerCount()+ " players online.");
}
if (playerCommand.startsWith("rules")) {
c.getPA().sendFrame126("www.alchemize.site50.net/index.php?topic=3.0", 12000);
c.sendMessage("Please read our rules to prevent getting banned!");
}
if (playerCommand.startsWith("commands")) {
c.getPA().sendFrame126("www.alchemize.site50.net/index.php?topic=17.0", 12000);
c.sendMessage("To suggest more commands, post on the forums!");
}
if (playerCommand.startsWith("cleartitle") && c.isDonator == 1) {
c.sendMessage("<shad=255>You have reset your Player title!</col>");
c.playerTitle = 0;
}
if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
c.playerPass = playerCommand.substring(15);
c.sendMessage("Your password is now: " + c.playerPass);
}
if (playerCommand.startsWith("ep") || playerCommand.startsWith("Ep") || playerCommand.startsWith("EP") || playerCommand.startsWith("eP")) {
c.sendMessage("EP: "+ c.earningPotential+"");
}
if (playerCommand.startsWith("yell")) {
/*
*This is the sensor for the yell command
*/
/*String text = playerCommand.substring(5);
String[] bad = {"chalreq", "duelreq", "tradereq", ". com", "c0m", "com",
"org", "net", "biz", ". net", ". org", ". biz",
". no-ip", "- ip", ".no-ip.biz", "no-ip.org", "servegame",
".com", ".net", ".org", "no-ip", "****", "is gay", "****",
"crap", "rubbish", ". com", ". serve", ". no-ip", ". net", ". biz"};
for(int i = 0; i < bad.length; i++){
if(text.indexOf(bad[i]) >= 0){
return;
}
}*/
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
if (c.playerName.equalsIgnoreCase("Matt")) {
c2.sendMessage("<col=17407><shad=54783>[Owner]<img=2>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"</col></shad>");
}else if (c.isDonator == 4) {
c2.sendMessage("<shad=10906535>[Forum Moderator]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerRights == 1){
c2.sendMessage("<shad=10906535>[Moderator]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerRights == 2){
c2.sendMessage("<col=255><shad=15695415>[Administrator]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerRights == 3){
c2.sendMessage("<col=255><shad=15695415>[Co-Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.isDonator == 1){
c2.sendMessage("<col=13238272><shad=16711680>[Donator]<img=0>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"</col></shad>");
}else if (c.isDonator == 2) {
c2.sendMessage("<shad=65535>[Super Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.isDonator == 3) {
c2.sendMessage("<shad=14981889>[Extreme Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerRights == 0){
c2.sendMessage("<shad=255>[Player]</shad>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}
}
}
}
}
public void moderatorCommands(Client c, String playerCommand)
{
if(playerCommand.startsWith("jail")) {
try {
String playerToBan = playerCommand.substring(5);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.teleportToX = 3102;
c2.teleportToY = 9516;
c2.Jail = true;
c2.sendMessage("You have been jailed by "+c.playerName+"");
c.sendMessage("Successfully Jailed "+c2.playerName+".");
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("emote") && c.playerRights >= 2) {
String[] args = playerCommand.split(" ");
c.startAnimation(Integer.parseInt(args[1]));
c.getPA().requestUpdates();
}
if (playerCommand.startsWith("pushups") && c.playerRights >= 1) {
c.startAnimation(2756);
}
if (playerCommand.startsWith("mute")) {
try {
String playerToBan = playerCommand.substring(5);
Connection.addNameToMuteList(playerToBan);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been muted by: " + c.playerName);
c.sendMessage("You have muted: " + c2.playerName);
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("xteletome") && c.playerRights >= 1) {
try {
String playerToTele = playerCommand.substring(10);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been teleported to " + c.playerName);
c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel);
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("xteleto") && c.playerRights >= 1) {
String name = playerCommand.substring(8);
for (int i = 0; i < Config.MAX_PLAYERS; i++) {
if (Server.playerHandler.players[i] != null) {
if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
}
}
}
}
if (playerCommand.startsWith("unmute")) {
try {
String playerToBan = playerCommand.substring(7);
Connection.unMuteUser(playerToBan);
c.sendMessage("Unmuted.");
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("checkbank")) {
String[] args = playerCommand.split(" ");
for(int i = 0; i < Config.MAX_PLAYERS; i++)
{
Client o = (Client) Server.playerHandler.players[i];
if(Server.playerHandler.players[i] != null)
{
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
{
c.getPA().otherBank(c, o);
break;
}
}
}
}
if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') {
try {
String playerToBan = playerCommand.substring(5);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Server.playerHandler.players[i].disconnected = true;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
try {
String playerToBan = playerCommand.substring(4);
Connection.addNameToBanList(playerToBan);
Connection.addNameToFile(playerToBan);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Server.playerHandler.players[i].disconnected = true;
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("unban")) {
try {
String playerToBan = playerCommand.substring(6);
Connection.removeNameFromBanList(playerToBan);
c.sendMessage(playerToBan + " has been unbanned.");
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if(playerCommand.startsWith("unjail")) {
try {
String playerToBan = playerCommand.substring(7);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.teleportToX = 2844;
c2.teleportToY = 10209;
c2.monkeyk0ed = 0;
c2.Jail = false;
c2.sendMessage("You have been unjailed by "+c.playerName+".");
c.sendMessage("Successfully unjailed "+c2.playerName+".");
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
}
public void administratorCommands(Client c, String playerCommand)
{
if (playerCommand.startsWith("alert")) {
String msg = playerCommand.substring(6);
for (int i = 0; i < Config.MAX_PLAYERS; i++) {
if (Server.playerHandler.players[i] != null) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("Alert##Notification##" + msg + "##By: " + c.playerName);
}
}
}
if(playerCommand.startsWith("getid")) {
String a[] = playerCommand.split(" ");
String name = "";
int results = 0;
for(int i = 1; i < a.length; i++)
name = name + a[i]+ " ";
name = name.substring(0, name.length()-1);
c.sendMessage("<shad=255>Searching: " + name + "</shad>");
for (int j = 0; j < Server.itemHandler.ItemList.length; j++) {
if (Server.itemHandler.ItemList[j] != null)
if (Server.itemHandler.ItemList[j].itemName.replace("_", " ").toLowerCase().contains(name.toLowerCase())) {
c.sendMessage("<col=232>"
+ Server.itemHandler.ItemList[j].itemName.replace("_", " ")
+ " - "
+ Server.itemHandler.ItemList[j].itemId);
results++;
}
}
c.sendMessage("<shad=255>" + results + " results found...</shad>");
}
if (playerCommand.equals("empty")) {
c.getItems().removeAllItems();
c.sendMessage("<shad=6081134>You empty your inventory.</col>");
}
if (playerCommand.startsWith("ipmute")) {
try {
String playerToBan = playerCommand.substring(7);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been muted by: " + c.playerName);
c2.sendMessage(" " +c2.playerName+ " Got IpMuted By " + c.playerName+ ".");
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.equalsIgnoreCase("mypos")) {
c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel);
}
if (playerCommand.startsWith("interface")) {
String[] args = playerCommand.split(" ");
c.getPA().showInterface(Integer.parseInt(args[1]));
}
if (playerCommand.startsWith("gfx")) {
String[] args = playerCommand.split(" ");
c.gfx0(Integer.parseInt(args[1]));
}
if (playerCommand.startsWith("tele")) {
String[] arg = playerCommand.split(" ");
if (arg.length > 3)
c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3]));
else if (arg.length == 3)
c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel);
}
if (playerCommand.equalsIgnoreCase("bank") && c.playerRights >= 2) {
c.getPA().openUpBank();
}
if (playerCommand.startsWith("unipmute")) {
try {
String playerToBan = playerCommand.substring(9);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
break;
}
}
}
} catch(Exception e) {
c.sendMessage("@red@Player Must Be Offline.");
}
}
if (playerCommand.startsWith("item")) {
try {
String[] args = playerCommand.split(" ");
if (args.length == 3) {
int newItemID = Integer.parseInt(args[1]);
int newItemAmount = Integer.parseInt(args[2]);
if ((newItemID <= 20500) && (newItemID >= 0)) {
c.getItems().addItem(newItemID, newItemAmount);
} else {
c.sendMessage("<shad=505>That item ID does not exist.</col>");
}
} else {
c.sendMessage("<shad=505>Wrong usage: (Ex:(::item 995 1))</col>");
}
} catch(Exception e) {
} // HERE?
} // HERE?
if (playerCommand.startsWith("ipban")) {
try {
String playerToBan = playerCommand.substring(6);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom);
Client c2 = (Client)Server.playerHandler.players[i];
Server.playerHandler.players[i].disconnected = true;
c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ ".");
}
}
}
} catch(Exception e) {
c.sendMessage("@red@Player Must Be Offline.");
}
}
}
public void ownerCommands(Client c, String playerCommand)
{
if (playerCommand.startsWith("update") && c.playerName.equalsIgnoreCase("Matt")) {
String[] args = playerCommand.split(" ");
int a = Integer.parseInt(args[1]);
PlayerHandler.updateSeconds = a;
PlayerHandler.updateAnnounced = false;
PlayerHandler.updateRunning = true;
PlayerHandler.updateStartTime = System.currentTimeMillis();
}
if (playerCommand.startsWith("giveitem") && c.playerName.equalsIgnoreCase("Matt")) {
try {
String[] args = playerCommand.split(" ");
int newItemID = Integer.parseInt(args[1]);
int newItemAmount = Integer.parseInt(args[2]);
String otherplayer = args[3];
Client c2 = null;
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
c2 = (Client)Server.playerHandler.players[i];
break;
}
}
}
if (c2 == null) {
c.sendMessage("Player doesn't exist.");
return;
}
c.sendMessage("You have just given " + server.model.items.Item.getItemName(newItemID) + "X" + newItemAmount + " to "+c2.playerName+"." );
c2.getItems().addItem(newItemID, newItemAmount);
} catch(Exception e) {
c.sendMessage("Use as ::giveitem ID AMOUNT PLAYERNAME.");
}
}
if (playerCommand.startsWith("givedp") && c.playerName.equalsIgnoreCase("Matt")) {
try {
final String[] args = playerCommand.split(" ");
final String otherplayer = args[1];
final int point = Integer.parseInt(args[2]);
for (final Player player : PlayerHandler.players) {
if (player != null) {
if (player.playerName.equalsIgnoreCase(otherplayer)) {
final Client c2 = (Client) player;
c2.donorPoints += point; //CHANGE THIS TO YOUR DONOR POINTS VARIABLE
c.sendMessage("<shad=24344>You have given "
+ otherplayer + ", " + point
+ " Donor points.");
c2.sendMessage("<shad=24344>You have been given "
+ point + " Donor points by "
+ c.playerName + ".");
}
}
}
} catch (final Exception e) {
c.sendMessage("Wrong syntax! ::givedp name amount");
}
}
if (playerCommand.startsWith("givesp") && c.playerName.equalsIgnoreCase("Matt")) {
try {
final String[] args = playerCommand.split(" ");
final String otherplayer = args[1];
final int point = Integer.parseInt(args[2]);
for (final Player player : PlayerHandler.players) {
if (player != null) {
if (player.playerName.equalsIgnoreCase(otherplayer)) {
final Client c2 = (Client) player;
c2.SPoints += point; //CHANGE THIS TO YOUR POINTS VARIABLE
c.sendMessage("<shad=24344>You have given "
+ otherplayer + ", " + point
+ " Slayer points.");
c2.sendMessage("<shad=24344>You have been given "
+ point + " Slayer points by "
+ c.playerName + ".");
}
}
}
} catch (final Exception e) {
c.sendMessage("Wrong syntax! ::givesp name amount");
}
}
if (playerCommand.startsWith("givelvlpoints") && c.playerName.equalsIgnoreCase("Matt")) {
try {
final String[] args = playerCommand.split(" ");
final String otherplayer = args[1];
final int point = Integer.parseInt(args[2]);
for (final Player player : PlayerHandler.players) {
if (player != null) {
if (player.playerName.equalsIgnoreCase(otherplayer)) {
final Client c2 = (Client) player;
c2.lvlPoints += point;
c.sendMessage("<shad=24344>You have given "
+ otherplayer + ", " + point
+ " Level Points");
c2.sendMessage("<shad=24344>You have been given "
+ point + " Level Points "
+ c.playerName + ".");
}
}
}
} catch (final Exception e) {
c.sendMessage("Wrong syntax! ::givelvlp name amount");
}
}
if (playerCommand.startsWith("givetitle") && c.playerName.equalsIgnoreCase("Matt")) {
if (c.playerRights != 3)
return;
try {
String[] args = playerCommand.split(" ");
if (args.length == 3) {
int titleId = Integer.parseInt(args[1]);
String playerToGiveTitle = args[2];
for(int i = 0; i < PlayerHandler.players.length; i++) {
if(PlayerHandler.players[i] != null) {
if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToGiveTitle)) {
Client o = (Client)PlayerHandler.players[i];
c.sendMessage("You have given "+ Misc.optimizeText(o.playerName) +" a title.");
o.sendMessage("You have been give a title by "+ Misc.optimizeText(c.playerName) +".");
o.playerTitle = titleId;
o.getPA().requestUpdates();
return;
}
}
}
} else {
c.sendMessage("Wrong usage of this command!");
}
} catch (Exception e) {
c.sendMessage("Player must be offline.");
}
}
if (playerCommand.startsWith("resettitle") && c.playerName.equalsIgnoreCase("Matt")) {
if (c.playerRights != 3)
return;
try {
String[] args = playerCommand.split(" ");
if (args.length == 3) {
int titleId = Integer.parseInt(args[1]);
String playerToGiveTitle = args[2];
for(int i = 0; i < PlayerHandler.players.length; i++) {
if(PlayerHandler.players[i] != null) {
if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToGiveTitle)) {
Client o = (Client)PlayerHandler.players[i];
c.sendMessage("You have reset "+ Misc.optimizeText(o.playerName) +"'s title.");
o.sendMessage("Your title has been reset by "+ Misc.optimizeText(c.playerName) +".");
o.playerTitle = 0;
o.getPA().requestUpdates();
return;
}
}
}
} else {
c.sendMessage("Wrong usage of this command!");
}
} catch (Exception e) {
c.sendMessage("Player must be offline.");
}
}
if(playerCommand.startsWith("npc") && c.playerRights >= 2) {
try {
int newNPC = Integer.parseInt(playerCommand.substring(4));
if(newNPC > 0) {
Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false);
c.sendMessage("You spawn a Npc.");
} else {
c.sendMessage("No such NPC.");
}
} catch(Exception e) {
}
}
if (playerCommand.equalsIgnoreCase("infspec") && c.playerName.equalsIgnoreCase("Matt")) {
c.getItems().updateSpecialBar();
c.gfx0(2015);
c.specAmount = 100000000;
}
if (playerCommand.equalsIgnoreCase("infhp") && c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().requestUpdates();
c.playerLevel[3] = 99999999;
c.getPA().refreshSkill(3);
c.gfx0(754);
}
if (playerCommand.equalsIgnoreCase("infprayer") && c.playerName.equalsIgnoreCase("Matt")) {
c.getPA().requestUpdates();
c.playerLevel[5] = 99999999;
c.getPA().refreshSkill(5);
c.startAnimation(12565);
c.gfx0(2226);
}
if (playerCommand.startsWith("object") && c.playerRights >=2) {
String[] args = playerCommand.split(" ");
c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10);
}
if (playerCommand.startsWith("emote") && c.playerRights >= 2) {
String[] args = playerCommand.split(" ");
c.startAnimation(Integer.parseInt(args[1]));
c.getPA().requestUpdates();
}
if (playerCommand.startsWith("giveowner") && c.playerName.equalsIgnoreCase("Matt")) {
try {
String playerToOwner = playerCommand.substring(10);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToOwner)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been given Owner status by " + c.playerName);
c2.playerRights = 3;
c2.isDonator = 1;
c2.logout();
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if(playerCommand.startsWith("giveadmin") && c.playerName.equalsIgnoreCase("Matt")) {
try {
String playerToAdmin = playerCommand.substring(10);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been given admin status by " + c.playerName);
c2.playerRights = 2;
c2.isDonator = 1;
c2.logout();
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if(playerCommand.startsWith("giveadmin") && c.playerName.equalsIgnoreCase("haribo")) {
try {
String playerToAdmin = playerCommand.substring(10);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been given admin status by " + c.playerName);
c2.playerRights = 2;
c2.isDonator = 1;
c2.logout();
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("givemod") && c.playerName.equalsIgnoreCase("Matt")) {
try {
String playerToMod = playerCommand.substring(8);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been given mod status by " + c.playerName);
c2.playerRights = 1;
c2.logout();
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("givemod") && c.playerName.equalsIgnoreCase("haribo")) {
try {
String playerToMod = playerCommand.substring(8);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been given mod status by " + c.playerName);
c2.playerRights = 1;
c2.logout();
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("timedmute") && c.playerRights >= 1 && c.playerRights <= 3) {
try {
String[] args = playerCommand.split("-");
if(args.length < 2) {
c.sendMessage("Currect usage: ::timedmute-playername-time");
return;
}
String playerToMute = args[1];
int muteTimer = Integer.parseInt(args[2])*1000;
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMute)) {
Client c2 = (Client) Server.playerHandler.players[i];
c2.sendMessage("You have been muted by: " + c.playerName+" for "+muteTimer/1000+" seconds");
c2.muteEnd = System.currentTimeMillis()+ muteTimer;
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("pnpc"))
{
try {
int newNPC = Integer.parseInt(playerCommand.substring(5));
if (newNPC <= 200000 && newNPC >= 0) {
c.npcId2 = newNPC;
c.isNpc = true;
c.updateRequired = true;
c.setAppearanceUpdateRequired(true);
}
else {
c.sendMessage("No such P-NPC.");
}
} catch(Exception e) {
c.sendMessage("Wrong Syntax! Use as ::pnpc #");
}
}
if (playerCommand.startsWith("givedonor") && c.playerName.equalsIgnoreCase("Matt")) {
try {
String playerToDonor = playerCommand.substring(10);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDonor)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been given donator status by " + c.playerName);
c2.playerRights = 4;
c2.isDonator = 1;
c2.logout();
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("givedonor") && c.playerName.equalsIgnoreCase("Matt")) {
try {
String playerToDonor = playerCommand.substring(10);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDonor)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been given donator status by " + c.playerName);
c2.playerRights = 4;
c2.isDonator = 1;
c2.logout();
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("givesupport") && c.playerName.equalsIgnoreCase("Matt")) {
try {
String playerToSupport = playerCommand.substring(12);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToSupport)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been given [Support] status by " + c.playerName);
c2.playerRights = 7;
c2.logout();
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("demote") && c.playerName.equalsIgnoreCase("Matt")) {
try {
String playerToDemote = playerCommand.substring(7);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been demoted by " + c.playerName);
c2.playerRights = 0;
c2.isDonator = 0;
c2.logout();
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
if (playerCommand.startsWith("npcreset")) {
Server.npcHandler = null;
Server.npcHandler = new server.model.npcs.NPCHandler();
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
c2.sendMessage("<shad=15695415>[" + c.playerName + "] " + " Has Reset NPC's....</col>");
}
}
}
if (playerCommand.equals("alltome") && c.playerRights >= 3) {
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
c2.teleportToX = c.absX;
c2.teleportToY = c.absY;
c2.heightLevel = c.heightLevel;
c2.sendMessage("Mass teleport to: " + c.playerName + "");
}
}
}
if (playerCommand.startsWith("heal") && c.playerRights >=1) {
if (playerCommand.indexOf(" ") > -1 && c.playerRights > 1) {
String name = playerCommand.substring(5);
if (c.validClient(name)) {
Client p = c.getClient(name);
for (int i = 0; i < 20; i++) {
p.playerLevel[i] = p.getLevelForXP(p.playerXP[i]);
p.getPA().refreshSkill(i);
}
p.sendMessage("You have been healed by " + c.playerName + ".");
} else {
c.sendMessage("Player must be offline.");
}
} else {
for (int i = 0; i < 20; i++) {
c.playerLevel[i] = c.getLevelForXP(c.playerXP[i]);
c.getPA().refreshSkill(i);
}
c.freezeTimer = -1;
c.frozenBy = -1;
c.sendMessage("You have been healed.");
}
}
if (playerCommand.startsWith("shop")) {
try {
c.getShops().openShop(Integer.parseInt(playerCommand.substring(5)));
} catch(Exception e) {
c.sendMessage("Invalid input data! try typing ::shop 1");
} else if {
c.sendMessage("Player must be offline.");
}
}
}
public void SupportCommands(Client c, String playerCommand) {
}
{
if (playerCommand.startsWith("szone")) {
c.getPA().startTeleport(3087, 3498, 0, "modern");
c.sendMessage("Just testing at the moment.");
}
if (playerCommand.startsWith("report") && playerCommand.length() > 7) {
try {
BufferedWriter report = new BufferedWriter(new FileWriter("./Data/bans/Reports.txt", true));
String Report = playerCommand.substring(7);
try {
report.newLine();
report.write("[Support]" + c.playerName + ": " + Report);
c.sendMessage("You have successfully submitted your report.");
} finally {
report.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void DonatorCommands(Client c, String playerCommand) {
}
{
if (playerCommand.startsWith("god") && c.playerRights >= 1) {
if (c.playerStandIndex != 1501) {
c.startAnimation(1500);
c.playerStandIndex = 1501;
c.playerTurnIndex = 1851;
c.playerWalkIndex = 1851;
c.playerTurn180Index = 1851;
c.playerTurn90CWIndex = 1501;
c.playerTurn90CCWIndex = 1501;
c.playerRunIndex = 1851;
c.updateRequired = true;
c.appearanceUpdateRequired = true;
c.sendMessage("You turn God mode on.");
} else {
c.playerStandIndex = 0x328;
c.playerTurnIndex = 0x337;
c.playerWalkIndex = 0x333;
c.playerTurn180Index = 0x334;
c.playerTurn90CWIndex = 0x335;
c.playerTurn90CCWIndex = 0x336;
c.playerRunIndex = 0x338;
c.updateRequired = true;
c.appearanceUpdateRequired = true;
c.sendMessage("Godmode has been deactivated.");
}
}
if (playerCommand.startsWith("emote") && c.playerRights >= 2) {
String[] args = playerCommand.split(" ");
c.startAnimation(Integer.parseInt(args[1]));
c.getPA().requestUpdates();
}
if (playerCommand.startsWith("fall") && c.playerRights >= 1) {
if (c.playerStandIndex != 2048) {
c.startAnimation(2046);
c.playerStandIndex = 2048;
c.playerTurnIndex = 2048;
c.playerWalkIndex = 2048;
c.playerTurn180Index = 2048;
c.playerTurn90CWIndex = 2048;
c.playerTurn90CCWIndex = 2048;
c.playerRunIndex = 2048;
c.updateRequired = true;
c.appearanceUpdateRequired = true;
} else {
c.startAnimation(2047);
c.playerStandIndex = 0x328;
c.playerTurnIndex = 0x337;
c.playerWalkIndex = 0x333;
c.playerTurn180Index = 0x334;
c.playerTurn90CWIndex = 0x335;
c.playerTurn90CCWIndex = 0x336;
c.playerRunIndex = 0x338;
c.updateRequired = true;
c.appearanceUpdateRequired = true;
}
}
if (playerCommand.startsWith("pushups") && c.playerRights >= 1) {
c.startAnimation(2756);
}
}
}