Cydh

'flag' at Shop to disable Discount & Overcharge

Recommended Posts

Just a simple modification to enable/disable Discount or Overcharge on specified NPC Shop.
Maybe the idea was brought from Shop System and my old commit about "disable" discount for point & item shop.
 
It just simple touch, add optional flag at very last of NPC shop line.

-%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}{,<flag>}
<map name>,<x>,<y>,<facing>%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}{,<flag>}

<map name>,<x>,<y>,<facing>%TAB%marketshop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>:<quantity>{,<itemid>:<price>:<quantity>...}{,<flag>}

 
If the flag isn't set, it doesn't bother any default NPC.
 
Flag
0x1 = Disable Discount
0x2 = Disable Overcharge

If unset, Discount and Overcharge are enabled (if available)
 
Examples
Discount & Overcharge are disabled here

prontera,147,167,6	shop	Shop 1	872,2102:-1,2104:-1,501:-1,3

Overcharge is disabled

prontera,147,164,6	shop	Shop 2	872,2102:-1,2104:-1,501:-1,2

Discount is disabled

prontera,147,161,6	shop	Shop 3	872,2102:-1,2104:-1,501:-1,1

When file is loaded with that flag, you will get this Info

 

Download

Screenshot_30.png

Edited by Cydh
  • Upvote 1
  • Love 1

Share this post


Link to post
Share on other sites

Just a simple modification to enable/disable Discount or Overcharge on specified NPC Shop.

Maybe the idea was brought from Shop System and my old commit about "disable" discount for point & item shop.

 

It just simple touch, add optional flag at very last of NPC shop line.

-%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}{,<flag>}

<map name>,<x>,<y>,<facing>%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}{,<flag>}

 

If the flag isn't set, it doesn't bother any default NPC.

 

Flag

1 = Disable Discount

2 = Disable Overcharge

 

Examples

Discount & Overcharge are disabled here

prontera,147,167,6	shop	Shop 1	872,2102:-1,2104:-1,501:-1,3

Overcharge is disabled

prontera,147,164,6	shop	Shop 2	872,2102:-1,2104:-1,501:-1,2

Discount is disabled

prontera,147,161,6	shop	Shop 3	872,2102:-1,2104:-1,501:-1,1

When file is loaded with that flag, you will get this Info

attachicon.gifScreenshot_30.png

 

Download

Ahh sorry, from now, I think I just throw my modification on my fork (under PServeRO account), it'll easier for me to update some mode later.

https://github.com/pservero/rathena/compare/custom/shop_flag

Diff: https://github.com/pservero/rathena/compare/custom/shop_flag.diff

This is a very nice release but I think it would be better as a default feature in rA :P

Share this post


Link to post
Share on other sites

Just a simple modification to enable/disable Discount or Overcharge on specified NPC Shop.

Maybe the idea was brought from Shop System and my old commit about "disable" discount for point & item shop.

 

It just simple touch, add optional flag at very last of NPC shop line.

-%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}{,<flag>}

<map name>,<x>,<y>,<facing>%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}{,<flag>}

 

If the flag isn't set, it doesn't bother any default NPC.

 

Flag

1 = Disable Discount

2 = Disable Overcharge

 

Examples

Discount & Overcharge are disabled here

prontera,147,167,6	shop	Shop 1	872,2102:-1,2104:-1,501:-1,3

Overcharge is disabled

prontera,147,164,6	shop	Shop 2	872,2102:-1,2104:-1,501:-1,2

Discount is disabled

prontera,147,161,6	shop	Shop 3	872,2102:-1,2104:-1,501:-1,1

When file is loaded with that flag, you will get this Info

attachicon.gifScreenshot_30.png

 

Download

Ahh sorry, from now, I think I just throw my modification on my fork (under PServeRO account), it'll easier for me to update some mode later.

https://github.com/pservero/rathena/compare/custom/shop_flag

Diff: https://github.com/pservero/rathena/compare/custom/shop_flag.diff

 

 

Cyd, can you also release for eA? please :)

Edited by Reducto

Share this post


Link to post
Share on other sites

This is a very nice release but I think it would be better as a default feature in rA :P

Then open a new post on Source Discussion and hear what people say.

 

 

Cyd, can you also release for eA? please :)

hmm, try patch it manually yourself, it should be easy. :P

Share this post


Link to post
Share on other sites

 

This is a very nice release but I think it would be better as a default feature in rA :P

Then open a new post on Source Discussion and hear what people say.

 

 

Cyd, can you also release for eA? please :)

hmm, try patch it manually yourself, it should be easy. :P

 

 

Hello, I tried to patch it manually. But, there are a lot of errors while compiling. Please make a patch for eA. :(

Share this post


Link to post
Share on other sites

Svn 17704 erro

Error	1	error C2065: 'nameid2' : undeclared identifier	c:\users\admin\desktop\rathena\src\map\npc.c	2462	1	map-server_sql

Share this post


Link to post
Share on other sites

Work in cashshop ??

prontera,147,161,6	cashshop Shop 3	872,2102:-1,2104:-1,501:-1,1

Share this post


Link to post
Share on other sites

thank you.


please help error

1>c:\users\pc\desktop\server\rathena-master\src\map\clif.c(1784): error C2065: 'SHOP' : undeclared identifier
1>c:\users\pc\desktop\server\rathena-master\src\map\clif.c(1817): error C2065: 'SHOP' : undeclared identifier

1>c:\users\pc\desktop\server\rathena-master\src\map\npc.c(1606): error C2065: 'SHOP' : undeclared identifier
1>c:\users\pc\desktop\server\rathena-master\src\map\npc.c(1606): error C2065: 'SHOP' : undeclared identifier
1>c:\users\pc\desktop\server\rathena-master\src\map\npc.c(1831): error C2065: 'SHOP' : undeclared identifier
1>c:\users\pc\desktop\server\rathena-master\src\map\npc.c(1831): error C2065: 'SHOP' : undeclared identifier

Share this post


Link to post
Share on other sites

Errors During Recompile:
 

clif.c: In function 'clif_buylist':
clif.c:1784: error: 'SHOP' undeclared (first use in this function)
clif.c:1784: error: (Each undeclared identifier is reported only once
clif.c:1784: error: for each function it appears in.)
clif.c: In function 'clif_selllist':
clif.c:1819: error: 'SHOP' undeclared (first use in this function)
make[1]: Leaving directory `/home/.........../src/map'
make[1]: *** [obj/clif.o] Error 1
make: *** [map] Error 2
Edited by Phenex

Share this post


Link to post
Share on other sites

change SHOP to NPCTYPE_SHOP

Share this post


Link to post
Share on other sites

[Info]: Shop at 'npc/Baphomet-RO/Scripts_Shop/Shop Armor.txt#L114' Discount: YES, Overcharge: YES.
[Info]: Shop at 'npc/Baphomet-RO/Scripts_Shop/Shop Armor.txt#L115' Discount: YES, Overcharge: NO.
[Info]: Shop at 'npc/Baphomet-RO/Scripts_Shop/Shop Armor.txt#L116' Discount: YES, Overcharge: NO.
 

 

 

prontera,147,167,6    shop    Shop 1    872,2102:-1,2104:-1,501:-1,3
prontera,147,164,6    shop    Shop 2    872,2102:-1,2104:-1,501:-1,2
prontera,147,162,6    shop    Shop 3    872,2102:-1,2104:-1,501:-1,1

 

I set this value, but Discount NO

 

Discount NO not working

Share this post


Link to post
Share on other sites
Posted (edited)

        CXX     clif.cpp
clif.cpp: In function 'void clif_selllist(map_session_data*, npc_data*)':
clif.cpp:2013:19: error: declaration of 'npc_data* nd' shadows a parameter
  struct npc_data *nd;
                   ^~
make[1]: *** [obj/clif.o] Error 1

any fix?


i think this make your diff fail
https://github.com/rathena/rathena/commit/3e1105b0cf8380b4e4646800305b59c3de0f96ea#diff-c5d5e782db2344e04a7089b24ba6c962

Edited by pedroppb

Share this post


Link to post
Share on other sites

lol i fixed,

1 hour ago, pedroppb said:

        CXX     clif.cpp
clif.cpp: In function 'void clif_selllist(map_session_data*, npc_data*)':
clif.cpp:2013:19: error: declaration of 'npc_data* nd' shadows a parameter
  struct npc_data *nd;
                   ^~
make[1]: *** [obj/clif.o] Error 1

any fix?


i think this make your diff fail
https://github.com/rathena/rathena/commit/3e1105b0cf8380b4e4646800305b59c3de0f96ea#diff-c5d5e782db2344e04a7089b24ba6c962

lol i fixed by accident,
in clif.cpp diff change the void to
void clif_selllist(struct map_session_data *sd, struct npc_data *nd)

but after updates rathena puts "struct npc_data *nd" inside making the diff finish with this code

void clif_selllist(struct map_session_data *sd, struct npc_data *nd)
{
    int fd,i,c=0,val;
    struct npc_data *nd;

and giving error when compiles, because  "struct npc_data *nd" is inside, and parameter,

i just removed the line inside.

tested and work 100%

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...