Jump to content
  • 0

Phantom private buy/sell


Question

Posted (edited)

Hi guys is there anyone that could help me out with some code, pls, here is the code from my PhantomPrivateStore.class _

-is there a way i could sort buy/seel prices in phantom shops by ItemID? like this:

- items with ID 5001-6000  Rnd.get (1, 10)

-items with ID 6001-7000 Rnd.get(11,20)

.

.

.

etc

 

i am a newbie with java searching for l2j guides for like 3 weeks now but couldn figure it out 

 

any help is welcome thanky ou all and whish you all the best 

 

 

public void run() {
    if (!this.player.isDead()) {
        if (Rnd.get(100) < Config.PHANTOM_PRIVATE_BUY_CHANCE && Config.PHANTOM_PRIVATE_STORE && !Config.ALLOW_PHANTOM_RETAIL_LOC) {
            this.player.addItem(":", 57, 1000000000, this.player, false);
            this.player.getBuyList().addItemByItemId(PhantomPrivateStore.getPrivateBuy(), 1, Rnd.get(1, 10));
            this.player.getBuyList().setTitle(PhantomPrivateStore.getPrivateBuy_Title());
            this.player.sitDown();
            this.player.setStoreType(StoreType.BUY);
            this.player.broadcastUserInfo();
            this.player.broadcastPacket(new PrivateStoreMsgBuy(this.player));
        } else if (Rnd.get(100) < Config.PHANTOM_PRIVATE_SELL_CHANCE && Config.PHANTOM_PRIVATE_STORE && !Config.ALLOW_PHANTOM_RETAIL_LOC) {
            this.player.addItem(":", PhantomPrivateStore.getPrivateSell(), 1, this.player, true);
            Iterator var1 = this.player.getInventory().getItems().iterator();

            while(var1.hasNext()) {
                ItemInstance itemDrop = (ItemInstance)var1.next();
                this.player.getSellList().addItem(itemDrop.getObjectId(), 1, Rnd.get(100456789, 150456789));
            }

            this.player.getSellList().setTitle(PhantomPrivateStore.getPrivateSell_Title());
            this.player.getSellList().setPackaged(StoreType.SELL == StoreType.PACKAGE_SELL);
            this.player.sitDown();
            this.player.setStoreType(StoreType.SELL);
            this.player.broadcastUserInfo();
            this.player.broadcastPacket(new PrivateStoreMsgSell(this.player));
        } else {
            if (Config.PLAYER_SPAWN_PROTECTION > 0) {
                this.player.setSpawnProtection(true);
            }

            PhantomPrivateStore.startWalk(this.player);
        }
    }

}
Edited by Vision

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock