| 
 
| 赞 | 0 |  
| VIP | 157 |  
| 好人卡 | 6 |  
| 积分 | 1 |  
| 经验 | 113829 |  
| 最后登录 | 2014-1-16 |  
| 在线时间 | 26 小时 |  
 Lv1.梦旅人 B 
	梦石0 星屑50 在线时间26 小时注册时间2007-8-26帖子3693 | 
| 只需稍作修改即可。 使用方法:自定义路线 - 脚本 - move_toward_event(事件编号)复制代码class Game_Character
  def move_toward_event(event_id)
    sx = @x - $game_map.events[event_id].x
    sy = @y - $game_map.events[event_id].y
    if sx == 0 and sy == 0
      return
    end
    abs_sx = sx.abs
    abs_sy = sy.abs
    if abs_sx == abs_sy
      rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
    end
    if abs_sx > abs_sy
      sx > 0 ? move_left : move_right
      if not moving? and sy != 0
        sy > 0 ? move_up : move_down
      end
    else
      sy > 0 ? move_up : move_down
      if not moving? and sx != 0
        sx > 0 ? move_left : move_right
      end
    end
  end
end
 | 
 评分
查看全部评分
 |