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 6208
1021 메시지 Taylor's Simple Message System 2000 Alkaid 2020.07.05 250
1020 제작도구 [XP/VX/VXA] Doodad's Editor by newold Alkaid 2020.07.12 391
1019 이름입력 한글조합입력기(영어가능) file 조규진1 2019.11.10 513
1018 전투 전투중에 장비들 교체하기 file 레이스89 2017.08.19 601
1017 기타 [All RGSS] FileTest (Unicode) file Cheapmunk 2014.12.29 615
1016 맵/타일 맵연결 스크립트 (데모첨부) file 게임애호가 2018.06.15 698
1015 기타 에어리어 설정 by RPG Advocate 백호 2009.02.22 710
1014 기타 Boat Script 백호 2009.02.21 729
1013 기타 Localization by ForeverZer0, KK20 습작 2013.04.26 739
1012 기타 Materia System file 백호 2009.02.21 749
1011 기타 Real-Time Day Night 3 백호 2009.02.22 751
1010 스킬 SG_Escape Only Skills by sandgolem (SDK호환) 백호 2009.02.22 753
1009 기타 killer님 요청하신 스크립트 두번째입니다. 나뚜루 2009.02.21 759
1008 기타 Letter by Letter Message Window by slipknot@rmxp.org (SDK호환) 1 file 백호 2009.02.22 760
1007 기타 Advanced Gold display by Dubealex 1 백호 2009.02.22 761
1006 스킬 Skill Requirements by SephirothSpawn (SDK호환) file 백호 2009.02.22 763
1005 기타 Sphere Grid System file 백호 2009.02.21 765
1004 기타 AMS-Advanced Message Script Edited by Dubleax 3 file 백호 2009.02.21 766
1003 스킬 SG_Skill Break by sandgolem (SDK호환) 백호 2009.02.22 772
1002 기타 Activation_system file 백호 2009.02.22 775
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