Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: Rotcoin on March 29, 2015, 06:11:50 pm
-
Long time lurker, first time poster.
I'm currently working on a project and have a query in regards to some SQL that I'm working on. We're looking to remove stats from all weapons and armour and I'm unsure if my query is targeting the right class.
UPDATE `Item_template` SET stat_value1 = (stat_value1 = 0) WHERE class = 2;
UPDATE `Item_template` SET stat_value2 = (stat_value2 = 0) WHERE class = 2;
UPDATE `Item_template` SET stat_value3 = (stat_value3 = 0) WHERE class = 2;
UPDATE `Item_template` SET stat_value4 = (stat_value4 = 0) WHERE class = 2;
UPDATE `Item_template` SET stat_value5 = (stat_value5 = 0) WHERE class = 2;
UPDATE `Item_template` SET stat_value6 = (stat_value6 = 0) WHERE class = 2;
UPDATE `Item_template` SET stat_value7 = (stat_value7 = 0) WHERE class = 2;
UPDATE `Item_template` SET stat_value8 = (stat_value8 = 0) WHERE class = 2;
UPDATE `Item_template` SET stat_value1 = (stat_value1 = 0) WHERE class = 4;
UPDATE `Item_template` SET stat_value2 = (stat_value2 = 0) WHERE class = 4;
UPDATE `Item_template` SET stat_value3 = (stat_value3 = 0) WHERE class = 4;
UPDATE `Item_template` SET stat_value4 = (stat_value4 = 0) WHERE class = 4;
UPDATE `Item_template` SET stat_value5 = (stat_value5 = 0) WHERE class = 4;
UPDATE `Item_template` SET stat_value6 = (stat_value6 = 0) WHERE class = 4;
UPDATE `Item_template` SET stat_value7 = (stat_value7 = 0) WHERE class = 4;
UPDATE `Item_template` SET stat_value8 = (stat_value8 = 0) WHERE class = 4;
To me, that logically makes sense. But I'm just wondering if anyone would be able to give it a quick look over and see if it is correct?
Thank you in advance for any help.
-
UPDATE `Item_template` SET stat_value1 = 0 WHERE class = 2;
etc.
stat_value1 = (stat_value1 = 0) doesn't make any sense at all.
-
Aaah. I was basing my SQL query off of one which was previously used for a server where they were boosting all the stats up on items by a percentage.
Initially it was; stat_value1 = stat_value1 * 1.15
Thus adding 15% to all stats.
Thank you for the help and clarification, Kaev. It's really appreciated.
-
But why so many comands?
UPDATE `Item_template` SET stat_value1 = stat_value1 * 1.15, stat_value2 = stat_value2 * 1.15, stat_value3 = stat_value3 * 1.15, stat_value4 = stat_value4 * 1.15, stat_value5 = stat_value5 * 1.15, stat_value6 = stat_value6 * 1.15, stat_value7 = stat_value7 * 1.15, stat_value8 = stat_value8 * 1.15 WHERE class = 2;