Esempio n. 1
0
  @Override
  public void processPacket(Client c, int packetType, int packetSize) {

    if (packetType == PART1) {
      c.getOutStream().createFrame(27);
      XremoveSlot = c.getInStream().readSignedWordBigEndian();
      XinterfaceID = c.getInStream().readUnsignedWordA();
      XremoveID = c.getInStream().readSignedWordBigEndian();
    }

    if (packetType == PART2) {
      Xamount = c.getInStream().readDWord();
      switch (XinterfaceID) {
        case 5064:
          c.getItems().bankItem(c.playerItems[XremoveSlot], XremoveSlot, Xamount);
          break;

        case 5382:
          c.getItems().fromBank(c.playerItems[XremoveSlot], XremoveSlot, Xamount);
          break;

        case 3322:
          if (c.duelStatus <= 0) {
            c.getTradeAndDuel().tradeItem(XremoveID, XremoveSlot, Xamount);
          } else {
            c.getTradeAndDuel().stakeItem(XremoveID, XremoveSlot, Xamount);
          }
          break;

        case 3415:
          if (c.duelStatus <= 0) {
            c.getTradeAndDuel().fromTrade(XremoveID, XremoveSlot, Xamount);
          }
          break;

        case 6669:
          c.getTradeAndDuel().fromDuel(XremoveID, XremoveSlot, Xamount);
          break;
      }
    }
  }
Esempio n. 2
0
  public static int getBlockEmote(Client c) {
    String shield = c.getItems().getItemName(c.playerEquipment[c.playerShield]).toLowerCase();
    String weapon = c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase();
    if (shield.contains("defender")) return 4177;
    if (shield.contains("2h")) return 7050;
    if (shield.contains("book") && (weapon.contains("wand"))) return 420;
    if (shield.contains("shield")) return 1156;
    switch (c.playerEquipment[c.playerWeapon]) {
      case 4755:
        return 2063;
      case 15241:
        return 12156;
      case 13899:
        return 13042;
      case 18355:
        return 13046;
      case 14484:
        return 397;
      case 11716:
        return 12008;
      case 4153:
        return 1666;
      case 4151:
        return 1659;
      case 15486:
        return 12806;
      case 18349:
        return 12030;
      case 18353:
        return 13054;
      case 18351:
        return 13042;

      case 11694:
      case 11698:
      case 11700:
      case 11696:
      case 11730:
        return 7050;
      case -1:
        return 424;
      default:
        return 424;
    }
  }
Esempio n. 3
0
  public void startMining(final int j, final int x, final int y, final int type) {
    if (c.isMining) return;
    if (c.mining) return;
    int miningLevel = c.playerLevel[c.playerMining];
    a = -1;
    c.turnPlayerTo(x, y);
    if (Rock_Settings[j][1] > miningLevel) {
      c.sendMessage("You need a Mining level of " + Rock_Settings[j][1] + " to mine this rock.");
      return;
    }
    for (int i = 0; i < Pick_Settings.length; i++) {
      if (c.getItems().playerHasItem(Pick_Settings[i][0])
          || c.playerEquipment[c.playerWeapon] == Pick_Settings[i][0]) {
        if (Pick_Settings[i][1] <= miningLevel) {
          a = i;
        }
      }
    }
    if (a == -1) {
      c.sendMessage("You need a pickaxe to mine this rock.");
      return;
    }
    if (c.getItems().freeSlots() < 1) {
      c.sendMessage("You do not have enough inventory slots to do that.");
      return;
    }
    c.startAnimation(Pick_Settings[a][3]);
    c.isMining = true;
    c.rockX = x;
    c.rockY = y;
    c.mining = true;
    CycleEventHandler.getSingleton()
        .addEvent(
            c,
            new CycleEvent() {
              @Override
              public void execute(CycleEventContainer container) {
                if (!c.isMining) {
                  container.stop();
                  c.startAnimation(65535);
                  return;
                }
                if (c.isMining) {
                  c.getItems().addItem(Rock_Settings[j][4], 1);
                  c.getPA().addSkillXP(Rock_Settings[j][2], c.playerMining);
                }
                if (c.getItems().freeSlots() < 1) {
                  c.sendMessage("You have ran out of inventory slots.");
                  container.stop();
                }
                mineRock(Rock_Settings[j][3], x, y, type, Rock_Settings[j][0]);
                c.isMining = false;
                container.stop();
              }

              @Override
              public void stop() {
                c.getPA().removeAllWindows();
                c.startAnimation(65535);
                c.isMining = false;
                c.rockX = 0;
                c.rockY = 0;
                c.mining = false;
                return;
              }
            },
            getTimer(j, a, miningLevel));
  }