Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Create a Buff Seals SQL Script IGCN

Newbie Spellweaver
Joined
May 11, 2018
Messages
8
Reaction score
0
I would like to adapt this query to the igcn files to give seals when creating a new character

Code:
[COLOR=#666666]Code:[/COLOR]/****** Object: Stored Procedure dbo.WZ_CreateCharacter Script Date: 28.11.2008 19:52:26 ******/

CREATE Procedure WZ_CreateCharacter   @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID    varchar(10),  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL]    varchar(10),  @[I][B][URL="http://forum.ragezone.com/members/437263.html"]clas[/URL]s    tinyint
AS
Begin

SET NOCOUNT ON
SET    XACT_ABORT ON
DECLARE  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt    tinyint

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt = 0x00    

If EXISTS ( SELECT Name FROM Character WHERE Name =  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL] )
begin
SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt    = 0x01    
GOTO ProcEnd    
end 

BEGIN TRAN

If NOT EXISTS ( SELECT Id FROM AccountCharacter WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID )
begin
INSERT INTO dbo.AccountCharacter(Id, GameID1, GameID2, GameID3, GameID4, GameID5, GameIDC) 
VALUES  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID,  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL], NULL, NULL, NULL, NULL, NULL)

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt = @@Error
end 
else
begin
Declare @g1 varchar(10), @g2 varchar(10), @g3 varchar(10), @g4 varchar(10), @g5 varchar(10)    
SELECT @g1=GameID1, @g2=GameID2, @g3=GameID3, @g4=GameID4, @g5=GameID5 FROM dbo.AccountCharacter Where Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID 
if( ( @g1 Is NULL) OR (Len(@g1) = 0))

begin
UPDATE AccountCharacter SET GameID1 =  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt = @@Error
end 
else    if( @g2 Is NULL OR Len(@g2) = 0)
begin
UPDATE AccountCharacter SET GameID2 =  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt = @@Error
end 
else    if( @g3 Is NULL OR Len(@g3) = 0)
begin    
UPDATE AccountCharacter SET GameID3 =  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt = @@Error
end 
else    if( @g4 Is NULL OR Len(@g4) = 0)
begin
UPDATE AccountCharacter SET GameID4 =  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt = @@Error
end 
else    if( @g5 Is NULL OR Len(@g5) = 0)
begin
UPDATE AccountCharacter SET GameID5 =  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt = @@Error
end 
else 
begin    
SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt    = 0x03    
GOTO TranProcEnd    
end 
end 

if(  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt <> 0 )
begin
GOTO TranProcEnd    
end 
else
begin
INSERT INTO dbo.Character(AccountID, Name, cLevel, LevelUpPoint, Class, Strength, Dexterity, Vitality, Energy, Inventory,MagicList, 
Life, MaxLife, Mana, MaxMana, MapNumber, MapPosX, MapPosY, MDate, LDate, Quest, DbVersion, Leadership,money )
SELECT  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID As AccountID,  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL] As Name, Level, 0,  @[I][B][URL="http://forum.ragezone.com/members/437263.html"]clas[/URL]s As Class, 
Strength, Dexterity, Vitality, Energy, Inventory,MagicList, Life, MaxLife, Mana, MaxMana, MapNumber, MapPosX, MapPosY,
getdate() As MDate, getdate() As LDate, Quest, DbVersion, Leadership,0
FROM DefaultClassType WHERE Class =  @[I][B][URL="http://forum.ragezone.com/members/437263.html"]clas[/URL]s    

DECLARE @memb_guid int
SELECT @memb_guid = memb_guid FROM MEMB_INFO WHERE memb___id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID
INSERT INTO dbo.T_periodItem_info(memb_guid,char,itemcode,optiontype,item_effect1,item_effect2,UseTime,ExpireDate)
VALUES(@memb_guid,  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL],[B]6700,0,6,7,10080,getdate()+7)

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt = @@Error
end 

TranProcEnd:
IF (  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt <> 0 )
ROLLBACK TRAN
ELSE
COMMIT    TRAN

ProcEnd:

SET NOCOUNT OFF
SET    XACT_ABORT OFF

SELECT
CASE  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL]lt
WHEN 0x00 THEN 0x01
WHEN 0x01 THEN 0x00
WHEN 0x03 THEN 0x03
ELSE 0x02
END AS Result 
End


[/B][/I][/B][/I][/B][/I][/B][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][I][B][B][I][B][I][B][I][B]GO[/B][/I][/B][/I][/B][/I][/B][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I][/B][/I]

Code:
DECLARE @memb_guid int
SELECT @memb_guid = memb_guid FROM MEMB_INFO WHERE memb___id = @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL]ID
INSERT INTO dbo.T_periodItem_info(memb_guid,char,itemcode,optiontype,item_effect1,item_effect2,UseTime,ExpireDate)
VALUES(@memb_guid, @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL],[B]6700,0,6,7,[B]10080,getdate()+7)[/B][/B][/B][/I][/B][/I]
 
Newbie Spellweaver
Joined
Nov 14, 2017
Messages
93
Reaction score
3
ha
how to set it expiration date to 7 days ? and what seal this seal of wealth or master seal of wealth ?
 
Upvote 0
Back
Top