|
• الانـتـسـاب » Feb 2012
|
• رقـم العـضـويـة » 98501
|
• المشـــاركـات » 655
|
• الـدولـة » Maadi
|
• الـهـوايـة » Travel, Music and Coding
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 22
|
|
|
رد: .•°« كيوري بسيط لحل مشكلة إستخدام TwoHand Weapon + Shield فى نفس الوقت »°•.
دة الفكرة الخاصه بيا وهيا انى اشيل الشيلد دة بعد ما يحطهاله فى الانفتورى وكمان يديله بلوك 24 ساعه عشان استخدم البج دة وباردوا فيه نوتك بتتبعتله والبوت بيكلمه انا مجربتش البروديسير لكن ظبط الكلام بتاعى عليه ولسا مجربتش لانى معنديش امكانيه تخلينى اجربه دلوقتى نخش على البروديسير :
كود:
IF @EventID in (4,6)
Begin
declare @Charname4 nvarchar(max) = (select Charname16 from SRO_VT_SHARD.._Char where charid = @CharID)
Declare @WeaponID Int , @ShieldID Int , @RefWeaponID Int , @Slot Int
Set @WeaponID = (Select ItemID From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and Slot = 6)
Set @ShieldID = (Select ItemID From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and Slot = 7)
IF @ShieldID > 0 and @WeaponID > 0
Begin
Set @RefWeaponID = (Select RefItemID From [SRO_VT_SHARD].[dbo].[_Items] Where ID64 = @WeaponID)
IF @RefWeaponID Is Not Null and @RefWeaponID in
(Select ID From [SRO_VT_SHARD].[dbo].[_RefObjCommon] Where CodeName128 Like 'ITEM_CH_SPEAR_%'
Or CodeName128 Like 'ITEM_CH_TBLADE_%' Or CodeName128 Like 'ITEM_CH_BOW_%'
Or CodeName128 Like 'ITEM_EU_TSWORD_%' Or CodeName128 Like 'ITEM_EU_AXE_%'
Or CodeName128 Like 'ITEM_EU_DAGGER_%' Or CodeName128 Like 'ITEM_EU_CROSSBOW_%'
Or CodeName128 Like 'ITEM_EU_TSTAFF_%' Or CodeName128 Like 'ITEM_EU_HARP_%')
Begin
Set @Slot = (Select Top 1 Slot From [SRO_VT_SHARD].[dbo].[_Inventory] Where ItemID = 0 and CharID = @CharID and Slot > 12 Order by Slot)
IF @Slot Is Not Null
begin
Update [SRO_VT_SHARD].[dbo].[_Inventory] Set ItemID = 0 Where Slot = 7 and CharID = @CharID
Update [SRO_VT_SHARD].[dbo].[_Inventory] Set ItemID = 0 Where Slot = @Slot and CharID = @CharID
begin
declare @5 smalldatetime , @6 smalldatetime
set @5 = getdate() Set @6 = dateadd(day,1,getdate());
exec SRO_VT_SHARD.._Block_Loren 'Ban',@Charname4,@1,@2
SELECT 'Banned'
begin
INSERT INTO SRO_VT_SHARD.dbo._Notification(Type, Content, Target,Executor,Notified) VALUES(3,'You are banned because you are cheater for 1day.',@Charname4,'BOT1',0)
INSERT INTO SRO_VT_SHARD.dbo._Notification(Type, Content, Target,Executor,Notified) VALUES(7,'Ban.',@Charname4,'BOT1',0)
INSERT INTO SRO_VT_SHARD.dbo._Notification(Type, Content, Target,Executor,Notified) VALUES(1,'['+@Charname4 +'] tried to break our system by using his/her double-weapon in the same time.',@Charname4,'BOT1',0)
End
End
End
End
End
End
هتحتاج تكريت التابل دة عندك :
كود:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_Block_Loren] Script Date: 28/11/2015 12:05:19 ص ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[_Block_Loren]
@Type varchar(33),
@Charname varchar(max),
@BeginTime datetime,
@EndTime datetime
as
begin
declare @CharID int = (select CHarID from _Char where Charname16 = @Charname)
declare @UserJID int = (select userJID from _user where charID = @CharID)
DECLARE @ID VARCHAR (64)
DECLARE @Reason VARCHAR(128)
SET @ID = (Select STRuserID FROM SRO_VT_ACCOUNT..TB_User Where JID = @userJID)
if (@Type in ('Ban','1'))
begin
SET @Reason = 'Ban Reason Here'
if not exists (select UserJID from SRO_VT_ACCOUNT..[_Punishment] where UserJID = @UserJID)
begin
INSERT SRO_VT_ACCOUNT..[_Punishment]([UserJID],[Type],[Executor],[Shard],[CharName],[CharInfo],[PosInfo] ,[Guide],[Description],[RaiseTime],[BlockStartTime],[BlockEndTime],[PunishTime],[Status])
VALUES (@userJID,1,1,0,@CharName,1,1,@Reason,@Reason,@BeginTime,@BeginTime,@EndTime,@EndTime,0);
----------------------------------------------------------
DECLARE @ReasonID INT
SET @ReasonID =(Select SerialNo FROM SRO_VT_ACCOUNT.._Punishment Where UserJID = @userJID)
if @ReasonID is null
begin
set @ReasonID = 15
end
else
begin
set @ReasonID = @ReasonID
end
----------------------------------------------------------
INSERT SRO_VT_ACCOUNT..[_BlockedUser]([UserJID],[UserID],[Type],[SerialNo],[TimeBegin],[TimeEnd])
VALUES(@userJID,@ID,1,@ReasonID,@BeginTime,@EndTime);
end
else if exists (select UserJID from SRO_VT_ACCOUNT..[_Punishment] where UserJID = @UserJID)
begin
Print 'You can not ban this User because he already banned'
end
end
else if (@Type in ('Unban','2'))
begin
if exists (select UserJID from SRO_VT_ACCOUNT.._BlockedUser where UserJID = @UserJID)
begin
DELETE FROM SRO_VT_ACCOUNT..[_BlockedUser] WHERE UserJID = @UserJID
DELETE FROM SRO_VT_ACCOUNT..[_Punishment] WHERE UserJID = @UserJID
end
else if not exists (select UserJID from SRO_VT_ACCOUNT.._BlockedUser where UserJID = @UserJID)
begin
print 'There is no User called '+ '[' + (convert(varchar(max),@ID)) + ']' + ' and Charname called [' + @Charname+']'
end
end
end
|