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

Status
Not open for further replies.
Elite Diviner
Joined
Oct 1, 2007
Messages
413
Reaction score
9
Character Create
service
Create buffer
Script need

new char Create


new char Create



lvl 1
Buff is created
SQL script
or procedure
need











 
Last edited:
Elite Diviner
Joined
Oct 1, 2007
Messages
413
Reaction score
9
Re: KarLi help Character Creation Create buffer Script needed

After generating a new character
Buff 6700
Automatically
To be created
How necessary



For example
When creating characters
point
----
CREATE TRIGGER [Restrict_IntLUP] ON [dbo].[Character]
after Insert
as
Update [Character] set [Character].LevelUpPoint=3000 From Inserted
Where [Character].accountid=inserted.accountid and [Character].name=inserted.name
----
This way
Creating a buffer

Buff Item Number
6700












 
Upvote 0
Experienced Elementalist
Joined
Mar 18, 2012
Messages
255
Reaction score
20
Re: KarLi help Character Creation Create buffer Script needed

i dont understand, u want create character script.
and character start with buffer? what buffer?

He tryng to say that, he want new characters start with seals or some another buff items ( limited day (idea) i think
 
Upvote 0
Joined
May 26, 2009
Messages
17,317
Reaction score
3,224
Re: KarLi help Character Creation Create buffer Script needed

run this

Code:
/****** 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][/B][/I]ID    varchar(10),  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I]    varchar(10),  @[I][B][URL="http://forum.ragezone.com/members/437263.html"]clas[/URL][/B][/I]s    tinyint
AS
Begin

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

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

If EXISTS ( SELECT Name FROM Character WHERE Name =  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I] )
begin
SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]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][/B][/I]ID,  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I], NULL, NULL, NULL, NULL, NULL)

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

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

if(  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]ID As AccountID,  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I] As Name, Level, 0,  @[I][B][URL="http://forum.ragezone.com/members/437263.html"]clas[/URL][/B][/I]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][/B][/I]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][/B][/I]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][/I],[B]6700[/B],0,6,7,10080,getdate()+7)

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

TranProcEnd:
IF (  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]lt
WHEN 0x00 THEN 0x01
WHEN 0x01 THEN 0x00
WHEN 0x03 THEN 0x03
ELSE 0x02
END AS Result 
End


GO

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][/B][/I]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][/I],[B]6700[/B],0,6,7,[B]10080[/B],getdate()+7)

6700 = Item (seal)
10080 = expiration date (in seconds how much left)

from item.txt -> find Group ID + ID and make 512 x ID + ID = 6XXX for ex:
you make 512 x Group ID + ID

14 11 = box of luck 512 x 14 + 11 = 7179

Seal of Ascension = 6699
Seal of Wealth =6700
Master Seal of Ascension = 6749
Master Seal of Wealth =6750
 
Upvote 0
Experienced Elementalist
Joined
Mar 18, 2012
Messages
255
Reaction score
20
Re: KarLi help Character Creation Create buffer Script needed

run this

Code:
/****** 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][/B][/I]ID    varchar(10),  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I]    varchar(10),  @[I][B][URL="http://forum.ragezone.com/members/437263.html"]clas[/URL][/B][/I]s    tinyint
AS
Begin

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

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

If EXISTS ( SELECT Name FROM Character WHERE Name =  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I] )
begin
SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]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][/B][/I]ID,  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I], NULL, NULL, NULL, NULL, NULL)

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

SET  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]
WHERE Id =  @[I][B][URL="http://forum.ragezone.com/members/162874.html"]account[/URL][/B][/I]ID

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

if(  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]ID As AccountID,  @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I] As Name, Level, 0,  @[I][B][URL="http://forum.ragezone.com/members/437263.html"]clas[/URL][/B][/I]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][/B][/I]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][/B][/I]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][/I],[B]6700[/B],0,6,7,10080,getdate()+7)

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

TranProcEnd:
IF (  @[I][B][URL="http://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]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][/B][/I]lt
WHEN 0x00 THEN 0x01
WHEN 0x01 THEN 0x00
WHEN 0x03 THEN 0x03
ELSE 0x02
END AS Result 
End


GO

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][/B][/I]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][/I],[B]6700[/B],0,6,7,[B]10080[/B],getdate()+7)

6700 = Item (seal)
10080 = expiration date (in seconds how much left)

from item.txt -> find Group ID + ID and make 512 x ID + ID = 6XXX for ex:
you make 512 x Group ID + ID

14 11 = box of luck 512 x 14 + 11 = 7179

Seal of Ascension = 6699
Seal of Wealth =6700
Master Seal of Ascension = 6749
Master Seal of Wealth =6750

You are perfect man like everytime :p
 
Upvote 0
Elite Diviner
Joined
Oct 1, 2007
Messages
413
Reaction score
9
Re: KarLi help Character Creation Create buffer Script needed

You are great

Where the FIX?


DECLARE @memb_guid int
SELECT @memb_guid = memb_guid FROM MEMB_INFO WHERE memb___id = @accountID
INSERT INTO dbo.T_periodItem_info(memb_guid,char,itemcode,optiontype,item_effect1,item_effect2,UseTime,ExpireDate)
VALUES(@memb_guid, @name,6700,0,6,7,10080,getdate()+7)




T_PeriodItem_Info
BuyDate

BuyDate <- Character Creation daydate

dbo.T_periodItem_info(UserGuid,CharacterName,itemcode,optiontype,EffectType1,EffectType2,UseTime,BuyDate,ExpireDate)
VALUES(@memb_guid, @name,6700,0,6,7,10080,(?),getdate()+7)



T_PeriodItem_Info

PeriodIndex
UserGuid
CharacterName
ItemCode
EffectType1
EffectType2
UsedTime
LeftTime
BuyDate
ExpireDate
UsedInfo
OptionType
 
Last edited:
Upvote 0
Elite Diviner
Joined
Oct 1, 2007
Messages
413
Reaction score
9
Re: KarLi help Character Creation Create buffer Script needed

I was solved thanks karli
 
Upvote 0
Status
Not open for further replies.
Back
Top