XP 스크립트

FF2처럼, 스테이터스 성장은 전투중의 행동에 따라 결정됩니다.(가령, 전투중 대미지를 입었을 때는 최대 HP가 증가하고, 물리공격을 많이하면 그만큼 Str이 올라가고 등등)  경험치는 있지만 통상의 레벨업이 없으므로 경험치 부분은 사실상 더미입니다(대신 스킬을 익힌다든가 하는 다른 용도로 사용가능).


#==============================================================================
# Custom Stat Growing System (CSGS) by Blizzard
# version 1.0
# Date: 20.5.2006
#
# Special Thanks:
# Viviatus - for requesting this script =D
#
# IMPORTANT NOTE:
# This script will disable the feature of leveling up. Please be sure to use
# a Custom Skill Learning System or have an appropriate script.
#
# SDK compatibilty:
# This script was NOT tested with SDK, altough there is only a 5% chance, that
# it will not work with SDK.
#
# Description:
# This script disables the ability to gain levels, altough EXP are still being
# received and can be used for another purpose. It also will allow to raise
# the character stats by other meanings than level ups.
#
# Explanation:
# - max HP will be raised if the character loses an ammount of HP, that is
# equal to a specific (and configurable) percentage of the max HP
# - max SP will be raised if the character uses an ammount of SP, that is
# equal to a specific (and configurable) percentage of the max SP
# - also it is possible to set up the succes chance of raising max HP and/or SP
# - STR will be raised if the character attacks often.
# - DEX will be raised if the character lands a critical hit or evade a status
# change.
# - INT will be raised if the character uses magic based skills, but not if
# skills are only STR, DEX and/or AGI based!
# - AGI will be raised if the character manages to evades a physical attack or
# is the very first character to act during a round.
#
# This script has a preconfiguration, but I highly recommend to configure it to
# your suits. Press CTRL+F and type CONFIGURATION to find the part, that may be
# configured.
#
#==============================================================================

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor < Game_Battler

  attr_reader  :dmghp
  attr_reader  :usesp
  attr_reader  :xstr
  attr_reader  :xdex
  attr_reader  :xint
  attr_reader  :xagi
 
  alias setup_later setup
  def setup(actor_id)
    setup_later(actor_id)
    @dmghp = 0
    @usesp = 0
    @xstr = 0
    @xdex = 0
    @xint = 0
    @xagi = 0
  end
 
  def dmghp=(hp)
    @dmghp = hp
  end
 
  def usesp=(sp)
    @usesp = sp
  end
 
  def xstr=(str)
    @xstr = str
  end
 
  def xdex=(dex)
    @xdex = dex
  end
 
  def xint=(int)
    @xint = int
  end
 
  def xagi=(agi)
    @xagi = agi
  end

  def exp=(exp) # disabling level up
    @exp = [[exp, 9999999].min, 0].max
    # Correction if exceeding current max HP and max SP
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
 
end

#==============================================================================
# Game_Battler
#==============================================================================

class Game_Battler

  alias attack_effect_later attack_effect
  def attack_effect(attacker)
    # saving old ammount of HP
    last_hp = self.hp
    saving = attack_effect_later(attacker)
    # Is the actor the one being attacked?
    if self.is_a?(Game_Actor)
      # Has the actor taken damage?
      if last_hp > self.hp
        self.dmghp += (last_hp - self.hp)
      end
      if self.damage == "Miss"
        self.xagi += 1
      end
    end
    # Is the actor the attacker?
    if attacker.is_a?(Game_Actor)
      # Has the actor dealt damage?
      if last_hp > self.hp
        attacker.xstr += 1
      end
      # Is the damage dealt by the actor critical?
      if self.critical == true
        attacker.xdex += 1
      end
    end
    return saving
  end
 
  alias skill_effect_later skill_effect
  def skill_effect(user, skill)
    # saving old ammount of HP and SP
    last_hp = self.hp
    last_sp = user.sp
    saving = skill_effect_later(user, skill)
    if self.is_a?(Game_Actor)
      # Has the actor taken damage?
      if last_hp > self.hp
        self.dmghp += (last_hp - self.hp)
      end
      if @state_changed == false
        self.xdex += 1
      end
    end
    if user.is_a?(Game_Actor)
      # Has the actor used skill points?
      if last_sp > user.sp
        user.usesp += (last_sp - user.sp)
      end
      # Is the skill magical?
      if skill.int_f != 0
        user.xint += 1
      end
    end
    return saving
  end
 
  alias slip_damage_effect_later slip_damage_effect
  def slip_damage_effect
    # saving old ammount of HP
    last_hp = self.hp
    saving = slip_damage_effect_later
    if self.is_a?(Game_Actor)
      # Has the actor taken damage?
      if last_hp > self.hp
        self.dmghp += (last_hp - self.hp)
      end
    end
    return saving
  end

end

#==============================================================================
# Window_BattleStatus
#==============================================================================

class Window_BattleStatus < Window_Base
 
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "STATS UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
 
end

#==============================================================================
# Scene_Battle
#==============================================================================

class Scene_Battle
 
  alias main_later main
  def main
    #---------------------#
    # BEGIN CONFIGURATION #
    #---------------------#
    @hpchance = 50 # % chance of HP raising if 50% of max HP value were lost
    @spchance = 50 # % chance of SP raising if 50% of max SP value were used
    @hplost = 50 # how much % of max HP must be lost, that max HP increase
    @spused = 50 # how much % of max SP must be used, that max SP increase
    @hprate = 100 # how much additional HP
    @sprate = 100 # how much additional SP
    @strchance = 70 # % chance of STR raising
    @dexchance = 70 # % chance of DEX raising
    @intchance = 70 # % chance of INT raising
    @agichance = 70 # % chance of AGI raising
    @strrate = 7 # how much additional STR points
    @dexrate = 7 # how much additional DEX points
    @intrate = 7 # how much additional INT points
    @agirate = 7 # how much additional AGI points
    @strrate_min = 10 # min xstr needed to raise STR
    @dexrate_min = 10 # min xstr needed to raise DEX
    @intrate_min = 10 # min xstr needed to raise INT
    @agirate_min = 10 # min xstr needed to raise AGI
    # In the part below you can activate or deactivate the RBB - "Reset Before
    # Battle" feature, that will reset the "counters", that are counting how
    # many times a stat was stimulated. Only activate this if you want that
    # counters ARE RESETED TO ZERO before every fight. This will have the
    # effect, that not MANY battles will raise the stats, but LONG battles.
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor.dmghp = 0
      actor.usesp = 0
      #actor.xstr = 0 # remove the # at the beginning to activate "RBB" for STR
      #actor.xdex = 0 # remove the # at the beginning to activate "RBB" for DEX
      #actor.xint = 0 # remove the # at the beginning to activate "RBB" for INT
      #actor.xagi = 0 # remove the # at the beginning to activate "RBB" for AGI
    end
    #-------------------#
    # END CONFIGURATION #
    #-------------------#
    main_later
    # Raising stats
  end
 
  alias start_phase5_later start_phase5
  def start_phase5
    for i in 0...$game_party.actors.size
      # Lost enough HP to raise?
      actor = $game_party.actors[i]
      if actor.dmghp >= actor.maxhp * @hplost / 100
        if rand(100) > @hpchance
          actor.maxhp += @hprate
          @status_window.level_up(i)
        end
      end
      # Lost enough SP to raise?
      if actor.usesp >= actor.maxsp * @spused / 100
        if rand(100) > @spchance
          actor.maxsp += @sprate
          @status_window.level_up(i)
        end
      end
      # Enough xstr gained to raise str?
      if actor.xstr >= @strrate_min
        if rand(100) > @strchance
          actor.str += @strrate
          actor.xstr = 0
          @status_window.level_up(i)
        end
      end
      # Enough xdex gained to raise dex?
      if actor.xdex >= @dexrate_min
        if rand(100) > @dexchance
          actor.dex += @dexrate
          actor.xdex = 0
          @status_window.level_up(i)
        end
      end
      # Enough xint gained to raise int?
      if actor.xint >= @intrate_min
        if rand(100) > @intchance
          actor.int += @intrate
          actor.xint = 0
          @status_window.level_up(i)
        end
      end
      # Enough xagi gained to raise agi?
      if actor.xagi >= @agirate_min
        if rand(100) > @agichance
          actor.agi += @agirate
          actor.xagi = 0
          @status_window.level_up(i)
        end
      end
    end
    start_phase5_later
  end
 
  alias make_action_orders_later make_action_orders
  def make_action_orders
    make_action_orders_later
    if @action_battlers[0].is_a?(Game_Actor)
      @action_battlers[0].xagi += 1
    end
  end
 
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Atachment
첨부 '1'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
901 아이템 아이템창변경 27 카르닉스 2010.02.26 3634
900 이름입력 이름입력스크립트 ps인간 2009.01.23 3632
899 타이틀/게임오버 타이틀 가기전에 오프닝 이벤트 시작하기?! 13 file 백호 2009.02.21 3630
898 기타 3d 렌더링스크립트 어렵게 찾음 9 라구나 2011.03.05 3610
897 전투 RPG Advocate의 데모에서 발췌한 사이드뷰용 전투상태창 4 file 백호 2009.02.22 3597
896 키입력 메세지 입력 스크립트. 25 file Bera 2010.10.18 3582
895 상점 상점 메뉴 개조시킨 스크립트 [한글] 35 file 백호 2009.02.21 3567
894 HUD 맵이름스크립트 52 file 이안 2010.01.17 3554
893 [ 무기 & 방어구 레벨제한 스크립트 ]엄청유용! ㅎ 24 file 제로스S2 2009.08.05 3554
892 타이틀/게임오버 타이틀 전에 로고 띄우기, 홈피 띄우기, 메일 보내기 13 file 유아 2009.01.09 3554
891 HUD xp대화창에 얼굴, 이름 넣기!! [방법두 있음] 3 백호 2009.02.21 3545
890 이동 및 탈것 그림자 스크립트 13 file 백호 2009.02.22 3540
889 전투 [신기술 체험] SRPG-Test 13 file 백호 2009.02.22 3537
888 메뉴 [메뉴] 간단한 형식의 CoaMenu2Scroll 버젼 20 file 코아 코스튬 2010.10.24 3526
887 전투 srpg용 스크립트라는데 4 세죠 2010.03.26 3524
886 전투 사이트뷰 전투 스크립트 (CBS R1) 8 file 백호 2009.02.21 3498
885 이동 및 탈것 새로운 픽셀 이동 스크립트 27 file 케나이 2010.04.10 3496
884 메뉴 링 메뉴 16 Neowitch* 2008.04.18 3478
883 전투 Mr. Mo's ABS 5.5 13 Alkaid 2010.09.10 3459
882 전투 펫 시스템(ABS 3.4v포함) 23 file 백호 2009.02.22 3459
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52