Page 1 of 1

DBtool manager

Posted: Sat Jan 13, 2007 9:25 pm
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 :)

Posted: Sat Jan 13, 2007 10:48 pm
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);

Posted: Sun Jan 14, 2007 2:00 am
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.

Posted: Sun Jan 14, 2007 8:46 pm
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 :-)

Posted: Sun Jan 14, 2007 10:40 pm
by jcbrello
PERFECT!

Thanks worked like a dream :)


Thanks msknight!!

and Krwawy too :)