Jump to content

'flag' at Shop to disable Discount & Overcharge


Cydh

Recommended Posts


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   136
  • Joined:  02/26/14
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  231
  • Reputation:   9
  • Joined:  12/16/11
  • Last Seen:  

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


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  231
  • Reputation:   9
  • Joined:  12/16/11
  • Last Seen:  

 

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

  • 1 month later...

  • Group:  Members
  • Topic Count:  56
  • Topics Per Day:  0.01
  • Content Count:  224
  • Reputation:   4
  • Joined:  02/09/12
  • Last Seen:  

Svn 17704 erro

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   1
  • Joined:  03/07/12
  • Last Seen:  

Work in cashshop ??

prontera,147,161,6	cashshop Shop 3	872,2102:-1,2104:-1,501:-1,1
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  11/19/12
  • Last Seen:  

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

  • 1 month later...

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

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


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

change SHOP to NPCTYPE_SHOP

Link to comment
Share on other sites

  • 3 years later...

  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

Updated for rAthena Git Hash: ec1d6d28 (20180713)

  • Upvote 1
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  10
  • Reputation:   0
  • Joined:  04/19/16
  • Last Seen:  

[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

  • 9 months later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   0
  • Joined:  11/22/12
  • Last Seen:  

        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

  • 1 year later...

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   26
  • Joined:  11/20/11
  • Last Seen:  

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

  • 6 months later...

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  


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