---------------------------------------------MAX Lv Reward
IF (@EventID=9 or @EventID=4)
DECLARE @Date VARCHAR(100) = (SELECT GETDATE())
DECLARE @Service INT
SET @Service = (SELECT TOP 1 Service1 FROM _MaxLevelGift WHERE CharName = @Charname16)
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)
begin
if not exists (select CharName from _MaxLevelGift where CharName = @Charname16)
insert into _MaxLevelGift (CharName,Zaman,Service1) values (@Charname16,@Date,0)
if (@EventID = 22)
BEGIN
if (@Data2 = 90)
BEGIN
IF (SELECT COUNT(*) FROM _MaxLevelGift WHERE [Service1]=1)<100
BEGIN
UPDATE _MaxLevelGift SET [Service1]=1 WHERE CharName = @Charname16
DECLARE @MaxLvSayi VARCHAR (100)
SET @MaxLvSayi = (SELECT COUNT(*) FROM _MaxLevelGift WHERE [Service1]=1)
begin
if not exists (select CharName from _MaxLevelKontrol where CharName = @Charname16)
begin
insert into _MaxLevelKontrol values (@Charname16,@Date)
insert into SRO_VT_MULTITOOLS..iLegend_Tool (Service,Type,Message,Date) values ('1','Notice','Tebrikler '+@CharName16+' son Seviyeye ulaştınız. ['+@MaxLvSayi+'/100]',GETDATE())
exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN_CHEST @AccountID_1, 'ITEM_EVENT_GLOBAL_CHATTING', 1, 0
exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN_CHEST @AccountID_1, 'ITEM_EVENT_REVERSE_RETURN_SCROLL', 1, 0
exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN_CHEST @AccountID_1, 'ITEM_MALL_HP_SUPERSET_5_BAG',1000,1
exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN_CHEST @AccountID_1, 'ITEM_MALL_MP_SUPERSET_5_BAG',1000,1
exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN_CHEST @AccountID_1, 'ITEM_COS_T_BUFFALO_SCROLL',1,1
end
end
end
end
END
end
--------------------------------------MAX Lv Reward END-----------------------