Does anyone know the stored procedure for instant level of spawning with a fresh new character to be set in auction house? if you can help me, i would be very grateful.
USE [PS_GameData]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER Proc [dbo].[usp_Create_Char_R]
@serverID tinyint, @userID varchar(12), @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
AS
SET NOCOUNT ON
declare @result int
SET @charName = LTRIM(RTRIM(@charName))
SET @SkillPoint = 5
set @result = 0
if exists (select CharID from Chars where CharName=@charName and
(Del=0 or (Del=1 and Level>10 and DeleteDate>DATEADD(dd, -7, GETDATE()))))
begin
set @result = -2
end
else
begin
-- Changes starts Here
if exists (select level from PS_GameDefs.dbo.CharDefs where
grow=@grow and family=@family and job=@job)
begin
-- replace some received values with data read from our table
select @level=[level], @statPoint=[statPoint], @skillPoint=[skillPoint],
@str=[str], @dex=[dex], @rec=[rec], @int=[int], @luc=[luc], @wis=[wis],
@HP=[HP], @MP=[MP], @SP=[SP], @exp=[exp], @money=[money],
@map=[map], @dir=[dir], @posX=[posX], @posY=[posY], @posz=[posZ]
from PS_GameDefs.dbo.CharDefs
where grow=@grow and family=@family and job=@job
-- set mode to ultimate (valid for "immediate leveling" use only)
set @grow = 3
end
-- Changes Ends Here
begin transaction
-- create toon with updated information
insert into Chars(ServerID, UserID, 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, @userID, @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)
begin
rollback transaction
set @result = -1
end
else
begin
commit transaction
set @result = IDENT_CURRENT('Chars')
end
end
SET NOCOUNT OFF