Question about auto spawn?

06/05/2013 08:38 Twilight360#1
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.
06/05/2013 16:47 infinite59#2
If i understand what you mean is when you create a new character, you want it to be spawning in AH instead of map 1 (light/dark)
If not then i suggest you to re-write your text as your english is hard to read.
So if what you are asking is what i mean:
If you use the standard instant levelling script (made by castor), this procedure
Code:
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
read the map and position of the new created character in the table PS_GameDefs.dbo.CharDefs
Just edit it inside.
Set map to 42 and set the PosX, PosY, PosZ where you want them to spawn.
06/05/2013 17:53 Twilight360#3
#Request close, as it has been answered.
06/06/2013 10:53 Muddy Waters#4
#closed