XP 스크립트

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆능력치 한계 돌파 - KGC_ParameterLimitOver◆
#_/----------------------------------------------------------------------------
#_/ 능력치의 상한을 변경합니다.
#_/  (터무니 없는 값을 설정한다면 버그(bug)る 가능성 있고)
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

# 도입 끝나고 플래그(flag)를 온(on)
$imported["ParameterLimitOver"] = true

#==============================================================================
# ★ 커스터마이즈(customize)항목 ★
#==============================================================================

# 능력치 보정치(소수점 사용 가)
$maxhp_correct = 1  # MAXHP
$maxsp_correct = 1  # MAXSP

class Game_Battler
  # 적의 HP 상한
  ENEMY_HP_LIMIT = 9999999
  # 적의 SP 상한
  ENEMY_SP_LIMIT = 99999
  # 적의 「str, dex, agi, int」상한
  ENEMY_ETC_LIMIT = 9999
end

class Game_Actor < Game_Battler
  # 배우(actor)의 레벨(level) 상한
  #  배우(actor) ID 순서로 배열에 격납(처음은 nil)
  ACTOR_LV_LIMIT = [nil]
  # 상한미 지정 배우(actor)의 레벨(level) 상한
  #  상한미 지정(nil)의 배우(actor)는 이 값을 사용
  ACTOR_LV_LIMIT_DEFAULT = 512
  # 배우(actor)의 경험치 상한
  ACTOR_EXP_LIMIT = 9999999999
  # 배우(actor)의 HP 상한
  ACTOR_HP_LIMIT = 9999999
  # 배우(actor)의 SP 상한
  ACTOR_SP_LIMIT = 9999999
  # 배우(actor)의 「str, dex, agi, int」상한
  ACTOR_ETC_LIMIT = 99999

  # 레벨(level) 100 이후의 능력치 계산 식(lv:현실 레벨(level) p[x]:레벨(level) x의 능력 치)
  #  이 계산 결과를 레벨(level) 99 의(것) 능력치에 가산
  ACTOR_LV100_CALC = "(p[2] - p[1]) * (lv - 99)"
end

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

#==============================================================================
# ■ Game_Battler (분할 정의 1)
#------------------------------------------------------------------------------
#  버틀러(butler)를 취급한 클래스(class)입니다.이 클래스(class)는 Game_Actor 클래스(class)와 Game_Enemy 쿠라
# 스의 슈퍼(super) 클래스(class)로서 사용됩니다.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # ● MaxHP 의(것) 취득
  #--------------------------------------------------------------------------
  def maxhp
    n = [[base_maxhp + @maxhp_plus, 1].max, ENEMY_HP_LIMIT].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, ENEMY_HP_LIMIT].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● MaxSP 의(것) 취득
  #--------------------------------------------------------------------------
  def maxsp
    n = [[base_maxsp + @maxsp_plus, 0].max, ENEMY_SP_LIMIT].min
    for i in @states
      n *= $data_states[i].maxsp_rate / 100.0
    end
    n = [[Integer(n), 1].max, ENEMY_SP_LIMIT].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 완력의 취득
  #--------------------------------------------------------------------------
  def str
    n = [[base_str + @str_plus, 1].max, ENEMY_ETC_LIMIT].min
    for i in @states
      n *= $data_states[i].str_rate / 100.0
    end
    n = [[Integer(n), 1].max, ENEMY_ETC_LIMIT].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 손재주가  사노 취득
  #--------------------------------------------------------------------------
  def dex
    n = [[base_dex + @dex_plus, 1].max, ENEMY_ETC_LIMIT].min
    for i in @states
      n *= $data_states[i].dex_rate / 100.0
    end
    n = [[Integer(n), 1].max, ENEMY_ETC_LIMIT].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 신속함의 취득
  #--------------------------------------------------------------------------
  def agi
    n = [[base_agi + @agi_plus, 1].max, ENEMY_ETC_LIMIT].min
    for i in @states
      n *= $data_states[i].agi_rate / 100.0
    end
    n = [[Integer(n), 1].max, ENEMY_ETC_LIMIT].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 마력의 취득
  #--------------------------------------------------------------------------
  def int
    n = [[base_int + @int_plus, 1].max, ENEMY_ETC_LIMIT].min
    for i in @states
      n *= $data_states[i].int_rate / 100.0
    end
    n = [[Integer(n), 1].max, ENEMY_ETC_LIMIT].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● MaxHP 의(것) 설정
  #    maxhp : 새롭다 MaxHP
  #--------------------------------------------------------------------------
  def maxhp=(maxhp)
    @maxhp_plus += maxhp - self.maxhp
    @maxhp_plus = [[@maxhp_plus, -ENEMY_HP_LIMIT].max, ENEMY_HP_LIMIT].min
    @hp = [@hp, self.maxhp].min
  end
  #--------------------------------------------------------------------------
  # ● MaxSP 의(것) 설정
  #    maxsp : 새롭다 MaxSP
  #--------------------------------------------------------------------------
  def maxsp=(maxsp)
    @maxsp_plus += maxsp - self.maxsp
    @maxsp_plus = [[@maxsp_plus, -SP_LIMIT].max, SP_LIMIT].min
    @sp = [@sp, self.maxsp].min
  end
  #--------------------------------------------------------------------------
  # ● 완력의 설정
  #    str : 새로운 완력
  #--------------------------------------------------------------------------
  def str=(str)
    @str_plus += str - self.str
    @str_plus = [[@str_plus, -ENEMY_ETC_LIMIT].max, ENEMY_ETC_LIMIT].min
  end
  #--------------------------------------------------------------------------
  # ● 손재주가  사노 설정
  #    dex : 새로운 손재주가 
  #--------------------------------------------------------------------------
  def dex=(dex)
    @dex_plus += dex - self.dex
    @dex_plus = [[@dex_plus, -ENEMY_ETC_LIMIT].max, ENEMY_ETC_LIMIT].min
  end
  #--------------------------------------------------------------------------
  # ● 신속함의 설정
  #    agi : 새로운 신속함
  #--------------------------------------------------------------------------
  def agi=(agi)
    @agi_plus += agi - self.agi
    @agi_plus = [[@agi_plus, -ENEMY_ETC_LIMIT].max, ENEMY_ETC_LIMIT].min
  end
  #--------------------------------------------------------------------------
  # ● 마력의 설정
  #    int : 새로운 마력
  #--------------------------------------------------------------------------
  def int=(int)
    @int_plus += int - self.int
    @int_plus = [[@int_plus, -ENEMY_ETC_LIMIT].max, ENEMY_ETC_LIMIT].min
  end
end

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

#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  배우(actor)를 취급한 클래스(class)입니다.이 클래스(class)는 Game_Actors 클래스(class) ($game_actors)
# 의(것) 내부에서 사용되고,Game_Party 클래스(class) ($game_party) 얽히다 참조됩니다.
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● EXP 계산
  #--------------------------------------------------------------------------
  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list[1] = 0
    pow_i = 2.4 + actor.exp_inflation / 100.0
    for i in 2..self.final_level + 1
      if i > self.final_level
        @exp_list[i] = 0
      else
        n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
        @exp_list[i] = @exp_list[i-1] + Integer(n)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● EXP 의(것) 변경
  #    exp : 새롭다 EXP
  #--------------------------------------------------------------------------
  def exp=(exp)
    @exp = [[exp, ACTOR_EXP_LIMIT].min, 0].max
    # 레벨업(level up)
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      # 숙련(skill) 습득
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    # 레벨(level) 다운(down)
    while @exp < @exp_list[@level]
      @level -= 1
    end
    # 레벨(level)가 100 이상의 경우
    if @level >= 100
      $data_actors[@actor_id].parameters.resize(6, @level + 1)
      for k in 0..5
        # 능력치 미설정의 경우
        if $data_actors[@actor_id].parameters[k, @level] == 0
          # 해당 레벨(level)에서의 능력치를 계산
          calc_text = ACTOR_LV100_CALC
          calc_text.gsub!(/lv/) { "@level" }
          calc_text.gsub!(/p[([0-9]+)]/) { "$data_actors[@actor_id].parameters[k, #{$1.to_i}]" }
          n = $data_actors[@actor_id].parameters[k, 99]
          n += eval(calc_text)
          $data_actors[@actor_id].parameters[k, @level] = [n, 32767].min
        end
      end
    end
    # 현재의 HP 라고(와) SP 이(가) 최대치를 초과하고 있다면 수정
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
  #--------------------------------------------------------------------------
  # ● MaxHP 의(것) 취득
  #--------------------------------------------------------------------------
  def maxhp
    n = [[base_maxhp + @maxhp_plus, 1].max, ACTOR_HP_LIMIT].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, ACTOR_HP_LIMIT].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 기본 MaxHP 의(것) 취득
  #--------------------------------------------------------------------------
  def base_maxhp
    n = $data_actors[@actor_id].parameters[0, @level]
    n *= $maxhp_correct
    # MAXHP 을(를) 정수에 고치고 돌려 준다
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● MaxSP 의(것) 취득
  #--------------------------------------------------------------------------
  def maxsp
    n = [[base_maxsp + @maxsp_plus, 0].max, ACTOR_SP_LIMIT].min
    for i in @states
      n *= $data_states[i].maxsp_rate / 100.0
    end
    n = [[Integer(n), 1].max, ACTOR_SP_LIMIT].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 기본 MaxSP 의(것) 취득
  #--------------------------------------------------------------------------
  def base_maxsp
    n = $data_actors[@actor_id].parameters[1, @level]
    n *= $maxsp_correct
    # MAXSP 을(를) 정수에 고치고 돌려 준다
    return Integer(n)
  end
  unless $imported["EquipIncrease"]
  #--------------------------------------------------------------------------
  # ● 기본 완력의 취득
  #--------------------------------------------------------------------------
  def base_str
    n = $data_actors[@actor_id].parameters[2, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.str_plus : 0
    n += armor1 != nil ? armor1.str_plus : 0
    n += armor2 != nil ? armor2.str_plus : 0
    n += armor3 != nil ? armor3.str_plus : 0
    n += armor4 != nil ? armor4.str_plus : 0
    return [[n, 1].max, ACTOR_ETC_LIMIT].min
  end
  #--------------------------------------------------------------------------
  # ● 기본 손재주가  사노 취득
  #--------------------------------------------------------------------------
  def base_dex
    n = $data_actors[@actor_id].parameters[3, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.dex_plus : 0
    n += armor1 != nil ? armor1.dex_plus : 0
    n += armor2 != nil ? armor2.dex_plus : 0
    n += armor3 != nil ? armor3.dex_plus : 0
    n += armor4 != nil ? armor4.dex_plus : 0
    return [[n, 1].max, ACTOR_ETC_LIMIT].min
  end
  #--------------------------------------------------------------------------
  # ● 기본 신속함의 취득
  #--------------------------------------------------------------------------
  def base_agi
    n = $data_actors[@actor_id].parameters[4, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.agi_plus : 0
    n += armor1 != nil ? armor1.agi_plus : 0
    n += armor2 != nil ? armor2.agi_plus : 0
    n += armor3 != nil ? armor3.agi_plus : 0
    n += armor4 != nil ? armor4.agi_plus : 0
    return [[n, 1].max, ACTOR_ETC_LIMIT].min
  end
  #--------------------------------------------------------------------------
  # ● 기본 마력의 취득
  #--------------------------------------------------------------------------
  def base_int
    n = $data_actors[@actor_id].parameters[5, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.int_plus : 0
    n += armor1 != nil ? armor1.int_plus : 0
    n += armor2 != nil ? armor2.int_plus : 0
    n += armor3 != nil ? armor3.int_plus : 0
    n += armor4 != nil ? armor4.int_plus : 0
    return [[n, 1].max, ACTOR_ETC_LIMIT].min
  end
  end
  #--------------------------------------------------------------------------
  # ● 레벨(level)의 변경
  #    level : 새로운 레벨(level)
  #--------------------------------------------------------------------------
  def level=(level)
    # 상하한 체크(check)
    level = [[level, self.final_level].min, 1].max
    # EXP 을(를) 변경
    self.exp = @exp_list[level]
  end
  #--------------------------------------------------------------------------
  # ● 최종 레벨(level)의 취득
  #--------------------------------------------------------------------------
  def final_level
    return ACTOR_LV_LIMIT[@actor_id] != nil ? ACTOR_LV_LIMIT[@actor_id] : ACTOR_LV_LIMIT_DEFAULT
  end
end

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

#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
#  에네미를 취급한 클래스(class)입니다.이 클래스(class)는 Game_Troop 클래스(class) ($game_troop) 의(것)
# 내부에서 사용됩니다.
#==============================================================================

class Game_Enemy < Game_Battler
  unless $imported["BattleDifficulty"]
  #--------------------------------------------------------------------------
  # ● 기본 MaxHP 의(것) 취득
  #--------------------------------------------------------------------------
  def base_maxhp
    n = $data_enemies[@enemy_id].maxhp
    n *= $maxhp_correct
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 기본 MaxSP 의(것) 취득
  #--------------------------------------------------------------------------
  def base_maxsp
    n = $data_enemies[@enemy_id].maxsp
    n *= $maxsp_correct
    return Integer(n)
  end
  end
end

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

#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
#  파티(party)를 취급한 클래스(class)입니다.골드(gold)나 아이템(item)등의 정보가 포함됩니다.이 쿠
# 래스(RAS)의 인(in) 스탠스(stance)는 $game_party 로 참조됩니다.
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # ● 골드(gold)의 증가 (감소)
  #    n : 금액
  #--------------------------------------------------------------------------
  def gain_gold(n)
    # 소지금의 한계치 변경
    @gold = [[@gold + n, 0].max, 99999999].min
  end
end

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

#==============================================================================
# ■ Scene_Battle (분할 정의 4)
#------------------------------------------------------------------------------
#  전투(battle) 화면의 처리를 행한 클래스(class)입니다.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 기본 액션(action) 결과 작성
  #--------------------------------------------------------------------------
  alias make_basic_action_result_KGC_ParameterLimitOver make_basic_action_result
  def make_basic_action_result
    # 효과 발동전의 HP를 보존
    last_hp = []
    battlers = $game_party.actors + $game_troop.enemies
    for i in 0...battlers.size
      last_hp[i] = battlers[i].hp
    end

    # 원래의 처리를 실행
    make_basic_action_result_KGC_ParameterLimitOver

    # 공격의 경우
    if @active_battler.current_action.basic == 0
      for target in @target_battlers
        # 데미지(damage)가 수치가 아닌 경우는 차에
        next if !target.damage.is_a?(Numeric) || target.damage <= 0
        # 데미지(damage)치 조정
        target.damage = Integer(target.damage * $maxhp_correct * 0.75)
        target.base_damage = target.damage if $imported["BonusGauge"]
        # HP 감소 처리
        for i in 0...battlers.size
          if battlers[i] == target
            target.hp = last_hp[i]
            target.hp -= target.damage
            break
          end
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 숙련(skill) 액션(action) 결과 작성
  #--------------------------------------------------------------------------
  alias make_skill_action_result_KGC_ParameterLimitOver make_skill_action_result
  def make_skill_action_result
    # 효과 발동전의 HP를 보존
    last_hp = []
    battlers = $game_party.actors + $game_troop.enemies
    for i in 0...battlers.size
      last_hp[i] = battlers[i].hp
    end

    # 원래의 처리를 실행
    make_skill_action_result_KGC_ParameterLimitOver

    # 기력 증감 속성을 갖고 있지 않다,또한 비율 데미지(damage)가 아닌  경우
    if !@skill.element_set.include?($game_special_elements["spirit_id"]) &&
        ($imported["RateDamage"] && check_damage_rate(@skill) == nil) &&
        ($imported["SPCostAlter"] && check_sp_rate(@skill) == nil)
      for target in @target_battlers
        # 데미지(damage)가 수치가 아닌 경우는 차에
        next if !target.damage.is_a?(Numeric)
        # 데미지(damage)치 조정
        target.damage = Integer(target.damage * $maxhp_correct * 0.75)
        target.base_damage = target.damage if $imported["BonusGauge"]
        # HP 감소 처리
        for i in 0...battlers.size
          if battlers[i] == target
            target.hp = last_hp[i]
            target.hp -= target.damage
            break
          end
        end
      end
    end
  end
end

===================================================================
이건 능력치 상승하는것이
다른버전과 다르게 데이터 베이스에서 설정하는거랑 같습니다
전 이걸 사용중입니다

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '3'
  • ?
    방콕족의생활 2009.03.13 19:44
    자료가 더 필요한 것 같은데 새 프로젝트에서 이 스크립트를 넣을 경우 9행렬에 문제가 있다네요
  • ?
    무뇌인 2010.09.21 08:50

    장난하시나요, KGC스크립트라고요 KGC 필수스크립트 넣으세요

  • profile
    nask33 2014.01.22 14:01
    KGC 스크립트 넣어도 문제가 발생하네요.

    KCG 스크립트 예제에 돌려도 undefined method `[]' for nil:NilClass 뜹니다.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6203
481 기타 다중 파노라마 사용 by Guillaume777 file 백호 2009.02.22 886
480 이동 및 탈것 대쉬 밑에 꺼 MP가 깍기는거 1 백호 2009.02.22 1467
479 전투 대전게임 Fighter 1 file 백호 2009.02.21 1436
478 기타 대화 글씨가 한글자씩 나오는 스크립트 2 백호 2009.02.22 2464
477 기타 대화창 글자 한글자씩뜨는 스크립트 7 백호 2009.02.22 2185
476 메시지 대화창에 얼굴 그래픽 띠우기 73 아방스 2007.11.09 7119
475 이름입력 대화창에 얼굴, 이름 띄우기 37 킬라롯 2008.11.09 7497
474 기타 대화창에 얼굴그래픽 스크립트 25 file 백호 2009.02.21 4137
473 기타 더블애니메이션 스크립트 1 백호 2009.02.22 1598
472 미니맵 던전용 미니맵 스크립트[사용법 추가] 16 file 배포 2008.03.02 3443
471 전투 데미지 출력 스크립트 6 백호 2009.02.22 1810
470 기타 데미지 출력 스크립트 예제 9 file 백호 2009.02.22 1560
469 전투 데미지 폰트변경 7 카르닉스 2010.02.26 2600
468 전투 데미지 표시 개조 8 file 백호 2009.02.21 2532
467 전투 데미지마루 백호 2009.02.21 1163
466 이동 및 탈것 데쉬 기능 스크립트 8 file 백호 2009.02.21 1508
465 기타 데이터베이스 자체 제한 해체 XP Ver. 13 THE풀잎 2010.07.04 2171
464 이동 및 탈것 도트이동 5 file 허걱 2009.08.19 2891
463 이동 및 탈것 동료들끼리 따라오는 스크립트 41 file ◐아이흥행 2010.01.23 3714
462 기타 동료들이 기차처럼 줄줄 따라온다!? 7 file 백호 2009.02.21 1990
Board Pagination Prev 1 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ... 52 Next
/ 52