Code:
ORGINAL POSTED BY **********.NET
This is a small guide on how to Change Starting coordinates with a Stored Procedure
I'd Like to say thanks to bjorn for the "Introduction to Stored procedures".
So Let's get started.
Make sure you have:
-MSSQL (Version doesnt matter, Im using MSSQL 2000)
-Enterprise Manager
-A working kal server with (DbSvR,MainSvR,AuthSvR/LoginSvR)
Step 1:
Open Enterprise manager and select kal_db>stored procedures.
Right click on Stored Procedures and select "New Stored procedure".
It will look like this:
Now Paste this code:
Code:
CREATE PROCEDURE CreatePlayer
@UID int,
@Name varchar(14),
@Class int,
@Strength int,
@Health int,
@Intelligence int,
@Wisdom int,
@Dexterity int,
@CurHP int,
@CurMP int,
@Map int,
@X int,
@Y int,
@Z int,
@Face int,
@Hair int
as
begin
Insert into Player ( [UID], [Name], [Class], [Strength], [Health], [Intelligence], [Wisdom], [Dexterity], [CurHP], [CurMP], [Map], [X], [Y], [Z], [Face], [Hair]) VALUES ( @UID, @Name, @Class, @Strength, @Health, @Intelligence, @Wisdom, @Dexterity, @CurHP, @CurMP, @Map,266973, 242542, 19780, @Face, @Hair)
end
GO
The Coordinates that's inserted atm is for temp, You can change the coordinates to what ever you want
So now press OK. and the Sql part is done.
Step 2:
Open your dbsvr with a hex editor and search for the query:
Code:
INSERT INTO Player ( [UID], [Name], [Class], [Strength], Health, Intelligence, Wisdom, Dexterity, [CurHP], [CurMP], [Map], [X], [Y], [Z], [Face], [Hair]) VALUES ( %d, '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)
Instead of the query above add this:
Code:
EXEC CreatePlayer %d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d
(REMEMBER to space out the rest of the query with 00 bytes)
And it should now look like this:
Remember that while you're hex editing dbsvr, you cant run it.
Now save and close. Start the server and make a new char
and you will spawn at the coordinates you've typed in the stored procedure called "CreatePlayer".