XP 스크립트

통상 공격하면, 일정 확률로 스킬이 발동하는 무기를 작성합니다.
발동하는 스킬·확률은 무기 마다 설정할 수 있어 발동해도 SP는 줄어 들지 않습니다.

사용법1

무기명에 [MW{ID},{확률}] (을)를 추가합니다.
예를 들면 「 10% 의 확률로 ID:20 의 스킬을 발동시킨다」경우는
무기명[MW20,10]
됩니다.

사용법2

속성 마법검 (을)를 만들어, 무기로 세트 합니다.
그리고는 무기의[민첩함+]%의 확률로 ID:[손재주가 있음+]의 스킬이 발동합니다.

예를 들면, 10% 의 확률로 ID:20 의 스킬을 발동시키고 싶은 경우는,
[손재주가 있음+] 20
[민첩함+] 10
(이)라고 입력합니다.
 
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆마법검 - KGC_MagicWeapon◆
#_/----------------------------------------------------------------------------
#_/ 통상 공격시에 일정 확률로 스킬이 발동하는 무기를 작성합니다.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

$imported["MagicWeapon"] = true

# 마법검용 속성
$game_special_elements["magic_weapon"] = $data_system.elements.index("魔法?")

#==============================================================================
# ■ RPG::Weapon
#==============================================================================

class RPG::Weapon
  #--------------------------------------------------------------------------
  # ● 이름 취득
  #--------------------------------------------------------------------------
  def name
    return @name.gsub(/[.*]/) {""}
  end
  #--------------------------------------------------------------------------
  # ● 발동 스킬 취득
  #--------------------------------------------------------------------------
  def exec_skill
    if @name =~ /[MW[ ]*([0-9]+)[ ]*,[ ]*([0-9]+)]/i
      return [$1.to_i, $2.to_i]
    elsif @element_set.include?($game_special_elements["magic_weapon"])
      return [@dex_plus, @agi_plus]
    else
      return nil
    end
  end
end

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

#==============================================================================
# ■ Game_Battler (분할 정의 1)
#------------------------------------------------------------------------------
#  버틀러를 취급하는 클래스입니다.이 클래스는 Game_Actor 클래스와 Game_Enemy 곳간
# 스의 슈퍼 클래스로서 사용됩니다.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # ● 공개 인스턴스 변수
  #--------------------------------------------------------------------------
  attr_accessor :magic_weapon            # 마법검발동 플래그
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  alias initialize_KGC_MagicWeapon initialize
  def initialize
    # 원래의 처리를 실행
    initialize_KGC_MagicWeapon

    @magic_weapon = false
  end
end

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

#==============================================================================
# ■ Scene_Battle (분할 정의 3)
#------------------------------------------------------------------------------
#  배틀 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (액터 커멘드 국면)
  #--------------------------------------------------------------------------
  alias update_phase3_KGC_MagicWeapon update_phase3
  def update_phase3
    # 마법검발동 플래그 해제
    @active_battler.magic_weapon = false if @active_battler.magic_weapon

    # 원래의 처리를 실행
    update_phase3_KGC_MagicWeapon
  end
end

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

#==============================================================================
# ■ Scene_Battle (분할 정의 4)
#------------------------------------------------------------------------------
#  배틀 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (메인 국면 스텝 2 : 액션 개시)
  #--------------------------------------------------------------------------
  alias update_phase4_step2_KGC_MagicWeapon update_phase4_step2
  def update_phase4_step2
    # 원래의 처리를 실행
    update_phase4_step2_KGC_MagicWeapon

    # 마법검발동의 경우
    if @magic_weapon
      @phase4_step = 2
      @magic_weapon = false
    end
  end
  #--------------------------------------------------------------------------
  # ● 기본 액션 결과 작성
  #--------------------------------------------------------------------------
  alias make_basic_action_result_KGC_MagicWeapon make_basic_action_result
  def make_basic_action_result
    # 마법검발동 플래그 해제
    @active_battler.magic_weapon = false

    # 행동측 버틀러가 액터, 행동이 통상 공격의 경우
    if @active_battler.is_a?(Game_Actor) &&
        @active_battler.current_action.basic == 0
      # 마법검의 경우
      weapon = $data_weapons[@active_battler.weapon_id]
      if weapon != nil && weapon.exec_skill != nil
        # 공격 대상 설정
        if @active_battler.restriction == 3
          target = $game_party.random_target_actor
        elsif @active_battler.restriction == 2
          target = $game_troop.random_target_enemy
        else
          index = @active_battler.current_action.target_index
          target = $game_troop.smooth_target_enemy(index)
        end
        # ?動判定
        if rand(100) < weapon.exec_skill[1]
          # アクションを設定
          @active_battler.current_action.kind = 1
          @active_battler.current_action.skill_id = weapon.exec_skill[0]
          # 魔法??動フラグを立てる
          @active_battler.magic_weapon = true
          # 魔法??動
          @magic_weapon = true
          # ?る
          return
        end
      end
    end

    # 元の?理を?行
    make_basic_action_result_KGC_MagicWeapon
  end
  #--------------------------------------------------------------------------
  # ● スキルアクション 結果作成
  #--------------------------------------------------------------------------
  alias make_skill_action_result_KGC_MagicWeapon make_skill_action_result
  def make_skill_action_result
    # 行動者がアクタ?、魔法??動、かつ?制アクションでなければ
    if @active_battler.is_a?(Game_Actor) && @active_battler.magic_weapon &&
        !@active_battler.current_action.forcing
      # 魔法??動フラグ解除
      @active_battler.magic_weapon = false
      # スキルを取得
      @skill = $data_skills[@active_battler.current_action.skill_id]
      # ステ?タスウィンドウをリフレッシュ
      @status_window.refresh
      # ヘルプウィンドウにスキル名を表示
      @help_window.set_text(@skill.name, 1)
      # アニメ?ション ID を設定
      @animation1_id = @skill.animation1_id
      @animation2_id = @skill.animation2_id
      # コモンイベント ID を設定
      @common_event_id = @skill.common_event_id
      # ?象側バトラ?を設定
      set_target_battlers(@skill.scope)
      # スキルの?果を適用
      for target in @target_battlers
        target.skill_effect(@active_battler, @skill)
      end
      return
    end

    # 元の?理を?行
    make_skill_action_result_KGC_MagicWeapon
  end
end

묻혀두기엔 너무 아까운거 같아서 다시 올립니다^^;;
근데 저두 사용법을 몰라서요..ㅜ.ㅜ
스크립트 잘 아시는님들은 이거 보고 사용법 점 알려주세요~^^
출저는 kgc-블루다운님의 게시물

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '1'
  • profile
    킬비 2012.07.07 09:35

    공격시 확률적으로 스킬이 발동한다니 멋진 스크립트네요. 감사합니다.

    (포맷할때 실수로 스크립트를 죄다 날려먹어서 횡스크롤 전투 찾으려고 이리저리 돌아다니는 킬비)


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
134 전투 KGC_GuardRecover(방어시 HP회복) 4 백호 2009.02.22 1348
133 전투 매턴 자동 회복이나 도트힐 3 file 백호 2009.02.22 1350
132 전투 KGC_PreempAttack(선제공격) file 백호 2009.02.22 1405
131 전투 숙력도 시스템 스크립트 2 백호 2009.02.21 1408
» 전투 마법검 스크립트 1 백호 2009.02.22 1425
129 전투 KGC_AutoRecover(매턴 자동 회복) 1 백호 2009.02.22 1430
128 전투 Mr Mo DVV Addon #20~#21 Alkaid 2011.09.05 1432
127 전투 대전게임 Fighter 1 file 백호 2009.02.21 1436
126 전투 Mr. Mo's ABS Ultimate by DerVVulfman Alkaid 2011.09.05 1438
125 전투 전투 난이도 설정 스크립트 file 백호 2009.02.21 1441
124 전투 배틀 리포트 화면 변경 스크립트 2 file 백호 2009.02.21 1442
123 전투 SG_Batte Retry ver.4 by sandgolem 2 백호 2009.02.22 1457
122 전투 S ABS_NonSDK ver 1 file 백호 2009.02.22 1458
121 전투 Minkoff's Animated Battlers - Enhanced 13.4 by DerVVulfman 2 Alkaid 2011.07.13 1458
120 전투 추적 공격 스크립트 백호 2009.02.21 1459
119 전투 전투시 미묘한 효과 스크립트 file 백호 2009.02.21 1468
118 전투 전투배경확장 한글 3 백호 2009.02.22 1472
117 전투 Minkoff's Animated Battler Enhanced 11.2 by DerVVulfman 1 쉴더 2009.02.21 1483
116 전투 S ABS_NonSDK(구버전용) 5 file 백호 2009.02.22 1494
115 전투 KGC_RandomTarget(랜덤 타겟) 1 file 백호 2009.02.22 1495
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9