VX 스크립트

▶ MAIN 섹쉰 위쪽에 추가해주세요
#===============================================================================
# Regenerate HP/MP - RMVX Version
#===============================================================================
# Written by Synthesize
# Version 1.2.0
# January 19, 2008
#===============================================================================
#            *This script is not compatible with RPG Maker XP*
#===============================================================================
module SynRegen
  # Format = { Actor_ID => Percent to restore, Actor_ID2 => Percent to restore}
  HP_regen = {1 => 5, 2 =>7} # %
  # You can define how much HP each individual actor regenerates when they
  # Defend. Add new actors by seperating each returning value with a comma (,)
  #-----------------------------------------------------------------------------
  # This value determines the Default Percent growth if the Actor_ID is not
  # in the above hash
  HP_regen.default = 5 # %
  #-----------------------------------------------------------------------------
  # Set to true to enable HP regen in battle, false to disable.
  Use_hp_regen = true
  #----------------------------------------------------------------------------
  # Format = {Actor_ID => SP to restore
  SP_regen = {1 => 5, 2 => 7} # %
  # You can define how much SP each individual actor regenerates when they
  # defend. Add new actors by seperating each returning value with a comma (,)
  #-----------------------------------------------------------------------------
  # This is the default percentage to regenerate if the Actor_ID is not in the
  # hash.
  SP_regen.default = 5 # %
  #-----------------------------------------------------------------------------
  # Set to true to enable, false to disable
  Use_mp_regen = true
  #-----------------------------------------------------------------------------
  # Draw how much HP/MP the actor regenerated?
  Draw_text = true
  #-----------------------------------------------------------------------------
  # The defense rate if the actor has 'Super Defense'
  Super_guard_rate = 4
  #-----------------------------------------------------------------------------
  # The defense rate if the actor has 'Normal Defense'
  Normal_guard_rate = 2
end
#-------------------------------------------------------------------------------
# Scene_Battle
#   This aliases the execute_action_guard method in Scene_Battle
#-------------------------------------------------------------------------------
class Scene_Battle
  # Alias execute_action_guard
  alias syn_regen_execute_guard execute_action_guard
  #-----------------------------------------------------------------------------
  # Execute Action_Guard
  #-----------------------------------------------------------------------------
  def execute_action_guard
    # Calculate the amount of HP and MP gained
    hp_restore = ((@active_battler.maxhp * SynRegen::HP_regen[@active_battler.id]) / 100) if SynRegen::Use_hp_regen == true
    sp_restore = ((@active_battler.maxmp * SynRegen::SP_regen[@active_battler.id]) / 100) if SynRegen::Use_mp_regen == true
    # Calculate the different between MaxHP, HP, MaxMP and MP
    temp_value_hp = (@active_battler.maxhp - @active_battler.hp)
    temp_value_mp = (@active_battler.maxmp - @active_battler.mp)
    # Add HP and MP
    @active_battler.hp += hp_restore if SynRegen::Use_hp_regen == true
    @active_battler.mp += sp_restore if SynRegen::Use_mp_regen == true
    # Draw how much HP/MP the actor regenerated
    if temp_value_hp != 0 and temp_value_mp != 0
      @message_window.add_instant_text("#{@active_battler.name} HP increased by #{hp_restore} and MP increased by #{sp_restore}")
    elsif temp_value_hp != 0 and temp_value_mp == 0
      @message_window.add_instant_text("#{@active_battler.name} HP increased by #{hp_restore}")
    elsif temp_value_hp == 0 and temp_value_mp != 0
      @message_window.add_instant_text("#{@active_battler.name} MP increased by #{sp_restore}")
    end
    # Call the original code
    syn_regen_execute_guard
  end
end
#-------------------------------------------------------------------------------
# Game_Battler
#   This rewrites the defense method found in Game_Battler
#-------------------------------------------------------------------------------
class Game_Battler
  #-----------------------------------------------------------------------------
  # Apply_Guard_Damage
  #-----------------------------------------------------------------------------
  def apply_guard(damage)
    if damage > 0 and guarding?
      # Divide the total damage from the effectivness of the defense rate.
      damage /= super_guard ? SynRegen::Super_guard_rate : SynRegen::Normal_guard_rate    
    end
    return damage
  end
end
#===============================================================================
# This script is not compatible with Rpg Maker XP. However, I have also made a
# RPG Maker Xp version which can be found on RPGRPG Revolution.
#===============================================================================
#           * This script is untested but should work in theory *
#===============================================================================
# Written by Synthesize
# January 19, 2008
#===============================================================================
# Regenerate HP/MP - RMVX Version
#===============================================================================




Comment '15'
  • ?
    참겨니 2008.01.25 19:01

    메세지를 아에 않나오게 할 수는 없나요?

  • ?
    넌닝구가좋아 2008.03.21 18:05
    감사 감사!
  • profile
    NewSet 2008.03.28 21:40
    감사합니다^^!
  • ?
    이렐 2008.08.20 15:56

    감사합니다~

  • ?
    21thcentuary 2008.09.23 19:13
    좋긴좋은데 쓰기는 싫네.
  • ?
    레핀 2008.09.24 03:14
    이 스크립트를 쓰고서 [방어] 커맨드 이름을 [휴식]으로 바꿔버리면 딱이겠네요 ~
  • ?
    불독 2008.11.04 18:35
    저두 레핀 님 생각에 동의.
  • profile
    카와이 2009.01.12 19:30
    멋쟁이 ㅋ
  • ?
    흠냐흠냐 2009.07.07 17:46

    흠냐 복사하면 한줄로 쭉 나와서 어떻게 할수가 없네요 ㅎㄷ;;

  • ?
    음냐~~ 2010.02.12 15:04

    방어를 하니 mp,hp가 올라가는군요

    지정된 방패만 이 기능이 있으면 좋을것 같네요

  • ?
    이수 2010.06.12 14:04

    감사합니당ㅋㅋ

  • ?
    다시한번 2010.07.28 09:25

    감사합니다~ ㅇㅁㅇ 이런거 있는줄 모랐어요 ㅇㅁㅇ;;

  • ?
    달봉스쿨 2010.08.20 18:58

    스크립트는 좋은데, 이것도 어떻게 쓰느냐 일 것 같네요.ㅋ

  • ?
    하얀아이 2011.09.24 03:07

    오 마침 찾고 있었는데

  • ?
    러닝금빛 2012.06.15 20:27

    피가 사기적으로 차지 않도록 회복량 조절도 해주면 좋겠어요 ㅋ


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
» 전투 방어를 했을경우 hp / mp 회복 되도록 하는 스크립트 15 아방스 2008.01.22 3746
80 전투 전투배경을 자신이 원하는 형태로 45 file 아방스 2008.01.23 7137
79 전투 전투 배경을 이미지로 설정하는 스크립트 20 file 아방스 2008.01.23 4889
78 전투 맨손 공격시 2번공격하는 스크립트 5 아방스 2008.01.24 2357
77 전투 전투시 메시지 표시 시간 조절 7 file 아방스 2008.01.24 2827
76 전투 Target 몬스터 플래시 스크립트 16 아방스 2008.01.24 4512
75 전투 VX에서 전투배경을 XP스타일로 나오게 하는 스크립트 7 아방스 2008.01.25 4839
74 전투 rpgvx 간단액알 스크립트 제작: 41 *PS 2008.02.07 9821
73 전투 VX 사이드 뷰 전투 (2003 방식) 16 드로드맨 2008.02.24 4996
72 전투 Actor Battler Graphics 13 아방스 2008.03.07 3065
71 전투 KGC]전투형태 오버드라이브(턴알) 13 찌나 2008.03.08 5656
70 전투 사이드뷰 스크립트 [2003 전투 방식] 39 아방스 2008.03.09 8406
69 전투 VX]Mog Battleback XP 1.0 11 file WMN 2008.04.06 3868
68 전투 2003식 사이드뷰 적들도 가까이와서 공격함 ㅇㅇ 51 배군 2008.05.02 6750
67 전투 [vx] ATB 시스템. 10 만들어보자꾸나 2008.07.05 4925
66 전투 돌아가는 전투 메뉴 시스템 33 아방스 2008.08.29 5083
65 전투 지형에 따른 전투배경화면 표시 스크립트!! 30 file 레오 2008.09.17 5855
64 전투 GTBS_VX 1.0 택틱컬rpg 14 file RPGbooster 2008.10.08 3352
63 전투 Crissaegrim ABS 2.0.5 최신 48 file RPGbooster 2008.10.08 8768
62 전투 PRABS 2.0 액션배틀시스템 58 file RPGbooster 2008.10.08 7572
Board Pagination Prev 1 2 3 4 5 Next
/ 5