目录
一、设置移动范围
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(利用此字段可实现多个生物之间的联动)
Value | Behavior |
---|---|
0 | Noone assists noone and member don't follow the leader |
512 | Noone assists noone and member follow the leader |
1 | The member aggroes if the leader aggroes |
2 | The leader aggroes if the member aggroes |
3 | Everyone assists everyone and member don't follow the leader |
515 | Everyone assists everyone and member follow the leader |
举例
- 阵型成员的 MovementType 应设置为 0(creature.MovementType)
(creature_formations 表)
(creature 表)
(creature_addon 表,其中 path_id 链接 waypoints.entry)