Jump to content
Araştır
  • Diğer seçenekler ...
Sonuçları bul ...
Sonuçları bul ...
Netfarmko

21xx için 1 lvl baslangic yapma

Önerilen Mesajlar

DB de USERDATA tablosuna sağ tıkla DESIGN de. gelen pencerede [LEVEL] colum ün default değerini 1 yap. aynı zamanda skill ve statlarda column isimlerine bakarak düzeltebilirsin. tabiki @ OzkanOzdemir in bahsettiği gibi prosedür ile DB ye yazılmamış ise bu dediklerim geçerli..

İletiyi paylaş


Link to post
Sitelerde Paylaş

USE [kn_online]
GO
/****** Object: StoredProcedure [dbo].[CREATE_NEW_CHAR] Script Date: 22.07.2018 22:08:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[CREATE_NEW_CHAR]
@strAccountID varchar(21),
@index tinyint,
@strCharID varchar(21),
@bRace tinyint,
@sClass smallint,
@nHair int,
@bFace tinyint,
@bStr tinyint,
@bSta tinyint,
@bDex tinyint,
@bIntel tinyint,
@bCha tinyint
AS
DECLARE @bNation tinyint
DECLARE @bCharCount tinyint
DECLARE @bCount tinyint

SELECT @bNation = bNation, @bCharCount = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @strAccountID

--IF (@bNation = 1 AND @bRace > 10)
--RETURN 2
--ELSE IF (@bNation = 2 AND @bRace --RETURN 2
--ELSE IF (@bNation 1 AND @bNation 2)
--RETURN 2

SELECT @bCount = COUNT(strUserID) FROM USERDATA WHERE strUserID = @strCharID

IF (@bCount > 0)
RETURN 3

BEGIN TRAN
IF (@index = 0)
UPDATE ACCOUNT_CHAR SET strCharID1 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 1)
UPDATE ACCOUNT_CHAR SET strCharID2 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 2)
UPDATE ACCOUNT_CHAR SET strCharID3 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 3)
UPDATE ACCOUNT_CHAR SET strCharID4 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID

IF (@@ERROR 0 OR @@ROWCOUNT = 0)
BEGIN
ROLLBACK TRAN
RETURN 4
END

INSERT INTO USERDATA (strUserID, Nation, Race, Class, HairRGB, Face, Strong, Sta, Dex, Intel, Cha)
VALUES (@strCharID, @bNation, @bRace, @sClass, @nHair, @bFace, @bStr, @bSta, @bDex, @bIntel, @bCha)
EXEC GIVE_BEGINNER_ITEM @StrCharID
EXEC MASTER_AC @StrCharID


IF (@@ERROR 0)
BEGIN
ROLLBACK TRAN
RETURN 4
END
COMMIT TRAN

RETURN 0



Bu Şekilde Hocam

İletiyi paylaş


Link to post
Sitelerde Paylaş
Alıntı
USE [kn_online]
GO
/****** Object: StoredProcedure [dbo].[CREATE_NEW_CHAR] Script Date: 22.07.2018 22:08:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[CREATE_NEW_CHAR]
@strAccountID varchar(21),
@index tinyint,
@strCharID varchar(21),
@bRace tinyint,
@sClass smallint,
@nHair int,
@bFace tinyint,
@bStr tinyint,
@bSta tinyint,
@bDex tinyint,
@bIntel tinyint,
@bCha tinyint
AS
DECLARE @bNation tinyint
DECLARE @bCharCount tinyint
DECLARE @bCount tinyint

SELECT @bNation = bNation, @bCharCount = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @strAccountID

--IF (@bNation = 1 AND @bRace > 10)
--RETURN 2
--ELSE IF (@bNation = 2 AND @bRace --RETURN 2
--ELSE IF (@bNation 1 AND @bNation 2)
--RETURN 2

SELECT @bCount = COUNT(strUserID) FROM USERDATA WHERE strUserID = @strCharID

IF (@bCount > 0)
RETURN 3

BEGIN TRAN
IF (@index = 0)
UPDATE ACCOUNT_CHAR SET strCharID1 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 1)
UPDATE ACCOUNT_CHAR SET strCharID2 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 2)
UPDATE ACCOUNT_CHAR SET strCharID3 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID
ELSE IF (@index = 3)
UPDATE ACCOUNT_CHAR SET strCharID4 = @strCharID, bCharNum += 1 WHERE strAccountID = @strAccountID

IF (@@ERROR 0 OR @@ROWCOUNT = 0)
BEGIN
ROLLBACK TRAN
RETURN 4
END

INSERT INTO USERDATA (strUserID, Nation, Race, Class, HairRGB, Face, Strong, Sta, Dex, Intel, Cha)
VALUES (@strCharID, @bNation, @bRace, @sClass, @nHair, @bFace, @bStr, @bSta, @bDex, @bIntel, @bCha)
EXEC GIVE_BEGINNER_ITEM @StrCharID
EXEC MASTER_AC @StrCharID


IF (@@ERROR 0)
BEGIN
ROLLBACK TRAN
RETURN 4
END
COMMIT TRAN

RETURN 0



Bu Şekilde Hocam


EXEC GIVE_BEGINNER_ITEM @StrCharID bunu kaldırırsan başlangıç eşyalarını vermez.
EXEC MASTER_AC @StrCharID bunu kaldırırsan master vs. açmaz.

İletiyi paylaş


Link to post
Sitelerde Paylaş

1 level için prosedür yok ama ben şu şekilde yaptım, başlangıç itemlerini silip warrior priest vs karakter açıp editörle 1 lvl yaptım ve sonra db de actığım charlar 1 lvl oldu yanlış isem düzeltin, uzun zaman olmuştu yapalı..

İletiyi paylaş


Link to post
Sitelerde Paylaş

×
×
  • Yeni Oluştur...