
Originally Posted by
GranPhilar
i have a dura shading script i cant remember where i got it from but the problem is where do i add the script to. Ill be nice and ill share the script so maybe someone can share where i can add it to.
Code:
CREATE PROCEDURE [dbo].[DEGRADE_SPECIALITEMS] AS
DECLARE
@ItemDurability Int,
@NewDura3 int,
@NewDura2 int,
@NewDura1 int,
@NewDura0 int,
@NewDuraR int
set nocount on
SET @NewDura3 = 3
SET @NewDura2 = 2
SET @NewDura1 = 1
SET @NewDura0 = 0
SET @NewDuraR = -1
SELECT @ItemDurability = ItemDurability FROM tblSpecialItem1
IF @ItemDurability = 4
BEGIN
UPDATE tblSpecialItem1
SET ItemDurability = @NewDura3
WHERE ItemIndex <100 AND ItemDurability =4
AND WindowKind!=2
END
ELSE
BEGIN
IF @ItemDurability = 3
UPDATE tblSpecialItem1
SET ItemDurability = @NewDura2
WHERE ItemIndex <100 AND ItemDurability =3
AND WindowKind!=2
END
BEGIN
IF @ItemDurability = 2
UPDATE tblSpecialItem1
SET ItemDurability = @NewDura1
WHERE ItemIndex <100 AND ItemDurability =2
AND WindowKind!=2
END
BEGIN
IF @ItemDurability = 1
UPDATE tblSpecialItem1
SET ItemDurability = @NewDura0
WHERE ItemIndex <100 AND ItemDurability =1
AND WindowKind!=2
END
BEGIN
IF @ItemDurability = 0
UPDATE tblSpecialItem1
SET ItemDurability = @NewDuraR
WHERE ItemIndex <100 AND ItemDurability =1
AND WindowKind!=2
END
BEGIN
IF @ItemDurability = -1
DELETE tblSpecialItem1 WHERE ItemDurability=-1
AND WindowKind!=2
END