XP 스크립트

http://f44.aaa.livedoor.jp/~ytomy/tkool/rpgtech/frame.html
  이미 아시는 분은 아실 아이템으로 스킬을 습득하게 하는 스크립트입니다.  스킬습득 아이템을 위한 속성을 만들고(스크립트에 지정한 것과 동일해야 함), 아이템의 HP회복량에 습득할 스킬의 ID를 쓰면 됩니다.


#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆スキル習得アイテム - KGC_ItemLearnSkill◆
#_/----------------------------------------------------------------------------
#_/ 使用するとスキルを習得するアイテムを作成します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

$imported = {} if $imported == nil
$imported["ItemLearnSkill"] = true

if $game_special_elements == nil
  $game_special_elements = {}
  $data_system = load_data("Data/System.rxdata")
end
# スキル習得アイテム属性
$game_special_elements["item_learn_skill"] = $data_system.elements.index("スキル習得アイテム")
if $game_special_elements["item_learn_skill"] == nil
  $game_special_elements["item_learn_skill"] = $data_system.elements.index("スキル修得アイテム")
end

#==============================================================================
# ■ Game_Battler (分割定義 3)
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # ● アイテムの効果適用
  #    item : アイテム
  #--------------------------------------------------------------------------
  alias item_effect_KGC_ItemLearnSkill item_effect
  def item_effect(item)
    # スキル修得属性を持っていない、または対象がエネミーの場合
    if !item.element_set.include?($game_special_elements["item_learn_skill"]) ||
        self.is_a?(Game_Enemy)
      # 元の処理を実行
      return item_effect_KGC_ItemLearnSkill(item)
    end

    # 習得済みの場合は戻る
    return false if self.skill_learn?(item.recover_hp)
    # クリティカルフラグをクリア
    self.critical = false
    # アイテムの効果範囲が HP 1 以上の味方で、自分の HP が 0、
    # またはアイテムの効果範囲が HP 0 の味方で、自分の HP が 1 以上の場合
    if ((item.scope == 3 || item.scope == 4) && self.hp == 0) ||
      ((item.scope == 5 || item.scope == 6) && self.hp >= 1)
      # メソッド終了
      return false
    end
    # 有効フラグをクリア
    effective = false
    # コモンイベント ID が有効の場合は有効フラグをセット
    effective |= item.common_event_id > 0
    # 命中判定
    hit_result = (rand(100) < item.hit)
    # 不確実なスキルの場合は有効フラグをセット
    effective |= item.hit < 100
    # 命中の場合
    if hit_result == true
      self.damage = nil
      # "HP回復量"のスキルを修得
      self.learn_skill(item.recover_hp)
      return true
    end
    return false
  end
end

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
781 아이템 아이템 종류별로 분류시키는 스크립트 3 file 백호 2009.02.21 1259
780 오디오 WinAMP 플러그인을 이용하여 RMXP에서 다른 형식의 음악파일 재생하기 file 백호 2009.02.22 1259
779 전투 전투 속도 조정 스크립트 2 file 백호 2009.02.21 1261
778 기타 Golden_sun_intro v1 1 백호 2009.02.22 1262
777 기타 엔딩후 캐릭터 이어서 새로운 게임시작 스크립트 1 file 백호 2009.02.21 1263
776 전투 Mr Mo DVV Addon #18~#19 Alkaid 2011.07.13 1266
775 전투 배틀포인트 + 배틀샵 1 file 백호 2009.02.21 1272
774 기타 Advanced Weather System (AWS) 3 file 백호 2009.02.22 1272
773 변수/스위치 SG_Self Variables by sandgolem 백호 2009.02.22 1275
772 기타 ID띄우기 스크립트(新) 3 백호 2009.02.22 1280
771 아이템 지정한 아이템 갯수 제한 3 백호 2009.02.22 1282
770 전투 Mr Mo DVV Addon #14~#17 3 Alkaid 2011.05.23 1285
769 스킬 Trickster's Bag of Skill Effects (SDK 필요) Alkaid 2012.09.17 1289
» 스킬 [KGC] 스킬습득 아이템 2 백호 2009.02.22 1290
767 맵/타일 SG_Map Pause ver.1 by sandgolem 2 백호 2009.02.22 1290
766 전투 엑터, 에너미 개별적인 효과음 스크립트 1 백호 2009.02.21 1292
765 기타 Realistic Shop by MeisMe@rmxp.org 3 file 백호 2009.02.22 1292
764 저장 Advanced Save Menu 편집 20101005 Edition (SDK2용) 3 Alkaid 2010.10.05 1293
763 전투 맨손 공격력,속성 설정 스크립트 4 file 백호 2009.02.21 1294
762 스킬 스킬제휴 스크립트 file 백호 2009.02.21 1294
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ... 52 Next
/ 52