Пример #1
0
  public void setupSkillCapes(int capes, int capes2) {
    synchronized (c) {
      c.getItems().resetItems(3823);
      c.isShopping = true;
      c.myShopId = 14;
      c.getPA().sendFrame248(3824, 3822);
      c.getPA().sendFrame126("reflexion SkillCape Shop", 3901);

      int TotalItems = 0;
      TotalItems = capes2;
      if (TotalItems > Server.shopHandler.MaxShopItems) {
        TotalItems = Server.shopHandler.MaxShopItems;
      }
      c.getOutStream().createFrameVarSizeWord(53);
      c.getOutStream().writeWord(3900);
      c.getOutStream().writeWord(TotalItems);
      int TotalCount = 0;
      for (int i = 0; i < 23; i++) {
        if (c.getLevelForXP(c.playerXP[i]) < 99) continue;
        c.getOutStream().writeByte(1);
        c.getOutStream().writeWordBigEndianA(skillCapes[i] + 2);
        TotalCount++;
      }
      c.getOutStream().endFrameVarSizeWord();
      c.flushOutStream();
    }
  }
Пример #2
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;
      }
    }
  }
Пример #3
0
 public void resetShop(Client o) {
   synchronized (c) {
     fixShop(o);
     for (int x = 0; x < 10; x++) {
       if (o.playerShopN[x] <= 0) {
         o.playerShop[x] = 0;
       }
     }
     int TotalItems = 0;
     for (int i = 0; i < 10; i++) {
       if (o.playerShop[i] > 0) {
         TotalItems++;
       }
     }
     if (TotalItems > 10) {
       TotalItems = 10;
     }
     c.getOutStream().createFrameVarSizeWord(53);
     c.getOutStream().writeWord(3900);
     c.getOutStream().writeWord(TotalItems);
     int TotalCount = 0;
     for (int i = 0; i < o.playerShop.length; i++) {
       if (o.playerShop[i] > 0) {
         if (o.playerShopN[i] > 254) {
           c.getOutStream().writeByte(255);
           c.getOutStream().writeDWord_v2(o.playerShopN[i]);
         } else {
           c.getOutStream().writeByte(o.playerShopN[i]);
         }
         c.getOutStream().writeWordBigEndianA((o.playerShop[i] + 1));
         TotalCount++;
       }
       if (TotalCount > TotalItems) {
         break;
       }
     }
     c.getOutStream().endFrameVarSizeWord();
     c.flushOutStream();
   }
 }
Пример #4
0
 public void resetShop(int ShopID) {
   synchronized (c) {
     int TotalItems = 0;
     for (int i = 0; i < Server.shopHandler.MaxShopItems; i++) {
       if (Server.shopHandler.ShopItems[ShopID][i] > 0) {
         TotalItems++;
       }
     }
     if (TotalItems > Server.shopHandler.MaxShopItems) {
       TotalItems = Server.shopHandler.MaxShopItems;
     }
     c.getOutStream().createFrameVarSizeWord(53);
     c.getOutStream().writeWord(3900);
     c.getOutStream().writeWord(TotalItems);
     int TotalCount = 0;
     for (int i = 0; i < Server.shopHandler.ShopItems.length; i++) {
       if (Server.shopHandler.ShopItems[ShopID][i] > 0
           || i <= Server.shopHandler.ShopItemsStandard[ShopID]) {
         if (Server.shopHandler.ShopItemsN[ShopID][i] > 254) {
           c.getOutStream().writeByte(255);
           c.getOutStream().writeDWord_v2(Server.shopHandler.ShopItemsN[ShopID][i]);
         } else {
           c.getOutStream().writeByte(Server.shopHandler.ShopItemsN[ShopID][i]);
         }
         if (Server.shopHandler.ShopItems[ShopID][i] > Config.ITEM_LIMIT
             || Server.shopHandler.ShopItems[ShopID][i] < 0) {
           Server.shopHandler.ShopItems[ShopID][i] = Config.ITEM_LIMIT;
         }
         c.getOutStream().writeWordBigEndianA(Server.shopHandler.ShopItems[ShopID][i]);
         TotalCount++;
       }
       if (TotalCount > TotalItems) {
         break;
       }
     }
     c.getOutStream().endFrameVarSizeWord();
     c.flushOutStream();
   }
 }