Aleos Posted November 14, 2016 Group: Development Manager Topic Count: 56 Topics Per Day: 0.01 Content Count: 732 Reputation: 525 Joined: 12/13/11 Last Seen: June 13, 2024 Share Posted November 14, 2016 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! 14 Quote Link to comment Share on other sites More sharing options...
Popular Post Cydh Posted November 14, 2016 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 747 Joined: 06/16/12 Last Seen: February 21 Popular Post Share Posted November 14, 2016 Didn't we plan to make this as Xmas Nightmare bundle? 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)) { .@mode = STOR_MODE_GET|STOR_MODE_PUT; mes "VIP will be opened. Thank you"; } else { .@mode = STOR_MODE_GET; mes "Seems you're no longer VIP anymore. You only can take the items."; } close2; openstorage2(2,.@mode); break; } end; } Extra Leaving comment here so people will easier if want to give me rep too 17 Quote Link to comment Share on other sites More sharing options...
Aleos Posted November 15, 2016 Group: Development Manager Topic Count: 56 Topics Per Day: 0.01 Content Count: 732 Reputation: 525 Joined: 12/13/11 Last Seen: June 13, 2024 Author Share Posted November 15, 2016 It ended up being an early Christmas gift. 1 Quote Link to comment Share on other sites More sharing options...
Fratini Posted November 16, 2016 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 153 Reputation: 8 Joined: 07/01/14 Last Seen: May 3, 2018 Share Posted November 16, 2016 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 Quote Link to comment Share on other sites More sharing options...
Radian Posted January 7, 2017 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Share Posted January 7, 2017 I really like this kind of VIP system.. thanks guys! Quote Link to comment Share on other sites More sharing options...
Lighta Posted January 9, 2017 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 737 Reputation: 216 Joined: 11/29/11 Last Seen: December 20, 2020 Share Posted January 9, 2017 Nice to see it finally release =) you guys did a tons of job on it Quote Link to comment Share on other sites More sharing options...
casper Posted March 2, 2023 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 38 Reputation: 2 Joined: 02/15/13 Last Seen: Monday at 03:09 PM Share Posted March 2, 2023 Nice to see it finally release = thankyou Quote Link to comment Share on other sites More sharing options...
hendra814 Posted March 17, 2023 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 1281 Reputation: 170 Joined: 06/12/12 Last Seen: 1 hour ago Share Posted March 17, 2023 can't find inter_server.conf. is it change into inter_server.yml ? Quote Link to comment Share on other sites More sharing options...
LearningRO Posted March 21, 2023 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 2 hours ago Share Posted March 21, 2023 On 3/17/2023 at 9:00 PM, hendra814 said: can't find inter_server.conf. is it change into inter_server.yml ? yes new emu moved into inter_server.yml for new storage Quote Link to comment Share on other sites More sharing options...
hendra814 Posted March 21, 2023 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 1281 Reputation: 170 Joined: 06/12/12 Last Seen: 1 hour ago Share Posted March 21, 2023 13 hours ago, LearningRO said: yes new emu moved into inter_server.yml for new storage thanks, but getting error when try the npc Quote [Error]: intif_parse_StorageReceived: Failed to load! (AID: 2000000, type: 3) here my inter_server.yml # Config for Storages # # To access the premium storage, use script command 'openstorage2'. # If premium storages are added, copy the structure of the storage table and match the table name in this config. # The 'max' of premium storages are not adjusted by 'vip_storage_increase' config nor MIN_STORAGE. # # Structure: # - ID: <storage_id> // (int) Storage ID will be used for script command 'openstorage2'. # Name: "<storage name>" // (string) Storage name will be sent to the client to display on the title bar. # Table: "<storage_table>" // (string) Name of table where storage is saved. The table stucture is the same as the default storage table. # Max: <max_amount> // (int) *optional* Maximum number of items in storage. MAX_STORAGE will be used if no value is defined. ############################################################################################################################################### Header: Type: INTER_SERVER_DB Version: 1 Body: - ID: 1 Name: "Personal" Table: "storage_1" Max: 100 - ID: 2 Name: "VIP Storage" Table: "vip_storage" Max: 300 and here the npc script Welgaia,151,125,4 script storage 94,{ mes "[ Kafra ]"; mes "Which storage do you want to open?"; next; switch(select("Personal Storage","VIP Storage")) { case 1: mes "[ Kafra ]"; mes "Premium storage will be opened"; close2; openstorage2(1,STOR_MODE_GET|STOR_MODE_PUT); break; case 2: mes "[ Kafra ]"; if (vip_status(1)) { .@mode = STOR_MODE_GET|STOR_MODE_PUT; mes "VIP will be opened. Thank you"; } else { .@mode = STOR_MODE_GET; mes "Seems you're no longer VIP anymore. You only can take the items."; } close2; openstorage2(2,.@mode); break; } end; } Is this need sql update for create new storage table? Because from Cydh example don't have information for sql part. Quote Link to comment Share on other sites More sharing options...
LearningRO Posted March 21, 2023 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 2 hours ago Share Posted March 21, 2023 already add new table on database? storage_1 vip_storage Quote Link to comment Share on other sites More sharing options...
hendra814 Posted March 21, 2023 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 1281 Reputation: 170 Joined: 06/12/12 Last Seen: 1 hour ago Share Posted March 21, 2023 (edited) 8 minutes ago, LearningRO said: already add new table on database? storage_1 vip_storage Not yet, i don't know to create it. can i use this sql script to create it? this is from my collection script personal storage. CREATE TABLE IF NOT EXISTS `storage_char_0` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `account_id` int(11) unsigned NOT NULL DEFAULT '0', `nameid` smallint(5) unsigned NOT NULL DEFAULT '0', `amount` smallint(11) unsigned NOT NULL DEFAULT '0', `equip` int(11) unsigned NOT NULL DEFAULT '0', `identify` smallint(6) unsigned NOT NULL DEFAULT '0', `refine` tinyint(3) unsigned NOT NULL DEFAULT '0', `attribute` tinyint(4) unsigned NOT NULL DEFAULT '0', `card0` smallint(5) unsigned NOT NULL DEFAULT '0', `card1` smallint(5) unsigned NOT NULL DEFAULT '0', `card2` smallint(5) unsigned NOT NULL DEFAULT '0', `card3` smallint(5) unsigned NOT NULL DEFAULT '0', `option_id0` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val0` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm0` tinyint(3) unsigned NOT NULL DEFAULT '0', `option_id1` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val1` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm1` tinyint(3) unsigned NOT NULL DEFAULT '0', `option_id2` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val2` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm2` tinyint(3) unsigned NOT NULL DEFAULT '0', `option_id3` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val3` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm3` tinyint(3) unsigned NOT NULL DEFAULT '0', `option_id4` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val4` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm4` tinyint(3) unsigned NOT NULL DEFAULT '0', `expire_time` int(11) unsigned NOT NULL DEFAULT '0', `bound` tinyint(3) unsigned NOT NULL DEFAULT '0', `unique_id` bigint(20) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `account_id` (`account_id`) ) ENGINE=MyISAM AUTO_INCREMENT=3169 DEFAULT CHARSET=utf8; Edited March 21, 2023 by hendra814 Quote Link to comment Share on other sites More sharing options...
LearningRO Posted March 21, 2023 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 2 hours ago Share Posted March 21, 2023 8 minutes ago, hendra814 said: Not yet, i don't know to create it. can i use this sql script to create it? this is from my collection script personal storage. CREATE TABLE IF NOT EXISTS `storage_char_0` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `account_id` int(11) unsigned NOT NULL DEFAULT '0', `nameid` smallint(5) unsigned NOT NULL DEFAULT '0', `amount` smallint(11) unsigned NOT NULL DEFAULT '0', `equip` int(11) unsigned NOT NULL DEFAULT '0', `identify` smallint(6) unsigned NOT NULL DEFAULT '0', `refine` tinyint(3) unsigned NOT NULL DEFAULT '0', `attribute` tinyint(4) unsigned NOT NULL DEFAULT '0', `card0` smallint(5) unsigned NOT NULL DEFAULT '0', `card1` smallint(5) unsigned NOT NULL DEFAULT '0', `card2` smallint(5) unsigned NOT NULL DEFAULT '0', `card3` smallint(5) unsigned NOT NULL DEFAULT '0', `option_id0` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val0` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm0` tinyint(3) unsigned NOT NULL DEFAULT '0', `option_id1` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val1` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm1` tinyint(3) unsigned NOT NULL DEFAULT '0', `option_id2` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val2` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm2` tinyint(3) unsigned NOT NULL DEFAULT '0', `option_id3` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val3` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm3` tinyint(3) unsigned NOT NULL DEFAULT '0', `option_id4` smallint(5) unsigned NOT NULL DEFAULT '0', `option_val4` smallint(5) unsigned NOT NULL DEFAULT '0', `option_parm4` tinyint(3) unsigned NOT NULL DEFAULT '0', `expire_time` int(11) unsigned NOT NULL DEFAULT '0', `bound` tinyint(3) unsigned NOT NULL DEFAULT '0', `unique_id` bigint(20) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `account_id` (`account_id`) ) ENGINE=MyISAM AUTO_INCREMENT=3169 DEFAULT CHARSET=utf8; just dummy from storage table and rename with same name in your config inter_server.yml Quote Link to comment Share on other sites More sharing options...
hendra814 Posted March 21, 2023 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 1281 Reputation: 170 Joined: 06/12/12 Last Seen: 1 hour ago Share Posted March 21, 2023 5 minutes ago, LearningRO said: just dummy from storage table and rename with same name in your config inter_server.yml ok done, copy from storage sql into storage_1 and vip_storage. now i can open the new storage service Thanks you for the information Quote Link to comment Share on other sites More sharing options...
LearningRO Posted March 21, 2023 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 2 hours ago Share Posted March 21, 2023 1 hour ago, hendra814 said: ok done, copy from storage sql into storage_1 and vip_storage. now i can open the new storage service Thanks you for the information ur welcome Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.