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
541 전투 RTAB 1.15와 애드온 from 歯車の城 4 file 백호 2009.02.22 1186
540 이동 및 탈것 Advanced Player Movement by SephirothSpawn (SDK호환) 1 file 백호 2009.02.22 801
539 스킬 Equipment Skills 2.0 by SephirothSpawn file 백호 2009.02.22 1007
538 기타 Letter by Letter Message Window by slipknot@rmxp.org (SDK호환) 1 file 백호 2009.02.22 760
537 상점 간단한 여관 by Tsunokiette@Creation Asylum 2 백호 2009.02.22 1529
536 온라인 멀티넷플레이 99Q Beta 3 27 백호 2009.02.22 3107
535 기타 KGC, SG 필수 스크립트 1 백호 2009.02.22 1110
534 전투 [신기술 체험] 강회된 횡스크롤 액알 13 file 백호 2009.02.22 6841
533 저장 [신기술 체험] 데이터 저장 6 file 백호 2009.02.22 1420
532 전투 Real Time Active Battle(RTAB) 1.14 from 歯車の城 3 file 백호 2009.02.22 1315
531 메뉴 1-Scene CMS 1.1 by LegACy@rmxp.org (SDK호환) file 백호 2009.02.22 953
530 메뉴 제가추천하는 메뉴스크립트 11 file 백호 2009.02.22 5298
529 전투 FFX, X-2, FFXII 식으로 대미지 표시하기 by squall@rmxp.org 백호 2009.02.22 1115
528 전투 레벨업시 능력치 표시 2 백호 2009.02.22 1620
527 아이템 SG_Escape Only Items by sandgolem (SDK호환) 백호 2009.02.22 850
526 스킬 SG_Escape Only Skills by sandgolem (SDK호환) 백호 2009.02.22 752
525 저장 [KGC]_2PaneSave 스크립트 1 file 백호 2009.02.22 1655
524 저장 [KGC] 스크립트 저장된 리셋 불어오기 [스샷첨부] 1 file 백호 2009.02.22 1052
» 스킬 [KGC] 스킬습득 아이템 2 백호 2009.02.22 1290
522 이동 및 탈것 Memorize Location R2 by dubealex file 백호 2009.02.22 846
Board Pagination Prev 1 ... 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ... 52 Next
/ 52