Пример #1
0
  @Override
  public void processPacket(Client c, int packetType, int packetSize) {
    c.wearId = c.getInStream().readUnsignedWord();
    c.wearSlot = c.getInStream().readUnsignedWordA();
    c.interfaceId = c.getInStream().readUnsignedWordA();

    if (!c.getItems().playerHasItem(c.wearId, 1, c.wearSlot)) {
      return;
    }
    int oldCombatTimer = c.attackTimer;
    if (c.playerIndex > 0 || c.npcIndex > 0) c.getCombat().resetPlayerAttack();
    if (c.wearId >= 5509 && c.wearId <= 5515) {
      int pouch = -1;
      int a = c.wearId;
      if (a == 5509) pouch = 0;
      if (a == 5510) pouch = 1;
      if (a == 5512) pouch = 2;
      if (a == 5514) pouch = 3;
      c.getPA().emptyPouch(pouch);
      return;
    }
    // c.attackTimer = oldCombatTimer;
    c.getItems().wearItem(c.wearId, c.wearSlot);
  }
Пример #2
0
  @Override
  public void processPacket(Client c, int packetType, int packetSize) {
    /*
     * a = ?
     * b = ?
     */

    int a = c.getInStream().readUnsignedWord();
    int objectId = c.getInStream().readSignedWordBigEndian();
    int objectY = c.getInStream().readSignedWordBigEndianA();
    int b = c.getInStream().readUnsignedWord();
    int objectX = c.getInStream().readSignedWordBigEndianA();
    int itemId = c.getInStream().readUnsignedWord();
    if (!c.getItems().playerHasItem(itemId, 1)) {
      return;
    }
    UseItem.ItemonObject(c, objectId, objectX, objectY, itemId);
    c.objectX = objectX;
    c.objectY = objectY;
  }