قسم الشروحات و البرامج المستخدمة في عمل السيرفرات الخاصة[ قسم متخصص فى شروحات و البرامج في عمل السيرفرات الخاصة ] [ يرجى عدم وضع الأسئلة والاستفسارات في هذا القسم ]
المشاركة الأصلية كتبت بواسطة Jayden
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
ينفع يا باشا .. انا عملتلك ال Proc واقراه وهتفهم
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: StoredProcedure [dbo].[_SpellUpgSys] Script Date: 4/1/2016 9:49:24 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[_JaydenUpg]
@CharID INT,
@ItemID int,
@Slot1 int,
@Slot2 int
AS
DECLARE @IID int
,@IID2 int
,@RefID int
,@RefID2 int
,@InvID int
,@Type varchar(50) = NULL
,@T1 int
,@T2 int
,@T3 int
,@T4 int
,@NID int
,@Gender varchar(8)
,@Color varchar(16)
,@DG int
IF @ItemID = '42572' -- Scroll ID
SET @Type = 'Weapon'
IF @ItemID = '42573' -- Scroll ID
SET @Type = 'Set'
IF @ItemID = '42574' -- Scroll ID
SET @Type = 'Shield'
IF @ItemID = '42575' -- Scroll ID
SET @Type = 'Access'
/**_# Get ItemID of item in slot 13.*/
SELECT TOP 1 @IID=ID64,@RefID=RefItemID
FROM SRO_VT_SHARD.dbo._Items I INNER JOIN SRO_VT_SHARD.dbo._Inventory IV
WITH(NOLOCK) ON I.ID64 = IV.ItemID
WHERE Iv.Slot = @Slot1 AND CharID = @CharID
/**_# Get ItemID of item in slot 14.*/
SELECT TOP 1 @IID2=ID64,@RefID2=RefItemID
FROM SRO_VT_SHARD.dbo._Items I INNER JOIN SRO_VT_SHARD.dbo._Inventory IV
WITH(NOLOCK) ON I.ID64 = IV.ItemID
WHERE Iv.Slot = @Slot2 AND CharID = @CharID
IF @IID = 0 AND @RefID = 0
BEGIN
RETURN -1
END
IF @IID > 0 AND @RefID > 0
BEGIN
/**_# Get all required informations to upgrade the item.*/
SELECT TOP 1 @T1 = T1 , @T2 = T2 , @T3 = T3 , @T4 = T4,@Gender = Gender,@Color = Color ,@DG = DG
FROM SRO_VT_SHARDLOG.dbo._UpgradeItems
WITH(NOLOCK) WHERE [TYPE] = @Type
AND [Required] = 'Low'
AND ID = @RefID
SELECT TOP 1 @NID = ID
FROM SRO_VT_SHARDLOG.dbo._UpgradeItems
WITH(NOLOCK) WHERE [TYPE] = @Type
AND T1 = @T1
AND T2 = @T2
AND T3 = @T3
AND T4 = @T4
AND [Required] = 'Top'
AND Gender = @Gender
AND Color = @Color
AND DG = @DG
/**_# Upgrade your item.*/
IF @T1 IS NOT NULL BEGIN
DELETE FROM SRO_VT_SHARD.dbo.Items
WHERE RefItemID = @RefID2 and ID64 = @IID2
UPDATE SRO_VT_SHARD.dbo._Items
SET RefItemID = @NID , OptLevel = '0', MagParamNum = '0'
, MagParam1 = '0'
, MagParam2 = '0'
, MagParam3 = '0'
, MagParam4 = '0'
, MagParam5 = '0'
, MagParam6 = '0'
, MagParam7 = '0'
, MagParam8 = '0'
, MagParam9 = '0'
, MagParam10 = '0'
, MagParam11 = '0'
, MagParam12 = '0'
WHERE ID64 = @IID
END
END
وأدى ال Table
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: Table [dbo].[_UpgradeItems] Script Date: 4/1/2016 10:29:10 PM ******/
SET ANSI_NULLS ON
GO