:') @-III- changed the way I think, If I want a community to change, might as well chip in and help it change :P Here is my stored procedure (ep3) hootzoo, just add the changes you want by where I have it :P
USE [PS_GameData]
GO
/****** Object: StoredProcedure [dbo].[usp_Create_Char_R] Script Date: 05/22/2012 18:14:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** Object: Stored Procedure dbo.usp_Create_Char_R Script Date: 2008-6-7 18:31:57 ******/
/****** Object: Stored Procedure dbo.usp_Create_Char_R Script Date: 2008/3/15 下午 05:25:51 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.usp_Create_Char_R 蝶觼董 陳瞼: 2006-05-26 螃 1:54:44 ******/
ALTER Proc [dbo].[usp_Create_Char_R]
@ServerID tinyint,
@UserID varchar(18),
@UserUID int,
@CharName varchar(50) ,
@Slot Tinyint,
@Family Tinyint,
@Grow Tinyint,
@Hair Tinyint,
@Face Tinyint,
@Size Tinyint,
@Job Tinyint,
@Sex Tinyint,
@Level Smallint,
@Statpoint Smallint,
@Skillpoint Smallint,
@Str Smallint,
@Dex Smallint,
@Rec Smallint,
@Int Smallint,
@Luc Smallint,
@Wis Smallint,
@Hp Smallint,
@Mp Smallint,
@Sp Smallint,
@Map Smallint,
@Dir Smallint,
@Exp Int,
@Money Int,
@Posx Real,
@Posy Real,
@Posz Real,
@Hg Smallint,
@Vg Smallint,
@Cg Tinyint,
@Og Tinyint,
@Ig Tinyint,
/* 罹晦梱雖 檣濠高 輿橫螳撿 */
/* SP 頂睡 霤褻辨 滲熱 */
@CharID int = 0,
@NameCnt tinyint = 0
AS
SET NOCOUNT ON
IF @Grow = 0 --Easy Mode
BEGIN
SET @Grow = 3
SET @Level = 1
SET @money = 500000
END
IF @Grow = 1-- Normal Mode
BEGIN
SET @Grow = 3
SET @Level = 1
SET @money = 500000
END
IF @Grow = 2 -- Hard Mode
BEGIN
SET @Grow = 3
SET @Level = 1
SET @money = 500000
END
IF @Grow = 3-- Ultimate Mode
BEGIN
SET @Grow = 3
SET @Level = 1
SET @money = 500000
END
IF EXISTS ( SELECT CharID FROM Chars WHERE CharName=@CharName AND Del=0)
BEGIN
RETURN -2
END
SET @CharName = LTRIM(RTRIM(@CharName))
SET @SkillPoint = 5
BEGIN
INSERT INTO Chars(ServerID,UserUID, CharName, Slot, Family, Grow,
Hair, Face, [Size], Job, Sex, [Level], StatPoint, SkillPoint,
[Str], Dex, Rec, [Int], Luc, Wis, HP, MP, SP, Map, Dir, [Exp], [Money],
PosX, PosY, Posz, Hg, Vg, Cg, Og, Ig, RenameCnt, RemainTime)
VALUES(@ServerID, @UserUID, @CharName, @Slot, @Family, @Grow,
@Hair, @Face, @Size, @Job, @Sex, @Level, @StatPoint, @SkillPoint,
@Str, @Dex, @Rec, @Int, @Luc, @Wis, @HP, @MP, @SP, @Map, @Dir, @Exp, @Money,
@PosX, @PosY, @Posz, @Hg, @Vg, @Cg, @Og, @Ig, 0,0)
IF ( @@ERROR<>0 )
RETURN -1
SET @CharID = IDENT_CURRENT('Chars')
RETURN @CharID
END
SET NOCOUNT OFF
That is what I did :P And it worked :) There could be cleaner ways to do it, just this method worked :)