How to Remove Item optlvl > 30

08/08/2012 10:37 itatknic#1
Hello all !
I have more item optlvl greater than 30 . I want remove all it (item optlvl > 30).

any help will be greatly appreciated and will gain my utmost respect..lol
Thanks for any help in advance
08/08/2012 14:57 sarkoplata#2
USE SRO_VT_SHARD
DELETE FROM _Items WHERE OptLevel > 30
08/08/2012 15:32 Kape7#3
Quote:
Originally Posted by sarkoplata View Post
USE SRO_VT_SHARD
DELETE FROM _Items WHERE OptLevel > 30
Or instead of delete them, reduce the plus.

This is what happens when you mess up with the alchemy XD
08/08/2012 15:45 IceAmStiel#4
Quote:
Originally Posted by sarkoplata View Post
USE SRO_VT_SHARD
DELETE FROM _Items WHERE OptLevel > 30
Will either cause an error right away at the execution since there are constraints referenced or as soon as someone tries to login to his/her char again.
If you're going to delete an item completely you'd have to set the reference on the inventory tables to 0/NULL (belongs to its location) AND delete the ItemID from _ItemPool as well.


I would also recommend against the use of a simple update statement since e.g. Alchemy Stones use the OptLevel for their assimilation values (!> 30 though, just sayin) - could end up turning every stone to a 0% one.

You may use..
Code:
UPDATE _Items
SET OptLevel = 0
WHERE
	RefItemID in
		(
		SELECT ID FROM _RefObjCommon
		WHERE (CodeName128 like 'ITEM_CH%' OR CodeName128 like 'ITEM_EU%')
		AND TypeID1 = 3 AND TypeID2 = 1 AND TypeID3 != 7 AND [Service] = 1
		)
AND
	OptLevel > 30
:) sry, in case I was acting like a smartypants
08/08/2012 15:49 ahmed4ever2u#5
@Caipi i think this one is better :D

just execute this query .

Code:
--##################By Ahmed4ever2u--#####################################
use SRO_VT_SHARD
		DECLARE
			@OptLevel VarCHAR (129) = (SELECT MAX (OPTLEVEL) FROM _Items)
			
	Update _items
		SET OptLevel = '10'
		where OptLevel = @OptLevel
--##################By Ahmed4ever2u--#####################################
then use this query to see the highest item plus

Code:
SELECT MAX (OPTLEVEL) FROM _Items
have Fun :-p
08/08/2012 15:51 sarkoplata#6
Quote:
Originally Posted by Synx7 View Post
Or instead of delete them, reduce the plus.

This is what happens when you mess up with the alchemy XD
Yes, was just a basic example, you may f*ck up the _Items table if you mess with it.
08/08/2012 15:55 IceAmStiel#7
Oh well I'll simply quote myself:

Quote:
Originally Posted by IceAmStiel View Post
I would also recommend against the use of a simple update statement since e.g. Alchemy Stones use the OptLevel for their assimilation values (!> 30 though, just sayin) - could end up turning every stone to a 0% one.