社区服务 统计排行 RSS
  • 2769阅读
  • 0回复
gm研究 离线

级别: 编辑

  • UID8
  • 精华 0
  • 发帖4230
  • 铜币1530 枚
  • 威望0 点
  • 贡献值209 点
  • 银元0 个
  • 好评度0 点
  • 注册时间2019-03-09
  • 最后登录2021-10-16
正序阅读   只看楼主      0楼 发表于: 2019-07-23
更多操作

[技术研究] 御剑江湖如何添加自己的怪物

本帖被 admin 从 |更多|技术 移动到本区(2019-12-29)
这段时间一直在研究御剑,目前基本上摸清楚了相关架构,也成功在单机上同步了官方最新的摩崖顶地图、怪物、任务等。因此就逐步发帖,教大家如何制作自己的怪物、NPC、物品、任务等等,这样大家就可以完全开发有自己特色的服务端了:)。今天这是第一个帖子,先从简单的讲起。


(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=""204"" 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


好了,重启服务端进入游戏
描述
快速回复

如果您在写长篇帖子又不马上发表,建议存为草稿
认证码:

验证问题:
本站网址是? 正确答案:www.wudut.com
 回复后跳转到最后一页