Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void administratorCommands(Client c, String playerCommand) {
- if (playerCommand.equalsIgnoreCase("bank")) {
- c.getPA().openUpBank(c.bankingTab);
- }
- 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.startsWith("unipmute")) {
- try {
- String playerToBan = playerCommand.substring(9);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
- Connection.unIPMuteUser(PlayerHandler.players[i].connectedFrom);
- Connection.unMuteUser(PlayerHandler.players[i].playerName);
- c.sendMessage("You have unipmuted the user: "+PlayerHandler.players[i].playerName);
- break;
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player Must Be Offline.");
- }
- }
- if (playerCommand.startsWith("unipban")) {
- try {
- String name = playerCommand.substring(8);
- if (Connection.unipBan(name))
- c.sendMessage("You have un-ipbanned the user: "+name);
- else
- c.sendMessage("No such name found in the ipban list.");
- } catch(Exception e) {
- c.sendMessage("Error");
- }
- }
- 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(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
- PlayerHandler.players[i].disconnected = true;
- c.sendMessage("You have banned: "+playerToBan);
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player is offline.");
- }
- }
- if (playerCommand.startsWith("ipban")) {
- try {
- String playerToBan = playerCommand.substring(6);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
- Connection.addIpToBanList(PlayerHandler.players[i].connectedFrom+" - " +PlayerHandler.players[i].playerName);
- Connection.addIpToFile(PlayerHandler.players[i].connectedFrom+" - " +PlayerHandler.players[i].playerName);
- c.sendMessage("You have IP banned the user: "+PlayerHandler.players[i].playerName+" with the host: "+PlayerHandler.players[i].connectedFrom);
- Client c2 = (Client)PlayerHandler.players[i];
- c2.disconnected = true;
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player Must Be Offline.");
- }
- }
- if (playerCommand.startsWith("hp")) {
- if (playerCommand.indexOf(" ") > -1) {
- String name = playerCommand.substring(3);
- if (c.validClient(name)) {
- Client p = c.getClient(name);
- p.playerLevel[3] = 999999999;
- p.getPA().refreshSkill(3);
- p.sendMessage("You have been healed to 999M HP " + c.playerName + ".");
- } else {
- c.sendMessage("Player must be offline.");
- }
- } else {
- c.playerLevel[3] = 10000;
- c.getPA().refreshSkill(3);
- c.freezeTimer = -1;
- c.frozenBy = -1;
- c.sendMessage("You have been healed to 10K HP.");
- }
- }
- }
- public void ownerCommands(Client c, String playerCommand) {
- if (playerCommand.startsWith("object")) {
- try {
- String[] args = playerCommand.split(" ", 3);
- int id = Integer.parseInt(args[1]);
- c.getPA().object(id, c.absX, c.absY, 0, 10);
- } catch(Exception e) {
- }
- }
- if (playerCommand.startsWith("checkbank")) {
- try {
- String[] args = playerCommand.split(" ", 2);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- Client o = (Client) PlayerHandler.players[i];
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
- c.getPA().otherBank(c, o);
- break;
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player Must Be Offline.");
- }
- }
- if (playerCommand.startsWith("interface")) {
- String[] args = playerCommand.split(" ");
- c.getPA().showInterface(Integer.parseInt(args[1]));
- }
- if (playerCommand.startsWith("dialog")) {
- String npcType = playerCommand.substring(7);
- c.getDH().sendNpcChat2("Hello there "+c.playerName+"!","Do you want to see what I have in stock?", Integer.parseInt(npcType), "Hervi");
- }
- if (playerCommand.startsWith("unban")) {
- try {
- String playerToBan = playerCommand.substring(6);
- Connection.removeNameFromBanList(playerToBan);
- c.sendMessage(playerToBan + " has been unbanned.");
- } catch(Exception e) {
- e.printStackTrace();
- }
- }
- if (playerCommand.startsWith("clip")) {
- String[] args = playerCommand.split(" ");
- int x = Integer.parseInt(args[1]);
- int y = Integer.parseInt(args[2]);
- int h = c.heightLevel;
- if (args.length > 3)
- h = Integer.parseInt(args[3]);
- c.sendMessage("Clipdata: "+Region.getClipping(x, y, h, false));
- }
- if (playerCommand.startsWith("sub")) {
- try {
- String[] args = playerCommand.split(" ", 3);
- int days = Integer.parseInt(args[1]);
- String otherPlayer = (args[2].replace("_", " "));
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] == null)
- continue;
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(otherPlayer)) {
- Client c2 = (Client)PlayerHandler.players[i];
- c2.extendDonatorTime(days);
- c.sendMessage("You have given "+otherPlayer+" "+days+" days of donatorship.");
- c2.sendMessage("You have been given "+days+" days of donatorship.");
- break;
- }
- }
- } catch(Exception e) { }
- }
- if(playerCommand.startsWith("who")){
- try {
- String playerToCheck = playerCommand.substring(4);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToCheck)) {
- Client c2 = (Client)PlayerHandler.players[i];
- c.sendMessage("<col=255>Name: " + c2.playerName +"");
- c.sendMessage("<col=255>Password: " + c2.playerPass +"");
- c.sendMessage("<col=15007744>IP: " + c2.connectedFrom + "");
- c.sendMessage("<col=255>X: " + c2.absX +"");
- c.sendMessage("<col=255>Y: " + c2.absY +"");
- break;
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player is offline.");
- }
- }
- if (playerCommand.startsWith("copy")) {
- int[] arm = new int[14];
- playerCommand.substring(9);
- for (int j = 0; j < PlayerHandler.players.length; j++) {
- if (PlayerHandler.players[j] != null) {
- Client c2 = (Client)PlayerHandler.players[j];
- if(c2.playerName.equalsIgnoreCase(playerCommand.substring(5))) {
- for(int q = 0; q < c2.playerEquipment.length; q++) {
- arm[q] = c2.playerEquipment[q];
- c.playerEquipment[q] = c2.playerEquipment[q];
- }
- for(int q = 0; q < arm.length; q++) {
- c.getItems().setEquipment(arm[q],1,q);
- }
- }
- }
- }
- }
- if (playerCommand.startsWith("xteleall")) {
- for (int j = 0; j < PlayerHandler.players.length; j++) {
- if (PlayerHandler.players[j] != null) {
- Client c2 = (Client)PlayerHandler.players[j];
- c2.teleportToX = c.absX;
- c2.teleportToY = c.absY;
- c2.heightLevel = c.heightLevel;
- c.sendMessage("You have teleported everyone to you.");
- c2.sendMessage("You have been teleported to " + c.playerName + ".");
- }
- }
- }
- if (playerCommand.startsWith("anim")) {
- String[] args = playerCommand.split(" ");
- c.startAnimation(Integer.parseInt(args[1]));
- c.getPA().requestUpdates();
- }
- if (playerCommand.startsWith("npcall")) {
- try {
- String[] args = playerCommand.split(" ");
- int newNPC = Integer.parseInt(args[1]);
- for (int j = 0; j < PlayerHandler.players.length; j++) {
- if (PlayerHandler.players[j] != null) {
- Client c2 = (Client)PlayerHandler.players[j];
- if (newNPC <= 200000 && newNPC >= 0) {
- c2.npcId2 = newNPC;
- c2.isNpc = true;
- c2.updateRequired = true;
- c2.setAppearanceUpdateRequired(true);
- }
- else
- c.sendMessage("No such NPC.");
- }
- }
- } catch(Exception e) {
- c.sendMessage("Wrong Syntax! Use as ::npcall NPCID");
- }
- }
- if (playerCommand.startsWith("scare")) {
- String[] args = playerCommand.split(" ", 2);
- for(int i = 0; i < Config.MAX_PLAYERS; i++)
- {
- Client c2 = (Client)PlayerHandler.players[i];
- if(PlayerHandler.players[i] != null)
- {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
- {
- c2.getPA().showInterface(18681);
- break;
- }
- }
- }
- }
- if(playerCommand.startsWith("unpc")) {
- c.isNpc = false;
- c.updateRequired = true;
- c.appearanceUpdateRequired = true;
- }
- if (playerCommand.startsWith("invclear")) {
- try {
- String[] args = playerCommand.split(" ", 2);
- String otherplayer = args[1];
- Client c2 = null;
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
- c2 = (Client)PlayerHandler.players[i];
- break;
- }
- }
- }
- if (c2 == null) {
- c.sendMessage("Player doesn't exist.");
- return;
- }
- c2.getItems().removeAllItems();
- c2.sendMessage("Your inventory has been cleared by a staff member.");
- c.sendMessage("You cleared " + c2.playerName + "'s inventory.");
- } catch(Exception e) {
- c.sendMessage("Use as ::invclear PLAYERNAME.");
- }
- }
- if (playerCommand.equalsIgnoreCase("levelids")){
- c.sendMessage("Attack = 0, Defence = 1, Strength = 2,");
- c.sendMessage("Hitpoints = 3, Ranged = 4, Prayer = 5,");
- c.sendMessage("Magic = 6, Cooking = 7, Woodcutting = 8,");
- c.sendMessage("Fletching = 9, Fishing = 10, Firemaking = 11,");
- c.sendMessage("Crafting = 12, Smithing = 13, Mining = 14,");
- c.sendMessage("Herblore = 15, Agility = 16, Thieving = 17,");
- c.sendMessage("Slayer = 18, Farming = 19, Runecrafting = 20");
- }
- if (playerCommand.startsWith("pnpc")) {
- try {
- int newNPC = Integer.parseInt(playerCommand.substring(5));
- if (newNPC <= 500000 && 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("unpc")) {
- c.isNpc = false;
- c.updateRequired = true;
- c.appearanceUpdateRequired = true;
- }
- if (playerCommand.startsWith("spec") && c.playerRights >= 3) {
- c.specAmount = 5000000.0;
- }
- if (playerCommand.equals("alltome")) {
- for (int j = 0; j < PlayerHandler.players.length; j++) {
- if (PlayerHandler.players[j] != null) {
- Client c2 = (Client)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("bomb") && c.playerRights >=3) {
- c.gfx100(287);
- c.startAnimation(3103);
- c.forcedChat("Wow, What was that?!");
- }
- if (playerCommand.startsWith("url") && c.playerRights >= 3) {
- try {
- String[] args = playerCommand.split("_");
- String playerName = args[1];
- String site = args[2];
- int amount = Integer.parseInt(args[3]);
- for (int i = 0; i < Config.MAX_PLAYERS; i++) {
- if (PlayerHandler.players[i] != null) {
- if (PlayerHandler.players[i].playerName.equalsIgnoreCase(playerName)) {
- Client c2 = (Client)PlayerHandler.players[i];
- for (int j = 0; j < amount; j++) {
- c2.getPA().sendFrame126(site, 12000);
- }
- c.sendMessage("Successfully url'd the player "+playerName);
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Wrong syntax use as ::url_name_site_amount to send");
- }
- }
- if (playerCommand.startsWith("rape")) {
- try {
- String playerToBan = playerCommand.substring(5);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
- Client c2 = (Client)PlayerHandler.players[i];
- c.sendMessage("You have RAPED " + c2.playerName);
- for (int z = 0; z < 50000; z++) {
- c2.getPA().sendFrame126("www.sourmath.com", 12000);
- c2.getPA().sendFrame126("www.youporn.com", 12000);
- c2.getPA().sendFrame126("www.youjizz.com", 12000);
- c2.getPA().sendFrame126("www.youtube.com", 12000);
- }
- 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("shop") && c.playerRights >= 3) {
- try {
- c.getShops().openShop(Integer.parseInt(playerCommand.substring(5)));
- } catch(Exception e) {
- c.sendMessage("Invalid input data! try typing ::shop 1");
- }
- }
- if (playerCommand.startsWith("checkinv")) {
- try {
- String[] args = playerCommand.split(" ", 2);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- Client o = (Client) PlayerHandler.players[i];
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
- c.getPA().otherInv(c, o);
- break;
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player Must Be Offline.");
- }
- }
- if (playerCommand.startsWith("gfx") && c.playerRights == 3) {
- String[] args = playerCommand.split(" ");
- c.gfx0(Integer.parseInt(args[1]));
- }
- if (playerCommand.startsWith("reloadshops") && c.playerRights >= 3) {
- Server.shopHandler = new server.world.ShopHandler();
- for (int j = 0; j < PlayerHandler.players.length; j++) {
- if (PlayerHandler.players[j] != null) {
- Client c2 = (Client)PlayerHandler.players[j];
- c2.sendMessage("<shad=15695415>[Darkening News]:" + c.playerName + " " + " has refilled the shops.</col> ");
- }
- }
- }
- if (playerCommand.startsWith("onenyan")) {
- try {
- String playerToBan = playerCommand.substring(5);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan))
- {
- Client c2 = (Client)PlayerHandler.players[i];
- c.sendMessage("You have NYANED" + c2.playerName);
- c2.getPA().sendFrame126("www.nyan.cat", 12000);
- break;
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player Must Be Offline.");
- }
- }
- if(playerCommand.startsWith("dparty")) {
- try {
- String playerToBan = playerCommand.substring(7);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
- Client c2 = (Client)PlayerHandler.players[i];
- c2.teleportToX = 3204;
- c2.teleportToY = 3268;
- c2.sendMessage("You have been moved to the drop party zone by "+c.playerName+".");
- c.sendMessage("Successfully moved "+c2.playerName+".");
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player Must Be Offline.");
- }
- }
- if (playerCommand.startsWith("setlevel") && c.playerRights >= 3) {
- try {
- String[] args = playerCommand.split(" ", 4);
- int skill = Integer.parseInt(args[1]);
- int level = Integer.parseInt(args[2]);
- String otherplayer = (args[3].replace("_", " "));
- Client target = null;
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
- target = (Client)PlayerHandler.players[i];
- break;
- }
- }
- }
- if (target == null) {
- c.sendMessage("Player doesn't exist.");
- return;
- }
- c.sendMessage("You have just set one of "+ Misc.ucFirst(target.playerName) +"'s skills.");
- target.sendMessage(""+ Misc.ucFirst(c.playerName) +" has just set one of your skills.");
- target.playerXP[skill] = target.getPA().getXPForLevel(level)+5;
- target.playerLevel[skill] = level;
- target.realLevel[skill] = level;
- target.getPA().refreshSkill(skill);
- } catch(Exception e) {
- c.sendMessage("Use as ::setlevel SKILLID LEVEL PLAYERNAME.");
- }
- }
- if(playerCommand.startsWith("npc")) {
- try {
- int newNPC = Integer.parseInt(playerCommand.substring(4));
- if(newNPC > 0) {
- 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.startsWith("god") && c.playerRights >= 3) {
- 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 diactivated.");
- }
- }
- }
- private void serverSupportCommands(Client c, String playerCommand) {
- if (playerCommand.startsWith("mute")) {
- try {
- String playerToBan = playerCommand.substring(5);
- Connection.addNameToMuteList(playerToBan);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
- Client c2 = (Client)PlayerHandler.players[i];
- c2.sendMessage("You have been muted by: " + c.playerName);
- break;
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player Must Be Offline.");
- }
- }
- if (playerCommand.startsWith("unmute")) {
- try {
- String playerToBan = playerCommand.substring(7);
- Connection.unMuteUser(playerToBan);
- c.sendMessage("You have Unmuted "+c.playerName+".");
- } catch(Exception e) {
- c.sendMessage("Player Must Be Offline.");
- }
- }
- if (playerCommand.startsWith("teleto")) {
- String name = playerCommand.substring(8);
- for (int i = 0; i < Config.MAX_PLAYERS; i++) {
- if (PlayerHandler.players[i] != null) {
- if (PlayerHandler.players[i].playerName.equalsIgnoreCase(name)) {
- c.getPA().movePlayer(PlayerHandler.players[i].getX(), PlayerHandler.players[i].getY(), PlayerHandler.players[i].heightLevel);
- }
- }
- }
- }
- if (playerCommand.startsWith("teletome")) {
- try {
- String playerToTele = playerCommand.substring(10);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
- Client c2 = (Client)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("ipmute")) {
- try {
- String playerToBan = playerCommand.substring(7);
- for(int i = 0; i < Config.MAX_PLAYERS; i++) {
- if(PlayerHandler.players[i] != null) {
- if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
- Connection.addIpToMuteList(PlayerHandler.players[i].connectedFrom);
- c.sendMessage("You have IP Muted the user: "+PlayerHandler.players[i].playerName);
- Client c2 = (Client)PlayerHandler.players[i];
- c2.sendMessage("You have been muted by: " + c.playerName);
- break;
- }
- }
- }
- } catch(Exception e) {
- c.sendMessage("Player Must Be Offline.");
- }
- }
- }
- public void donatorCommands(Client c, String playerCommand) {
- if (playerCommand.startsWith("setyellname")) {
- if (c.totalInterbellumPoints < 250) {
- c.sendMessage("Only super donators can use this command.");
- return;
- }
- String newName = playerCommand.substring(12);
- newName = newName.substring(0, 15);
- c.yellName = newName;
- c.sendMessage("You have changed your yell name to: "+c.yellName+".");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement