Jump to content
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 2
  • Love 2
Link to comment
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

Link to comment
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
Link to comment
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
Link to comment
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. :(

Link to comment
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
Link to comment
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
Link to comment
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

Link to comment
Share on other sites

        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,

On 6/17/2019 at 4:05 AM, 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%

Edited by pedroppb
Link to comment
Share on other sites

doesnt work anymore because of the update in npc_shop_discount() **** BUT MANAGE TO FIX JUST COMMENT THAT ONE

old : bool npc_shop_discount(enum npc_subtype type, bool discount) {

new : bool npc_shop_discount( struct npc_data* nd ){

manage to fix i guess just comment out this one.

//nd->u.shop.discount = is_discount > 0; << THIS ONE

Edited by Ice Bear
  • Upvote 1
Link to comment
Share on other sites


Error    C2082    redefinition of formal parameter 'nd'    map-server    c:\users\user\documents\ra\rathena\src\map\clif.cpp    2153    
Error    C2065    'discount': undeclared identifier    map-server    c:\users\user\documents\ra\rathena\src\map\npc.cpp    3166    
Error    C2059    syntax error: '}'    map-server    c:\users\user\documents\ra\rathena\src\map\npc.cpp    3168    
Error    C2143    syntax error: missing ';' before '}'    map-server    c:\users\user\documents\ra\rathena\src\map\npc.cpp    3168    
Error    C2143    syntax error: missing ';' before '{'    map-server    c:\users\user\documents\ra\rathena\src\map\npc.cpp    3176    
Error    C2447    '{': missing function header (old-style formal list?)    map-server    c:\users\user\documents\ra\rathena\src\map\npc.cpp    3176    
Error    C2065    'npc_convertlabel_db': undeclared identifier    map-server    c:\users\user\documents\ra\rathena\src\map\npc.cpp    3338    
 

Edited by kalabasa
Link to comment
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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.