首席执行官-CEO
- UID
- 1
- 金叶子
- 6
- 在线时间
- 76 小时
- 注册时间
- 2023-10-27
- 最后登录
- 2024-11-23
|
(1)首先在数据库表wb_monstertype中添加自己定义的怪物。具体参数如下
"id" 204 //怪物ID
"name" "勇敢的骆驼" //怪物名称
"level" "0100" //怪物等级
"profession" "0000"
"attack_range" "0003" //攻击范围
"attack_speed" "0800"
"attack_user" "1" //和平状态,1为不主动攻击,3为主动攻击
"view_range" "0005"
"chase_range" "0018"
"run_speed" "0400"
"life" "122260" //生命
"mana" "0000" //内力
"attack" "2161" //攻击力
"magicAttack" "0000"
"defence" "84850" //防御力
"magicDefence" "84850"
"dodge" "2138"
"hitrate" "0806"
"Crit" "0456"
"though" "2161"
"attadd1" "0000"
"attadd2" "0000"
"attadd3" "0000"
"attadd4" "0000"
"defadd1" "0080"
"defadd2" "0080"
"defadd3" "0080"
"defadd4" "0080"
"drop_money_chance" "0000"
"drop_money_min" "0000"
"drop_money_max" "0000"
"drop_item_rule1" "1090"
"drop_item_rule2" "3090"
"drop_item_rule3" "4002"
"drop_item_rule4" "0000"
"exp" "0480" //杀怪经验
"bosstype" "0000"
"lookface" "0558" //头像图标,在\Resources\Face\文件夹下
"killedaction" "22201" //死亡后动作,比如掉宝,完成任务掉相关物品等;
这里的怪物没有特殊魔法,如果你要定义厉害的怪物,会特殊的魔法,还要修改wb_monstermagic这个表
(2)\Resources\GameData\ModelOffsetXML.swf 中添加怪物的动作图像
在this.modelOffsetEnemy_xml = <Root>r 下面添加一行
n<E Id=""204"" Swf=""935"" Title="" "" X=""112"" Y=""-80"" H=""4""/>r
这里的id与前面怪物id相同,swf表示怪物的动作图像,存放在\Resources\Enemy\下面
(3)在数据库表wb_action中添加自己定义的怪物的动作
"id"; "id_next"; "id_nextfail"; "type"; "data"; "param"
22201 0000 0000 6001 0 monster\monster_204.lua
//重点是将动作代码22201与脚本monster_204.lua联系起来
(4)在服务端的\main\MsgServer\script\monster 下面新建monster_204.lua,定义自己要掉落的物品
具体的代码这里就不详细讲了。
(5)在数据库表wb_generator中把怪物添加到地图上
id 4074 //数据库行编号,按顺序即可
mapid 1088 //地图编号,这里表示摩崖顶
bound_x 140 //怪物的坐标x
bound_y 83 //怪物的坐标y
bound_cx 1
bound_cy 1
rest_type 1
rest_secs 5
max_npc 1 //怪物的数量
max_per_gen 0
npctype 204 //怪物的代码,与自己定义的要一致
timer_begin 0
timer_end 0
init_secs 20
gentype 0
好了,重启服务端进入游戏,
|
|