Exemplo n.º 1
0
 public void setCustomPrice(int amount)
 {
     if (currentOffer != null)
     {
         ItemData.ItemPrice price = currentOffer.getItemPrice();
         if (amount < price.getMinimumPrice())
         {
             currentOffer.setPriceEach(price.getMinimumPrice());
         }
         else if (amount > price.getMaximumPrice())
         {
             currentOffer.setPriceEach(price.getMaximumPrice());
         }
         else
         {
             currentOffer.setPriceEach(amount);
         }
         p.getPackets().sendConfig(1111, currentOffer.getPriceEach());
     }
 }
Exemplo n.º 2
0
 public void updateSearchItem(int item)
 {
     p.getPackets().sendConfig(1109, item);
     p.getPackets().sendConfig(1110, 0);
     ItemData.Item def = ItemData.forId(item);
     if (def == null)
     {
         return;
     }
     p.getPackets().sendConfig(1109, item);
     p.getPackets().sendConfig(1114, def.getPrice().getNormalPrice());
     p.getPackets().sendConfig(1116, def.getPrice().getMaximumPrice());
     p.getPackets().sendConfig(1115, def.getPrice().getMinimumPrice());
     p.getPackets().sendConfig(1111, def.getPrice().getNormalPrice());
     currentOffer = new BuyOffer(slot, p.getLoginDetails().getUsername());
     currentOffer.setTotalAmount(0);
     currentOffer.setItem(item);
     currentOffer.setPriceEach(def.getPrice().getNormalPrice());
     p.getPackets().sendInterface(0, 752, 6, 137);         // Removes the item search
 }
Exemplo n.º 3
0
        public void updateSearchItem(int item)
        {
            ItemData.Item def = ItemData.forId(item);
            if (def == null)
            {
                p.getPackets().sendMessage("Item: " + item + " cannot be found in item definitions, please report it.");
                return;
            }

            if (currentOffer == null)
            {
                p.getPackets().sendMessage("You shouldn't be running GE Item Search if you didn't click Buy in GE first");
                p.getPackets().sendCloseInterface(752, 6);    // Removes the item search
                p.getPackets().sendInterface(0, 752, 6, 137); // Removes the item search
                return;
            }

            p.getPackets().sendConfig(1109, item);
            p.getPackets().sendConfig(1110, 0);
            p.getPackets().sendConfig(1114, def.getPrice().getNormalPrice());
            p.getPackets().sendConfig(1116, def.getPrice().getMaximumPrice());
            p.getPackets().sendConfig(1115, def.getPrice().getMinimumPrice());
            p.getPackets().sendConfig(1111, def.getPrice().getNormalPrice());
            p.getPackets().modifyText(def.getExamine(), 105, 142); //item examine text.

            currentOffer.setTotalAmount(0);
            currentOffer.setItem(item);
            currentOffer.setPriceEach(def.getPrice().getNormalPrice());
            p.getPackets().sendInterface(0, 752, 6, 137);// Removes the item search
        }