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 6153
29 스킬 SG_Skill Invoking Battle Items by sandgolem (SDK호환) 백호 2009.02.22 894
28 스킬 [KGC] 스킬습득 아이템 2 백호 2009.02.22 1290
27 스킬 SG_Escape Only Skills by sandgolem (SDK호환) 백호 2009.02.22 752
26 스킬 Equipment Skills 2.0 by SephirothSpawn file 백호 2009.02.22 1007
25 스킬 Skill Requirements by SephirothSpawn (SDK호환) file 백호 2009.02.22 763
24 스킬 SG_Skill Break by sandgolem (SDK호환) 백호 2009.02.22 772
23 스킬 Conditional+Conbo Skills 2.0 by trickster 2 file 백호 2009.02.22 1637
22 스킬 [KGC]시간차스킬 스크립트 -일종의 죽음의 선고?- 1 file 백호 2009.02.22 1666
21 스킬 Advanced Mission Skills/Shop/Manager by trickster 3 file 백호 2009.02.22 1601
» 스킬 KGC - 도주스킬 스크립트 백호 2009.02.22 1193
19 스킬 KGC_SkillMessage (스킬사용메세지) 1 file 백호 2009.02.22 2081
18 스킬 KGC_SkillReflection (마법반사) 2 file 백호 2009.02.22 1476
17 스킬 ABP액알 v1.2 스킬추가, 버그수정판 36 file 백호 2009.02.22 6919
16 스킬 KGC_HideNameSkill(명칭 비표시 스킬) 백호 2009.02.22 1122
15 스킬 [RTAB] 스킬영창시간 7 file 백호 2009.02.22 2872
14 스킬 KGC_CrashSkill(자폭스킬) 4 file 백호 2009.02.22 2024
13 스킬 제한시간내 커맨드를 입력해야 스킬이 발동~ 3 file 백호 2009.02.22 2614
12 스킬 스킬 컷인 - 전투시만.. 4 file 허걱 2009.08.16 3298
11 스킬 스킬샵 스크립트 16 file 독도2005 2009.08.24 4219
10 스킬 스킬 레벨 스크립트 # 번역 진행중 6 빗자루씨 2010.02.11 1981
Board Pagination Prev 1 2 3 Next
/ 3