Guest User

Untitled

a guest
Jul 26th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. package server.model.players.packets;
  3.  
  4. import server.Config;
  5. import server.Connection;
  6. import server.Server;
  7. import server.model.players.PlayerSave;
  8. import server.model.players.Player;
  9. import server.model.players.Client;
  10. import server.model.players.PacketType;
  11. import server.model.players.PlayerHandler;
  12. import server.util.Misc;
  13.  
  14.  
  15. import java.io.*;
  16.  
  17. /**
  18.  * Commands
  19.  **/
  20. public class Commands implements PacketType
  21. {
  22.  
  23.    
  24.     @Override
  25.     public void processPacket(Client c, int packetType, int packetSize)
  26.     {
  27.     String playerCommand = c.getInStream().readString();
  28.         if (!playerCommand.startsWith("/"))
  29.         {
  30.             c.getPA().writeCommandLog(playerCommand);
  31.        
  32.    
  33.         }
  34.             if (playerCommand.equalsIgnoreCase("zerker")) {
  35.                 int i = 0;
  36.                 c.getPA().a::killXP(14000000, 0);
  37.                 c.getPA().addSkillXP(65000, 1);
  38.                 c.getPA().addSkillXP(14000000, 2);
  39.                 c.getPA().addSkillXP(14000000, 3);
  40.                 c.getPA().addSkillXP(14000000, 4);
  41.                 c.getPA().addSkillXP(136594, 5);
  42.                 c.getPA().addSkillXP(14000000, 6);
  43.                 c.playerXP[3] = c.getPA().getXPForLevel(99)+5;
  44.                 c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
  45.                 c.getPA().refreshSkill(3);
  46.         }
  47.             if (playerCommand.startsWith("pure")) {
  48.                 int i = 0;
  49.                 c.getPA().addSkillXP((15000000), 0);
  50.                 c.getPA().addSkillXP((15000000), 2);
  51.                 c.getPA().addSkillXP((15000000), 3);
  52.                 c.getPA().addSkillXP((15000000), 4);
  53.                 c.getPA().addSkillXP((15000000), 6);
  54.                 c.playerXP[3] = c.getPA().getXPForLevel(99)+5;
  55.                 c.playerLevel[3] = c.getPA().getLevelForXP
  56.         }
  57.         if (playerCommand.startsWith("empty")) {
  58.             if (playerCommand.indexOf(" ") > -1 && c.playerRights > 1) {
  59.                 String name = playerCommand.substring(6);
  60.                 if (c.validClient(name)) {
  61.                     Client p = c.getClient(name);
  62.                     p.getItems().removeAllItems();
  63.                     p.sendMessage("Your inventory has been cleared.");
  64.                     c.sendMessage("You cleared the players inventory.");
  65.                 } else {
  66.                     c.sendMessage("Player must be offline.");
  67.                 }
  68.             } else {
  69.                 c.getItems().removeAllItems();
  70.             }
  71.         }
  72.  
  73.         /*if (playerCommand.startsWith("kill")) {
  74.         String nameToKill = playerCommand.substring(5);
  75.         for (Client player : Server.playerHandler.players) {
  76.             if (player != null) {
  77.                 if (player.playerName.equals(nameToKill)) {
  78.                     player.getPA().applyDead();
  79.                     player.sendMessage("You died.");
  80.                 }
  81.             }
  82.         }
  83.     }*/
  84.  
  85.         if (playerCommand.equalsIgnoreCase("skillcapes")) {    
  86.                             c.getItems().addItem(12170, 1);
  87.                                                         c.getItems().addItem(9748, 1);
  88.                                                         c.getItems().addItem(9751, 1);
  89.                                                         c.getItems().addItem(9754, 1);
  90.                                                         c.getItems().addItem(9757, 1);
  91.                                                         c.getItems().addItem(9760, 1);
  92.                                                         c.getItems().addItem(9763, 1);
  93.                                                         c.getItems().addItem(9766, 1);
  94.                                                         c.getItems().addItem(9769, 1);
  95.                                                         c.getItems().addItem(9772, 1);
  96.                                                         c.getItems().addItem(9775, 1);
  97.                                                         c.getItems().addItem(9778, 1);
  98.                                                         c.getItems().addItem(9781, 1);
  99.                                                         c.getItems().addItem(9784, 1);
  100.                                                         c.getItems().addItem(9787, 1);
  101.                                                         c.getItems().addItem(9790, 1);
  102.                                                         c.getItems().addItem(9793, 1);
  103.                                                         c.getItems().addItem(9796, 1);
  104.                                                         c.getItems().addItem(9799, 1);
  105.                                                         c.getItems().addItem(9802, 1);
  106.                                                         c.getItems().addItem(9805, 1);
  107.                                                         c.getItems().addItem(9808, 1);
  108.                                                         c.getItems().addItem(9811, 1);
  109.                                                         c.getItems().addItem(9813, 1);
  110.                                                         c.getItems().addItem(9949, 1);
  111.                                                         c.getItems().addItem(19710, 1);
  112.                                 c.sendMessage("Nice Capes Batman");    
  113.         }
  114.         if (playerCommand.equalsIgnoreCase("veng")) {      
  115.                             c.getItems().addItem(560, 500);
  116.                                                         c.getItems().addItem(9075, 500);
  117.                                                         c.getItems().addItem(557, 1000);
  118.                                 c.sendMessage("Nice Veng");    
  119.         }
  120.         if (playerCommand.equalsIgnoreCase("runes")) {
  121.             for (int i = 554; i < 567; i++) {
  122.                 c.getItems().addItem(i, 1000);             
  123.             }
  124.             c.getItems().addItem(9075, 1000);  
  125.         }
  126.         if (playerCommand.equalsIgnoreCase("barrage")) {
  127.                             c.getItems().addItem(560, 500);
  128.                                                         c.getItems().addItem(565, 500);
  129.                                                         c.getItems().addItem(555, 1000);
  130.                                 c.sendMessage("Have fun Owning!!");                                        
  131.         }
  132.         if (playerCommand.equalsIgnoreCase("food")) {
  133.             if (c.inWild())
  134.                 return;
  135.             c.getItems().addItem(386, 5000);
  136.         }
  137.         if (playerCommand.equals("shops")) {
  138.             if (c.inWild())
  139.                 return;
  140.             c.getPA().startTeleport(2441, 3089, 0, "modern");
  141.        
  142.         }
  143.         if (playerCommand.equals("funpk")) {
  144.             if (c.inWild())
  145.                 return;
  146.             c.getPA().startTeleport(2604, 3155, 0,         }
  147.         if (playerCommand.equalsIgnoreCase("brb") && c.playerRights >= 0) {
  148.             c.startAnimation(1353);
  149.             c.forcedChat (c.playerName + " Is AFK"); }
  150.         if (playerCommand.equalsIgnoreCase("back")) {
  151.             c.startAnimation(6); c.forcedChat(c.playerName + " Is Back");
  152.         }
  153.                 if (playerCommand.startsWith("report") && playerCommand.length() > 7) {
  154.    try {
  155.    BufferedWriter report = new BufferedWriter(new FileWriter("./Data/bans/Reports.txt", true));
  156.    String Report = playerCommand.substring(7);
  157.    try {   
  158.     report.newLine();
  159.     report.write(c.playerName + ": " + Report);
  160.     c.sendMessage("You have successfully submitted your report.");
  161.     } finally {
  162.     report.close();
  163.     }
  164.     } catch (IOException e) {
  165.                 e.printStackTrace();
  166.     }
  167. }
  168.         if (playerCommand.startsWith("kdr")) {
  169.                 double KDR = ((double)c.KC)/((double)c.DC);
  170.                 c.forcedChat("My Kill/Death ratio is "+c.KC+"/"+c.DC+"; "+KDR+".");
  171.             }
  172.         if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
  173.             if (c.clanId >= 0) {
  174.                 System.out.println(playerCommand);
  175.                 playerCommand = playerCommand.substring(1);
  176.                 Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
  177.             } else {
  178.                 if (c.clanId != -1)
  179.                 c.clanId = -1;
  180.                 c.sendMessage("You are not in a clan.");
  181.             }
  182.             return;      
  183.         }
  184.     if (Config.SERVER_DEBUG)
  185.         Misc.println(c.playerName+" playerCommand: "+playerCommand);
  186.    
  187.     if (c.playerRights >= 0)
  188.         playerCommands(c, playerCommand);
  189.     if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 3)
  190.         moderatorCommands(c, playerCommand);
  191.     if (c.playerRights == 2 || c.playerRights == 3)
  192.         administratorCommands(c, playerCommand);
  193.     if (c.playerRights == 3)
  194.         ownerCommands(c, playerCommand);
  195.         if (c.playerRights == 4)
  196.         DonatorCommands(c, playerCommand);
  197.            
  198.     }
  199.  
  200.    
  201.     public void playerCommands(Client c, String playerCommand)
  202.     {        
  203.             if (playerCommand.startsWith("resettask")) {
  204.                 c.taskAmount = -1;
  205.                 c.slayerTask = 0;
  206.             }
  207.             if (playerCommand.startsWith("resetdef")) {
  208.                 if (c.inWild())
  209.                 return;
  210.                 for (int j = 0; j < c.playerEquipment.length; j++) {
  211.                     if (c.playerEquipment[j] > 0) {
  212.                         c.sendMessage("Please take all your armour and weapons off before using this command.");
  213.                         return;
  214.                     }
  215.                 }
  216.                 try {
  217.                     int skill = 1;
  218.                     int level = 1;
  219.                     c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
  220.                     c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  221.                     c.getPA().refreshSkill(skill);
  222.                 } catch (Exception e){}
  223.             }
  224.            
  225.                                     if (playerCommand.startsWith("help")) {
  226.             c.getPA().showInterface(8134);
  227.             c.flushOutStream();
  228.             c.getPA().sendFrame126("Welcome to Nirvana", 8144);
  229.             c.getPA().sendFrame126("1.Do not ask staff", 8148);
  230.             c.getPA().sendFrame126("2.No Pkpoint farming (Ban)", 8149);
  231.             c.getPA().sendFrame126("3.Do not use offensive Language. (Mild flaming aloud)", 8150);
  232.             c.getPA().sendFrame126("4.Do not Scam Passwords or Items (IPBAN)", 8151);
  233.             c.getPA().sendFrame126("5.Auto Clickers are Allowed, Auto Typers are not", 8152);
  234.             c.getPA().sendFrame126("Luring is aloud do not complain to a admin", 8153);
  235.             c.getPA().sendFrame126("If your a idiot and you got lured go cry.", 8154);
  236.             c.getPA().sendFrame126("Do ::commands For commands And Please Do ::vote.", 8155);
  237.             }
  238.                                     if (playerCommand.startsWith("commands")) { //change name to whatever, info, donate etc.
  239.             c.getPA().showInterface(8134);
  240.             c.flushOutStream();
  241.             c.getPA().sendFrame126("@dre@Welcome to REPLACE Our Commands Are", 8144);      
  242.             c.getPA().sendFrame126("::vote,::vote2,::register,::kdr, ::help", 8148);
  243.             c.getPA().sendFrame126("::brb, ::back, ::pure, ::epp, ::ep, ::players,::veng , ::barrage", 8149);
  244.             c.getPA().sendFrame126("::changepassword, ::shops,::rest ,::food ,::funpk ,::zerker", 8150);
  245.             c.getPA().sendFrame126("::skillcapes, ::empty,::music ,::players", 8151);
  246.             }
  247.            
  248.             if (playerCommand.startsWith("rest")) {
  249. c.startAnimation(5713);
  250.             }
  251.                 if (playerCommand.startsWith("EPP") || playerCommand.startsWith("epp") || playerCommand.startsWith("Epp")) {
  252.                 c.sendMessage("You have <col=1532693>" + c.pkPoints + "</col> EPP.");
  253.                 }
  254.                     if (playerCommand.equalsIgnoreCase("voted")) {
  255.                   if(c.checkVotes(c.playerName)) {
  256.                                 c.getItems().addItem(995, 10000000);
  257.                                 c.sendMessage("<col=1532693>Thanks for voting!</col>");
  258.                         } else {
  259.         c.sendMessage("<col=1532693>You have voted already!</col>");
  260. }
  261. }
  262.             if (playerCommand.equals("vote")) {
  263.                         c.getPA().sendFrame126("REPLACE", 12000);
  264.             }
  265.             if (playerCommand.equals("vote2")) {
  266.                         c.getPA().sendFrame126("REPLACE", 12000);
  267.             }
  268.             if (playerCommand.equals("music")) {
  269.                         c.getPA().sendFrame126("REPLACE", 12000);
  270.             }
  271.             if (playerCommand.equals("update")) {
  272.                         c.getPA().sendFrame126("REPLACE", 12000);
  273.             }
  274.             if (playerCommand.equalsIgnoreCase("players")) {
  275.                 c.sendMessage("There are currently "+PlayerHandler.getPlayerCount()+ " players online.");
  276.                 c.getPA().sendFrame126(Config.SERVER_NAME+" - Online Players", 8144);
  277.                 c.getPA().sendFrame126("@dbl@Online players(" + PlayerHandler.getPlayerCount()+ "):", 8145);
  278.                 int line = 8147;
  279.                 for (int i = 1; i < Config.MAX_PLAYERS; i++) {
  280.                     Client p = c.getClient(i);
  281.                     if (!c.validClient(i))
  282.                         continue;
  283.                     if (p.playerName != null) {
  284.                         String title = "";
  285.                         if (p.playerRights == 1) {
  286.                             title = "Mod, ";
  287.                         } else if (p.playerRights == 2) {
  288.                             title = "Admin, ";
  289.                         } else if (p.playerRights == 3) {
  290.                             title = "Owner, ";
  291.                         }
  292.                         title += "level-" + p.combatLevel;
  293.                         String extra = "";
  294.                         if (c.playerRights > 0) {
  295.                             extra = "(" + p.playerId + ") ";
  296.                         }
  297.                         c.getPA().sendFrame126("@dre@" + extra + p.playerName + "@dbl@ ("+ title + ") is at " + p.absX + ", "+ p.absY, line);
  298.                         line++;
  299.                     }
  300.                 }
  301.                 c.getPA().showInterface(8134);
  302.                 c.flushOutStream();
  303.             }
  304.             if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
  305.                 c.playerPass = playerCommand.substring(15);
  306.                 c.sendMessage("Your password is now: " + c.playerPass);        
  307.             }
  308.  
  309. if (playerCommand.startsWith("dice") && c.sit == false) {
  310.             if(c.inWild()) {
  311.             c.sendMessage("Er, it's not to smart to do this in the Wilderness.");
  312.             return;
  313.             }
  314.             c.sit = false;
  315.             if(c.playerRights == 0) {
  316.                         c.forcedText = "I'm Not A Donor+, So, I Can't Dice!";
  317.             c.forcedChatUpdateRequired = true;
  318.             c.updateRequired = true;
  319.                         c.sendMessage("You must be a donor or a mod to dice!!!!");
  320.             }
  321.             if(c.playerRights == 2) {
  322.                         c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
  323.             c.forcedChatUpdateRequired = true;
  324.             c.updateRequired = true;
  325.                         c.sendMessage("you roll the dice...");
  326.             }
  327.             if(c.playerRights == 3) {
  328.                         c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
  329.             c.forcedChatUpdateRequired = true;
  330.             c.updateRequired = true;
  331.                         c.sendMessage("you roll the dice...");
  332.             }
  333.             if(c.playerRights == 1) {
  334.                         c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
  335.             c.forcedChatUpdateRequired = true;
  336.             c.updateRequired = true;
  337.                         c.sendMessage("you roll the dice...");
  338.             }
  339.             if(c.playerRights == 4) {
  340.                         c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
  341.             c.forcedChatUpdateRequired = true;
  342.             c.updateRequired = true;
  343.                         c.sendMessage("you roll the dice...");
  344.             }
  345.             }
  346.  
  347.             if (playerCommand.startsWith("ep") || playerCommand.startsWith("Ep") || playerCommand.startsWith("EP") || playerCommand.startsWith("eP")) {
  348.             c.sendMessage("EP: "+ c.earningPotential+"");
  349.             }
  350.             if (playerCommand.startsWith("yell")) {
  351.                     /*
  352.                     *This is the sensor for the yell command
  353.                     */
  354.                     /*String text = playerCommand.substring(5);
  355.                     String[] bad = {"chalreq", "duelreq", "tradereq", ". com", "c0m", "com",
  356.                             "org", "net", "biz", ". net", ". org", ". biz",
  357.                             ". no-ip", "- ip", ".no-ip.biz", "no-ip.org", "servegame",
  358.                             ".com", ".net", ".org", "no-ip", "****", "hack", "****",
  359.                             "crap", "rubbish", ". com", ". serve", ". no-ip", ". net", ". biz"};
  360.                     for(int i = 0; i < bad.length; i++){
  361.                         if(text.indexOf(bad[i]) >= 0){
  362.                             return;
  363.                         }
  364.                     }*/
  365.                 for (int j = 0; j < Server.playerHandler.players.length; j++) {
  366.                     if (Server.playerHandler.players[j] != null) {
  367.                         Client c2 = (Client)Server.playerHandler.players[j];
  368.                        
  369.                            
  370.                             if (c.isDonator == 1 && (c.playerRights < 1 || c.playerRights > 3)){
  371.                                 c2.sendMessage("<shad=6081134>[Legit Hoster]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
  372.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  373.                             }else if (c.playerName.equalsIgnoreCase("Brett")){
  374.                                 c2.sendMessage("<shad=800000000><col=200000000>[The Fag]</col=200000000><img=1>"+ Misc.optimizeText(c.playerName) +": "
  375.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  376.                                 }else if (c.playerRights == 1){
  377.                                 c2.sendMessage("<col=255>[Nirvana's Mod]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
  378.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  379.                             }else if (c.playerRights == 2){
  380.                                 c2.sendMessage("<col=225>[Admin Nirvana]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
  381.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  382.                             }else if (c.playerName.equalsIgnoreCase("Jake")){
  383.                                 c2.sendMessage("<shad=255><col=800000000>[Beast Server Helper]</col=800000000><img=3>"+ Misc.optimizeText(c.playerName) +": "
  384.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  385.                             }else if (c.playerName.equalsIgnoreCase("Nirvana")){
  386.                                    c2.sendMessage("<shad=255><col=12151>[Beast Owner/Hoster]</col=12151><img=2>"+ Misc.optimizeText(c.playerName) +": "
  387.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  388.                             }else if (c.playerRights == 3){
  389.                                 c2.sendMessage("<shad=225><col=800000000>[Nirvana's Slutty Co-Owner]</col=800000000><img=2>"+ Misc.optimizeText(c.playerName) +": "
  390.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  391.                             }else if (c.playerRights == 0 && c.isDonator == 0) {
  392.                                 c.sendMessage("<shad=6081134><img=0>You must be a Donator to use yell,Contact REPLACE<img=0></col>");
  393.                                    
  394.                             }
  395.                         }
  396.                     }
  397.                 }
  398.        
  399.        
  400.     }
  401.    
  402.     public void moderatorCommands(Client c, String playerCommand)
  403.     {
  404.             if(playerCommand.startsWith("jail")) {
  405.                 try {
  406.                     String playerToBan = playerCommand.substring(5);
  407.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  408.                     if(Server.playerHandler.players[i] != null) {
  409.                     if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  410.                     Client c2 = (Client)Server.playerHandler.players[i];
  411.                     c2.teleportToX = 3102;
  412.                     c2.teleportToY = 9516;
  413.                     c2.Jail = true;
  414.                     c2.sendMessage("You have been jailed by "+c.playerName+"");
  415.                     c.sendMessage("Successfully Jailed "+c2.playerName+".");
  416.                             }
  417.                         }
  418.                     }
  419.                 } catch(Exception e) {
  420.                     c.sendMessage("Player Must Be Offline.");
  421.                 }
  422. }
  423. if (playerCommand.startsWith("mute")) {
  424.             try {  
  425.                 String playerToBan = playerCommand.substring(5);
  426.                 Connection.addNameToMuteList(playerToBan);
  427.                 for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  428.                     if(Server.playerHandler.players[i] != null) {
  429.                         if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  430.                             Client c2 = (Client)Server.playerHandler.players[i];
  431.                             c2.sendMessage("You have been muted by: " + c.playerName);
  432.                             c.sendMessage("You have muted: " + c2.playerName);
  433.                             break;
  434.                         }
  435.                     }
  436.                 }
  437.             } catch(Exception e) {
  438.                 c.sendMessage("Player Must Be Offline.");
  439.             }          
  440.         }  
  441.         if (playerCommand.equalsIgnoreCase("bank")) {
  442.             if (c.inWild())
  443.            return;
  444.         c.getPA().openUpBank();
  445.         }
  446.         if (playerCommand.startsWith("unmute")) {
  447.             try {  
  448.                 String playerToBan = playerCommand.substring(7);
  449.                 Connection.unMuteUser(playerToBan);
  450.                 c.sendMessage("Unmuted.");
  451.             } catch(Exception e) {
  452.                 c.sendMessage("Player Must Be Offline.");
  453.             }          
  454.         }  
  455.                     if (playerCommand.startsWith("item")) {
  456.                 try {
  457.                     String[] args = playerCommand.split(" ");
  458.                     if (args.length == 3) {
  459.                         int newItemID = Integer.parseInt(args[1]);
  460.                         int newItemAmount = Integer.parseInt(args[2]);
  461.                         if ((newItemID <= 20500) && (newItemID >= 0)) {
  462.                             c.getItems().addItem(newItemID, newItemAmount);    
  463.                         } else {
  464.                             c.sendMessage("That item ID does not exist.");
  465.                         }
  466.                     } else {
  467.                         c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))");
  468.                     }
  469.                 } catch(Exception e) {
  470.                    
  471.                 } // HERE?
  472.                 } // HERE?
  473.  
  474.                 if (playerCommand.startsWith("checkbank")) {
  475.                 String[] args = playerCommand.split(" ");
  476.                 for(int i = 0; i < Config.MAX_PLAYERS; i++)
  477.                 {
  478.                     Client o = (Client) Server.playerHandler.players[i];
  479.                     if(Server.playerHandler.players[i] != null)
  480.                     {
  481.                         if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
  482.                         {
  483.                                         c.getPA().otherBank(c, o);
  484.                         break;
  485.                         }
  486.                     }
  487.                 }
  488.             }
  489.             if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') {
  490.                 try {  
  491.                     String playerToBan = playerCommand.substring(5);
  492.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  493.                         if(Server.playerHandler.players[i] != null) {
  494.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  495.                                 Server.playerHandler.players[i].disconnected = true;
  496.                             }
  497.                         }
  498.                     }
  499.                 } catch(Exception e) {
  500.                     c.sendMessage("Player Must Be Offline.");
  501.                 }
  502.                 }
  503.             if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
  504.                 try {  
  505.                     String playerToBan = playerCommand.substring(4);
  506.                     Connection.addNameToBanList(playerToBan);
  507.                     Connection.addNameToFile(playerToBan);
  508.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  509.                         if(Server.playerHandler.players[i] != null) {
  510.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  511.                                 Server.playerHandler.players[i].disconnected = true;
  512.                         Client c2 = (Client)Server.playerHandler.players[i];
  513.                                 c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
  514.                             }
  515.                         }
  516.                     }
  517.                 } catch(Exception e) {
  518.                     c.sendMessage("Player Must Be Offline.");
  519.                 }
  520.                 }
  521.             if (playerCommand.startsWith("unban")) {
  522.                 try {  
  523.                     String playerToBan = playerCommand.substring(6);
  524.                     Connection.removeNameFromBanList(playerToBan);
  525.                     c.sendMessage(playerToBan + " has been unbanned.");
  526.                 } catch(Exception e) {
  527.                     c.sendMessage("Player Must Be Offline.");
  528.                 }
  529.             }
  530.             if(playerCommand.startsWith("unjail")) {
  531.                 try {
  532.                     String playerToBan = playerCommand.substring(7);
  533.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  534.                     if(Server.playerHandler.players[i] != null) {
  535.                     if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  536.                     Client c2 = (Client)Server.playerHandler.players[i];
  537.                     c2.teleportToX = 3086;
  538.                                 c2.teleportToY = 3493;
  539.                     c2.monkeyk0ed = 0;
  540.                     c2.Jail = false;
  541.                     c2.sendMessage("You have been unjailed by "+c.playerName+".");
  542.                     c.sendMessage("Successfully unjailed "+c2.playerName+".");
  543.                             }
  544.                         }
  545.                     }
  546.                 } catch(Exception e) {
  547.                     c.sendMessage("Player Must Be Offline.");
  548.                 }
  549.             }
  550.        
  551.     }
  552.    
  553.     public void administratorCommands(Client c, String playerCommand)
  554.     {
  555.             if (playerCommand.startsWith("alert")) {
  556.                 String msg = playerCommand.substring(6);
  557.                 for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  558.                     if (Server.playerHandler.players[i] != null) {
  559.                          Client c2 = (Client)Server.playerHandler.players[i];
  560.                         c2.sendMessage("Alert##Notification##" + msg + "##By: " + c.playerName);
  561.  
  562.                     }
  563.                 }
  564.             }
  565.             if (playerCommand.startsWith("ipmute")) {
  566.                 try {  
  567.                     String playerToBan = playerCommand.substring(7);
  568.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  569.                         if(Server.playerHandler.players[i] != null) {
  570.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  571.                                 Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
  572.                                 c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
  573.                                 Client c2 = (Client)Server.playerHandler.players[i];
  574.                                 c2.sendMessage("You have been muted by: " + c.playerName);
  575.                                 c2.sendMessage(" " +c2.playerName+ " Got IpMuted By " + c.playerName+ ".");
  576.                                 break;
  577.                             }
  578.                         }
  579.                     }
  580.                 } catch(Exception e) {
  581.                     c.sendMessage("Player Must Be Offline.");
  582.                 }  
  583.                 }  
  584.  
  585.  
  586.  
  587.             if (playerCommand.startsWith("object")) {
  588.                 String[] args = playerCommand.split(" ");              
  589.                 c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10);
  590.             }
  591.            
  592.             if (playerCommand.equalsIgnoreCase("mypos")) {
  593.                 c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel);
  594.             }
  595.  
  596.             if (playerCommand.startsWith("interface")) {
  597.                 String[] args = playerCommand.split(" ");
  598.                 c.getPA().showInterface(Integer.parseInt(args[1]));
  599.             }
  600.  
  601.             if (playerCommand.startsWith("gfx")) {
  602.                 String[] args = playerCommand.split(" ");
  603.                 c.gfx0(Integer.parseInt(args[1]));
  604.             }
  605.             if (playerCommand.startsWith("tele")) {
  606.                 String[] arg = playerCommand.split(" ");
  607.                 if (arg.length > 3)
  608.                     c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3]));
  609.                 else if (arg.length == 3)
  610.                     c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel);
  611.             }
  612.  
  613.             if (playerCommand.startsWith("xteletome")) {
  614.                 try {  
  615.                     String playerToTele = playerCommand.substring(10);
  616.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  617.                         if(Server.playerHandler.players[i] != null) {
  618.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
  619.                                 Client c2 = (Client)Server.playerHandler.players[i];
  620.                                 c2.sendMessage("You have been teleported to " + c.playerName);
  621.                                 c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel);
  622.                                 break;
  623.                             }
  624.                         }
  625.                     }
  626.                 } catch(Exception e) {
  627.                     c.sendMessage("Player Must Be Offline.");
  628.                 }          
  629.             }      
  630.  
  631.  
  632.             if (playerCommand.startsWith("xteleto")) {
  633.                 String name = playerCommand.substring(8);
  634.                 for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  635.                     if (Server.playerHandler.players[i] != null) {
  636.                         if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
  637.                             c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
  638.                         }
  639.                     }
  640.                 }          
  641.             }
  642.             if (playerCommand.startsWith("unipmute")) {
  643.                 try {  
  644.                     String playerToBan = playerCommand.substring(9);
  645.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  646.                         if(Server.playerHandler.players[i] != null) {
  647.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  648.                                 Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
  649.                                 c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
  650.                                 break;
  651.                             }
  652.                         }
  653.                     }
  654.                 } catch(Exception e) {
  655.                     c.sendMessage("Player Must Be Offline.");
  656.                         }          
  657.                     }
  658.             if (playerCommand.startsWith("ipban")) {
  659.                 try {
  660.                     String playerToBan = playerCommand.substring(6);
  661.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  662.                         if(Server.playerHandler.players[i] != null) {
  663.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  664.                                 Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
  665.                                 Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
  666.                                 c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom);
  667.                         Client c2 = (Client)Server.playerHandler.players[i];
  668.                                 Server.playerHandler.players[i].disconnected = true;
  669.                                 c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ ".");
  670.                             }
  671.                         }
  672.                     }
  673.                 } catch(Exception e) {
  674.                     c.sendMessage("Player Must Be Offline.");
  675.                 }
  676.             }
  677.        
  678.     }
  679.    
  680.     public void ownerCommands(Client c, String playerCommand)
  681.     {
  682.        
  683.             if (playerCommand.startsWith("update") && c.playerName.equalsIgnoreCase("REPLACE")) {
  684.                 String[] args = playerCommand.split(" ");
  685.                 int a = Integer.parseInt(args[1]);
  686.                 PlayerHandler.updateSeconds = a;
  687.                 PlayerHandler.updateAnnounced = false;
  688.                 PlayerHandler.updateRunning = true;
  689.                 PlayerHandler.updateStartTime = System.currentTimeMillis();
  690.             }
  691.            
  692.  
  693.             if(playerCommand.startsWith("npc")) {
  694.                 try {
  695.                     int newNPC = Integer.parseInt(playerCommand.substring(4));
  696.                     if(newNPC > 0) {
  697.                         Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false);
  698.                         c.sendMessage("You spawn a Npc.");
  699.                     } else {
  700.                         c.sendMessage("No such NPC.");
  701.                     }
  702.                 } catch(Exception e) {
  703.                    
  704.                 }          
  705.             }
  706.  
  707.             if (playerCommand.startsWith("anim")) {
  708.                 String[] args = playerCommand.split(" ");
  709.                 c.startAnimation(Integer.parseInt(args[1]));
  710.                 c.getPA().requestUpdates();
  711.             }
  712.  
  713.             if (playerCommand.equals("spec") && c.playerRights >= 2) {
  714.                             c.specAmount = 100000.0;
  715.             }
  716.            
  717.             if (playerCommand.equals("high")) {
  718.             for (int j = 0; j < Server.playerHandler.players.length; j++) {
  719.             if (Server.playerHandler.players[j] != null) {
  720.             Client c2 = (Client)Server.playerHandler.players[j];
  721.             c.forcedChat("SMOKE DAT SHIT!");
  722.             c2.forcedChat("YEAAA NIGGA!"); c.startAnimation(884);
  723.             c2.startAnimation(884); } }
  724.             }
  725.        
  726.             if (playerCommand.equalsIgnoreCase("asleep") && c.playerRights >= 1) {
  727.                 c.startAnimation(5713);
  728.                 c.forcedChat (c.playerName + " Is asleep"); }
  729.             if (playerCommand.equalsIgnoreCase("awake")) {
  730.                 c.startAnimation(6); c.forcedChat(c.playerName + " Is awake");
  731.             }
  732.  
  733.             if (playerCommand.startsWith("giveadmin") && c.playerRights >= 3) {
  734.                 try {  
  735.                     String playerToAdmin = playerCommand.substring(10);
  736.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  737.                         if(Server.playerHandler.players[i] != null) {
  738.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
  739.                                 Client c2 = (Client)Server.playerHandler.players[i];
  740.                                 c2.sendMessage("You have been given admin status by " + c.playerName);
  741.                                 c2.playerRights = 2;
  742.                                 c2.logout();
  743.                                 break;
  744.                             }
  745.                         }
  746.                     }
  747.                 } catch(Exception e) {
  748.                     c.sendMessage("Player Must Be Offline.");
  749.                 }          
  750.             }
  751.  
  752.             if (playerCommand.startsWith("givemod") && c.playerRights >= 3) {
  753.                 try {  
  754.                     String playerToMod = playerCommand.substring(8);
  755.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  756.                         if(Server.playerHandler.players[i] != null) {
  757.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  758.                                 Client c2 = (Client)Server.playerHandler.players[i];
  759.                                 c2.sendMessage("You have been given mod status by " + c.playerName);
  760.                                 c2.playerRights = 1;
  761.                                 c2.logout();
  762.                                 break;
  763.                             }
  764.                         }
  765.                     }
  766.                 } catch(Exception e) {
  767.                     c.sendMessage("Player Must Be Offline.");
  768.                 }          
  769.             }
  770.  
  771.             if (playerCommand.startsWith("kill")) {
  772.                 try {  
  773.                     String playerToKill = playerCommand.substring(5);
  774.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  775.                         if(Server.playerHandler.players[i] != null) {
  776.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKill)) {
  777.                                 c.sendMessage("You have killed the user: "+Server.playerHandler.players[i].playerName);
  778.                                 Client c2 = (Client)Server.playerHandler.players[i];
  779.                                 c2.isDead = true;
  780.                                 break;
  781.                             }
  782.                         }
  783.                     }
  784.                 } catch(Exception e) {
  785.                     c.sendMessage("Player Must Be Offline.");
  786.                 }          
  787.             }
  788.  
  789.             /*if (playerCommand.startsWith("kill")) {
  790.         String nameToKill = playerCommand.substring(5);
  791.         for (Client player : Server.playerHandler.players) {
  792.             if (player != null) {
  793.                 if (player.playerName.equals(nameToKill)) {
  794.                     player.getPA().applyDead();
  795.                     player.sendMessage("You died.");
  796.                 }
  797.             }
  798.         }
  799.     }*/
  800.             if (playerCommand.startsWith("pnpc"))
  801.                 {
  802.                 try {
  803.                     int newNPC = Integer.parseInt(playerCommand.substring(5));
  804.                     if (newNPC <= 200000 && newNPC >= 0) {
  805.                         c.npcId2 = newNPC;
  806.                         c.isNpc = true;
  807.                         c.updateRequired = true;
  808.                         c.setAppearanceUpdateRequired(true);
  809.                     }
  810.                     else {
  811.                         c.sendMessage("No such P-NPC.");
  812.                     }
  813.                 } catch(Exception e) {
  814.                     c.sendMessage("Wrong Syntax! Use as ::pnpc #");
  815.                 }
  816.             }
  817.  
  818.            
  819.                 if (playerCommand.startsWith("givedonor") && c.playerRights >= 3) {
  820.                 try {  
  821.                     String playerToMod = playerCommand.substring(10);
  822.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  823.                         if(Server.playerHandler.players[i] != null) {
  824.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  825.                                 Client c2 = (Client)Server.playerHandler.players[i];
  826.                                 c2.sendMessage("You have been given donator status by " + c.playerName);
  827.                                 c2.playerRights = 4;
  828.                                 c2.isDonator = 1;
  829.                                 c2.logout();
  830.                                
  831.                                 break;
  832.                             }
  833.                         }
  834.                     }
  835.                 } catch(Exception e) {
  836.                     c.sendMessage("Player Must Be Offline.");
  837.                 }          
  838.             }
  839.             if (playerCommand.startsWith("checkip")) {
  840.                 try {
  841.                     String playerToG = playerCommand.substring(8);
  842.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  843.                         if(Server.playerHandler.players[i] != null) {
  844.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToG)) {
  845.                                 c.sendMessage(""+Server.playerHandler.players[i].playerName+" 's Ip Is: "+Server.playerHandler.players[i].connectedFrom);      
  846.                             }
  847.                         }
  848.                     }
  849.                 } catch(Exception e) {
  850.                 c.sendMessage("Player Must Be Offline.");
  851.                 }
  852.             }
  853.             if (playerCommand.startsWith("giveitem")) {
  854.  
  855.             try {
  856.             String[] args = playerCommand.split(" ");
  857.             int newItemID = Integer.parseInt(args[1]);
  858.             int newItemAmount = Integer.parseInt(args[2]);
  859.             String otherplayer = args[3];
  860.             Client c2 = null;
  861.             for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  862.             if(Server.playerHandler.players[i] != null) {
  863.             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
  864.             c2 = (Client)Server.playerHandler.players[i];
  865.             break;
  866.                     }
  867.                 }
  868.             }
  869.             if (c2 == null) {
  870.             c.sendMessage("Player doesn't exist.");
  871.             return;
  872.             }
  873.             c.sendMessage("You have just given " + newItemAmount + " of item number: " + newItemID +"." );
  874.             c2.sendMessage("You have just been given item(s)." );
  875.             c2.getItems().addItem(newItemID, newItemAmount);   
  876.             } catch(Exception e) {
  877.             c.sendMessage("Use as ::giveitem ID AMOUNT PLAYERNAME.");
  878.                 }            
  879.             }
  880.            
  881.             if (playerCommand.startsWith("demote") && c.playerRights == 3) {
  882.                 try {  
  883.                     String playerToDemote = playerCommand.substring(7);
  884.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  885.                         if(Server.playerHandler.players[i] != null) {
  886.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) {
  887.                                 Client c2 = (Client)Server.playerHandler.players[i];
  888.                                 c2.sendMessage("You have been demoted by " + c.playerName);
  889.                                 c2.playerRights = 0;
  890.                                 c2.logout();
  891.                                 break;
  892.                             }
  893.                         }
  894.                     }
  895.                 } catch(Exception e) {
  896.                     c.sendMessage("Player Must Be Offline.");
  897.                 }          
  898.             }
  899.                         if (playerCommand.startsWith("reloadspawns")) {
  900.                 Server.npcHandler = null;
  901.                 Server.npcHandler = new server.model.npcs.NPCHandler();
  902.                 for (int j = 0; j < Server.playerHandler.players.length; j++) {
  903.                     if (Server.playerHandler.players[j] != null) {
  904.                         Client c2 = (Client)Server.playerHandler.players[j];
  905.                         c2.sendMessage("<shad=15695415>[" + c.playerName + "] " + "NPC Spawns have been reloaded.</col>");
  906.                     }
  907.                 }
  908.  
  909.             }
  910.                         if(playerCommand.startsWith("restart") && (c.playerName.equalsIgnoreCase("REPLACE"))) {
  911.     for(Player p : PlayerHandler.players) {
  912.         if(p == null)
  913.                  continue; 
  914.         PlayerSave.saveGame((Client)p);
  915.     }
  916. System.exit(0);
  917.     }
  918.  
  919.             if (playerCommand.equalsIgnoreCase("switch")) {
  920.             for (int i = 0; i < 8 ; i++){
  921.                 c.getItems().wearItem(c.playerItems[i]-1,i);
  922.             }
  923.                         c.sendMessage("Switching Armor");
  924.         }
  925.                     if (playerCommand.equalsIgnoreCase("REPLACE")) {
  926.                 c.getItems().deleteAllItems();
  927.                 int itemsToAdd[] = { 4151, 6585, 10551, 20072, 11732, 11726, 15220, 7462,
  928.                     2440, 2436, 3024};
  929.                     for (int i = 0; i < itemsToAdd.length; i++) {
  930.                 c.getItems().addItem(itemsToAdd[i], 1);
  931.             }
  932.             int[] equip = { 10828, 2414, 18335, 15486, 4712, 6889, -1, 4714, -1,
  933.                  6922, -1, 6920, 15018};
  934.             for (int i = 0; i < equip.length; i++) {
  935.                 c.playerEquipment[i] = equip[i];
  936.                 c.playerEquipmentN[i] = 1;
  937.                 c.getItems().setEquipment(equip[i], 1, i);
  938.             }
  939.                 c.getItems().addItem(555, 1200);
  940.                 c.getItems().addItem(560, 800);
  941.                 c.getItems().addItem(565, 400);
  942.                 c.getItems().addItem(5698, 1);
  943.                 c.getItems().addItem(391, 13);
  944.                                 c.playerMagicBook = 1;
  945.                                 c.setSidebarInterface(6, 12855);
  946.                 c.getItems().resetItems(3214);
  947.                 c.getItems().resetBonus();
  948.                 c.getItems().getBonus();
  949.                 c.getItems().writeBonus();
  950.                 c.updateRequired = true;
  951.                 c.appearanceUpdateRequired = true;
  952.         }
  953.                 if (playerCommand.equals("alltome")) {
  954.                 for (int j = 0; j < Server.playerHandler.players.length; j++) {
  955.                     if (Server.playerHandler.players[j] != null) {
  956.                         Client c2 = (Client)Server.playerHandler.players[j];
  957.             c2.teleportToX = c.absX;
  958.                         c2.teleportToY = c.absY;
  959.                         c2.heightLevel = c.heightLevel;
  960.                 c2.sendMessage("Mass teleport to: " + c.playerName + "");
  961.                     }
  962.                 }
  963.             }
  964. if(playerCommand.equalsIgnoreCase("hail")) {
  965. c.hail();
  966. }
  967. if(playerCommand.equalsIgnoreCase("barrage")) {
  968. c.barrage();
  969. }
  970. if(playerCommand.equalsIgnoreCase("zombie")) {
  971. c.zombie();
  972. }
  973.             if (playerCommand.startsWith("setlevel")) {
  974. try {
  975. String[] args = playerCommand.split(" ");
  976. int skill = Integer.parseInt(args[1]);
  977. int level = Integer.parseInt(args[2]);
  978. String otherplayer = args[3];
  979. Client target = null;
  980. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  981. if(Server.playerHandler.players[i] != null) {
  982. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
  983. target = (Client)Server.playerHandler.players[i];
  984. break;
  985. }
  986. }
  987. }
  988. if (target == null) {
  989. c.sendMessage("Player doesn't exist.");
  990. return;
  991. }
  992. c.sendMessage("You have just set one of "+ Misc.ucFirst(target.playerName) +"'s skills.");
  993. target.sendMessage(""+ Misc.ucFirst(c.playerName) +" has just set one of your skills.");
  994. target.playerXP[skill] = target.getPA().getXPForLevel(level)+5;
  995. target.playerLevel[skill] = target.getPA().getLevelForXP(target.playerXP[skill]);
  996. target.getPA().refreshSkill(skill);
  997. } catch(Exception e) {
  998. c.sendMessage("Use as ::setlevel SKILLID LEVEL PLAYERNAME.");
  999. }            
  1000. }      
  1001.         if (playerCommand.startsWith("heal") && c.playerRights > 0) {
  1002.             if (playerCommand.indexOf(" ") > -1 && c.playerRights > 1) {
  1003.                 String name = playerCommand.substring(5);
  1004.                 if (c.validClient(name)) {
  1005.                     Client p = c.getClient(name);
  1006.                     for (int i = 0; i < 20; i++) {
  1007.                         p.playerLevel[i] = p.getLevelForXP(p.playerXP[i]);
  1008.                         p.getPA().refreshSkill(i);
  1009.                     }
  1010.                     p.sendMessage("You have been healed by " + c.playerName + ".");
  1011.                 } else {
  1012.                     c.sendMessage("Player must be offline.");
  1013.                 }
  1014.             } else {
  1015.                 for (int i = 0; i < 20; i++) {
  1016.                     c.playerLevel[i] = c.getLevelForXP(c.playerXP[i]);
  1017.                     c.getPA().refreshSkill(i);
  1018.                 }
  1019.                 c.freezeTimer = -1;
  1020.                 c.frozenBy = -1;
  1021.                 c.sendMessage("You have been healed.");
  1022.             }
  1023.         }
  1024.         if (playerCommand.startsWith("shop")) {
  1025.             try {
  1026.                 c.getShops().openShop(Integer.parseInt(playerCommand.substring(5)));
  1027.             } catch(Exception e) {
  1028.                 c.sendMessage("Invalid input data! try typing ::shop 1");
  1029.             }
  1030.         }
  1031.         if (playerCommand.startsWith("fhome") && c.playerRights > 2) {
  1032.             String name = playerCommand.substring(6);
  1033.             if (c.validClient(name)) {
  1034.                 Client p = c.getClient(name);
  1035.                 p.getPA().movePlayer(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0); // Replace these coords to your home location
  1036.                 c.sendMessage("You have forced " + p.playerName + " home.");
  1037.                 p.sendMessage("You have been forced home by:" + c.playerName + ".");
  1038.             }
  1039.         }
  1040.         if (playerCommand.startsWith("copy")) {
  1041.             String name = playerCommand.substring(5);
  1042.             if (c.validClient(name)) {
  1043.                 Client p = c.getClient(name);
  1044.                 for(int i = 0; i < c.playerEquipment.length; i++)
  1045.                     c.playerEquipment[i] = p.playerEquipment[i];
  1046.                 for(int i = 0; i < c.playerAppearance.length; i++)
  1047.                     c.playerAppearance[i] = p.playerAppearance[i];
  1048.                 c.sendMessage("You have copied " + p.playerName + ".");
  1049.                 c.updateRequired = true;
  1050.                 c.appearanceUpdateRequired = true;
  1051.             }
  1052.         }
  1053.             if (playerCommand.equals("govote") && c.playerRights == 2) {
  1054.                 for (int j = 0; j < Server.playerHandler.players.length; j++)
  1055.                     if (Server.playerHandler.players[j] != null) {
  1056.                         Client c2 = (Client)Server.playerHandler.players[j];
  1057.                         c2.getPA().sendFrame126("REPLACE", 12000);
  1058.                         c2.sendMessage("Please vote every day!");
  1059.                     }
  1060.             }
  1061.             if (playerCommand.equals("forums")) {
  1062.                 for (int j = 0; j < Server.playerHandler.players.length; j++)
  1063.                     if (Server.playerHandler.players[j] != null) {
  1064.                         Client c2 = (Client)Server.playerHandler.players[j];
  1065.                         c2.getPA().sendFrame126("REPLACE", 12000);
  1066.                         c2.sendMessage("enjoy our forums");
  1067.                     }
  1068.             }
  1069.             if (playerCommand.equals("download") && c.playerRights == 3) {
  1070.                 for (int j = 0; j < Server.playerHandler.players.length; j++)
  1071.                     if (Server.playerHandler.players[j] != null) {
  1072.                         Client c2 = (Client)Server.playerHandler.players[j];
  1073.                         c2.getPA().sendFrame126("REPLACE", 12001);
  1074.                         c2.sendMessage("enjoy newest client");
  1075.                     }
  1076.             }
  1077.         if (playerCommand.startsWith("xcopy")) {
  1078.             String name = playerCommand.substring(6);
  1079.             if (c.validClient(name)) {
  1080.                 Client p = c.getClient(name);
  1081.                 for(int i = 0; i < c.playerEquipment.length; i++)
  1082.                     p.playerEquipment[i] = c.playerEquipment[i];
  1083.                 for(int i = 0; i < c.playerAppearance.length; i++)
  1084.                     p.playerAppearance[i] = c.playerAppearance[i];
  1085.                 c.sendMessage("You have xcopied " + p.playerName + ".");
  1086.                 p.sendMessage("You have been xcopied by " + c.playerName + ".");
  1087.                 p.updateRequired = true;
  1088.                 p.appearanceUpdateRequired = true;
  1089.             }
  1090.         }
  1091.         if (playerCommand.startsWith("god")) {
  1092.             if (c.playerStandIndex != 1501) {
  1093.                 c.startAnimation(1500);
  1094.                 c.playerStandIndex = 1501;
  1095.                 c.playerTurnIndex = 1851;
  1096.                 c.playerWalkIndex = 1851;
  1097.                 c.playerTurn180Index = 1851;
  1098.                 c.playerTurn90CWIndex = 1501;
  1099.                 c.playerTurn90CCWIndex = 1501;
  1100.                 c.playerRunIndex = 1851;
  1101.                 c.updateRequired = true;
  1102.                 c.appearanceUpdateRequired = true;
  1103.                 c.sendMessage("You turn God mode on.");
  1104.             } else {
  1105.                 c.playerStandIndex = 0x328;
  1106.                 c.playerTurnIndex = 0x337;
  1107.                 c.playerWalkIndex = 0x333;
  1108.                 c.playerTurn180Index = 0x334;
  1109.                 c.playerTurn90CWIndex = 0x335;
  1110.                 c.playerTurn90CCWIndex = 0x336;
  1111.                 c.playerRunIndex = 0x338;
  1112.                 c.updateRequired = true;
  1113.                 c.appearanceUpdateRequired = true;
  1114.                 c.sendMessage("Godmode has been diactivated.");
  1115.             }
  1116.         }
  1117.         if (playerCommand.startsWith("fall")) {
  1118.             if (c.playerStandIndex != 2048) {
  1119.                 c.startAnimation(2046);
  1120.                 c.playerStandIndex = 2048;
  1121.                 c.playerTurnIndex = 2048;
  1122.                 c.playerWalkIndex = 2048;
  1123.                 c.playerTurn180Index = 2048;
  1124.                 c.playerTurn90CWIndex = 2048;
  1125.                 c.playerTurn90CCWIndex = 2048;
  1126.                 c.playerRunIndex = 2048;
  1127.                 c.updateRequired = true;
  1128.                 c.appearanceUpdateRequired = true;
  1129.             } else {
  1130.                 c.startAnimation(2047);
  1131.                 c.playerStandIndex = 0x328;
  1132.                 c.playerTurnIndex = 0x337;
  1133.                 c.playerWalkIndex = 0x333;
  1134.                 c.playerTurn180Index = 0x334;
  1135.                 c.playerTurn90CWIndex = 0x335;
  1136.                 c.playerTurn90CCWIndex = 0x336;
  1137.                 c.playerRunIndex = 0x338;
  1138.                 c.updateRequired = true;
  1139.                 c.appearanceUpdateRequired = true;
  1140.             }
  1141.         }
  1142.         if (playerCommand.startsWith("demon")) {
  1143.             int id = 82+Misc.random(2);
  1144.             c.npcId2 = id;
  1145.             c.isNpc = true;
  1146.             c.updateRequired = true;
  1147.             c.appearanceUpdateRequired = true;
  1148.             c.playerStandIndex = 66;
  1149.             c.playerTurnIndex = 66;
  1150.             c.playerWalkIndex = 63;
  1151.             c.playerTurn180Index = 66;
  1152.             c.playerTurn90CWIndex = 66;
  1153.             c.playerTurn90CCWIndex = 63;
  1154.             c.playerRunIndex = 63;
  1155.         }
  1156.         if (playerCommand.startsWith("brute")) {
  1157.             int id = 6102+Misc.random(2);
  1158.             c.npcId2 = id;
  1159.             c.isNpc = true;
  1160.             c.updateRequired = true;
  1161.             c.appearanceUpdateRequired = true;
  1162.         }
  1163.                 if (playerCommand.startsWith("checkinv")) {
  1164.                 try {
  1165.                     String[] args = playerCommand.split(" ", 2);
  1166.                     for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1167.                         Client o = (Client) Server.playerHandler.players[i];
  1168.                         if(Server.playerHandler.players[i] != null) {
  1169.                             if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
  1170.                                         c.getPA().otherInv(c, o);
  1171.                                             break;
  1172.                             }
  1173.                         }
  1174.                     }
  1175.                 } catch(Exception e) {
  1176.                     c.sendMessage("Player Must Be Offline.");
  1177.                     }
  1178.             }
  1179.    
  1180.     }
  1181.  
  1182.     public void DonatorCommands(Client c, String playerCommand)
  1183.     {
  1184.     if (playerCommand.equalsIgnoreCase("bank")) {
  1185.         if (c.inWild())
  1186.            return;
  1187.         c.getPA().openUpBank();
  1188.         }
  1189.        
  1190. }
  1191. }
Add Comment
Please, Sign In to add comment