View Full Version : Sql
knight-mare
06-18-2015, 02:42 PM
Im wanting to do change afew things in game .... i know how to do this but im wanting to know if i can run something in sql to make it quicker
first thing is change NPC races say from 211 to 478
second is change all items from nodrop to attunable
any help is appreciated
thanks in advance
Shendare
06-18-2015, 02:52 PM
1. UPDATE `npc_types` SET `race`=478 WHERE `race`=211;
2. UPDATE `items` SET `attuneable`=1, `nodrop`=0 WHERE `nodrop`=1;
Shendare
06-18-2015, 02:54 PM
Note that both of these are irreversible actions. You'd have to restore the npc_types and items tables from a backup if you wanted to undo it.
knight-mare
06-18-2015, 03:01 PM
thank you :) give it a try now ... if this works you saved me alot of time
knight-mare
06-18-2015, 06:24 PM
items are still notrade even after server restart?
Shendare
06-18-2015, 06:39 PM
Are you running shared_memory over again as well? That's what loads the items from the database into memory for the zone server to access, and it's easy to miss.
knight-mare
06-18-2015, 07:06 PM
that fires up when i use start.bat
i compiled my own server... did not use repack or anything
Shendare
06-18-2015, 07:14 PM
Huh. Maybe the fields aren't as straightforward as they looked.
Anybody else have an idea?
knight-mare
06-18-2015, 07:43 PM
everything now seems notrade
knight-mare
06-18-2015, 07:52 PM
ok upon me and players checking things it seems everything is attunable and notrade... so it kinda worked :)
Shendare
06-18-2015, 08:01 PM
You know what? I'll bet the name of the field is reversed. It should be "tradeable".
Try this:
UPDATE `items` SET `nodrop`=1 WHERE `attuneable`=1;
Shendare
06-18-2015, 08:11 PM
Crud... and you know what? If the field name is backwards, then the first UPDATE command did the wrong thing. It turned the TRADEABLE items into Attunable No-Trade, leaving the No-Trade items alone. Gah.
Do you have a backup of the items table?
knight-mare
06-18-2015, 08:14 PM
and now everything is notrade :s
i have a full back-up so just need to scroll and find items if theres no way to fix
knight-mare
06-18-2015, 08:14 PM
and i meant to put everything is notrade... nothing is attunable
knight-mare
06-18-2015, 08:16 PM
how about a command to take off notrade then a seprate one to make everything attuneable? i tried this
UPDATE `items` SET `nodrop`=0 WHERE `nodrop`=1;
Shendare
06-18-2015, 08:18 PM
That makes everything in your items table No Trade.
To do exactly what you wanted in the first place with the items, restore the table from your backup, then run this command:
UPDATE `items` SET `attuneable`=1, `nodrop`=1 WHERE `nodrop`=0;
That makes all No Trade items in your items table Attuneable and Tradeable instead.
What a monkey wrench having that field name backwards was!
knight-mare
06-18-2015, 08:30 PM
that worked :) thank you
Shendare
06-18-2015, 08:32 PM
I think that's a quirk I'll not soon forget. Hahaha.
Uleat
06-18-2015, 08:54 PM
I think that 2 of the implemented item flags are backwards from what you would think..the other 3-4 are syntactically biased.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.