Since everyone acted like a pro.. and started commenting on the old shit..here's the Ready To Use Lines...
Simply this shit will get the RefID Of the items and compare them to a table if the ID exists it will change it to another one..
Table name in this example is Upgrade columns Are Req/Up
Edit this to match how you will use it.. but i guess you got the point..
Simply this shit will get the RefID Of the items and compare them to a table if the ID exists it will change it to another one..
Table name in this example is Upgrade columns Are Req/Up
Code:
--Upgrade By #Khaled# --
DECLARE @WepRefID INT,
@ArenaRefID INT,
@OptLevel INT,
@Data INT,
@UP INT,
@WepRefID2 INT
SELECT @WepRefID = I.RefItemID
FROM SRO_VT_SHARD.._Inventory Inv
INNER JOIN SRO_VT_SHARD.._Items I
ON INV.ItemID =I.ID64
WHERE CharID =@CharID AND Inv.Slot=13
SELECT @WepRefID2 = I.ID64
FROM SRO_VT_SHARD.._Inventory Inv
INNER JOIN SRO_VT_SHARD.._Items I
ON INV.ItemID =I.ID64
WHERE CharID =@CharID AND Inv.Slot=13
SELECT @ArenaRefID = I.RefItemID
FROM SRO_VT_SHARD.._Inventory Inv
INNER JOIN SRO_VT_SHARD.._Items I
ON INV.ItemID =I.ID64
WHERE CharID =@CharID AND Inv.Slot=15
SELECT @OptLevel = I.OptLevel
FROM SRO_VT_SHARD.._Inventory Inv
INNER JOIN SRO_VT_SHARD.._Items I
ON INV.ItemID =I.ID64
WHERE CharID =@CharID AND Inv.Slot=13
SELECT @Data = I.Data
FROM SRO_VT_SHARD.._Inventory Inv
INNER JOIN SRO_VT_SHARD.._Items I
ON Inv.ItemID = I.ID64
WHERE CharID = @CharID AND Inv.Slot=15
SET @UP = (SELECT UP FROM Upgrade Where Req =@WepRefID)
IF EXISTS (SELECT * FROM SRO_VT_SHARD..Upgrade WHERE Req =@WepRefID)
BEGIN
If ( @OptLevel =8 And @Gold >=50000000000 AND @ArenaRefID='25834' AND @Data>=100)--Staff
BEGIN
UPDATE _Items SET RefItemID = @Up ,OptLevel=0 WHERE ID64=@WepRefID2
UPDATE _Char SET RemainGold =RemainGold-50000000000 WHERE CharID=@CharID
EXEC SRO_VT_SHARD.._STRG_DEL_ITEM_NoTX 1,@CharID,15
END
END