XP 스크립트

도주 성공확률을 통상도주확률보다 ○○○% 이런식으로 스킬을 만들 수 있습니다.
200%로 하면 통상보다 2배의 확률로 도주성공 ㅎ
저같은 경우에는 통상도주 성공률을 줄인다음에 도적캐릭터한테 이 스킬을 만들어 준다는.;;ㅋ

#--------------------여기서부터
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆도주 스킬 - KGC_EscapeSkill◆
#_/----------------------------------------------------------------------------
#_/ 도주 효과를 가지는 스킬을 작성합니다.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

$imported = {} if $imported == nil
$imported["EscapeSkill"] = true

if $game_special_elements == nil
  $game_special_elements = {}
  $data_system = load_data("Data/System.rxdata")
end
# 도주 스킬 속성
$game_special_elements["skill_escape"] = $data_system.elements.index("도주 스킬")

#==============================================================================
# ■ Scene_Battle (분할 정의 2)
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (파티 커멘드 국면 : 도망친다)
  #--------------------------------------------------------------------------
  alias update_phase2_escape_KGC_EscapeSkill update_phase2_escape
  def update_phase2_escape(skill = nil)
    # 스킬이 아닌 경우는 원래의 처리를 실행
    if skill == nil
      update_phase2_escape_KGC_EscapeSkill
      return
    end

    # 도주할 수 없는 경우는 돌아온다
    return unless $game_temp.battle_can_escape

    # 에너지?-의 민첩함 평균치를 계산
    enemies_agi, enemies_number = 0, 0
    for enemy in $game_troop.enemies
      next unless enemy.exist?
      enemies_agi += enemy.agi
      enemies_number += 1
    end
    enemies_agi /= enemies_number if enemies_number > 0
    # 액터의 민첩함 평균치를 계산
    actors_agi, actors_number = 0, 0
    for actor in $game_party.actors
      next unless actor.exist?
      actors_agi += actor.agi
      actors_number += 1
    end
    actors_agi /= actors_number if actors_number > 0
    # 성공율 계산 (여기서 통상도주성공확률을 계산하실 수 있습니다)
    prob = 50 * actors_agi / [enemies_agi, 1].max
    # 스킬의 경우는 배율을 곱한다
    prob = prob * skill.power / 100 if skill != nil
    # 도주 성공 판정
    success = rand(100) < prob
    # 도주 성공의 경우
    if success
      # 도주 SE (을)를 연주
      $game_system.se_play($data_system.escape_se)
      # 배틀 개시전의 BGM 에 되돌린다
      $game_system.bgm_play($game_temp.map_bgm)
      # 배틀 종료
      battle_end(1)
    # 도주 실패의 경우
    else
      # 돌아온다
      return
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Battle (분할 정의 4)
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (메인 국면 스텝 5 : 데미지 표시)
  #--------------------------------------------------------------------------
  alias update_phase4_step5_KGC_EscapeSkill update_phase4_step5
  def update_phase4_step5
    # 도주 스킬 판정
    if @active_battler.current_action.kind == 1 &&
        @active_battler.current_action.skill_id > 0
      skill = $data_skills[@active_battler.current_action.skill_id]
      if skill.element_set.include?($game_special_elements["skill_escape"])
        # 도주 판정
        update_phase2_escape(skill)
        unless $scene.is_a?(Scene_Battle)
          @phase4_step = 1
          return
        end
      end
    end

    # 원래의 처리를 실행
    update_phase4_step5_KGC_EscapeSkill
  end
end
#--------------끝!!!

※주의
아군전용스킬입니다

사용법
우선 시스템 - 속성에 들어가서 "도주 스킬" 을 만드신후 (띄어쓰기까지 정확히)
스킬에 속성을 세트 하면됩니다. 여기서 스킬의 위력이 확률입니다
위력 200 으로 하면 통상확률의 2배입니다 1000으로 하면 10배 겠죠? ㅎ

참고로 통상도주확률을 변경하시려면 스크립트 51번째줄에 성공확률 계산 이라고 있습니다
그쪽에서 수정

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6203
841 전투 전투 특수효과 DamageEX 스크립트 1 file 백호 2009.02.21 1590
840 기타 특수효과 ElseEX 스크립트 file 백호 2009.02.21 995
839 타이틀/게임오버 타이틀 화면 연출 4 file 백호 2009.02.21 2286
838 전투 전투 속도 조정 스크립트 2 file 백호 2009.02.21 1261
837 기타 전투 승리 BGM+페이드아웃 스크립트 1 file 백호 2009.02.21 1159
836 아이템 아이템 종류별로 분류하는 스크립트 2 file 백호 2009.02.21 1056
835 아이템 아이템 분류별로 나누기 (1) - 밑글과 다른 스크립트 3 file 백호 2009.02.21 1122
834 전투 전투중의 윈도우 전부 투명화 3 file 백호 2009.02.21 1879
833 기타 발소리 스크립트 4 file 백호 2009.02.21 1614
832 스킬 선택 스킬 스크립트 4 file 백호 2009.02.21 1632
831 전투 데미지마루 백호 2009.02.21 1163
830 아이템 아이템 소지수 무제한 1 백호 2009.02.21 887
829 HUD 맵명을 표시하는 스크립트 한글로 번역한것 백호 2009.02.21 1257
828 메시지 메세지플러스3.1v스크립트(얼굴표시,메세지색상,속도등정하는스크립트) 8 백호 2009.02.21 4880
827 메뉴 제가 쓰고있는 메뉴 13 file 백호 2009.02.21 3030
826 파티 파티교환 시스템...이걸로 순서 교체도 가능할 듯... 9 file 백호 2009.02.21 2393
825 기타 CG그림 감상 스크립트 file 백호 2009.02.21 1735
824 오디오 음악감상 스크립트 3 file 백호 2009.02.21 1126
823 메뉴 스테이터스 일람 스크립트 file 백호 2009.02.21 1330
822 메뉴 메뉴 화면 변경 스크립트 file 백호 2009.02.21 2237
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