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
174 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
173 기타 Steal Script (SDK Required) file 백호 2009.02.21 1182
172 기타 Defining Encounter Areas by RPG Advocate (사용법 첨부) file 백호 2009.02.22 1201
171 기타 [신기술 체험] 빠른 애니매이션 1 file 백호 2009.02.22 1201
170 기타 창고 스크립트 2 백호 2009.02.21 1203
169 기타 NPC Details Window by SephirothSpawn (SDK호환) 1 file 백호 2009.02.22 1209
168 기타 경험치 퍼센트 수정 백호 2009.02.22 1212
167 기타 액터 선택 스크립트 2 백호 2009.02.21 1229
166 기타 멋진...제작자 정보를 그림으로 1 백호 2009.02.22 1233
165 기타 제작한 게임의 파일을 모두 exe파일 하나에 쓸어담기 by sheefo@Creation Asylum 1 file 백호 2009.02.22 1240
164 기타 무기 개조 스크립트 file 백호 2009.02.21 1248
163 기타 무기 회피율, 방어구 공격력 지정 스크립트 6 백호 2009.02.22 1248
162 기타 Etude87_Bone_Animation_Character ver.1.2 4 습작 2012.07.06 1255
161 기타 복권 스크립트 6 백호 2009.02.21 1258
160 기타 엔딩후 캐릭터 이어서 새로운 게임시작 스크립트 1 file 백호 2009.02.21 1263
159 기타 Golden_sun_intro v1 1 백호 2009.02.22 1267
158 기타 Advanced Weather System (AWS) 3 file 백호 2009.02.22 1272
157 기타 ID띄우기 스크립트(新) 3 백호 2009.02.22 1280
156 기타 Realistic Shop by MeisMe@rmxp.org 3 file 백호 2009.02.22 1295
155 기타 카운트 3초 1 file 백호 2009.02.22 1296
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13