Help on updating account_data through query_sql

Jedzkie

The Master of White Spaces
Messages
632
Points
0
Age
33
Location
Philippines
Discord
✪ Jedzkie#0662
IRC Nickname
Jedzkie
Github
Jedzkie
Emulator
Client Version
2016-03-16 RE
hi! as the title says, how can i update my account_data through query_sql? thanks!

 
CREATE TABLE IF NOT EXISTS `account_data` (`account_id` int(11) unsigned NOT NULL default '0',`bank_vault` int(11) unsigned NOT NULL default '0',`base_exp` TINYINT( 4 ) UNSIGNED NOT NULL default '100',`base_drop` TINYINT( 4 ) UNSIGNED NOT NULL default '100',`base_death` TINYINT( 4 ) UNSIGNED NOT NULL default '100',PRIMARY KEY (`account_id`)) ENGINE=MyISAM; 

For example you want to add 1 zeny from your vault everytime you click this npc :

Code:
prontera,150,150,0	script	Sample	123,{	query_sql "UPDATE `account_data` SET `bank_vault` = `bank_vault` + 1 WHERE `account_id` = '" +getcharid(3)+ "'";	end;}
 
thanks for your reply, but how can i make it in base_Exp, and base_drop and death>?

 
For example if i talk to the npc it will give me 7 days vip service. I try a your post but i have a problem, it does not add another column for other accounts, one column only and if other account talked to the npc, it overwrite the first account.

 
If you want to make a vip service then you might need to create another table for that to store their names and other basic info

 
For example if i talk to the npc it will give me 7 days vip service. I try a your post but i have a problem, it does not add another column for other accounts, one column only and if other account talked to the npc, it overwrite the first account.

you can update the VIP System with  set ModExp,150;     it changes the value in sql to 150   what you means you got 50% more exp  ( 100% is basic + 50% = 150) so you dont need a query_sql for it

 
For example if i talk to the npc it will give me 7 days vip service. I try a your post but i have a problem, it does not add another column for other accounts, one column only and if other account talked to the npc, it overwrite the first account.

you can update the VIP System with  set ModExp,150;     it changes the value in sql to 150   what you means you got 50% more exp  ( 100% is basic + 50% = 150) so you dont need a query_sql for it
can you make a sample script for that? thanks!

 
Main problem with this, is that you need to set the expiration time somewhere else since you can't track that with current `account_data` table...

 
For example if i talk to the npc it will give me 7 days vip service. I try a your post but i have a problem, it does not add another column for other accounts, one column only and if other account talked to the npc, it overwrite the first account.

you can update the VIP System with  set ModExp,150;     it changes the value in sql to 150   what you means you got 50% more exp  ( 100% is basic + 50% = 150) so you dont need a query_sql for it
can you make a sample script for that? thanks!
you can try this one ,  its binded over a Function to a item .  I use Vip Tickets for it

just add this into your item what should give the VIP Status

after using the Item you can check your remaining time with  @vip

Code:
{	Id: YOUR ITEM ID HERE	AegisName: "VIP Ticket 3D"	Name: "VIP Ticket 3D"	Type: 0	Weight: 10	Job: 0x7FFFFFFF	Script: <"		if(#vip_status >0) {			dispbottom "You allready got a Premium Service Running , Use another one after the Time Runs out.!";			getitem YOUR ITEM ID HERE,1;			end;		}		callfunc "getVIP", 3 * 24 * 3600; //VIP Status for 3 Day , change the 3 into 7  for 7 Days.	">},
Code:
Code will be readded , changing some stuff
 
Last edited by a moderator:
ossi0110, what if the vip timer runs out while you're logged in?

 
CREATE TABLE IF NOT EXISTS `account_data` (`account_id` int(11) unsigned NOT NULL default '0',`bank_vault` int(11) unsigned NOT NULL default '0',`base_exp` TINYINT( 4 ) UNSIGNED NOT NULL default '100',`base_drop` TINYINT( 4 ) UNSIGNED NOT NULL default '100',`base_death` TINYINT( 4 ) UNSIGNED NOT NULL default '100',PRIMARY KEY (`account_id`)) ENGINE=MyISAM; 

For example you want to add 1 zeny from your vault everytime you click this npc :
would this affect the account saved in my server?

and can i add this even if my server is running?

 
Last edited by a moderator:
Back
Top