USE [master]
GO


CREATE DATABASE box
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'box_mdf', FILENAME = N'D:\SQLSERVER\MSSQL\DATA\filename.mdf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'box_ldf', FILENAME = N'D:\SQLSERVER\MSSQL\DATA\filename.ldf' , SIZE = 1024KB , MAXSIZE = 52428800KB , FILEGROWTH = 10%)
GO

USE [box]
GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC box.[dbo].[sp_fulltext_database] @action = 'enable'
end
GO

ALTER DATABASE box SET ANSI_NULL_DEFAULT OFF 
GO

ALTER DATABASE box SET ANSI_NULLS OFF 
GO

ALTER DATABASE box SET ANSI_PADDING OFF 
GO

ALTER DATABASE box SET ANSI_WARNINGS OFF 
GO

ALTER DATABASE box SET ARITHABORT OFF 
GO

ALTER DATABASE box SET AUTO_CLOSE OFF 
GO

ALTER DATABASE box SET AUTO_SHRINK OFF 
GO

ALTER DATABASE box SET AUTO_UPDATE_STATISTICS ON 
GO

ALTER DATABASE box SET CURSOR_CLOSE_ON_COMMIT OFF 
GO

ALTER DATABASE box SET CURSOR_DEFAULT  GLOBAL 
GO

ALTER DATABASE box SET CONCAT_NULL_YIELDS_NULL OFF 
GO

ALTER DATABASE box SET NUMERIC_ROUNDABORT OFF 
GO

ALTER DATABASE box SET QUOTED_IDENTIFIER OFF 
GO

ALTER DATABASE box SET RECURSIVE_TRIGGERS OFF 
GO

ALTER DATABASE box SET  DISABLE_BROKER 
GO

ALTER DATABASE box SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO

ALTER DATABASE box SET DATE_CORRELATION_OPTIMIZATION OFF 
GO

ALTER DATABASE box SET TRUSTWORTHY OFF 
GO

ALTER DATABASE box SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO

ALTER DATABASE box SET PARAMETERIZATION SIMPLE 
GO

ALTER DATABASE box SET READ_COMMITTED_SNAPSHOT OFF 
GO

ALTER DATABASE box SET HONOR_BROKER_PRIORITY OFF 
GO

ALTER DATABASE box SET RECOVERY FULL 
GO

ALTER DATABASE box SET  MULTI_USER 
GO

ALTER DATABASE box SET PAGE_VERIFY CHECKSUM  
GO

ALTER DATABASE box SET DB_CHAINING OFF 
GO

ALTER DATABASE box SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO

ALTER DATABASE box SET TARGET_RECOVERY_TIME = 0 SECONDS 
GO

ALTER DATABASE box SET  READ_WRITE 
GO
/****** Object:  Table [dbo].[Game_Config]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Game_Config](
	[open_time] [varchar](50) NULL,
	[merge_time] [varchar](50) NULL,
	[merge_num] [int] NULL,
	[kuafu_ip] [varchar](50) NULL,
	[kuafu_port] [int] NULL,
	[kuafu_state] [int] NULL,
	[cs3v3_ip] [varchar](50) NULL,
	[cs3v3_port2] [int] NULL,
	[kuafu_date] [varchar](50) NULL,
	[cs3v3_port] [int] NULL,
	[createchr_day] [int] NULL,
	[hefu_flag] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[diypay]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[diypay](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[PayId] [varchar](128) NOT NULL,
	[sGameOrder] [varchar](128) NOT NULL,
	[sRoleId] [varchar](128) NOT NULL,
	[ExtData] [varchar](512) NULL,
	[Account] [varchar](128) NOT NULL,
	[SdkId] [varchar](50) NOT NULL,
	[SecSdkId] [varchar](50) NULL,
	[ServerId] [varchar](50) NOT NULL,
	[ProductId] [varchar](50) NOT NULL,
	[Gold] [money] NOT NULL,
	[DrawOut] [int] NULL,
	[DrawLevel] [int] NULL,
	[DrawTime] [datetime] NULL,
	[sChrName] [varchar](50) NULL,
	[CreateTime] [datetime] NULL,
	[nExtid] [int] NULL,
	[nExt1] [int] NULL,
 CONSTRAINT [PK__diypay__3214EC07A0A8F97B] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[TLOG_BOX_SELL]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[TLOG_BOX_SELL](
	[FLD_ID] [int] IDENTITY(1,1) NOT NULL,
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_BUYUSERID] [varchar](50) NOT NULL,
	[FLD_MONEYID] [smallint] NULL,
	[FLD_MONEY] [int] NULL,
	[FLD_ORDER] [varchar](50) NULL,
	[FLD_CREATEDATE] [datetime] NULL,
	[FLD_UPDATEEDATE] [datetime] NULL,
	[FLD_STATE] [smallint] NULL,
	[FLD_DECSTATE] [smallint] NULL,
	[FLD_GETSTATE] [smallint] NULL,
	[FLD_PAYORDER] [varchar](128) NOT NULL,
	[FLD_STATUS] [tinyint] NOT NULL,
 CONSTRAINT [PK__TLOG_BOX_SELL] PRIMARY KEY CLUSTERED 
(
	[FLD_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [FLD_ID_IDX] ON [dbo].[TLOG_BOX_SELL] 
(
	[FLD_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_VAR]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_VAR](
	[uGuid] [uniqueidentifier] NOT NULL,
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_VAR_NAME] [varchar](50) NOT NULL,
	[FLD_VAR_VALUE] [varchar](max) NULL,
	[FLD_TYPE] [smallint] NOT NULL,
	[FLD_TIMESTAMP] [timestamp] NOT NULL,
	[tUpdateTime] [datetime] NULL,
	[FLD_JOINTYPE] smallint DEFAULT ((0)) NULL,
PRIMARY KEY CLUSTERED 
(
	[uGuid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [TBL_VAR_FLD_USERID] ON [dbo].[TBL_VAR] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [TBL_VAR_FLD_VAR_NAME] ON [dbo].[TBL_VAR] 
(
	[FLD_VAR_NAME] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_MAIL]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_MAIL](
	[ID] [int] PRIMARY KEY IDENTITY(1,1) NOT NULL,
	[UserID] [varchar](50) NOT NULL,
	[SendName] [varchar](128) NULL,
	[Type] [smallint] NULL,
	[Lable] [varchar](50) NULL,
	[Memo] [varchar](1024) NULL,
	[Item] [varchar](1024) NULL,
	[dCreateTime] [datetime] NULL,
	[dRecvTime] [datetime] NULL,
	[ReadFlag] [smallint] NULL,
	[RecvFlag] [smallint] NULL,
	[Deleted] [smallint] NULL,
	[dDeleteTime] [datetime] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_MAIL_dCreateTime] ON [dbo].[TBL_MAIL] 
(
	[dCreateTime] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_MAIL_UserID] ON [dbo].[TBL_MAIL] 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_MAGIC]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_MAGIC](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAGICID] [int] NOT NULL,
	[FLD_LEVEL] [tinyint] NULL,
	[FLD_KEY] [tinyint] NULL,
	[FLD_CURTRAIN] [int] NULL,
	[FLD_LEVEL_UP] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_MAGIC_FLD_USERID] ON [dbo].[TBL_MAGIC] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_LINE]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_LINE](
	[nId] [int] IDENTITY(1,1) NOT NULL,
	[Time] [int] NULL,
	[Num] [int] NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_STORAGE]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_ITEM_STORAGE](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [int] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_BTVALUE] [binary](200) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_AddVale] [binary](80) NULL,
	[FLD_EXTEND] [varchar](500) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_STORAGE_FLD_MAKEINDEX] ON [dbo].[TBL_ITEM_STORAGE] 
(
	[FLD_MAKEINDEX] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_STORAGE_FLD_USERID] ON [dbo].[TBL_ITEM_STORAGE] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_PAIMAI]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_ITEM_PAIMAI](
	[FLD_MAKEINDEX] [int] NOT NULL,
	[FLD_INDEX] [int] NOT NULL,
	[FLD_DURA] [int] NOT NULL,
	[FLD_DURAMAX] [int] NOT NULL,
	[FLD_BTVALUE] [binary](200) NULL
) ON [PRIMARY]
SET ANSI_PADDING OFF
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_ADDVALUE] [binary](80) NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_WHERE] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_OVERLAP] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_USERID] [varchar](50) NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_TYPE] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_PRICE] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_ADDTIME] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_USERLIST] [varchar](3000) NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_JOINUSERLIST] [varchar](1500) NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_LASTPRICE] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_CURRUSERID] [varchar](50) NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_PAGE] [smallint] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_LASTTIME] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_FLAG] [smallint] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_ID] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_GUILDID] [varchar](50) NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_MEGUILDRATE] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_STDMODE] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_QUALITY] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_JOB] [smallint] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_LEVEL] [int] NOT NULL
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD [FLD_EXTENDINFO] [varchar](500) NULL
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_PAIMAI_MAKEINDEX] ON [dbo].[TBL_ITEM_PAIMAI]
(
	[FLD_MAKEINDEX] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_LEVELVALUE]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[TBL_ITEM_LEVELVALUE](
	[nIdx] [int] NULL,
	[ItemValue] [smallint] NOT NULL,
	[MakeDate] [datetime] NOT NULL,
	[wIndex] [int] NOT NULL,
	[sChrName] [varchar](50) NOT NULL,
	[sMap] [varchar](16) NOT NULL,
	[sMonName] [varchar](50) NOT NULL,
	[sUserID] [varchar](30) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[TBL_ITEM_JISHOU]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_ITEM_JISHOU](
	[FLD_MAKEINDEX] [int] NOT NULL,
	[FLD_INDEX] [int] NOT NULL,
	[FLD_DURA] [int] NOT NULL,
	[FLD_DURAMAX] [int] NOT NULL,
	[FLD_BTVALUE] [binary](200) NULL,
	[FLD_WHERE] [int] NOT NULL,
	[FLD_OVERLAP] [int] NOT NULL,
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_TYPE] [int] NOT NULL,
	[FLD_PRICE] [int] NOT NULL,
	[FLD_ADDTIME] [int] NOT NULL,
	[FLD_AddVale] [binary](80) NULL,
	[FLD_EXTEND] [varchar](500) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_JISHOU_FLD_MAKEINDEX] ON [dbo].[TBL_ITEM_JISHOU] 
(
	[FLD_MAKEINDEX] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_GUILD_STORAGE]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_ITEM_GUILD_STORAGE](
	[FLD_MAKEINDEX] [int] NOT NULL,
	[FLD_INDEX] [int] NOT NULL,
	[FLD_DURA] [int] NOT NULL,
	[FLD_DURAMAX] [int] NOT NULL,
	[FLD_BTVALUE] [binary](200) NULL,
	[FLD_WHERE] [int] NOT NULL,
	[FLD_OVERLAP] [int] NOT NULL,
	[FLD_GUILDID] [varchar](50) NOT NULL,
	[FLD_AddVale] [binary](80) NULL,
	[FLD_EXTEND] [varchar](500) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_GUILD_STORAGE_FLD_MAKEINDEX] ON [dbo].[TBL_ITEM_GUILD_STORAGE] 
(
	[FLD_MAKEINDEX] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_EX_ABIL]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_ITEM_EX_ABIL](
	[FLD_MAKEINDEX] [int] NOT NULL,
	[FLD_EX_ABIL] [varchar](8000) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_EX_ABIL_FLD_MAKEINDEX] ON [dbo].[TBL_ITEM_EX_ABIL] 
(
	[FLD_MAKEINDEX] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_BODY]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_ITEM_BODY](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [int] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_BTVALUE] [binary](200) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_AddVale] [binary](80) NULL,
	[FLD_EXTEND] [varchar](500) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_BODY_FLD_MAKEINDEX] ON [dbo].[TBL_ITEM_BODY] 
(
	[FLD_MAKEINDEX] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_BODY_FLD_USERID] ON [dbo].[TBL_ITEM_BODY] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_BAG]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_ITEM_BAG](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [int] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_BTVALUE] [binary](200) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_AddVale] [binary](80) NULL,
	[FLD_EXTEND] [varchar](500) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_BAG_FLD_MAKEINDEX] ON [dbo].[TBL_ITEM_BAG] 
(
	[FLD_MAKEINDEX] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_BAG_FLD_USERID] ON [dbo].[TBL_ITEM_BAG] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_HERO_MAGIC]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[TBL_HERO_MAGIC](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAGICID] [int] NOT NULL,
	[FLD_LEVEL] [tinyint] NULL,
	[FLD_KEY] [tinyint] NULL,
	[FLD_CURTRAIN] [int] NULL,
	[FLD_LEVEL_UP] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_MAGIC_FLD_USERID] ON [dbo].[TBL_HERO_MAGIC] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_HERO_BODY]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[TBL_HERO_BODY](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [int] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_BTVALUE] [binary](200) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_AddVale] [binary](80) NULL,
	[FLD_EXTEND] [varchar](500) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_BODY_FLD_MAKEINDEX] ON [dbo].[TBL_HERO_BODY] 
(
	[FLD_MAKEINDEX] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_BODY_FLD_USERID] ON [dbo].[TBL_HERO_BODY] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_HERO_BAG]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[TBL_HERO_BAG](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [int] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_BTVALUE] [binary](200) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_AddVale] [binary](80) NULL,
	[FLD_EXTEND] [varchar](500) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_BAG_FLD_MAKEINDEX] ON [dbo].[TBL_HERO_BAG] 
(
	[FLD_MAKEINDEX] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_BAG_FLD_USERID] ON [dbo].[TBL_HERO_BAG] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_HERO]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[TBL_HERO](
	[FLD_ID] [int] IDENTITY(1,1) NOT NULL,
	[FLD_HEROMASTERUSERID] [varchar](128) NULL,
	[FLD_CHARACTER] [varchar](50) NULL,
	[FLD_USERID] [varchar](50) NULL,
	[FLD_DELETED] [tinyint] NOT NULL,
	[FLD_UPDATEDATETIME] [datetime] NULL,
	[FLD_MAPNAME] [varchar](50) NULL,
	[FLD_CX] [smallint] NOT NULL,
	[FLD_CY] [smallint] NOT NULL,
	[FLD_DIR] [tinyint] NOT NULL,
	[FLD_HAIR] [tinyint] NOT NULL,
	[FLD_SEX] [tinyint] NOT NULL,
	[FLD_JOB] [tinyint] NOT NULL,
	[FLD_LEVEL] [int] NOT NULL,
	[FLD_HP] [BIGINT] NOT NULL,
	[FLD_MP] [BIGINT] NOT NULL,
	[FLD_EXP] [bigint] NOT NULL,
	[FLD_PKPOINT] [int] NOT NULL,
	[FLD_BODYLUCK] [float] NOT NULL,
	[FLD_INCHEALTH] [int] NOT NULL,
	[FLD_INCSPELL] [int] NOT NULL,
	[FLD_INCHEALING] [int] NOT NULL,
	[FLD_BONUSPOINT] [int] NOT NULL,
	[FLD_HUNGRYSTATE] [tinyint] NOT NULL,
	[FLD_MAKEDATE] [datetime] NULL,
	[FLD_StatusTimeArr] [binary](24) NOT NULL,
	[FLD_RELEVEL] [tinyint] NOT NULL,
	[FLD_MASTERNAME] [varchar](50) NULL,
	[FLD_QUESTUNITOPEN] [binary](128) NOT NULL,
	[FLD_QUESTUNIT] [binary](128) NOT NULL,
	[FLD_QUESTFLAG] [binary](128) NOT NULL,
	[FLD_BONUS_DC] [int] NOT NULL,
	[FLD_BONUS_MC] [int] NOT NULL,
	[FLD_BONUS_SC] [int] NOT NULL,
	[FLD_BONUS_AC] [int] NOT NULL,
	[FLD_BONUS_MAC] [int] NOT NULL,
	[FLD_BONUS_HP] [int] NOT NULL,
	[FLD_BONUS_MP] [int] NOT NULL,
	[FLD_BONUS_HIT] [int] NOT NULL,
	[FLD_BONUS_SPEED] [int] NOT NULL,
	[FLD_BONUS_X2] [int] NOT NULL,
	[FLD_SELECTID] [tinyint] NOT NULL,
	[FLD_BTF9] [int] NOT NULL,
	[FLD_SYSVAR] [binary](400) NOT NULL,
	[FLD_EE] [tinyint] NOT NULL,
	[FLD_UVAR] [binary](1020) NOT NULL,
	[FLD_FEATURE] [varchar](200) NULL,
	[FLD_SUCKDAMAGECOUNT] [int] NOT NULL,
	[FLD_SUCKDAMAGERATE] [tinyint] NOT NULL,
	[FLD_SUCKDAMAGEBILI] [int] NOT NULL,
	[FLD_SNDAITEMBOXOPENED] [tinyint] NOT NULL,
	[FLD_SDKID] [varchar](50) NULL,
	[FLD_SERVERID] [int] NOT NULL,
	[FLD_DC] [BIGINT] NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_FLD_CHARACTER] ON [dbo].[TBL_HERO] 
(
	[FLD_CHARACTER] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_FLD_UPDATEDATETIME] ON [dbo].[TBL_HERO] 
(
	[FLD_UPDATEDATETIME] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_FLD_USERID] ON [dbo].[TBL_HERO] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_GUILD_MEMBER]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_GUILD_MEMBER](
	[sGuildID] [varchar](50) NULL,
	[sGuildName] [varchar](50) NULL,
	[sUserID] [varchar](50) NULL,
	[btRank] [smallint] NULL,
	[btJob] [smallint] NULL,
	[btJoin] [smallint] NULL,
	[nLevel] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[TBL_GUILD_INFO]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_GUILD_INFO](
	[sGuildID] [varchar](50) NULL,
	[sGuildName] [varchar](128) NULL,
	[sNotice] [varchar](256) NULL,
	[Level] [smallint] NULL,
	[nGold] [int] NULL,
	[nExp] [int] NULL,
	[btAutoJoin] [smallint] NULL,
	[dCreateTime] [datetime] NULL,
	[btDeleted] [smallint] NULL,
	[nJoinLevel] [int] NULL,
	[btContriLvl] [smallint] NULL,
	[nMemberCount] [int] NULL,
	[nBuildPoint] [int] NULL,
	[nAurae] [int] NULL,
	[nStability] [int] NULL,
	[nFlourishing] [int] NULL,
	[sRank1] [varchar](50) NULL,
	[sRank2] [varchar](50) NULL,
	[sRank3] [varchar](50) NULL,
	[sRank4] [varchar](50) NULL,
	[sRank5] [varchar](50) NULL,
	[FLD_SERVERID] [int] NULL,
	[sGuildName_old] [varchar](128) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[TBL_FRIEND]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_FRIEND](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_FUSERID] [varchar](50) NULL,
	[FLD_JOB] [varchar](10) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[TBL_CONFIG]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_CONFIG](
	[StartTime] [datetime] NULL,
	[recharge_config] [varchar](8000) NULL,
	[Regis] [int] NOT NULL,
	[iRegCount] [int] NULL,
	[sRegionServerName] [varchar](50) NULL,
	[HfCount] [int] NULL,
	[HfTime] [datetime] NULL,
	[TongServerIP] [varchar](30) NULL,
	[TongServerPort] [int] NULL,
	[kuafuip] [varchar](50),
	[kuafuport] [INT],
	[kuafustate] [INT],
	[kuafuinfo] [varchar](200),
	[sshowtime] [datetime] NULL,
	[FLD_JYHCannelID] [varchar](8000) NULL,
	[FLD_TTSQCannelID] [varchar](8000) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[TBL_CHARACTER]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_CHARACTER](
	[FLD_ID] [int] IDENTITY(1,1) NOT NULL,
	[FLD_ACCOUNT] [varchar](128) NULL,
	[FLD_CHARACTER] [varchar](50) NULL,
	[FLD_USERID] [varchar](50) NULL,
	[FLD_DELETED] [tinyint] NULL,
	[FLD_UPDATEDATETIME] [datetime] NULL,
	[FLD_DBVERSION] [tinyint] NULL,
	[FLD_MAPNAME] [varchar](20) NULL,
	[FLD_CX] [smallint] NULL,
	[FLD_CY] [smallint] NULL,
	[FLD_DIR] [tinyint] NULL,
	[FLD_HAIR] [tinyint] NULL,
	[FLD_SEX] [tinyint] NULL,
	[FLD_JOB] [tinyint] NULL,
	[FLD_LEVEL] [int] NULL,
	[FLD_HP] [BIGINT] NULL,
	[FLD_MP] [BIGINT] NULL,
	[FLD_EXP] [bigint] NULL,
	[FLD_GOLD] [int] NULL,
	[FLD_HOMEMAP] [varchar](20) NULL,
	[FLD_HOMEX] [smallint] NULL,
	[FLD_HOMEY] [smallint] NULL,
	[FLD_PKPOINT] [int] NULL,
	[FLD_ALLOWGROUP] [tinyint] NULL,
	[FLD_ATTACKMODE] [tinyint] NULL,
	[FLD_FIGHTZONEDIE] [tinyint] NULL,
	[FLD_BODYLUCK] [float] NULL,
	[FLD_INCHEALTH] [int] NULL,
	[FLD_INCSPELL] [int] NULL,
	[FLD_INCHEALING] [int] NULL,
	[FLD_BONUSPOINT] [int] NULL,
	[FLD_HUNGRYSTATE] [tinyint] NULL,
	[FLD_MAKEDATE] [datetime] NULL,
	[FLD_ISFIRSTCHAR] [tinyint] NULL,
	[FLD_StatusTimeArr] [binary](24) NULL,
	[FLD_RELEVEL] [tinyint] NULL,
	[FLD_GAMEGOLD] [int] NULL,
	[FLD_CREDITPOINT] [int] NULL,
	[FLD_MASTERNAME] [varchar](50) NULL,
	[FLD_MASTER] [tinyint] NULL,
	[FLD_DEARNAME] [varchar](50) NULL,
	[FLD_STORAGEPWD] [varchar](10) NULL,
	[FLD_GAMEPOINT] [int] NULL,
	[FLD_PAYMENTPOINT] [int] NULL,
	[FLD_LOCKLOGON] [tinyint] NULL,
	[FLD_CONTRIBUTION] [int] NULL,
	[FLD_ALLOWGUILDRECALL] [tinyint] NULL,
	[FLD_GROUPRECALLTIME] [int] NULL,
	[FLD_ALLOWGROUPRECALL] [tinyint] NULL,
	[FLD_QUESTUNITOPEN] [binary](128) NULL,
	[FLD_QUESTUNIT] [binary](128) NULL,
	[FLD_QUESTFLAG] [binary](128) NULL,
	[FLD_MARRYCOUNT] [int] NULL,
	[FLD_BONUS_DC] [int] NULL,
	[FLD_BONUS_MC] [int] NULL,
	[FLD_BONUS_SC] [int] NULL,
	[FLD_BONUS_AC] [int] NULL,
	[FLD_BONUS_MAC] [int] NULL,
	[FLD_BONUS_HP] [int] NULL,
	[FLD_BONUS_MP] [int] NULL,
	[FLD_BONUS_HIT] [int] NULL,
	[FLD_BONUS_SPEED] [int] NULL,
	[FLD_BONUS_X2] [int] NULL,
	[FLD_SELECTID] [tinyint] NULL,
	[FLD_MONEY] [binary](400) NULL,
	[FLD_BTF9] [int] NULL,
	[FLD_SYSVAR] [binary](400) NULL,
	[FLD_EE] [tinyint] NULL,
	[FLD_UVAR] [binary](1020) NULL,
	[FLD_FEATURE] [varchar](200) NULL,
	[FLD_OFFLINE_TIME] [datetime] NULL,
	[FLD_SUCKDAMAGECOUNT] [int] NULL,
	[FLD_SUCKDAMAGERATE] [tinyint] NULL,
	[FLD_SUCKDAMAGEBILI] [int] NULL,
	[FLD_SNDAITEMBOXOPENED] [tinyint] NULL,
	[FLD_SDKID] [varchar](50) NULL,
	[FLD_SERVERID] [int] NULL,
	[FLD_DC] [BIGINT] NULL,
	[FLD_TOTAL_RECHARGE] [int] NULL,
	[FLD_CHARACTER_OLD] [varchar](100) NULL,
	[FLD_LOCKHUM] [tinyint] NOT NULL,
	[FLD_ISBUYCHAR] [tinyint] NOT NULL,
	[FLD_JVAR] [BINARY](2000),
	[FLD_BVAR] [BINARY](800),
	[FLD_VARCLEARTIME] [DATETIME]
) ON [PRIMARY]
SET ANSI_PADDING OFF
ALTER TABLE [dbo].[TBL_CHARACTER] ADD [FLD_REALACCOUNT] [varchar](128) NOT NULL
ALTER TABLE [dbo].[TBL_CHARACTER] ADD [FLD_LOCKDATE] [datetime] NULL
ALTER TABLE [dbo].[TBL_CHARACTER] ADD [FLD_PAYORDER] [varchar](128) NOT NULL
ALTER TABLE [dbo].[TBL_CHARACTER] ADD [FLD_STATUS] [tinyint] NOT NULL
SET ANSI_PADDING ON
ALTER TABLE [dbo].[TBL_CHARACTER] ADD [FLD_HEROUSERID] [varchar](50) NOT NULL
ALTER TABLE [dbo].[TBL_CHARACTER] ADD [FLD_HERONAME] [varchar](50) NOT NULL
ALTER TABLE [dbo].[TBL_CHARACTER] ADD PRIMARY KEY CLUSTERED 
(
	[FLD_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_ACCOUNT] ON [dbo].[TBL_CHARACTER] 
(
	[FLD_ACCOUNT] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_CHARACTER] ON [dbo].[TBL_CHARACTER] 
(
	[FLD_CHARACTER] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_UPDATEDATETIME] ON [dbo].[TBL_CHARACTER] 
(
	[FLD_UPDATEDATETIME] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_USERID] ON [dbo].[TBL_CHARACTER] 
(
	[FLD_USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_REALACCOUNT] ON [dbo].[TBL_CHARACTER] 
(
	[FLD_REALACCOUNT] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[TBL_BOX_SELL]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[TBL_BOX_SELL](
	[FLD_ID] [int] IDENTITY(1,1) NOT NULL,
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_BUYUSERID] [varchar](50) NOT NULL,
	[FLD_MONEYID] [smallint] NULL,
	[FLD_MONEY] [int] NULL,
	[FLD_ORDER] [varchar](50) NULL,
	[FLD_CREATEDATE] [datetime] NULL,
	[FLD_UPDATEEDATE] [datetime] NULL,
	[FLD_STATE] [smallint] NULL,
	[FLD_DECSTATE] [smallint] NULL,
	[FLD_GETSTATE] [smallint] NULL,
	[FLD_PAYORDER] [varchar](128) NOT NULL,
	[FLD_STATUS] [tinyint] NOT NULL,
 CONSTRAINT [PK__TBL_BOX___84774207A5B56D0B] PRIMARY KEY CLUSTERED 
(
	[FLD_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [FLD_ID_IDX] ON [dbo].[TBL_BOX_SELL] 
(
	[FLD_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_BLACK]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_BLACK](
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_BUSERID] [varchar](50) NOT NULL,
	[FLD_JOB] [varchar](10) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[pay]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[pay](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[PayId] [varchar](128) NOT NULL,
	[sGameOrder] [varchar](128) NOT NULL,
	[sRoleId] [varchar](128) NOT NULL,
	[ExtData] [varchar](512) NULL,
	[Account] [varchar](128) NOT NULL,
	[SdkId] [varchar](50) NOT NULL,
	[SecSdkId] [varchar](50) NULL,
	[ServerId] [varchar](50) NOT NULL,
	[ProductId] [varchar](50) NOT NULL,
	[Gold] [money] NOT NULL,
	[nRealGold] [money] NULL,
	[DrawOut] [int] NULL,
	[DrawLevel] [int] NULL,
	[DrawTime] [datetime] NULL,
	[sChrName] [varchar](50) NULL,
	[CreateTime] [datetime] NULL,
	[nExtid] [int] NULL,
	[nExt1] [int] NULL,
	[OldGold] [money] NULL,
 CONSTRAINT [PK__pay__3214EC07A0A8F97B] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
 CONSTRAINT [PayGameOrder] UNIQUE NONCLUSTERED 
(
	[sGameOrder] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Mir_Disble_List]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[Mir_Disble_List](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[sAccount] [varchar](128) NULL,
	[sUserId] [varchar](50) NULL,
	[sIpAddr] [varchar](20) NULL,
	[nVerify] [int] NULL,
	[sTab] [varchar](100) NULL,
	[dCreateTime] [datetime] NULL,
PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Mir_Disble_Chat]    Script Date: 06/19/2021 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[Mir_Disble_Chat](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[sUserId] [varchar](50) NOT NULL,
	[nChannel] [int] NULL,
	[nTime] [int] NULL,
	[sTab] [varchar](100) NULL,
	[dCreateTime] [datetime] NULL,
PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  StoredProcedure [dbo].[LoadExAbil]    Script Date: 06/19/2021 18:12:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[LoadExAbil]
as 
BEGIN
SELECT * FROM TBL_ITEM_EX_ABIL A 
	WHERE EXISTS(SELECT TOP 1 1 FROM DBO.TBL_ITEM_BAG A1 WHERE A1.FLD_MAKEINDEX=A.FLD_MAKEINDEX)
	OR EXISTS(SELECT TOP 1 1 FROM DBO.TBL_ITEM_BODY A1 WHERE A1.FLD_MAKEINDEX=A.FLD_MAKEINDEX)
	OR EXISTS(SELECT TOP 1 1 FROM DBO.TBL_ITEM_GUILD_STORAGE A1 WHERE A1.FLD_MAKEINDEX=A.FLD_MAKEINDEX)
	OR EXISTS(SELECT TOP 1 1 FROM DBO.TBL_ITEM_JISHOU A1 WHERE A1.FLD_MAKEINDEX=A.FLD_MAKEINDEX)
	OR EXISTS(SELECT TOP 1 1 FROM DBO.TBL_ITEM_STORAGE A1 WHERE A1.FLD_MAKEINDEX=A.FLD_MAKEINDEX)
	OR EXISTS(SELECT TOP 1 1 FROM DBO.TBL_ITEM_PAIMAI A1 WHERE A1.FLD_MAKEINDEX=A.FLD_MAKEINDEX)	

	OR EXISTS(SELECT TOP 1 1 FROM DBO.TBL_HERO_BODY A1 WHERE A1.FLD_MAKEINDEX=A.FLD_MAKEINDEX)
	OR EXISTS(SELECT TOP 1 1 FROM DBO.TBL_HERO_BAG A1 WHERE A1.FLD_MAKEINDEX=A.FLD_MAKEINDEX)
end
GO
/****** Object:  StoredProcedure [dbo].[HUM_INFO_UPDATE]    Script Date: 06/19/2021 18:12:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[HUM_INFO_UPDATE]
@sUserID VARCHAR(50),
@sChrName VARCHAR(50),
@MapName VARCHAR(50),
@Cx SMALLINT,
@Cy SMALLINT,
@Dir SMALLINT,
@Hair SMALLINT,
@Sex SMALLINT,
@Job SMALLINT,
@nLevel INT,
@Hp BIGINT,
@Mp BIGINT,
@Exp BIGINT,
@Gold INT,
@sHomeMap VARCHAR(50),
@Hx SMALLINT,
@Hy SMALLINT,
@PkPoint INT,
@AllowGroup tinyint,
@btF9 INT,
@AttackMode tinyint,
@FightZoneDie tinyint,
@BodyLuck FLOAT,
@InChealth INT,
@IncSpell INT,
@IncHealing INT,
@BonusPoint INT,
@HungerStatus INT,
@StatusTimeAr binary(24),
@Relevel tinyint,
@GameGold INT,
@CreditPoint INT,
@MasterName VARCHAR(50),
@Master tinyint,
@DearName VARCHAR(50),
@StoragePwd VARCHAR(10),
@GamePoint INT,
@PayMentPoint INT,
@LockLogon tinyint,
@Contribution INT,
@AllowGuildRecall tinyint,
@GroupRecallTime INT,
@AllowGroupRecall tinyint,
@QuestUnitOpen binary(128),
@QuestUnit binary(128),
@QuestFlag binary(128),
@Money binary(400),
@MarryCount INT,
@Bonus_Dc INT,
@Bonus_Mc INT,
@Bonus_Sc INT,
@Bonus_Ac INT,
@Bonus_Mac INT,
@Bonus_Hp INT,
@Bonus_Mp INT,
@Bonus_Hit INT,
@Bonus_Speed INT,
@Bonus_X2 INT,
@Ee tinyint,
@Sysvar binary(400),
@uvar binary(1020),
@Feathure VARCHAR(200),
@SuckDamageCount INT,
@SuckDamageBiLi INT,
@SuckDamageRate tinyint,
@SndaItemBoxOpened TINYINT,
@Dc BIGINT,
@sHeroName VARCHAR(50),
@sHeroUid VARCHAR(50),
@tClearVarTime datetime,
@jVar binary(2000),
@bVar binary(800)
AS
IF EXISTS(SELECT FLD_ID FROM TBL_CHARACTER WHERE FLD_USERID=@sUserID)
BEGIN
  UPDATE TBL_CHARACTER SET
  FLD_UPDATEDATETIME = getdate(),
  FLD_CHARACTER = @sChrName,
  FLD_MAPNAME = @MapName,
  FLD_CX = @Cx,
  FLD_CY = @Cy,
	FLD_DIR = @Dir,
  FLD_HAIR = @Hair,
	FLD_SEX = @Sex,
  FLD_JOB = @Job,
  FLD_LEVEL = @nLevel,
	FLD_HP = @Hp,
	FLD_MP = @Mp,
	FLD_EXP = @Exp,
  FLD_GOLD = @Gold,
	FLD_HOMEMAP = @sHomeMap,
  FLD_HOMEX = @Hx,
	FLD_HOMEY	= @Hy,
  FLD_PKPOINT = @PkPoint,
	FLD_ALLOWGROUP = @AllowGroup,
  FLD_BTF9 = @btF9,
	FLD_ATTACKMODE = @AttackMode,
	FLD_FIGHTZONEDIE = @FightZoneDie,
	FLD_BODYLUCK = @BodyLuck,
	FLD_INCHEALTH = @InChealth,
	FLD_INCSPELL = @IncSpell,
	FLD_INCHEALING = @IncHealing,
	FLD_BONUSPOINT = @BonusPoint,
	FLD_HUNGRYSTATE	= @HungerStatus,
	FLD_StatusTimeArr = @StatusTimeAr,
	FLD_RELEVEL = @Relevel,
	FLD_GAMEGOLD = @GameGold,
	FLD_CREDITPOINT = @CreditPoint,
	FLD_MASTERNAME = @MasterName,
	FLD_MASTER = @Master,
	FLD_DEARNAME = @DearName,
	FLD_STORAGEPWD = @StoragePwd,
	FLD_GAMEPOINT	= @GamePoint,
	FLD_PAYMENTPOINT = @PayMentPoint,
	FLD_LOCKLOGON = @LockLogon,
	FLD_CONTRIBUTION = @Contribution,
	FLD_ALLOWGUILDRECALL = @AllowGroupRecall,
	FLD_GROUPRECALLTIME = @GroupRecallTime,
	FLD_ALLOWGROUPRECALL = @AllowGroupRecall,
	FLD_QUESTUNITOPEN = @QuestUnitOpen,
	FLD_QUESTUNIT = @QuestUnit,
	FLD_QUESTFLAG = @QuestFlag,
  FLD_MONEY = @Money,
	FLD_MARRYCOUNT = @MarryCount,
	FLD_BONUS_DC = @Bonus_Dc,
	FLD_BONUS_MC = @Bonus_Mc,
	FLD_BONUS_SC = @Bonus_Sc,
	FLD_BONUS_AC = @Bonus_Ac,
	FLD_BONUS_MAC = @Bonus_Mac,
	FLD_BONUS_HP = @Bonus_Hp,
	FLD_BONUS_MP = @Bonus_Mp,
	FLD_BONUS_HIT = @Bonus_Hit,
	FLD_BONUS_SPEED = @Bonus_Speed,
	FLD_BONUS_X2 = @Bonus_X2,
	FLD_EE = @Ee,
  FLD_SYSVAR = @Sysvar,
  FLD_UVAR = @uvar,
  FLD_FEATURE = @Feathure,
	FLD_SUCKDAMAGECOUNT = @SuckDamageCount,
	FLD_SUCKDAMAGERATE = @SuckDamageRate,
	FLD_SUCKDAMAGEBILI = @SuckDamageBiLi,
	FLD_SNDAITEMBOXOPENED = @SndaItemBoxOpened,
	FLD_DC = @Dc,
	FLD_HERONAME = @sHeroName,
	FLD_HEROUSERID = @sHeroUid,
	FLD_JVAR = @jVar,
	FLD_BVAR = @bVar,
	FLD_VARCLEARTIME = @tClearVarTime
	
  WHERE FLD_USERID=@sUserID
	Return(0)
END
ELSE 
  RETURN(1)
GO
/****** Object:  StoredProcedure [dbo].[HUM_INFO_ADD]    Script Date: 06/19/2021 18:12:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[HUM_INFO_ADD]
@sAccount VARCHAR(128),
@sChrName VARCHAR(50),
@btSex SMALLINT,
@btJob SMALLINT,
@sUserID VARCHAR(50),
@sSdkId VARCHAR(50) = '',
@sServerID VARCHAR(50) = '',
@sHeroName VARCHAR(50) = '',
@sHeroID VARCHAR(50) = ''
AS
BEGIN
IF EXISTS (SELECT FLD_ID FROM TBL_CHARACTER WHERE (FLD_CHARACTER like @sChrName+'%') or (FLD_CHARACTER like 'S'+@sServerID+'_'+@sChrName+'%') )
   RETURN(1)

  DECLARE @nNum INT
  DECLARE @IsFirstChar INT
  DECLARE @iRegCount INT
  DECLARE @iRegis INT
  DECLARE @tStartTime DATETIME
  
	SELECT TOP 1 @iRegCount = iRegCount,@iRegis=Regis,@tStartTime=StartTime
	FROM dbo.TBL_CONFIG WITH(NOLOCK)
	SET @iRegCount= ISNULL(@iRegCount, 0)
	SET @iRegis= ISNULL(@iRegis, 0)

	IF (@iRegis > 0) AND (@tStartTime IS NOT NULL)
	BEGIN
		IF DATEDIFF(DAY,@tStartTime,GETDATE()) > @iRegis
			RETURN(7)
	END

	IF (@iRegCount <> 0) 
	BEGIN
		DECLARE @nTotal INT
		SELECT @nTotal = COUNT(DISTINCT FLD_ACCOUNT) FROM TBL_CHARACTER WHERE FLD_DELETED = 0;
		IF (@nTotal >= @iRegCount)
			RETURN(7)
	END
	
	 SELECT @nNum = COUNT(*) FROM TBL_CHARACTER WHERE FLD_ACCOUNT=@sAccount AND (FLD_DELETED=0) AND FLD_SERVERID=@sServerID
	 
	IF @nNum >= 2
		RETURN(3)
		
	IF @nNum >= 1
		SET @IsFirstChar = 0
	ELSE
		SET @IsFirstChar = 1 

	INSERT INTO TBL_CHARACTER
	(
  FLD_USERID,
	FLD_CHARACTER,
	FLD_ACCOUNT,
	FLD_SEX,
	FLD_JOB,
	FLD_UPDATEDATETIME,
	FLD_MAKEDATE, 
	FLD_ISFIRSTCHAR, 
	FLD_MAPNAME,
	FLD_HOMEMAP,
	FLD_SDKID,
	FLD_SERVERID,
	FLD_HEROUSERID,
	FLD_HERONAME
	)

	VALUES
	(
  @sUserID,
	@sChrName,
	@sAccount,
	@btSex,
	@btJob,
	getdate(),
	getdate(),
	@IsFirstChar,
	'',
	'',
	@sSdkId,
	@sServerID,
	@sHeroID,
	@sHeroName
	)

  declare @new_sn varchar(30)
	declare @new_id int
	set @new_id=@@identity

	set @new_sn= Left(@sServerID+'0000000000',10)+convert(varchar,DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE()))
		+ right('000000'+cast(@new_id as varchar),6)
		+ substring(convert(varchar,rand()),3,3)
		
	update TBL_CHARACTER set FLD_USERID=@new_sn where FLD_ID=@new_id
	set @sUserId = @new_sn

  RETURN(0)
	
END
GO
/****** Object:  StoredProcedure [dbo].[HERO_INFO_UPDATE]    Script Date: 06/19/2021 18:12:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[HERO_INFO_UPDATE]
@sUserID VARCHAR(50),
@sChrName VARCHAR(50),
@MapName VARCHAR(50),
@Cx SMALLINT,
@Cy SMALLINT,
@Dir SMALLINT,
@Hair SMALLINT,
@Sex SMALLINT,
@Job SMALLINT,
@nLevel INT,

@Hp BIGINT,
@Mp BIGINT,
@Exp BIGINT,

@PkPoint INT,
@btF9 INT,
@BodyLuck FLOAT,
@InChealth INT,
@IncSpell INT,
@IncHealing INT,
@BonusPoint INT,
@HungerStatus INT,
@StatusTimeAr binary(24),
@Relevel tinyint,
@MasterName VARCHAR(50),
@QuestUnitOpen binary(128),
@QuestUnit binary(128),
@QuestFlag binary(128),
@Bonus_Dc INT,
@Bonus_Mc INT,
@Bonus_Sc INT,
@Bonus_Ac INT,
@Bonus_Mac INT,
@Bonus_Hp INT,
@Bonus_Mp INT,
@Bonus_Hit INT,
@Bonus_Speed INT,
@Bonus_X2 INT,
@Ee tinyint,
@Sysvar binary(400),
@uvar binary(1020),
@Feathure VARCHAR(200),
@SuckDamageCount INT,
@SuckDamageBiLi INT,
@SuckDamageRate tinyint,
@SndaItemBoxOpened TINYINT,
@Dc BIGINT

AS
IF EXISTS(SELECT FLD_ID FROM TBL_HERO WHERE FLD_USERID=@sUserID)
BEGIN
  UPDATE TBL_HERO SET
    FLD_UPDATEDATETIME = getdate(),
	FLD_CHARACTER = @sChrName,
	FLD_MAPNAME = @MapName,
	FLD_CX = @Cx,
	FLD_CY = @Cy,
	FLD_DIR = @Dir,
	FLD_HAIR = @Hair,
	FLD_SEX = @Sex,
	FLD_JOB = @Job,
	FLD_LEVEL = @nLevel,
	FLD_HP = @Hp,
	FLD_MP = @Mp,
	FLD_EXP = @Exp,
	FLD_PKPOINT = @PkPoint,
	FLD_BTF9 = @btF9,
	FLD_BODYLUCK = @BodyLuck,
	FLD_INCHEALTH = @InChealth,
	FLD_INCSPELL = @IncSpell,
	FLD_INCHEALING = @IncHealing,
	FLD_BONUSPOINT = @BonusPoint,
	FLD_HUNGRYSTATE	= @HungerStatus,
	FLD_StatusTimeArr = @StatusTimeAr,
	FLD_RELEVEL = @Relevel,
	FLD_MASTERNAME = @MasterName,
	FLD_QUESTUNITOPEN = @QuestUnitOpen,
	FLD_QUESTUNIT = @QuestUnit,
	FLD_QUESTFLAG = @QuestFlag,
	FLD_BONUS_DC = @Bonus_Dc,
	FLD_BONUS_MC = @Bonus_Mc,
	FLD_BONUS_SC = @Bonus_Sc,
	FLD_BONUS_AC = @Bonus_Ac,
	FLD_BONUS_MAC = @Bonus_Mac,
	FLD_BONUS_HP = @Bonus_Hp,
	FLD_BONUS_MP = @Bonus_Mp,
	FLD_BONUS_HIT = @Bonus_Hit,
	FLD_BONUS_SPEED = @Bonus_Speed,
	FLD_BONUS_X2 = @Bonus_X2,
	FLD_EE = @Ee,
	FLD_SYSVAR = @Sysvar,
	FLD_UVAR = @uvar,
	FLD_FEATURE = @Feathure,
	FLD_SUCKDAMAGECOUNT = @SuckDamageCount,
	FLD_SUCKDAMAGERATE = @SuckDamageRate,
	FLD_SUCKDAMAGEBILI = @SuckDamageBiLi,
	FLD_SNDAITEMBOXOPENED = @SndaItemBoxOpened,
	FLD_DC = @Dc


  WHERE FLD_USERID=@sUserID
	Return(0)
END
ELSE 
  RETURN(1)
GO
/****** Object:  StoredProcedure [dbo].[HERO_INFO_ADD]    Script Date: 06/19/2021 18:12:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[HERO_INFO_ADD]
@MasterUserID VARCHAR(50),
@sChrName VARCHAR(50),
@btSex SMALLINT,
@btJob SMALLINT,
@sUserID VARCHAR(50),
@sSdkId VARCHAR(50) = '',
@sServerID VARCHAR(50) = '',
@sMasterName VARCHAR(50) = ''
AS
BEGIN
IF EXISTS (SELECT FLD_ID FROM TBL_HERO WHERE (FLD_CHARACTER like @sChrName+'%') or (FLD_CHARACTER like 'S'+@sServerID+'_'+@sChrName+'%') )
   RETURN(1)

  DECLARE @nNum INT
  DECLARE @IsFirstChar INT
  DECLARE @iRegCount INT
  
	SELECT TOP 1 @iRegCount = iRegCount
	FROM dbo.TBL_CONFIG WITH(NOLOCK)
	SET @iRegCount= ISNULL(@iRegCount, 0)

	IF (@iRegCount <> 0) 
	BEGIN
		DECLARE @nTotal INT
		SELECT @nTotal = COUNT(DISTINCT FLD_HEROMASTERUSERID) FROM TBL_HERO WHERE FLD_DELETED = 0;
		IF (@nTotal >= @iRegCount)
			RETURN(7)
	END
	
	 SELECT @nNum = COUNT(*) FROM TBL_HERO WHERE FLD_HEROMASTERUSERID=@MasterUserID AND (FLD_DELETED=0) AND FLD_SERVERID=@sServerID;

	IF @nNum >= 1
		RETURN(3)
		
	IF @nNum >= 1
		SET @IsFirstChar = 0
	ELSE
		SET @IsFirstChar = 1 

	INSERT INTO TBL_HERO
	(
	FLD_HEROMASTERUSERID,
  FLD_USERID,
	FLD_CHARACTER,
	FLD_SEX,
	FLD_JOB,
	FLD_UPDATEDATETIME,
	FLD_MAKEDATE, 
	FLD_MAPNAME,
	FLD_SDKID,
	FLD_SERVERID,
	FLD_MASTERNAME
	)

	VALUES
	(
	@MasterUserID,
  @sUserID,
	@sChrName,
	@btSex,
	@btJob,
	getdate(),
	getdate(),
	'',
	@sSdkId,
	@sServerID,
	@sMasterName
	)

  declare @new_sn varchar(30)
	declare @new_id int
	set @new_id=@@identity

	set @new_sn=convert(varchar,DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE()))
		+ right('000000'+cast(@new_id as varchar),6)
		+ substring(convert(varchar,rand()),3,3)
		
	update TBL_HERO set FLD_USERID=@new_sn where FLD_ID=@new_id
	set @sUserId = @new_sn

  RETURN(0)
	
END
GO

-- -----------------国家系统-----------------

CREATE TABLE [dbo].[TBL_NATION_INFO] (
  [nIdx] int DEFAULT ((0)) NOT NULL,
  [sNationUID] varchar(50)  NOT NULL,
  [sNationName] varchar(128)  NULL,
  [nLevel] smallint DEFAULT ((0)) NULL,
  [nGold] int DEFAULT ((0)) NULL,
  [nExp] int DEFAULT ((0)) NULL,
  [dCreateTime] datetime  NULL,
  [btDeleted] smallint DEFAULT ((0)) NULL,
  [nMemberCount] int DEFAULT ((0)) NULL,
  [nAdvValue] int DEFAULT ((0)) NULL,
  [sRanks] varchar(500) DEFAULT '' NULL,
  [nServerID] int DEFAULT ((0)) NULL
)
GO

ALTER TABLE [dbo].[TBL_NATION_INFO] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Primary Key structure for table TBL_NATION_INFO
-- ----------------------------
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD CONSTRAINT [PK__TBL_NATI__2AD156350D5A9384] PRIMARY KEY CLUSTERED ([sNationUID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO



CREATE TABLE [dbo].[TBL_NATION_MEMBER] (
  [nIdx] varchar(50)  DEFAULT ((0)) NULL,
  [sUserID] varchar(50)  DEFAULT ((0)) NULL,
  [btRank] smallint DEFAULT ((0)) NULL,
  [btJob] smallint DEFAULT ((0)) NULL,
  [btJoin] smallint DEFAULT ((0)) NULL,
  [nLevel] int DEFAULT ((0)) NULL,
  [nAdvValue] int DEFAULT ((0)) NULL
)
GO

ALTER TABLE [dbo].[TBL_NATION_MEMBER] SET (LOCK_ESCALATION = TABLE)
GO



-- -----------------国家系统-----------------






-- -----------------宠物变量LoadItemVar-----------------


IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[LoadItemVar]') AND type IN ('P', 'PC', 'RF', 'X'))
	DROP PROCEDURE[dbo].[LoadItemVar]
GO

CREATE PROCEDURE [dbo].[LoadItemVar]
@sUserID VARCHAR(50),
@iType int= 0
AS
BEGIN
	IF @iType=0 
	BEGIN
		SELECT FLD_VAR_NAME, FLD_VAR_VALUE, FLD_TYPE FROM TBL_VAR
		WHERE LEN(FLD_USERID)<11 and ISNUMERIC(FLD_USERID)=1 and CONVERT(INT, FLD_USERID) IN (
		SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_BAG A1 WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_BODY A1 WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_JISHOU A1 WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_STORAGE A1 WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_PAIMAI A1 WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_HERO_BODY A1 WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_HERO_BAG A1 WHERE A1.FLD_USERID=@sUserID)
	END
	ELSE IF @iType=1 
	BEGIN
		SELECT FLD_VAR_NAME, FLD_VAR_VALUE, FLD_TYPE FROM TBL_VAR
		WHERE LEN(FLD_USERID)<11 and ISNUMERIC(FLD_USERID)=1 and CONVERT(INT, FLD_USERID) IN (
		SELECT FLD_MAKEINDEX FROM DBO.TBL_HERO_BODY A1 WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_HERO_BAG A1 WHERE A1.FLD_USERID=@sUserID)
	END
	ELSE IF @iType=2
	BEGIN
		SELECT FLD_VAR_NAME, FLD_VAR_VALUE, FLD_TYPE FROM TBL_VAR
		WHERE LEN(FLD_USERID)<11 and ISNUMERIC(FLD_USERID)=1 and CONVERT(INT, FLD_USERID) IN (
		SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_GUILD_STORAGE A1 WHERE A1.FLD_GUILDID=@sUserID)
	END	
END
GO


-- -----------------宠物表[TBL_PET]-----------------

CREATE TABLE [dbo].[TBL_PET] (
  [FLD_ID] int IDENTITY(1,1) NOT NULL,
  [FLD_MASTERUSERID] varchar(128) COLLATE Chinese_PRC_CI_AS NOT NULL,
  [FLD_PETIDX] int DEFAULT ((0)) NULL,
  [FLD_PETNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
  [FLD_USERID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
  [FLD_DELETED] tinyint DEFAULT ((0)) NOT NULL,
  [FLD_UPDATEDATETIME] datetime NULL,
  [FLD_RELEVEL] int DEFAULT ((0)) NOT NULL,
  [FLD_LEVEL] int DEFAULT ((0)) NOT NULL,
  [FLD_HP] bigint DEFAULT ((0)) NOT NULL,
  [FLD_MP] bigint DEFAULT ((0)) NOT NULL,
  [FLD_EXP] bigint DEFAULT ((0)) NOT NULL,
  [FLD_MAKEDATE] datetime NULL,
  [FLD_StatusTimeArr] binary(24) DEFAULT ((0)) NOT NULL,
  [FLD_BONUS_DC] bigint DEFAULT ((0)) NOT NULL,
  [FLD_BONUS_MC] bigint DEFAULT ((0)) NOT NULL,
  [FLD_BONUS_SC] bigint DEFAULT ((0)) NOT NULL,
  [FLD_BONUS_AC] bigint DEFAULT ((0)) NOT NULL,
  [FLD_BONUS_MAC] bigint DEFAULT ((0)) NOT NULL,
  [FLD_BONUS_HP] bigint DEFAULT ((0)) NOT NULL,
  [FLD_BONUS_MP] bigint DEFAULT ((0)) NOT NULL,
  [FLD_BONUS_HIT] bigint DEFAULT ((0)) NOT NULL,
  [FLD_BONUS_SPEED] bigint DEFAULT ((0)) NOT NULL,
  [FLD_FEATURE] varchar(200) COLLATE Chinese_PRC_CI_AS DEFAULT '' NULL,
  [FLD_BODYITEM] varchar(200) COLLATE Chinese_PRC_CI_AS DEFAULT '' NULL,
  [FLD_MASTERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
  [FLD_BONUSPOINT] bigint DEFAULT ((0)) NULL,
  [FLD_BONUS_X2] bigint DEFAULT ((0)) NULL,
  [FLD_STATE] tinyint DEFAULT ((1)) NULL
)
GO

ALTER TABLE [dbo].[TBL_PET] SET (LOCK_ESCALATION = TABLE)
GO

CREATE NONCLUSTERED INDEX [IX_TBL_PET_FLD_USERID]
ON [dbo].[TBL_PET] (
  [FLD_USERID] ASC
)
GO

-- -----------------宠物表存储过程-----------------
CREATE PROCEDURE [dbo].[PET_INFO_ADD]
@MasterUserID VARCHAR(50),
@sPetName VARCHAR(50),
@nPetIdx INT,
@sUserID VARCHAR(50),
@sMasterName VARCHAR(50) = '',
@nReLevel INT = 0,
@nLevel INT = 1,
@nHP bigint = 15,
@nExp bigint = 0,
@sBodyItem varchar(200) = '',
@nBonusDC bigInt= 0,
@nBonusMC bigint = 0 ,
@nBonusSC bigint = 0,
@nBonusAC bigint = 0,
@nBonusMAC bigint = 0,
@nBounsHP bigint = 0,
@nBonusMP bigint = 0,
@nBonusHit bigint = 0,
@nBonusSpeed bigint = 0,
@nBonusX2 bigint = 0,
@nBounsPoint bigint = 0
AS
IF EXISTS(SELECT FLD_ID FROM TBL_Pet WHERE FLD_USERID=@sUserID)
BEGIN
UPDATE TBL_PET SET
		FLD_MASTERUSERID= @MasterUserID,
		FLD_DELETED= 0,
    FLD_UPDATEDATETIME = getdate()
  WHERE FLD_USERID=@sUserID
	
	Return(0)
END
ELSE 
BEGIN
	INSERT INTO TBL_PET
	(
	FLD_MASTERUSERID,
	FLD_USERID,
	FLD_PETNAME,
	FLD_PETIDX,
	FLD_RELEVEL,
	FLD_LEVEL,
	FLD_HP,
	FLD_EXP,
	FLD_BONUS_DC,
	FLD_BONUS_MC,
	FLD_BONUS_SC,
	FLD_BONUS_AC,
	FLD_BONUS_MAC,
	FLD_BONUS_HP,
	FLD_BONUS_MP,
	FLD_BONUS_HIT,
	FLD_BONUS_SPEED,
	FLD_BODYITEM,
	FLD_BONUS_X2,
	FLD_BONUSPOINT,
	FLD_UPDATEDATETIME,
	FLD_MAKEDATE, 
	FLD_MASTERNAME,
	FLD_STATE
	)
	VALUES
	(
	@MasterUserID,
	@sUserID,
	@sPetName,
	@nPetIdx,
	@nReLevel,
	@nLevel,
	@nHP,
	@nExp,
	@nBonusDC,
	@nBonusMC,
	@nBonusSC,
	@nBonusAC,
	@nBonusMAC,
	@nBounsHP,
	@nBonusMP,
	@nBonusHit,
	@nBonusSpeed,
	@sBodyItem,
	@nBonusX2,
	@nBounsPoint,	
	getdate(),
	getdate(),
	@sMasterName,
	0
	)

RETURN(0)

END
GO

-- ----------------------------
-- Procedure structure for PET_INFO_UPDATE
-- ----------------------------

CREATE PROCEDURE [dbo].[PET_INFO_UPDATE]
@sUserID VARCHAR(50),
@sPetName VARCHAR(50),
@nPetIdx INT,
@Relevel INT,
@nLevel INT,

@Hp BIGINT,
@Mp BIGINT,
@Exp BIGINT,

@StatusTimeAr binary(24),
@Bonus_Dc INT,
@Bonus_Mc INT,
@Bonus_Sc INT,
@Bonus_Ac INT,
@Bonus_Mac INT,
@Bonus_Hp INT,
@Bonus_Mp INT,
@Bonus_Hit INT,
@Bonus_Speed INT,
@Bonus_X2 INT,
@BonusPoint INT,
@Feature VARCHAR(200),
@BodyItem VARCHAR(200),
@MasterName VARCHAR(50),
@State TINYINT,
@nDelete Tinyint
AS
IF EXISTS(SELECT FLD_ID FROM TBL_Pet WHERE FLD_USERID=@sUserID)
BEGIN
  UPDATE TBL_PET SET
    FLD_UPDATEDATETIME = getdate(),
		FLD_PETNAME = @sPetName,
		FLD_PETIDX = @nPetIdx,
		FLD_RELEVEL = @Relevel,
		FLD_LEVEL = @nLevel,
		FLD_HP = @Hp,
		FLD_MP = @Mp,
		FLD_EXP = @Exp,
		FLD_StatusTimeArr = @StatusTimeAr,
		FLD_BONUS_DC = @Bonus_Dc,
		FLD_BONUS_MC = @Bonus_Mc,
		FLD_BONUS_SC = @Bonus_Sc,
		FLD_BONUS_AC = @Bonus_Ac,
		FLD_BONUS_MAC = @Bonus_Mac,
		FLD_BONUS_HP = @Bonus_Hp,
		FLD_BONUS_MP = @Bonus_Mp,
		FLD_BONUS_HIT = @Bonus_Hit,
		FLD_BONUS_SPEED = @Bonus_Speed,
	  FLD_BONUS_X2 = @Bonus_X2,
	  FLD_BONUSPOINT = @BonusPoint,
		FLD_FEATURE = @Feature,
		FLD_Bodyitem	= @BodyItem,
	  FLD_MASTERNAME = @MasterName,
	  FLD_STATE =@State,
		FLD_DELETED= @nDelete
  WHERE FLD_USERID=@sUserID
	Return(0)
END
ELSE 
  RETURN(1)
GO















if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_BAG') and name='IX_TBL_ITEM_BAG_FLD_MAKEINDEX')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_BAG_FLD_MAKEINDEX ON dbo.TBL_ITEM_BAG (FLD_MAKEINDEX ASC)
GO
if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_BODY') and name='IX_TBL_ITEM_BODY_FLD_MAKEINDEX')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_BODY_FLD_MAKEINDEX ON dbo.TBL_ITEM_BODY (FLD_MAKEINDEX ASC)
GO
if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_GUILD_STORAGE') and name='IX_TBL_ITEM_GUILD_STORAGE_FLD_MAKEINDEX')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_GUILD_STORAGE_FLD_MAKEINDEX ON dbo.TBL_ITEM_GUILD_STORAGE (FLD_MAKEINDEX ASC)
GO
if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_JISHOU') and name='IX_TBL_ITEM_JISHOU_FLD_MAKEINDEX')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_JISHOU_FLD_MAKEINDEX ON dbo.TBL_ITEM_JISHOU (FLD_MAKEINDEX ASC)
GO
if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_STORAGE') and name='IX_TBL_ITEM_STORAGE_FLD_MAKEINDEX')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_STORAGE_FLD_MAKEINDEX ON dbo.TBL_ITEM_STORAGE (FLD_MAKEINDEX ASC)
GO
if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_STORAGE') and name='IX_TBL_ITEM_STORAGE_FLD_MAKEINDEX')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_STORAGE_FLD_MAKEINDEX ON dbo.TBL_ITEM_STORAGE (FLD_MAKEINDEX ASC)
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_MAIL') and name='IX_TBL_MAIL_UserID')
	CREATE NONCLUSTERED INDEX IX_TBL_MAIL_UserID ON dbo.TBL_MAIL (UserID ASC)
GO
if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_MAIL') and name='IX_TBL_MAIL_dCreateTime')
	CREATE NONCLUSTERED INDEX IX_TBL_MAIL_dCreateTime ON dbo.TBL_MAIL (dCreateTime ASC)
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_CHARACTER') and name='IX_TBL_CHARACTER_FLD_USERID')
	CREATE NONCLUSTERED INDEX IX_TBL_CHARACTER_FLD_USERID ON dbo.TBL_CHARACTER (FLD_USERID ASC)
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_CHARACTER') and name='IX_TBL_CHARACTER_FLD_ACCOUNT')
	CREATE NONCLUSTERED INDEX IX_TBL_CHARACTER_FLD_ACCOUNT ON dbo.TBL_CHARACTER (FLD_ACCOUNT ASC)
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_CHARACTER') and name='IX_TBL_CHARACTER_FLD_CHARACTER')
	CREATE NONCLUSTERED INDEX IX_TBL_CHARACTER_FLD_CHARACTER ON dbo.TBL_CHARACTER (FLD_CHARACTER ASC)
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_CHARACTER') and name='IX_TBL_CHARACTER_FLD_UPDATEDATETIME')
	CREATE NONCLUSTERED INDEX IX_TBL_CHARACTER_FLD_UPDATEDATETIME ON dbo.TBL_CHARACTER (FLD_UPDATEDATETIME ASC)
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_BAG') and name='IX_TBL_ITEM_BAG_FLD_USERID')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_BAG_FLD_USERID ON [dbo].[TBL_ITEM_BAG] ([FLD_USERID])
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_BODY') and name='IX_TBL_ITEM_BODY_FLD_USERID')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_BODY_FLD_USERID ON [dbo].[TBL_ITEM_BODY] ([FLD_USERID])
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_STORAGE') and name='IX_TBL_ITEM_STORAGE_FLD_USERID')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_STORAGE_FLD_USERID ON [dbo].[TBL_ITEM_STORAGE] ([FLD_USERID])
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_MAGIC') and name='IX_TBL_MAGIC_FLD_USERID')
	CREATE NONCLUSTERED INDEX IX_TBL_MAGIC_FLD_USERID ON [dbo].[TBL_MAGIC] ([FLD_USERID])
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_ITEM_EX_ABIL') and name='IX_TBL_ITEM_EX_ABIL_FLD_MAKEINDEX')
	CREATE NONCLUSTERED INDEX IX_TBL_ITEM_EX_ABIL_FLD_MAKEINDEX ON [dbo].[TBL_ITEM_EX_ABIL] ([FLD_MAKEINDEX])
GO



/****** Object:  Default [DF__TLOG_BOX___FLD_M__3864608B]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_MONEYID]
GO
/****** Object:  Default [DF__TLOG_BOX___FLD_M__395884C4]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_MONEY]
GO
/****** Object:  Default [DF__TLOG_BOX___FLD_S__3A4CA8FD]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_STATE]
GO
/****** Object:  Default [DF__TLOG_BOX___FLD_D__3B40CD36]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_DECSTATE]
GO
/****** Object:  Default [DF__TLOG_BOX___FLD_G__3C34F16F]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_GETSTATE]
GO
/****** Object:  Default [DF__TLOG_BOX___FLD_P__3D2915A8]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ('') FOR [FLD_PAYORDER]
GO
/****** Object:  Default [DF__TLOG_BOX___FLD_S__3E1D39E1]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_STATUS]
GO
/****** Object:  Default [DF__TBL_VAR__uGuid__29572725]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_VAR] ADD  DEFAULT (newid()) FOR [uGuid]
GO
/****** Object:  Default [DF_TBL_VAR_FLD_TYPE]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_VAR] ADD  CONSTRAINT [DF_TBL_VAR_FLD_TYPE]  DEFAULT ((0)) FOR [FLD_TYPE]
GO
/****** Object:  Default [DF__TBL_VAR__tUpdate__2A4B4B5E]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_VAR] ADD  DEFAULT (getdate()) FOR [tUpdateTime]
GO
/****** Object:  Default [DF__TBL_MAGIC__FLD_L__0A9D95DB]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_MAGIC] ADD  DEFAULT ((0)) FOR [FLD_LEVEL_UP]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_M__2739D489]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_M__2739D489]  DEFAULT ((0)) FOR [FLD_MAKEINDEX]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_I__282DF8C2]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_I__282DF8C2]  DEFAULT ((0)) FOR [FLD_INDEX]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_D__29221CFB]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_D__29221CFB]  DEFAULT ((0)) FOR [FLD_DURA]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_D__2A164134]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_D__2A164134]  DEFAULT ((0)) FOR [FLD_DURAMAX]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_B__2B0A656D]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_B__2B0A656D]  DEFAULT ((0)) FOR [FLD_BTVALUE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_W__2BFE89A6]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_W__2BFE89A6]  DEFAULT ((-1)) FOR [FLD_WHERE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_O__2CF2ADDF]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_O__2CF2ADDF]  DEFAULT ((0)) FOR [FLD_OVERLAP]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_U__2DE6D218]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_U__2DE6D218]  DEFAULT ('') FOR [FLD_USERID]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_T__2EDAF651]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_T__2EDAF651]  DEFAULT ((0)) FOR [FLD_TYPE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_P__2FCF1A8A]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_P__2FCF1A8A]  DEFAULT ((0)) FOR [FLD_PRICE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_A__30C33EC3]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_A__30C33EC3]  DEFAULT ((0)) FOR [FLD_ADDTIME]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_U__31B762FC]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_U__31B762FC]  DEFAULT ('') FOR [FLD_USERLIST]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_J__32AB8735]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_J__32AB8735]  DEFAULT ('') FOR [FLD_JOINUSERLIST]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_L__339FAB6E]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_L__339FAB6E]  DEFAULT ((0)) FOR [FLD_LASTPRICE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_C__3493CFA7]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_C__3493CFA7]  DEFAULT ('') FOR [FLD_CURRUSERID]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_P__3587F3E0]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_P__3587F3E0]  DEFAULT ((0)) FOR [FLD_PAGE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_L__367C1819]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_L__367C1819]  DEFAULT ((0)) FOR [FLD_LASTTIME]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_F__37703C53]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_F__37703C53]  DEFAULT ((0)) FOR [FLD_FLAG]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_I__3864608B]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_I__3864608B]  DEFAULT ((0)) FOR [FLD_ID]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_U__2DE6D219]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_U__2DE6D219]  DEFAULT ('') FOR [FLD_GUILDID]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_F__37703C52]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_F__37703C52]  DEFAULT ((90)) FOR [FLD_MEGUILDRATE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_L__395884C4]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_L__395884C4]  DEFAULT ((0)) FOR [FLD_LEVEL]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_M__00200768]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((0)) FOR [FLD_MAKEINDEX]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_I__01142BA1]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((0)) FOR [FLD_INDEX]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_D__02084FDA]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((0)) FOR [FLD_DURA]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_D__02FC7413]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((0)) FOR [FLD_DURAMAX]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_B__03F0984C]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((0)) FOR [FLD_BTVALUE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_W__04E4BC85]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((-1)) FOR [FLD_WHERE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_O__05D8E0BE]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((0)) FOR [FLD_OVERLAP]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_U__06CD04F7]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ('') FOR [FLD_USERID]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_T__07C12930]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((0)) FOR [FLD_TYPE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_P__08B54D69]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((0)) FOR [FLD_PRICE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_A__09A971A2]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_JISHOU] ADD  DEFAULT ((0)) FOR [FLD_ADDTIME]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_M__787EE5A0]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_GUILD_STORAGE] ADD  DEFAULT ((0)) FOR [FLD_MAKEINDEX]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_I__797309D9]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_GUILD_STORAGE] ADD  DEFAULT ((0)) FOR [FLD_INDEX]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_D__7A672E12]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_GUILD_STORAGE] ADD  DEFAULT ((0)) FOR [FLD_DURA]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_D__7B5B524B]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_GUILD_STORAGE] ADD  DEFAULT ((0)) FOR [FLD_DURAMAX]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_B__7C4F7684]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_GUILD_STORAGE] ADD  DEFAULT ((0)) FOR [FLD_BTVALUE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_W__7D439ABD]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_GUILD_STORAGE] ADD  DEFAULT ((-1)) FOR [FLD_WHERE]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_O__7E37BEF6]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_GUILD_STORAGE] ADD  DEFAULT ((0)) FOR [FLD_OVERLAP]
GO
/****** Object:  Default [DF__TBL_ITEM___FLD_G__7F2BE32F]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_GUILD_STORAGE] ADD  DEFAULT ('') FOR [FLD_GUILDID]
GO
/****** Object:  Default [DF_TBL_ITEM_BODY_FLD_MAKEINDEX]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_BODY] ADD  CONSTRAINT [DF_TBL_ITEM_BODY_FLD_MAKEINDEX]  DEFAULT ((0)) FOR [FLD_MAKEINDEX]
GO
/****** Object:  Default [DF_TBL_ITEM_BAG_FLD_MAKEINDEX]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_ITEM_BAG] ADD  CONSTRAINT [DF_TBL_ITEM_BAG_FLD_MAKEINDEX]  DEFAULT ((0)) FOR [FLD_MAKEINDEX]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_DE__4D5F7D71]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_DELETED]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_MA__4E53A1AA]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ('') FOR [FLD_MAPNAME]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_CX__4F47C5E3]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_CX]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_CY__503BEA1C]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_CY]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_DI__51300E55]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_DIR]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_HA__5224328E]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((1)) FOR [FLD_HAIR]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_SE__531856C7]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_SEX]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_JO__540C7B00]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_JOB]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_LE__55009F39]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_LEVEL]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_HP__55F4C372]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_HP]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_MP__56E8E7AB]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_MP]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_EX__57DD0BE4]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_EXP]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_PK__58D1301D]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_PKPOINT]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__59C55456]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BODYLUCK]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_IN__5AB9788F]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_INCHEALTH]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_IN__5BAD9CC8]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_INCSPELL]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_IN__5CA1C101]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_INCHEALING]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__5D95E53A]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUSPOINT]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_HU__5E8A0973]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_HUNGRYSTATE]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_St__5F7E2DAC]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_StatusTimeArr]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_RE__607251E5]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_RELEVEL]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_MA__6166761E]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ('') FOR [FLD_MASTERNAME]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_QU__625A9A57]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_QUESTUNITOPEN]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_QU__634EBE90]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_QUESTUNIT]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_QU__6442E2C9]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_QUESTFLAG]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__65370702]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_DC]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__662B2B3B]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_MC]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__671F4F74]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_SC]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__681373AD]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_AC]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__690797E6]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_MAC]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__69FBBC1F]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_HP]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__6AEFE058]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_MP]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__6BE40491]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_HIT]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__6CD828CA]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_SPEED]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BO__6DCC4D03]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BONUS_X2]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_SE__6EC0713C]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_SELECTID]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_BT__6FB49575]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_BTF9]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_SY__70A8B9AE]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_SYSVAR]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_EE__719CDDE7]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_EE]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_UV__72910220]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_UVAR]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_FE__73852659]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ('') FOR [FLD_FEATURE]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_SU__74794A92]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_SUCKDAMAGECOUNT]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_SU__756D6ECB]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_SUCKDAMAGERATE]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_SU__76619304]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_SUCKDAMAGEBILI]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_SN__7755B73D]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_SNDAITEMBOXOPENED]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_SD__7849DB76]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ('') FOR [FLD_SDKID]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_SE__793DFFAF]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_SERVERID]
GO
/****** Object:  Default [DF__TBL_HERO__FLD_DC__7A3223E8]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_HERO] ADD  DEFAULT ((0)) FOR [FLD_DC]
GO
/****** Object:  Default [DF_TBL_GUILD_MEMBER_btRank]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_MEMBER] ADD  CONSTRAINT [DF_TBL_GUILD_MEMBER_btRank]  DEFAULT ((0)) FOR [btRank]
GO
/****** Object:  Default [DF_TBL_GUILD_MEMBER_btJob]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_MEMBER] ADD  CONSTRAINT [DF_TBL_GUILD_MEMBER_btJob]  DEFAULT ((0)) FOR [btJob]
GO
/****** Object:  Default [DF_TBL_GUILD_MEMBER_btJoin]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_MEMBER] ADD  CONSTRAINT [DF_TBL_GUILD_MEMBER_btJoin]  DEFAULT ((0)) FOR [btJoin]
GO
/****** Object:  Default [DF_TBL_GUILD_MEMBER_nLevel]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_MEMBER] ADD  CONSTRAINT [DF_TBL_GUILD_MEMBER_nLevel]  DEFAULT ((0)) FOR [nLevel]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_Level]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_Level]  DEFAULT ((0)) FOR [Level]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_nGold]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nGold]  DEFAULT ((0)) FOR [nGold]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_nExp]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nExp]  DEFAULT ((0)) FOR [nExp]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_btAutoJoin]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_btAutoJoin]  DEFAULT ((0)) FOR [btAutoJoin]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_btDeleted]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_btDeleted]  DEFAULT ((0)) FOR [btDeleted]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_nJoinLevel]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nJoinLevel]  DEFAULT ((0)) FOR [nJoinLevel]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_btContriLvl]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_btContriLvl]  DEFAULT ((0)) FOR [btContriLvl]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_nMemberCount]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nMemberCount]  DEFAULT ((100)) FOR [nMemberCount]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_nBuildPoint]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nBuildPoint]  DEFAULT ((0)) FOR [nBuildPoint]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_nAurae]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nAurae]  DEFAULT ((0)) FOR [nAurae]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_nStability]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nStability]  DEFAULT ((0)) FOR [nStability]
GO
/****** Object:  Default [DF_TBL_GUILD_INFO_nFlourishing]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nFlourishing]  DEFAULT ((0)) FOR [nFlourishing]
GO
/****** Object:  Default [DF__TBL_CONFI__Regis__173876EA]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ((0)) FOR [Regis]
GO
/****** Object:  Default [DF__TBL_CONFI__iRegC__182C9B23]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ((0)) FOR [iRegCount]
GO
/****** Object:  Default [DF__TBL_CONFI__sRegi__1920BF5C]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ('') FOR [sRegionServerName]
GO
/****** Object:  Default [DF__TBL_CONFI__HfCou__1A14E395]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ((0)) FOR [HfCount]
GO
/****** Object:  Default [DF__TBL_CONFI__TongS__1B0907CE]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ('') FOR [TongServerIP]
GO
/****** Object:  Default [DF__TBL_CONFI__TongS__1BFD2C07]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ((0)) FOR [TongServerPort]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_U__2B3F6F97]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_USERID]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_D__2C3393D0]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_DELETED]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_D__2D27B809]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_DBVERSION]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_M__2E1BDC42]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_MAPNAME]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_C__2F10007B]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_CX]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_C__300424B4]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_CY]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_D__30F848ED]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_DIR]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_H__123EB7A3]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__123EB7A3]  DEFAULT ((1)) FOR [FLD_HAIR]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_L__32E0915F]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_LEVEL]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_H__33D4B598]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_HP]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_M__34C8D9D1]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_MP]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_E__35BCFE0A]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_EXP]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_G__36B12243]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_GOLD]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_H__37A5467C]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_HOMEMAP]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_H__38996AB5]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_HOMEX]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_H__398D8EEE]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_HOMEY]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_P__3A81B327]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_PKPOINT]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_A__3B75D760]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_ALLOWGROUP]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_A__3C69FB99]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_ATTACKMODE]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_F__3D5E1FD2]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_FIGHTZONEDIE]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__3E52440B]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BODYLUCK]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_I__3F466844]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_INCHEALTH]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_I__403A8C7D]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_INCSPELL]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_I__412EB0B6]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_INCHEALING]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__4222D4EF]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUSPOINT]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_H__4316F928]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_HUNGRYSTATE]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_I__440B1D61]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_ISFIRSTCHAR]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_S__44FF419A]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_StatusTimeArr]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_R__45F365D3]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_RELEVEL]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_G__46E78A0C]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_GAMEGOLD]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_C__47DBAE45]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_CREDITPOINT]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_M__48CFD27E]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_MASTERNAME]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_M__49C3F6B7]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_MASTER]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_D__4AB81AF0]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_DEARNAME]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_S__4BAC3F29]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_STORAGEPWD]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_G__4CA06362]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_GAMEPOINT]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_P__4D94879B]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_PAYMENTPOINT]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_L__4E88ABD4]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_LOCKLOGON]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_C__4F7CD00D]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_CONTRIBUTION]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_A__5070F446]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_ALLOWGUILDRECALL]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_G__5165187F]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_GROUPRECALLTIME]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_A__52593CB8]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_ALLOWGROUPRECALL]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_Q__534D60F1]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_QUESTUNITOPEN]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_Q__5441852A]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_QUESTUNIT]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_Q__5535A963]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_QUESTFLAG]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_M__5629CD9C]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_MARRYCOUNT]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__571DF1D5]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_DC]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__5812160E]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_MC]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__59063A47]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_SC]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__59FA5E80]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_AC]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__5AEE82B9]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_MAC]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__5BE2A6F2]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_HP]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__5CD6CB2B]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_MP]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__5DCAEF64]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_HIT]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__5EBF139D]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_SPEED]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__5FB337D6]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BONUS_X2]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_S__60A75C0F]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_SELECTID]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_M__619B8048]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_MONEY]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_B__628FA481]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_BTF9]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_S__6383C8BA]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_SYSVAR]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_E__6477ECF3]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_EE]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_U__656C112C]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_UVAR]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_O__66603565]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT (NULL) FOR [FLD_OFFLINE_TIME]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_T__145C0A3F]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_TOTAL_RECHARGE]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_C__15502E78]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_CHARACTER_OLD]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_L__40058253]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_LOCKHUM]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_I__40F9A68C]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_ISBUYCHAR]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_R__41EDCAC5]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_REALACCOUNT]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_L__42E1EEFE]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT (NULL) FOR [FLD_LOCKDATE]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_P__43D61337]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_PAYORDER]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_S__44CA3770]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_STATUS]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_H__45BE5BA9]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_HEROUSERID]
GO
/****** Object:  Default [DF__TBL_CHARA__FLD_H__46B27FE2]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ('') FOR [FLD_HERONAME]
GO
/****** Object:  Default [DF__TBL_BOX_S__FLD_M__2FCF1A8A]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_MONEYID]
GO
/****** Object:  Default [DF__TBL_BOX_S__FLD_M__30C33EC3]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_MONEY]
GO
/****** Object:  Default [DF__TBL_BOX_S__FLD_S__31B762FC]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_STATE]
GO
/****** Object:  Default [DF__TBL_BOX_S__FLD_D__32AB8735]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_DECSTATE]
GO
/****** Object:  Default [DF__TBL_BOX_S__FLD_G__339FAB6E]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_GETSTATE]
GO
/****** Object:  Default [DF__TBL_BOX_S__FLD_P__3493CFA7]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ('') FOR [FLD_PAYORDER]
GO
/****** Object:  Default [DF__TBL_BOX_S__FLD_S__3587F3E0]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_STATUS]
GO
/****** Object:  Default [DF__Mir_Disbl__dCrea__2B0A656D]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[Mir_Disble_List] ADD  DEFAULT (getdate()) FOR [dCreateTime]
GO
/****** Object:  Default [DF__Mir_Disbl__dCrea__2DE6D218]    Script Date: 06/19/2021 18:12:47 ******/
ALTER TABLE [dbo].[Mir_Disble_Chat] ADD  DEFAULT (getdate()) FOR [dCreateTime]
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_BOX_SELL') and name='IX_TBL_BOX_SELL_FLD_USERID')
	CREATE NONCLUSTERED INDEX IX_TBL_BOX_SELL_FLD_USERID ON [dbo].[TBL_BOX_SELL] ([FLD_USERID])
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_BOX_SELL') and name='IX_TBL_BOX_SELL_FLD_ORDER')
	CREATE NONCLUSTERED INDEX IX_TBL_BOX_SELL_FLD_ORDER ON [dbo].[TBL_BOX_SELL] ([FLD_ORDER])
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TBL_BOX_SELL') and name='IX_TBL_BOX_SELL_FLD_STATE')
	CREATE NONCLUSTERED INDEX IX_TBL_BOX_SELL_FLD_STATE ON [dbo].[TBL_BOX_SELL] ([FLD_STATE])
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TLOG_BOX_SELL') and name='IX_TLOG_BOX_SELL_FLD_USERID')
	CREATE NONCLUSTERED INDEX IX_TLOG_BOX_SELL_FLD_USERID ON [dbo].[TLOG_BOX_SELL] ([FLD_USERID])
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TLOG_BOX_SELL') and name='IX_TLOG_BOX_SELL_FLD_ORDER')
	CREATE NONCLUSTERED INDEX IX_TLOG_BOX_SELL_FLD_ORDER ON [dbo].[TLOG_BOX_SELL] ([FLD_ORDER])
GO

if not exists(select TOP 1 1 from sysindexes where id=object_id('TLOG_BOX_SELL') and name='IX_TLOG_BOX_SELL_FLD_STATE')
	CREATE NONCLUSTERED INDEX IX_TLOG_BOX_SELL_FLD_STATE ON [dbo].[TLOG_BOX_SELL] ([FLD_STATE])
GO

