XP 스크립트

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆入手経験値&金増加 - KGC_ExpGoldIncrease◆
#_/----------------------------------------------------------------------------
#_/  戦闘後に獲得する経験値・金を増加する機能を追加します。
#_/  Provides the function which increases gain EXP and Gold of battle result.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ カスタマイズ項目 - Customize ★
#==============================================================================

module KGC
  # ◆増加ステートの重複を許可
  ### Permits repetition of gain states.
  EXPGLD_INC_PERMIT_DOUBLE = true
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

$imported = {} if $imported == nil
$imported["ExpGoldIncrease"] = true

if $game_special_states == nil
  $game_special_states = {}
  $data_states = load_data("Data/States.rxdata")
end
# 経験値○%ステート
### <e.g.> GainEXP150%
$game_special_states["inc_exp"] = /(?:(?:경험치)|(?:GainEXP))(d+)(%|%)/
# 入手金○%ステート                   
### <e.g.> GainGold150%           
$game_special_states["inc_gold"] = /(?:(?:입수금)|(?:GainGold))(d+)(%|%)/

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● EXP の変更
  #    exp : 新しい EXP
  #--------------------------------------------------------------------------
  def exp=(exp)
    rate = calc_exp_increase_rate(KGC::EXPGLD_INC_PERMIT_DOUBLE)
    exp = @exp + (exp - @exp) * rate / 100
    @exp = [[exp, $imported["LimitBreak"] ?
      KGC::LB_ACTOR_EXP_LIMIT : 9999999].min, 0].max
    # レベルアップ
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      # スキル習得
      for j in $data_classes[@class_id].learnings
        learn_skill(j.skill_id) if j.level == @level
      end
    end
    # レベルダウン
    while @exp < @exp_list[@level]
      @level -= 1
    end
    # 現在の HP と SP が最大値を超えていたら修正
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
  #--------------------------------------------------------------------------
  # ● 経験値増加率計算
  #    permit_double : 重複許可
  #--------------------------------------------------------------------------
  def calc_exp_increase_rate(permit_double)
    rate = 100
    max_rate = -1
    # ステート[経験値○%]判定
    self.states.each { |state|
      if $data_states[state].name =~ $game_special_states["inc_exp"]
        if permit_double
          rate = rate * $1.to_i / 100
        else
          max_rate = [$1.to_i, max_rate].max
        end
      end
    }
    unless permit_double
      rate = [max_rate, 0].max
    end
    return rate
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # ● ゴールドの取得
  #--------------------------------------------------------------------------
  alias gold_KGC_ExpGoldIncrease gold
  def gold
    n = gold_KGC_ExpGoldIncrease
    rate = calc_gold_increase_rate(KGC::EXPGLD_INC_PERMIT_DOUBLE)
    return n * rate / 100
  end
  #--------------------------------------------------------------------------
  # ● ゴールド増加率計算
  #    permit_double : 重複許可
  #--------------------------------------------------------------------------
  def calc_gold_increase_rate(permit_double)
    rate = 100
    max_rate = -1
    $game_party.actors.each { |actor|
      if actor.exist?
        # ステート[入手金○%]判定
        actor.states.each { |state|
          if $data_states[state].name =~ $game_special_states["inc_gold"]
            if permit_double
              rate = rate * $1.to_i / 100
            else
              max_rate = [$1.to_i, max_rate].max
            end
          end
        }
      end
    }
    unless permit_double
      rate = [max_rate, 0].max
    end
    return rate
  end
end
#-----------끝

귀찮아서 한글번역은 안했음;;;;;; (퍽)
사용법
스크립트 도입 후, 데이타베이스로 설정을 실시합니다.
우선, 스테이트에 「경험치○%」 「입수금○%」를 만듭니다.( ○은 임의의 자연수)
다음에[ 레이팅] (을)를0 ,[ 저항하지 않는다][ 배틀 종료시에 해제] (을)를 체크.
예를 들면 「경험치 2배」를 만들고 싶은 경우, 스테이트명을 「경험치200 %」로 하면OK 입니다.

출처는 KGC

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6203
254 기타 [All RGSS] FileTest (Unicode) file Cheapmunk 2014.12.29 614
253 기타 에어리어 설정 by RPG Advocate 백호 2009.02.22 710
252 기타 Boat Script 백호 2009.02.21 729
251 기타 Localization by ForeverZer0, KK20 습작 2013.04.26 738
250 기타 Materia System file 백호 2009.02.21 749
249 기타 Real-Time Day Night 3 백호 2009.02.22 751
248 기타 killer님 요청하신 스크립트 두번째입니다. 나뚜루 2009.02.21 759
247 기타 Letter by Letter Message Window by slipknot@rmxp.org (SDK호환) 1 file 백호 2009.02.22 760
246 기타 Advanced Gold display by Dubealex 1 백호 2009.02.22 761
245 기타 Sphere Grid System file 백호 2009.02.21 765
244 기타 AMS-Advanced Message Script Edited by Dubleax 3 file 백호 2009.02.21 766
243 기타 Activation_system file 백호 2009.02.22 775
242 기타 Terrain Encounter Areas by SephirothSpawn 백호 2009.02.22 778
241 기타 Damage Reductions by SephirothSpawn (SDK호환) 1 백호 2009.02.22 779
240 기타 killer님 요청하신 스크립트입니다. 1 나뚜루 2009.02.21 784
239 기타 Selected phyolomortis.com scripts 1 file 백호 2009.02.22 789
238 기타 Hero Databass 4 file 백호 2009.02.22 797
237 기타 SG_Multiple Currencies v3 by sandgolem (SDK호환) 백호 2009.02.22 803
236 기타 SG_Call Script Fix by sandgolem (SDK호환) 백호 2009.02.22 804
235 기타 Weather Script 1.02 by ccoa 1 file 백호 2009.02.22 810
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13