set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[CreatePlayer]
@uid int,
name varchar(14),
class tinyint,
Strength tinyint,
Health tinyint,
Intelligence tinyint,
Wisdom tinyint,
dexterity tinyint,
@curhp smallint,
@curmp smallint,
@map tinyint,
@x int,
@y int,
@z int,
face tinyint,
Hair tinyint
AS
DECLARE @PID int
DECLARE @GM int
DECLARE
globalgm int
DECLARE @itemid int
DECLARE
Startitems int
DECLARE
knightX int
DECLARE
KnightY int
DECLARE @knightz int
DECLARE @knightm int
DECLARE
magex int
DECLARE
magey int
DECLARE
magez int
DECLARE
magem int
DECLARE
archerx int
DECLARE
archery int
DECLARE
archerz int
DECLARE
archerm int
--***************************************
SET
Startitems = 1 --set to 0 to disable
--Knight*********************************
SET
knightX = 257565 -- X Coord
SET
KnightY = 259394 -- Y Coord
SET @knightz = 16131 -- Z Coord
SET @knightm = 0 -- MAP, 0 for normal world
--Mage***********************************
SET
magex = 257473 -- X Coord
SET
magey = 259191 -- Y Coord
SET
magez = 16080 -- Z Coord
SET
magem = 0 -- MAP, 0 for normal world
--Archer*********************************
SET
archerx = 257254 -- X Coord
SET
archery = 259242 -- Y Coord
SET
archerz = 16104 -- Z Coord
SET
archerm = 0 -- MAP, 0 for normal world
--***************************************
--Start Koordinates für jedes Klasse extra zuweisen
IF
class = 0) --knight
begin
Set @x =
knightX
Set @y =
KnightY
Set @z = @knightz
Set @map = @knightm
end
ELSE IF
class = 1) --mage
begin
Set @x =
magex
Set @y =
magey
Set @z =
magez
Set @map =
magem
end
ELSE IF
class = 2) --archer
begin
Set @x =
archerx
Set @y =
archery
Set @z =
archerz
Set @map =
archerm
end
set
Wisdom =
Wisdom+200
--Charakter erstellen
begin
INSERT INTO Player ( [UID], [Admin], [Name], [Class], [Strength], [Health], [Intelligence], [Wisdom], [Dexterity], [CurHP], [CurMP], [Map], [X], [Y], [Z], [Face], [Hair]) VALUES ( @uid, 0,
name,
class,
Strength,
Health Intelligence Wisdom,
dexterity,@curhp,@curmp, @map, @x, @y, @z,
face,
Hair)
end
--Jeder Klasse eigene Items geben
IF
Startitems = 1)
begin
SET @PID = (select max([PID]) from Player WHERE [UID] = @UID)
SET @itemid =(select max([IID]) from Item)
--common items
IF (@itemid >= 1000000)
begin
SET @itemid =(select max([IID]) from Item) + 1
end
ELSE
begin
SET @itemid = 1000000
end
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 3022, 0, 128, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 3009, 0, 128, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 3000, 0, 128, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 538, 0, 128, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 471, 0, 128, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
IF
class = 0) --knight
begin
--weapon
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 61, 46, 129, 1, 12, 12, 0, 8, 0, 0, 0, 0, 0, 8, 8 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 67, 46, 129, 1, 12, 12, 0, 8, 0, 0, 0, 0, 0, 8, 8 )
--armor
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 49, 0, 129, 1, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 50, 0, 129, 1, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 51, 0, 129, 1, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 52, 0, 129, 1, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 53, 0, 129, 1, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
--baked eel
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 268, 0, 128, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
INSERT INTO Skill ( [Index] , [Level] , [PID] ) VALUES ( 23 , 5, @PID )
end
ELSE IF
class = 2) --archer
begin
--weapon
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 64, 46, 129, 1, 12, 12, 0, 0, 8, 0, 0, 0, 0, 8, 8 )
--armor
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 54, 0, 129, 1, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 55, 0, 129, 1, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 56, 0, 129, 1, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 57, 0, 129, 1, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 58, 0, 129, 1, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
--baked eel
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 268, 0, 128, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
INSERT INTO Skill ( [Index] , [Level] , [PID] ) VALUES ( 6 , 3, @PID )
end
ELSE IF
class = 1) --mage
begin
--weapon
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 98, 46, 129, 1, 12, 12, 0, 8, 0, 0, 0, 0, 0, 8, 8 )
--armor
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 85, 0, 129, 1, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 86, 0, 129, 1, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 87, 0, 129, 1, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 88, 0, 129, 1, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 89, 0, 129, 1, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
--eel soup
SET @itemid = @itemid + 1
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num], [MaxEnd], [CurEnd], [SetGem], [XAttack], [XMagic], [XDefense], [XHit], [XDodge], [Protect], [UpgrLevel], [UpgrRate]) VALUES ( @PID, @itemid, 268, 0, 128, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
INSERT INTO Skill ( [Index] , [Level] , [PID] ) VALUES ( 24 , 1, @PID )
end
end