--以下代码在查询分析器里执行
--1、修改每级升级获得属性点数、技能点数:
use chart
update LEVELUPCHART set lc_statpoint = '30',lc_skillpoint='15' where lc_seq>1
--上面的30是每级升级获得属性点数,15是每级升级获得技能点数,根据你实际需要改变。
--2、去掉对属性点数的检查:
--数据库对属性点数和技能点数作了如下检查
--如果 各项属性点数之和 <> (等级 - 1) * 5 + 50 就报错
--如果 使用技能点数+剩余技能点数 <> 等级 就报错
--执行下面代码,去掉检查(这个没有试,不知道除了数据库检查,程序有没有作检查)
use game
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Fun_LoginPlayer_Select]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Fun_LoginPlayer_Select]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Fun_LoginPlayer_Select_Check]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Fun_LoginPlayer_Select_Check]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Fun_LoginPlayer_Select_New]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Fun_LoginPlayer_Select_New]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Fun_LoginPlayer_Select_New_Check]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Fun_LoginPlayer_Select_New_Check]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
/*
선택된 케릭의 정보를 반환 시킴
해당 오류 내역을 검색 후 처리함
Error Code Expain
----------------------------------------------------------------------------------------
0. 해당 사용자 정보를 찾을수 없음
1. 스텟 포인트 이상
2. 스킬 포인트 이상
----------------------------------------------------------------------------------------
*/
CREATE PROCEDURE Fun_LoginPlayer_Select
@pMsgCode INT OUTPUT, -- Message Code
@pMap INT OUTPUT, -- Map Index
@pLastLevel INT OUTPUT, -- Last Level
@pPlayerName VARCHAR(20) -- Player Name
AS
DECLARE @nPlayerSeq INT
DECLARE @nStr INT
DECLARE @nDex INT
DECLARE @nIntel INT
DECLARE @nLuck INT
DECLARE @nLastLvl INT
DECLARE @nSkillPoint INT
DECLARE @nStatPoint INT
DECLARE @nUseSkill INT
SET @pMsgCode = 0 -- 총 사용 SKILL합
-- --------------------------------------------------------------------------------------------------
-- 해당 Player의 정보를 얻음
-- --------------------------------------------------------------------------------------------------
SELECT @nPlayerSeq = CT_SEQ ,
@nStr = CT_STR ,
@nDex = CT_DEX ,
@nIntel = CT_INTEL ,
@nLuck = CT_LUCK ,
@nLastLvl = CT_LASTLVL ,
@nSkillPoint = CT_SKILLPOINT ,
@nStatPoint = CT_STATPOINT ,
@pMap = CT_MAPZONE -- Map Index
FROM CHARTABLE
WHERE CT_NAME = @pPlayerName
-- --------------------------------------------------------------------------------------------------
-- 해당 PLAYER정보를 찾을수 없는 경우
-- --------------------------------------------------------------------------------------------------
IF @@ERROR <> 0
BEGIN
SET @pMsgCode = 0
RETURN 0
END
-- --------------------------------------------------------------------------------------------------
-- 스텟 포인 이상인 경우
-- --------------------------------------------------------------------------------------------------
--IF ( @nStr + @nDex + @nIntel + @nLuck + @nStatPoint ) <> ( @nLastLvl - 1 ) * 5 + 50
--BEGIN
--INSERT INTO ERROR VALUES( @pPlayerName + ' 스텟 포인트 이상')
-- SET @pMsgCode = 1
-- RETURN 0
--END
-- --------------------------------------------------------------------------------------------------
-- 스킬 포인 이상인 경우
-- --------------------------------------------------------------------------------------------------
-- 사용 스킬 정보를 얻음
SELECT @nUseSkill = ISNULL( SUM( ST_LVL ), 0 )
FROM SKILLTABLE
WHERE ST_CHARIDX = @nPlayerSeq
--IF ( @nUseSkill + @nSkillPoint ) <> @nLastLvl
--BEGIN
--INSERT INTO ERROR VALUES( @pPlayerName + ' 스킬 포인트 이상')
-- SET @pMsgCode = 2
-- RETURN 0
--END
SET @pLastLevel = @nLastLvl
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
/****** Object: Stored Procedure dbo.Fun_LoginPlayer_Select Script Date: 8/16/2004 4:51:34 PM ******/
/*
선택된 케릭의 정보를 반환 시킴
해당 오류 내역을 검색 후 처리함
Error Code Expain
----------------------------------------------------------------------------------------
0. 해당 사용자 정보를 찾을수 없음
1. 스텟 포인트 이상
2. 스킬 포인트 이상
----------------------------------------------------------------------------------------
*/
CREATE PROCEDURE Fun_LoginPlayer_Select_Check
@pMsgCode INT OUTPUT, -- Message Code
@pMap INT OUTPUT, -- Map Index
@pLastLevel INT OUTPUT, -- Last Level
@pPlayerName VARCHAR(20) , -- Player Name
@pAccountID VARCHAR(20) -- Player Name
AS
DECLARE @strAccountID VARCHAR(20)
DECLARE @nPlayerSeq INT
DECLARE @nStr INT
DECLARE @nDex INT
DECLARE @nIntel INT
DECLARE @nLuck INT
DECLARE @nLastLvl INT
DECLARE @nSkillPoint INT
DECLARE @nStatPoint INT
DECLARE @nUseSkill INT
DECLARE @nDiffSkill INT -- 틀려진 SKILL POINT
SET @pMsgCode = 0 -- 총 사용 SKILL합
-- --------------------------------------------------------------------------------------------------
-- 해당 Player의 정보를 얻음
-- --------------------------------------------------------------------------------------------------
SELECT @nPlayerSeq = CT_SEQ ,
@nStr = CT_STR ,
@nDex = CT_DEX ,
@nIntel = CT_INTEL ,
@nLuck = CT_LUCK ,
@nLastLvl = CT_LASTLVL ,
@nSkillPoint = CT_SKILLPOINT ,
@nStatPoint = CT_STATPOINT ,
@pMap = CT_MAPZONE -- Map Index
FROM CHARTABLE
WHERE CT_NAME = @pPlayerName
AND CT_ACCOUNTID = CONVERT(BINARY(12), @pAccountID)
-- --------------------------------------------------------------------------------------------------
-- 해당 PLAYER정보를 찾을수 없는 경우
-- --------------------------------------------------------------------------------------------------
IF @@ERROR <> 0
BEGIN
INSERT INTO ERROR VALUES( 'jason test'+@pPlayerName + '/' + @pAccountID)
SET @pMsgCode = 0
RETURN 0
END
-- --------------------------------------------------------------------------------------------------
-- 현재 로그인 중이면 조인 테이블에 있다.
-- --------------------------------------------------------------------------------------------------
/*SELECT JOIN010_ACCOUNTID FROM JOIN010TL WHERE JOIN010_ACCOUNTID = CONVERT( BINARY(12), @pAccountID )
IF @@ERROR <> 0
BEGIN
--INSERT INTO ERROR VALUES( @pAccountID +'JOIN010TL' )
SET @pMsgCode = 4
RETURN 0
END */
-- ---------------------------------------------------------------------------------------------------------------------
-- 스텟 포인 이상인 경우
-- ---------------------------------------------------------------------------------------------------------------------
--IF ( @nStr + @nDex + @nIntel + @nLuck + @nStatPoint ) <> ( @nLastLvl - 1 ) * 5 + 50
--BEGIN
--INSERT INTO ERROR VALUES( @pPlayerName + ' 스텟 포인트 이상')
-- SET @pMsgCode = 1
-- RETURN 0
--END
-- ---------------------------------------------------------------------------------------------------------------------
-- 스킬 포인 이상인 경우
-- ---------------------------------------------------------------------------------------------------------------------
SELECT @nUseSkill = ISNULL( SUM( ST_LVL ), 0 )
FROM SKILLTABLE
WHERE ST_CHARIDX = @nPlayerSeq
/*
--IF ( @nUseSkill + @nSkillPoint ) <> @nLastLvl
--BEGIN
--SET @nDiffSkill = @nLastLvl - ( @nUseSkill + @nSkillPoint )
-- --------------------------------------------------------------------------------------------------------
-- 스킬이 부족한 경우 부족 스킬 만큼 입력 시킴
-- --------------------------------------------------------------------------------------------------------
--IF @nDiffSkill > 0
--BEGIN
UPDATE CHARTABLE
SET CT_SKILLPOINT = CT_SKILLPOINT + @nDiffSkill
WHERE CT_NAME = @pPlayerName
INSERT INTO ERROR (MSG) VALUES( @pPlayerName + ' 스킬 포인트 부족')
END
ELSE
BEGIN
INSERT INTO ERROR (MSG) VALUES( @pPlayerName + ' 스킬 포인트 초과')
END
END
*/
SET @pLastLevel = @nLastLvl
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
/*
선택된 케릭의 정보를 반환 시킴
해당 오류 내역을 검색 후 처리함
Error Code Expain
----------------------------------------------------------------------------------------
0. 해당 사용자 정보를 찾을수 없음
1. 스텟 포인트 이상
2. 스킬 포인트 이상
----------------------------------------------------------------------------------------
*/
CREATE PROCEDURE Fun_LoginPlayer_Select_New
@pMsgCode INT OUTPUT, -- Message Code
@pMap INT OUTPUT, -- Map Index
@pLastLevel INT OUTPUT, -- Last Level
@pAlign INT OUTPUT,
@pPlayerName VARCHAR(20) -- Player Name
AS
DECLARE @nPlayerSeq INT
DECLARE @nStr INT
DECLARE @nDex INT
DECLARE @nIntel INT
DECLARE @nLuck INT
DECLARE @nLastLvl INT
DECLARE @nSkillPoint INT
DECLARE @nStatPoint INT
DECLARE @nAlign INT
DECLARE @nUseSkill INT
SET @pMsgCode = 0 -- 총 사용 SKILL합
-- --------------------------------------------------------------------------------------------------
-- 해당 Player의 정보를 얻음
-- --------------------------------------------------------------------------------------------------
SELECT @nPlayerSeq = CT_SEQ ,
@nStr = CT_STR ,
@nDex = CT_DEX ,
@nIntel = CT_INTEL ,
@nLuck = CT_LUCK ,
@nLastLvl = CT_LASTLVL ,
@nSkillPoint = CT_SKILLPOINT ,
@nStatPoint = CT_STATPOINT ,
@nAlign = CT_ALIGNMENT ,
@pMap = CT_MAPZONE -- Map Index
FROM CHARTABLE
WHERE CT_NAME = @pPlayerName
-- --------------------------------------------------------------------------------------------------
-- 해당 PLAYER정보를 찾을수 없는 경우
-- --------------------------------------------------------------------------------------------------
IF @@ERROR <> 0
BEGIN
SET @pMsgCode = 0
RETURN 0
END
-- --------------------------------------------------------------------------------------------------
-- 스텟 포인 이상인 경우
-- --------------------------------------------------------------------------------------------------
/*
IF ( @nStr + @nDex + @nIntel + @nLuck + @nStatPoint ) <> ( @nLastLvl - 1 ) * 5 + 50
BEGIN
INSERT INTO ERROR VALUES( @pPlayerName + ' 스텟 포인트 이상')
-- SET @pMsgCode = 1
-- RETURN 0
END
*/
-- --------------------------------------------------------------------------------------------------
-- 스킬 포인 이상인 경우
-- --------------------------------------------------------------------------------------------------
-- 사용 스킬 정보를 얻음
SELECT @nUseSkill = ISNULL( SUM( ST_LVL ), 0 )
FROM SKILLTABLE
WHERE ST_CHARIDX = @nPlayerSeq
/*
IF ( @nUseSkill + @nSkillPoint ) <> @nLastLvl
BEGIN
INSERT INTO ERROR VALUES( @pPlayerName + ' 스킬 포인트 이상')
-- SET @pMsgCode = 2
-- RETURN 0
END
*/
SET @pLastLevel = @nLastLvl
SET @pAlign = @nAlign
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE Fun_LoginPlayer_Select_New_Check
@pMsgCode INT OUTPUT, -- Message Code
@pMap INT OUTPUT, -- Map Index
@pLastLevel INT OUTPUT, -- Last Level
@pAlign INT OUTPUT,
@pPlayerName VARCHAR(20) , -- Player Name
@pAccountID VARCHAR(20) -- Player Name
AS
DECLARE @strAccountID VARCHAR(20)
DECLARE @nPlayerSeq INT
DECLARE @nStr INT
DECLARE @nDex INT
DECLARE @nIntel INT
DECLARE @nLuck INT
DECLARE @nLastLvl INT
DECLARE @nSkillPoint INT
DECLARE @nStatPoint INT
DECLARE @nAlign INT
DECLARE @nUseSkill INT
DECLARE @nDiv SMALLINT
SET @pMsgCode = 0 -- ? ?? SKILL?
SELECT @nPlayerSeq = CT_SEQ ,
@nStr = CT_STR ,
@nDex = CT_DEX ,
@nIntel = CT_INTEL ,
@nLuck = CT_LUCK ,
@nLastLvl = CT_LASTLVL ,
@nSkillPoint = CT_SKILLPOINT ,
@nStatPoint = CT_STATPOINT ,
@nAlign = CT_ALIGNMENT ,
@pMap = CT_MAPZONE , -- Map Index
@nDiv = CT_DIV
FROM CHARTABLE
WHERE CT_NAME = @pPlayerName
AND CT_ACCOUNTID = CONVERT(BINARY(12), @pAccountID)
SET @pLastLevel = @nLastLvl
SET @pAlign = @nAlign
IF @@ERROR <> 0
BEGIN
SET @pMsgCode = 0
RETURN 0
END
/*SELECT JOIN010_ACCOUNTID FROM JOIN010TL WHERE JOIN010_ACCOUNTID = CONVERT( BINARY(12), @pAccountID )
IF @@ERROR <> 0
BEGIN
INSERT INTO ERROR VALUES( @pAccountID +'NO RECORD IN JOIN010' )
SET @pMsgCode = 4
RETURN 0
END */
/*ELSE
BEGIN
IF SELECT COUNT(*) FROM Bak_GDB.dbo.Award_Type
BEGIN
EXEC Bak_GDB.dbo.PROC_SendItem @nPlayerSeq
END
END*/
/*
IF ( @nStr + @nDex + @nIntel + @nLuck + @nStatPoint ) <= ( ( @nLastLvl - 1 ) * 5 + 50 )
BEGIN
UPDATE CHARTABLE
SET CT_StatPoint =( (@nLastLvl-1)*5+50-@nStr-@nDex-@nIntel-@nLuck)
WHERE CT_SEQ=@nPlayerSeq
END
ELSE BEGIN
IF ( @nStr + @nDex + @nIntel + @nLuck ) <= ( ( @nLastLvl - 1 ) * 5 + 50 )
BEGIN
UPDATE CHARTABLE
SET CT_StatPoint =@nStatPoint
WHERE CT_SEQ=@nPlayerSeq
END
ELSE
BEGIN
UPDATE CHARTABLE
SET CT_StatPoint =@nStatPoint
WHERE CT_SEQ=@nPlayerSeq
END
END
*/
SELECT @nUseSkill = ISNULL( SUM( ST_LVL ), 0 )
FROM SKILLTABLE
WHERE ST_CHARIDX = @nPlayerSeq
/*
IF ( @nUseSkill + @nSkillPoint ) <= @nLastLvl
BEGIN
UPDATE CHARTABLE
SET CT_SKILLPOINT=(@nLastLvl-@nUseSkill)
WHERE CT_SEQ=@nPlayerSeq
END
ELSE
BEGIN
IF (@nLastLvl >= @nUseSkill)
BEGIN
UPDATE CHARTABLE
SET CT_SKILLPOINT=(@nLastLvl-@nUseSkill)
WHERE CT_SEQ=@nPlayerSeq
END
ELSE
BEGIN
IF @nDiv < 2 -- if not admin
BEGIN
SET @pMsgCode = 2
RETURN 0
END
END
END
*/
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO