قسم الشروحات و البرامج المستخدمة في عمل السيرفرات الخاصة[ قسم متخصص فى شروحات و البرامج في عمل السيرفرات الخاصة ] [ يرجى عدم وضع الأسئلة والاستفسارات في هذا القسم ]
حولت اجمع اكبر كم من السيستمات الي مرت عليا وممكن تفيد الناس ..
Anti Job Cheat Thief
_AddLogItem
كود PHP:
IF @Operation = '114'
BEGIN
DECLARE @CheaterName varchar(max) = (SELECT CharName16 from SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID),
@RegionID INT = (SELECT LatestRegion FROM sro_VT_shard.dbo._Char WHERE CharID = @CharID)
DECLARE @JobType1 INT = (SELECT JobType From SRO_VT_SHARD.dbo._CharTrijob Where CharID = @CharID )
IF (@RegionID IN (SELECT wRegionID FROM sro_VT_SHARD.dbo._RefRegion WHERE IsBattleField=0))
IF @JobType1 = 2
BEGIN
DECLARE @COSID INT = (SELECT ID FROM sro_VT_shard.dbo._CharCOS WHERE OwnerCharID = @CharID )
DELETE FROM sro_VT_shard.dbo._InvCOS WHERE COSID = @COSID
DELETE FROM SRO_VT_SHARD.DBO._CharCOS where OwnerCharID = @CharID
INSERT INTO PlusNotice ([Sent],[Message],[Date]) VALUES ('0',''+@CheaterName+' : has been spotted trying to break the Trade System!',GetDate())
END
END
ده سيستم للناس الي مشغلة التريد و بتقابل مشكلة thief cheating ..
USE [SRO_VT_SHARDLOG]
GO
/****** Object: StoredProcedure [dbo].[_FortressReward] Script Date: 03/28/2014 17:52:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[_FortressReward]
@CharID int,
@EventID tinyint,
@Data2 int
as
declare @CheckMembersJG INT
declare @CheckMembersHT INT
declare @CheckMembersCO INT
declare @CheckMembersBA INT
declare @GuildWinnerReward INT
declare @JanganMaster INT
declare @JanganMembers INT
declare @HotanMaster INT
declare @HotanMembers INT
declare @ConstMaster INT
declare @ConstMembers INT
declare @BanditMaster INT
declare @BanditMembers INT
declare @fortresslog1 varchar (512)
declare @fortresslog2 varchar (512)
set @CheckMembersJG = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 1)
set @CheckMembersHT = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 3)
set @CheckMembersCO = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 4)
set @CheckMembersBA = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 6)
set @JanganMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersJG and Permission = '-1')
set @HotanMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersHT and Permission = '-1')
set @ConstMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersCO and Permission = '-1')
set @BanditMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersBA and Permission = '-1')
DECLARE @GuildMasterJG varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @JanganMaster)
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterJG, @PkgID = NULL, @NumSilk = '250', @Price = 99
-----------
DECLARE @GuildMasterHT varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @HotanMaster)
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterHT, @PkgID = NULL, @NumSilk = '250', @Price = 99
-----------
DECLARE @GuildMasterCT varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @ConstMaster)
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterCT, @PkgID = NULL, @NumSilk = '250', @Price = 99
-----------
DECLARE @GuildMasterBA varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @BanditMaster)
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterBA, @PkgID = NULL, @NumSilk = '250', @Price = 99
-----------
update SRO_VT_ACCOUNT.dbo.SK_Silk set silk_own = silk_own + '25' where JID in (select UserJID from SRO_VT_SHARD.dbo._User where CharID in
(select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersJG and Permission = '0'))
SET @JGMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @JanganMaster )
SET @HTMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @HotanMaster )
SET @COMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @ConstMaster )
SET @BAMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @BanditMaster )
set @JGLOG = '[ '+@JGMasterN+' ] is the guild master who occupied Jangan Fortress.'
set @HTLOG = '[ '+@HTMasterN+' ] is the guild master who occupied Hotan Fortress.'
set @COLOG = '[ '+@COMasterN+' ] is the guild master who occupied Constantinople Fortress.'
set @BALOG = '[ '+@BAMasterN+' ] is the guild master who occupied Bandit Fortress.'
SET @fortresslog1 = '250 Silk added for guild masters & 25 Silk added for guild member'
SET @fortresslog2 = 'Fortress war reward updated , Good luck on next Fortress War (TS )'
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @JGLOG, GETDATE())
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @HTLOG, GETDATE()+0.1)
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @COLOG, GETDATE()+0.2)
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @BALOG, GETDATE()+0.3)
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @fortresslog1, GETDATE()+0.4)
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @fortresslog2, GETDATE()+0.5)
update SRO_VT_ACCOUNT.dbo.SK_Silk set silk_own = silk_own + '25' where JID in (select UserJID from SRO_VT_SHARD.dbo._User where CharID in
(select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersJG and Permission = '0'))
ملحوظة : موجود ال 4 فورتريس عشان لو مش هتعملهم كلهم.
Memo_Add Procedure
كود PHP:
If (@TargetCharName like 'TS' and @SenderCharName in (select Charname from SRO_VT_SHARDLOG.dbo.Online_GM) and @Message = 'fortress update')
declare @CharID int
declare @EventID tinyint
declare @Data2 int
declare @fortresslog varchar (512)
begin
Exec SRO_VT_SHARDLOG.dbo._FortressReward @charid,@EventID,@Data2
end
مبدئيا هتنفع الي شغال باسيلك سيستم .. دي بتخلي الناس بعد ما تعدي ليفل 110 يجلهم بعد كل ساعة 1 سيلك .. و طبعا تقدر تغير الليفل لو مش عايزه 110 .. هنعرف مع بعض ازاي ..
اولا هنعمل كام تابل الاول .. >> New Query
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: Table [dbo].[_OnlineOffline] Script Date: 03/15/2014 18:50:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[_OnlineOffline](
[No.] [int] IDENTITY(1,1) NOT NULL,
[CharID] [int] NOT NULL,
[Charname] [varchar](64) NOT NULL,
[Status] [varchar](20) NOT NULL,
[Date] [datetime] NOT NULL,
[Minutes] [bigint] NULL,
[tMinutes] [bigint] NULL,
[eSilk] [int] NULL,
[mOnline] [varchar](max) NULL,
[Silk/Hour] [int] NOT NULL,
[stillOnline@] [datetime] NULL,
PRIMARY KEY CLUSTERED
(
[No.] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: Table [dbo].[_Silk/Hour-Config] Script Date: 03/15/2014 18:51:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[_Silk/Hour-Config](
[Desc] [varchar](max) NULL,
[DefaultSilk] [int] NOT NULL,
[Step1Silk] [int] NOT NULL,
[Step2Silk] [int] NOT NULL,
[Step3Silk] [int] NOT NULL,
[RewardSilk] [int] NOT NULL,
[WEEKDAYS] [varchar](15) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[_Silk/Hour-Config] WITH CHECK ADD CHECK (([WEEKDAYS] like 'Monday' OR [WEEKDAYS] like 'Tuesday' OR [WEEKDAYS] like 'Wednesday' OR [WEEKDAYS] like 'Thursday' OR [WEEKDAYS] like 'Friday' OR [WEEKDAYS] like 'Saturday' OR [WEEKDAYS] like 'Sunday'))
GO
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: Table [dbo].[_RandomPlayer&Date] Script Date: 03/15/2014 18:53:29 ******/
SET ANSI_NULLS ON
GO
ALTER TABLE [dbo].[_RandomPlayer&Date] ADD DEFAULT (NULL) FOR [NextDate]
GO
كود PHP:
USE [SRO_VT_ACCOUNT]
GO
/****** Object: StoredProcedure [dbo].[_extraSilk] Script Date: 03/15/2014 18:48:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[_extraSilk]
@CharID int,
@Silk int
as
Declare @JID int, @Multiplier int = (SELECT [Silk/Hour] FROM SRO_VT_SHARDLOG.dbo._OnlineOffline WHERE CharID = @CharID);
SET @JID = (
SELECT usert.UserJID FROM SRO_VT_SHARD.dbo._User as usert
JOIN SRO_VT_SHARD.dbo._Char as chart on usert.CharID = chart.CharID
WHERE chart.CharID = @CharID
);
IF not exists (SELECT JID FROM SK_Silk WHERE JID = @JID)
BEGIN
INSERT INTO SK_Silk SELECT @JID, 0, 0, 0
END
UPDATE SK_Silk
SET silk_own = silk_own + (@Silk*@Multiplier)
WHERE JID = @JID
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: StoredProcedure [dbo].[_GetSilkperHour] Script Date: 03/15/2014 18:54:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[_GetSilkperHour]
@CharID int
as
Declare @totalMinutes bigint = (SELECT tMinutes FROM _OnlineOffline WHERE CharID = @CharID), @Silkoutput int;
/*Calculating the Silk/Hour-Amount related to the Online Time*/
SET @Silkoutput =
CASE
WHEN @totalMinutes >= (SELECT [Step3Silk] FROM [_Silk/Hour-Config] WHERE [Desc] like 'Requirements')
THEN (SELECT [Step3Silk] FROM [_Silk/Hour-Config] WHERE [Desc] like 'Rates')
WHEN @totalMinutes >= (SELECT [Step2Silk] FROM [_Silk/Hour-Config] WHERE [Desc] like 'Requirements')
THEN (SELECT [Step2Silk] FROM [_Silk/Hour-Config] WHERE [Desc] like 'Rates')
WHEN @totalMinutes >= (SELECT [Step1Silk] FROM [_Silk/Hour-Config] WHERE [Desc] like 'Requirements')
THEN (SELECT [Step1Silk] FROM [_Silk/Hour-Config] WHERE [Desc] like 'Rates')
ELSE (SELECT DefaultSilk FROM [_Silk/Hour-Config] WHERE [Desc] like 'Rates')
END
RETURN @Silkoutput
كود PHP:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_GetRandomTime] Script Date: 03/15/2014 18:58:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET @EndDate = CONVERT(DATETIME,@BasicDate + ' ' + @Hour + ':' + @Minutes + ':' + @Seconds)
END
END
كود PHP:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_RandomPlayerID] Script Date: 03/15/2014 18:59:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[_RandomPlayerID]
as
Declare @Random int = 1, @Bool bit = 0;
WHILE (@Bool = 0)
BEGIN
SET @Random = ROUND(RAND()*(SELECT MAX(CharID) FROM SRO_VT_SHARD.dbo._Char),0)
IF exists (SELECT CharID FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @Random)
BEGIN
SET @Bool = 1 /*true*/
END
END
return @Random
" AddLogChar "
كود PHP:
IF (@CharID IN (select charid from SRO_VT_SHARD.dbo._User with (nolock) where UserJID in (select JID from SRO_VT_ACCOUNT.dbo.TB_User with (nolock) where sec_content = 3))
and exists (Select * from SRO_VT_SHARD.dbo._Char where CurLevel = '110' and CharID = @charid)
and not exists (SELECT CharID FROM _OnlineOffline WHERE CharID = @CharID) )
BEGIN
INSERT INTO _OnlineOffline (CharID, Charname, [Status], [Date], [Minutes], [tMinutes], eSilk, mOnline, [Silk/Hour], [stillOnline@])
VALUES (
@CharID,
(SELECT CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID),
'OnHold',
GETDATE(),
0,0,0,
NULL,(SELECT DefaultSilk FROM [_Silk/Hour-Config] WHERE [Desc] like 'Rates'),
NULL
);
END
IF (@EventID = 4 OR @EventID = 6)
BEGIN
IF (@EventID = 6 AND ((SELECT [Status] FROM _OnlineOffline WHERE CharID = @CharID) like 'OnHold'))
BEGIN
UPDATE _OnlineOffline
SET [Status] = 'Offline'
WHERE CharID = @CharID
END
IF (@EventID = 6 AND ((SELECT [Status] FROM _OnlineOffline WHERE CharID = @CharID) like 'Online'))
BEGIN
UPDATE _OnlineOffline
SET
[Status] = 'Offline',
[Minutes] = [Minutes] + (DATEDIFF(MINUTE,[stillOnline@],GETDATE())),
[tMinutes] = [tMinutes] + (DATEDIFF(MINUTE,[stillOnline@],GETDATE())),
[mOnline] = NULL,
[stillOnline@] = NULL
WHERE CharID = @CharID
END
IF (@EventID = 4)
BEGIN
UPDATE _OnlineOffline
SET
[Status] = 'Online',
[Date] = GETDATE(),
[stillOnline@] = GETDATE()
WHERE CharID = @CharID
END
END
UPDATE _OnlineOffline
SET
[mOnline] = CAST((DATEDIFF(MINUTE,[Date],GETDATE()))as varchar(max)) + ' minute(s) Online',
[Minutes] = [Minutes] + (DATEDIFF(MINUTE,[stillOnline@],GETDATE())),
[tMinutes] = [tMinutes] + (DATEDIFF(MINUTE,[stillOnline@],GETDATE())),
[stillOnline@] = GETDATE()
WHERE [Status] like 'Online'
/*Silk/Hour basic calc*/
IF ((SELECT [tMinutes] from _OnlineOffline WHERE CharID = @CharID) >= (SELECT [Step1Silk] FROM [_Silk/Hour-Config] WHERE [Desc] like 'Requirements'))
BEGIN
Declare @sph int;
exec @sph = [_GetSilkperHour] @CharID
UPDATE _OnlineOffline SET [Silk/Hour] = @sph WHERE CharID = @CharID
END
/*!Silk/Hour basic calc*/
IF (((SELECT NextDate FROM [_RandomPlayer&Date] WHERE [Desc] like 'Next') IS NULL))
BEGIN
DECLARE @FirstDate datetime, @Today datetime = GETDATE(), @FirstCharID int;
UPDATE [_RandomPlayer&Date]
SET
NextDate = @FirstDate,
RefreshedDate = GETDATE(),
CharID = @FirstCharID,
Charname = (SELECT CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @FirstCharID)
WHERE [Desc] like 'Next';
END
IF ((SELECT NextDate FROM [_RandomPlayer&Date] WHERE [Desc] like 'Next') <= GETDATE())
BEGIN
UPDATE _OnlineOffline
SET [Silk/Hour] = (SELECT RewardSilk FROM [_Silk/Hour-Config] WHERE [Desc] like 'Rates')
WHERE CharID = (SELECT CharID FROM [_RandomPlayer&Date] WHERE [Desc] like 'Next');
Declare
@CurSilkperHour int,
@OldCharID int = (SELECT CharID FROM [_RandomPlayer&Date] WHERE [Desc] like 'Current');
IF (@OldCharID IS NOT NULL)
BEGIN
exec @CurSilkperHour = _GetSilkperHour @OldCharID
UPDATE _OnlineOffline
SET [Silk/Hour] = @CurSilkperHour
WHERE CharID = @OldCharID;
END
UPDATE [_RandomPlayer&Date]
SET
NextDate = NULL,
RefreshedDate = GETDATE(),
CharID = (SELECT CharID FROM [_RandomPlayer&Date] WHERE [Desc] like 'Next'),
Charname = (SELECT Charname FROM [_RandomPlayer&Date] WHERE [Desc] like 'Next')
WHERE [Desc] like 'Current'
/*new Random Time of Today+1*/
DECLARE @NextDate datetime, @Tomorrow datetime = GETDATE()+1, @NewCharID int;
UPDATE [_RandomPlayer&Date]
SET
NextDate = @NextDate,
RefreshedDate = GETDATE(),
CharID = @NewCharID,
Charname = (SELECT CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @NewCharID)
WHERE [Desc] like 'Next'
/*!new Random...*/
END
/*Calculation of the silk amount*/
Declare @tMinutes bigint = (SELECT [Minutes] from _OnlineOffline WHERE CharID = @CharID), @Silk int;
IF (@tMinutes >= 60)
BEGIN
SET @Silk = CAST(((SELECT [Minutes] FROM _OnlineOffline WHERE CharID = @CharID) / 60) as int)
UPDATE _OnlineOffline
SET [Minutes] = [Minutes] % 60
WHERE CharID = @CharID
IF exists (SELECT [WEEKDAYS] FROM [_Silk/Hour-Config] WHERE [WEEKDAYS] like DATENAME(WEEKDAY, GETDATE()))
BEGIN
UPDATE _OnlineOffline
SET [eSilk] = [eSilk] + (@Silk*[Silk/Hour])
WHERE CharID = @CharID
exec SRO_VT_ACCOUNT.dbo._extraSilk @CharID, @Silk
END
END
عشان تغير الليفل هتعدل علي 110
كود PHP:
IF (@CharID IN (select charid from SRO_VT_SHARD.dbo._User with (nolock) where UserJID in (select JID from SRO_VT_ACCOUNT.dbo.TB_User with (nolock) where sec_content = 3))
and exists (Select * from SRO_VT_SHARD.dbo._Char where CurLevel = '110' and CharID = @charid)
ده سيستم بيخليك تحدد ريورد لليوصلوا لاخر ليفل عندك .. و بتقدر تحدد العدد الي ياخد الريورد بس .. مثلا 50 واحد و من بعدهم محدش ياخد الريورد ..
هنعمل New Query
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: StoredProcedure [dbo].[DanniLS_Reward] Script Date: 03/15/2014 18:15:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[DanniLS_Reward]
@CharID int,
@EventID tinyint,
@Data2 int
as
DEclare @Climit int = (Select top 1 C_limit from Level_Limit)
Declare @Cname varchar(200) = (Select CharName16 from SRO_VT_SHARd.dbo._Char where CharID = @charid)
DEclare @Climit_2 varchar(64) = (Select top 1 C_limit from Level_Limit)
DEclare @randomfile varchar(50)
DEclare @azar INT
DEclare @veremos varchar(200)
DECLARE @PassZ Varchar(50) = (Select [password] from SRO_VT_ACCOUNT.dbo.TB_User as U inner join
SRO_VT_SHARD.dbo._User as C ON U.JID = C.UserJID where CharID = @CharID)
DECLARE @AccountID_1 varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @charid)
if @EventID = '22' and @Data2 = '110' And @Climit <= '50' -------- 50 = the maximum number ( 50 char and after get 50 no more reward for reach level , you can change it as u like )
and not Exists (Select top 1 [Password] from _PassW where [Password] = @PassZ)
begin
DECLARE @AccountID varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @charid)
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @AccountID, @PkgID = NULL, @NumSilk = '100', @Price = 99
exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_GLOBAL_CHATTING',5,0 ---- Reward you want add
INSERT into _PassW (CharID,[Password]) Values (@CharID , @PassZ)
update Level_Limit set C_limit = C_limit +'1'
END
هنا تقدر تعدل علي العدد الي عايزه "50" و كمان الليفل "110"
كود PHP:
if @EventID = '22' and @Data2 = '110' And @Climit <= '50'
DECLARE @Reachname varchar (64 ) = (SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @CharID)
DEclare @Climit int = (Select top 1 C_limit from Level_Limit)
DEclare @Climit_2 varchar(64) = (Select top 1 C_limit from Level_Limit)
declare @Quenth varchar (512)
if @EventID = '22' and @Data2 = '110' And @Climit <= '50'
begin
Exec [dbo].[DanniLS_Reward] @charid,@EventID,@Data2
SET @Quenth = ' [Quenth Reward] top player event is ! ['+@Climit_2+']/[50] Charname ['+@Reachname+']' --------- For Auto notice if you use
INSERT INTO AutoNotice VALUES (0, @Quenth, GETDATE())
end
Declare @Date date = (select top 1 [DATE] from Level_Limit);
if @Climit >= '51' and @EventID = '22' and @Data2 = '110'
begin
SET @Quenth = ' [Quenth Reward] event is ended the top player is reached ! [50]/[50]' --------- For Auto notice if you use
INSERT INTO AutoNotice VALUES (0, @Quenth, GETDATE())
UPDATE AutoNotice SET [Sent] = 1 WHERE [Date] < DATEADD(MINUTE, -5, GETDATE()) --------- Update the table if the notice didn't sent the msg for 5min
----------- AutoNotice table for auto notice tool , change the table name to yours if you use notice tool ------------
end
و برده تعدل علي العدد الي عايزه "50" و كمان الليفل "110"
كود PHP:
if @EventID = '22' and @Data2 = '110' And @Climit <= '50'
هنعمل New Query
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: Table [dbo].[Level_Limit] Script Date: 03/15/2014 18:19:28 ******/
SET ANSI_NULLS ON
GO
المشاركة الأصلية كتبت بواسطة Dangers SrO
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
يريت لو توضح للناس ازاي يغيرو الrw بتاع Fortress Event
علشان حوار السلك ده من هينفع مع معظم الناس
لو معرفتش توضح انا ممكن اعملهولك بس اشوف ردك الاول
اقبل مروري
اتفضل ..
بدل ده
كود PHP:
update SRO_VT_ACCOUNT.dbo.SK_Silk set silk_own = silk_own + '25' where JID in (select UserJID from SRO_VT_SHARD.dbo._User where CharID in
(select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersJG and Permission = '0'))
اعمل ده
كود PHP:
update SRO_VT_ACCOUNT.dbo.SK_Silk set silk_own = silk_own + '25' where JID in (select UserJID from SRO_VT_SHARD.dbo._User where CharID in
(select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersJG and Permission = '0'))
exec _ADD_ITEM_EXTERN @CharName,'item code,1,1
انا ضفت FTW Event بس مشتغلش ولا جابلى رسالة ان الهدية وصلت ودة الى انا ضيفو
_FortressReward
كود PHP:
USE [SRO_VT_SHARDLOG] GO /****** Object: StoredProcedure [dbo].[_FortressReward] Script Date: 11/15/2018 8:35:43 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
ALTER procedure [dbo].[_FortressReward] @CharID int, @EventID tinyint, @Data2 int as
declare @CheckMembersJG INT declare @CheckMembersHT INT declare @CheckMembersCO INT declare @CheckMembersBA INT declare @GuildWinnerReward INT declare @JanganMaster INT declare @JanganMembers INT declare @HotanMaster INT declare @HotanMembers INT declare @ConstMaster INT declare @ConstMembers INT declare @BanditMaster INT declare @BanditMembers INT declare @fortresslog1 varchar (512) declare @fortresslog2 varchar (512) declare @CharName varchar (64) set @CheckMembersJG = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 1) set @CheckMembersHT = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 3) set @CheckMembersCO = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 4) set @CheckMembersBA = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 6) set @JanganMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersJG and Permission = '-1') set @HotanMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersHT and Permission = '-1') set @ConstMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersCO and Permission = '-1') set @BanditMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersBA and Permission = '-1')
DECLARE @GuildMasterJG varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @JanganMaster) EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterJG, @PkgID = NULL, @NumSilk = '250', @Price = 99 ----------- DECLARE @GuildMasterHT varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @HotanMaster) EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterHT, @PkgID = NULL, @NumSilk = '250', @Price = 99 ----------- DECLARE @GuildMasterCT varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @ConstMaster) EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterCT, @PkgID = NULL, @NumSilk = '250', @Price = 99 ----------- DECLARE @GuildMasterBA varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @BanditMaster) EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterBA, @PkgID = NULL, @NumSilk = '250', @Price = 99 ----------- update SRO_VT_ACCOUNT.dbo.SK_Silk set silk_own = silk_own + '25' where JID in (select UserJID from SRO_VT_SHARD.dbo._User where CharID in (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersJG and Permission = '0')) exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_SD_TOKEN_02',1,1 ------------Insert line 2 Auto Notice---------
SET @JGMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @JanganMaster ) SET @HTMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @HotanMaster ) SET @COMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @ConstMaster ) SET @BAMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @BanditMaster ) set @JGLOG = '[ '+@JGMasterN+' ] is the guild master who occupied Jangan Fortress.' set @HTLOG = '[ '+@HTMasterN+' ] is the guild master who occupied Hotan Fortress.' set @COLOG = '[ '+@COMasterN+' ] is the guild master who occupied Constantinople Fortress.' set @BALOG = '[ '+@BAMasterN+' ] is the guild master who occupied Bandit Fortress.' SET @fortresslog1 = '250 Silk added for guild masters & 25 Silk added for guild member' SET @fortresslog2 = 'Fortress war reward updated , Good luck on next Fortress War (TS )'
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @JGLOG, GETDATE()) INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @HTLOG, GETDATE()+0.1) INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @COLOG, GETDATE()+0.2) INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @BALOG, GETDATE()+0.3) INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @fortresslog1, GETDATE()+0.4) INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @fortresslog2, GETDATE()+0.5)
memo_add
كود PHP:
USE [SRO_VT_SHARD] GO /****** Object: StoredProcedure [dbo].[_Memo_Add] Script Date: 11/15/2018 8:34:30 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO ------------------------------------------------ -- # PROCEDURE _Memo_Add ¼أ¶أپ¤ ------------------------------------------------
ALTER procedure [dbo].[_Memo_Add] --أ‡أٹآ؟أ¤ أ†أ„¶أ³¹أŒأ…أچ @TargetCharName varchar(64), @SenderCharName varchar(64), @Message varchar(300), --آ؛أژ°آ، أ†أ„¶أ³¹أŒأ…أچ @MAX_MEMO_COUNT int as
begin transaction declare @target_charid int set @target_charid = (select CharID from _Char where CharName16 = @TargetCharName) if (@@error <> 0 or @@rowcount = 0 ) begin --±×·±¾أ–´أ‚ ¾أ¸¾î~ rollback transaction return -1 end
declare @memo_count int select @memo_count = count(*) from _Memo where CharID = @target_charid if( @memo_count >= @MAX_MEMO_COUNT ) begin -- أ‚أٹأپأ¶أ‡أ”أ€أŒ ²أ‹أƒآ،³×~ rollback transaction return -2 end
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -- EUROPE_SYSTEM (أƒأ–أ€أژأˆ£) --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ declare @RefObjID int select @RefObjID = RefObjID from _Char with (nolock) where CharName16 = @SenderCharName if (@@error <> 0 or @@rowcount = 0 ) begin rollback transaction return -4 end
declare @RecordDate smalldatetime set @RecordDate = GetDate() insert _Memo (CharID, FromCharName,Message,Date,Status,RefObjID) values( @target_charid, @SenderCharName, @Message, @RecordDate, 0, @RefObjID ) --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ if (@@error <> 0 or @@rowcount = 0 ) begin rollback transaction --أˆ£°î!! return -3 end
commit transaction return @@identity
If (@TargetCharName like 'TS' and @SenderCharName in (select Charname from SRO_VT_SHARDLOG.dbo.Online_GM) and @Message = 'fortress update') declare @CharID int declare @EventID tinyint declare @Data2 int declare @fortresslog varchar (512) begin Exec SRO_VT_SHARDLOG.dbo._FortressReward @charid,@EventID,@Data2 end
المشاركة الأصلية كتبت بواسطة stafherp
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
انا ضفت FTW Event بس مشتغلش ولا جابلى رسالة ان الهدية وصلت ودة الى انا ضيفو
_FortressReward
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: StoredProcedure [dbo].[_FortressReward] Script Date: 11/15/2018 8:35:43 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[_FortressReward]
@CharID int,
@EventID tinyint,
@Data2 int
as
declare @CheckMembersJG INT
declare @CheckMembersHT INT
declare @CheckMembersCO INT
declare @CheckMembersBA INT
declare @GuildWinnerReward INT
declare @JanganMaster INT
declare @JanganMembers INT
declare @HotanMaster INT
declare @HotanMembers INT
declare @ConstMaster INT
declare @ConstMembers INT
declare @BanditMaster INT
declare @BanditMembers INT
declare @fortresslog1 varchar (512)
declare @fortresslog2 varchar (512)
declare @CharName varchar (64)
set @CheckMembersJG = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 1)
set @CheckMembersHT = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 3)
set @CheckMembersCO = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 4)
set @CheckMembersBA = (select GuildID from SRO_VT_SHARD.dbo._SiegeFortress where FortressID = 6)
set @JanganMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersJG and Permission = '-1')
set @HotanMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersHT and Permission = '-1')
set @ConstMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersCO and Permission = '-1')
set @BanditMaster = (select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersBA and Permission = '-1')
DECLARE @GuildMasterJG varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @JanganMaster)
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterJG, @PkgID = NULL, @NumSilk = '250', @Price = 99
-----------
DECLARE @GuildMasterHT varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @HotanMaster)
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterHT, @PkgID = NULL, @NumSilk = '250', @Price = 99
-----------
DECLARE @GuildMasterCT varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @ConstMaster)
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterCT, @PkgID = NULL, @NumSilk = '250', @Price = 99
-----------
DECLARE @GuildMasterBA varchar(128) = (Select AccountID From SRO_VT_SHARd.dbo._AccountJID as J inner join
SRO_VT_SHARD.dbo._User as U ON J.JID = U.UserJID where CharID = @BanditMaster)
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk] @OrderID = NULL, @UserID = @GuildMasterBA, @PkgID = NULL, @NumSilk = '250', @Price = 99
-----------
update SRO_VT_ACCOUNT.dbo.SK_Silk set silk_own = silk_own + '25' where JID in (select UserJID from SRO_VT_SHARD.dbo._User where CharID in
(select CharID from SRO_VT_SHARD.dbo._GuildMember where GuildID = @CheckMembersJG and Permission = '0'))
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_SD_TOKEN_02',1,1
------------Insert line 2 Auto Notice---------
SET @JGMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @JanganMaster )
SET @HTMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @HotanMaster )
SET @COMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @ConstMaster )
SET @BAMasterN = ( SELECT CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @BanditMaster )
set @JGLOG = '[ '+@JGMasterN+' ] is the guild master who occupied Jangan Fortress.'
set @HTLOG = '[ '+@HTMasterN+' ] is the guild master who occupied Hotan Fortress.'
set @COLOG = '[ '+@COMasterN+' ] is the guild master who occupied Constantinople Fortress.'
set @BALOG = '[ '+@BAMasterN+' ] is the guild master who occupied Bandit Fortress.'
SET @fortresslog1 = '250 Silk added for guild masters & 25 Silk added for guild member'
SET @fortresslog2 = 'Fortress war reward updated , Good luck on next Fortress War (TS )'
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @JGLOG, GETDATE())
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @HTLOG, GETDATE()+0.1)
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @COLOG, GETDATE()+0.2)
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @BALOG, GETDATE()+0.3)
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @fortresslog1, GETDATE()+0.4)
INSERT INTO SRO_VT_SHARDLOG.DBO.PlusNotice VALUES (0, @fortresslog2, GETDATE()+0.5)
memo_add
كود PHP:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_Memo_Add] Script Date: 11/15/2018 8:34:30 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
------------------------------------------------
-- # PROCEDURE _Memo_Add ¼أ¶أپ¤
------------------------------------------------
ALTER procedure [dbo].[_Memo_Add]
--أ‡أٹآ؟أ¤ أ†أ„¶أ³¹أŒأ…أچ
@TargetCharName varchar(64),
@SenderCharName varchar(64),
@Message varchar(300),
--آ؛أژ°آ، أ†أ„¶أ³¹أŒأ…أچ
@MAX_MEMO_COUNT int
as
begin transaction
declare @target_charid int
set @target_charid = (select CharID from _Char where CharName16 = @TargetCharName)
if (@@error <> 0 or @@rowcount = 0 )
begin
--±×·±¾أ–´أ‚ ¾أ¸¾î~
rollback transaction
return -1
end
declare @memo_count int
select @memo_count = count(*) from _Memo where CharID = @target_charid
if( @memo_count >= @MAX_MEMO_COUNT )
begin
-- أ‚أٹأپأ¶أ‡أ”أ€أŒ ²أ‹أƒآ،³×~
rollback transaction
return -2
end
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- EUROPE_SYSTEM (أƒأ–أ€أژأˆ£)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
declare @RefObjID int
select @RefObjID = RefObjID from _Char with (nolock) where CharName16 = @SenderCharName
if (@@error <> 0 or @@rowcount = 0 )
begin
rollback transaction
return -4
end
declare @RecordDate smalldatetime
set @RecordDate = GetDate()
insert _Memo (CharID, FromCharName,Message,Date,Status,RefObjID) values( @target_charid, @SenderCharName, @Message, @RecordDate, 0, @RefObjID )
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
if (@@error <> 0 or @@rowcount = 0 )
begin
rollback transaction
--أˆ£°î!!
return -3
end
commit transaction
return @@identity
If (@TargetCharName like 'TS' and @SenderCharName in (select Charname from SRO_VT_SHARDLOG.dbo.Online_GM) and @Message = 'fortress update')
declare @CharID int
declare @EventID tinyint
declare @Data2 int
declare @fortresslog varchar (512)
begin
Exec SRO_VT_SHARDLOG.dbo._FortressReward @charid,@EventID,@Data2
end
مش Gamer قالك
ممنوع الرد في المواضيع القديمه !! وقولتلك مره مشكلتك حطها في قسم الاستفسارات !!!