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
621 온라인 멀티넷 스크립트 수정본 (약간 한글화) 7 백호 2009.02.22 2315
620 HUD 머리위에 직업명을 표시해줍니다... 9 file 제로스S2 2009.08.03 2465
619 타이틀/게임오버 맵화면을 타이틀에 표시 백호 2009.02.21 1648
618 기타 맵처리를 가볍게 1 백호 2009.02.21 1147
617 HUD 맵이름표시 ps인간 2009.01.23 3441
616 HUD 맵이름표시 6 캉쿤 2011.09.14 2382
615 HUD 맵이름스크립트 52 file 이안 2010.01.17 3554
614 HUD 맵이름 스크립트 1 file 긔염둥이♥ 2012.05.19 2914
613 HUD 맵이름 넣기(bs님의 강의랑 다르게 스크립트로) 16 file 아방스 2007.11.09 2982
612 맵/타일 맵연결 스크립트 (데모첨부) file 게임애호가 2018.06.15 687
611 HUD 맵명을 표시하는 스크립트 한글로 번역한것 백호 2009.02.21 1257
610 HUD 맵 이름을 표시해주는 스크립트입니다. 25 임희성 2011.02.12 2937
609 HUD 맵 이름 표시와 미니맵을 같이하자 8 file 뮤리온。 2011.10.08 4193
608 HUD 맵 이름 표시 스크립트 수정하기 (계속 뜨게 하기, 위치 바꾸기 등) 3 뮤리온。 2011.10.08 2886
607 HUD 맵 이름 표시 by Slipknot@rmxp.net (SDK호환) 2 백호 2009.02.22 1463
606 HUD 맵 이름 뛰우기 10 WMN 2008.03.17 1966
605 기타 맵 이동시 로딩 그림 표시 14 file 백호 2009.02.21 2479
604 전투 맨손 공격력,속성 설정 스크립트 4 file 백호 2009.02.21 1294
603 전투 매턴 자동 회복이나 도트힐 3 file 백호 2009.02.22 1350
602 메시지 말풍선 표시 스크립트 48 file insertend 2010.06.06 5161
Board Pagination Prev 1 ... 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ... 52 Next
/ 52