Add Mobs Query problems...

05/30/2014 15:04 Dotzie#1
Well i am trying to find the exact script to set the drops with 4 grades mob by mob.. Still no success tho

Update PS_GameDefs.dbo.MobItems
SET
Grade=52, DropRate=30, ItemOrder=1
Grade=52, DropRate=30, ItemOrder=2
Grade=52, DropRate=30, ItemOrder=3
Grade=52, DropRate=30, ItemOrder=4
Where MobID = 228

Any Idea Why i get Error at the 3 rows here:
Grade=52, DropRate=30, ItemOrder=2
Grade=52, DropRate=30, ItemOrder=3
Grade=52, DropRate=30, ItemOrder=4
Where MobID = 228

Says Syntax '='
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'Grade'.

Row 1 with ItemOrder=1 are good...

Im trying to add 4 Grades to same mobs but i have been trying whole the day to figure it out even been Re-Searching but no success at all..
05/30/2014 16:50 andr3y_you96#2
Code:
Update PS_GameDefs.dbo.MobItems
SET Grade = '52' where ItemOrder = '1' and MobID = '228'
Update PS_GameDefs.dbo.MobItems
SET DropRate = '30' where ItemOrder = '1' and MobID = '228'
Update PS_GameDefs.dbo.MobItems
SET Grade = '52' where ItemOrder = '2' and MobID = '228'
Update PS_GameDefs.dbo.MobItems
SET DropRate = '30' where ItemOrder = '2' and MobID = '228'
....
05/30/2014 17:17 killer870#3
So what you are trying to do is Update the drops of MobID:228 and i see that all the grades and Droprate are the same. If the code isnt well writen the quiry WILL NOT work, it doesnt know when Grade=52 (#2) is for ItemOrder:2 it will just think that you are trying to update again the Grade for itemOrder 1 again and again.. if that makes sence.. lol (sorry im very bad at explaining this stype of stuffs)

On this code since all grades and droprate are going to be the same for ItemOrder 1 2 3 and 4, the code should be
Code:
Update PS_GameDefs.dbo.MobItems
SET Grade=52, DropRate=30
Where MobID = 228 AND ItemOrder in (1,2,3,4)