Aleos

Storage Types Optimization

Recommended Posts

Storage Types Optimization
As of Git Hash: ade1b17, rAthena has moved the Cart, Inventory, and Storage types out of the mmo_charstatus!

What does this mean to you?

  • These storage types now mimic Guild Storage and can be loaded/saved whenever needed.
  • Relieves mmo_charstatus from having to send storage types and lets the char-server handle it.
  • All item storage types now have an increased max amount.
  • Custom Storages can be created in conf/inter_server.conf which mimics official behavior of secondary Storages.
    • Each Premium Storage behaves as a unique Storage for players to access.
    • Images below show it in use.
  • Fixes players having to log out to resync cart item data before opening a Vending Store.
  • Refactored player weight and cart weight calculations into their own functions.
  • Added script commands openstorage2 (for premium Storages), guildstoragecountitem[2] and guildstoragedelitem[2].
  • Refactored several function return types as well as documentation.
Quote

*guildstoragecountitem(<nameID>{,<accountID>})
*guildstoragecountitem("<item name>"{,<accountID>})

This command behaves identically to 'countitem', but counts items from the player's
cart, storage, or guild storage.

If no cart is mounted, 'cartcountitem' will return -1.
If player is not in a guild or storage is open, 'guildstoragecountitem' will return -1.


---------------------------------------

*guildstoragecountitem2(<nameID>,<Identified>,<Refine>,<Attribute>,<Card0>,<Card1>,<Card2>,<Card3>{,<accountID>})
*guildstoragecountitem2("<item name>",<Identified>,<Refine>,<Attribute>,<Card0>,<Card1>,<Card2>,<Card3>{,<accountID>})

This command behaves identically to 'countitem2', but counts items from the player's
cart, storage, or guild storage.

If no cart is mounted, 'cartcountitem2' will return -1.
If player is not in a guild or storage is open, 'guildstoragecountitem2' will return -1.

---------------------------------------

*guildstoragedelitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
*guildstoragedelitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};

This command behaves identically to 'delitem2', but deletes items from the player's
cart, storage, or guild storage.

If no cart is mounted, 'cartdelitem2' will return -1.
If player is not in a guild or storage is open, 'guildstoragedelitem2' will return -1.

---------------------------------------

*openstorage2 <storage_id>,<mode>{,<account_id>};

Just like the 'openstorage' command, except this command can open additional storages
by the specified <storage_id>. For <storage_id>, please read the conf/inter_server.conf
for storage groups.

Values for <mode> are:
    STOR_MODE_NONE : Player only can read the storage entries.
    STOR_MODE_GET  : Player can get items from the storage.
    STOR_MODE_PUT  : Player can put items in the storage.

Example:
    if (vip_status(1)) {
        mes "I will open your Premium storage.";
        mes "Thank you for using our service.";
        close2;
        openstorage2 1,STOR_MODE_GET|STOR_MODE_PUT;
    } else {
        mes "Sorry, your Premium status is expired.";
        mes "Storage will be opened but you can't put any item into it.";
        close2;
        openstorage2 1,STOR_MODE_GET;
    }
    end;

Thanks to @Cydh for his work on the Premium Storage support and thanks to @Lighta for the initial support on creating the cleanup. Thanks to everyone else who tested the PR and helped it come to fruition!

storage-normal.jpg

storage-premium.jpg

storage-vip.jpg

  • Upvote 13

Share this post


Link to post
Share on other sites

Didn't we plan to make this as Xmas Nightmare bundle? /heh

From my comment at Pull: 1620#issuecomment-253699196

Sample to use the 'premium' storage

conf/inter_server.conf

 
storages: (
{
    // Default storage
    // DO NOT CHANGE THIS EXCEPT YOU KNOW WHAT YOU ARE DOING
    id: 0
    name: "Storage"
    table: "storage"
    //max: 600
}
,{
    id: 1
    name: "Premium"
    table: "storage_1"
    max: 100
}
,{
    id: 2
    name: "VIP"
    table: "storage_2"
    max: 300
}
)

 

Sample NPC

 
prontera,146,162,5  script  Premium Kafra#prt   4_F_KAFRA4,{
    mes "[ Kafra ]";
    mes "Which storage do you want to open?";
    next;
    switch(select("Normal Storage","Premium Storage","VIP Storage")) {
        case 1:
            mes "[ Kafra ]";
            mes "Storage will be opened. Thank you";
            close2;
            openstorage;
            break;
        case 2:
            mes "[ Kafra ]";
            mes "Premium storage will be opened";
            close2;
            openstorage2(1,STOR_MODE_GET|STOR_MODE_PUT);
            break;
        case 3:
            mes "[ Kafra ]";
            if (vip_status(1)) {
                [email protected] = STOR_MODE_GET|STOR_MODE_PUT;
                mes "VIP will be opened. Thank you";
            } else {
                [email protected] = STOR_MODE_GET;
                mes "Seems you're no longer VIP anymore. You only can take the items.";
            }
            close2;
            openstorage2(2,[email protected]);
            break;
    }
    end;
}

Extra

 

Leaving comment here so people will easier if want to give me rep too

/gg

  • Upvote 14

Share this post


Link to post
Share on other sites

It ended up being an early Christmas gift. :)

  • Upvote 1

Share this post


Link to post
Share on other sites

That's pretty neat!

 

 

57 68 65 6e 20 72 69 63 68 2c 20 74 68 69 6e 6b 20 6f 66 20 70 6f 76 65 72 74 79 2c 20 62 75 74 20 64 6f 6e 27 74 20 74 68 69 6e 6b 20 6f 66 20 72 69 63 68 65 73 20 77 68 65 6e 20 79 6f 75 20 61 72 65 20 70 6f 6f 72

Share this post


Link to post
Share on other sites

I really like this kind of VIP system.. thanks guys!

Share this post


Link to post
Share on other sites

Nice to see it finally release =) you guys did a tons of job on it ;)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...