CREATE PROCEDURE CREATE_NEW_CHAR
@nRet smallint OUTPUT,
@AccountID char(21),
@index tinyint,
@CharID char(21),
@Race tinyint,
@class smallint,
@Hair tinyint,
@Face tinyint,
@Str tinyint,
@Sta tinyint,
@Dex tinyint,
@Intel tinyint,
@Cha tinyint
AS
DECLARE @Row tinyint, @Nation tinyint,
@zone tinyint, @PosX int, @PosZ int
SET @Row = 0 SET @Nation = 0 SET
@zone = 0 SET @PosX = 0 SET @PosZ = 0
SELECT @Nation = bNation, @Row = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
IF @Row >= 5 SET @nRet = 1
IF @Nation = 1 AND @Race > 10 SET @nRet = 2
ELSE IF @Nation = 2 AND @Race < 10 SET @nRet = 2
ELSE IF @Nation <>1 AND @Nation <> 2 SET @nRet = 2
IF @nRet > 0
RETURN
SELECT @Row = COUNT(*) FROM USERDATA WHERE strUserId = @CharID
IF @Row > 0
BEGIN
SET @nRet = 3
RETURN
END
SET @Zone=21
SELECT @PosX = InitX, @PosZ = InitZ FROM ZONE_INFO WHERE ZoneNo =
@zone
select @row = 3
if @CharID like '%___%'
if @CharID like '%_%'
if @CharID like '%__%'
if @CharID like '%:%'
if @CharID like '%::%'
begin
SET @nRet = 3
RETURN