v2xxx XMYGAME | Ver.2125 Original USKO | Maden, Balık | YENİ BAŞLIYAN HERKESE | Kanat, Peri, Pathos

  • Konbuyu başlatan Konbuyu başlatan akira295
  • Başlangıç tarihi Başlangıç tarihi
USE [kn_online]
GO
/****** Object: StoredProcedure [dbo].[CREATE_NEW_CHAR] Script Date: 14.02.2021 14:54:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[CREATE_NEW_CHAR]
@strAccountID varchar(21),
@index tinyint,
@strCharID varchar(21),
@bRace tinyint,
@sClass smallint,
@nHair int,
@bFace tinyint,
@bStr tinyint,
@bSta tinyint,
@bDex tinyint,
@bIntel tinyint,
@bCha tinyint
AS

DECLARE @bNation tinyint
DECLARE @bCharCount tinyint
DECLARE @bCount tinyint

SELECT @bNation = bNation, @bCharCount = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @strAccountID

IF (@bNation = 1 AND @bRace > 10)
RETURN 2
ELSE IF (@bNation = 2 AND @bRace < 10)
RETURN 2
ELSE IF (@bNation <> 1 AND @bNation <> 2)
RETURN 2

SELECT @bCount = COUNT(strUserID) FROM USERDATA WHERE strUserID = @strCharID

IF (@bCount > 0)
RETURN 3

BEGIN TRAN
IF (@index = 0)
UPDATE ACCOUNT_CHAR SET strCharID1 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 1)
UPDATE ACCOUNT_CHAR SET strCharID2 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 2)
UPDATE ACCOUNT_CHAR SET strCharID3 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID

IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
BEGIN
ROLLBACK TRAN
RETURN 4
END

INSERT INTO USERDATA (strUserID, Nation, Race, Class, HairRGB, Face, Strong, Sta, Dex, Intel, Cha)
VALUES (@strCharID, @bNation, @bRace, @sClass, @nHair, @bFace, @bStr, @bSta, @bDex, @bIntel, @bCha)

/*-- # Beginner set optimization start #

DECLARE @bLevel tinyint
DECLARE @iExp bigint
DECLARE @nPoints smallint
DECLARE @nMoney int
DECLARE @strSkill varchar(10)
DECLARE @stritem binary(584)
DECLARE @strwarehousedata binary (584)

SELECT @bLevel = bLevel,
@iExp = iExp,
@nPoints = nPoints,
@nMoney = nMoney,
@strSkill = strSkill,
@stritem = stritem ,
@strwarehousedata = strwarehousedata
FROM BEGINNER_SET WHERE sClass = @sClass

DECLARE @bFree tinyint
DECLARE @bSkill1 tinyint
DECLARE @bSkill2 tinyint
DECLARE @bSkill3 tinyint
DECLARE @bMaster tinyint

-- Warrior
IF (@sClass IN(101,201))
BEGIN
SET @sClass += 4
-- Bonus->10
SET @nPoints -= 0
-- Str->65
SET @bStr += 0
-- Hp->65
SET @bSta += 0
-- Skill Point Option
SET @bFree = 0
SET @bSkill1 = 59
SET @bSkill2 = 41
SET @bSkill3 = 0
SET @bMaster = 0
END
-- Rogue
ELSE IF (@sClass IN(102,202))
BEGIN
SET @sClass += 5
-- Bonus->10
SET @nPoints -= 0
-- Dex->70
SET @bDex += 0
-- Hp->60
SET @bSta += 0
-- Skill Point Option
SET @bFree = 0
SET @bSkill1 = 0
SET @bSkill2 = 59
SET @bSkill3 = 41
SET @bMaster = 0
END
-- Magician
ELSE IF (@sClass IN(103,203))
BEGIN
SET @sClass += 6
-- Bonus->10
SET @nPoints -= 0
-- Int->70
SET @bIntel += 0
-- Mp->50
SET @bCha += 0
-- Skill Point Option
SET @bFree = 0
SET @bSkill1 = 0
SET @bSkill2 = 41
SET @bSkill3 = 59
SET @bMaster = 0
END
-- Priest
ELSE IF (@sClass IN(104,204))
BEGIN
SET @sClass += 7
-- Bonus->10
SET @nPoints -= 0
-- Str->50
SET @bStr += 0
-- Sta
SET @bSta += 0
-- Int->70
SET @bIntel += 0
-- Skill Point Option
SET @bFree = 0
SET @bSkill1 = 59
SET @bSkill2 = 0
SET @bSkill3 = 41
SET @bMaster = 0
END

SET @strSkill =
CAST(@bFree AS BINARY(1))
+ CAST(0 AS BINARY(4))
+ CAST(@bSkill1 AS BINARY(1))
+ CAST(@bSkill2 AS BINARY(1))
+ CAST(@bSkill3 AS BINARY(1))
+ CAST(@bMaster AS BINARY(1))

-- # Beginner set optimization end #*/

/*--warrior
EXEC EDIT_QUEST @strCharID,51 , 2
EXEC EDIT_QUEST @strCharID,510 , 2
EXEC EDIT_QUEST @strCharID,511 , 2
--rogue
EXEC EDIT_QUEST @strCharID,53 , 2
EXEC EDIT_QUEST @strCharID,515 , 2
EXEC EDIT_QUEST @strCharID,516 , 2
EXEC EDIT_QUEST @strCharID,517 , 2
--mage
EXEC EDIT_QUEST @strCharID,52 , 2
EXEC EDIT_QUEST @strCharID,512 , 2
EXEC EDIT_QUEST @strCharID,513 , 2
EXEC EDIT_QUEST @strCharID,514 , 2
---pre
EXEC EDIT_QUEST @strCharID,54 , 2
EXEC EDIT_QUEST @strCharID,518 , 2
EXEC EDIT_QUEST @strCharID,519 , 2
EXEC EDIT_QUEST @strCharID,520 , 2
EXEC EDIT_QUEST @strCharID,521 , 2
EXEC EDIT_QUEST @strCharID,522 , 2
EXEC EDIT_QUEST @strCharID,523 , 2*/
--EXEC GIVE_BEGINNER_ITEM @StrCharID

IF (@@ERROR <> 0)
BEGIN
ROLLBACK TRAN
RETURN 4
END
COMMIT TRAN

RETURN 0
 
Geri
Üst Alt