Jump to content

Extended Vending System [1.9] cleanup & fix


Recommended Posts

Posted (edited)

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
Posted

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

Posted

@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`;
Posted (edited)

@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
Posted (edited)
@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
  • 1 month later...
Posted (edited)

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
Posted (edited)

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
Posted

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));
 		}
 	}
Posted

 

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?

  • 4 weeks later...
  • 1 month later...
Posted

@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

Posted

@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 

  • 2 weeks later...
Posted

@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

  • 2 weeks later...

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...