Jump to content
  • 0

Auto Vend Modification


Yudax

Question


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

I take the credit from this post:

http://rathena.org/board/topic/71796-callshop-npc-using-vending/#entry142562

 

I edited some of the errors in this .diff But I still cant make it work.

 

like

pc_payzeny(sd, (int)zeny);

to:

pc_payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd);

 

and

case ADDITEM_NEW:

to:

case CHKADDITEM_NEW:

 

-------------

 

But after compiling I got this error

1>d:\ragnarok\17294\src\map\vending.c(146): error C2065: 'z' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(146): error C2065: 'vsd' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(146): warning C4047: 'function' : 'map_session_data *' differs in levels of indirection from 'int'
1>d:\ragnarok\17294\src\map\vending.c(146): warning C4024: 'pc_payzeny' : different types for formal and actual parameter 4
========== Rebuild All: 3 succeeded, 1 failed, 0 skipped ==========

 

 

new patch here;

vending.patch

Edited by Yudax
Link to comment
Share on other sites

12 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   3
  • Joined:  03/25/12
  • Last Seen:  

try this

 

Make this line:

void vending_purchasereq_script(struct map_session_data* sd, struct npc_data* nd, int uid, const uint8* data, int count)
{
	int i;
	int add;
	int blank;
	int weight;
	double zeny;

 

to this:

void vending_purchasereq_script(struct map_session_data* sd, struct npc_data* nd, int uid, const uint8* data, int count)
{
	int i;
	int add;
	int blank;
	int weight;
	double z;
        struct map_session_data* vsd = map_id2sd(aid);

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

try this

 

Make this line:

void vending_purchasereq_script(struct map_session_data* sd, struct npc_data* nd, int uid, const uint8* data, int count)
{
	int i;
	int add;
	int blank;
	int weight;
	double zeny;

 

to this:

void vending_purchasereq_script(struct map_session_data* sd, struct npc_data* nd, int uid, const uint8* data, int count)
{
	int i;
	int add;
	int blank;
	int weight;
	double z;
        struct map_session_data* vsd = map_id2sd(aid);

 

 

this one pops out

 

1>d:\ragnarok\17294\src\map\vending.c(146): error C2065: 'z' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(146): error C2065: 'vsd' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(146): warning C4047: 'function' : 'map_session_data *' differs in levels of indirection from 'int'
1>d:\ragnarok\17294\src\map\vending.c(146): warning C4024: 'pc_payzeny' : different types for formal and actual parameter 4
1>d:\ragnarok\17294\src\map\vending.c(176): error C2084: function 'void vending_purchasereq_script(map_session_data *,npc_data *,int,const uint8 *,int)' already has a body
1>          d:\ragnarok\17294\src\map\vending.c(73) : see previous definition of 'vending_purchasereq_script'
1>d:\ragnarok\17294\src\map\vending.c(182): error C2065: 'aid' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(205): error C2065: 'aid' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(216): error C2065: 'vending' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(220): error C2065: 'w' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(234): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(234): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(234): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(234): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(235): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(238): error C2065: 'vend_list' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(238): error C2109: subscript requires array or pointer type
1>d:\ragnarok\17294\src\map\vending.c(238): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(240): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(248): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(252): error C2065: 'w' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(253): error C2065: 'w' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(260): error C2065: 'vending' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(260): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(260): error C2109: subscript requires array or pointer type
1>d:\ragnarok\17294\src\map\vending.c(261): error C2065: 'vending' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(261): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(261): error C2109: subscript requires array or pointer type
1>d:\ragnarok\17294\src\map\vending.c(265): error C2065: 'vending' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(265): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(265): error C2109: subscript requires array or pointer type
1>d:\ragnarok\17294\src\map\vending.c(268): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(272): error C2065: 'vending' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(272): error C2065: 'j' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(272): error C2109: subscript requires array or pointer type
1>d:\ragnarok\17294\src\map\vending.c(278): error C2065: 'new_' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(279): error C2065: 'new_' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(300): error C2065: 'vend_list' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(300): error C2109: subscript requires array or pointer type
1>d:\ragnarok\17294\src\map\vending.c(314): error C2065: 'cursor' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(319): error C2065: 'cursor' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(321): error C2065: 'cursor' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(322): error C2065: 'cursor' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(323): error C2065: 'cursor' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(326): error C2065: 'cursor' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(328): error C2065: 'cursor' : undeclared identifier
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   3
  • Joined:  03/25/12
  • Last Seen:  

try this one :

void vending_purchasereq_script(struct map_session_data* sd, struct npc_data* nd, int aid, int uid, const uint8* data, int count)
{
	int i;
	int add;
	int blank;
	int weight;
	double z;
        struct map_session_data* vsd = map_id2sd(aid);
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

try this one :

void vending_purchasereq_script(struct map_session_data* sd, struct npc_data* nd, int aid, int uid, const uint8* data, int count)
{
	int i;
	int add;
	int blank;
	int weight;
	double z;
        struct map_session_data* vsd = map_id2sd(aid);

 

still error

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   3
  • Joined:  03/25/12
  • Last Seen:  

I manage to eliminate the errors.

Just try this patch. I didn't yet try ingame.

vending.patch

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

I manage to eliminate the errors.

Just try this patch. I didn't yet try ingame.

 

I will try it right now sir,

Anyway may I know what are the things you edit and why?

--------------

 

I will try it right now sir,

Anyway may I know what are the things you edit and why?

Theres an error and i think its in this line

pc_payzeny(sd, (int)z);

When i try to change it to;

pc_payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd);

Thats the error that it shows

1>d:\ragnarok\17294\src\map\vending.c(146): error C2065: 'vsd' : undeclared identifier
1>d:\ragnarok\17294\src\map\vending.c(146): warning C4047: 'function' : 'map_session_data *' differs in levels of indirection from 'int'
1>d:\ragnarok\17294\src\map\vending.c(146): warning C4024: 'pc_payzeny' : different types for formal and actual parameter 4
Edited by Yudax
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   3
  • Joined:  03/25/12
  • Last Seen:  

this is what I change

 

zeny = 0; to z = 0;

 

pc_payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd);

to

pc_payzeny(sd, (int)z);

 

because too many actual parameters.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

this is what I change

 

zeny = 0; to z = 0;

 

pc_payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd);

to

pc_payzeny(sd, (int)z);

 

because too many actual parameters.

 

The error is in that one, either of the two gives an error

for

pc_payzeny(sd, (int)z);

 

d:\ragnarok\17294\src\map\vending.c(146): error C2198: 'pc_payzeny' : too few arguments for call
Edited by Yudax
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   3
  • Joined:  03/25/12
  • Last Seen:  

can I know what revision do you use?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

17324



can I know what revision do you use?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   3
  • Joined:  03/25/12
  • Last Seen:  

try this one:

 

vending.patch

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

try this one:

 

Hmm this one

1>  vending.c

3>  char-server_sql.vcxproj -> D:\Ragnarok\17294\vcproj-10\..\char-server_sql.exe

1>LINK : fatal error LNK1168: cannot open ..\map-server_sql.exe for writing

========== Rebuild All: 3 succeeded, 1 failed, 0 skipped ==========

 

I think its fine now, I compiled it 3 times, I guess its okay. So what did you edit? Thank you so much :) I really appreciate, Just want to know what did you do so far

Edited by Yudax
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
Answer this question...

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