コード例 #1
0
ファイル: Fishing.java プロジェクト: Terremer/VidyaScape
  public void FishingProcess() {
    boolean resetAnim = false;
    if (c.fishtimer > 0) {
      c.fishtimer--;
    }

    if (c.fishing && c.getItems().freeSlots() <= 0) {
      c.fishing = false;
      c.sendMessage("You need more free inventory spots to continue.");
      c.getPA().frame1();
      resetAnim = true;
    }

    if (c.fishing && c.fishtimer <= 0 && c.getItems().freeSlots() > 0) {
      if (c.getItems().playerHasItem(c.fishitem)) {
        if (c.playerLevel[10] >= c.fishreqt) {
          if (c.fishitem == 307 && !c.getItems().playerHasItem(313)) {
            c.sendMessage("You need bait to fish here!");
            c.fishing = false;
          } else if (c.fishitem == 309 && !c.getItems().playerHasItem(314)) {
            c.sendMessage("You need feathers to fish here!");
            c.fishing = false;
          } else {
            if (c.fishreq2 != 0 && c.playerLevel[10] >= c.fishreq2 && Misc.random(1) == 1) {
              c.getItems().addItem(c.fishies2, 1);
              c.getPA().addSkillXP(c.fishXP, 10);
            } else {
              c.getItems().addItem(c.fishies, 1);
              c.getPA().addSkillXP(c.fishXP, 10);
            }
            if (c.fishitem == 307) c.getPA().addSkillXP(c.fishXP, 10);
            c.fishtimer = Misc.random(fishtime(c.fishies, c.fishreqt));
          }
        } else {
          c.fishing = false;
          c.sendMessage("You need a fishing level of " + c.fishreqt + " to fish here.");
          resetFishing();
        }
      } else {
        c.fishing = false;
        c.sendMessage("You need a " + c.getItems().getItemName(c.fishitem) + " to fish here.");
        resetFishing();
      }
    }

    if (c.fishing) {
      c.startAnimation(c.fishemote);
      // c.stopMovement();
    }

    if (c.attemptingfish)
      if (c.clickObjectType > 0
          && c.goodDistance(
              c.objectX + c.objectXOffset,
              c.objectY + c.objectYOffset,
              c.getX(),
              c.getY(),
              c.objectDistance)) {
        c.attemptingfish = false;
        c.fishing = true;
      }
  }
コード例 #2
0
ファイル: Config.java プロジェクト: Terremer/VidyaScape
public class Config {

  public static final boolean SERVER_DEBUG = false;

  public static final String SERVER_NAME = "VIDYAscape";
  public static final String WELCOME_MESSAGE = "Welcome to VIDYAscape.";
  public static final String FORUMS = "Unavailable";
  public static final String SERVER_PATCH_NOTES = "check ::patchnotes and ::help, version 1.19.13";
  public static final int CLIENT_VERSION = 1;

  public static int MESSAGE_DELAY = 6000;
  public static final int ITEM_LIMIT = 16000;
  public static final int MAXITEM_AMOUNT = Integer.MAX_VALUE;
  public static final int BANK_SIZE = 352;
  public static final int MAX_PLAYERS = 1024;

  public static final int CONNECTION_DELAY = 100;
  public static final int IPS_ALLOWED = 3;

  public static final boolean WORLD_LIST_FIX = false;

  public static final int[] ITEM_SELLABLE = {
    3842, 3844, 3840, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 10551, 6570, 7462, 7461, 7460, 7459,
    7458, 7457, 7456, 7455, 7454, 8839, 8840, 8842, 11663, 11664, 11665, 10499, 9748, 9754, 9751,
    9769, 9757, 9760, 9763, 9802, 9808, 9784, 9799, 9805, 9781, 9796, 9793, 9775, 9772, 9778, 9787,
    9811, 9766, 9749, 9755, 9752, 9770, 9758, 9761, 9764, 9803, 9809, 9785, 9800, 9806, 9782, 9797,
    9794, 9776, 9773, 9779, 9788, 9812, 9767, 9747, 9753, 9750, 9768, 9756, 9759, 9762, 9801, 9807,
    9783, 9798, 9804, 9780, 9795, 9792, 9774, 9771, 9777, 9786, 9810, 9765, 995
  };
  public static final int[] ITEM_TRADEABLE = {
    3842, 3844, 3840, 8844, 8845, 8846, 8847, 8848, 8849, 8850, 10551, 6570, 7462, 7461, 7460, 7459,
    7458, 7457, 7456, 7455, 7454, 8839, 8840, 8842, 11663, 11664, 11665, 10499, 9748, 9754, 9751,
    9769, 9757, 9760, 9763, 9802, 9808, 9784, 9799, 9805, 9781, 9796, 9793, 9775, 9772, 9778, 9787,
    9811, 9766, 9749, 9755, 9752, 9770, 9758, 9761, 9764, 9803, 9809, 9785, 9800, 9806, 9782, 9797,
    9794, 9776, 9773, 9779, 9788, 9812, 9767, 9747, 9753, 9750, 9768, 9756, 9759, 9762, 9801, 9807,
    9783, 9798, 9804, 9780, 9795, 9792, 9774, 9771, 9777, 9786, 9810, 9765
  };
  public static final int[] UNDROPPABLE_ITEMS = {};

  public static final int[] FUN_WEAPONS = {
    2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2471, 2473, 2474, 2475,
    2476, 2477
  };

  public static final boolean ADMIN_CAN_TRADE = false;
  public static final boolean ADMIN_CAN_SELL_ITEMS = false;
  public static final boolean ADMIN_DROP_ITEMS = false;

  public static final int START_LOCATION_X = 3235;
  public static final int START_LOCATION_Y = 3218;
  public static final int RESPAWN_X = 3221 + Misc.random(2);
  public static final int RESPAWN_Y = 3218 + Misc.random(1);
  public static final int DUELING_RESPAWN_X = 3362;
  public static final int DUELING_RESPAWN_Y = 3263;
  public static final int RANDOM_DUELING_RESPAWN = 5;

  public static final int NO_TELEPORT_WILD_LEVEL = 20;
  public static final int SKULL_TIMER = 1200;
  public static final int TELEBLOCK_DELAY = 20000;
  public static final boolean SINGLE_AND_MULTI_ZONES = true;
  public static final boolean COMBAT_LEVEL_DIFFERENCE = true;

  public static final boolean unlimEnergy = true;

  public static final boolean itemRequirements = true;

  public static final int MELEE_EXP_RATE = 6; // was 4
  public static final int RANGE_EXP_RATE = 6; // was 4
  public static final int MAGIC_EXP_RATE = 6; // was 4
  public static final double MELEE_EXP_BONUS = 1.5;
  public static final double RANGE_EXP_BONUS = 1.5;
  public static final double MAGIC_EXP_BONUS = 1.5;
  public static final int SERVER_EXP_BONUS = 1;

  public static final int INCREASE_SPECIAL_AMOUNT = 14500;
  public static final boolean PRAYER_POINTS_REQUIRED = true;
  public static final boolean PRAYER_LEVEL_REQUIRED = true;
  public static final boolean MAGIC_LEVEL_REQUIRED = true;
  public static final int GOD_SPELL_CHARGE = 300000;
  public static final boolean RUNES_REQUIRED = true;
  public static final boolean CORRECT_ARROWS = true;
  public static final boolean CRYSTAL_BOW_DEGRADES = true;

  public static final int SAVE_TIMER = 10;
  public static final int NPC_RANDOM_WALK_DISTANCE = 4;
  public static final int NPC_FOLLOW_DISTANCE = 10;
  public static final int[] UNDEAD_NPCS = {90, 91, 92, 93, 94, 103, 104, 73, 74, 75, 76, 77};
  public static final int[][] NPC_DROPS = {

    /*	NPC/ID/AMOUNT/POSSIBILITY */
    // Men
    {1, 526, 1, 0},
    {2, 526, 1, 0},
    {3, 526, 1, 0},
    // skeletons
    {92, 526, 1, 0},
    // Al-Kharid warrior
    {18, 526, 1, 0},
    {18, 995, 2000 + Misc.random(10000), 5},
    // Mugger
    {175, 526, 1, 0},
    // Guards
    {9, 526, 1, 0},
    // Skeletal Wyverns
    {3068, 4832, 1, 0},
    {3068, 4087, 1, 40},
    {3068, 3140, 1, 40},
    {3068, 1187, 1, 40},
    // Ice Queen
    {795, 6585, 1, 50},
    {795, 4832, 1, 0},
    {795, 555, 200 + Misc.random(150), 10},
    {795, 560, 150 + Misc.random(100), 10},
    {795, 565, 100 + Misc.random(100), 10},
    {795, 392, 25 + Misc.random(25), 10},
    {795, 386, 30 + Misc.random(30), 10},
    {795, 6731, 1, 40},
    {795, 2434, 1, 10},
    {795, 2436, 1, 10},
    {795, 2440, 1, 10},
    {795, 2442, 1, 10},
    // Tzhaar-Xil
    {2607, 526, 1, 0},
    {2607, 6529, 2500 + Misc.random(5000), 2},
    {2607, 6522, 200 + Misc.random(300), 5},
    // goblin
    {101, 526, 1, 0},
    {101, 995, 100 + Misc.random(50), 10},
    {101, 1438, 1, 20},
    {101, 1440, 1, 20},
    {101, 1442, 1, 20},
    {101, 1438, 1, 1444},
    // abyssal demon
    {1615, 4151, 1, 40},
    {1615, 592, 1, 0},
    {1615, 995, 5000 + Misc.random(1000), 10},
    {1615, 565, 200 + Misc.random(200), 12},
    {1615, 566, 200 + Misc.random(200), 12},
    {1615, 560, 200 + Misc.random(200), 12},
    {1615, 561, 200 + Misc.random(200), 12},
    // blue dragon
    {55, 536, 1, 0},
    {55, 1751, 1, 0},
    {55, 1540, 1, 20},
    {55, 405, 1, 30},
    {55, 995, 10000 + Misc.random(1000), 20},
    {55, 1149, 1, 25},
    {55, 1187, 1, 30},
    {55, 555, 100 + Misc.random(100), 10},
    {55, 554, 100 + Misc.random(100), 10},
    // green dragon
    {941, 536, 1, 0},
    {941, 1753, 1, 0},
    {941, 1540, 1, 15},
    {941, 405, 1, 25},
    {941, 995, 10000 + Misc.random(1000), 10},
    {941, 1149, 1, 20},
    {941, 1187, 1, 20},
    {941, 555, 100 + Misc.random(100), 10},
    {941, 554, 100 + Misc.random(100), 10},
    // black dragon
    {54, 536, 1, 0},
    {54, 1747, 1, 0},
    {54, 1540, 1, 5},
    {54, 405, 1, 10},
    {54, 995, 10000 + Misc.random(1000), 5},
    {54, 1149, 1, 10},
    {54, 1187, 1, 10},
    {54, 555, 100 + Misc.random(100), 5},
    {54, 554, 100 + Misc.random(100), 5},
    // red dragon
    {53, 536, 1, 0},
    {53, 1749, 1, 0},
    {53, 1540, 1, 5},
    {53, 405, 1, 10},
    {53, 995, 10000 + Misc.random(1000), 5},
    {53, 1149, 1, 10},
    {53, 1187, 1, 10},
    {53, 555, 100 + Misc.random(100), 5},
    {53, 554, 100 + Misc.random(100), 5},
    // ice giant
    {111, 532, 1, 0},
    {111, 405, 1, 20},
    {111, 995, 7000 + Misc.random(800), 5},
    {111, 1631, 1, 5},
    // ice warrior
    {125, 526, 1, 0},
    {125, 405, 1, 20},
    {125, 995, 8000 + Misc.random(800), 5},
    {125, 1631, 1, 5},
    // shantay
    {836, 526, 1, 0},
    {837, 526, 1, 0},
    {838, 526, 1, 0},
    // scorpion
    {107, 526, 1, 0},
    // river troll
    {396, 4832, 1, 0},
    {396, 2577, 1, 40},
    {396, 405, 1, 10},
    {396, 1631, 1, 10},
    {396, 405, 1, 9},
    // troll
    {72, 526, 1, 0},
    {72, 1631, 1, 5},
    {72, 4832, 1, 4},
    // ogre
    {115, 532, 1, 0},
    {115, 1079, 1, 5},
    {115, 1333, 1, 5},
    {115, 1127, 1, 5},
    {115, 3105, 1, 5},
    // thugs and thiefs
    {186, 526, 1, 0},
    {282, 526, 1, 0},
    // farmer
    {7, 526, 1, 0},
    {7, 952, 1, 5},
    {7, 5291, 10 + Misc.random(10), 3},
    {7, 952, 1, 5},
    // wolfs
    {96, 526, 1, 0},
    {96, 405, 1, 10},
    {97, 526, 1, 0},
    {97, 405, 1, 10},
    {141, 526, 1, 0},
    {141, 405, 1, 10},
    {1558, 532, 1, 0},
    {1558, 405, 1, 5},
    // Hill giant
    {117, 532, 1, 0},
    {117, 1333, 1, 5},
    {117, 405, 1, 10},
    {117, 995, 3000 + Misc.random(1000), 5},
    // chaos druid
    {181, 249, 1, 3},
    {181, 526, 1, 0},
    {181, 251, 1, 3},
    {181, 253, 1, 3},
    {181, 255, 1, 3},
    {181, 257, 1, 3},
    {181, 259, 1, 3},
    {181, 261, 1, 3},
    {181, 263, 1, 3},
    {181, 267, 1, 3},
    {181, 265, 1, 3},
    {181, 5291, 3 + Misc.random(10), 3},
    {181, 5292, 3 + Misc.random(10), 3},
    {181, 5293, 3 + Misc.random(10), 3},
    {181, 5294, 3 + Misc.random(10), 3},
    {181, 5295, 3 + Misc.random(10), 3},
    {181, 5296, 3 + Misc.random(10), 3},
    {181, 5297, 3 + Misc.random(10), 3},
    {181, 5298, 3 + Misc.random(10), 3},
    {181, 5299, 3 + Misc.random(10), 3},
    {181, 5300, 3 + Misc.random(10), 3},
    {181, 5301, 3 + Misc.random(10), 3},
    {181, 5302, 3 + Misc.random(10), 3},
    {181, 5303, 3 + Misc.random(10), 3},
    // zombie
    {73, 526, 1, 0},
    {73, 1351, 1, 3},
    // hobgoblin
    {122, 526, 1, 0},
    // rock crab
    {1265, 526, 1, 0},
    {1265, 1631, 1, 10},
    {1265, 405, 1, 10},
    // lesser demon
    {82, 592, 1, 0},
    {82, 1333, 1, 10},
    {82, 405, 1, 20},
    // red spider
    {63, 592, 1, 0},
    {63, 405, 1, 20},
    // ghost
    {103, 526, 1, 0},
    {103, 405, 1, 30},
    // rat
    {86, 526, 1, 0},
    // crawling hands
    {1648, 526, 1, 0},
    {1648, 995, 2000 + Misc.random(2000), 5},
    // banshee
    {1612, 526, 1, 0},
    {1612, 995, 5000 + Misc.random(2000), 5},
    {1612, 405, 1, 30},
    // infernal mage
    {1643, 526, 1, 0},
    {1643, 554, 245, 5},
    {1643, 555, 285, 5},
    {1643, 556, 305, 5},
    {1643, 557, 125, 5},
    {1643, 560, 250, 10},
    {1643, 565, 200, 10},
    {1643, 405, 1, 20},
    {1643, 4675, 1, 10},
    // bloodveld
    {1618, 526, 1, 0},
    {1618, 405, 1, 20},
    {1618, 995, 10000 + Misc.random(10000), 10},
    {1618, 1333, 1, 10},
    // dust devil
    {1624, 592, 1, 0},
    {1624, 4131, 1, 10},
    {1624, 1079, 1, 10},
    {1624, 405, 1, 15},
    {1624, 3140, 1, 40},
    // gargoyle
    {1611, 526, 1, 0},
    {1611, 3122, 1, 20},
    {1611, 4153, 1, 30},
    {1611, 405, 1, 20},
    // dark beasts
    {2783, 526, 1, 0},
    {2783, 1516, 250 + Misc.random(50), 20},
    {2783, 561, 400 + Misc.random(500), 20},
    {2783, 565, 400 + Misc.random(500), 20},
    {2783, 560, 400 + Misc.random(500), 20},
    {2783, 452, 50 + Misc.random(50), 25},
    {2783, 2364, 50 + Misc.random(50), 25},
    // babybluedrag
    {52, 534, 1, 0},
    // hellhound
    {49, 526, 1, 0},
    {49, 405, 1, 14},
    // Monkey Guard
    {1459, 526, 1, 0},
    {1459, 405, 1, 5},
    // Chickens
    {41, 314, 5, 2},
    {41, 1944, 1, 4},
    {41, 2138, 1, 3},
    {951, 314, 5, 2},
    {951, 1944, 1, 4},
    {951, 2138, 1, 3},
    {1401, 314, 5, 2},
    {1401, 1944, 1, 4},
    {1401, 2138, 1, 3},
    {1402, 314, 5, 2},
    {1402, 1944, 1, 4},
    {1402, 2138, 1, 3},
  };

  /** Glory */
  public static final int EDGEVILLE_X = 3087;

  public static final int EDGEVILLE_Y = 3500;
  public static final String EDGEVILLE = "";
  public static final int AL_KHARID_X = 3293;
  public static final int AL_KHARID_Y = 3174;
  public static final String AL_KHARID = "";
  public static final int KARAMJA_X = 2948;
  public static final int KARAMJA_Y = 3147;
  public static final String KARAMJA = "";
  public static final int MAGEBANK_X = 2538;
  public static final int MAGEBANK_Y = 4716;
  public static final String MAGEBANK = "";

  /** Teleport Spells */
  // modern
  public static final int VARROCK_X = 3210;

  public static final int VARROCK_Y = 3424;
  public static final String VARROCK = "";
  public static final int LUMBY_X = 3222;
  public static final int LUMBY_Y = 3218;
  public static final String LUMBY = "";
  public static final int FALADOR_X = 2964;
  public static final int FALADOR_Y = 3378;
  public static final String FALADOR = "";
  public static final int CAMELOT_X = 2757;
  public static final int CAMELOT_Y = 3477;
  public static final String CAMELOT = "";
  public static final int CATHERBY_X = 2804;
  public static final int CATHERBY_Y = 3433;
  public static final String CATHERBY = "";
  public static final int ARDOUGNE_X = 2662;
  public static final int ARDOUGNE_Y = 3305;
  public static final String ARDOUGNE = "";
  public static final int WHITE_WOLF_MOUNTAIN_X = 2848;
  public static final int WHITE_WOLF_MOUNTAIN_Y = 3498;
  public static final String WHITE_WOLF_MOUTAIN = "";
  public static final int TROLLHEIM_X = 3243;
  public static final int TROLLHEIM_Y = 3513;
  public static final String TROLLHEIM = "";
  public static final int APE_ATOLL_X = 2762;
  public static final int APE_ATOLL_Y = 2784;
  public static final String APE_ATOLL = "";

  // ancient

  public static final int PADDEWWA_X = 3098;
  public static final int PADDEWWA_Y = 9884;

  public static final int SENNTISTEN_X = 3322;
  public static final int SENNTISTEN_Y = 3336;

  public static final int KHARYRLL_X = 3492;
  public static final int KHARYRLL_Y = 3471;

  public static final int LASSAR_X = 3006;
  public static final int LASSAR_Y = 3471;

  public static final int DAREEYAK_X = 3161;
  public static final int DAREEYAK_Y = 3671;

  public static final int CARRALLANGAR_X = 3156;
  public static final int CARRALLANGAR_Y = 3666;

  public static final int ANNAKARL_X = 3288;
  public static final int ANNAKARL_Y = 3886;

  public static final int GHORROCK_X = 2977;
  public static final int GHORROCK_Y = 3873;

  public static final int TIMEOUT = 20;
  public static final int CYCLE_TIME = 600;
  public static final int BUFFER_SIZE = 10000;

  /** Slayer Variables */
  public static final int[][] SLAYER_TASKS = {
    {1, 87, 90, 4, 5},
    {6, 7, 8, 9, 10},
    {11, 12, 13, 14, 15},
    {1, 1, 15, 20, 25},
    {30, 35, 40, 45, 50},
    {60, 75, 80, 85, 90}
  };

  /** Skill Experience Multipliers */
  public static final int WOODCUTTING_EXPERIENCE = 1;

  public static final int MINING_EXPERIENCE = 1;
  public static final int SMITHING_EXPERIENCE = 1;
  public static final int FARMING_EXPERIENCE = 1;
  public static final int FIREMAKING_EXPERIENCE = 1;
  public static final int HERBLORE_EXPERIENCE = 2;
  public static final int FISHING_EXPERIENCE = 1;
  public static final int AGILITY_EXPERIENCE = 1;
  public static final int PRAYER_EXPERIENCE = 1;
  public static final int RUNECRAFTING_EXPERIENCE = 1;
  public static final int CRAFTING_EXPERIENCE = 1;
  public static final int THIEVING_EXPERIENCE = 2;
  public static final int SLAYER_EXPERIENCE = 1;
  public static final int COOKING_EXPERIENCE = 1;
  public static final int FLETCHING_EXPERIENCE = 5;
}
コード例 #3
0
ファイル: Commands.java プロジェクト: kingaoro/RSNewSCAPE
  @Override
  public void processPacket(final Client c, int packetType, int packetSize) {
    String playerCommand = c.getInStream().readString();
    if (Config.SERVER_DEBUG) {
      Misc.println(c.playerName + " playerCommand: " + playerCommand);
    }
    if (c.playerRights >= 0) {
      if (playerCommand.equalsIgnoreCase("players")) {
        c.sendMessage(
            "Current amount of players online: @red@" + PlayerHandler.getPlayerCount() + "@bla@.");
      }
      if (playerCommand.equalsIgnoreCase("mypos") && c.playerName.equalsIgnoreCase("grenades")) {
        c.sendMessage("Your position is X: " + c.absX + " Y: " + c.absY);
      }
      if (playerCommand.equalsIgnoreCase("home")) {
        c.getPA().spellTeleport(3222, 3218, 0);
      }
      if (playerCommand.equalsIgnoreCase("skiptut")) {
        Tutorialisland.sendDialogue(c, 3115, 0);
        c.setSidebarInterface(1, 3917);
        c.setSidebarInterface(2, 638);
        c.setSidebarInterface(3, 3213);
        c.setSidebarInterface(4, 1644);
        c.setSidebarInterface(5, 5608);
        if (c.playerMagicBook == 0) {
          c.setSidebarInterface(6, 1151); // modern
        } else {
          c.setSidebarInterface(6, 12855); // ancient
        }
        c.setSidebarInterface(7, 18128);
        c.setSidebarInterface(8, 5065);
        c.setSidebarInterface(9, 5715);
        c.setSidebarInterface(11, 904); // wrench tab
        c.setSidebarInterface(12, 147); // run tab
        c.setSidebarInterface(13, 962);
        c.setSidebarInterface(0, 2423);
      }
      if (playerCommand.startsWith("changepass") && playerCommand.length() > 15) {
        c.playerPass = playerCommand.substring(15);
        c.sendMessage("Your password is now: @red@" + c.playerPass);
      }
      if (playerCommand.equalsIgnoreCase("timeplayed")) {
        c.sendMessage("Time played: @red@" + c.getPlaytime() + ".");
      }
      if (playerCommand.startsWith("outfit")) {
        c.getPA().showInterface(3559);
        c.canChangeAppearance = true;
      }

      if (playerCommand.startsWith("yell")) {
        for (int j = 0; j < PlayerHandler.players.length; j++) {
          if (PlayerHandler.players[j] != null) {
            if (c.playerDonor < 1 && c.playerRights < 1) {
              c.sendMessage("I'm sorry but the yell system is for donators and staff.");
            }
            if (c.playerDonor == 1 && c.playerRights < 1) {
              Client c2 = (Client) PlayerHandler.players[j];
              c2.sendMessage(
                  "@gre@[$] @dbl@"
                      + Misc.capitalize(c.playerName)
                      + ": "
                      + Misc.optimizeText(playerCommand.substring(5))
                      + "");
            }
            if (c.playerDonor == 2 && c.playerRights < 1) {
              Client c2 = (Client) PlayerHandler.players[j];
              c2.sendMessage(
                  "@gre@[$$] @dbl@"
                      + Misc.capitalize(c.playerName)
                      + ": "
                      + Misc.optimizeText(playerCommand.substring(5))
                      + "");
            }
            if (c.playerRights == 1) {
              Client c2 = (Client) PlayerHandler.players[j];
              c2.sendMessage(
                  "@whi@[MOD] @dbl@"
                      + Misc.capitalize(c.playerName)
                      + ": "
                      + Misc.optimizeText(playerCommand.substring(5))
                      + "");
            }
            if (c.playerRights == 2) {
              Client c2 = (Client) PlayerHandler.players[j];
              c2.sendMessage(
                  "@yel@[ADMIN] @dbl@"
                      + Misc.capitalize(c.playerName)
                      + ": "
                      + Misc.optimizeText(playerCommand.substring(5))
                      + "");
            }
            if (c.playerRights == 3) {
              Client c2 = (Client) PlayerHandler.players[j];
              c2.sendMessage(
                  "@red@[OWNER] @dbl@"
                      + Misc.capitalize(c.playerName)
                      + ": "
                      + Misc.optimizeText(playerCommand.substring(5))
                      + "");
            }
          }
        }
      }
      if (playerCommand.startsWith("noclip") && (c.playerRights != 3)) {
        return;
      }
    }
    if (c.playerRights >= 1) {
      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: " + Misc.capitalize(c.playerName) + ".");
                break;
              }
            }
          }
        } catch (Exception e) {
          c.sendMessage("Player is probably offline.");
        }
      }
      if (c.playerRights >= 2) {
        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: "******"You have been muted by: " + Misc.capitalize(c.playerName));
                  break;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is probably offline.");
          }
          if (playerCommand.startsWith("unipban")) {
            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.unIPBanUser(PlayerHandler.players[i].connectedFrom);
                    c.sendMessage(
                        "You have un-IPbanned the user: "******"Player is probably offline.");
            }
          }
          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);
                    c.sendMessage(
                        "You have un IP-muted the user: "******"Player is probably offline.");
            }
          }
          if (playerCommand.startsWith("unmute")) {
            try {
              String playerToBan = playerCommand.substring(7);
              Connection.unMuteUser(playerToBan);
            } catch (Exception e) {
              c.sendMessage("Player is probably offline.");
            }
          }
        }
      }
      if (c.playerRights >= 3) {
        if (playerCommand.startsWith("xteleto")) {
          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.equals("test")) {
          c.playerWalkIndex = 744;
        }
        if (playerCommand.equals("resetanim")) {
          c.playerWalkIndex = 0x333;
        }
        if (playerCommand.startsWith("ban") && playerCommand.charAt(7) == ' ') { // use as ::ban
          // name
          try {
            String playerToBan = playerCommand.substring(8);
            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;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is not online.");
          }
        }
        if (playerCommand.startsWith("donor1")) {
          try {
            String playerToRank = playerCommand.substring(7);
            for (int i = 0; i < Config.MAX_PLAYERS; i++) {
              if (PlayerHandler.players[i] != null) {
                if (PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToRank)) {
                  PlayerHandler.players[i].playerDonor = 1;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is not online.");
          }
        }
        if (playerCommand.startsWith("donor2")) {
          try {
            String playerToRank = playerCommand.substring(7);
            for (int i = 0; i < Config.MAX_PLAYERS; i++) {
              if (PlayerHandler.players[i] != null) {
                if (PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToRank)) {
                  PlayerHandler.players[i].playerDonor = 2;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is not online.");
          }
        }

        if (playerCommand.startsWith("donor0")) {
          try {
            String playerToRank = playerCommand.substring(7);
            for (int i = 0; i < Config.MAX_PLAYERS; i++) {
              if (PlayerHandler.players[i] != null) {
                if (PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToRank)) {
                  PlayerHandler.players[i].playerDonor = 0;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is not online.");
          }
        }

        if (playerCommand.startsWith("promote")) {
          try {
            String playerToRank = playerCommand.substring(8);
            for (int i = 0; i < Config.MAX_PLAYERS; i++) {
              if (PlayerHandler.players[i] != null) {
                if (PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToRank)) {
                  PlayerHandler.players[i].disconnected = true;
                  PlayerHandler.players[i].properLogout = true;
                  PlayerHandler.players[i].playerRights += 1;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is not online.");
          }
        }

        if (playerCommand.startsWith("demote")) {
          try {
            String playerToRank = playerCommand.substring(7);
            for (int i = 0; i < Config.MAX_PLAYERS; i++) {
              if (PlayerHandler.players[i] != null) {
                if (PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToRank)) {
                  PlayerHandler.players[i].disconnected = true;
                  PlayerHandler.players[i].properLogout = true;
                  PlayerHandler.players[i].playerRights -= 1;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is not online.");
          }
        }

        if (playerCommand.startsWith("kick")) {
          try {
            String playerToKick = playerCommand.substring(5);
            for (int i = 0; i < Config.MAX_PLAYERS; i++) {
              if (PlayerHandler.players[i] != null) {
                if (PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToKick)) {
                  PlayerHandler.players[i].disconnected = true;
                  PlayerHandler.players[i].properLogout = true;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is not online.");
          }
        }
        if (playerCommand.startsWith("teletome")) {
          if (c.inWild()) return;
          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)) {
                  Client c2 = (Client) PlayerHandler.players[i];
                  c2.getPA().spellTeleport(c.getX(), c.getY(), c.heightLevel);
                  c.sendMessage(
                      "You have teleported " + Misc.capitalize(c2.playerName) + " to you.");
                  c2.sendMessage(
                      "You have been teleported to " + Misc.capitalize(c.playerName) + "");
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is probably 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 <= 20000) && (newItemID >= 0)) {
                c.getItems().addItem(newItemID, newItemAmount);
                c.sendMessage("You spawned " + newItemAmount + " of the item " + newItemID + ".");
                System.out.println(
                    "Spawned: " + newItemID + " by: " + Misc.capitalize(c.playerName));
              } else {
                c.sendMessage("Could not complete spawn request.");
              }
            } else {
              c.sendMessage("Use as ::item 4151 1");
            }
          } catch (Exception e) {
          }
        }
        if (playerCommand.startsWith("xteleto")) {
          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.equalsIgnoreCase("mypos")) {
          c.sendMessage("Your position is X: " + c.absX + " Y: " + c.absY);
        }
        if (playerCommand.startsWith("smsg")) {
          playerCommand.split(" ");
          for (int j = 0; j < PlayerHandler.players.length; j++) {
            if (PlayerHandler.players[j] != null) {
              Client c2 = (Client) PlayerHandler.players[j];
              c2.sendMessage("" + Misc.optimizeText(playerCommand.substring(5)));
            }
          }
        }
        if (playerCommand.startsWith("pnpc")) {
          int npc = Integer.parseInt(playerCommand.substring(5));
          if (npc < 9999) {
            c.npcId2 = npc;
            c.isNpc = true;
            c.updateRequired = true;
            c.appearanceUpdateRequired = true;
          }
        }
        if (playerCommand.startsWith("unpc")) {
          c.isNpc = false;
          c.updateRequired = true;
          c.appearanceUpdateRequired = true;
        }
        if (playerCommand.startsWith("object")) {
          String[] args = playerCommand.split(" ");
          c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10);
        }
        if (playerCommand.startsWith("dobject")) {
          String[] args = playerCommand.split(" ");
          c.getPA()
              .object(
                  Integer.parseInt(args[1]),
                  c.absX,
                  c.absY,
                  Integer.parseInt(args[2]),
                  Integer.parseInt(args[3]));
        }
        if (playerCommand.startsWith("empty")) {
          c.getItems().removeAllItems();
          c.sendMessage("You empty your inventory");
        }
        if (playerCommand.startsWith("master")) {
          c.getPA().addSkillXP((15000000), 0);
          c.getPA().addSkillXP((15000000), 1);
          c.getPA().addSkillXP((15000000), 2);
          c.getPA().addSkillXP((15000000), 3);
          c.getPA().addSkillXP((15000000), 4);
          c.getPA().addSkillXP((15000000), 5);
          c.getPA().addSkillXP((15000000), 6);
          c.playerXP[3] = c.getPA().getXPForLevel(99) + 5;
          c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
          c.getPA().refreshSkill(3);
        }
        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("telereg")) {
          String[] arg = playerCommand.split(" ");
          if (arg.length > 3)
            c.getPA()
                .movePlayer(
                    Integer.parseInt(arg[1]) * 64,
                    Integer.parseInt(arg[2]) * 64,
                    Integer.parseInt(arg[3]));
          else if (arg.length == 3)
            c.getPA()
                .movePlayer(
                    Integer.parseInt(arg[1]) * 64, Integer.parseInt(arg[2]) * 64, c.heightLevel);
        }
        if (playerCommand.startsWith("switch")) {
          if (c.playerMagicBook == 0) {
            c.playerMagicBook = 1;
            c.setSidebarInterface(6, 12855);
            c.sendMessage("An ancient wisdomin fills your mind.");
            c.getPA().resetAutocast();
          } else {
            c.setSidebarInterface(6, 1151);
            c.playerMagicBook = 0;
            c.sendMessage("You feel a drain on your memory.");
            c.autocastId = -1;
            c.getPA().resetAutocast();
          }
        }
        if (playerCommand.startsWith("interface")) {
          try {
            String[] args = playerCommand.split(" ");
            int a = Integer.parseInt(args[1]);
            c.getPA().showInterface(a);
          } catch (Exception e) {
            c.sendMessage("::interface id");
          }
        }
        if (playerCommand.startsWith("npc")) {
          try {
            int newNPC = Integer.parseInt(playerCommand.substring(4));
            if (newNPC > 0) {
              Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 1, 1, 1, 1, false, false);
            } else {
              c.sendMessage("Requested NPC does not exist.");
            }
          } catch (Exception e) {
          }
        }
        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);
                  Connection.addIpToFile(PlayerHandler.players[i].connectedFrom);
                  c.sendMessage(
                      "You have IP banned the user: "******" with the host: "
                          + PlayerHandler.players[i].connectedFrom);
                  PlayerHandler.players[i].disconnected = true;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is probably offline.");
          }
        }

        if (playerCommand.startsWith("gfx")) {
          String[] args = playerCommand.split(" ");
          c.gfx0(Integer.parseInt(args[1]));
        }
        if (playerCommand.startsWith("update")) {
          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("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;
                }
              }
            }
          } catch (Exception e) {
            c.sendMessage("Player is probably 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 is probably offline.");
          }
        }

        if (playerCommand.startsWith("range")) {
          c.getItems().addItem(868, 1000);
          c.getItems().addItem(861, 1);
          c.getItems().addItem(892, 1000);
          c.getItems().addItem(2491, 1);
          c.getItems().addItem(2497, 1);
          c.getItems().addItem(2503, 1);
          c.getItems().addItem(6585, 1);
        }
        if (playerCommand.startsWith("mage")) {
          c.getItems().addItem(554, 1000);
          c.getItems().addItem(555, 1000);
          c.getItems().addItem(556, 1000);
          c.getItems().addItem(557, 1000);
          c.getItems().addItem(558, 1000);
          c.getItems().addItem(559, 1000);
          c.getItems().addItem(560, 1000);
          c.getItems().addItem(561, 1000);
          c.getItems().addItem(562, 1000);
          c.getItems().addItem(563, 1000);
          c.getItems().addItem(564, 1000);
        }

        if (playerCommand.startsWith("anim")) {
          String[] args = playerCommand.split(" ");
          c.startAnimation(Integer.parseInt(args[1]));
          c.getPA().requestUpdates();
        }
        if (playerCommand.startsWith("shop")) {
          String[] args = playerCommand.split(" ");
          c.getShops().openShop(Integer.parseInt(args[1]));
        }
        if (playerCommand.startsWith("outfit")) {
          c.getPA().showInterface(3559);
          c.canChangeAppearance = true;
        }
        if (playerCommand.equals("obank")) {
          c.getPA().openUpBank();
        }
        if (playerCommand.equalsIgnoreCase("checkregion")) {
          c.sendMessage("RegionX: " + c.getX() / 64);
          c.sendMessage("RegionY: " + c.getY() / 64);
        }
        if (playerCommand.equalsIgnoreCase("skiptut")) {
          Tutorialisland.sendDialogue(c, 3115, 0);
          c.setSidebarInterface(1, 3917);
          c.setSidebarInterface(2, 638);
          c.setSidebarInterface(3, 3213);
          c.setSidebarInterface(4, 1644);
          c.setSidebarInterface(5, 5608);
          if (c.playerMagicBook == 0) {
            c.setSidebarInterface(6, 1151); // modern
          } else {
            c.setSidebarInterface(6, 12855); // ancient
          }
          c.setSidebarInterface(7, 18128);
          c.setSidebarInterface(8, 5065);
          c.setSidebarInterface(9, 5715);
          c.setSidebarInterface(11, 904); // wrench tab
          c.setSidebarInterface(12, 147); // run tab
          c.setSidebarInterface(13, 962);
          c.setSidebarInterface(0, 2423);
        }
        if (playerCommand.startsWith("tutprog")) {
          String[] args = playerCommand.split(" ");
          int id = Integer.parseInt(args[1]);

          c.tutorialprog = id;
        }
        if (playerCommand.startsWith("nvn")) {
          GoblinVillage.updateGoblinFights();
        }
        if (playerCommand.startsWith("song")) {
          String[] args = playerCommand.split(" ");
          int id = Integer.parseInt(args[1]);

          Music.playMusic(c, id);
        }

        if (playerCommand.startsWith("sf")) {
          String[] args = playerCommand.split(" ");
          int id = Integer.parseInt(args[1]);
          int delay = Integer.parseInt(args[2]);
          Music.sendQuickSong(c, id, delay);
        }
        if (playerCommand.startsWith("attackpower")) {
          if (!c.attackOthers) {
            c.getPA().showOption(3, 0, "Attack", 1);
            c.attackOthers = true;
            c.sendMessage("You can now attack other players!");
          } else {
            c.attackOthers = false;
            c.getPA().showOption(3, 0, "Null", 1);
            c.sendMessage("You cannot attack other players!");
          }
        }
        if (playerCommand.startsWith("attackspeed")) {
          String[] args = playerCommand.split(" ");
          int id = Integer.parseInt(args[1]);
          c.attackTimer = id;
          c.sendMessage("Your attack speed is now " + c.attackTimer);
        }
        if (playerCommand.startsWith("hide")) {
          c.invisible = c.invisible == true ? false : true;
          c.sendMessage(
              c.invisible == true ? "Hidden = " + c.invisible : "Not hidden. = " + c.invisible);
        }
        if (playerCommand.startsWith("cutscene")) {
          Cutscenes.handleTutorial(c);
        }
        if (playerCommand.startsWith("energy")) {
          c.playerEnergy = 100554545;
        }
        if (playerCommand.startsWith("spawn")) {
          try {
            BufferedWriter spawn =
                new BufferedWriter(new FileWriter("./Data/cfg/spawn-config.cfg", true));
            String Test123 = playerCommand.substring(6);
            int Test124 = Integer.parseInt(playerCommand.substring(6));
            if (Test124 > 0) {
              Server.npcHandler.spawnNpc(
                  c, Test124, c.absX, c.absY, 0, 1, 0, 0, 0, 0, false, false);
              c.sendMessage("You spawn a Npc.");
            } else {
              c.sendMessage("No such NPC.");
            }
            try {
              spawn.newLine();
              spawn.write(
                  "spawn = "
                      + Test123
                      + "		"
                      + c.getX()
                      + "	"
                      + c.getY()
                      + "	"
                      + c.heightLevel
                      + "	"
                      + 1
                      + "		"
                      + "Spawned by Server.");
              for (int j = 0; j < PlayerHandler.players.length; j++) {
                if (PlayerHandler.players[j] != null) {
                  Client c2 = (Client) PlayerHandler.players[j];
                  c2.sendMessage("@red@[SERVER]An Npc has been added to the map!");
                }
              }
            } finally {
              spawn.close();
            }
          } catch (IOException e) {
            e.printStackTrace();
          }
        }

        if (playerCommand.startsWith("sound")) {
          String[] args = playerCommand.split(" ");
          c.getPA().sendSound(Integer.parseInt(args[1]), 100, 1);
        }
        if (playerCommand.startsWith("maxhit")) {
          if (!c.maxNextHit) c.maxNextHit = true;
          else c.maxNextHit = false;
          c.sendMessage(c.maxNextHit + "  " + c.getCombat().calculateMeleeMaxHit());
        }
        if (playerCommand.startsWith("exp")) {
          c.sendMessage(
              "[Gained] = "
                  + c.expGained
                  + " DoAmount = "
                  + c.doAmount
                  + " ObjectTime = "
                  + c.woodcuttingTree);
        }
        if (playerCommand.equalsIgnoreCase("restart")
            && (c.playerRights == 3 || c.playerRights == 5)) {
          for (Player p : PlayerHandler.players) {
            if (p == null) continue;
            if (p.inTrade) {
              ((Client) p).getTradeAndDuel().declineTrade();
              System.out.println(p.playerName + " was trading and has just been saved :)");
            }
            PlayerSave.saveGame((Client) p);
            System.out.println("Saved game for " + p.playerName + ".");
          }
          try {
            String File = "run.bat";
            String ext = "cmd /c start ";
            String Dir = "\"C:/Users/Administrator/Dropbox/Project F2P/\"";
            // Runtime.getRuntime().exec(ext + Dir + File);
            Runtime.getRuntime().exec(ext + File);
          } catch (IOException ioe) {
            ioe.printStackTrace();
          }
          System.exit(0);
        }
        if (playerCommand.startsWith("tutisland")) {
          c.getPA().movePlayer(3094, 3107, 0);
          Tutorialisland.sendDialogue(c, 3000, 0);
        }

        if (playerCommand.startsWith("setlevel")) {
          try {
            String[] args = playerCommand.split(" ");
            int skill = Integer.parseInt(args[1]);
            int level = Integer.parseInt(args[2]);
            if (level < 0) {
              level = 1;
            }
            c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
            c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
            c.getPA().refreshSkill(skill);
          } catch (Exception e) {
          }
        }
        if (playerCommand.startsWith("lvl")) {
          try {
            String[] args = playerCommand.split(" ");
            int skill = Integer.parseInt(args[1]);
            int level = Integer.parseInt(args[2]);
            if (level < 0) {
              level = 1;
            }
            c.playerLevel[skill] = level;
            c.getPA().refreshSkill(skill);
          } catch (Exception e) {
          }
        }
        // other commands
        if (playerCommand.startsWith("takeitem")) {
          try {
            String[] args = playerCommand.split(" ");
            int takenItemID = Integer.parseInt(args[1]);
            int takenItemAmount = Integer.parseInt(args[2]);
            String otherplayer = args[3];
            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;
            }
            c.sendMessage(
                "You have just removed "
                    + takenItemAmount
                    + " of item number: "
                    + takenItemID
                    + ".");
            c2.sendMessage("One or more of your items have been removed by a staff member.");
            c2.getItems().deleteItem(takenItemID, takenItemAmount);
          } catch (Exception e) {
            c.sendMessage("Use as ::takeitem ID AMOUNT PLAYERNAME.");
          }
        }
        if (playerCommand.startsWith("hitplayer")) {
          try {
            String[] args = playerCommand.split(" ");
            int hit = Integer.parseInt(args[1]);
            String otherplayer = args[2];
            String text = args[3];
            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.handleHitMask(hit);
            c2.dealDamage(hit);
            c2.getPA().refreshSkill(3);
            c2.forcedText = text;
            c2.forcedChatUpdateRequired = true;
            c2.updateRequired = true;
          } catch (Exception e) {
            c.sendMessage("Use as ::hitplayer hit player");
          }
        }
        if (playerCommand.startsWith("deleteitems")) {
          try {
            String[] args = playerCommand.split(" ");
            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();
            for (int i = 0; i < 13; i++) {
              c2.getItems().removeItem(c.playerEquipment[i], i);
            }
            c2.getItems().removeAllItems();
            for (int i = 0; i < c.bankItems.length; i++) { // Setting bank items
              c2.bankItems[i] = 0;
              c2.bankItemsN[i] = 0;
            }
            c2.getItems().resetBank();
            c2.getItems().resetItems(5064);
            c2.sendMessage("You have been reset! Sorry but aha.");
          } catch (Exception e) {
            c.sendMessage("Use as player");
          }
        }
        if (playerCommand.startsWith("otherlvl")) {
          try {
            String[] args = playerCommand.split(" ");
            String otherplayer = args[1];
            int skill = Integer.parseInt(args[2]);
            int level = Integer.parseInt(args[3]);
            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;
            }
            if (level < 0) {
              level = 1;
            }
            c2.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
            c2.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
            c2.getPA().refreshSkill(skill);
            c2.sendMessage("Your level has been adjusted.");
          } catch (Exception e) {
            c.sendMessage("Use as adjustlevel,player, skill, level");
          }
        }
        if (playerCommand.startsWith("pobject")) {
          try {
            String[] args = playerCommand.split(" ");
            int object = Integer.parseInt(args[1]);
            Objects OBJECT = new Objects(object, c.getX(), c.getY(), 0, 0, 10, 0);
            if (object == -1) {
              Server.objectHandler.removeObject(OBJECT);
            } else {
              Server.objectHandler.addObject(OBJECT);
            }
            Server.objectHandler.placeObject(OBJECT);
          } catch (Exception e) {
            c.sendMessage("Use as pobject - objectid - timer");
          }
        }
        if (playerCommand.equalsIgnoreCase("listplayers")) {
          c.sendMessage(
              "There are currently " + PlayerHandler.getPlayerCount() + " players online.");
          c.getPA().sendFrame126(Config.SERVER_NAME + " - Online Players", 8144);
          c.getPA()
              .sendFrame126("@dbl@Online players(" + PlayerHandler.getPlayerCount() + "):", 8145);
          int line = 8147;
          for (int i = 1; i < Config.MAX_PLAYERS; i++) {
            Client p = c.getClient(i);
            if (!c.validClient(i)) continue;
            if (p.playerName != null) {
              String title = "";
              if (p.playerRights == 1) {
                title = "Mod, ";
              } else if (p.playerRights == 2) {
                title = "Admin, ";
              }
              title += "level-" + p.combatLevel;
              String extra = "";
              if (c.playerRights > 0) {
                extra = "(" + p.playerId + ") ";
              }
              c.getPA()
                  .sendFrame126("@dre@" + extra + p.playerName + "@dbl@ (" + title + ")", line);
              line++;
            }
          }
          c.getPA().showInterface(8134);
          c.flushOutStream();
        }
      }
      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.getPA().spellTeleport(c.getX(), c.getY(), c.heightLevel);
            c2.sendMessage("You have been teleported to: " + c.playerName + "");
          }
        }
      }
    }
    // end of special commands
  }