i added some commands for an ally System
the new commands are: move_to_enemy = move to the nearest enemy
turn_toward_enemy = turn to the nearest enemy
playershoot(action_id) = shoot only if the actor learn the skill
lowhp_playershoot(action_id,perc) = same with lowhp
playerskills(a,b,c,d,e,f,g,h) = shoot skill a if actor learn skill a else shoot skill b and so on
move_toward_event(id) = move to the event
turn_toward_event(id) = turn to the event
the ID of the actor are the Enemy ID * -1 (actor 1 = Enemy ID -1, actor 5 = Enemy ID -5)
add this to Game_Character 3 Line 235
def move_toward_event(id)
if $game_map.events[id] != nil
sx = @x - $game_map.events[id].x
sy = @y - $game_map.events[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
#--------------------------------------------------------------------------
# * Turn Towards Event
#--------------------------------------------------------------------------
def turn_toward_event(id)
# Get difference in player coordinates
if $game_map.events[id] != nil
sx = @x - $game_map.events[id].x
sy = @y - $game_map.events[id].y
# If coordinates are equal
if sx == 0 and sy == 0
return
end
# If horizontal distance is longer
if sx.abs > sy.abs
# Turn to the right or left towards player
sx > 0 ? turn_left : turn_right
# If vertical distance is longer
else
# Turn up or down towards player
sy > 0 ? turn_up : turn_down
end
end
end
and replace the XAS - SYSTEM with this
http://www.megaupload.com/de/?d=7D9SFVFN