LCKB
QUERY BUILDER - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: General Section (https://lckb.dev/forum/forumdisplay.php?fid=216)
+---- Forum: General (https://lckb.dev/forum/forumdisplay.php?fid=183)
+---- Thread: QUERY BUILDER (/showthread.php?tid=2093)

Pages: 1 2


- dethunter12 - 07-02-2013


hey all i would like to know what the query would be for this i want to update t_item from values 10019-1512  a_rare_index_0-5 and a_rare_prob_0-5 can somone make me a query for it  would it be somthing like this?

UPDATE t_item Where a_index = 10019-1512 SET a_rare_index_0-5= 14 SET a_rare_prob_0-5= 6;




- someone - 07-02-2013


The correct order is UPDATE SET WHERE

 

So your code yould be:

UPDATE t_item
SET a_rare_prob_0 = 6,  a_rare_prob_1 = 6, a_rare_prob_2 = 6, a_rare_prob_3 = 6, a_rare_prob_4 = 6, a_rare_prob_5 = 6,
a_rare_index_0 = 14, a_rare_index_1 = 14, a_rare_index_2 = 14, a_rare_index_3 = 14, a_rare_index_4 = 14, a_rare_index_5 = 14
WHERE a_index BETWEEN 10019 AND 1512



- dethunter12 - 07-03-2013


sorry but are you not missing = and ;?

UPDATE t_item
SET a_rare_prob_0 = 6,  a_rare_prob_1 = 6, a_rare_prob_2 = 6, a_rare_prob_3 = 6, a_rare_prob_4 = 6, a_rare_prob_5 = 6,
a_rare_index_0 = 14, a_rare_index_1 = 14, a_rare_index_2 = 14, a_rare_index_3 = 14, a_rare_index_4 = 14, a_rare_index_5 = 14
WHERE a_index = BETWEEN 10019 AND 1512;




- someone - 07-03-2013


Nope the query is correct. Or you want this to apply for only 2 items, because what I posed is only valid for range of items with the a_index  between 10019 and 1512( if there are 100 items between these range, this will apply on all the items)

 

For only 2 items just make(there are 2 methods)

UPDATE t_item
SET a_rare_prob_0 = 6, a_rare_prob_1 = 6, a_rare_prob_2 = 6, a_rare_prob_3 = 6, a_rare_prob_4 = 6, a_rare_prob_5 = 6,
a_rare_index_0 = 14, a_rare_index_1 = 14, a_rare_index_2 = 14, a_rare_index_3 = 14, a_rare_index_4 = 14, a_rare_index_5 = 14
WHERE a_index in (10019, 1512);
Or this:

UPDATE t_item
SET a_rare_prob_0 = 6, a_rare_prob_1 = 6, a_rare_prob_2 = 6, a_rare_prob_3 = 6, a_rare_prob_4 = 6, a_rare_prob_5 = 6,
a_rare_index_0 = 14, a_rare_index_1 = 14, a_rare_index_2 = 14, a_rare_index_3 = 14, a_rare_index_4 = 14, a_rare_index_5 = 14
WHERE a_index = 10019 OR a_index = 1512;

if you add  = before between it will generate a error, and ";" it is not necessary, it only specifices, the query to executes(if you want to execute 2 queries in 1 you will need ";"  to separate the queries)

 

if you run only 1 query  ";" is not necessary, only if you run multiple queries in 1 file.(in MSSQL you can run multiple lines without ";", but more queries in 1 will  increase the query timeout, plus it has a limit on this, on how big the query is)




- [email protected] - 01-29-2014

hey I am wondering if there is a query I can run to set starting levels of all characters to level 1 rather than hex editing it please and thank you




- DeChamp3 - 01-29-2014


hey I am wondering if there is a query I can run to set starting levels of all characters to level 1 rather than hex editing it please and thank you

 

gameserver editing only way, when char is created it will be automatical level 90, no matter if u run a query over it, because the char is online it wont be updated.

when char is logged of, only them the value changes




- [email protected] - 02-04-2014

im aware the char info wont change if its online I was after a query for sql to set the beginning level of a char on the server to start at level 1 instead of 90 asin how do I change the server files so the newly created characters start at level 1 instead of level 90




- DeChamp3 - 02-04-2014


you are changing the start level in gameserver and not database..

making a query that updates the chars to level 1 isnt possible, because its gonna run again and again and again and again and again to make the char level 1...

u can make like UPDATE t_characters SET a_level = 1; but it will just set ALL chars to level 1.. u can also make a script to make only all chars to level 1 when they are lvl 90, but then if they reach 90 again and log out they gonna be level 1 again

 




- [email protected] - 02-04-2014

okies mp u got any idea of the offsets for hex editing the info than?




- DeChamp3 - 02-04-2014


open gameserver_d with a hex editor, go to this offset: 000991BF 

change it from 5A to 01