USE [ITEM_DBF]
GO
/****** Object: Table [dbo].[MONSTER_TBL] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MONSTER_TBL](
[Index] [int] NULL,
[szName] [varchar](256) NULL,
[Level] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[JOB_TBL] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[JOB_TBL](
[Index] [int] NULL,
[szJobName] [varchar](32) NULL,
[szJobNameen] [varchar](32) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[ITEM_TBL] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ITEM_TBL](
[Index] [int] NULL,
[szName] [nvarchar](255) NULL,
[szNameEn] [nvarchar](255) NULL,
[dwNum] [int] NULL,
[dwPackMax] [int] NULL,
[dwItemKind1] [int] NULL,
[dwItemKind2] [int] NULL,
[dwItemKind3] [int] NULL,
[dwItemJob] [int] NULL,
[bPermanence] [int] NULL,
[dwUseable] [int] NULL,
[dwItemSex] [int] NULL,
[dwWeight] [int] NULL,
[dwCost] [int] NULL,
[dwCash] [int] NULL,
[dwEndurance] [int] NULL,
[bRepairUnable] [int] NULL,
[bJammed] [int] NULL,
[nAbrasion] [int] NULL,
[nHardness] [int] NULL,
[dwParts] [int] NULL,
[dwItemLV] [int] NULL,
[dwAddLV] [int] NULL,
[dwItemRare] [int] NULL,
[bLog] [int] NULL,
[dwSpeedPenalty] [int] NULL,
[dwLinkItem] [int] NULL,
[dwAbilityMin] [int] NULL,
[dwAbilityMax] [int] NULL,
[dwAddSkillMin] [int] NULL,
[dwAddSkillMax] [int] NULL,
[dwWeaponType] [int] NULL,
[bContinuousPain] [int] NULL,
[dwShellQuantity] [int] NULL,
[dwRecoil] [int] NULL,
[dwCaliber] [int] NULL,
[dwBarrageRate] [int] NULL,
[dwLoadingTime] [int] NULL,
[nAdjHitRate] [int] NULL,
[nAdjSpellRate] [int] NULL,
[dwAttackSpeed] [int] NULL,
[dwDmgShift] [int] NULL,
[dwAttackRange] [int] NULL,
[dwConnaturalSkill] [int] NULL,
[dwAdjRoll] [int] NULL,
[dwDestParam1] [int] NULL,
[dwDestParam2] [int] NULL,
[nAdjParamVal1] [int] NULL,
[nAdjParamVal2] [int] NULL,
[dwChgParamVal1] [int] NULL,
[dwChgParamVal2] [int] NULL,
[dwReqJob] [int] NULL,
[dwReqStr] [int] NULL,
[dwReqSta] [int] NULL,
[dwReqDex] [int] NULL,
[dwReqInt] [int] NULL,
[dwReqMp] [int] NULL,
[dwRepFp] [int] NULL,
[dwReqJobLV] [int] NULL,
[dwReqDisLV] [int] NULL,
[dwSkillReadyType] [int] NULL,
[dwSkillReady] [int] NULL,
[dwSkillRange] [int] NULL,
[dwCircleTime] [int] NULL,
[dwSkillTime] [int] NULL,
[dwExeChance] [int] NULL,
[dwExeTarget] [int] NULL,
[dwUseChance] [int] NULL,
[dwSpellRegion] [int] NULL,
[dwSpellType] [int] NULL,
[dwSkillType] [int] NULL,
[dwItemResistMagic] [int] NULL,
[dwItemResistElecricity] [int] NULL,
[dwItemResistDark] [int] NULL,
[dwItemResistFire] [int] NULL,
[dwItemResistWind] [int] NULL,
[dwItemResistWater] [int] NULL,
[dwItemResistEarth] [int] NULL,
[bAmplification] [int] NULL,
[bFusion] [int] NULL,
[nEvildoing] [int] NULL,
[bGrow] [int] NULL,
[bCraft] [int] NULL,
[dwExpertLV] [int] NULL,
[ExpertMax] [int] NULL,
[dwSubDefine] [int] NULL,
[dwExp] [int] NULL,
[LVRatio] [int] NULL,
[dwCardType] [int] NULL,
[fFlightSpeed] [float] NULL,
[dwFlightLimit] [int] NULL,
[dwLimitJob1] [int] NULL,
[dwLimitLevel1] [int] NULL,
[dwLimitJob2] [int] NULL,
[dwLimitLevel2] [int] NULL,
[dwReflect] [int] NULL,
[szComment] [nvarchar](255) NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tm_ITEM_TBL] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tm_ITEM_TBL](
[Index] [int] NULL,
[szName] [nvarchar](255) NULL,
[szNameEn] [nvarchar](255) NULL,
[dwNum] [int] NULL,
[dwPackMax] [int] NULL,
[dwItemKind1] [int] NULL,
[dwItemKind2] [int] NULL,
[dwItemKind3] [int] NULL,
[dwItemJob] [int] NULL,
[bPermanence] [int] NULL,
[dwUseable] [int] NULL,
[dwItemSex] [int] NULL,
[dwWeight] [int] NULL,
[dwCost] [int] NULL,
[dwCash] [int] NULL,
[dwEndurance] [int] NULL,
[bRepairUnable] [int] NULL,
[bJammed] [int] NULL,
[nAbrasion] [int] NULL,
[nHardness] [int] NULL,
[dwParts] [int] NULL,
[dwItemLV] [int] NULL,
[dwAddLV] [int] NULL,
[dwItemRare] [int] NULL,
[bLog] [int] NULL,
[dwSpeedPenalty] [int] NULL,
[dwLinkItem] [int] NULL,
[dwAbilityMin] [int] NULL,
[dwAbilityMax] [int] NULL,
[dwAddSkillMin] [int] NULL,
[dwAddSkillMax] [int] NULL,
[dwWeaponType] [int] NULL,
[bContinuousPain] [int] NULL,
[dwShellQuantity] [int] NULL,
[dwRecoil] [int] NULL,
[dwCaliber] [int] NULL,
[dwBarrageRate] [int] NULL,
[dwLoadingTime] [int] NULL,
[nAdjHitRate] [int] NULL,
[nAdjSpellRate] [int] NULL,
[dwAttackSpeed] [int] NULL,
[dwDmgShift] [int] NULL,
[dwAttackRange] [int] NULL,
[dwConnaturalSkill] [int] NULL,
[dwAdjRoll] [int] NULL,
[dwDestParam1] [int] NULL,
[dwDestParam2] [int] NULL,
[nAdjParamVal1] [int] NULL,
[nAdjParamVal2] [int] NULL,
[dwChgParamVal1] [int] NULL,
[dwChgParamVal2] [int] NULL,
[dwReqJob] [int] NULL,
[dwReqStr] [int] NULL,
[dwReqSta] [int] NULL,
[dwReqDex] [int] NULL,
[dwReqInt] [int] NULL,
[dwReqMp] [int] NULL,
[dwRepFp] [int] NULL,
[dwReqJobLV] [int] NULL,
[dwReqDisLV] [int] NULL,
[dwSkillReadyType] [int] NULL,
[dwSkillReady] [int] NULL,
[dwSkillRange] [int] NULL,
[dwCircleTime] [int] NULL,
[dwSkillTime] [int] NULL,
[dwExeChance] [int] NULL,
[dwExeTarget] [int] NULL,
[dwUseChance] [int] NULL,
[dwSpellRegion] [int] NULL,
[dwSpellType] [int] NULL,
[dwSkillType] [int] NULL,
[dwItemResistMagic] [int] NULL,
[dwItemResistElecricity] [int] NULL,
[dwItemResistDark] [int] NULL,
[dwItemResistFire] [int] NULL,
[dwItemResistWind] [int] NULL,
[dwItemResistWater] [int] NULL,
[dwItemResistEarth] [int] NULL,
[bAmplification] [int] NULL,
[bFusion] [int] NULL,
[nEvildoing] [int] NULL,
[bGrow] [int] NULL,
[bCraft] [int] NULL,
[dwExpertLV] [int] NULL,
[ExpertMax] [int] NULL,
[dwSubDefine] [int] NULL,
[dwExp] [int] NULL,
[LVRatio] [int] NULL,
[dwCardType] [int] NULL,
[fFlightSpeed] [float] NULL,
[dwFlightLimit] [int] NULL,
[dwLimitJob1] [int] NULL,
[dwLimitLevel1] [int] NULL,
[dwLimitJob2] [int] NULL,
[dwLimitLevel2] [int] NULL,
[dwReflect] [int] NULL,
[szComment] [nvarchar](255) NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[TEST_CONVERT_TBL] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TEST_CONVERT_TBL](
[Lv] [int] NULL,
[Exp] [bigint] NULL,
[Exp_n] [bigint] NULL,
[Pxp] [int] NULL
) ON [PRIMARY]
GO
/****** Object: StoredProcedure [dbo].[sp_generate_insert_script] Script Date: 11/22/2013 14:36:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[sp_generate_insert_script]
@tablename_mask sysname = NULL
as
begin
--------------------------------------------------------------------------------
-- Stored Procedure: sp_generate_insert_script
-- Language: Microsoft Transact SQL (7.0)
-- Author: Inez Boone ([Only registered and activated users can see links. Click Here To Register...])
-- working on the Sybase version of & thanks to:
-- Reinoud van Leeuwen ([Only registered and activated users can see links. Click Here To Register...])
-- Version: 1.4
-- Date: December 6th, 2000
-- Description: This stored procedure generates an SQL script to fill the
-- tables in the database with their current content.
-- Parameters: IN: @tablename_mask : mask for tablenames
-- History: 1.0 October 3rd 1998 Reinoud van Leeuwen
-- first version for Sybase
-- 1.1 October 7th 1998 Reinoud van Leeuwen
-- added limited support for text fields; the first 252
-- characters are selected.
-- 1.2 October 13th 1998 Reinoud van Leeuwen
-- added support for user-defined datatypes
-- 1.3 August 4 2000 Inez Boone
-- version for Microsoft SQL Server 7.0
-- use dynamic SQL, no intermediate script
-- 1.4 December 12 2000 Inez Boone
-- handles quotes in strings, handles identity columns
-- 1.5 December 21 2000 Inez Boone
-- Output sorted alphabetically to assist db compares,
-- skips timestamps
-- 1.6 June 10 2005 [Only registered and activated users can see links. Click Here To Register...]
-- added support for reserver keyword
--------------------------------------------------------------------------------
-- NOTE: If, when executing in the Query Analyzer, the result is truncated, you can remedy
-- this by choosing Query / Current Connection Options, choosing the Advanced tab and
-- adjusting the value of 'Maximum characters per column'.
-- Unchecking 'Print headers' will get rid of the line of dashes.
declare @tablename varchar (128)
declare @tablename_max varchar (128)
declare @tableid int
declare @columncount numeric (7,0)
declare @columncount_max numeric (7,0)
declare @columnname varchar (30)
declare @columntype int
declare @string varchar (30)
declare @leftpart varchar (8000) /* 8000 is the longest string SQLSrv7 can EXECUTE */
declare @rightpart varchar (8000) /* without having to resort to concatenation */
declare @hasident int
set nocount on
-- take ALL tables when no mask is given (!)
if (@tablename_mask is NULL)
begin
select @tablename_mask = '%'
end
-- create table columninfo now, because it will be used several times
create table #columninfo (num numeric (7,0) identity,name varchar(30),usertype smallint)
select name,id into #tablenames
from sysobjects
where type in ('U' ,'S')
and name like @tablename_mask
-- loop through the table #tablenames
select @tablename_max = MAX (name),@tablename = MIN (name)
from #tablenames
while @tablename <= @tablename_max
begin
select @tableid = id
from #tablenames
where name = @tablename
if (@@rowcount <> 0)
begin
-- Find out whether the table contains an identity column
select @hasident = max( status & 0x80 )
from syscolumns
where id = @tableid
truncate table #columninfo
insert into #columninfo (name,usertype)
select name, type
from syscolumns C
where id = @tableid
and type <> 37 -- do not include timestamps
-- Fill @leftpart with the first part of the desired insert-statement, with the fieldnames
select @leftpart = 'select ''insert into '+@tablename
select @leftpart = @leftpart + '('
select @columncount = MIN (num),@columncount_max = MAX (num)
from #columninfo
while @columncount <= @columncount_max
begin
select @columnname = quotename([name]),@columntype = usertype
from #columninfo
where num = @columncount
if (@@rowcount <> 0)
begin
if (@columncount < @columncount_max)
begin
select @leftpart = @leftpart + @columnname + ','
end
else
begin
select @leftpart = @leftpart + @columnname + ')'
end
end
select @columncount = @columncount + 1
end
select @leftpart = @leftpart + ' values('''
-- Now fill @rightpart with the statement to retrieve the values of the fields, correctly formatted
select @columncount = MIN (num),
@columncount_max = MAX (num)
from #columninfo
select @rightpart = ''
while @columncount <= @columncount_max
begin
select @columnname = quotename(name),@columntype = usertype
from #columninfo
where num = @columncount
if (@@rowcount <> 0)
begin
if @columntype in (39,47) /* char fields need quotes (except when entering NULL);
* use char(39) == ', easier readable than escaping
*/
begin
select @rightpart = @rightpart + '+'
select @rightpart = @rightpart + 'ISNULL(' + replicate( char(39), 4 ) + '+replace(' + @columnname + ','
+ replicate( char(39), 4 ) + ',' + replicate( char(39), 6) + ')+' + replicate ( char(39), 4 ) + ',''NULL'')'
end
else if @columntype = 35 /* TEXT fields cannot be RTRIM-ed and need quotes */
/* convert to VC 1000 to leave space for other fields */
begin
select @rightpart = @rightpart + '+'
select @rightpart = @rightpart + 'ISNULL(' + replicate( char(39), 4 ) + '+replace (convert(varchar(1000),'
+ @columnname + ')' + ',' + replicate( char(39), 4 ) + ',' + replicate( char(39), 6 ) + ')+'
+ replicate( char(39), 4 ) + ',''NULL'')'
end
else if @columntype in (58,61,111) /* datetime fields */
begin
select @rightpart = @rightpart + '+'
select @rightpart = @rightpart + 'ISNULL(' + replicate( char(39), 4 ) + '+convert (varchar(20),'
+ @columnname + ')+'+ replicate( char(39), 4 ) + ',''NULL'')'
end
else /* numeric types */
begin
select @rightpart = @rightpart + '+'
select @rightpart = @rightpart + 'ISNULL(convert(varchar(99),' + @columnname + '),''NULL'')'
end
if ( @columncount < @columncount_max)
begin
select @rightpart = @rightpart + '+'','''
end
end
select @columncount = @columncount + 1
end
end
select @rightpart = @rightpart + '+'')''' + ' from ' + @tablename
-- Order the select-statements by the first column so you have the same order for
-- different database (easy for comparisons between databases with different creation orders)
select @rightpart = @rightpart + ' order by 1'
-- For tables which contain an identity column we turn identity_insert on
-- so we get exactly the same content
if @hasident > 0
select 'SET IDENTITY_INSERT ' + @tablename + ' ON'
exec ( @leftpart + @rightpart )
if @hasident > 0
select 'SET IDENTITY_INSERT ' + @tablename + ' OFF'
select @tablename = MIN (name)
from #tablenames
where name > @tablename
end
end
return
GO
/****** Object: Table [dbo].[SKILL_TBL] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SKILL_TBL](
[Index] [int] NULL,
[szName] [varchar](256) NULL,
[job] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[SEX_TBL] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SEX_TBL](
[Index] [int] NULL,
[szSex] [varchar](10) NULL,
[szSexen] [varchar](20) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[QUEST_TBL] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[QUEST_TBL](
[Index] [int] NULL,
[szName] [varchar](256) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[flyff_ranking_temp] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[flyff_ranking_temp](
[ranking] [int] IDENTITY(1,1) NOT NULL,
[account] [varchar](32) NOT NULL,
[m_szName] [varchar](32) NOT NULL,
[m_nLevel] [int] NOT NULL,
[m_nExp1] [int] NOT NULL,
[m_nJob] [char](2) NOT NULL,
[serverindex] [char](2) NOT NULL,
[regday] [char](10) NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[ITEM_KIND2_TBL] Script Date: 11/22/2013 14:36:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ITEM_KIND2_TBL](
[Index] [int] NULL,
[szIKName] [varchar](256) NULL,
[szIKNameen] [varchar](256) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: UserDefinedFunction [dbo].[fnGetPattern] Script Date: 11/22/2013 14:36:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[fnGetPattern] (
@iData VARCHAR(3000),
@iValue VARCHAR(1)
)
RETURNS INT
AS
BEGIN
DECLARE @len INT, @cur INT, @ret INT
SET @cur = 1
SET @ret = 0
SET @len = LEN(@iData)
WHILE ( @cur <> @len )
BEGIN
IF ( SUBSTRING(@iData, @cur, 1) = @iValue )
BEGIN
SET @ret = @ret + 1
END
SET @cur = @cur + 1
END
RETURN @ret
END
-- SELECT dbo.fnGetPattern('/1/-1/-1/-1/-1/-1/-1/-1/$', '/')
--SELECT substring('A/1/-1/-1/-1/-1/-1/-1/-1/$', 5, 1)
GO
/****** Object: UserDefinedFunction [dbo].[fnDateFormat] Script Date: 11/22/2013 14:36:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[fnDateFormat] (
@iData VARCHAR(3000),
@iValue CHAR(1)
)
RETURNS INT
AS
BEGIN
DECLARE @len INT, @cur INT, @ret INT
SET @cur = 0
SET @ret = 0
SET @len = LEN(@iData)
WHILE ( @cur = @len )
BEGIN
IF ( ASCII(SUBSTRING(@iValue, @cur, 1)) = @iValue )
BEGIN
SET @cur = @cur + 1
END
SET @cur = @cur + 1
END
RETURN @ret
END
GO
/****** Object: StoredProcedure [dbo].[uspGetItemKind] Script Date: 11/22/2013 14:36:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE Procedure [dbo].[uspGetItemKind]
AS
SET NOCOUNT ON
SELECT
[Index] as ItemKind,
szIKName as ItemKindName,
szIKNameen as ItemKingEngName
FROM
ITEM_DBF.dbo.ITEM_KIND2_TBL
ORDER BY [Index]
SET NOCOUNT OFF
GO
/****** Object: StoredProcedure [dbo].[usp_ItemProperty] Script Date: 11/22/2013 14:36:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[usp_ItemProperty]
@Index int,
@szName varchar(510) = '' output,
@Kind1 int = 0 output,
@Kind2 int = 0 output,
@Kind3 int = 0 output
as
set nocount on
select @szName = szName, @Kind1 = dwItemKind1, @Kind2 = dwItemKind2, @Kind3 = dwItemKind3
from ITEM_TBL (nolock)
where [Index] = @Index
GO
/****** Object: StoredProcedure [dbo].[usp_item_index_check] Script Date: 11/22/2013 14:36:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[usp_item_index_check]
@szName varchar(510)
as
set nocount on
declare @check tinyint
set @check = (select count(*) from ITEM_TBL where szName = @szName)
if(@check = 0)
begin
select -1
end
else
begin
select [Index]
from ITEM_TBL
where szName = @szName
end
GO
/****** Object: StoredProcedure [dbo].[usp_bia_procsql] Script Date: 11/22/2013 14:36:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[usp_bia_procsql]
@itemindex int
as
set nocount on
SELECT a.szName, -- Item Name
a.szNameEn, -- Item Name English
b.szIKName, -- Item Kind
a.dwPackMax,
CAST(a.dwAbilityMin AS VARCHAR(12)) + ' ==> ' + CAST(a.dwAbilityMax AS VARCHAR(12)) as dwAbility,
c.szJobName,
a.dwItemLV,
dwWeight,
a.dwAttackSpeed,
a.dwCost,
a.dwEndurance,
CASE a.dwItemSex
WHEN 0 THEN '남자용'
WHEN 1 THEN '여자용'
WHEN 2 THEN '공통용'
ELSE '' END AS dwItemSex
FROM ITEM_TBL as a left outer join ITEM_KIND2_TBL as b on a.dwItemKind2 = b.[Index]
left outer join JOB_TBL as c on a.dwItemJob = c.[Index]
where a.[Index] = @itemindex
GO
/****** Object: StoredProcedure [dbo].[usp_bia_getitem] Script Date: 11/22/2013 14:36:36 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
create proc [dbo].[usp_bia_getitem]
@itemindex int
as
set nocount on
SELECT a.szName, a.szNameEn, a.dwPackMax, b.szIKName dwItemKind2,
CASE a.dwItemSex WHEN 0 THEN '남자용'
WHEN 1 THEN '여자용'
WHEN 2 THEN '공통용'
ELSE '' END AS dwItemSex,
a.dwAbilityMin, a.dwAbilityMax, a.dwAttackSpeed, c.szJobName dwItemJob, a.dwReqStr, a.dwReqSta, a.dwReqDex, a.dwReqInt,
a.dwDestParam1, a.dwDestParam2, a.nAdjParamVal1, a.nAdjParamVal2, dwWeight, dwEndurance, dwCost, szComment
FROM ITEM_TBL a, ITEM_KIND2_TBL b, JOB_TBL c
WHERE a.dwItemKind2 = b.[Index]
AND a.dwItemJob = c.[Index]
AND a.[Index] = @itemindex
GO
/****** Object: UserDefinedFunction [dbo].[fn_ItemName] Script Date: 11/22/2013 14:36:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE function [dbo].[fn_ItemName] (@Index int)
returns varchar(32)
as
begin
declare @szName varchar(32)
select @szName = szName from ITEM_TBL where [Index] = @Index
set @szName = isnull(@szName, @Index)
return @szName
end
GO
/****** Object: StoredProcedure [dbo].[PROC_JOB_SKILL] Script Date: 11/22/2013 14:36:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROC [dbo].[PROC_JOB_SKILL]
@m_aJobSkill CHAR(8000) -- 스킬 잡 리스트
AS
/*
사용자 스킬을 보여준다.
*/
SET NOCOUNT ON
-- 임시 테이블 생성
SELECT -1 m_exp, -1 m_level, -1 number, -1 alive
INTO #TMP
DECLARE @sql VARCHAR(8000)
DECLARE @pos INT,
@old_pos INT,
@len INT
SELECT @len = LEN(@m_aJobSkill) -- 입력 문자열 길이
SELECT @pos = 1 -- 현재 위치 값
SELECT @old_pos = 0 -- 전 위치 값
WHILE ( @pos <> 0 )
BEGIN
SELECT @pos = CHARINDEX('/', @m_aJobSkill, @pos + 1)
IF ( @len > @old_pos )
BEGIN
SET @sql = ' INSERT INTO #TMP VALUES ( ' + SUBSTRING(@m_aJobSkill, @old_pos, @pos - @old_pos) + ')'
EXEC (@sql)
END
SET @old_pos = @pos + 1
END
SELECT B.szName, A.m_level, A.m_exp,
CASE A.alive
WHEN 0 THEN '비활성화'
WHEN 1 THEN '활성화'
END,
C.szJobName
FROM #TMP A, ITEM_DBF.dbo.SKILL_TBL B, ITEM_DBF.dbo.JOB_TBL C
WHERE A.number = B.[Index] AND B.job = C.[Index]
ORDER BY A.number
SET NOCOUNT OFF
GO
/****** Object: StoredProcedure [dbo].[ITEM_STR] Script Date: 11/22/2013 14:36:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[ITEM_STR]
@iGu CHAR(2) = 'S1',
@iIndex INT = 0,
@iszName NVARCHAR(255) = '',
@iszNameEn NVARCHAR(255) = '',
@idwNum INT = 0,
@idwPackMax INT = 0,
@idwItemKind1 INT = 0,
@idwItemKind2 INT = 0,
@idwItemKind3 INT = 0,
@idwItemJob INT = 0,
@ibPermanence INT = 0,
@idwUseable INT = 0,
@idwItemSex INT = 0,
@idwWeight INT = 0,
@idwCost INT = 0,
@idwCash INT = 0,
@idwEndurance INT = 0,
@ibRepairUnable INT = 0,
@ibJammed INT = 0,
@inAbrasion INT = 0,
@inHardness INT = 0,
@idwParts INT = 0,
@idwItemLV INT = 0,
@idwAddLV INT = 0,
@idwItemRare INT = 0,
@ibLog INT = 0,
@idwSpeedPenalty INT = 0,
@idwLinkItem INT = 0,
@idwAbilityMin INT = 0,
@idwAbilityMax INT = 0,
@idwAddSkillMin INT = 0,
@idwAddSkillMax INT = 0,
@idwWeaponType INT = 0,
@ibContinuousPain INT = 0,
@idwShellQuantity INT = 0,
@idwRecoil INT = 0,
@idwCaliber INT = 0,
@idwBarrageRate INT = 0,
@idwLoadingTime INT = 0,
@inAdjHitRate INT = 0,
@inAdjSpellRate INT = 0,
@idwAttackSpeed INT = 0,
@idwDmgShift INT = 0,
@idwAttackRange INT = 0,
@idwConnaturalSkill INT = 0,
@idwAdjRoll INT = 0,
@idwDestParam1 INT = 0,
@idwDestParam2 INT = 0,
@inAdjParamVal1 INT = 0,
@inAdjParamVal2 INT = 0,
@idwChgParamVal1 INT = 0,
@idwChgParamVal2 INT = 0,
@idwReqJob INT = 0,
@idwReqStr INT = 0,
@idwReqSta INT = 0,
@idwReqDex INT = 0,
@idwReqInt INT = 0,
@idwReqMp INT = 0,
@idwRepFp INT = 0,
@idwReqJobLV INT = 0,
@idwReqDisLV INT = 0,
@idwSkillReadyType INT = 0,
@idwSkillReady INT = 0,
@idwSkillRange INT = 0,
@idwCircleTime INT = 0,
@idwSkillTime INT = 0,
@idwExeChance INT = 0,
@idwExeTarget INT = 0,
@idwUseChance INT = 0,
@idwSpellRegion INT = 0,
@idwSpellType INT = 0,
@idwSkillType INT = 0,
@idwItemResistMagic INT = 0,
@idwItemResistElecricity INT = 0,
@idwItemResistDark INT = 0,
@idwItemResistFire INT = 0,
@idwItemResistWind INT = 0,
@idwItemResistWater INT = 0,
@idwItemResistEarthINT INT = 0,
@ibAmplification INT = 0,
@ibFusion INT = 0,
@inEvildoing INT = 0,
@ibGrow INT = 0,
@ibCraft INT = 0,
@idwExpertLV INT = 0,
@iExpertMax INT = 0,
@idwSubDefine INT = 0,
@idwExp INT = 0,
@iLVRatio INT = 0,
@idwCardType INT = 0,
@ifFlightSpeed FLOAT = 0,
@idwFlightLimit INT = 0,
@idwLimitJob1 INT = 0,
@idwLimitLevel1 INT = 0,
@idwLimitJob2 INT = 0,
@idwLimitLevel2 INT = 0,
@idwReflect INT = 0,
@iszComment NVARCHAR(255) = ''
AS
set nocount on
IF @iGu = 'D1' -- 데이터 삭제
BEGIN
TRUNCATE TABLE ITEM_TBL
RETURN
END
ELSE
IF @iGu = 'I1' -- 데이터 Insert
BEGIN
INSERT ITEM_TBL
(
[Index],
[szName],
[szNameEn],
[dwNum],
[dwPackMax],
[dwItemKind1],
[dwItemKind2],
[dwItemKind3],
[dwItemJob],
[bPermanence],
[dwUseable],
[dwItemSex],
[dwWeight],
[dwCost],
[dwCash],
[dwEndurance],
[bRepairUnable],
[bJammed],
[nAbrasion],
[nHardness],
[dwParts],
[dwItemLV],
[dwAddLV],
[dwItemRare],
[bLog],
[dwSpeedPenalty],
[dwLinkItem],
[dwAbilityMin],
[dwAbilityMax],
[dwAddSkillMin],
[dwAddSkillMax],
[dwWeaponType],
[bContinuousPain],
[dwShellQuantity],
[dwRecoil],
[dwCaliber],
[dwBarrageRate],
[dwLoadingTime],
[nAdjHitRate],
[nAdjSpellRate],
[dwAttackSpeed],
[dwDmgShift],
[dwAttackRange],
[dwConnaturalSkill],
[dwAdjRoll],
[dwDestParam1],
[dwDestParam2],
[nAdjParamVal1],
[nAdjParamVal2],
[dwChgParamVal1],
[dwChgParamVal2],
[dwReqJob],
[dwReqStr],
[dwReqSta],
[dwReqDex],
[dwReqInt],
[dwReqMp],
[dwRepFp],
[dwReqJobLV],
[dwReqDisLV],
[dwSkillReadyType],
[dwSkillReady],
[dwSkillRange],
[dwCircleTime],
[dwSkillTime],
[dwExeChance],
[dwExeTarget],
[dwUseChance],
[dwSpellRegion],
[dwSpellType],
[dwSkillType],
[dwItemResistMagic],
[dwItemResistElecricity],
[dwItemResistDark],
[dwItemResistFire],
[dwItemResistWind],
[dwItemResistWater],
[dwItemResistEarth],
[bAmplification],
[bFusion],
[nEvildoing],
[bGrow],
[bCraft],
[dwExpertLV],
[ExpertMax],
[dwSubDefine],
[dwExp],
[LVRatio],
[dwCardType],
[fFlightSpeed],
[dwFlightLimit],
[dwLimitJob1],
[dwLimitLevel1],
[dwLimitJob2],
[dwLimitLevel2],
[dwReflect],
[szComment]
)
VALUES
(
@iIndex,
@iszName,
@iszNameEn,
@idwNum,
@idwPackMax,
@idwItemKind1,
@idwItemKind2,
@idwItemKind3,
@idwItemJob,
@ibPermanence,
@idwUseable,
@idwItemSex,
@idwWeight,
@idwCost,
@idwCash,
@idwEndurance,
@ibRepairUnable,
@ibJammed,
@inAbrasion,
@inHardness,
@idwParts,
@idwItemLV,
@idwAddLV,
@idwItemRare,
@ibLog,
@idwSpeedPenalty,
@idwLinkItem,
@idwAbilityMin,
@idwAbilityMax,
@idwAddSkillMin,
@idwAddSkillMax,
@idwWeaponType,
@ibContinuousPain,
@idwShellQuantity,
@idwRecoil,
@idwCaliber,
@idwBarrageRate,
@idwLoadingTime,
@inAdjHitRate,
@inAdjSpellRate,
@idwAttackSpeed,
@idwDmgShift,
@idwAttackRange,
@idwConnaturalSkill,
@idwAdjRoll,
@idwDestParam1,
@idwDestParam2,
@inAdjParamVal1,
@inAdjParamVal2,
@idwChgParamVal1,
@idwChgParamVal2,
@idwReqJob,
@idwReqStr,
@idwReqSta,
@idwReqDex,
@idwReqInt,
@idwReqMp,
@idwRepFp,
@idwReqJobLV,
@idwReqDisLV,
@idwSkillReadyType,
@idwSkillReady,
@idwSkillRange,
@idwCircleTime,
@idwSkillTime,
@idwExeChance,
@idwExeTarget,
@idwUseChance,
@idwSpellRegion,
@idwSpellType,
@idwSkillType,
@idwItemResistMagic,
@idwItemResistElecricity,
@idwItemResistDark,
@idwItemResistFire,
@idwItemResistWind,
@idwItemResistWater,
@idwItemResistEarthINT,
@ibAmplification,
@ibFusion,
@inEvildoing,
@ibGrow,
@ibCraft,
@idwExpertLV,
@iExpertMax,
@idwSubDefine,
@idwExp,
@iLVRatio,
@idwCardType,
@ifFlightSpeed,
@idwFlightLimit,
@idwLimitJob1,
@idwLimitLevel1,
@idwLimitJob2,
@idwLimitLevel2,
@idwReflect,
@iszComment
)
RETURN
END
ELSE
IF @iGu = 'D2' -- SKILL_TBL Data 모두 지우기
BEGIN
TRUNCATE TABLE SKILL_TBL
RETURN
END
ELSE
IF @iGu = 'I2' -- SKILL_TBL Data Insert
BEGIN
INSERT SKILL_TBL
(
[Index],
[szName],
[job]
)
VALUES
(
@iIndex,
@iszName,
@idwNum
)
RETURN
END
ELSE
IF @iGu = 'D3' -- MONSTER_TBL Data 모두 지우기
BEGIN
TRUNCATE TABLE MONSTER_TBL
RETURN
END
ELSE
IF @iGu = 'I3' -- MONSTER_TBL Data Insert
BEGIN
INSERT MONSTER_TBL
(
[Index],
[szName]
)
VALUES
(
@iIndex,
@iszName
)
RETURN
END
ELSE
IF @iGu = 'D4' -- QUEST_TBL Data 모두 지우기
BEGIN
TRUNCATE TABLE QUEST_TBL
RETURN
END
ELSE
IF @iGu = 'I4' -- QUEST_TBL Data Insert
BEGIN
INSERT QUEST_TBL
(
[Index],
[szName]
)
VALUES
(
@iIndex,
@iszName
)
RETURN
END
set nocount off
GO
|