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 6202
841 기타 Complete Climate and Time System 1.2 by ForeverZer0 1 Alkaid 2010.09.17 1315
840 액터 Actor Customization 6.0.2 by Synthesize 4 file Alkaid 2010.09.17 1912
839 그래픽 MAWS: Modified Advanced Weather Script 1.2 by Agckuu Coceg 2 file Alkaid 2010.09.13 1969
838 메뉴 L's Custom Menu #3: 1인용 메뉴 Revision 1 3 Alkaid 2010.09.12 2363
837 저장 Advanced Save Menu 편집한 것. (SDK2용) Alkaid 2010.09.11 1219
836 HUD MOG_Active_Hud 3 file Bera 2010.09.11 2468
835 HUD MOG_C_HUD. 6 file Bera 2010.09.11 2333
834 액터 크리쳐 합체, 'SW_CreatureMix(for_rmxp)' by SiotWarrior 21 file 시옷전사 2010.09.11 2781
833 메뉴 L's Custom Menu #4: 'Compact' (SDK 2.x 필수) Alkaid 2010.09.11 1758
832 전투 Minkoff's Animated Battlers - Enhanced 13.2 by DerVVulfman Alkaid 2010.09.10 1687
831 전투 CTB by Charlie Fleed 3.1 - FF10 스타일의 전투시스템 6 Alkaid 2010.09.10 2975
830 전투 Mr. Mo's ABS 5.5 13 Alkaid 2010.09.10 3459
829 전투 DerVVulfman's addons for Mr.Mo's ABS file Alkaid 2010.09.10 1645
828 메시지 Hermes(Hermes Extends RPGXP Message System) 0.3d by derula Alkaid 2010.09.10 2025
827 아이템 Categorized Items Menu 1.3 by albertfish 1 file Alkaid 2010.09.09 1798
826 기타 간단한 Scene_Base Alkaid 2010.09.09 1394
825 메뉴 Ring menu edit (Non-SDK ver.) Alkaid 2010.09.08 1547
824 메뉴 Ring menu edit for SDK2 (Original by Hypershadow180) file Alkaid 2010.09.08 1376
823 메시지 Universal Message System 1.8.0 by ccoa 1 file Alkaid 2010.09.08 2185
822 그래픽 Weather Script(버전 불명) by ccoa 1 file Alkaid 2010.09.08 1572
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