Secrets Posted January 22, 2017 Group: Developer Topic Count: 36 Topics Per Day: 0.01 Content Count: 587 Reputation: 431 Joined: 01/26/16 Last Seen: Saturday at 08:22 AM Share Posted January 22, 2017 This mod was ported from a Hercules plugin by @bio which can be found here. Thank you for the great idea. This mod implements a new script command called `sellitem` which works just like `callshop`, but only for selling items. This command has an ability to filter out unwanted items that you don't want to display in selling shop. Quote Command usage: sellitem "<shopname">,<type>,<param>{,<overcharge>}; The <type> parameter is for specifying the filter type. SFT_TYPE - Type filter SFT_ID - ID filter Item type filter hides every item that isn't of type specified in <param> parameter. You can set nth bit of <param> to allow certain item type to be displayed. Where n is an item type's numerical value. See src/map/script_constants.h for more info. Item ID filter hides every item whose ID isn't equal to <param>. <Overcharge> parameter controls whether overcharge skill will affect item value display in the window. Example usages: mes "[ Jellopy Lover ]"; mes "I buy Jellopy for 50 Poring coins each."; close2; npcshopattach "JellopyShop"; sellitem "JellopyShop",SFT_ID,909; end; mes "[ Rare Items Collector ]"; mes "Sell me some rare items and cards"; close2; .@filter |= 1 << IT_CARD; .@filter |= 1 << IT_ARMOR; .@filter |= 1 << IT_WEAPON; npcshopattach "CardShop"; sellitem "CardShop",SFT_TYPE,.@filter; end; DOWNLOAD THE DIFF FILE 6 Quote Link to comment Share on other sites More sharing options...
Deleted User Posted January 22, 2017 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 235 Reputation: 55 Joined: 12/02/11 Last Seen: February 26, 2021 Share Posted January 22, 2017 Hi, Secret thank you for porting this from rAthena this is very useful command. i have a question so im able to get support on this? since yours is working fine. my emulator is kinda old around June 2016. When i recompile my rAthena it gives me error. Severity Code Description Project File Line Suppression State Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19095 Warning C4047 'function': 'int' differs in levels of indirection from 'bool (__cdecl *)(item_data *,int,int)' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Warning C4047 'function': 'item *' differs in levels of indirection from 'int' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19099 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19103 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19114 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19117 Warning C4024 'itemdb_isrestricted': different types for formal and actual parameter 1 map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Warning C4024 'itemdb_isrestricted': different types for formal and actual parameter 3 map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error C2198 'itemdb_isrestricted': too few arguments for call map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error C2198 'itemdb_search': too few arguments for call map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19099 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19095 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19099 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19103 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19114 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19117 Thank you in advanced! i appreciate it. Quote Link to comment Share on other sites More sharing options...
Secrets Posted January 22, 2017 Group: Developer Topic Count: 36 Topics Per Day: 0.01 Content Count: 587 Reputation: 431 Joined: 01/26/16 Last Seen: Saturday at 08:22 AM Author Share Posted January 22, 2017 1 hour ago, Kaze said: Hi, Secret thank you for porting this from rAthena this is very useful command. i have a question so im able to get support on this? since yours is working fine. my emulator is kinda old around June 2016. When i recompile my rAthena it gives me error. Severity Code Description Project File Line Suppression State Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19095 Warning C4047 'function': 'int' differs in levels of indirection from 'bool (__cdecl *)(item_data *,int,int)' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Warning C4047 'function': 'item *' differs in levels of indirection from 'int' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19099 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19103 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19114 Error C2039 'inventory': is not a member of 'map_session_data' map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19117 Warning C4024 'itemdb_isrestricted': different types for formal and actual parameter 1 map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Warning C4024 'itemdb_isrestricted': different types for formal and actual parameter 3 map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error C2198 'itemdb_isrestricted': too few arguments for call map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error C2198 'itemdb_search': too few arguments for call map-server C:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19099 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19095 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19099 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19103 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19111 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19114 Error (active) struct "map_session_data" has no field "inventory" map-server c:\Users\Administrator\Desktop\Test-Server\src\map\clif.c 19117 Thank you in advanced! i appreciate it. Replace all sd->inventory.u.items_inventory to sd->status.inventory Quote Link to comment Share on other sites More sharing options...
Deleted User Posted January 22, 2017 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 235 Reputation: 55 Joined: 12/02/11 Last Seen: February 26, 2021 Share Posted January 22, 2017 @Secrets Thanks a lot i appreciate it. Quote Link to comment Share on other sites More sharing options...
Johnson Posted February 20 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 23 Reputation: 1 Joined: 08/22/18 Last Seen: March 20 Share Posted February 20 How do we append multiple item ids if SFT_ID sellitem "egglog_shop",SFT_ID,501,502,503,504; or sellitem "egglog_shop",SFT_ID,.samplearray[.@i]; Quote Link to comment Share on other sites More sharing options...
botka4aet Posted February 20 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 211 Reputation: 17 Joined: 12/23/11 Last Seen: April 28 Share Posted February 20 1 hour ago, Johnson said: How do we append multiple item ids if SFT_ID sellitem "egglog_shop",SFT_ID,.samplearray[.@i]; dunno void clif_sellitem(struct map_session_data* sd, enum sellitem_filter_type type, int param[], bool discount) { case SFT_ID: if !(contains(param,sd->inventory.u.items_inventory[i].nameid) continue; break; Quote Link to comment Share on other sites More sharing options...
playniks Posted March 28 Group: Members Topic Count: 12 Topics Per Day: 0.03 Content Count: 45 Reputation: 2 Joined: 02/23/23 Last Seen: 6 minutes ago Share Posted March 28 Hello is this still working in latest Rathena? Quote Link to comment Share on other sites More sharing options...
Rynbef Posted March 28 Group: Forum Moderator Topic Count: 44 Topics Per Day: 0.01 Content Count: 898 Reputation: 120 Joined: 05/23/12 Last Seen: May 2 Share Posted March 28 I think u have to add it manually and try it. Rynbef~ Quote Link to comment Share on other sites More sharing options...
Dev j Posted March 28 Group: Members Topic Count: 17 Topics Per Day: 0.05 Content Count: 79 Reputation: 1 Joined: 06/22/23 Last Seen: 10 hours ago Share Posted March 28 (edited) Hello can you please update this @Secrets not working on latest rev Edited March 28 by Dev j Quote Link to comment Share on other sites More sharing options...
Rynbef Posted March 28 Group: Forum Moderator Topic Count: 44 Topics Per Day: 0.01 Content Count: 898 Reputation: 120 Joined: 05/23/12 Last Seen: May 2 Share Posted March 28 It the most u add it manually and the console output should give small introduction what's wrong. I'm crtly can't help by src modifications. Sry Rynbef~ Quote Link to comment Share on other sites More sharing options...
playniks Posted March 29 Group: Members Topic Count: 12 Topics Per Day: 0.03 Content Count: 45 Reputation: 2 Joined: 02/23/23 Last Seen: 6 minutes ago Share Posted March 29 (edited) Hi I try to add it manual but is having only 1 error. Clif_Sellitem doesn't seem to be working as per the screenshot shows. How to solve this? Edited March 29 by playniks Quote Link to comment Share on other sites More sharing options...
Outlook Posted March 29 Group: Members Topic Count: 25 Topics Per Day: 0.04 Content Count: 64 Reputation: 5 Joined: 07/10/22 Last Seen: Tuesday at 08:21 AM Share Posted March 29 I found error. Quote Link to comment Share on other sites More sharing options...
pajodex Posted March 29 Group: Members Topic Count: 78 Topics Per Day: 0.03 Content Count: 436 Reputation: 167 Joined: 12/12/17 Last Seen: Yesterday at 09:38 AM Share Posted March 29 I have updated it somehow. I don't know how I did but I did. Since this is a free release, here is the one I was able to update: 0001-sellitem-diff.patch Don't ask for support from me. Im not sure how stable this is but so far its working on my end. Quote Link to comment Share on other sites More sharing options...
Outlook Posted March 29 Group: Members Topic Count: 25 Topics Per Day: 0.04 Content Count: 64 Reputation: 5 Joined: 07/10/22 Last Seen: Tuesday at 08:21 AM Share Posted March 29 5 hours ago, pajodex said: I have updated it somehow. I don't know how I did but I did. Since this is a free release, here is the one I was able to update: 0001-sellitem-diff.patch Don't ask for support from me. Im not sure how stable this is but so far its working on my end. Thank you it's works fine but can't use NPC Script mes "[ Jellopy Lover ]"; mes "I buy Jellopy for 50 Poring coins each."; close2; npcshopattach "JellopyShop"; sellitem "JellopyShop",SFT_ID,909; end; mes "[ Rare Items Collector ]"; mes "Sell me some rare items and cards"; close2; .@filter |= 1 << IT_CARD; .@filter |= 1 << IT_ARMOR; .@filter |= 1 << IT_WEAPON; npcshopattach "CardShop"; sellitem "CardShop",SFT_TYPE,.@filter; end; Quote Link to comment Share on other sites More sharing options...
pajodex Posted March 29 Group: Members Topic Count: 78 Topics Per Day: 0.03 Content Count: 436 Reputation: 167 Joined: 12/12/17 Last Seen: Yesterday at 09:38 AM Share Posted March 29 15 minutes ago, Outlook said: Thank you it's works fine but can't use NPC Script mes "[ Jellopy Lover ]"; mes "I buy Jellopy for 50 Poring coins each."; close2; npcshopattach "JellopyShop"; sellitem "JellopyShop",SFT_ID,909; end; mes "[ Rare Items Collector ]"; mes "Sell me some rare items and cards"; close2; .@filter |= 1 << IT_CARD; .@filter |= 1 << IT_ARMOR; .@filter |= 1 << IT_WEAPON; npcshopattach "CardShop"; sellitem "CardShop",SFT_TYPE,.@filter; end; Your console error tells you the problem Quote Link to comment Share on other sites More sharing options...
Outlook Posted March 29 Group: Members Topic Count: 25 Topics Per Day: 0.04 Content Count: 64 Reputation: 5 Joined: 07/10/22 Last Seen: Tuesday at 08:21 AM Share Posted March 29 27 minutes ago, pajodex said: Your console error tells you the problem Do you have Example Npc script. 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.