قسم المواضيع المكررة و المخالفة هنا يتم وضع المواضيع المخالفة والمواضيع المكررة |
|
أدوات الموضوع | تقييم الموضوع | انواع عرض الموضوع |
16-07-2016, 10:50 PM | #1 | ||||||||||
|
انا عامل سيستم سيلك كل ساعة و لكن عايز اعمله يبدأ من لفل معين Required Level علشان يبدأ ياخد كل ساعة سيلك اعمل ايه |
||||||||||
|
17-07-2016, 12:50 AM | #2 | ||||||||||
|
هتعمل نظام ال Silk/hour عادى وهتحط ده فى ال addlogchar كود:
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 = '120' 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; exec @FirstCharID = SRO_VT_SHARD.dbo._RandomPlayerID exec SRO_VT_SHARD.dbo._GetRandomTime @Today, @FirstDate OUTPUT 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; exec @NewCharID = SRO_VT_SHARD.dbo._RandomPlayerID exec SRO_VT_SHARD.dbo._GetRandomTime @Tomorrow, @NextDate OUTPUT 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 وهتعدل على ال Curlevel |
||||||||||
التعديل الأخير تم بواسطة Dev.Ri3o ; 17-07-2016 الساعة 12:52 AM
|
الكلمات الدليلية |
بدون |
يتصفح الموضوع حالياً : 1 (0 عضو و 1 زائر) | |
|
|
المواضيع المتشابهه | ||||
الموضوع | كاتب الموضوع | المنتدى | الردود | آخر مشاركة |
New silk System auto free Silk/Hour based on the Online time | Yui | قسم الشروحات و البرامج المستخدمة في عمل السيرفرات الخاصة | 55 | 25-03-2019 07:46 AM |
2 silk per hour | Danger Sro | قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة | 1 | 23-06-2015 10:48 AM |
Silk per hour | No Smoking | قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة | 2 | 19-04-2015 01:43 PM |
silk per hour | resident | قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة | 5 | 27-01-2015 04:35 PM |
About Silk Per Hour | Ch3tos | قسم المواضيع المكررة و المخالفة | 8 | 16-07-2013 10:05 AM |