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 7282
201 스킬 스킬변화를 주는 스크립트 2 백호 2009.02.21 1212
200 기타 [신기술 체험] 빠른 애니매이션 1 file 백호 2009.02.22 1211
199 전투 Steal Script 5.5 by trickster@rmxp.net (SDK호환) file 백호 2009.02.22 1211
» 스킬 KGC - 도주스킬 스크립트 백호 2009.02.22 1210
197 영상 XP에서 AVI파일을 지원가능하게 하는 스크립트 2 백호 2009.02.21 1210
196 기타 Defining Encounter Areas by RPG Advocate (사용법 첨부) file 백호 2009.02.22 1206
195 전투 Advanced Individual Battle Command v2.1 by Trickster@rmxp.org (SDK호환) 1 file 백호 2009.02.22 1203
194 전투 SimpleAction (출처 -RPGXP 포럼 비밀소년님의 자작품) 1 file 백호 2009.02.21 1199
193 장비 장비무기가이드&쉴드방어 1 백호 2009.02.22 1192
192 전투 RTAB 1.15와 애드온 from 歯車の城 4 file 백호 2009.02.22 1191
191 기타 Resolution Changer Ultimate by Zeus81 7 file 습작 2013.05.05 1190
190 기타 Steal Script (SDK Required) file 백호 2009.02.21 1188
189 기타 상점 변동시세 적용 스크립트 3 file 백호 2009.02.21 1187
188 기타 Shift Puzzles v2 by SephirothSpawn (SDK호환) 3 file 백호 2009.02.22 1186
187 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1185
186 이름입력 Advanced Enter Hero Name Window by RPG Advocate 백호 2009.02.22 1184
185 상태/속성 순간 적으로 무적상태되는 스크립트 백호 2009.02.21 1180
184 기타 메세지를 분출해 표시 백호 2009.02.22 1178
183 기타 마우스로 길찾기 스크립트 예제 file 백호 2009.02.21 1175
182 맵/타일 Mode07 0.5 by mewsterus 3 백호 2009.02.22 1174
Board Pagination Prev 1 ... 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 Next
/ 52