Hello,
since alot of you guys probably have deleted items by setting ItemID = 0 and forgot totally about the _ItemPool table I`ve coded a little query that is able to detect items that dont exists in any inventory and marks them as "not used" for the Database to overwrite them.
since alot of you guys probably have deleted items by setting ItemID = 0 and forgot totally about the _ItemPool table I`ve coded a little query that is able to detect items that dont exists in any inventory and marks them as "not used" for the Database to overwrite them.
Code:
UPDATE P
SET InUse = 0
FROM _Items I
JOIN _ItemPool P ON I.ID64 = P.ItemID
FULL JOIN _Inventory INV ON I.ID64 = INV.ItemID
FULL JOIN _InvCOS INV_C ON I.ID64 = INV_C.ItemID
FULL JOIN _Chest C ON I.ID64 = C.ItemID
FULL JOIN _GuildChest GC ON I.ID64 = GC.ItemID
FULL JOIN _InventoryForAvatar IFA ON I.ID64 = IFA.ItemID
WHERE P.InUse = 1
AND INV.ItemID IS NULL
AND INV_C.ItemID IS NULL
AND C.ItemID IS NULL
AND GC.ItemID IS NULL
AND IFA.ItemID IS NULL