VX 스크립트

스킬
2009.02.03 01:59

스킬 필요 조건(번역)

조회 수 4644 추천 수 0 댓글 23
Atachment
첨부 '1'





###########################
# Requirements for Skills #
##############################################################################
# 버전 1.1                                                               
# 제작자: Queex                                                             
# 저작권: 비상업적 일반 창작자
# 필요 스크립트: TagNote 2.0 이상  (이 스크립트보다 위쪽에 위치하도록!)                                               
# 번역: 훈덕
##############################################################################
# 스킬의 사용에 필요 조건이 생깁니다.
# 이것을 활용하여
# 기술을 사용하면 불화살이 소모되게 한다거나
# HP가 낮을 때만 발동되는 초필살기 등을 만들 수 있습니다.
#
# 필요 조건은 스킬의 메모 항목에 표기하면됩니다. 
# 각 종류별로 하나의 태그만 인식됩니다.                  
#            
#                                                                           
# 무기의 메모 항목에 표기하는 태그:                   
# <weapon_type xxx>                                                         
#                                                                          
# 아이템에 표기 가능한 태그:                                           
# <include_battle_test> - 이 아이템을 테스트 전투에서 사용가능하게 해줌 
#                                                                          
# 스킬에 표기 가능한 태그:                                     
# <weapon_type xxx> - 해당 종류의 무기로만 스킬 사용 가능   
# <item_present id> - 파티가 해당 id의 아이템을 소유하고 있어야 스킬 사용 가능 
# <item_consume id n> - 스킬 사용시 id 아이템을 n 개 소비               
# <item_consume id> - 스킬 사용시 id 아이템을 1 개 소비               
# <hp_percent_exceed per> - HP가 비율 per 이상        
# <hp_percent_below per> - HP가 비율 per 미만 
# <mp_percent_exceed per> - MP가 비율 per 이상                                                     
# <mp_percent_exceed per true> - MP를 비율 per 만큼 소비
# <mp_percent_below per> - MP가 비율 per 미만             
# <free_hand> - 적어도 한 손이 빈손이어야 함                
# <dual_weapon> - 이도류 사용                      
# <two_handed_weapon> - 양손무기 사용      
#   
#
# 예를 들어:
# <item_present 3>
# <item_consumed 4 2>
# <weapon_type bow>
#
# 위의 스킬을 사용하려면 id 3 아이템이 필요하고
# 사용할때 id 4 아이템을 2개씩 소비하며
# bow 타입으로 설정된 (메모란에 <weapon_type bow> 라고 입력한) 무기를 장비해야합니다.
#
#
#
#                                                                      
# Note:                                                                     
# This script also includes the function hands_free which returns the       
# number of free hands for a Game_Actor.                                    
#                                                                           
# Version History:                                                          
# 0.4 - test release                                                        
# 0.5 - can specify some item to include in battle test                     
# 1.0 - Bugfix and update to TagNote 2.0                                    
# 1.1 - Fix regressions                                                     
##############################################################################

class Game_Actor < Game_Battler
 
  include TAGNOTE

  def hands_free
    if weapons[0]==nil
      if @armor1_id[0]==0
        return 2
      elsif weapons.length==2
        if weapons[1].two_handed
          return 0
        else
          return 1
        end
      else
        return 1
      end
    elsif weapons[0].two_handed or @armor1_id!=0
      return 0
    else
      return 1
    end
  end

  alias skill_req_skill_can_use? skill_can_use?
  def skill_can_use?(skill)
   
    if skill.id != 0
      skill_note=$data_skills[skill.id].note
      #Check for weapon type
      skill_needs = get_tag(skill_note,"weapon_type") #weapon type string
      if skill_needs != nil
        if two_swords_style
          if @weapon_id!=0 and @armor1_id!=0
            return false unless has_tag_value?($data_weapons[@weapon_id].note,"weapon_type",skill_needs) or has_tag_value?($data_weapons[@armor1_id].note,"weapon_type",skill_needs)
          elsif @weapon_id!=0
            return false unless has_tag_value?($data_weapons[@weapon_id].note,"weapon_type",skill_needs)
          elsif @armor1_id!=0
            return false unless has_tag_value?($data_weapons[@armor1_id].note,"weapon_type",skill_needs)
          else
            return false
          end
        else
          return false unless @weapon_id!=0
          return false unless has_tag_value?($data_weapons[@weapon_id].note,"weapon_type",skill_needs)
        end
      end
     
      #Check for item presence
      skill_needs = get_tag(skill_note,"item_present") #item id
      if skill_needs != nil
        return false unless $game_party.has_item?($data_items[skill_needs.to_i],true)
      end
     
      #Check for item consumption
      skill_needs = get_tag(skill_note,"item_consume") #item id
      if skill_needs !=nil
        skill_needs_num = get_additional_tag(skill_note,"item_consume",2) #number
        if skill_needs_num == nil
          skill_needs_num = 1
        end
        return false unless $game_party.item_number($data_items[skill_needs.to_i])>=skill_needs_num.to_i
      end
     
      #Check for HP exceeds
      skill_needs = get_tag(skill_note,"hp_percent_exceed") #percent
      if skill_needs !=nil
        return false unless (100.0 * @hp/maxhp)>=skill_needs.to_f
      end
     
      #Check for HP below
      skill_needs = get_tag(skill_note,"hp_percent_below") #percent
      if skill_needs != nil
        return false unless (100.0 * @hp/maxhp)<skill_needs.to_f
      end
     
      #Check for MP exceeds
      skill_needs = get_tag(skill_note,"mp_percent_exceed") #percent
      if skill_needs != nil
        return false unless (100.0 * @mp/maxmp)>=skill_needs.to_f
      end
     
      #Check for MP below
      skill_needs = get_tag(skill_note,"mp_percent_below") #percent
      if skill_needs != nil
        return false unless (100.0* @mp/maxmp)<skill_needs.to_f
      end
     
      #Check for free hand
      skill_needs = has_tag?(skill_note,"free_hand") #boolean
      if skill_needs
        return false unless hands_free>=1
      end
     
      #Check for dual weapons
      skill_needs = has_tag?(skill_note,"dual_weapon") #boolean
      if skill_needs
        return false unless two_swords_style
        return false unless weapons[0]!=nil and weapons[1]!=nil
      end
     
      #Check for two-handed weapon
      skill_needs = has_tag?(skill_note,"two_handed_weapon") #boolean
      if skill_needs
        if two_swords_style
          return false unless ( weapons[0]!= nil and weapons[0].two_handed) or (weapons[1] != nil and weapons[1].two_handed)
        else
          return false unless ( weapons[0]!= nil and weapons[0].two_handed)
        end
      end
     
      return skill_req_skill_can_use?(skill)
    end
  end
 
 
  def calc_mp_cost(skill)
    base_cost=skill.mp_cost
   
    mp_prop=get_tag(skill.note,"mp_percent_exceed")
    if mp_prop!=nil
      mp_lose=get_additional_tag_value(skill.note,"mp_percent_exceed",2)
      if mp_lose.eql?("true")
        base_cost=(mp_prop.to_f/100.0 * maxmp).to_i
      end
    end
   
    if half_mp_cost
      return base_cost / 2
    else
      return base_cost
    end
  end
 
end

class Scene_Battle < Scene_Base
 
  include TAGNOTE
#--------------------------------------------------------------------------
# * Execute Battle Action: Skill
#--------------------------------------------------------------------------
  alias skill_req_execute_action_skill execute_action_skill
  def execute_action_skill
    skill_req_execute_action_skill
    skill = @active_battler.action.skill
   
    #consume items required
    skill_needs = get_tag(skill.note,"item_consume")
    if skill_needs != nil
      num_items = get_additional_tag(skill.note,"item_consume",2)
      if num_items==nil
        num_items=1
      end
      $game_party.lose_item($data_items[skill_needs.to_i],num_items.to_i,true)
    end
  end
end

class Game_Party < Game_Unit
 
  include TAGNOTE
 
  alias skill_req_setup_battle_test_members setup_battle_test_members
  def setup_battle_test_members
    skill_req_setup_battle_test_members
    for i in 1...$data_items.size
      if has_tag?($data_items[i].note,"include_battle_test")
        @items[i] = 99
      end
    end
  end
end
   

Comment '23'
  • ?
    Scud 2009.02.03 07:54
    오 턴알 사용하시는분들께 굉장히 유용한자료
  • ?
    레오 2009.02.03 18:25
    필요하던건데.. 감사합니다 emoticon
  • ?
    집에가고싶다 2009.02.05 16:03
    턴알에 중요하지만... 액알도 꽤 쓸만 하다능.
  • ?
    H3r 2009.02.07 00:05
    전 왜 안돼는지요...;;
  • ?
    훈덕 2009.02.07 00:39
    ㄴ 정확히 뭐가 어떻게 안되는지 설명해주셔야 답을 해드리지요
  • ?
    H3r 2009.02.08 23:04
    스크립트에 추가를 해도 왜 적용이 안되는지 모르겠네요...

    맨아래에 삽입해야 하나요? 명령어를 써도 안되고...;;
  • ?
    훈덕 2009.02.08 23:51
    스크립트 추가는 메인 위쪽에 하면 된다는건 아시죠?
    초보자 분이라면 아방스님의 다른 스크립트 동영상 강좌를 한두개만 보셔도 이해가 될겁니다.
    그리고 명령어란게 뭘 뜻하는지 모르겠지만
    다른 스크립트와 충돌이 발생하지 않는한 문제없이 잘 돌아갑니다.
  • ?
    하꽝 2009.02.10 13:01
    왜 레벨재한거는것은없죠?
  • ?
    H3r 2009.02.12 19:19
    자꾸 아 자꾸 보니; TAGNOTE가 계속 에러뜨네요; 65번째줄...
  • ?
    훈덕 2009.02.13 10:59
    혹시 태그 노트 설치 안하셨나요? 참고로 여기 게시판에서 검색하면 나옵니다. 
  • ?
    꿀꿀이 2009.02.13 00:49
    제가 찾고있던게 바로 이거였어요!! 훈덕님 감사합니다!!
  • ?
    castalia 2009.02.13 21:14
    고맙습니닷!!!
  • ?
    Moonlight 2009.02.21 00:54
    유용한자료 감사합니다.
  • ?
    할퓨리어 2009.10.28 22:36

    훈덕님 게임 자체가 실행이 안됩니다 ㅡㅡ

  • ?
    리프네버 2009.12.27 17:28

    태그노트가 잇는데 왜 자꾸 없다구하지;; 밑에 놔둿는데

  • ?
    루네스카 2009.12.28 12:36

    좋아용 좋앙ㅇ!

  • profile
    케이나인 2010.01.05 00:56

    악 ㅋ

     

    ATB초식스킬에도 사용가능 하군

    이것으로 테오데 2처럼

     

    오의 -비 오의 가 가능하겠군 하

  • ?
    콩밥 2010.04.26 19:37

    정말 슬모 있네욤;;

    잘쓰겠 습니다~.

  • ?
    KOREA♬♪ 2010.08.29 20:08

    정말 미치겠구만..................

    쓸만하고.....

    사용하면 좋을거지만....

    복잡하구만.. 복잡해....

  • ?
    키레이 2010.11.21 22:37

    복잡해죽겠는데 어케든 써봐야겠군요

  • ?
    엿데브 2011.06.03 21:31

    작동이 안 되네요.

  • profile
    DevilEx 2011.08.21 21:35

    와 감사합니다 !

  • profile
    DevilEx 2011.08.21 21:45

    201번째 줄 에러 떠요 어떻게 된거임? 태그노트도 위쪽에 배치


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
257 이름입력 주인공이름으로 저장하는 스크립트 6 file 아방스 2009.02.07 4079
256 전투 ORBS_v1[1].06 전투시스템. 22 file 할렘 2009.02.06 7406
255 메뉴 파이날 판타지 IX 메뉴. 12 file 할렘 2009.02.06 6286
254 이동 및 탈것 8 방향 이동스크립트 + 스프라이트 효과 12 file 레오 2009.02.06 7557
253 메뉴 스테이터스 창을 멋있게 쿨하게~!전신을 보여주자. 24 file 할렘 2009.02.06 6236
252 스킬 스킬 사용시 컷인 연출 (번역) 26 file 훈덕 2009.02.05 5387
251 직업 [직업 변경] TBK_JobChanger_Demo_v1.2 10 아방스 2009.02.05 3468
250 전투 RPG Tankentai SBS 3.3 + ATB Kaduki Eng 58 아방스 2009.02.05 9071
249 전투 RPG Tankentai SBS 3.3 Kaduki Eng 2 아방스 2009.02.05 5467
248 이동 및 탈것 피티원이 따라다니는 스크립트 38 file 아방스 2009.02.05 5024
247 기타 Base Project 15 아방스 2009.02.05 3063
246 전투 GTBS 1.0 [스크립트] 24 아방스 2009.02.05 6141
245 기타 작은 게이지바 표시 스크립트 44 file 허걱 2009.02.05 5979
244 전투 스킬 커맨드 스크립트 16 아방스 2009.02.05 4535
243 온라인 NETVX 2버전 18 아방스 2009.02.04 3908
242 퀘스트 디아블로 스타일 퀘스트 시스템(번역) 38 file 훈덕 2009.02.03 6049
241 메뉴 캐릭터설명을 심플하게! 스크립트. 13 file 할렘 2009.02.03 4848
240 기타 VX서비스팩1 6 훈덕 2009.02.03 2806
» 스킬 스킬 필요 조건(번역) 23 file 훈덕 2009.02.03 4644
238 메시지 MessageSound v2.0 글자에 소리 다다닥 스크립트 21 할렘 2009.02.02 3510
Board Pagination Prev 1 ... 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ... 32 Next
/ 32