Cydh Posted February 1, 2013 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Share Posted February 1, 2013 (edited) Infromation I know rAthena has @itemlist and gives us item list of certain player, but, how if I just want to know how many a player has Red Potion (for example) in the inventory, or storage, or maybe cart? @countitem used to count how many item in player's inventory @storagecountitem used to count how many item in player's storage @cartcountitem used to count how many item in player's cart How to use? @countitem <item_id>#countitem <player> <item_id> @storagecountitem <item_id>#storagecountitem <player> <item_id> @cartcountitem <item_id>#cartcountitem <player> <item_id> CompabilityI made this on rAthena 17101Screenshots**soon**Download at_countitem-rA-svn17138.patch Sorry for previous version, I think there were some mistakes .patch lines **If you guys like this, rate this post and give me rep +1 haha** Edited February 19, 2013 by Cydh 2 Quote Link to comment Share on other sites More sharing options...
Zopokx Posted February 1, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 22 Reputation: 4 Joined: 01/09/13 Last Seen: November 13, 2022 Share Posted February 1, 2013 Nice idea! Quote Link to comment Share on other sites More sharing options...
Cydh Posted February 1, 2013 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Author Share Posted February 1, 2013 Nice idea! thank's haha Quote Link to comment Share on other sites More sharing options...
Cydh Posted February 19, 2013 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Author Share Posted February 19, 2013 (edited) ---- bump for revision as update Edited February 19, 2013 by Cydh Quote Link to comment Share on other sites More sharing options...
Lighta Posted February 20, 2013 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 February 20, 2013 didn't saw that but I like the coding style, I may try it and review what we got to integrate it. nb : script would probably need them too. Quote Link to comment Share on other sites More sharing options...
Cydh Posted February 20, 2013 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Author Share Posted February 20, 2013 didn't saw that but I like the coding style, I may try it and review what we got to integrate it. nb : script would probably need them too. yeah, maybe need to be improvised. hmm, what's script? storagecountitem(<item_id>)? cartcountitem(<item_id>)? Quote Link to comment Share on other sites More sharing options...
Lighta Posted February 20, 2013 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 February 20, 2013 yes even tough not sure I really like the nomenclature of this. They must be kinda similar from script and atcommand (name) but we also don't want lot of script function atm. (well it's a same a flag could do the job). Think something more generic would be @countitem,@countitemstorage,@countitemcart,@countitemguildsto name doesn't matter that much for atcommand since we could do alias, but they more regxy like that and easier to maintain for script. (guildsto is similar to cart, if(sd as guildid)) countitem(id,{loc,sd}) with sd and loc optional, only bad part on this is for a regular countitem on a particular sd you'll need something like countitem(apple,0,lighta). now do we do each small to link to tht generic hmm ? Quote Link to comment Share on other sites More sharing options...
Cydh Posted February 20, 2013 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Author Share Posted February 20, 2013 yeah, because I made the countitem and delitem extension script first (someone asked on eAthena forum), then I remove them (I don't know why, LOL) and make the atcommand. for script... my first idea was, using current countitem(<item_id>) then edit it becomes countitem(<item_id>{,<loc>}{,<aid>}). aid = account_id will be sd and also for delitem(<item id>,<amount>{,<account ID>}) will be delitem(<item_id>,<amount>{,<loc>}{,<aid>}) loc are inventory, cart, storage, also guild storage (maybe). I'd like location first to check then using sd first, because if using atcommand, sd is the command user, countitem(id,{loc,sd}), if sd can be guildid we assume loc : 0=inventory, 1=cart, 2=storage, 3=guild countitem (apple,3,guildid) ==> check apple from 3 with guild_id == guildid. Any chance player as member of 2 guilds? for atcommand yeah, naming is doesn't matter, just make a user friendly name and for aid/cid/name for sd, sd will be taken from command user @countcartitem apple cydh just like @cartcountitem apple and for other player can use charcommand, right? #cartcountitem cydh apple I didn't want to make some problem at first made, that why separate them all. haha well, so here, we will concern about the scripts first, for countitem? Quote Link to comment Share on other sites More sharing options...
Lighta Posted February 20, 2013 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 February 20, 2013 ye the atcommand is fine, issue is more to kinda define a pattern to we don't have script growing in every direction. yep sd was just to said player we could found them by name wich is fine for atcommand or (char_id). Atm no it's not possible for a player to have multiple guilde so it's fine to do it. If there was a change I believe we could extra location for guild2 guild3 etc, assuming they sorted... (anyway let's not bother with this yet). Last note is that for script even if we could resolde sd with nick I prefer via charid, but we could add both methode for flexibility. we tought same thing for loc =) Quote Link to comment Share on other sites More sharing options...
Cydh Posted February 20, 2013 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Author Share Posted February 20, 2013 (edited) hmm, AID, map_id2sd() need AID, not CID. and when use AID, map_id2sd() will find the online sd based on AID, only 1 online AID at same time right? well, I think I make new release post about modified countitem <item_id> becomes countitem <item_id/"item_name">{,<location>}{,<AID/"nick">} first, and you can review the source, regarding this post is talking about atcommand, don't want to 'out-of-topic'.. haha @topic, I didn't make countitem for guild storage becase, as far as I know to access guild storage, player has to open guild storage first. example on @cleargstorage's lines gstorage = guild2storage2(sd->status.guild_id); if (gstorage == NULL) {// Doesn't have opened @gstorage yet, so we skip the deletion since *shouldn't* have any item there. return -1; } Edited February 21, 2013 by Cydh 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.