移动范围与移动路径

目录

一、设置移动范围

二、预设移动路径

三、SAI实现路径移动

四、设置移动阵型

举例


一、设置移动范围

creature.movementtype = 1

creature.spawndist = '移动范围'(在此范围内自由移动)

二、预设移动路径

creature.movementtype = 2

creature_addon.path_id = pathid(预设的路径ID),链接 waypoint_data.id

waypoint_data

  • id = pathid
  • point =1,2,3,...
  • position_x,position_y,position_z,orientation (路径点坐标、方位,游戏中用GM账号输入“.gps”获取)
  • delay(前往下一路径点前的等待时间,ms)
  • action(动作ID)
  • action_chance(动作触发的几率)

三、SAI实现路径移动

smart_script

  • event_type
    • 39(SMART_EVENT_WAYPOINT_START)
    • 40(SMART_EVENT_WAYPOINT_REACHED)
    • 55(SMART_EVENT_WAYPOINT_PAUSED)
    • 56(SMART_EVENT_WAYPOINT_RESUMED)
    • 57(SMART_EVENT_WAYPOINT_ENDED)
    • 58(SMART_EVENT_WAYPOINT_STOPPED)
  • action_type
    • 53(SMART_ACTION_WP_START)
    • 54(SMART_ACTION_WP_PAUSE)
    • 55(SMART_ACTION_WP_STOP)

waypoints

  • entry(路径编号,一般与creature的entry一致)
  • pointid = 1,2,3,...
  • position_x,position_y,position_z(路径点坐标,游戏中用“.gps”获取)

四、设置移动阵型

creature_formations

  • leaderGUID(头领creature的GUID)
  • memberGUID(阵型成员的GUID)
  • dist(成员与头领之间的距离)
  • angle(成员与头领间的角度,0-360)

  • groupAI(利用此字段可实现多个生物之间的联动)
ValueBehavior
0Noone assists noone and member don't follow the leader
512Noone assists noone and member follow the leader
1The member aggroes if the leader aggroes
2The leader aggroes if the member aggroes
3Everyone assists everyone and member don't follow the leader
515Everyone assists everyone and member follow the leader

举例

  • 阵型成员的 MovementType 应设置为 0(creature.MovementType)

 (creature_formations 表)

(creature 表)

(creature_addon 表,其中 path_id 链接 waypoints.entry)

相关数据表介绍

waypoint_path | waypoint_path_node (master)

  • MoveType

    • 0:walk
    • 1:run
    • 2:fly
  • Flags
HexName
0x00None
0x01FollowPathBackwardsFromEndToStart
  • Velocity:路线行进速度
  • PathId:链接 creature_template.pathid | creature_addon.pathid
  • NodeId:与早前版本 point 相同,1,2,3...
  • PositionX,Y,Z,O:坐标数据
  • Delay:移动至下一 NodeId 的延迟时间,ms为单位
  • 8
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值