Hi all, i have a problem, with my script for never 30 day's item
when i make a new char i not get buff D: anyone have a solution??
USE [PS_GameData]
GO
/****** Object: StoredProcedure [dbo].[usp_Read_Char_ApplySkills_R] Script Date: 02/25/2015 23:26:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Proc [dbo].[usp_Read_Char_ApplySkills_R]
@CharID int
AS
SET NOCOUNT ON
---Ress 30 Dias
if exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=286 and skilllevel=3)
begin
update charapplyskills set LeftResettime=2592000 where CharID=@charID and skillid=286
end
if not exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=286)
begin
insert into CharApplySkills (CharID, SkillID, SkillLevel,LeftResetTime)
Values (@CharID, 286,3,2592000)
end
---Resistência Eterna 30 Dias
if exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=225 and skilllevel=1)
begin
update charapplyskills set LeftResettime=2592000 where CharID=@charID and skillid=225
end
if not exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=225)
begin
insert into CharApplySkills (CharID, SkillID, SkillLevel,LeftResetTime)
Values (@CharID, 225,1,2592000)
end
---Amuleto Fênix Vermelha 30 Dias
if exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=233 and skilllevel=1)
begin
update charapplyskills set LeftResettime=2592000 where CharID=@charID and skillid=233
end
if not exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=233)
begin
insert into CharApplySkills (CharID, SkillID, SkillLevel,LeftResetTime)
Values (@CharID, 233,1,2592000)
end
---Previne Queda de Itens 30 Dias
if exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=227 and skilllevel=1)
begin
update charapplyskills set LeftResettime=2592000 where CharID=@charID and skillid=227
end
if not exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=227)
begin
insert into CharApplySkills (CharID, SkillID, SkillLevel,LeftResetTime)
Values (@CharID, 227,1,2592000)
end
SELECT SkillID,SkillLevel,LeftResetTime FROM CharApplySkills WHERE CharID=@CharID
SET NOCOUNT OFF
GO
/****** Object: StoredProcedure [dbo].[usp_Read_Char_ApplySkills_R] Script Date: 02/25/2015 23:26:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Proc [dbo].[usp_Read_Char_ApplySkills_R]
@CharID int
AS
SET NOCOUNT ON
---Ress 30 Dias
if exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=286 and skilllevel=3)
begin
update charapplyskills set LeftResettime=2592000 where CharID=@charID and skillid=286
end
if not exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=286)
begin
insert into CharApplySkills (CharID, SkillID, SkillLevel,LeftResetTime)
Values (@CharID, 286,3,2592000)
end
---Resistência Eterna 30 Dias
if exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=225 and skilllevel=1)
begin
update charapplyskills set LeftResettime=2592000 where CharID=@charID and skillid=225
end
if not exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=225)
begin
insert into CharApplySkills (CharID, SkillID, SkillLevel,LeftResetTime)
Values (@CharID, 225,1,2592000)
end
---Amuleto Fênix Vermelha 30 Dias
if exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=233 and skilllevel=1)
begin
update charapplyskills set LeftResettime=2592000 where CharID=@charID and skillid=233
end
if not exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=233)
begin
insert into CharApplySkills (CharID, SkillID, SkillLevel,LeftResetTime)
Values (@CharID, 233,1,2592000)
end
---Previne Queda de Itens 30 Dias
if exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=227 and skilllevel=1)
begin
update charapplyskills set LeftResettime=2592000 where CharID=@charID and skillid=227
end
if not exists ( select skillID from charapplyskills with (nolock) where charID=@CHARID and skillid=227)
begin
insert into CharApplySkills (CharID, SkillID, SkillLevel,LeftResetTime)
Values (@CharID, 227,1,2592000)
end
SELECT SkillID,SkillLevel,LeftResetTime FROM CharApplySkills WHERE CharID=@CharID
SET NOCOUNT OFF