Exemple #1
0
 public void checkOffer(int slot)
 {
     this.currentOffer = Server.getGrandExchange().getOfferForSlot(p, slot);
     if (currentOffer != null)
     {
         ItemData.ItemPrice price = currentOffer.getItemPrice();
         p.getPackets().sendConfig(1109, currentOffer.getItem());
         p.getPackets().sendConfig(1110, currentOffer.getTotalAmount());
         p.getPackets().sendConfig(1111, currentOffer.getPriceEach());
         p.getPackets().sendConfig(1112, currentOffer.getSlot());
         p.getPackets().sendConfig(1113, 0);
         p.getPackets().sendConfig(1114, price.getNormalPrice());
         p.getPackets().sendConfig(1116, price.getMaximumPrice());
         p.getPackets().sendConfig(1115, price.getMinimumPrice());
         Item slot1 = currentOffer.getSlot1();
         Item slot2 = currentOffer.getSlot2();
         if (currentOffer is BuyOffer)
         {
             //slot1 = currentOffer.getAmountTraded() == 0 ? null : new Item(currentOffer.getItem(), currentOffer.getAmountTraded());
             //slot2 = (currentOffer.getAmountTraded() == currentOffer.getTotalAmount()) ||  currentOffer.getAmountTraded() == 0 ? null : new Item(995, (currentOffer.getTotalAmount() - currentOffer.getAmountTraded()) * currentOffer.getPriceEach());
         }
         else
         {
             //slot1 = (currentOffer.getAmountTraded() == currentOffer.getTotalAmount()) ||  currentOffer.getAmountTraded() == 0 ? null : new Item(currentOffer.getUnNotedId(), currentOffer.getTotalAmount() - currentOffer.getAmountTraded());
             //slot2 = currentOffer.getAmountTraded() == 0 ? null : new Item(995, (currentOffer.getAmountTraded()) * currentOffer.getPriceEach());
         }
         Item[] items = { slot1, slot2 };
         currentOffer.setSlot1(slot1);
         currentOffer.setSlot2(slot2);
         p.getPackets().sendItems(-1, -1757, 523 + currentOffer.getSlot(), items);
     }
 }
Exemple #2
0
 public void updateGEProgress(GEItem offer)
 {
     connection.SendPacket(new PacketBuilder().setId(116)
         .addByte((byte)offer.getSlot())
         .addByte((byte)offer.getProgress())
         .addUShort(offer.getDisplayItem())
         .addInt(offer.getPriceEach())
         .addInt(offer.getTotalAmount())
         .addInt(offer.getAmountTraded())
         .addInt(offer.getTotalAmount() * offer.getPriceEach()).toPacket());
 }