XP 스크립트

http://www.gamebaker.com/rmxp/scripts/battle-items.htm
  시전시 아이템을 소모하는 스킬을 만드는 스크립트입니다.  아이템을 사용하는 스킬을 만들 때는 DB에서 아이템 이름 뒤에 /S[스킬id]라고 써 주면 됩니다. (S는 항상 대문자)  물론 해당 아이템은 전투에서 사용가능해야 합니다.


#=============================================================================
# ** SG Skill Invoking Battle Items
#=============================================================================
# sandgolem
# Version 1
# 3.06.06
#=============================================================================

# Place S[#] in any of your item (not armor, weapon) names
# The item will use that skill when used in battle.

#=============================================================================
#
# To check for updates or find more scripts, visit:
#      http://www.gamebaker.com/rmxp/scripts/
#
# To use this script, copy it and insert it in a new section above "Main",
# under the default scripts, the SDK if you're using it, and anything else
# that rewrites this part of battle.
#
# SG Settings Control is required for this script! Must be above this.
#
# Have problems? You can leave me a message at:
# http://www.gamebaker.com/users/sandgolem
#
#=============================================================================

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
begin
  SDK.log("SG Skill Invoking Battle Items", "sandgolem", 1, "3.06.06")
  if SDK.state("SG Skill Invoking Battle Items") != true
    @sg_skillinvoking_disabled = true
  end
  rescue
end

#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if !@sg_skillinvoking_disabled

class SG_Start
  alias sandgolem_sinvoke_start start_game
  def start_game
    sandgolem_sinvoke_start
    sg_skillinvoking_set
  end

  def sg_skillinvoking_set
    if $sg_loaded != true
      $data_sg['invoke items'] = {}
      for i in 1...$data_items.size
        if $data_items[i].name.include?('S')
          $data_sg['invoke items'][i] = $data_items[i].name.slice(/\[S][([0-9]+)]/).to_s
          $data_sg['invoke items'][i].gsub!(/\S[/,'')
          $data_sg['invoke items'][i] = $data_sg['invoke items'][i].chop
          $data_items[i].name.gsub!(/\[S][([0-9]+)]/,'')
        end
      end
    end
  end
end

if $sg_loaded != nil && $sg_loaded != true
  sg_temp = SG_Start.new
  sg_temp.sg_skillinvoking_set
  sg_temp = nil
  $sg_loaded.refresh
end

class Game_Battler
  attr_accessor :sg_sinvoke
end

class Game_Actor < Game_Battler
  alias sandgolem_sinvoke_actor_canuse skill_can_use?
  def skill_can_use?(skill_id)
    if @sg_sinvoke
      return super
    end
    sandgolem_sinvoke_actor_canuse(skill_id)
  end
end

class Scene_Battle
  alias sandgolem_sinvoke_battle_skillact make_skill_action_result
  def make_skill_action_result
    sandgolem_sinvoke_battle_skillact
    if @active_battler.sg_sinvoke
      @active_battler.maxsp -= @active_battler.sg_sinvoke
      @active_battler.sg_sinvoke = nil
    end
  end
 
  alias sandgolem_sinvoke_battle_itemr make_item_action_result
  def make_item_action_result
    if $data_sg['invoke items'].has_key?(@active_battler.current_action.item_id)
      @item = $data_items[@active_battler.current_action.item_id]
      unless $game_party.item_can_use?(@item.id)
        @phase4_step = 1
        return
      end
      if @item.consumable
        $game_party.lose_item(@item.id, 1)
      end
      @active_battler.current_action.item_id = nil
      @active_battler.current_action.skill_id = $data_sg['invoke items'][@item.id].to_i
      @active_battler.sg_sinvoke = $data_skills[@active_battler.current_action.skill_id].sp_cost
      @active_battler.maxsp += @active_battler.sg_sinvoke
      @active_battler.sp += @active_battler.sg_sinvoke
      make_skill_action_result
      return
    end
    sandgolem_sinvoke_battle_itemr
  end 
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
501 상점 상점 직접 장비 스크립트 1 file 백호 2009.02.21 1771
500 기타 밤/낮 변화 시스템 스크립트 4 file 백호 2009.02.21 1770
499 전투 SRPGコンバータⅡ by AD.Bank 1 습작 2013.05.13 1769
498 이름입력 Keyboard-Controlled Name Input Script by BlueScope@rmxp.org 1 file 백호 2009.02.22 1769
497 장비 장비창 개조 스크립트 from Harts Horn 7 백호 2009.02.22 1769
496 아이템 아이템,돈 보관창고 스크립트 4 file 백호 2009.02.21 1769
495 스킬 Blacksmith System 2.0 by ForeverZer0 4 Alkaid 2011.09.07 1768
494 기타 타이머스크립트 ps인간 2009.01.23 1765
493 기타 창고 시스템 8 백호 2009.02.22 1763
492 기타 아이디 스크립트 4 백호 2009.02.22 1761
491 메뉴 스테이터스 화면에 넥스트 표시 1 file 백호 2009.02.21 1759
490 이동 및 탈것 기차스크립트 6 백호 2009.02.21 1757
489 메뉴 L's Custom Menu #4: 'Compact' (SDK 2.x 필수) Alkaid 2010.09.11 1755
488 기타 하나더올립니다....하암........이건...렙제라네요 7 벨☆ 2010.01.23 1754
487 타이틀/게임오버 코아 코스튬씨의 타이틀 랜덤출력 1.5를 SDK2용으로 편집한 것(수정). file Alkaid 2010.09.29 1753
486 기타 [◆ 안 됨?지?값개조 - KGC_DamageAlter ◆]데미지값을 개조[ 해석하지못함 ㅠㅠ;;] 1 file 제로스S2 2009.08.02 1753
485 기타 소지금 7자리수(9,999,999원)돌파 6 백호 2009.02.22 1752
484 메뉴 Tales Of Symphonia Menu 8 file 백호 2009.02.21 1744
483 메뉴 Stormtronics CMS 5.39b - Hybrid Edition by Blizzard 4 file Alkaid 2010.09.06 1742
482 전투 Prize Point System 2.0 by Dark Ruby@rmxp.org 3 file 백호 2009.02.22 1742
Board Pagination Prev 1 ... 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 ... 52 Next
/ 52