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
257 영상 동영상 재생 스크립트.-Game_Film II-(테스트) 7 할렘 2009.02.22 3741
» 전투 방어를 했을경우 hp / mp 회복 되도록 하는 스크립트 15 아방스 2008.01.22 3746
255 메뉴 전투승리시 아이템 경험치팝업창 스크립트 18 file 카르와푸딩의아틀리에 2009.06.23 3760
254 그래픽 밤낮 변환 스크립트 18 kram3 2008.01.31 3762
253 기타 레벨업 이펙트... 20 비극ㆍ 2010.04.19 3768
252 상점 상점 아이템 목록 정리 14 정의로운녀석 2008.07.22 3771
251 키입력 입력 기능 확장 스크립트 추가. [전체키 스크립트] 22 아방스 2008.08.25 3772
250 메뉴 몬스터도감 Tankentai사이드뷰에 작동하도록 수정 13 카르와푸딩의아틀리에 2009.05.22 3775
249 이동 및 탈것 부드럽게 이동, 8 방향이동 스크립트 25 file 사람이라면? 2010.08.16 3795
248 아이템 아이템 획득 팝업 스크립트 24 아방스 2009.01.07 3805
247 이동 및 탈것 화면의 부드러운 스크롤 스크립트 32 카르와푸딩의아틀리에 2009.07.17 3817
246 기타 설명하기 힘든 스크립트 (스크린샷 확인) 10 file 사람이라면? 2010.08.16 3818
245 맵/타일 맵에 이벤트 뿌리기 입니다. 7 file 허걱 2009.01.31 3827
244 기타 통합 스크립트(좋은 마우스 스크립트 좋은거),KGC좋은거 새로운 거 스크립트 세이브 스크립트 좋은거!~~~~~ 14 알피지GM 2010.03.07 3829
243 메뉴 YERD - 커먼 이벤트 메뉴 4 file 훈덕 2009.11.08 3850
242 심플하게 메뉴 띄우기 25 file RPGbooster 2008.10.08 3864
241 파티 파티 체인저 3.4 최신 13 file RPGbooster 2008.10.08 3864
240 전투 VX]Mog Battleback XP 1.0 11 file WMN 2008.04.06 3868
239 전투 Spirits System 정령 장착?이라고해야되나; 26 file 카르와푸딩의아틀리에 2009.08.19 3869
238 기타 VX에서 포그 그래픽을 사용하자 16 아방스 2008.01.31 3895
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