Thread: [Hyperion] Infinite Shop Stock

Results 1 to 7 of 7
  1. #1 [Hyperion] Infinite Shop Stock 
    Banned

    Join Date
    Oct 2009
    Posts
    734
    Thanks given
    168
    Thanks received
    54
    Rep Power
    0
    How do I specify that I want a shop to have infinite shop stock? So the amount on the items will appear as the infinity symbol. Is there like a certain value I set the amount to that represents infinity? Or what?

    Will rep and thank for the answer.

    EDIT: My source and client are 474, so I assume its already added client sided.
    Reply With Quote  
     

  2. #2  
    🍥🍥🍥


    Join Date
    Dec 2008
    Posts
    1,702
    Thanks given
    664
    Thanks received
    293
    Rep Power
    621
    Code:
        <shop>        <!-- Shop 8 -->
            <mainStockId>784</mainStockId>
            <name>Drogo's Mining Emporium</name>
            <shopType>SPECIALIST_STORE_BUY</shopType>
            <currency>995</currency>
            <mainItems>
            </mainItems>
            <playerItems>
                <item>
                    <id>2347</id>
                    <count>10</count>
                </item>
                <item>
                    <id>1265</id>
                    <count>10</count>
                </item>
                <item>
                    <id>436</id>
                    <count>0</count>
                </item>
                <item>
                    <id>438</id>
                    <count>0</count>
                </item>
                <item>
                    <id>440</id>
                    <count>0</count>
                </item>
                <item>
                    <id>453</id>
                    <count>0</count>
                </item>
                <item>
                    <id>2349</id>
                    <count>0</count>
                </item>
                <item>
                    <id>2351</id>
                    <count>0</count>
                </item>
                <item>
                    <id>2357</id>
                    <count>0</count>
                </item>
            </playerItems>
        </shop>
    Code:
                case 1: //Main stock
                    if (shop.getMainStock().get(slot).getCount() > 0) {
                        if (amount >= shop.getMainStock().get(slot).getCount()) {
                            amount = shop.getMainStock().get(slot).getCount();
                        }
                        if (!shop.hasCurrency(player, item, amount)) {
                            player.getActionSender().sendMessage("You don't have enough " + ItemDefinition.forId(shop.getCurrency()).getName().toLowerCase() + ".");
                        } else {
                            //The infinite stock  ---------------------------------------------------
                            Item reward = new Item(item.getId(), amount);
                            Container temporaryInventory = new Container(Type.STANDARD, Inventory.SIZE);
                            for (Item invItem : player.getInventory().toArray()) {
                                temporaryInventory.add(invItem);
                            }
                            temporaryInventory.remove(new Item(shop.getCurrency(), amount * shop.getCostValue(player, new Item(item.getId(), amount))));
                            if (!temporaryInventory.add(reward)) {
                                return; //We wouldn't have enough inventory space, even after removing the currency cost.
                            }
                            player.getInventory().remove(new Item(shop.getCurrency(), amount * shop.getCostValue(player, new Item(item.getId(), amount))));
                            player.getInventory().add(reward);
                            //We don't remove from an infinity stock.
                        }
                    }
                    break;
    Set the item amount to 0 to make the item infinite
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Oct 2009
    Posts
    734
    Thanks given
    168
    Thanks received
    54
    Rep Power
    0
    Quote Originally Posted by Global View Post
    Code:
        <shop>        <!-- Shop 8 -->
            <mainStockId>784</mainStockId>
            <name>Drogo's Mining Emporium</name>
            <shopType>SPECIALIST_STORE_BUY</shopType>
            <currency>995</currency>
            <mainItems>
            </mainItems>
            <playerItems>
                <item>
                    <id>2347</id>
                    <count>10</count>
                </item>
                <item>
                    <id>1265</id>
                    <count>10</count>
                </item>
                <item>
                    <id>436</id>
                    <count>0</count>
                </item>
                <item>
                    <id>438</id>
                    <count>0</count>
                </item>
                <item>
                    <id>440</id>
                    <count>0</count>
                </item>
                <item>
                    <id>453</id>
                    <count>0</count>
                </item>
                <item>
                    <id>2349</id>
                    <count>0</count>
                </item>
                <item>
                    <id>2351</id>
                    <count>0</count>
                </item>
                <item>
                    <id>2357</id>
                    <count>0</count>
                </item>
            </playerItems>
        </shop>
    Code:
                case 1: //Main stock
                    if (shop.getMainStock().get(slot).getCount() > 0) {
                        if (amount >= shop.getMainStock().get(slot).getCount()) {
                            amount = shop.getMainStock().get(slot).getCount();
                        }
                        if (!shop.hasCurrency(player, item, amount)) {
                            player.getActionSender().sendMessage("You don't have enough " + ItemDefinition.forId(shop.getCurrency()).getName().toLowerCase() + ".");
                        } else {
                            //The infinite stock  ---------------------------------------------------
                            Item reward = new Item(item.getId(), amount);
                            Container temporaryInventory = new Container(Type.STANDARD, Inventory.SIZE);
                            for (Item invItem : player.getInventory().toArray()) {
                                temporaryInventory.add(invItem);
                            }
                            temporaryInventory.remove(new Item(shop.getCurrency(), amount * shop.getCostValue(player, new Item(item.getId(), amount))));
                            if (!temporaryInventory.add(reward)) {
                                return; //We wouldn't have enough inventory space, even after removing the currency cost.
                            }
                            player.getInventory().remove(new Item(shop.getCurrency(), amount * shop.getCostValue(player, new Item(item.getId(), amount))));
                            player.getInventory().add(reward);
                            //We don't remove from an infinity stock.
                        }
                    }
                    break;
    Set the item amount to 0 to make the item infinite
    That just makes the stock 0, so nothing can be bought. And the main stock is automatically infinite, I want to make the player stock infinite with the symbol.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Nando's Avatar
    Join Date
    Feb 2009
    Age
    29
    Posts
    3,517
    Thanks given
    2,439
    Thanks received
    1,108
    Rep Power
    5000
    If you're talking about an actual 474, afaik, no one has found out yet.


    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Oct 2009
    Posts
    734
    Thanks given
    168
    Thanks received
    54
    Rep Power
    0
    Quote Originally Posted by Nando View Post
    If you're talking about an actual 474, afaik, no one has found out yet.
    Shit
    Reply With Quote  
     

  6. #6  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    Code:
    public void openFor(Player player) {
        player.getActionSender().sendString(SHOPINTERFACE, SHOP_NAME_CHILD, shopName);
        player.getActionSender().sendConfigByte(118, 17);
        player.getActionSender().sendInventoryInterface(SHOPINVENTORYINTERFACE);
        player.getActionSender().sendMainInterface(SHOPINTERFACE, false, false);
        player.getActionSender().sendRunScript(25, mainStockParamaters, MAINSTOCKTYPEMASK);
        player.getActionSender().sendRunScript(150, BUY_PARAMETERS, STOCKOPTIONTYPEMASK);
        player.getActionSender().sendRunScript(150, SELL_PARAMETERS, STOCKOPTIONTYPEMASK);
        player.getActionSender().sendItemOptions(0x43E, 0, SHOPINVENTORYINTERFACE, 0, Inventory.SIZE);
        player.getActionSender().hideTabs();
        player.getActionSender().sendShowHideInterfaceFeature(ActionButtonPacketHandler.GAMEFRAME_PARENT, 50, true);
        player.getActionSender().sendShowHideInterfaceFeature(ActionButtonPacketHandler.GAMEFRAME_PARENT, 57, true);
        setShopType(player, true);
        player.setCurrentShop(this);
    }
    With these constants:
    Code:
    public static final int SHOPINTERFACE = 0x26C;
    public static final int SHOPINVENTORYINTERFACE = 0x26D;
    private static final int CLIENTINVENTORYITEMINDEX = 93;
    private static final int CLIENTMAINSTOCKITEMINDEX = 91;
    private static final int SHOP_NAME_CHILD = 0x16;
    public static final int SHOP_MAIN_STOCK = 0x17;
    public static final int SHOP_PLAYER_STOCK = 0x18;
    private static final int SHOP_MAIN_UNHIGHLIGHED = 0x19;
    private static final int SHOP_MAIN_HIGHLIGHTED = 0x1D;
    private static final int SHOP_PLAYER_UNHIGHLIGHTED = 0x1A;
    private static final int SHOP_PLAYER_HIGHLIGHTED = 0x1B;
    And mainStockParameters defined as:
    Code:
    mainStockParamaters = new Integer[] { mainStockId, 93 };
    MainStockId is -1 if there's no main stock.

    Furthermore I have these methods:
    Code:
    public void closeFor(Player player){
        if(player.getShopListener() != null)
            personalStock.removeListener(player.getShopListener());
        player.getActionSender().restoreInventory();
        player.getActionSender().showTabs();
        player.setShopListener(null);
    
    }
    
    private void setShopType(Player player, boolean mainShop) {
        player.setShopType(mainShop);
        if (mainShop) {
            if(mainStockDefinition != null){
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_MAIN_STOCK, true);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_MAIN_HIGHLIGHTED, true);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_MAIN_UNHIGHLIGHED, false);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_PLAYER_STOCK, false);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_PLAYER_UNHIGHLIGHTED, true);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_PLAYER_HIGHLIGHTED, false);
                player.getActionSender().sendItemOptions(Constants.SCRIPT_SHOP_AND_INV_ITEMOPTIONS, SHOP_MAIN_STOCK, SHOPINTERFACE, 0, SHOP_SIZE);
                InterfaceContainerListener oldShopListener = player.getShopListener();
                if(personalStock != null && oldShopListener != null)
                    player.getInterfaceState().removeListener(personalStock, oldShopListener);
            }
        } else {
            if(personalStock != null){
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_MAIN_STOCK, false);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_MAIN_HIGHLIGHTED, false);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_MAIN_UNHIGHLIGHED, true);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_PLAYER_STOCK, true);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_PLAYER_UNHIGHLIGHTED, false);
                player.getActionSender().sendShowHideInterfaceFeature(SHOPINTERFACE, SHOP_PLAYER_HIGHLIGHTED, true);
                player.getActionSender().sendItemOptions(Constants.SCRIPT_SHOP_AND_INV_ITEMOPTIONS, SHOP_PLAYER_STOCK, SHOPINTERFACE, 0, SHOP_SIZE);
                InterfaceContainerListener newShopListener = new InterfaceContainerListener(player, -1, 2, CLIENTMAINSTOCKITEMINDEX);
                player.getInterfaceState().addListener(personalStock, newShopListener);
                player.setShopListener(newShopListener);
            }
        }
    }
    The result:

    and


    The main shops are client sided though. So if you want one that differs from the standard, you'll need to change stuff over there.
    Reply With Quote  
     

  7. #7  
    Registered Member copycopy's Avatar
    Join Date
    Aug 2006
    Posts
    185
    Thanks given
    17
    Thanks received
    3
    Rep Power
    14
    Will use this probably in the future thanks

    Copycopy.
    Quote Originally Posted by Liam View Post
    We have like 20 staff members, and lots of them are pretty worthless. what the **** is the point of a SB mod?
    agreed there... well kinda
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Infinity Shop Stock
    By _Austin_ in forum Help
    Replies: 2
    Last Post: 09-09-2012, 11:56 PM
  2. Infinite shop symbol
    By Konceal in forum Help
    Replies: 5
    Last Post: 03-23-2012, 03:07 AM
  3. Infinite shop stock [PI]
    By natelead in forum Help
    Replies: 1
    Last Post: 08-20-2011, 09:47 PM
  4. [PI] Activate Infinite Shop Stock
    By Solid in forum Help
    Replies: 1
    Last Post: 08-01-2010, 05:55 AM
  5. shop stock
    By elweb in forum Help
    Replies: 0
    Last Post: 01-18-2010, 04:10 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •