|
• الانـتـسـاب » Nov 2015
|
• رقـم العـضـويـة » 127853
|
• المشـــاركـات » 27
|
• الـدولـة »
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
لو سمحتم عايز Auto Equipment شغال
أنا استخدمت السيستم ده مشتغلش .. لما بلفل واعمل TP مبيجليش حاجة حتى بعد تعدل AddNewChar ان كل ال Items تبقى Sun .. و Normal سواء كده او كده مش شغال
Procedure
كود PHP:
CREATE procedure [dbo].[_AutoEquipment] @CharID INT, @data2 INT AS
DECLARE @Flag INT = 0, @ID64 INT, @ReFObjID INT, @ReFItemID INT, @T1 TINYINT, @T2 TINYINT, @T3 TINYINT, @T4 TINYINT, @optLvl TINYINT, @race BIT, @Gen TINYINT;
SELECT @Gen = CASE WHEN RefObjID BETWEEN 1920 AND 1932 THEN 2 WHEN RefObjID <= 1919 THEN 1 WHEN RefObjID BETWEEN 14875 AND 14887 THEN 3 WHEN RefObjID BETWEEN 14888 AND 14900 THEN 4 ELSE 0 END FROM SRO_VT_SHARD.._Char WITH (NOLOCK) WHERE CharID = @CharID
SELECT @race = CASE WHEN @Gen IN (1,2) THEN 0 WHEN @Gen IN (3,4) THEN 1 ELSE NULL END
IF @race IS NULL) RETURN;
WHILE @Flag <13 BEGIN
SELECT @ID64 = 0, @ReFItemID = 0, @ReFObjID = 0, @T1 = 0, @T2 =0, @T3 = 0, @T4 = 0
IF @Flag != 8 BEGIN
SELECT @ID64 = I.ItemID, @ReFObjID = IT.RefItemID, @optLvl = IT.OptLevel FROM SRO_VT_SHARD.._Inventory I WITH (NOLOCK) INNER JOIN SRO_VT_SHARD.._Items IT WITH (NOLOCK) ON I.ItemID = IT.ID64 WHERE I.Slot = @Flag AND I.CharID @CharID AND IT.RefItemID NOT IN (62,3655, 3823, 24459, 38345, 10383, 10885,19644, 24460, 38346) -- Arrows & Bolts...
IF @ID64 != 0 AND @ReFObjID IS NOT NULL BEGIN
SELECT @T1 = TypeID1,@T2 = TypeID2, @T3 = TypeID3, @T4 = TypeID4 FROM SRO_VT_SHARD.._RefObjCommon WHERE ID = @ReFObjID
SELECT @optLvl = CASE WHEN @optLvl >= 3 THEN @optLvl ELSE 3 END
UPDATE SRO_VT_SHARD.._Items SET RefItemID = Q.ID, Variance = ISNULL(Q.Va, 0), MagParam1 = Q.P1, MagParam2 = Q.P2, MagParam3 = Q.P3, MagParam4 = Q.P4, MagParam5 = Q.P5, MagParam6 = Q.P6, MagParam7 = Q.P7, MagParam8 = Q.P8, MagParam9 = Q.P9, MagParamNum = Q.MagParamNum, OptLevel = @optLvl FROM (SELECT TOP 1 ID, P1, P2, P3, P4, P5, P6, P7, P8, P9, Va, CASE WHEN P1 = 0 THEN 0 WHEN P5 = 0 THEN 4 WHEN P6 = 0 THEN 5 WHEN P7 = 0 THEN 6 WHEN P8 = 0 THEN 7 ELSE 0 END AS MagParamNum FROM SRO_VT_ROYAL.._royalitempoolautoequipment P WITH (NOLOCK) WHERE typeid1 = @T1 AND typeid2 = @T2 AND typeid3 = @T3 AND typeid4 = @T4 AND (Gender = @Gen OR Gender = 0) AND Race = @race AND ReqLevel1 <= @data2 ORDER BY reqlevel1 DESC) AS Q WHERE ID64 = @ID64 AND ID64 != 0 AND Q.ID != 0 END END
SET @Flag += 1 END
Table
كود PHP:
CREATE TABLE [dbo].[_RoyalItemPoolAutoEquipment](
[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,
[ReqLevel1] [tinyint] NOT NULL,
[Gender] [tinyint] NULL,
[P1] [bigint] NULL,
[P2] [bigint] NULL,
[P3] [bigint] NULL,
[P4] [bigint] NULL,
[P5] [bigint] NULL,
[P6] [bigint] NULL,
[P7] [bigint] NULL,
[P8] [bigint] NULL,
[P9] [bigint] NULL,
[MagParamNum] [tinyint] NULL,
[Va] [bigint] NULL,
[Race] [bit] NULL,
CONSTRAINT [PK__RoyalItemPoolAutoEquipment] 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]
انا عارف ان السيستم ده معقد .. بس ميزته انه سريع .. فبيقلل ال Ms وبالتالى اى Lag
وانا ضيفت دى فى AddLogChar
كود PHP:
IF @EventID = 22 AND @Data2 BETWEEN 0 AND 71
BEGIN
EXEC SRO_VT_SHARDLOG.._AutoEquipment @CharID, @Data2
END
ياريت اللى يعرف الحل يقولى
ولو هضطر استخدم سيستم تانى ووقفت معايا بقى .. هستخدمه بس ياريت حد يقولى عليه وياريت يكون كامل
وعلى فكره انا استخدمت السيستم ده
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
وبرضه نفس المشكلة
ارجو المساعده فى اسرع وقت
|