XP 스크립트

EMO_11일단 이름은Scene_LV으로 하시구요


↓↓↓↓↓↓↓↓↓↓↓↓↓이거를 하면 됍니다~↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

#LV限界突破
#
#最初に断っておきますと、このスクリプトを使うよりも
#自力で改造した方が、色々自由にできるしオススメです。
#なので、参考程度に見てもらえるといいかもしれません。
#(もちろん、これ単体でも動くように作っていますので
#そのまま使って頂いても構いません。)
#
#そのまま使う場合の注意点として、
#今までのスクリプトと違い、元からある処理をいくつか書き換えてます。
#併用とかする場合、なるべく上の方に貼り付ければなんとかなる、かもしれません。
#
#使い方
#まず、データベースのアクター設定でパラメータの設定をします。
#各パラメータは 初期値 + 基本値 * LV で算出されます。
#アクターのLV1の時のパラメータの値が初期値
#LV2の時の値が基本値です。
#仮にHPの初期値が1500、基本値が150としたいならば、
#データベースのアクターのパラメータ設定で
#LV1の時のHPが1500、LV2の時のHPが150となるように設定してください。
#
#パラメータの算出が適当すぎるので、各自修正が必要かと。

BASE_FINAL_LEVEL = 9999 #上限レベル(あんまり大きな値を設定するとハングします)
MAXHP_LIMIT = 99999999 #HP限界値
MAXSP_LIMIT = 99999999 #SP限界値
STR_LIMIT = 999999 #STR限界値
DEX_LIMIT = 999999 #DEX限界値
AGI_LIMIT = 999999 #AGI限界値
INT_LIMIT = 999999 #INT限界値

class Game_Actor < Game_Battler
def new_final_level
lv = BASE_FINAL_LEVEL
#以下上限LV個別指定用
#case self.id
#when 1
# lv = 255
#when 2
# lv = 999
#when 8
# lv = 15600
#end
return lv
end
#--------------------------------------------------------------------------
# ● EXP 計算
#--------------------------------------------------------------------------
def make_exp_list
actor = $data_actors[@actor_id]
@exp_list = Array.new(new_final_level + 2)
@exp_list[1] = 0
pow_i = 2.4 + actor.exp_inflation / 100.0
for i in 2..new_final_level + 1
if i > new_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
#--------------------------------------------------------------------------
# ● MaxHP の取得
#--------------------------------------------------------------------------
def maxhp
n = [[base_maxhp + @maxhp_plus, 1].max, MAXHP_LIMIT].min
for i in @states
n *= $data_states[i].maxhp_rate / 100.0
end
n = [[Integer(n), 1].max, MAXHP_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 基本 MaxHP の取得
#--------------------------------------------------------------------------
def base_maxhp
n = $data_actors[@actor_id].parameters[0, 1]
n += $data_actors[@actor_id].parameters[0, 2] * @level
return n
end
#--------------------------------------------------------------------------
# ● 基本 MaxSP の取得
#--------------------------------------------------------------------------
def base_maxsp
n = $data_actors[@actor_id].parameters[1, 1]
n += $data_actors[@actor_id].parameters[1, 2] * @level
return n
end
#--------------------------------------------------------------------------
# ● 基本腕力の取得
#--------------------------------------------------------------------------
def base_str
n = $data_actors[@actor_id].parameters[2, 1]
n += $data_actors[@actor_id].parameters[2, 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, STR_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 基本器用さの取得
#--------------------------------------------------------------------------
def base_dex
n = $data_actors[@actor_id].parameters[3, 1]
n += $data_actors[@actor_id].parameters[3, 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.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, DEX_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 基本素早さの取得
#--------------------------------------------------------------------------
def base_agi
n = $data_actors[@actor_id].parameters[4, 1]
n += $data_actors[@actor_id].parameters[4, 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.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, AGI_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 基本魔力の取得
#--------------------------------------------------------------------------
def base_int
n = $data_actors[@actor_id].parameters[5, 1]
n += $data_actors[@actor_id].parameters[5, 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.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, INT_LIMIT].min
end
#--------------------------------------------------------------------------
# ● EXP の変更
# exp : 新しい EXP
#--------------------------------------------------------------------------
def exp=(exp)
# ★EXPの上限チェックを解除
@exp = [exp, 0].max
# レベルアップ
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# スキル習得
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
# レベルダウン
while @exp < @exp_list[@level]
@level -= 1
end
# 現在の HP と SP が最大値を超えていたら修正
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# ● レベルの変更
# level : 新しいレベル
#--------------------------------------------------------------------------
def level=(level)
# 上下限チェック
# ★LV上限をnew_final_levelでチェックするように変更
level = [[level, new_final_level].min, 1].max
# EXP を変更
self.exp = @exp_list[level]
end
end


class Game_Battler
#--------------------------------------------------------------------------
# ● MaxSP の取得
#--------------------------------------------------------------------------
def maxsp
n = [[base_maxsp + @maxsp_plus, 0].max, MAXSP_LIMIT].min
for i in @states
n *= $data_states[i].maxsp_rate / 100.0
end
n = [[Integer(n), 0].max, MAXSP_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 腕力の取得
#--------------------------------------------------------------------------
def str
n = [[base_str + @str_plus, 1].max, STR_LIMIT].min
for i in @states
n *= $data_states[i].str_rate / 100.0
end
n = [[Integer(n), 1].max, STR_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 器用さの取得
#--------------------------------------------------------------------------
def dex
n = [[base_dex + @dex_plus, 1].max, DEX_LIMIT].min
for i in @states
n *= $data_states[i].dex_rate / 100.0
end
n = [[Integer(n), 1].max, DEX_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 素早さの取得
#--------------------------------------------------------------------------
def agi
n = [[base_agi + @agi_plus, 1].max, AGI_LIMIT].min
for i in @states
n *= $data_states[i].agi_rate / 100.0
end
n = [[Integer(n), 1].max, AGI_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 魔力の取得
#--------------------------------------------------------------------------
def int
n = [[base_int + @int_plus, 1].max, INT_LIMIT].min
for i in @states
n *= $data_states[i].int_rate / 100.0
end
n = [[Integer(n), 1].max, INT_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● MaxHP の設定
# maxhp : 新しい MaxHP
#--------------------------------------------------------------------------
def maxhp=(maxhp)
@maxhp_plus += maxhp - self.maxhp
@maxhp_plus = [[@maxhp_plus, -MAXHP_LIMIT].max, MAXHP_LIMIT].min
@hp = [@hp, self.maxhp].min
end
#--------------------------------------------------------------------------
# ● MaxSP の設定
# maxsp : 新しい MaxSP
#--------------------------------------------------------------------------
def maxsp=(maxsp)
@maxsp_plus += maxsp - self.maxsp
@maxsp_plus = [[@maxsp_plus, -MAXSP_LIMIT].max, MAXSP_LIMIT].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# ● 腕力の設定
# str : 新しい腕力
#--------------------------------------------------------------------------
def str=(str)
@str_plus += str - self.str
@str_plus = [[@str_plus, -STR_LIMIT].max, STR_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 器用さの設定
# dex : 新しい器用さ
#--------------------------------------------------------------------------
def dex=(dex)
@dex_plus += dex - self.dex
@dex_plus = [[@dex_plus, -DEX_LIMIT].max, DEX_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 素早さの設定
# agi : 新しい素早さ
#--------------------------------------------------------------------------
def agi=(agi)
@agi_plus += agi - self.agi
@agi_plus = [[@agi_plus, -AGI_LIMIT].max, AGI_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 魔力の設定
# int : 新しい魔力
#--------------------------------------------------------------------------
def int=(int)
@int_plus += int - self.int
@int_plus = [[@int_plus, -INT_LIMIT].max, INT_LIMIT].min
end
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '4'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
721 아이템 소지/구입 아이템 갯수 99개 이상 가능(약간 수정) 2 백호 2009.02.22 1103
720 변수/스위치 셀프 스위치 조작 10 file 허걱 2009.01.30 2655
719 저장 세이브파일 망가뜨리기 by RPG Advocate 3 백호 2009.02.22 2657
718 저장 세이브 슬롯 갯수 증가와 세이브 덮어씌울 때 확인 by RPG Advocate 5 백호 2009.02.22 1505
717 저장 세이브 & 로드 화면 개조 스크립트 file 백호 2009.02.21 1962
716 스킬 선택 스킬 스크립트 4 file 백호 2009.02.21 1631
715 HUD 새로운방법의 맵이름 표시 31 file 백호 2009.02.21 4617
714 이동 및 탈것 새로운 픽셀 이동 스크립트 27 file 케나이 2010.04.10 3496
713 메뉴 새로운 메뉴 시스템 을 한글화 및 약간 개조 3 file 백호 2009.02.21 2203
712 메뉴 새로운 메뉴 15 file 또라에몽 2010.07.17 5303
711 메뉴 새로운 cms 4 file 백호 2009.02.22 2117
710 상태/속성 상태창 표시 Ver 8.0 // 글씨 위치 변경 기능 + 변수 한글 7 file 코아 코스튬 2010.09.24 2561
709 상점 상점에서 Q.W버튼으로 순서를 바꿈!상점스텟 상세화 업그레이드 1 백호 2009.02.21 1714
708 상점 상점에 물방,마방 구별, 무기의 능력치 상세화 5 file 백호 2009.02.21 2512
707 상점 상점아템 가격변동(중뷁?) 4 캉쿤 2011.09.14 2188
706 상점 상점 직접 장비 스크립트 1 file 백호 2009.02.21 1771
705 상점 상점 시세 변동 스크립트 수정판 3 백호 2009.02.22 1518
704 기타 상점 변동시세 적용 스크립트 3 file 백호 2009.02.21 1162
703 상점 상점 메뉴 개조시킨 스크립트 [한글] 35 file 백호 2009.02.21 3567
702 상점 상점 메뉴 개조시킨 스크립트 - 수정 - 2 file 백호 2009.02.21 1818
Board Pagination Prev 1 ... 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ... 52 Next
/ 52