Jump to content

Extended Vending System [1.9] cleanup & fix


Napster

Recommended Posts


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

upgrade_extended_vending_item.sql for r17704

check your folder Sql-files/upgrades/upgrade_extended_vending_item.sql

 

my patch include sql file  /hum

ALTER TABLE `vendings` ADD COLUMN `extended_vending_item` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `title`;
Edited by Napster
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  387
  • Reputation:   60
  • Joined:  10/08/13
  • Last Seen:  

already check it...

 

and this is my Sql-files/upgrades/upgrade_extended_vending_item.sql

ALTER TABLE `vendings` ADD COLUMN `extended_vending_item` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `title`;

same like ur patch... im really lost...  /hmm

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

@Elsa Mist regarding on your error i encounter that kind of error.

 

what i did was this line

	if( Sql_Query( mmysql_handle, "INSERT INTO `%s`(`id`,`account_id`,`char_id`,`sex`,`map`,`x`,`y`,`title`,`autotrade`, `body_direction`, `head_direction`, `sit`) "
		"VALUES( %d, %d, %d, '%c', '%s', %d, %d, '%s', %d, '%d', '%d', '%d' );",
		vendings_db, sd->vender_id, sd->status.account_id, sd->status.char_id, sd->status.sex == 0 ? 'F' : 'M', map[sd->bl.m].name, sd->bl.x, sd->bl.y, message_sql, sd->state.autotrade, sd->ud.dir, sd->head_dir, pc_issit(sd) ) != SQL_SUCCESS ){

i didn't change it.

 

and i didn't applied this things.

`extended_vending_item` smallint(5) unsigned NOT NULL DEFAULT '0'. or this, ALTER TABLE `vendings` ADD COLUMN `extended_vending_item` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `sit`;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  387
  • Reputation:   60
  • Joined:  10/08/13
  • Last Seen:  

@Nepster its me again..

 

Ive got one problem, i cant buy zeny and cash. even my zeny and cash is more than selling prize it still say that im dont have enough items. i have try with my GM & normal account still not enough items. kindly, see image below on chat box.

 

sdpm7xeyyo.jpg

 

 

FYI, for zeny and cash i change the item ID is it ok? because ID 30000 & 30001 is already use by my costume.

 

  /thx


its okay now, im manage to solve it... hehehe

 

 

btw @napster,,,, thank you so much forthis patch,,,, love u more...  /lv

Edited by Elsa Mist
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

@Elsa Mist  i have test for this no problem

 

i think your checking 

if you change ID 30000 & 30001 is already 

 

1. check item db ...\db\import-tmpl\item_db.txt

 

// Vending system

30000,Zeny,Zeny,3,,10,10,,,,,,,,,,,,,{},{},{} <-- change you want item id

30001,Cash,Cash,3,,10,10,,,,,,,,,,,,,{},{},{} <-- change you want item id

 

2. check battle conf ...\battle\feature.conf

 

// Item ID for Zeny. Set to 0 if you don't want use Zeny.

item_zeny: 30000 <-- change you want item id

// Item ID for Cash. Set to 0 if you don't want use Cash.

item_cash: 30001 <-- change you want item id

 

3. check you data file ...\data\idnum2itemdisplaynametable.txt

 

// Vending system

30000#Zeny# <-- change you want item id

30001#Cash# <-- change you want item id

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

  • 1 month later...

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  187
  • Reputation:   7
  • Joined:  09/04/12
  • Last Seen:  

It did not support autotrade in last git...

When server restart....all turned it to Zeny Trading..

 

I noticed that COLUMN `extended_vending_item` will be set to "0" when the server restarted....

Edited by Darkpurple
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

Update fix bug : ExtendedVendingSystem_1.9.2

thank you for report

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  187
  • Reputation:   7
  • Joined:  09/04/12
  • Last Seen:  

It removed this part??

Index: db/item_vending.txt
===================================================================
--- db/item_vending.txt	(revision 0)
+++ db/item_vending.txt	(working copy)
@@ -0,0 +1,12 @@
+// Specific items for Vending System
+// Format: ItemID
+// Max items is equal MAX_INVENTORY ( 100 by default )
+
+// TCG Card
+7227
+// Mithril Coin
+674
+// Silver Coin
+675
+// Bronze Coin
+673
\ No newline at end of file

And why changed this part :

Old:

 	for( i = 0; i < count; i++ ) {
 		short amount = *(uint16*)(data + 4*i + 0);
 		short idx    = *(uint16*)(data + 4*i + 2);
+		const char *item_name;
+		double rev = 0.;
 		idx -= 2;
 
+		/**
+		 * Extended Vending system [Lilith]
+		**/
+		if(battle_config.ex_vending_info){ 
+			item_name = itemdb_jname(vsd->status.cart[idx].nameid);
+			rev = ((double)vsd->vending[vend_list[i]].value * (double)amount);
+		}
+
 		// vending item
 		pc_additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING);
 		vsd->vending[vend_list[i]].amount -= amount;
@@ -252,11 +346,20 @@
 		//print buyer's name
 		if( battle_config.buyer_name ) {
 			char temp[256];
-			sprintf(temp, msg_txt(sd,265), sd->status.name);
+			if(battle_config.ex_vending_info) // Extended Vending system [Lilith]
+				sprintf(temp, msg_txt(sd,1597), sd->status.name, item_name, amount, (int)(rev -= rev * (battle_config.vending_tax/10000.)), vsd->vend_loot?itemdb_jname(vsd->vend_loot):"Zeny");
+			else
+				sprintf(temp, msg_txt(sd,265), sd->status.name);
 			clif_disp_onlyself(vsd,temp,strlen(temp));
 		}
 	}

to new:

 	for( i = 0; i < count; i++ ) {
 		short amount = *(uint16*)(data + 4*i + 0);
@@ -250,11 +337,23 @@
 		//print buyer's name
 		if( battle_config.buyer_name ) {
 			char temp[256];
-			sprintf(temp, msg_txt(sd,265), sd->status.name);
+			if(battle_config.ex_vending_info) {// Extended Vending system [Lilith]
+				const char *item_name = itemdb_jname(vsd->status.cart[idx].nameid);
+				double rev = ((double)vsd->vending[vend_list[i]].value * (double)amount);
+
+				sprintf(temp, msg_txt(sd,1597), sd->status.name, item_name, amount, (int)(rev -= rev * (battle_config.vending_tax/10000.)), vsd->vend_loot?itemdb_jname(vsd->vend_loot):"Zeny");
+			} else
+				sprintf(temp, msg_txt(sd,265), sd->status.name);
 			clif_disp_onlyself(vsd,temp,strlen(temp));
 		}
 	}

should I use the new one? or the old one is okay(well) to use?

What is different?

Edited by Darkpurple
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

opps! forgot sorry i will update again
 

 

 

+++ db/item_vending.txt    (working copy)
@@ -0,0 +1,12 @@
+// Specific items for Vending System
+// Format: ItemID
+// Max items is equal MAX_INVENTORY ( 100 by default )
+
+// TCG Card
+7227
+// Mithril Coin
+674
+// Silver Coin
+675
+// Bronze Coin
+673
\ No newline at end of file

 

and this fix warning for linux bugreport by  Lelouch vi Britannia
 

 		//print buyer's name
 		if( battle_config.buyer_name ) {
 			char temp[256];
-			sprintf(temp, msg_txt(sd,265), sd->status.name);
+			if(battle_config.ex_vending_info) {// Extended Vending system [Lilith]
+				const char *item_name = itemdb_jname(vsd->status.cart[idx].nameid);
+				double rev = ((double)vsd->vending[vend_list[i]].value * (double)amount);
+
+				sprintf(temp, msg_txt(sd,1597), sd->status.name, item_name, amount, (int)(rev -= rev * (battle_config.vending_tax/10000.)), vsd->vend_loot?itemdb_jname(vsd->vend_loot):"Zeny");
+			} else
+				sprintf(temp, msg_txt(sd,265), sd->status.name);
 			clif_disp_onlyself(vsd,temp,strlen(temp));
 		}
 	}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  187
  • Reputation:   7
  • Joined:  09/04/12
  • Last Seen:  

 

opps! forgot sorry i will update again

 

 

 

+++ db/item_vending.txt    (working copy)

@@ -0,0 +1,12 @@

+// Specific items for Vending System

+// Format: ItemID

+// Max items is equal MAX_INVENTORY ( 100 by default )

+

+// TCG Card

+7227

+// Mithril Coin

+674

+// Silver Coin

+675

+// Bronze Coin

+673

\ No newline at end of file

 

and this fix warning for linux bugreport by  Lelouch vi Britannia

 

 		//print buyer's name
 		if( battle_config.buyer_name ) {
 			char temp[256];
-			sprintf(temp, msg_txt(sd,265), sd->status.name);
+			if(battle_config.ex_vending_info) {// Extended Vending system [Lilith]
+				const char *item_name = itemdb_jname(vsd->status.cart[idx].nameid);
+				double rev = ((double)vsd->vending[vend_list[i]].value * (double)amount);
+
+				sprintf(temp, msg_txt(sd,1597), sd->status.name, item_name, amount, (int)(rev -= rev * (battle_config.vending_tax/10000.)), vsd->vend_loot?itemdb_jname(vsd->vend_loot):"Zeny");
+			} else
+				sprintf(temp, msg_txt(sd,265), sd->status.name);
 			clif_disp_onlyself(vsd,temp,strlen(temp));
 		}
 	}

 

If I am window OS user should I change it ? Or keep the old one is okay?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

yes no problem

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  01/27/14
  • Last Seen:  

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  60
  • Reputation:   1
  • Joined:  12/12/13
  • Last Seen:  

@Napster 

 

Hi bud, i have an error, when ill try to Shop the Msg appear... with all the items i try and nothing..

 

B70DdKn.png

733: Item '%s' has not yet saved to your cart. Please re-log in order to correctly save your Vending information.

anybody can help me with this  /panic

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  187
  • Reputation:   7
  • Joined:  09/04/12
  • Last Seen:  

@Napster 

 

Hi bud, i have an error, when ill try to Shop the Msg appear... with all the items i try and nothing..

 

B70DdKn.png

733: Item '%s' has not yet saved to your cart. Please re-log in order to correctly save your Vending information.

anybody can help me with this  /panic

 

 

re-log 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  60
  • Reputation:   1
  • Joined:  12/12/13
  • Last Seen:  

w/e i solved it

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   25
  • Joined:  12/24/14
  • Last Seen:  

@napster
please detail how to use this file .patch
where i'm to place this file .patch

sorry, i'm newbie, please detail to use this vending system

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

can i have tutorial step by step? thanks in advance!

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  187
  • Reputation:   7
  • Joined:  09/04/12
  • Last Seen:  

It seem that rathena changed some structure in vending.c since here:

https://github.com/rathena/rathena/commit/7fcacb64c44f4305352d55dc12390aaaa8882997

So that this diff does not working on last Git rathena.

We need to hope that napster if had time to fixed it...:)

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   0
  • Joined:  06/25/12
  • Last Seen:  

It seem that rathena changed some structure in vending.c since here: https://github.com/rathena/rathena/commit/7fcacb64c44f4305352d55dc12390aaaa8882997 So that this diff does not working on last Git rathena. We need to hope that napster if had time to fixed it... :)

 

Just to follow up his post.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

try 1.9.3 for last gits & svn

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  187
  • Reputation:   7
  • Joined:  09/04/12
  • Last Seen:  

try 1.9.3 for last gits & svn

Welcome Back, NICE!!:):):)

Also I saw some interesting topics in hercules:

 

http://hercules.ws/board/topic/8192-restock-system/

 

and

 

http://hercules.ws/board/topic/8213-warp-hit-delay/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  114
  • Topics Per Day:  0.03
  • Content Count:  298
  • Reputation:   4
  • Joined:  03/13/12
  • Last Seen:  

try 1.9.3 for last gits & svn

i tried both manualy and patch i get this error.

post-3084-0-60900200-1422467307_thumb.jpg

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

 

try 1.9.3 for last gits & svn

i tried both manualy and patch i get this error.

 

Same Prob

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