XP 스크립트

#==============================================================================
# ■ My_AcR_Base
#------------------------------------------------------------------------------
#  액알을 위한 static 클래스
#                                                coded by Bimilist
#==============================================================================
class My_AcR_Base
  #--------------------------------------------------------------------------
  # ● 타겟이 1칸 이내라면 공격!
  #--------------------------------------------------------------------------
  def self.AttackShort(event, target, damage, delay)
    if self.Distance(event, target) == 1
      self.Damage(target, damage)
      target.animation_id = 4
      event.wait_count = (delay * 40).to_i
    end
  end
  #--------------------------------------------------------------------------
  # ● 모든 적을 반환!
  #--------------------------------------------------------------------------
  def self.iterate_enemy(event)
    for target in $game_map.events.values
      if target.AcR and not target.erased and event.team != target.team and target.hp > 0
        yield target
      end
    end
    target = $game_player
    if event.team != target.team
      yield target
    end
  end
  #--------------------------------------------------------------------------
  # ● 거리를 구한다
  #--------------------------------------------------------------------------
  def self.Distance(event, target)
    return (event.x - target.x).abs + (event.y - target.y).abs
  end
  #--------------------------------------------------------------------------
  # ● 이벤트에게 데미지를 준다
  #--------------------------------------------------------------------------
  def self.Damage(target, damage)
    target.hp -= damage
    if target == $game_player
      $game_temp.gameover = $game_party.all_dead?
    end
    if target.team == 1
      self.Gauge(1, target)
    else
      if target.hp != 0 or target.gold == 0
        self.Gauge(2, target)
      else
        target.animation_id = 1
        self.Gauge(1, nil, "exp + " + target.exp.to_s)
        self.Gauge(2, nil, "gold + " + target.gold.to_s)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 게이지를 보인다
  #--------------------------------------------------------------------------
  def self.Gauge(team = 1, target = $game_player, txt = nil)
    if team == nil
      if $my_wnd_guage != nil and not $my_wnd_guage.disposed?
        $my_wnd_guage.dispose
      end
      if $my_wnd_guage2 != nil and not $my_wnd_guage2.disposed?
        $my_wnd_guage2.dispose
      end
    end
    if team == 1
      if $my_wnd_guage == nil or $my_wnd_guage.disposed?
        $my_wnd_guage = My_Wnd_Gauge.new
        $my_wnd_guage.x = 640 - $my_wnd_guage.width
        $my_wnd_guage.y = 0
        $my_wnd_guage.back_opacity = 160
      end
      if txt == nil
        $my_wnd_guage.hp(target)
      else
        $my_wnd_guage.txt(txt)
      end
    end
    if team == 2
      if $my_wnd_guage2 == nil or $my_wnd_guage2.disposed?
        $my_wnd_guage2 = My_Wnd_Gauge.new
        $my_wnd_guage2.x = 640 - $my_wnd_guage2.width
        $my_wnd_guage2.y = 64
        $my_wnd_guage2.back_opacity = 160
      end
      if txt == nil
        $my_wnd_guage2.hp(target)
      else
        $my_wnd_guage2.txt(txt)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 살아있는 사람을 리더로
  #--------------------------------------------------------------------------
  def self.FocusAlive
    for i in 0..($game_party.actors.size - 1)
      if $game_party.actors[0].hp == 0
        self.PartyRotate
      end
    end
  end
  def self.FocusAliveBackward
    for i in 0..($game_party.actors.size - 1)
      if $game_party.actors[0].hp == 0
        self.PartyRotateBackward
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 파티를 돌린다
  #--------------------------------------------------------------------------
  def self.PartyRotate
    if $game_party.actors.size >= 2
      actor = $game_party.actors[0]
      for i in 0..($game_party.actors.size - 2)
        $game_party.actors[i] = $game_party.actors[i + 1]
      end
      $game_party.actors[$game_party.actors.size - 1] = actor
      $game_player.refresh
    end
  end
  def self.PartyRotateBackward
    if $game_party.actors.size >= 2
      actor = $game_party.actors[$game_party.actors.size - 1]
      for i in 0..($game_party.actors.size - 2)
        j = $game_party.actors.size - 2 - i
        $game_party.actors[j + 1] = $game_party.actors[j]
      end
      $game_party.actors[0] = actor
      $game_player.refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 팀의 남은 사람수 가져오기
  #--------------------------------------------------------------------------
  def self.Team_Alive(team)
    alive = 0
    for target in $game_map.events.values
      if target.AcR and not target.erased and target.team == team
        alive += 1
      end
    end
    return alive
  end
  #--------------------------------------------------------------------------
  # ● 리더 ID 가져오기
  #--------------------------------------------------------------------------
  def self.get_leader_id
    return $game_party.actors[0].id
  end
  #--------------------------------------------------------------------------
  # ● 밀치기
  #--------------------------------------------------------------------------
  def self.move_route_push(target, direction)
    move_route = RPG::MoveRoute.new
    move_route.list = [
      RPG::MoveCommand.new(29, [3]),
      RPG::MoveCommand.new(35),
      RPG::MoveCommand.new(direction / 2),
      RPG::MoveCommand.new(36),
      RPG::MoveCommand.new(29, [target.move_speed]),
      RPG::MoveCommand.new,
      RPG::MoveCommand.new
    ]
    move_route.repeat = false
    move_route.skippable = true
    target.force_move_route(move_route)
  end
  #--------------------------------------------------------------------------
  # ● 랜덤이동하며 주인공을 감지한다.
  #--------------------------------------------------------------------------
  def self.move_route_field(target, distance = 4, cmd = "My_AcR.WeaponPunch(self)")
    move_route = RPG::MoveRoute.new
    move_route.list = []
    move_route.list.push(RPG::MoveCommand.new(45, ["My_AcR.SenseDeath(self)"]))
    move_route.list.push(RPG::MoveCommand.new(9))
    move_route.list.push(RPG::MoveCommand.new(15, [20]))
    txt = "My_AcR.SensePlayer(self, " + distance.to_s + ", "" + cmd + "")"
    move_route.list.push(RPG::MoveCommand.new(45, [txt]))
    move_route.list.push(RPG::MoveCommand.new)
    move_route.list.push(RPG::MoveCommand.new)
    move_route.repeat = true
    move_route.skippable = true
    target.force_move_route(move_route)
  end
  #--------------------------------------------------------------------------
  # ● 주인공을 감지한다.
  #--------------------------------------------------------------------------
  def self.SensePlayer(target, distance, cmd)
    if My_AcR.Distance(target, $game_player) > distance
      return
    end
    move_route = RPG::MoveRoute.new
    move_route.list = []
    move_route.list.push(RPG::MoveCommand.new(45, ["My_AcR.SenseDeath(self)"]))
    move_route.list.push(RPG::MoveCommand.new(25))
    move_route.list.push(RPG::MoveCommand.new(45, [cmd]))
    move_route.list.push(RPG::MoveCommand.new(10))
    move_route.list.push(RPG::MoveCommand.new)
    move_route.list.push(RPG::MoveCommand.new)
    move_route.repeat = true
    move_route.skippable = true
    target.force_move_route(move_route)
  end
  #--------------------------------------------------------------------------
  # ● XP의 버그에 대항하기 위해 삭제되면 동작을 멈춘다
  #--------------------------------------------------------------------------
  def self.SenseDeath(target)
    if target.erased
      My_AcR.move_route_stop(target)
    end
  end
  def self.move_route_stop(target)
    move_route = RPG::MoveRoute.new
    move_route.list = []
    move_route.list.push(RPG::MoveCommand.new)
    move_route.list.push(RPG::MoveCommand.new)
    move_route.repeat = false
    move_route.skippable = true
    target.force_move_route(move_route)
  end
  #--------------------------------------------------------------------------
  # ● 일반적인 펀치! - 1칸 앞의 적에게 데미지
  #--------------------------------------------------------------------------
  def self.WeaponPunch(event, delay = 1.0)
    x = event.x + event.vx
    y = event.y + event.vy
    My_AcR.iterate_enemy(event) do |target|
      if target.x == x and target.y == y
        My_AcR.Damage(target, [event.atk - target.pdef, 0].max)
        target.animation_id = 4
        event.wait_count = (delay * 40).to_i
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 밀치기 칼질 - 근거리 적에게 데미지 + 밀치기
  #--------------------------------------------------------------------------
  def self.WeaponSword(event, delay = 1.0)
    x = event.x + event.vx
    y = event.y + event.vy
    My_AcR.iterate_enemy(event) do |target|
      if target.x == x and target.y == y
        My_AcR.Damage(target, [event.atk - target.pdef, 0].max)
        target.animation_id = 4
        move_route_push(target, event.direction)
        event.wait_count = (delay * 40).to_i
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 일반적인 화살 방아쇠 - 화살을 발싸시킨다.
  #--------------------------------------------------------------------------
  def self.TriggerArrow(owner, arrow, delay = 1.0)
    owner.wait_count = (delay * 40).to_i
    arrow.moveto(owner.x, owner.y)
    arrow.direction = owner.direction
    arrow.AcR = false
    arrow.AcR = true
    arrow.team = owner.team
    arrow.atk = owner.atk
    arrow.unerase
  end
  #--------------------------------------------------------------------------
  # ● 폰을 위한 총쏘기 기술
  #--------------------------------------------------------------------------
  def self.TriggerArrow4Pon(owner, arrow, direction)
    arrow.moveto(owner.x, owner.y)
    arrow.direction = direction
    arrow.AcR = false
    arrow.AcR = true
    arrow.team = owner.team
    arrow.atk = owner.atk
    arrow.unerase
  end
  #--------------------------------------------------------------------------
  # ● 일반적인 화살 - 화살과 겹쳐지는 적을 해치운 뒤 소멸 (일시 삭제)
  #--------------------------------------------------------------------------
  def self.MoveArrow(event)
    if event.AcR == false
      event.erase
    else
      My_AcR.iterate_enemy(event) do |target|
        if target.x == event.x and target.y == event.y
          self.Damage(target, [event.atk - target.pdef, 0].max)
          target.animation_id = 4
          event.erase
        end
      end
      event.move_forward
      if not event.moving?
        event.erase
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 레드의 단검치기
  #--------------------------------------------------------------------------
  def self.WeaponWeakPunch(event, delay = 1.0)
    x = event.x + event.vx
    y = event.y + event.vy
    My_AcR.iterate_enemy(event) do |target|
      if target.x == x and target.y == y
        My_AcR.Damage(target, [(event.atk / 10).to_i - target.pdef, 0].max)
        target.animation_id = 4
        event.wait_count = (delay * 40).to_i
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 레드의 단검치기 - 길찾아가기
  #--------------------------------------------------------------------------
  def self.move_route_red_attack(event)
    # find path and move
    move_route = RPG::MoveRoute.new
    move_route.list = []
    move_route.list.push(RPG::MoveCommand.new(45, ["My_AcR.WeaponWeakPunch(self, 0.2)"]))
    move_route.list.push (RPG::MoveCommand.new(37))
    move_route.list.push (RPG::MoveCommand.new(29, [5]))
    success = self.find_nearest_enemy(event, move_route.list)
    if not success
      # self.move_route_jumpto(event, x, y)
      return
    end
    move_route.list.push (RPG::MoveCommand.new(29, [3]))
    if not event.through
      move_route.list.push (RPG::MoveCommand.new(38))
    end
    move_route.list.push(RPG::MoveCommand.new)
    move_route.list.push(RPG::MoveCommand.new)
    move_route.repeat = false
    move_route.skippable = false
    event.force_move_route(move_route)
  end
  #가장 가까운 적을 찾아내어 그와의 이동루트를 계산
  def self.find_nearest_enemy(event, move_route_list)
    #먼저 맵을 클리어
    map = []
    for i in 1 .. $game_map.height + 1
      map.push []
    end
    #적들을 표시
    no_enemy = true
    My_AcR.iterate_enemy(event) do |enemy|
      map[enemy.y][enemy.x] = -1
      no_enemy = false
    end
    if no_enemy
      return false
    end
    #끝에서부터 시작까지 선을 잇는다.
    stack = []
    x = event.x
    y = event.y
    stack.push [x, y, 2]
    stack.push [x, y, 4]
    stack.push [x, y, 6]
    stack.push [x, y, 8]
    i = -1
    found = false
    while i < stack.size - 1 and not found
      i += 1
      x = stack[i][0]
      y = stack[i][1]
      d = stack[i][2]
      vx = (d == 6 ?  1 : d == 4 ?  -1 : 0)
      vy = (d == 2 ?  1 : d == 8 ?  -1 : 0)
      if map[y + vy][x + vx] == -1
        ex = x
        ey = y
        ed = d
        found = true
        next
      end
      if not event.passable?(x, y, d)
        next
      end
      x += vx
      y += vy
      if map[y][x] != nil
        next
      end
      map[y][x] = 10 - d
      stack.push([x, y, 2])
      stack.push([x, y, 4])
      stack.push([x, y, 6])
      stack.push([x, y, 8])
    end
    if not found
      return false
    end
    success = find_path(event, event.x, event.y, ex, ey, move_route_list)
    if success
      case ed
      when 2
        move_route_list.push (RPG::MoveCommand.new(16))
      when 4
        move_route_list.push (RPG::MoveCommand.new(17))
      when 6
        move_route_list.push (RPG::MoveCommand.new(18))
      when 8
        move_route_list.push (RPG::MoveCommand.new(19))
      end
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ● 길찾기 알고리즘 방향추가버젼
  #--------------------------------------------------------------------------
  def self.move_route_moveto2(target, x, y, direction)
    move_route = RPG::MoveRoute.new
    move_route.list = []
    move_route.list.push (RPG::MoveCommand.new(37))
    success = self.find_path(target, target.x, target.y, x, y, move_route.list)
    if not success
      self.move_route_jumpto(target, x, y)
      return
    end
    if not target.through
      move_route.list.push (RPG::MoveCommand.new(38))
    end
    case direction
    when 2
      move_route.list.push (RPG::MoveCommand.new(16))
    when 4
      move_route.list.push (RPG::MoveCommand.new(17))
    when 6
      move_route.list.push (RPG::MoveCommand.new(18))
    when 8
      move_route.list.push (RPG::MoveCommand.new(19))
    end
    move_route.list.push(RPG::MoveCommand.new)
    move_route.list.push(RPG::MoveCommand.new)
    move_route.repeat = false
    move_route.skippable = false
    target.force_move_route(move_route)
  end
  #--------------------------------------------------------------------------
  # ● 길찾기 알고리즘 이벤트로 이동버젼
  #--------------------------------------------------------------------------
  def self.move_route_moveto_target(event, target)
    if target.passable?(target.x - target.vx, target.y - target.vy, 10 - target.direction)
      move_route_moveto2(event, target.x - target.vx, target.y - target.vy, 10 - target.direction)
    end
  end
  #--------------------------------------------------------------------------
  # ● 지정 위치로 점프한다
  #--------------------------------------------------------------------------
  def self.move_route_jumpto2(target, x, y, direction)
    move_route = RPG::MoveRoute.new
    move_route.list = []
    move_route.list.push (RPG::MoveCommand.new(37))
    move_route.list.push (RPG::MoveCommand.new(14, [x - target.x, y - target.y]))
    if not target.through
      move_route.list.push (RPG::MoveCommand.new(38))
    end
    case direction
    when 2
      move_route.list.push (RPG::MoveCommand.new(16))
    when 4
      move_route.list.push (RPG::MoveCommand.new(17))
    when 6
      move_route.list.push (RPG::MoveCommand.new(18))
    when 8
      move_route.list.push (RPG::MoveCommand.new(19))
    end
    move_route.list.push(RPG::MoveCommand.new)
    move_route.list.push(RPG::MoveCommand.new)
    move_route.repeat = false
    move_route.skippable = false
    target.force_move_route(move_route)
  end
  #--------------------------------------------------------------------------
  # ● 유진의 전체공격.
  #--------------------------------------------------------------------------
  def self.WeaponSound(event, delay = 10.0)
    x = event.x + event.vx
    y = event.y + event.vy
    My_AcR.iterate_enemy(event) do |target|
      My_AcR.Damage(target, [event.atk - target.pdef, 0].max)
      target.animation_id = 4
      event.wait_count = (delay * 40).to_i
    end
  end
  #--------------------------------------------------------------------------
  # ● 연타공격
  #--------------------------------------------------------------------------
  def self.WeaponPunchHalf(event, delay = 0.0)
    x = event.x + event.vx
    y = event.y + event.vy
    My_AcR.iterate_enemy(event) do |target|
      if target.x == x and target.y == y
        My_AcR.Damage(target, [event.atk / 2 - target.pdef, 0].max)
        target.animation_id = 4
        event.wait_count = (delay * 40).to_i
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 거검공격
  #--------------------------------------------------------------------------
  def self.WeaponSwordDouble(event, delay = 3.0)
    x = event.x + event.vx
    y = event.y + event.vy
    My_AcR.iterate_enemy(event) do |target|
      if target.x == x and target.y == y
        My_AcR.Damage(target, [event.atk * 2 - target.pdef, 0].max)
        target.animation_id = 4
        move_route_push(target, event.direction)
        event.wait_count = (delay * 40).to_i
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 일반적인 화살 방아쇠 - 화살을 발싸시킨다.
  #--------------------------------------------------------------------------
  def self.TriggerArrowHalf(owner, arrow, delay = 1.0)
    owner.wait_count = (delay * 40).to_i
    arrow.moveto(owner.x, owner.y)
    arrow.direction = owner.direction
    arrow.AcR = false
    arrow.AcR = true
    arrow.team = owner.team
    arrow.atk = owner.atk / 2
    arrow.unerase
  end
end


===============================================

창도에서 퍼왔고요

사용법은 비밀님이 공개를 하지않았음

그럼 잘쓰세요

이거 검구4에서 쓰던 액알
Comment '24'
  • ?
    리안 2009.02.26 16:08
    고마워요
  • ?
    김옥인 2009.03.08 21:11
    감사합니다 ㅋ
  • ?
    용호작무 2009.08.08 12:24

    감사합니다! 되는지는 실행해봐야 겠지만...

     

    (+) 역시 전 오류뜨네요ㅜ 흑흑 액알을 또 찾아봐야 하는건가

  • ?
    rpg처음 2010.01.29 20:04

    저도좀여

     

  • ?
    Toast 2011.01.15 12:41

    나도 알려주세요

  • ?
    누군가 2010.01.08 10:34

    오!!! 용호작무님 제가 스크립트없이 이벤트로 엑알 만드는 방법알려드릴까요?

  • ?
    김병성 2009.08.09 11:11

    아 거참 비밀소년이란분 천재적인 실력을가진건 분명한데

    다같이좀 좋은거있으면 나누고좀 그러지 좋은거는 자기만 다하려고하네.

    수정도 못하게하고 왜그러지 좀다같이 나눠주면서 배포하면 후달리나?

  • ?
    ToRoTo 2009.08.10 12:29

    김병성님.. 말씀이 지나치시네요

    그럼 님이지닌 돈이나 물건들 다 아프리카에 뿌리고 올 수도있나요?

     

    아니면 님이 죽어라 열심히 써놓은 논문이나 보고서 뭐 그런거 그냥 회사원끼리 공유할 수 있나요?

     

  • ?
    동훈이 2010.01.07 22:23

    맞아

  • ?
    아방스마니아 2010.01.08 13:14

    그렇지만 비밀소년님이 스크립트를 공개유포한다는건 스크립트계의 발전을 촉진시키는것이니

    아프리카에돈뿌리는얘기하고는 다르죠.. 공개유포하면 어차피 비밀소년님도 이익을 당연히 보게될 체계인데

  • ?
    프라미 2010.10.07 02:22

    유포도 맞는말입니다 모르면 입방정 떨지마세요 천둥벌거숭이마냥 뭐하는 짓입니까 ...

  • ?
    유피 2010.01.12 16:43

    공개유포가 아니고 공개배포구요^^

    사실 자기가 열심히 만든 스크립트를 남한테 그냥 배포하는건, 좀 무리가 있죠

  • ?
    서울냥이 2010.01.09 16:31

    돈주고팔란예기 ㄷㄷ

  • ?
    매냐 2010.01.09 23:27

    어떻게 사용하죠 ?..

  • ?
    옹알이 2010.02.11 17:40

    와 대단하시네요 ㅋㅋㅋ

     

  • ?
    수호류 2010.02.24 12:11

    대단해요~

  • ?
    Fiting tree 2010.02.26 12:15

  • ?
    불량유저 2010.03.09 21:11

    굳 요기잇네요

  • ?
    홈버스트집사 2010.07.22 11:41

    오홋 어떻게하는지는 모르겠지만 ㄳ

  • profile
    I Like Sirooni 2010.07.24 11:00

    헐 액알스크립트를 이렇게 쉽게넘겨주다니.

  • ?
    캉쿤 2011.09.10 14:59

    에휴 안돼네요..

  • ?
    레어닉네임 2011.09.18 17:39

    사용법만알면좋을텐데 말이죠..

  • ?
    아트하우스 2011.11.10 17:27

    //김병성

    그건 비밀소년님 마음임 ㅌㅋㅋㅋㅋㅋ

  • ?
    액알알려주세요ㅠㅠ 2012.04.28 18:51

    고맙습니다.


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 5440
1022 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11626
1021 온라인 채팅 가능 온라인 스크립트 배포 107 file 아방스 2009.01.03 10569
1020 온라인 RPG 만들기 xp 온라인 스크립트 33 아방스 2007.11.09 9390
1019 맵/타일 [유니크급] RPG XP 게임을 3D화로 보자! Neo Mode7 script / 52 file 쉴더 2009.02.28 9311
1018 온라인 광넷[ 광땡 온라인 + 넷플레이 ] 62 - 하늘 - 2009.08.02 8874
1017 전투 [액알]neo_a-rpg_module_1[1][1].2 스크립트 83 file 은빛바람 2009.10.03 8224
1016 온라인 온라인 스크립트 Unis Net RMXP 공식 배포! 24 file 뮤바보 2011.12.25 8196
1015 온라인 넷플레이1.7.0+abs5.5+한챗 50 쀍뛝쒧 2009.01.24 7216
1014 이름입력 대화창에 얼굴, 이름 띄우기 37 킬라롯 2008.11.09 7106
1013 메시지 대화창에 얼굴 그래픽 띠우기 73 아방스 2007.11.09 7016
1012 메뉴 메이플스토리처럼 메뉴를^^ 57 file 딸기님 2010.07.13 6942
1011 스킬 ABP액알 v1.2 스킬추가, 버그수정판 36 file 백호 2009.02.22 6865
1010 전투 [신기술 체험] 강회된 횡스크롤 액알 13 file 백호 2009.02.22 6769
1009 메뉴 온라인메뉴처럼!! 메이플 메뉴처럼!! 변신~스크립트 34 WMN 2008.03.17 6765
1008 그래픽 화면을 부드럽게 해주는스크립트[ 아주 유용] 56 file - 하늘 - 2009.08.05 6448
1007 온라인 Mr.Metring NPE 1.0 [RPG XP 온라인 스크립트] 35 아방스 2009.01.07 6367
1006 이름입력 케릭터 위에 또는 NPC 위에 이름 뛰우기 [헬악이님 제공] 49 file 아방스 2007.11.09 6311
» 전투 액알 스크립트 24 백호 2009.02.22 5924
1004 HUD 주인공,NPC이름 머리 나타내기 49 file 송긔 2010.11.28 5893
1003 전투 ABS_v3액션 알피지 46 file 알피지GM 2010.03.07 5726
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52