|
• الانـتـسـاب » Mar 2017
|
• رقـم العـضـويـة » 132467
|
• المشـــاركـات » 326
|
• الـدولـة » Samanoud
|
• الـهـوايـة » Design / Developer
|
• اسـم الـسـيـرفـر » Private Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
Job Reward System For Beginners
انا جتلي فكره فا قررت انفذها
و الحمدلله نجحت
هو ان كل ما توصل تريد يبعت للبتو كلمه ' Reward'
فا هيتعمل teleport في نفس المكان ال انت واقف فيه
و انت بقا هتحدد الRewards بمزاجك في الtrigger
يلا بينا !
بس لازم يكون عندك برضو الVsro multi tools
و لازم تعمل كدا في _ItemQuotation
-
-
-
اقتباس:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: Trigger [dbo].[TRADE_SYSTEM] Script Date: 27/02/2020 01:42:05 ص ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Dev.HiTLER
-- =============================================
CREATE TRIGGER [dbo].[TRADE_SYSTEM]
ON [dbo].[_IncomingPrivateChat]
after insert
as
---------------------------- Q1 -----------------------------------------------------------------
DECLARE @Chat varchar(MAX) ,@Question nvarchar(MAX)
Declare @Message nvarchar(max)
DECLARE @Contribution int
DECLARE @TybeJob int
DECLARE @CharJob int
DECLARE @CampID INT
DECLARE @CharID int
DECLARE @CharName varchar(60)
declare @CampChar int
declare @jg_to_dw int
declare @dw_to_ht int
declare @jg_to_ht int
set @jg_to_dw = '1999'
set @dw_to_ht = '2999'
set @jg_to_ht = '3999'
set @CampChar = (Select Charid from SRO_VT_SHARD.._TrainingCampMember where CharID = @CharID)
Select @CharName=CharName From _IncomingPrivateChat
set @CharID = (select CharID from SRO_VT_SHARD.dbo._Char where CharName16 = @CharName)
SET @CampID = (Select TOP 1 CampID FROM SRO_VT_SHARD.._TrainingCampBuffStatus Where RecipientCharID = @CharID)
set @Contribution = (Select Contribution from SRO_VT_SHARD.dbo._CharTrijob where CharID = @CharID)
set @TybeJob = (Select JobType from SRO_VT_SHARD.dbo._CharTrijob where CharID = @CharID)
set @CharJob = (Select CharID from SRO_VT_SHARD.dbo._CharTrijob where CharID = @CharID)
select @Message=Chat From _IncomingPrivateChat
if @Contribution not between '1999' and '3999' and @Message = 'Reward'
begin
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You dont have any job record yet',GETDATE())
END
------------------------ THIEF
if @TybeJob = 2 and @Contribution = 3999 and @Message = 'Reward' and exists (select CharID from SRO_VT_SHARD.._TrainingCampMember where CharID = @CharID)
BEGIN
update SRO_VT_SHARD.._TrainingCamp set EvaluationPoint +=1, GraduateCount +=1 where ID = @CampID
exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN @CharName,ITEM_ETC_ARENA_COIN,40,0
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You have earned 1 honor point!',GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You have earned 40 Historian Coins!',GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Date) values (1,'Movetouser',@CharName,GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Date) values (1,'Recalluser',@CharName,GETDATE())
end
------------------------ TRADER -- Jg ~ DW
if @TybeJob = 1 and @Contribution = 1999 and @Message = 'Reward' and exists (select CharID from SRO_VT_SHARD.._TrainingCampMember where CharID = @CharID)
begin
update SRO_VT_SHARD.._TrainingCamp set EvaluationPoint +=1, GraduateCount +=1 where ID = @CampID
exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN @CharName,ITEM_ETC_ARENA_COIN,40,0
update SRO_VT_SHARD.._CharTrijob set Contribution = 0, Exp = 0, level = 1
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You have earned 1 honor point!',GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You have earned 40 Historian Coins!',GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Date) values (1,'Movetouser',@CharName,GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Date) values (1,'Recalluser',@CharName,GETDATE())
end
else if @TybeJob = 1 and @Message = 'Reward' and not exists (select CharID from SRO_VT_SHARD.._TrainingCampMember where CharID = @CharID)
begin
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You must create academy first!',GETDATE())
END
--- DW ~ HT
if @TybeJob = 1 and @Contribution = 2999 and @Message = 'Reward' and exists (select CharID from SRO_VT_SHARD.._TrainingCampMember where CharID = @CharID)
begin
update SRO_VT_SHARD.._TrainingCamp set EvaluationPoint +=1, GraduateCount +=1 where ID = @CampID
exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN @CharName,ITEM_ETC_ARENA_COIN,50,0
update SRO_VT_SHARD.._CharTrijob set Contribution = 0, Exp = 0, level = 1
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You have earned 1 honor point!',GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You have earned 50 Historian Coins!',GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Date) values (1,'Movetouser',@CharName,GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Date) values (1,'Recalluser',@CharName,GETDATE())
end
else if @TybeJob = 1 and @Message = 'Reward' and not exists (select CharID from SRO_VT_SHARD.._TrainingCampMember where CharID = @CharID)
begin
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You must create academy first!',GETDATE())
END
--- JG ~ HT
if @TybeJob = 1 and @Contribution = 3999 and @Message = 'Reward' and exists (select CharID from SRO_VT_SHARD.._TrainingCampMember where CharID = @CharID)
begin
update SRO_VT_SHARD.._TrainingCamp set EvaluationPoint +=1, GraduateCount +=1 where ID = @CampID
exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN @CharName,ITEM_ETC_ARENA_COIN,65,0
update SRO_VT_SHARD.._CharTrijob set Contribution = 0, Exp = 0, level = 1
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You have earned 1 honor point!',GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You have earned 65 Historian Coins!',GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Date) values (1,'Movetouser',@CharName,GETDATE())
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Date) values (1,'Recalluser',@CharName,GETDATE())
end
else if @TybeJob = 1 and @Message = 'Reward' and not exists (select CharID from SRO_VT_SHARD.._TrainingCampMember where CharID = @CharID)
begin
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You must create academy first!',GETDATE())
END
If (@CharName Like @CharName and @Message = 'Thanks' or @Message = 'Thank you' or @Message = 'Ty' )
BEGIN
insert into SRO_VT_SHARDLOG..iLegend_Tool (Service,Type,Target,Message,Date) values (1,'Private',@CharName,'You are Welcome dude',GETDATE())
END
GO
|
رستسرت للجيم سيرفر و عيش
|