DBtool manager

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
jcbrello
Posts: 59
Joined: Fri Sep 15, 2006 9:27 pm

DBtool manager

Post by jcbrello »

Does anyone know how to insert a set value into a whole column at once?

such as the Droplist table chance column ?

I.E.

if DBmanager has the table DROPlist open and showing 20 different MobID how can I change the chance value of all 20 at one time from a value of say 5 to all a value of 60

so I dont have to manualy change each MobID chance value one at a time.

any help wold be great ,


Thanks guys :)
Krwawy
Posts: 152
Joined: Sat Sep 09, 2006 7:15 am
Location: Polska

Post by Krwawy »

what exacly do you want to change ?
the chanse of one item ?

Code: Select all

UPDATE droplist SET chance = 1000 WHERE Itemid = 57 - this one changes the chanse of adena drop in all mobs 
or do you want to change the chance on every drop/spoil in your table ?

Code: Select all

UPDATE droplist SET chance = 1000 - this one does it 
if you want to change the chance of all drops of some mobs you need their id

Code: Select all

UPDATE droplist SET chance = 1000 WHERE mobid = 12345 - this one changes chance of every item of selected mob 
anything else ?

if you want to change the chanse of drop of all weapons in the game use

Code: Select all

 UPDATE droplist SET chance = 1000 WHERE itemid IN (SELECT weapon.item_id FROM weapon);
or change a chanse to all armors that drop

Code: Select all

 UPDATE droplist SET chance = 1000 WHERE itemid IN (SELECT armor.item_id FROM armor);
or everything else not related to wepon/armor table

Code: Select all

 UPDATE droplist SET chance = 1000 WHERE itemid IN (SELECT etcitem.item_id FROM etcitem);
jcbrello
Posts: 59
Joined: Fri Sep 15, 2006 9:27 pm

Post by jcbrello »

good info :)

thanks

but,

what im trying to do is this,

I want to get all droplist items that have a default chance of 1 to 50 to be all 200

all the droplist items that have a default chance of 50-100 to be 250


and all droplist default chance of between 100 to 200 be 300

the rest (300+) is fine where its at.

it seems that anything under 150 chance is way to rare on my server of only 10-15 people.

in fact, for over 4 months we never saw one normal mob rare drop (armor ect.) with a 7x drop rate.

but one day i took a few hours and one by one changed all the droplist from 1 to 200 to a set value of 333 and people started to acually get rare items here an there off normal mobs.

but when I recently updated the server I lost all the chance settings for some weird reason, and I cant restore the backup i made of it,

it just wont take for some reason, and I dont want to spend 6 hours updating it one by one again :P

Thanks for the info though, its really usefull for other settings.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

You probably want something like this ...

Code: Select all

 UPDATE droplist SET chance = 300 WHERE chance > 99 and chance < 201;
 UPDATE droplist SET chance = 250 WHERE chance > 49 and chance < 100;
 UPDATE droplist SET chance = 200 WHERE chance > 0 and chance < 50;
Note that you have to do them in that order, or else it will all go a little ga-ga :-)
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
jcbrello
Posts: 59
Joined: Fri Sep 15, 2006 9:27 pm

Post by jcbrello »

PERFECT!

Thanks worked like a dream :)


Thanks msknight!!

and Krwawy too :)
Post Reply