/****** Object: Table [dbo].[_ItemPoolAutoEquipment] Script Date: 03/26/2017 00:27:29 ******/ SET ANSI_NULLS ON GO
SET QUOTED_IDENTIFIER ON GO
SET ANSI_PADDING ON GO
CREATE TABLE [dbo].[_ItemPoolAutoEquipment]( [Service] [int] NOT NULL, [ID] [int] NOT NULL, [CodeName128] [varchar](129) NOT NULL, [TypeID1] [tinyint] NOT NULL, [TypeID2] [tinyint] NOT NULL, [TypeID3] [tinyint] NOT NULL, [TypeID4] [tinyint] NOT NULL, [Country] [tinyint] NOT NULL, [Rarity] [tinyint] NOT NULL, [ReqLevelType1] [int] NOT NULL, [ReqLevel1] [tinyint] NOT NULL, [ReqLevelType2] [int] NOT NULL, [ReqLevel2] [tinyint] NOT NULL, [ReqLevelType3] [int] NOT NULL, [ReqLevel3] [tinyint] NOT NULL, [ReqLevelType4] [int] NOT NULL, [ReqLevel4] [tinyint] NOT NULL, CONSTRAINT [PK__ItemPoolAutoEquipment] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]
USE [SRO_VT_SHARD] GO /****** Object: StoredProcedure [dbo].[_FN_ADD_INITIAL_EQUIP_DEPI] Script Date: 03/26/2017 00:24:35 ******/ SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER OFF GO ------------------------------------------------------------------------------------- CREATE PROCEDURE [dbo].[_FN_ADD_INITIAL_EQUIP_DEPI] @charname AS varchar(64), @slot AS TINYINT, @codename AS varchar(129), @data AS INT AS ---------------------------------------------------------- -- Step1. أ¬•”إ¾أ¬´أ*...إں“ أ¬§‘أ¬”“´ ë”إ¾£أ¬إں“¼ë ¤ëإں ” أ¬¸ë²¤أ*” 리 أ¬إں ¬ëآ،¯أ¬´ ë¹”إ¾أ¬””أ‹” ëإں ”ê°â”إںآ،¬ أ*â”إ¾¢•أ¬¸ ---------------------------------------------------------- DECLARE @charID INT SET @charID = (select CharID from _Char where CharName16 = @charname) DECLARE @ItemInSlot BIGINT SET @ItemInSlot = 0 SELECT @ItemInSlot = ItemID FROM _Inventory WHERE CharID = @charID AND Slot = @slot IF (@ItemInSlot <> 0) BEGIN RETURN -1 END ---------------------------------------------------------- -- Step2. أ¬•”إ¾أ¬´أ*...إں“ أ¬أ†’أ¬”إ¾± ---------------------------------------------------------- DECLARE @refItemID INT SET @refItemID = (select ID from _RefObjCommon where CodeName128 = @codename) DECLARE @NewItem BIGINT DECLARE @serial BIGINT SET @serial = 0
EXEC @NewItem = _STRG_ALLOC_ITEM_NoTX @serial OUTPUT IF (@NewItem = 0) BEGIN RETURN -2 END
IF (EXISTS(SELECT ItemID FROM _Inventory WHERE ItemID = @NewItem)) BEGIN RETURN -181818 END IF (EXISTS(SELECT ItemID FROM _Chest WHERE ItemID = @NewItem)) BEGIN RETURN -282828 END UPDATE _Items SET RefItemID = @refItemID, OptLevel = 4, Variance = 34359738367, Data = @data, MagParamNum='2',MagParam1='30064771144',MagParam2= '30064771150' WHERE ID64 = @NewItem IF (@@ERROR <> 0) BEGIN RETURN -3 END ---------------------------------------------------------- -- Step3. أ¬•”إ¾أ¬´أ*...إں“ أ¬”إ¾¸أ*إں’... ---------------------------------------------------------- UPDATE _Inventory SET ItemID = @NewItem WHERE CharID = @charID AND Slot = @slot IF (@@ERROR <> 0) BEGIN RETURN -4 END RETURN @NewItem
Trigger
كود PHP:
USE [SRO_VT_SHARD] GO /****** Object: Trigger [dbo].[TR_AUTOEQUIP_DEPIEDRA] Script Date: 03/26/2017 00:19:39 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TRIGGER [dbo].[TR_AUTOEQUIP_DEPIEDRA] ON [dbo].[_Char] AFTER UPDATE AS BEGIN declare @Newlvl as tinyint = (select CurLevel from inserted) declare @charID as int = (select CharID from inserted) if @Newlvl between 13 and 99 begin declare @refCharID int declare @charname varchar(64) declare @charLevel tinyint set @refCharID = (select RefObjID from SRO_VT_SHARD.dbo._Char where CharID = @charID) set @charname = (select CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @charID) set @charLevel = (select CurLevel from SRO_VT_SHARD.dbo._Char where CharID = @charID) Declare @refMail INT = (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID) AND Slot ='1') Declare @refMailID INT = (Select RefItemID From SRO_VT_SHARD.dbo._Items Where ID64 = @refMail) Declare @refWeapon INT Declare @weapon INT = (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID) AND Slot ='6') Declare @refWeaponID INT = (Select RefItemID From SRO_VT_SHARD.dbo._Items Where ID64 = @weapon) Declare @weaponType Tinyint = (Select Typeid4 from SRO_VT_SHARD.dbo._RefObjCommon where ID = @refWeaponID) Declare @refShield INT Declare @Shield INT = (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID) AND Slot ='7') Declare @refShieldID INT = (Select RefItemID From SRO_VT_SHARD.dbo._Items Where ID64 = @Shield) Declare @ShieldType Tinyint = (Select Typeid4 from SRO_VT_SHARD.dbo._RefObjCommon where ID = @refShieldID) declare @mail_codename varchar(250) declare @chr_gender varchar(250) declare @item_level varchar(250) declare @itemcodename varchar(250) select @mail_codename = CodeName128 from SRO_VT_SHARD.dbo._RefObjCommon where ID = @refMailID declare @degree varchar(25)
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 0 Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 1 Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 2 Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 3 Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 4 Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 5 Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 9 Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 10 Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 11 Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 12
if (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID) AND Slot ='6') != 0 begin If ((Select TypeID4 from SRO_VT_SHARD.dbo._RefObjCommon where ID = (Select top 1 RefItemID from SRO_VT_SHARD.dbo._items where id64 = @weapon)) = @weaponType ) -- Weapon Begin Set @refWeapon = (Select top 1 ID from SRO_VT_SHARD.dbo._ItemPoolAutoEquipment where Service = 1 AND TypeID1=3 AND --- Weapon TypeID2=1 AND TypeID3=6 AND TypeID4=@weaponType Group by SRO_VT_SHARD.dbo._ItemPoolAutoEquipment.ID,SRO_VT_SHARD.dbo._ItemPoolAutoEquipment.reqlevel1 having (MAX(ReqLevel1)<= @Newlvl) Order By ReqLevel1 Desc ) Update SRO_VT_SHARD.dbo._Items set RefItemID= @refWeapon where ID64= @weapon Update SRO_VT_SHARD.dbo._Items set OptLevel= 4,Variance= 34359738367,Data= 200, MagParamNum='2',MagParam1='30064771144',MagParam2= '30064771150' where ID64= @weapon END end
if (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID) AND Slot ='7') != 0 begin If ((Select ID from SRO_VT_SHARD.dbo._RefObjCommon where ID in (Select Refitemid from SRO_VT_SHARD.dbo._Items where ID64 = @Shield)) not in (62,3655)) Begin Set @refShield = (Select top 1 ID from SRO_VT_SHARD.dbo._ItemPoolAutoEquipment WITH (Nolock) where Service = 1 AND TypeID1=3 AND --- Shield TypeID2=1 AND TypeID3=4 AND TypeID4=@ShieldType Group by SRO_VT_SHARD.dbo._ItemPoolAutoEquipment.ID,SRO_VT_SHARD.dbo._ItemPoolAutoEquipment.reqlevel1 having (MAX(ReqLevel1)<= @Newlvl) Order By ReqLevel1 Desc ) Update SRO_VT_SHARD.dbo._Items set RefItemID= @refShield where ID64= @Shield Update SRO_VT_SHARD.dbo._Items set OptLevel= 4,Variance= 34359738367,Data= 200, MagParamNum='2',MagParam1='30064771144',MagParam2= '30064771150' where ID64= @Shield END end
IF @Newlvl >= 90 and @Newlvl <= 99 BEGIN set @item_level = '09' --DG set @degree = '_C' end end
IF @Newlvl >= 85 and @Newlvl <= 89 BEGIN set @item_level = '09' --DG set @degree = '_B' end end
IF @Newlvl >= 81 and @Newlvl <= 84 BEGIN set @item_level = '09' --DG set @degree = '_A' end
IF @Newlvl >= 77 and @Newlvl <= 80 BEGIN set @item_level = '08' --DG IF @item_level = '09' begin set @degree = '_A' end else if @item_level = '08' begin set @degree = '_C' end end
IF @Newlvl >= 73 and @Newlvl <= 76 BEGIN set @item_level = '08' --DG IF @item_level = '09' begin set @degree = '_A' end else if @item_level = '08' begin set @degree = '_B' end end
IF @Newlvl >= 69 and @Newlvl <= 72 BEGIN set @item_level = '08' --DG set @degree = '_A' end
IF @Newlvl >= 65 and @Newlvl <= 68 BEGIN set @item_level = '07' --DG IF @item_level = '08' begin set @degree = '_A' end else if @item_level = '07' begin set @degree = '_C' end end
IF @Newlvl >= 61 and @Newlvl <= 64 BEGIN set @item_level = '07' --DG IF @item_level = '08' begin set @degree = '_A' end else if @item_level = '07' begin set @degree = '_B' end end
IF @Newlvl >= 57 and @Newlvl <= 60 BEGIN set @item_level = '07' --DG set @degree = '_A' end
IF @Newlvl >= 53 and @Newlvl <= 56 BEGIN set @item_level = '06' --DG IF @item_level = '07' begin set @degree = '_A' end else if @item_level = '06' begin set @degree = '_C' end end
IF @Newlvl >= 50 and @Newlvl <= 52 BEGIN set @item_level = '06' --DG IF @item_level = '07' begin set @degree = '_A' end else if @item_level = '06' begin set @degree = '_B' end end
IF @Newlvl >= 47 and @Newlvl <= 49 BEGIN set @item_level = '06' --DG set @degree = '_A' end
IF @Newlvl >= 43 and @Newlvl <= 46 BEGIN set @item_level = '05' --DG IF @item_level = '06' begin set @degree = '_A' end else if @item_level = '05' begin set @degree = '_C' end end
IF @Newlvl >= 40 and @Newlvl <= 42 BEGIN set @item_level = '05' --DG IF @item_level = '06' begin set @degree = '_A' end else if @item_level = '05' begin set @degree = '_B' end end
IF @Newlvl >= 37 and @Newlvl <= 39 BEGIN set @item_level = '05' --DG set @degree = '_A' end
IF @Newlvl >= 34 and @Newlvl <= 36 BEGIN set @item_level = '04' --DG IF @item_level = '05' begin set @degree = '_A' end else if @item_level = '05' begin set @degree = '_C' end end
IF @Newlvl >= 31 and @Newlvl <= 33 BEGIN set @item_level = '04' --DG IF @item_level = '05' begin set @degree = '_A' end else if @item_level = '04' begin set @degree = '_B' end end
IF @Newlvl >= 29 and @Newlvl <= 30 BEGIN set @item_level = '04' --DG set @degree = '_A' end
IF @Newlvl >= 26 and @Newlvl <= 28 BEGIN set @item_level = '03' --DG IF @item_level = '04' begin set @degree = '_A' end else if @item_level = '03' begin set @degree = '_C' end end
IF @Newlvl >= 23 and @Newlvl <= 25 BEGIN set @item_level = '03' --DG IF @item_level = '04' begin set @degree = '_A' end else if @item_level = '03' begin set @degree = '_B' end end
IF @Newlvl = 21 or @Newlvl = 22 BEGIN set @item_level = '03' --DG set @degree = '_A' end
IF @Newlvl >= 18 and @Newlvl <= 20 BEGIN set @item_level = '02' --DG IF @item_level = '03' begin set @degree = '_B' end else if @item_level = '02' begin set @degree = '_C' end end
IF @Newlvl >= 15 and @Newlvl <= 17 BEGIN set @item_level = '02' --DG IF @item_level = '03' begin set @degree = '_A' end else if @item_level = '02' begin set @degree = '_B' end end
IF @Newlvl >= 13 and @Newlvl <= 14 BEGIN set @item_level = '02' --DG set @degree = '_A' end
if @refCharID between 1907 and 1919 or @refCharID between 14875 and 14887 begin set @chr_gender = 'M' --male end
if @refCharID between 1920 and 1932 or @refCharID between 14888 and 14900 begin set @chr_gender = 'W' --female end
if @refCharID between 1907 and 1919 or @refCharID between 1920 and 1932 begin set @itemcodename = 'ITEM_CH_RING_' + @item_level + @degree EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,11,@itemcodename,200 EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,12,@itemcodename,200 set @itemcodename = 'ITEM_CH_EARRING_' + @item_level + @degree EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,9,@itemcodename,200 set @itemcodename = 'ITEM_CH_NECKLACE_' + @item_level + @degree EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,10,@itemcodename,200 end if @refCharID between 14875 and 14887 or @refCharID between 14888 and 14900 begin set @itemcodename = 'ITEM_EU_RING_' + @item_level + @degree EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,11,@itemcodename,200 EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,12,@itemcodename,200 set @itemcodename = 'ITEM_EU_EARRING_' + @item_level + @degree EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,9,@itemcodename,200 set @itemcodename = 'ITEM_EU_NECKLACE_' + @item_level + @degree EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,10,@itemcodename,200 end
المشاركة الأصلية كتبت بواسطة Scrox
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
table
كود PHP:
USE [SRO_VT_SHARD]
GO
/****** Object: Table [dbo].[_ItemPoolAutoEquipment] Script Date: 03/26/2017 00:27:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[_ItemPoolAutoEquipment](
[Service] [int] NOT NULL,
[ID] [int] NOT NULL,
[CodeName128] [varchar](129) NOT NULL,
[TypeID1] [tinyint] NOT NULL,
[TypeID2] [tinyint] NOT NULL,
[TypeID3] [tinyint] NOT NULL,
[TypeID4] [tinyint] NOT NULL,
[Country] [tinyint] NOT NULL,
[Rarity] [tinyint] NOT NULL,
[ReqLevelType1] [int] NOT NULL,
[ReqLevel1] [tinyint] NOT NULL,
[ReqLevelType2] [int] NOT NULL,
[ReqLevel2] [tinyint] NOT NULL,
[ReqLevelType3] [int] NOT NULL,
[ReqLevel3] [tinyint] NOT NULL,
[ReqLevelType4] [int] NOT NULL,
[ReqLevel4] [tinyint] NOT NULL,
CONSTRAINT [PK__ItemPoolAutoEquipment] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_FN_ADD_INITIAL_EQUIP_DEPI] Script Date: 03/26/2017 00:24:35 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
-------------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[_FN_ADD_INITIAL_EQUIP_DEPI] @charname AS varchar(64), @slot AS TINYINT, @codename AS varchar(129), @data AS INT
AS
----------------------------------------------------------
-- Step1. أ¬•”إ¾أ¬´أ*...إں“ أ¬§‘أ¬”“´ ë”إ¾£أ¬إں“¼ë ¤ëإں ” أ¬¸ë²¤أ*” 리 أ¬إں ¬ëآ،¯أ¬´ ë¹”إ¾أ¬””أ‹” ëإں ”ê°â”إںآ،¬ أ*â”إ¾¢•أ¬¸
----------------------------------------------------------
DECLARE @charID INT
SET @charID = (select CharID from _Char where CharName16 = @charname)
DECLARE @ItemInSlot BIGINT
SET @ItemInSlot = 0
SELECT @ItemInSlot = ItemID FROM _Inventory WHERE CharID = @charID AND Slot = @slot
IF (@ItemInSlot <> 0)
BEGIN
RETURN -1
END
----------------------------------------------------------
-- Step2. أ¬•”إ¾أ¬´أ*...إں“ أ¬أ†’أ¬”إ¾±
----------------------------------------------------------
DECLARE @refItemID INT
SET @refItemID = (select ID from _RefObjCommon where CodeName128 = @codename)
DECLARE @NewItem BIGINT
DECLARE @serial BIGINT
SET @serial = 0
EXEC @NewItem = _STRG_ALLOC_ITEM_NoTX @serial OUTPUT
IF (@NewItem = 0)
BEGIN
RETURN -2
END
IF (EXISTS(SELECT ItemID FROM _Inventory WHERE ItemID = @NewItem))
BEGIN
RETURN -181818
END
IF (EXISTS(SELECT ItemID FROM _Chest WHERE ItemID = @NewItem))
BEGIN
RETURN -282828
END
UPDATE _Items SET RefItemID = @refItemID, OptLevel = 4, Variance = 34359738367, Data = @data, MagParamNum='2',MagParam1='30064771144',MagParam2= '30064771150' WHERE ID64 = @NewItem
IF (@@ERROR <> 0)
BEGIN
RETURN -3
END
----------------------------------------------------------
-- Step3. أ¬•”إ¾أ¬´أ*...إں“ أ¬”إ¾¸أ*إں’...
----------------------------------------------------------
UPDATE _Inventory SET ItemID = @NewItem WHERE CharID = @charID AND Slot = @slot
IF (@@ERROR <> 0)
BEGIN
RETURN -4
END
RETURN @NewItem
Trigger
كود PHP:
USE [SRO_VT_SHARD]
GO
/****** Object: Trigger [dbo].[TR_AUTOEQUIP_DEPIEDRA] Script Date: 03/26/2017 00:19:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[TR_AUTOEQUIP_DEPIEDRA] ON [dbo].[_Char] AFTER UPDATE
AS
BEGIN
declare @Newlvl as tinyint = (select CurLevel from inserted)
declare @charID as int = (select CharID from inserted)
if @Newlvl between 13 and 99
begin
declare @refCharID int
declare @charname varchar(64)
declare @charLevel tinyint
set @refCharID = (select RefObjID from SRO_VT_SHARD.dbo._Char where CharID = @charID)
set @charname = (select CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @charID)
set @charLevel = (select CurLevel from SRO_VT_SHARD.dbo._Char where CharID = @charID)
Declare @refMail INT = (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID)
AND Slot ='1')
Declare @refMailID INT = (Select RefItemID From SRO_VT_SHARD.dbo._Items Where ID64 = @refMail)
Declare @refWeapon INT
Declare @weapon INT = (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID)
AND Slot ='6')
Declare @refWeaponID INT = (Select RefItemID From SRO_VT_SHARD.dbo._Items Where ID64 = @weapon)
Declare @weaponType Tinyint = (Select Typeid4 from SRO_VT_SHARD.dbo._RefObjCommon where ID = @refWeaponID)
Declare @refShield INT
Declare @Shield INT = (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID)
AND Slot ='7')
Declare @refShieldID INT = (Select RefItemID From SRO_VT_SHARD.dbo._Items Where ID64 = @Shield)
Declare @ShieldType Tinyint = (Select Typeid4 from SRO_VT_SHARD.dbo._RefObjCommon where ID = @refShieldID)
declare @mail_codename varchar(250)
declare @chr_gender varchar(250)
declare @item_level varchar(250)
declare @itemcodename varchar(250)
select @mail_codename = CodeName128 from SRO_VT_SHARD.dbo._RefObjCommon where ID = @refMailID
declare @degree varchar(25)
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 0
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 1
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 2
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 3
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 4
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 5
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 9
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 10
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 11
Update SRO_VT_SHARD.dbo._Inventory set ItemID = 0 where CharID = @charID and Slot = 12
if (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID)
AND Slot ='6') != 0
begin
If ((Select TypeID4 from SRO_VT_SHARD.dbo._RefObjCommon where ID = (Select top 1 RefItemID from SRO_VT_SHARD.dbo._items where id64 = @weapon))
= @weaponType ) -- Weapon
Begin
Set @refWeapon = (Select top 1 ID from SRO_VT_SHARD.dbo._ItemPoolAutoEquipment where
Service = 1 AND
TypeID1=3 AND --- Weapon
TypeID2=1 AND
TypeID3=6 AND
TypeID4=@weaponType
Group by SRO_VT_SHARD.dbo._ItemPoolAutoEquipment.ID,SRO_VT_SHARD.dbo._ItemPoolAutoEquipment.reqlevel1
having (MAX(ReqLevel1)<= @Newlvl)
Order By ReqLevel1 Desc
)
Update SRO_VT_SHARD.dbo._Items set RefItemID= @refWeapon where ID64= @weapon
Update SRO_VT_SHARD.dbo._Items set OptLevel= 4,Variance= 34359738367,Data= 200, MagParamNum='2',MagParam1='30064771144',MagParam2= '30064771150' where ID64= @weapon
END
end
if (Select ItemID From SRO_VT_SHARD.dbo._Inventory Where CharID=(Select CharID From SRO_VT_SHARD.dbo._Char Where CharID = @charID)
AND Slot ='7') != 0
begin
If ((Select ID from SRO_VT_SHARD.dbo._RefObjCommon where ID in (Select Refitemid from SRO_VT_SHARD.dbo._Items where ID64 = @Shield)) not in (62,3655))
Begin
Set @refShield = (Select top 1 ID from SRO_VT_SHARD.dbo._ItemPoolAutoEquipment WITH (Nolock) where
Service = 1 AND
TypeID1=3 AND --- Shield
TypeID2=1 AND
TypeID3=4 AND
TypeID4=@ShieldType
Group by SRO_VT_SHARD.dbo._ItemPoolAutoEquipment.ID,SRO_VT_SHARD.dbo._ItemPoolAutoEquipment.reqlevel1
having (MAX(ReqLevel1)<= @Newlvl)
Order By ReqLevel1 Desc
)
Update SRO_VT_SHARD.dbo._Items set RefItemID= @refShield where ID64= @Shield
Update SRO_VT_SHARD.dbo._Items set OptLevel= 4,Variance= 34359738367,Data= 200, MagParamNum='2',MagParam1='30064771144',MagParam2= '30064771150' where ID64= @Shield
END
end
IF @Newlvl >= 90 and @Newlvl <= 99
BEGIN
set @item_level = '09' --DG
set @degree = '_C'
end
end
IF @Newlvl >= 85 and @Newlvl <= 89
BEGIN
set @item_level = '09' --DG
set @degree = '_B'
end
end
IF @Newlvl >= 81 and @Newlvl <= 84
BEGIN
set @item_level = '09' --DG
set @degree = '_A'
end
IF @Newlvl >= 77 and @Newlvl <= 80
BEGIN
set @item_level = '08' --DG
IF @item_level = '09'
begin
set @degree = '_A'
end
else if @item_level = '08'
begin
set @degree = '_C'
end
end
IF @Newlvl >= 73 and @Newlvl <= 76
BEGIN
set @item_level = '08' --DG
IF @item_level = '09'
begin
set @degree = '_A'
end
else if @item_level = '08'
begin
set @degree = '_B'
end
end
IF @Newlvl >= 69 and @Newlvl <= 72
BEGIN
set @item_level = '08' --DG
set @degree = '_A'
end
IF @Newlvl >= 65 and @Newlvl <= 68
BEGIN
set @item_level = '07' --DG
IF @item_level = '08'
begin
set @degree = '_A'
end
else if @item_level = '07'
begin
set @degree = '_C'
end
end
IF @Newlvl >= 61 and @Newlvl <= 64
BEGIN
set @item_level = '07' --DG
IF @item_level = '08'
begin
set @degree = '_A'
end
else if @item_level = '07'
begin
set @degree = '_B'
end
end
IF @Newlvl >= 57 and @Newlvl <= 60
BEGIN
set @item_level = '07' --DG
set @degree = '_A'
end
IF @Newlvl >= 53 and @Newlvl <= 56
BEGIN
set @item_level = '06' --DG
IF @item_level = '07'
begin
set @degree = '_A'
end
else if @item_level = '06'
begin
set @degree = '_C'
end
end
IF @Newlvl >= 50 and @Newlvl <= 52
BEGIN
set @item_level = '06' --DG
IF @item_level = '07'
begin
set @degree = '_A'
end
else if @item_level = '06'
begin
set @degree = '_B'
end
end
IF @Newlvl >= 47 and @Newlvl <= 49
BEGIN
set @item_level = '06' --DG
set @degree = '_A'
end
IF @Newlvl >= 43 and @Newlvl <= 46
BEGIN
set @item_level = '05' --DG
IF @item_level = '06'
begin
set @degree = '_A'
end
else if @item_level = '05'
begin
set @degree = '_C'
end
end
IF @Newlvl >= 40 and @Newlvl <= 42
BEGIN
set @item_level = '05' --DG
IF @item_level = '06'
begin
set @degree = '_A'
end
else if @item_level = '05'
begin
set @degree = '_B'
end
end
IF @Newlvl >= 37 and @Newlvl <= 39
BEGIN
set @item_level = '05' --DG
set @degree = '_A'
end
IF @Newlvl >= 34 and @Newlvl <= 36
BEGIN
set @item_level = '04' --DG
IF @item_level = '05'
begin
set @degree = '_A'
end
else if @item_level = '05'
begin
set @degree = '_C'
end
end
IF @Newlvl >= 31 and @Newlvl <= 33
BEGIN
set @item_level = '04' --DG
IF @item_level = '05'
begin
set @degree = '_A'
end
else if @item_level = '04'
begin
set @degree = '_B'
end
end
IF @Newlvl >= 29 and @Newlvl <= 30
BEGIN
set @item_level = '04' --DG
set @degree = '_A'
end
IF @Newlvl >= 26 and @Newlvl <= 28
BEGIN
set @item_level = '03' --DG
IF @item_level = '04'
begin
set @degree = '_A'
end
else if @item_level = '03'
begin
set @degree = '_C'
end
end
IF @Newlvl >= 23 and @Newlvl <= 25
BEGIN
set @item_level = '03' --DG
IF @item_level = '04'
begin
set @degree = '_A'
end
else if @item_level = '03'
begin
set @degree = '_B'
end
end
IF @Newlvl = 21 or @Newlvl = 22
BEGIN
set @item_level = '03' --DG
set @degree = '_A'
end
IF @Newlvl >= 18 and @Newlvl <= 20
BEGIN
set @item_level = '02' --DG
IF @item_level = '03'
begin
set @degree = '_B'
end
else if @item_level = '02'
begin
set @degree = '_C'
end
end
IF @Newlvl >= 15 and @Newlvl <= 17
BEGIN
set @item_level = '02' --DG
IF @item_level = '03'
begin
set @degree = '_A'
end
else if @item_level = '02'
begin
set @degree = '_B'
end
end
IF @Newlvl >= 13 and @Newlvl <= 14
BEGIN
set @item_level = '02' --DG
set @degree = '_A'
end
if @refCharID between 1907 and 1919 or @refCharID between 14875 and 14887
begin
set @chr_gender = 'M' --male
end
if @refCharID between 1920 and 1932 or @refCharID between 14888 and 14900
begin
set @chr_gender = 'W' --female
end
if @refCharID between 1907 and 1919 or @refCharID between 1920 and 1932
begin
set @itemcodename = 'ITEM_CH_RING_' + @item_level + @degree
EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,11,@itemcodename,200
EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,12,@itemcodename,200
set @itemcodename = 'ITEM_CH_EARRING_' + @item_level + @degree
EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,9,@itemcodename,200
set @itemcodename = 'ITEM_CH_NECKLACE_' + @item_level + @degree
EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,10,@itemcodename,200
end
if @refCharID between 14875 and 14887 or @refCharID between 14888 and 14900
begin
set @itemcodename = 'ITEM_EU_RING_' + @item_level + @degree
EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,11,@itemcodename,200
EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,12,@itemcodename,200
set @itemcodename = 'ITEM_EU_EARRING_' + @item_level + @degree
EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,9,@itemcodename,200
set @itemcodename = 'ITEM_EU_NECKLACE_' + @item_level + @degree
EXEC SRO_VT_SHARD.dbo._FN_ADD_INITIAL_EQUIP_DEPI @charname,10,@itemcodename,200
end