MSG源码相对数据库研究比较有利的内容收集
研究了一下源代码 发现很多值得参考的东西 特意收集了一下 发出来给大家研究
通过对MSG加载数据库的内容 让我们对数据库的研究不再盲目了!
以下内容不仅包含了数据字段解释 而且 还有相应数据字段的设置内容!
# Host: 192.168.1.200 Database: cq
#--------------------------------------------------------
# Server version 3.23.32
#
# Table structure for table 'cq_item'
#
CREATE TABLE cq_item(
id int(4) unsigned NOT NULL auto_increment,
type int(4) unsigned NOT NULL default '0',
owner_id int(4) unsigned NOT NULL default '0',
player_id int(4) unsigned NOT NULL default '0',
amount smallint(2) unsigned NOT NULL default '100',
amount_limit smallint(2) unsigned NOT NULL default '100',
ident tinyint(1) unsigned NOT NULL default '0',
position tinyint(1) unsigned NOT NULL default '0',
gem1 tinyint(1) unsigned NOT NULL default '0',
gem2 tinyint(1) unsigned NOT NULL default '0',
magic1 tinyint(1) unsigned NOT NULL default '0',
magic2 tinyint(1) unsigned NOT NULL default '0',
magic3 tinyint(1) unsigned NOT NULL default '0',
data int(4) NOT NULL default '0',
PRIMARY KEY (id),
KEY package(owner_id, position, player_id)
) TYPE=MyISAM;
#
# Table structure for table 'cq_itemtype'
#
DROP TABLE IF EXISTS cq_itemtype;
CREATE TABLE cq_itemtype (
id int(4) unsigned NOT NULL default '0',
name varchar(15) binary NOT NULL default '',
req_profession tinyint(1) unsigned NOT NULL default '0',
level tinyint(1) unsigned NOT NULL default '0',
req_level tinyint(1) unsigned NOT NULL default '0',
req_edu tinyint(1) unsigned NOT NULL default '0',
req_force smallint(2) unsigned NOT NULL default '0',
req_speed smallint(2) unsigned NOT NULL default '0',
req_health smallint(2) unsigned NOT NULL default '0',
req_soul smallint(2) unsigned NOT NULL default '0',
monopoly tinyint(1) unsigned NOT NULL default '0',
weight smallint(2) unsigned NOT NULL default '100',
price int(4) unsigned NOT NULL default '0',
id_action int(4) unsigned NOT NULL default '0',
attack_max smallint(2) unsigned NOT NULL default '0',
attack_min smallint(2) unsigned NOT NULL default '0',
defense smallint(2) unsigned NOT NULL default '0',
magicatk_min smallint(2) unsigned NOT NULL default '0',
add_soul smallint(2) unsigned NOT NULL default '0',
life smallint(2) NOT NULL default '0',
mana smallint(2) NOT NULL default '0',
amount smallint(2) unsigned NOT NULL default '1',
amount_limit smallint(2) unsigned NOT NULL default '1',
ident tinyint(1) unsigned NOT NULL default '0',
gem1 tinyint(1) unsigned NOT NULL default '0',
gem2 tinyint(1) unsigned NOT NULL default '0',
magic1 tinyint(1) unsigned NOT NULL default '0',
magic2 tinyint(1) unsigned NOT NULL default '0',
magic3 tinyint(1) unsigned NOT NULL default '0',
magicatk_max smallint(2) unsigned NOT NULL default '0',
magic_def smallint(2) unsigned NOT NULL default '0',
atk_range smallint(2) unsigned NOT NULL default '1',
atk_speed smallint(2) unsigned NOT NULL default '800',
PRIMARY KEY (id)
) TYPE=MyISAM;
##############################################################
# itemtype表针对物品的字段转义:
# req_level:人物等级
# attack_max:貌似是BB原始成长率
# attack_min:貌似是BB升级到下一级需要的经验值
##############################################################
#
# req_weaponskill字段无用,改名为level:物品等级
#
##############################################################
#
# Table structure for table 'cq_friend'
#
CREATE TABLE cq_friend (
id int(4) unsigned zerofill NOT NULL auto_increment,
userid int(4) unsigned zerofill NOT NULL default '0000',
friend int(4) unsigned zerofill NOT NULL default '0',
friendname varchar(15) NOT NULL default '无',
PRIMARY KEY (id),
KEY userid(userid)
) TYPE=MyISAM;
#
# Table structure for table 'cq_enemy'
#
DROP TABLE IF EXISTS cq_enemy;
CREATE TABLE cq_enemy (
id int(4) unsigned zerofill NOT NULL auto_increment,
userid int(4) unsigned zerofill NOT NULL default '0000',
enemy int(4) unsigned zerofill NOT NULL default '0',
enemyname varchar(15) NOT NULL default '无',
time int(4) unsigned zerofill NOT NULL default '0',
PRIMARY KEY (id),
KEY userid(userid,enemy)
) TYPE=MyISAM;
#
# Table structure for table 'cq_generator'
#
DROP TABLE IF EXISTS cq_generator;
CREATE TABLE cq_generator (
id int(4) unsigned zerofill NOT NULL auto_increment,
mapid int(4) unsigned zerofill NOT NULL default '0000',
bound_x int(4) unsigned zerofill NOT NULL default '0000',
bound_y int(4) unsigned zerofill NOT NULL default '0000',
bound_cx int(4) unsigned zerofill NOT NULL default '0000',
bound_cy int(4) unsigned zerofill NOT NULL default '0000',
grid int(4) unsigned zerofill NOT NULL default '0009',
rest_secs int(4) unsigned zerofill NOT NULL default '0000',
max_per_gen int(4) unsigned zerofill NOT NULL default '0000',
npctype int(4) unsigned zerofill NOT NULL default '0000',
timer_begin int(4) unsigned zerofill NOT NULL default '0000',
timer_end int(4) unsigned zerofill NOT NULL default '0000',
born_x int(4) unsigned zerofill NOT NULL default '0000',
born_y int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id),
KEY mapid(mapid)
) TYPE=MyISAM;
# max_per_gen - 0: generat by game server
# npctype - only use for monster but pet
# (bound_x==0 && bound_y==0) : dynamic bound for pet
# timer_begin,timer_end - format: DDWWHHMMSS, DD:day of month(1-31), WW:day of week(1-7), HHMMSS:hour,minute,second. WW mast 00 when DD is not 00.
# born_x,born_y - born from bound when default 0, else born to corrd(x,y)
#
# Table structure for table 'cq_monstertype'
#
DROP TABLE IF EXISTS cq_monstertype;
CREATE TABLE cq_monstertype (
id INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
name CHAR (15) NOT NULL DEFAULT '无',
type INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
lookface INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
length tinyint (4) NOT NULL DEFAULT 0,
fat tinyint (4) NOT NULL DEFAULT 0,
life SMALLINT (2) UNSIGNED ZEROFILL NOT NULL DEFAULT 00,
mana SMALLINT (2) UNSIGNED ZEROFILL NOT NULL DEFAULT 00,
attack_max INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
attack_min INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
defence INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
dexterity INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
dodge INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
helmet_type INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
armor_type INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
weaponr_type INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
weaponl_type INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
attack_range INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
view_range INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
escape_life INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
attack_speed INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
move_speed INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
level INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
attack_user INTEGER (1) UNSIGNED NOT NULL DEFAULT 3,
drop_money_min INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
drop_money_max INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
size_add INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
action INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
run_speed INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
drop_armet tinyint (3) UNSIGNED ZEROFILL NOT NULL DEFAULT 000,
drop_necklace tinyint (3) UNSIGNED ZEROFILL NOT NULL DEFAULT 000,
drop_armor tinyint (3) UNSIGNED ZEROFILL NOT NULL DEFAULT 000,
drop_ring tinyint (3) UNSIGNED ZEROFILL NOT NULL DEFAULT 000,
drop_weapon tinyint (3) UNSIGNED ZEROFILL NOT NULL DEFAULT 000,
drop_shield tinyint (3) UNSIGNED ZEROFILL NOT NULL DEFAULT 000,
drop_shoes tinyint (3) UNSIGNED ZEROFILL NOT NULL DEFAULT 000,
drop_money_chance INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
drop_item_chance INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
magic_type INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
magic_def INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
magic_hitrate INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0100,
atk_hitrate INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
ai_type INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
defence2 INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 10000,
explode_item_chance1 INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
explode_item_chance2 INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
explode_item_chance3 INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
drop_item_rule INTEGER (4) UNSIGNED ZEROFILL NOT NULL DEFAULT 0000,
PRIMARY KEY (id)
) TYPE=MyISAM;
# attack_user - 0: escape only;
1: passive; // 被动攻击
2: active; // 主动攻击
4: good; // 正义的(卫兵或玩家召唤和控制的怪物)
8: guard; // 卫兵
16: pk_killer; // 追杀黑名
32: jump; // 会跳
64: fixed // 不会动的
128: fastback, // 速归
256: lockuser(auto_die), for task monster // 锁定攻击指定玩家,玩家离开自动消失
512: lockone, // 锁定攻击首先攻击自己的玩家
1024: add_life, // 自动加血
2048: evil_killer, // 白名杀手
4096: wing, // 飞行状态
8192: neutral, // 中立的
16384: roar, // 出生时全地图怒吼
32768: no escape, // 不会逃跑
65536: equality, // 不藐视
# attack_max/attack_min - attack with weapon, or power of magic when magic_type
# magic_type - send to client type, need not cq_magictype.
# recruit magic npc - magic_type=1020, magic_hitrate=percent(10 -> 10%)
# ai_type - for call pet ai, use by client only
# defence2 - danage = danage * defence2 / 10000
#
# Table structure for table 'cq_pet'
#
DROP TABLE IF EXISTS cq_pet;
CREATE TABLE cq_pet (
id int(4) unsigned zerofill NOT NULL auto_increment,
ownerid int(4) unsigned zerofill NOT NULL default '0000',
ownertype tinyint(3) unsigned zerofill NOT NULL default '000',
generatorid int(4) unsigned zerofill NOT NULL default '0000',
typeid int(4) unsigned zerofill NOT NULL default '0000',
name char(15) binary NOT NULL default '无',
life smallint(2) unsigned zerofill NOT NULL default '0000',
mana smallint(2) unsigned zerofill NOT NULL default '0000',
recordmap_id int(4) unsigned NOT NULL default '0000',
recordx smallint(2) unsigned NOT NULL default '0000',
recordy smallint(2) unsigned NOT NULL default '0000',
data int(4) unsigned NOT NULL default '0000',
PRIMARY KEY (id)
) TYPE=MyISAM;
# ownertype - 1: user, 2: syndicate, 3: npc
# typeid - id of cq_monstertype
#
# Table structure for table 'cq_map'
#
DROP TABLE IF EXISTS cq_map;
CREATE TABLE cq_map (
id int(4) unsigned NOT NULL default '0',
name varchar(15) binary NOT NULL default '未命名',
describe_text varchar(127) binary NOT NULL default '',
mapdoc int(4) unsigned NOT NULL default '0',
type int(4) unsigned zerofill NOT NULL default '0',
owner_id int(4) unsigned NOT NULL default '0',
mapgroup int(4) unsigned zerofill NOT NULL default '0',
idxserver int(4) NOT NULL default '-1',
weather int(4) unsigned zerofill NOT NULL default '0',
bgmusic int(4) unsigned zerofill NOT NULL default '0',
bgmusic_show int(4) unsigned zerofill NOT NULL default '0',
portal0_x int(4) unsigned zerofill NOT NULL default '0000',
portal0_y int(4) unsigned zerofill NOT NULL default '0000',
reborn_mapid int(4) unsigned zerofill NOT NULL default '0000',
reborn_portal int(4) unsigned zerofill NOT NULL default '0000',
res_lev tinyint(3) unsigned NOT NULL default '0',
owner_type tinyint(3) unsigned NOT NULL default '0',
link_map int(4) unsigned zerofill NOT NULL default '0000',
link_x smallint(2) unsigned zerofill NOT NULL default '0000',
link_y smallint(2) unsigned zerofill NOT NULL default '0000',
del_flag tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (id),
KEY idx(idxserver,mapgroup)
) TYPE=MyISAM;
DROP TABLE IF EXISTS cq_dynamap;
CREATE TABLE cq_dynamap (
id int(4) unsigned NOT NULL default '0' auto_increment,
name varchar(15) binary NOT NULL default '未命名',
describe_text varchar(127) binary NOT NULL default '',
mapdoc smallint(4) unsigned NOT NULL default '0',
type int(4) unsigned zerofill NOT NULL default '0',
owner_id int(4) unsigned NOT NULL default '0',
mapgroup tinyint(4) unsigned zerofill NOT NULL default '0',
idxserver tinyint(4) NOT NULL default '-1',
weather tinyint(4) unsigned zerofill NOT NULL default '0',
bgmusic tinyint(4) unsigned zerofill NOT NULL default '0',
bgmusic_show tinyint(4) unsigned zerofill NOT NULL default '0',
portal0_x smallint(4) unsigned zerofill NOT NULL default '0000',
portal0_y smallint(4) unsigned zerofill NOT NULL default '0000',
reborn_mapid int(4) unsigned zerofill NOT NULL default '0000',
reborn_portal tinyint(4) unsigned zerofill NOT NULL default '0000',
res_lev smallint(4) unsigned NOT NULL default '0',
owner_type tinyint(3) unsigned NOT NULL default '0',
link_map int(4) unsigned zerofill NOT NULL default '0000',
link_x smallint(2) unsigned zerofill NOT NULL default '0000',
link_y smallint(2) unsigned zerofill NOT NULL default '0000',
del_flag tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;
INSERT cq_dynamap SET id=1000000,name='RESERVE_ID_SPACE';
# enum ENUM_MAPTYPE {
MAPTYPE_NORMAL = 0x0000,
MAPTYPE_PKFIELD = 0x0001,
MAPTYPE_CHGMAP_DISABLE = 0x0002,
MAPTYPE_RECORD_DISABLE = 0x0004,
MAPTYPE_PK_DISABLE = 0x0008,
};
#
# Table structure for table 'cq_portal'
#
DROP TABLE IF EXISTS cq_portal;
CREATE TABLE cq_portal (
id int(4) unsigned zerofill NOT NULL auto_increment,
mapid int(4) unsigned zerofill NOT NULL default '0000',
portal_idx int(4) unsigned zerofill NOT NULL default '0000',
pos_x int(4) unsigned zerofill NOT NULL default '0000',
pos_y int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id),
KEY mapid(mapid)
) TYPE=MyISAM;
#
# Table structure for table 'cq_passway'
#
DROP TABLE IF EXISTS cq_passway;
CREATE TABLE cq_passway (
id int(4) unsigned zerofill NOT NULL auto_increment,
mapid int(4) unsigned zerofill NOT NULL default '0000',
passway_idx int(4) unsigned zerofill NOT NULL default '0000',
target_mapid int(4) unsigned zerofill NOT NULL default '0000',
target_mapportal int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id),
KEY mapid(mapid)
) TYPE=MyISAM;
#
# Table structure for table 'cq_region'
#
DROP TABLE IF EXISTS cq_region;
CREATE TABLE cq_region (
id int(4) unsigned zerofill NOT NULL auto_increment,
mapid int(4) unsigned zerofill NOT NULL default '0000',
type int(4) unsigned zerofill NOT NULL default '0000',
bound_x int(4) unsigned zerofill NOT NULL default '0000',
bound_y int(4) unsigned zerofill NOT NULL default '0000',
bound_cx int(4) unsigned zerofill NOT NULL default '0000',
bound_cy int(4) unsigned zerofill NOT NULL default '0000',
datastr varchar(15) binary NOT NULL default '',
data0 int(4) unsigned zerofill NOT NULL default '0000',
data1 int(4) unsigned zerofill NOT NULL default '0000',
data2 int(4) unsigned zerofill NOT NULL default '0000',
data3 int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id),
KEY mapid(mapid)
) TYPE=MyISAM;
# mapid - is mapdoc
# type:
# 1 - city. record position disable, magic call player disable.
# 2 - weather. data0(2): Type, data1(200): Intensity(0-999), data2(10): dir(0-359), data3(0x00ffffff): nColor, data1<0: fast change.
# type - enum { WEATHER_NONE=0, WEATHER_FINE,
# WEATHER_RAINY, WEATHER_SNOWY, WEATHER_SANDS,
# WEATHER_LEAF, WEATHER_BAMBOO, WEATHER_FLOWER,
# WEATHER_FLYING, WEATHER_DANDELION, WEATHER_WORM, WEATHER_CLOUDY,
# WEATHER_ALL};
#
# Table structure for table 'cq_magictype'
#
DROP TABLE IF EXISTS cq_magictype;
CREATE TABLE cq_magictype (
id int(4) unsigned zerofill NOT NULL auto_increment,
type int(4) unsigned zerofill NOT NULL default '0000',
sort int(4) unsigned zerofill NOT NULL default '0000',
name varchar(15) binary NOT NULL default '',
crime tinyint(1) unsigned zerofill NOT NULL default '0',
ground tinyint(1) unsigned zerofill NOT NULL default '0',
multi tinyint(1) unsigned zerofill NOT NULL default '0',
target int(4) unsigned zerofill NOT NULL default '0000',
level int(4) unsigned zerofill NOT NULL default '0000',
use_mp int(4) unsigned zerofill NOT NULL default '0000',
power int(4) NOT NULL default '0000',
intone_speed int(4) unsigned zerofill NOT NULL default '0000',
percent int(4) unsigned zerofill NOT NULL default '0000',
step_secs int(4) unsigned zerofill NOT NULL default '0000',
range int(4) unsigned zerofill NOT NULL default '0000',
distance int(4) unsigned zerofill NOT NULL default '0000',
status int(4) unsigned zerofill NOT NULL default '0000',
need_prof int(4) unsigned zerofill NOT NULL default '0000',
need_exp int(4) NOT NULL default '0000',
need_level int(4) unsigned zerofill NOT NULL default '0000',
use_xp tinyint(3) unsigned zerofill NOT NULL default '000',
weapon_subtype int(4) unsigned zerofill NOT NULL default '0000',
active_times int(4) unsigned zerofill NOT NULL default '0000',
auto_active tinyint(3) unsigned zerofill NOT NULL default '000',
floor_attr int(4) unsigned zerofill NOT NULL default '0000',
auto_learn tinyint(1) unsigned zerofill NOT NULL default '0',
learn_level int(4) unsigned zerofill NOT NULL default '0000',
drop_weapon tinyint(1) unsigned zerofill NOT NULL default '0',
use_ep int(4) unsigned zerofill NOT NULL default '0000',
weapon_hit tinyint(1) unsigned zerofill NOT NULL default '0',
use_item int(4) unsigned zerofill NOT NULL default '0000',
next_magic int(4) unsigned zerofill NOT NULL default '0000',
delay_ms int(4) unsigned zerofill NOT NULL default '0000',
use_item_num int(4) unsigned zerofill NOT NULL default '0001',
width int(4) unsigned zerofill NOT NULL default '0000',
durability int(4) unsigned zerofill NOT NULL default '0001',
PRIMARY KEY (id)
) TYPE=MyISAM;
# type: 类型
# 10000~10255 - 武器魔法,即cq_itemtype中的magic1+10000
# sort: 行为分类。
# 1 - 攻击单人,对方去血, check floor attr, support drop_weapon in weapon skill。(support xp skill)
# 2 - 回复,加血。(support auto active), (support team member with multi flag)
# 3 - 十字型区域目标去血。
# 4 - 扇形区域目标去血。(support xp skill)(SizeAdd effective)(support auto active of random mode)
# 5 - 圆形区域目标去血。(support ground type)
# 6 - 攻击单人,对方加状态。
# 7 - 回复单人,对方去状态。
# 8 - range of square, multi target, (support xp skill)(support ground type)(SizeAdd effective)
# 9 - jump & attack, single target, (support xp skill)(support ground type)
# 10 - random transmit, power is max distance.
# 11 - dispatch xp
# 12 - collide, (support xp skill only)
# 13 - serial cut, ground type only. (auto active, support xp skill & weapon skill)
# 14 - line, (support weapon skill, power is number of life expended)(support auto active of random mode)
# 15 - add attack range, (auto active only, forever effect)
# 16 - attack with temp status, weapon skill only
# support status: attack | defence | be damage with weapon | attack rate | stop | vampire (other status is attack target and attach this status),
# support auto active of random mode, only for weapon_hit=0
# 17 - call team member.
# 18 - record map position to trans spell.
# 19 - transform to monster, (monster_type == power)
# 20 - add mana, (power is add number, support self target only)
# 21 - lay trap, power is trap_type.
# 22 - dance, (use for client)
# 23 - call pet, power is monster type. step_secs is alive secs for pet, 0 for keep alive.
# 24 - VAMPIRE. use for call pet.
# 25 - INSTEAD. use for call pet.
# 26 - decrement life. power is data or percent of current life.
# 27 - ground sting.
# range:
# 106 - 表示主方向为6,次方向为1
# power:
# (-29999)-29999 - add or sub
# 30000-32767 - add or sub by percent of (num - 30000)
# -32768 - set to full
# (-30000)-(-32767) - set to (-1*num - 30000)
# 0 - mast be zero when detach
# status:
# 2 - detach badly status.(support detach only)
# 4 - poison
# 8 - detach all status of magic.(support detach only)
# 16 - vampire(only support sort16)
# 32 - HitRate
# 64 - defence
# 128 - attack
# 512 - magic defence
# 1024 - bow defence
# 2048 - attack range
# 4096 - reflect weapon
# 8192 - super man status, with half of defence.
# 16384 - be damage with weapon, detach when move or attack in keep effect
# 32768 - be damage with magic
# 65536 - attack rate
# 131072 - invisible for monster
# 262144 - TORNADO
# 1048576 - reflect magic
# 2097152 - dodge
# 4194304 - wing
# 8388608 - keep_bow, add attack, cancel when move
# 16777216 - stop milli secs in power, have not keep effect. monster valid. (believe: power is add damage, step_secs is keep milli secs.)
# need_prof: 有多种职业要求时,值相加即可。最高级填0,表示没有一种职业可以再升级了。
# 1 - 魔法师
# 2 - 魔法师转职
# 4 - 战士
# 8 - 战士转职
# 16 - 弓箭手
# 32 - 弓箭手转职
# need_exp:
# 0 - 不升级(或通过任务系统升级)
# -1 - 自动升级。
# target:
# 0 - 敌人
# 1 - 允许对自己
# 2 - no target
# use_xp:
# 0 - 法术
# 1 - XP技
# 2 - 武器技(support up level with auto_uplevel & weaponskill_level, do not support up level with need_exp number)
# active_times:
# 0 - once times status class (use for defence/hitrate)
# 1-x - more times status class (use for poison)
# auto_active:
# 0 - none auto active
# 1 - active when kill target, enable sort 2, 13
# 2 - active when equipment, enable sort 15
# 4 - active in random, enable sort 4, 5, 14, 16
# learn_level:
# 1-99 - automatic learn weapon skill at this level.
# nnmm - automatic learn weapon skill between mm - nn level.
# drop_weapon:
# 1 - throw weapon_r to target around.
# weapon_hit:
# 0 - hit by weapon
# 1 - hit by magic
# 2 - hit mode by arrow
# use_item - use equip item by sub_type, 0 for no use.
# use_item_num - use equip item number, 0 for check item only.
# delay_ms - 0: for default delay.
# width - width of magic. 0-180 for degree of fan (sort 4), 0 for default.
#
# Table structure for table 'cq_magic'
#
CREATE TABLE cq_magic (
id int(4) unsigned zerofill NOT NULL auto_increment,
ownerid int(4) unsigned zerofill NOT NULL default '0000',
type smallint(4) unsigned zerofill NOT NULL default '0000',
level smallint(4) unsigned zerofill NOT NULL default '0000',
exp int(4) unsigned zerofill NOT NULL default '0000',
unlearn tinyint(1) unsigned zerofill NOT NULL default '0',
old_level smallint(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id),
KEY user_magic(ownerid)
) TYPE=MyISAM;
#
# Table structure for table 'cq_syndicate'
#
CREATE TABLE cq_syndicate (
id int(4) unsigned zerofill NOT NULL auto_increment,
name varchar(15) binary NOT NULL default '',
announce varchar(255) binary NOT NULL default '',
tenet varchar(255) binary NOT NULL default '',
member_title varchar(15) binary NOT NULL default '弟子',
leader_id int(4) unsigned zerofill NOT NULL default '0000',
leader_name varchar(15) binary NOT NULL default '',
money int(4) zerofill NOT NULL default '0000',
fealty_syn int(4) unsigned zerofill NOT NULL default '0000',
del_flag tinyint(1) unsigned zerofill NOT NULL default '0',
amount int(4) unsigned zerofill NOT NULL default '0000',
enemy0 int(4) unsigned zerofill NOT NULL default '0000',
enemy1 int(4) unsigned zerofill NOT NULL default '0000',
enemy2 int(4) unsigned zerofill NOT NULL default '0000',
enemy3 int(4) unsigned zerofill NOT NULL default '0000',
enemy4 int(4) unsigned zerofill NOT NULL default '0000',
ally0 int(4) unsigned zerofill NOT NULL default '0000',
ally1 int(4) unsigned zerofill NOT NULL default '0000',
ally2 int(4) unsigned zerofill NOT NULL default '0000',
ally3 int(4) unsigned zerofill NOT NULL default '0000',
ally4 int(4) unsigned zerofill NOT NULL default '0000',
rank tinyint(1) unsigned zerofill NOT NULL default '0',
saint tinyint(1) unsigned zerofill NOT NULL default '0',
mantle tinyint(1) unsigned zerofill NOT NULL default '0',
distime int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id),
UNIQUE KEY name(name)
) TYPE=MyISAM;
# del_flag: delete by syndicate leader
#
# Table structure for table 'cq_synattr'
#
CREATE TABLE cq_synattr (
id int(4) unsigned zerofill NOT NULL,
syn_id int(4) unsigned zerofill NOT NULL default '0000',
rank int(4) unsigned zerofill NOT NULL default '0000',
proffer int(4) unsigned zerofill NOT NULL default '0000',
title int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id)
) TYPE=MyISAM;
#
# Table structure for table 'cq_leaveword'
#
DROP TABLE IF EXISTS cq_leaveword;
CREATE TABLE cq_leaveword (
id int(4) unsigned zerofill NOT NULL auto_increment,
user_name char(15) binary NOT NULL default '未知',
send_name char(15) binary NOT NULL default '未知',
time char(15) binary NOT NULL default '00000000000000',
words char(255) binary NOT NULL default '未命名',
PRIMARY KEY (id),
KEY user_name(user_name)
) TYPE=MyISAM;
#
# Table structure for table 'cq_bonus'
#
CREATE TABLE cq_bonus (
serianumber char(15) binary NOT NULL default '未知',
password char(15) binary NOT NULL default '未知',
action int(4) unsigned zerofill NOT NULL default '0000',
id int(4) unsigned zerofill NOT NULL auto_increment,
PRIMARY KEY (id),
UNIQUE KEY serianumber(serianumber)
) TYPE=MyISAM;
#
# Table structure for table 'cq_traptype'
#
DROP TABLE IF EXISTS cq_traptype;
CREATE TABLE cq_traptype (
id int(4) unsigned zerofill NOT NULL,
sort tinyint(3) unsigned zerofill NOT NULL default '0',
look int(4) unsigned zerofill NOT NULL default '0000',
action_id int(4) unsigned zerofill NOT NULL default '0000',
level int(4) unsigned zerofill NOT NULL default '0000',
attack_max int(4) unsigned zerofill NOT NULL default '0000',
attack_min int(4) unsigned zerofill NOT NULL default '0000',
dexterity int(4) unsigned zerofill NOT NULL default '0000',
attack_speed int(4) unsigned zerofill NOT NULL default '1000',
active_times int(4) unsigned zerofill NOT NULL default '0000',
magic_type int(4) unsigned zerofill NOT NULL default '0000',
magic_hitrate int(4) unsigned zerofill NOT NULL default '0100',
size int(4) unsigned zerofill NOT NULL default '0000',
atk_mode int(3) unsigned zerofill NOT NULL default '0001',
PRIMARY KEY (id)
) TYPE=MyISAM;
insert cq_traptype values(1, 1,1091010,0,20,250,250,80,1000,0,1000,50,1,1);
insert cq_traptype values(2,10,1091010,0,20,25,25,80,1000,0,1000,50,7,1);
# sort:
TRAPSORT_SYSTRAP =1, // 系统的陷阱,多次有效
TRAPSORT_FIREWALL =10, // 火墙, 可由系统放置
# look - 0: invisible trap
# action_id - run action when active trap, only effect for TRAPSORT_SYSTRAP
# active_times - 0: forever effect
# magic_type - 0: hit by weapon mode
# atk_mode: 可叠加
ATKMODE_USER = 1,
ATKMODE_MONSTER = 2,
ATKMODE_NOATTACK = 4, // 不攻击对象,只触发ACTION
CREATE TABLE cq_trap (
id int(4) unsigned zerofill NOT NULL,
type int(4) unsigned zerofill NOT NULL default '0000',
look int(4) unsigned zerofill NOT NULL default '0000',
owner_id int(4) unsigned zerofill NOT NULL default '0000',
map_id int(4) unsigned zerofill NOT NULL default '0000',
pos_x int(4) unsigned zerofill NOT NULL default '0000',
pos_y int(4) unsigned zerofill NOT NULL default '0000',
data int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id)
) TYPE=MyISAM;
insert cq_trap values(990001,1,1091010,0,1002,404,400,0);
insert cq_trap values(990002,2,1091012,0,1002,439,400,0);
# id - 990001 ~ 999999
# look - 0: invisible trap
#
# Table structure for table 'cq_point_allot'
#
DROP TABLE IF EXISTS cq_point_allot;
CREATE TABLE cq_point_allot (
id int(4) unsigned zerofill NOT NULL auto_increment,
prof_sort int(4) unsigned zerofill NOT NULL default '0000',
level int(4) unsigned zerofill NOT NULL default '0000',
force int(4) unsigned zerofill NOT NULL default '0000',
Speed int(4) unsigned zerofill NOT NULL default '0000',
health int(4) unsigned zerofill NOT NULL default '0000',
soul int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id),
UNIQUE KEY idx(prof_sort,level)
) TYPE=MyISAM;
INSERT cq_point_allot VALUES(0,0,0,0,0,0,0);
#
# Table structure for table 'cq_superman'
#
CREATE TABLE cq_superman (
id int(4) unsigned zerofill NOT NULL,
number int(4) unsigned zerofill NOT NULL default '0000',
name varchar(15) binary NOT NULL default '--',
PRIMARY KEY (id),
KEY number(number)
) TYPE=MyISAM;
#
# Table structure for table 'cq_config'
#
CREATE TABLE cq_config (
id int(4) unsigned zerofill NOT NULL,
name varchar(15) binary NOT NULL default '',
data int(4) unsigned zerofill NOT NULL default '0000',
string varchar(255) binary NOT NULL default '',
PRIMARY KEY (id),
KEY name(name)
) TYPE=MyISAM;
#
# Table structure for table 'cq_rebirth'
#
DROP TABLE IF EXISTS cq_rebirth;
CREATE TABLE cq_rebirth (
id int(4) unsigned zerofill NOT NULL,
need_prof int(4) unsigned zerofill NOT NULL default '0000',
new_prof int(4) unsigned zerofill NOT NULL default '0000',
need_level int(4) unsigned zerofill NOT NULL default '0000',
new_level int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id)
) TYPE=MyISAM;
#
# Table structure for table 'cq_dropitemrule'
#
DROP TABLE IF EXISTS cq_dropitemrule;
CREATE TABLE cq_dropitemrule(
id int unsigned NOT NULL,
RuleId int unsigned NOT NULL default '0',
Chance int unsigned NOT NULL default '0',
Item0 int unsigned NOT NULL default '0',
Item1 int unsigned NOT NULL default '0',
Item2 int unsigned NOT NULL default '0',
Item3 int unsigned NOT NULL default '0',
Item4 int unsigned NOT NULL default '0',
Item5 int unsigned NOT NULL default '0',
Item6 int unsigned NOT NULL default '0',
Item7 int unsigned NOT NULL default '0',
Item8 int unsigned NOT NULL default '0',
Item9 int unsigned NOT NULL default '0',
Item10 int unsigned NOT NULL default '0',
Item11 int unsigned NOT NULL default '0',
Item12 int unsigned NOT NULL default '0',
Item13 int unsigned NOT NULL default '0',
Item14 int unsigned NOT NULL default '0',
PRIMARY KEY (id, RuleId)
) TYPE=MyISAM;
#
# Table structure for table 'cq_table'
#
DROP TABLE IF EXISTS cq_table;
CREATE TABLE cq_table (
id int(4) unsigned zerofill NOT NULL auto_increment,
npc_id int(4) unsigned zerofill NOT NULL default '0000',
type int(4) unsigned zerofill NOT NULL default '0000',
key_id int(4) unsigned zerofill NOT NULL default '0000',
datastr varchar(255) binary NOT NULL default '',
data0 int(4) unsigned zerofill NOT NULL default '0000',
data1 int(4) unsigned zerofill NOT NULL default '0000',
data2 int(4) unsigned zerofill NOT NULL default '0000',
data3 int(4) unsigned zerofill NOT NULL default '0000',
PRIMARY KEY (id),
) TYPE=MyISAM;
#
# Table structure for table 'cq_npc'
#
DROP TABLE IF EXISTS cq_npc;
CREATE TABLE cq_npc (
id int(4) unsigned zerofill NOT NULL default '0000',
ownerid int(4) unsigned NOT NULL default '0',
ownertype int(4) unsigned NOT NULL default '0',
name char(15) binary NOT NULL default '未命名',
type int(4) unsigned zerofill NOT NULL default '0',
lookface int(4) unsigned zerofill NOT NULL default '0',
idxserver int(4) NOT NULL default '-1',
mapid int(4) unsigned zerofill NOT NULL default '0',
cellx int(4) unsigned zerofill NOT NULL default '0',
celly int(4) unsigned zerofill NOT NULL default '0',
task0 int(4) unsigned zerofill NOT NULL default '0',
task1 int(4) unsigned zerofill NOT NULL default '0',
task2 int(4) unsigned zerofill NOT NULL default '0',
task3 int(4) unsigned zerofill NOT NULL default '0',
task4 int(4) unsigned zerofill NOT NULL default '0',
task5 int(4) unsigned zerofill NOT NULL default '0',
task6 int(4) unsigned zerofill NOT NULL default '0',
task7 int(4) unsigned zerofill NOT NULL default '0',
data0 int(4) NOT NULL default '0',
data1 int(4) NOT NULL default '0',
data2 int(4) NOT NULL default '0',
data3 int(4) NOT NULL default '0',
datastr char(15) binary NOT NULL default '无',
linkid int(4) unsigned zerofill NOT NULL default '0',
life int(4) unsigned zerofill NOT NULL default '0',
maxlife int(4) unsigned zerofill NOT NULL default '0',
base int(4) unsigned zerofill NOT NULL default '0',
sort smallint(2) unsigned zerofill NOT NULL default '0',
itemid int(4) unsigned zerofill NOT NULL default '0',
defence smallint(2) unsigned zerofill NOT NULL default '0',
magic_def smallint(2) unsigned zerofill NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;
INSERT cq_npc VALUES(9999,0,0,'赌场',19,26,-1,1002,404,398,0,0,0,0,0,0,0,0,0,0,0,0,'',0,0,0,0,0,0);
CREATE TABLE cq_dynanpc (
id int(4) unsigned zerofill NOT NULL default '0000' auto_increment,
ownerid int(4) unsigned NOT NULL default '0',
ownertype tinyint(3) unsigned NOT NULL default '0',
name varchar(15) binary NOT NULL default '未命名',
type smallint(2) unsigned zerofill NOT NULL default '0',
lookface int(4) unsigned zerofill NOT NULL default '0',
idxserver tinyint(3) NOT NULL default '-1',
mapid int(4) unsigned zerofill NOT NULL default '0',
cellx smallint(2) unsigned zerofill NOT NULL default '0',
celly smallint(2) unsigned zerofill NOT NULL default '0',
task0 int(4) unsigned zerofill NOT NULL default '0',
task1 int(4) unsigned zerofill NOT NULL default '0',
task2 int(4) unsigned zerofill NOT NULL default '0',
task3 int(4) unsigned zerofill NOT NULL default '0',
task4 int(4) unsigned zerofill NOT NULL default '0',
task5 int(4) unsigned zerofill NOT NULL default '0',
task6 int(4) unsigned zerofill NOT NULL default '0',
task7 int(4) unsigned zerofill NOT NULL default '0',
data0 int(4) NOT NULL default '0',
data1 int(4) NOT NULL default '0',
data2 int(4) NOT NULL default '0',
data3 int(4) NOT NULL default '0',
datastr varchar(255) binary NOT NULL default '无',
linkid int(4) unsigned zerofill NOT NULL default '0',
life int(4) unsigned zerofill NOT NULL default '0',
maxlife int(4) unsigned zerofill NOT NULL default '0',
base int(4) unsigned zerofill NOT NULL default '0',
sort smallint(2) unsigned zerofill NOT NULL default '0',
itemid int(4) unsigned zerofill NOT NULL default '0',
defence smallint(2) unsigned zerofill NOT NULL default '0',
magic_def smallint(2) unsigned zerofill NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;
####################
## INSERT VALUES ##
####################
#ownertype: 0: system, 1: user, 2: syndicate, 3: npc
#type -
enum NPCTYPE{
_NPC_NONE = 0, // 通用NPC
_SHOPKEEPER_NPC = 1, // 商店NPC
_TASK_NPC = 2, // 任务NPC
_STORAGE_NPC = 3, // 寄存处NPC
_TRUNCK_NPC = 4, // 箱子NPC
_FACE_NPC = 5, // 变头像NPC
_FORGE_NPC = 6, // 锻造NPC
_STATUARY_NPC = 7, // 雕像NPC
_WEAPONGOAL_NPC = 8, // 武器靶子NPC
_MAGICGOAL_NPC = 9, // 武器靶子NPC
_BOWGOAL_NPC = 10, // 武器靶子NPC
_SYNFLAG_NPC = 11, // 帮派标记NPC
};
#sort -
enum NPCSORT{
NPCSORT_TASK = 1, // 任务类
NPCSORT_RECYCLE = 2, // 可回收类
NPCSORT_SCENE = 4, // 场景类(带地图物件,LookFace为地图物件的TYPE)
NPCSORT_LINKMAP = 8, // 挂地图类(使用LINKID,与其它使用LINKID的互斥)
NPCSORT_DIEACTION = 16, // 带死亡任务(使用LINKID,与其它使用LINKID的互斥)
NPCSORT_DELENABLE = 32, // 可以手动删除(不是指通过任务)
};
#maxlife - 0: can not be attack
#base - npc type in "TerrainNpc.ini".
DROP TABLE IF EXISTS cq_goods;
CREATE TABLE cq_goods (
id int(4) unsigned zerofill NOT NULL default '0000',
ownerid int(4) unsigned NOT NULL default '0',
itemtype int(4) unsigned NOT NULL default '0',
PRIMARY KEY (id),
KEY ownerid(ownerid)
) TYPE=MyISAM;
#
# Table structure for table 'cq_task'
#
DROP TABLE IF EXISTS cq_task;
CREATE TABLE cq_task (
id int(4) unsigned zerofill NOT NULL default '0000',
id_next int(4) unsigned zerofill NOT NULL default '0000',
id_nextfail int(4) unsigned zerofill NOT NULL default '0000',
itemname1 char(15) binary NOT NULL default '',
itemname2 char(15) binary NOT NULL default '',
money int(4) unsigned NOT NULL default '0',
profession int(4) unsigned NOT NULL default '0',
edu int(4) unsigned NOT NULL default '0',
min_pk int(4) NOT NULL default '0',
max_pk int(4) NOT NULL default '0',
team int(4) unsigned zerofill NOT NULL default '0',
metempsychosis int(4) unsigned zerofill NOT NULL default '0',
query tinyint(1) unsigned zerofill NOT NULL default '0',
marriage tinyint(1) NOT NULL default '0',
client_active tinyint(1) unsigned zerofill NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;
#
# Table structure for table 'cq_action'
#
DROP TABLE IF EXISTS cq_action;
CREATE TABLE cq_action (
id int(4) unsigned zerofill NOT NULL default '0000',
id_next int(4) unsigned zerofill NOT NULL default '0000',
id_nextfail int(4) unsigned zerofill NOT NULL default '0000',
type int(4) unsigned zerofill NOT NULL default '0000',
data int(4) NOT NULL default '0',
param char(127) binary NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;
DROP TABLE IF EXISTS cq_user;
CREATE TABLE cq_user (
name varchar(15) binary NOT NULL default '',
mate varchar(15) binary NOT NULL default '',
lookface int(4) unsigned NOT NULL default '0',
hair smallint(2) unsigned NOT NULL default '0',
money int(4) unsigned NOT NULL default '0',
money_saved int(4) unsigned NOT NULL default '0',
task_data int(4) unsigned NOT NULL default '0',
level tinyint(1) unsigned NOT NULL default '0',
exp int(4) NOT NULL default '0',
force smallint(2) unsigned NOT NULL default '0',
physique smallint(2) unsigned NOT NULL default '0',
Speed smallint(2) unsigned NOT NULL default '0',
health smallint(2) unsigned NOT NULL default '0',
soul smallint(2) unsigned NOT NULL default '0',
additional_point smallint(2) unsigned NOT NULL default '0',
auto_allot tinyint(1) unsigned NOT NULL default '0',
life smallint(2) unsigned NOT NULL default '0',
mana smallint(2) unsigned NOT NULL default '0',
profession tinyint(2) unsigned NOT NULL default '0',
deed int(4) NOT NULL default '0',
pk smallint(2) NOT NULL default '0',
nobility tinyint(1) unsigned NOT NULL default '0000',
medal varchar(64) binary NOT NULL default '',
medal_select tinyint(4) unsigned NOT NULL default '0000',
metempsychosis tinyint(1) unsigned NOT NULL default '0000',
syndicate_id int(4) unsigned NOT NULL default '0000',
recordmap_id int(4) unsigned NOT NULL default '0000',
recordx smallint(2) unsigned NOT NULL default '0000',
recordy smallint(2) unsigned NOT NULL default '0000',
account_id int(4) unsigned NOT NULL default '0000',
id int(4) unsigned NOT NULL auto_increment,
last_login int(8) unsigned NOT NULL default '0',
task_mask int(4) unsigned NOT NULL default '0000',
time_of_life int(4) unsigned NOT NULL default '0000',
virtue int(4) unsigned NOT NULL default '0000',
home_id int(4) unsigned NOT NULL default '0000',
title varchar(64) binary NOT NULL default '',
title_select tinyint(4) unsigned NOT NULL default '0000',
lock_key int(4) unsigned NOT NULL default '0000',
PRIMARY KEY (id),
KEY index_account_id(account_id),
KEY index_name(name),
KEY index_level(level)
) TYPE=MyISAM;
INSERT cq_user SET id=1000000,name='RESERVE_ID_SPACE',account_id=4111222333;
DROP TABLE IF EXISTS cq_weapon_skill;
CREATE TABLE cq_weapon_skill (
type int(4) unsigned zerofill NOT NULL default '0000',
level tinyint(2) unsigned zerofill NOT NULL default '0000',
exp int(4) unsigned zerofill NOT NULL default '0000',
old_level tinyint(2) unsigned zerofill NOT NULL default '0000',
owner_id int(4) unsigned zerofill NOT NULL default '0000',
id int(4) unsigned zerofill NOT NULL auto_increment,
unlearn tinyint(1) unsigned zerofill NOT NULL default '0',
PRIMARY KEY (id),
KEY owner_id(owner_id)
) TYPE=MyISAM;
#
# Table structure for table 'cq_levexp'
#
DROP TABLE IF EXISTS cq_levexp;
CREATE TABLE cq_levexp (
level int(4) unsigned zerofill NOT NULL default '0000',
exp int(4) unsigned NOT NULL default '0',
PRIMARY KEY (level)
) TYPE=MyISAM;
#
# Dumping data for table 'cq_levexp'
#
INSERT INTO cq_levexp VALUES (0001,36);
INSERT INTO cq_levexp VALUES (0002,51);
INSERT INTO cq_levexp VALUES (0003,71);
INSERT INTO cq_levexp VALUES (0004,100);
INSERT INTO cq_levexp VALUES (0005,164);
INSERT INTO cq_levexp VALUES (0006,357);
INSERT INTO cq_levexp VALUES (0007,523);
INSERT INTO cq_levexp VALUES (0008,765);
INSERT INTO cq_levexp VALUES (0009,1115);
INSERT INTO cq_levexp VALUES (0010,2705);
INSERT INTO cq_levexp VALUES (0011,2841);
INSERT INTO cq_levexp VALUES (0012,3052);
INSERT INTO cq_levexp VALUES (0013,3275);
INSERT INTO cq_levexp VALUES (0014,3511);
INSERT INTO cq_levexp VALUES (0015,2461);
INSERT INTO cq_levexp VALUES (0016,3156);
INSERT INTO cq_levexp VALUES (0017,4213);
INSERT INTO cq_levexp VALUES (0018,5397);
INSERT INTO cq_levexp VALUES (0019,6396);
INSERT INTO cq_levexp VALUES (0020,4712);
INSERT INTO cq_levexp VALUES (0021,6036);
INSERT INTO cq_levexp VALUES (0022,8049);
INSERT INTO cq_levexp VALUES (0023,10300);
INSERT INTO cq_levexp VALUES (0024,12200);
INSERT INTO cq_levexp VALUES (0025,7828);
INSERT INTO cq_levexp VALUES (0026,9996);
INSERT INTO cq_levexp VALUES (0027,13291);
INSERT INTO cq_levexp VALUES (0028,16961);
INSERT INTO cq_levexp VALUES (0029,20034);
INSERT INTO cq_levexp VALUES (0030,12703);
INSERT INTO cq_levexp VALUES (0031,16183);
INSERT INTO cq_levexp VALUES (0032,21470);
INSERT INTO cq_levexp VALUES (0033,27338);
INSERT INTO cq_levexp VALUES (0034,32225);
INSERT INTO cq_levexp VALUES (0035,20031);
INSERT INTO cq_levexp VALUES (0036,25475);
INSERT INTO cq_levexp VALUES (0037,33740);
INSERT INTO cq_levexp VALUES (0038,42892);
INSERT INTO cq_levexp VALUES (0039,50478);
INSERT INTO cq_levexp VALUES (0040,37296);
INSERT INTO cq_levexp VALUES (0041,47367);
INSERT INTO cq_levexp VALUES (0042,62654);
INSERT INTO cq_levexp VALUES (0043,79550);
INSERT INTO cq_levexp VALUES (0044,93507);
INSERT INTO cq_levexp VALUES (0045,58310);
INSERT INTO cq_levexp VALUES (0046,73960);
INSERT INTO cq_levexp VALUES (0047,97707);
INSERT INTO cq_levexp VALUES (0048,123902);
INSERT INTO cq_levexp VALUES (0049,145465);
INSERT INTO cq_levexp VALUES (0050,90536);
INSERT INTO cq_levexp VALUES (0051,114712);
INSERT INTO cq_levexp VALUES (0052,151385);
INSERT INTO cq_levexp VALUES (0053,191773);
INSERT INTO cq_levexp VALUES (0054,224919);
INSERT INTO cq_levexp VALUES (0055,139669);
INSERT INTO cq_levexp VALUES (0056,176805);
INSERT INTO cq_levexp VALUES (0057,233123);
INSERT INTO cq_levexp VALUES (0058,295061);
INSERT INTO cq_levexp VALUES (0059,345764);
INSERT INTO cq_levexp VALUES (0060,223040);
INSERT INTO cq_levexp VALUES (0061,282232);
INSERT INTO cq_levexp VALUES (0062,371987);
INSERT INTO cq_levexp VALUES (0063,470642);
INSERT INTO cq_levexp VALUES (0064,551316);
INSERT INTO cq_levexp VALUES (0065,336936);
INSERT INTO cq_levexp VALUES (0066,426076);
INSERT INTO cq_levexp VALUES (0067,561214);
INSERT INTO cq_levexp VALUES (0068,709603);
INSERT INTO cq_levexp VALUES (0069,830715);
INSERT INTO cq_levexp VALUES (0070,502587);
INSERT INTO cq_levexp VALUES (0071,635204);
INSERT INTO cq_levexp VALUES (0072,836218);
INSERT INTO cq_levexp VALUES (0073,1056753);
INSERT INTO cq_levexp VALUES (0074,1236460);
INSERT INTO cq_levexp VALUES (0075,735967);
INSERT INTO cq_levexp VALUES (0076,929744);
INSERT INTO cq_levexp VALUES (0077,1223418);
INSERT INTO cq_levexp VALUES (0078,1545383);
INSERT INTO cq_levexp VALUES (0079,1807392);
INSERT INTO cq_levexp VALUES (0080,1175412);
INSERT INTO cq_levexp VALUES (0081,1484085);
INSERT INTO cq_levexp VALUES (0082,1951814);
INSERT INTO cq_levexp VALUES (0083,2464176);
INSERT INTO cq_levexp VALUES (0084,2880473);
INSERT INTO cq_levexp VALUES (0085,1655624);
INSERT INTO cq_levexp VALUES (0086,2089765);
INSERT INTO cq_levexp VALUES (0087,2747551);
INSERT INTO cq_levexp VALUES (0088,3467760);
INSERT INTO cq_levexp VALUES (0089,4052400);
INSERT INTO cq_levexp VALUES (0090,2304544);
INSERT INTO cq_levexp VALUES (0091,2908073);
INSERT INTO cq_levexp VALUES (0092,3822426);
INSERT INTO cq_levexp VALUES (0093,4823128);
INSERT INTO cq_levexp VALUES (0094,5634816);
INSERT INTO cq_levexp VALUES (0095,3234913);
INSERT INTO cq_levexp VALUES (0096,4081025);
INSERT INTO cq_levexp VALUES (0097,5362786);
INSERT INTO cq_levexp VALUES (0098,6765013);
INSERT INTO cq_levexp VALUES (0099,7901491);
INSERT INTO cq_levexp VALUES (0100,4518997);
INSERT INTO cq_levexp VALUES (0101,5699613);
INSERT INTO cq_levexp VALUES (0102,7487970);
INSERT INTO cq_levexp VALUES (0103,9443671);
INSERT INTO cq_levexp VALUES (0104,11027591);
INSERT INTO cq_levexp VALUES (0105,6136098);
INSERT INTO cq_levexp VALUES (0106,7737731);
INSERT INTO cq_levexp VALUES (0107,10163682);
INSERT INTO cq_levexp VALUES (0108,12815845);
INSERT INTO cq_levexp VALUES (0109,14962606);
INSERT INTO cq_levexp VALUES (0110,17410153);
INSERT INTO cq_levexp VALUES (0111,19151169);
INSERT INTO cq_levexp VALUES (0112,21066285);
INSERT INTO cq_levexp VALUES (0113,23172914);
INSERT INTO cq_levexp VALUES (0114,25490205);
INSERT INTO cq_levexp VALUES (0115,28039226);
INSERT INTO cq_levexp VALUES (0116,30843149);
INSERT INTO cq_levexp VALUES (0117,33927463);
INSERT INTO cq_levexp VALUES (0118,37320210);
INSERT INTO cq_levexp VALUES (0119,41052231);
INSERT INTO cq_levexp VALUES (0120,45157454);
DROP TABLE IF EXISTS cq_dropitemrule;
CREATE TABLE cq_dropitemrule(
id int unsigned NOT NULL, # 规则组ID
RuleId int unsigned NOT NULL default '0', # 规则ID
Chance int unsigned NOT NULL default '0', # 掉物品概率
Item0 int unsigned NOT NULL default '0', # 以下为此概率可能掉的物品类别ID
Item1 int unsigned NOT NULL default '0',
Item2 int unsigned NOT NULL default '0',
Item3 int unsigned NOT NULL default '0',
Item4 int unsigned NOT NULL default '0',
Item5 int unsigned NOT NULL default '0',
Item6 int unsigned NOT NULL default '0',
Item7 int unsigned NOT NULL default '0',
Item8 int unsigned NOT NULL default '0',
Item9 int unsigned NOT NULL default '0',
Item10 int unsigned NOT NULL default '0',
Item11 int unsigned NOT NULL default '0',
Item12 int unsigned NOT NULL default '0',
Item13 int unsigned NOT NULL default '0',
Item14 int unsigned NOT NULL default '0',
PRIMARY KEY (id, RuleId)
) TYPE=MyISAM;
#
# id=0为默认规则:不掉任何物品的规则——此规则不生效,正常的规则不允许id=0
#
INSERT cq_dropitemrule set id=0, ruleid=0, chance=0;
1) 掉物品规则概率改为精度1/10000,不再采用倒数 [ 提交时间:2003-11-28] [ 完成时间:2003-12-01]
[ 提交时间:2003-12-10 21:59 ]
增加物品追加效果支持;
怪物掉物品追加效果概率分布函数需要寻找更合适的;
关于掉物品/金钱的算法
==========================================================
冷紫龙 2003-11-13
功能要求:
========
1、每种怪都有可能掉某些特定类型的物品,掉每种物品都有特定的概率;
2、怪物掉物品可以有普通、小爆、中爆、大爆等几种方式,具体的每种方式如何掉物品、掉多少物品需要与策划讨论确认
数据库表要求:
============
1、修改cq_monstertype表
1)将drop_money和drop_itemtype字段分别改为:
drop_money_min //所掉金钱的下限
drop_money_max //所掉金钱的上限
★爆怪的时候如果有掉钱,则掉的金钱为正常的1.6倍
2)增加字段
drop_money_chance //掉钱的概率 ——需要确认是否与掉物品一起处理
drop_item_chance //掉物品的概率 掉1个物品
explode_item_chance1 //小爆的概率 掉2 - 5个物品
explode_item_chance2 //中爆的概率 掉6 - 9个物品
explode_item_chance3 //大爆的概率 掉10 - ?个物品
drop_item_rule //掉物品的规则组id
★★掉(爆)物品的数量如何计算?固定值还是某个固定范围内浮动(如上↑)
用于计算掉金钱的概率以及掉多少钱,避免大量的零碎银子产生
drop_item_chance 用于计算是否掉物品,如果drop_item_rule存在并且计算出来掉物品,才执行掉物品函数
drop_item_rule 指向DropItemRule表中的某个规则组
2、增加cq_dropitemrule表
cq_dropitemrule表结构:
---------------------------------------------------------------------------------------------------------
| 字段名 | 类型 | 说明 |
---------------------------------------------------------------------------------------------------------
| id | INT(4) UNSIGNED zerofill NOT NULL | 规则组ID |
| RuleId | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | 规则ID |
| Chance | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0001' | 掉宝概率(1 / Chance) |
| Item0 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | 物品类别id |
| Item1 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item2 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item3 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item4 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item5 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item6 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item7 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item8 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item9 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item10 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item11 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item12 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item13 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
| Item14 | INT(4) UNSIGNED zerofill NOT NULL DEFAULT '0000' | |
---------------------------------------------------------------------------------------------------------
PRIMARYKEY(id, RuleId)
该表中记录了若干组掉物品的规则,cq_monstertype表中每个记录可以对应最多一个规则组,每组规则由若干条规则(记录)组成,每条记录包括掉宝的概率以及最多15个ItemType(若同一种掉宝几率对应的不止15种物品,可以分多条记录保存,处理的时候统一处理)。
★★可以有一个默认的规则组:规则组id=0,不掉任何物品
算法设计:
========
掉物品概率计算:
1、根据monstertype表的drop_item_chance、explode_item_chance1、explode_item_chance2、explode_item_chance3字段值计算是否掉物品、掉几个物品,如果计算结果不掉,或者drop_item_rule不存在,则退出;
2、根据dropitemrule表的Probability字段,按照概率从低到高计算是否掉物品,如果计算出来掉落某条规则的物品,则从该规则的物品列表中随机选择一个,重复以上步骤直到找到足够数量的物品(爆的时候物品数大于1)。
★★按照掉物品的概率从低到高计算,会导致降低高概率物品的实际概率值。
例如:某个规则组有10%和50%两个概率的规则,则50%的规则实际概率为(100 - 10)% * 50% = 45%
内存中规则的存储格式:
应该以规则组id为键存储规则组,每个规则组又分别以规则id存储各自的规则
★★??是否考虑把所有概率相同的规则合并为一条
任务日志系统
====================================================
冷紫龙 2003-11-25
功能:
====
1、记录数据到日志数据库
2、删除指定的日志
3、根据给定条件查询相应的日志
dingwei、查找日志需要指定两个键:id和time,
数据结构:
========
1) 需要记录的数据
日志系统需要记录的数据主要有:id、时间、数据、参数串
各种数据类型:
id INT UNSIGNED OBJID
time DATETIME char [20]
data INT int
param VARCHAR(255) char [255]
2) 数据库结构
CREATE TABLE cq_log (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
logid INT UNSIGNED NOT NULL,
time DATETIME NOT NULL,
data INT NOT NULL,
param VARCHAR(255) NOT NULL,
PRIMARY KEY(id),
INDEX(logid), INDEX(time),
UNIQUE(logid, time)
);
###################################################################
1) 已经完成的CLogData类完全可以通过继承CGameData来实现
2) 还需要一个CLogMap类来管理CLogData。CLogMap并不在创建的时候一次载入所有的LogData,而仅仅在请求一个LogData找不到时才动态从数据库中创建这个LogData。CLogMap类最好能以双键的形式存储,便于以logid+time组合的方式查找,因为id有可能重复不能单独作为键查找。(或者将logid和time组合起来形成一个键?)
###################################################################
关于任务日志系统的设计
==========================================================
冷紫龙 2003-11-15
功能:
====
1、支持多线任务的功能;
1)每个玩家在中都可以领取到若干个任务,这些任务可以并行进行;
2)任务之间可以有依赖关系,如任务B依赖于任务A,则必须完成任务A才可以领取任务B;
cq_task表中增加依赖任务字段(最多可以依赖几个??),可以允许一个任务依赖于多个任务,也允许多个任务依赖于同一个任务,这样整个任务树结构可以分支也可以合并;
2、每个任务执行的进度直接记录在数据库中,而不再依靠身上的物品来判断当前任务执行进度;
由于不必依赖于身上的任务物品来判断任务执行进度,任务系统可以更加灵活
需要解决的问题:
==============
1、玩家完成某个任务后,为了避免重复做任务,或者判断任务的依赖关系,必须保留任务完成的记录,这样导致一个问题是任务记录表的容量会越来越大(不过任务记录表每个记录也仅仅几个int字段而已——如果仅记录任务进度的话,只需要:任务ID、玩家ID、进度三个INT字段)
实现设计:
========
1、在玩家任务记录表cq_usertask中为取得的每个任务记录执行进度
物品类型:
const int ITEMTYPE_CHEST = 30000;
1) 不允许丢弃
[ 修改CItem::IsDiscardable(); OK ]
2) 不允许放入另外一个百宝囊
[ CMsgPackage消息中处理 OK ]
3) 允许存入仓库
4) 不允许交易
[ 修改CItem::IsExchangeEnable(); OK ]
6) 不允许放入摆摊交易
[ 修改CBooth::AddItem OK ]
7) 死亡的时候不会掉
[ 掉物品必须调用CUser:ropItem,根据CItem::IsDiscardable()判断此物品是否能丢弃,因此这里无需修改,因为第一步已经保证了物品不会丢弃。是否还有必要修改CUser::BeKill? ]