สคริปต์ Max Level Limitation System
หน้า 1 จาก 1
สคริปต์ Max Level Limitation System
คิดว่ามันเป็น hidden class ง่ะครับ~ ใน help file ก็ไม่มีบอก ToT
อันนี้แจกไปยังหว่า สคริปต์กำหนด Max LV ตัวละครใน VX แบบที่แก้ได้ในฐานข้อมูล XP ครับ
CODE
#==============================================================================
# ¦ [RMVX Script] +MAX Level Limitation System+ Version 1.1
#------------------------------------------------------------------------------
# by Woratana [woratana@hotmail.com]
# Release Date: 30/01/2008
#
# Features in Version 1.1
# - Use alias to make the script shorter. Thanks Modern Algebra for suggestion.
# Features in Version 1.0
# - Set Default Max Level for Actor that doesn't need Specific Max Level
# - Allow to Set Specific Max Level for Specific Character
#
# How to Set Max Level
# - For all the Actors that don't need specific max level,
# set their Max Level in DEFAULT_LV_MAX = ...
# For example, DEFAULT_LV_MAX = 20
# This will make all the characters that you didn't set their specific max level
# have their max level at 20.
#
# - For the Actors that need specific max level,
# set their Max Level by:
# CHAR[actor's id from database] = ...
# For example, CHAR[7] = 10
# This will make character no.7 in database has max level at 10.
#==============================================================================
module Wormaxlv
CHAR = Array.new
#------------------------------------
# SETUP MAX Level HERE
#------------------------------------
DEFAULT_LV_MAX = 99 # Set Default Max Level
CHAR[1] = 5 # This make Character No.1 has max level at 5
end
class Scene_Battle < Scene_Base
def display_level_up
exp = $game_troop.exp_total
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(exp, true)
end
wait_for_message
end
end
class Game_Actor < Game_Battler
attr_accessor :max_lv
alias wor_actor_setup setup
def setup(actor_id)
wor_actor_setup(actor_id)
if Wormaxlv::CHAR[actor_id] == nil
@max_lv = Wormaxlv::DEFAULT_LV_MAX
else
@max_lv = Wormaxlv::CHAR[actor_id]
end
end
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0 and @level <= (@max_lv - 1)
level_up
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
display_level_up(skills - last_skills)
end
end
end
เครดิต วอราม่อน
อันนี้แจกไปยังหว่า สคริปต์กำหนด Max LV ตัวละครใน VX แบบที่แก้ได้ในฐานข้อมูล XP ครับ
CODE
#==============================================================================
# ¦ [RMVX Script] +MAX Level Limitation System+ Version 1.1
#------------------------------------------------------------------------------
# by Woratana [woratana@hotmail.com]
# Release Date: 30/01/2008
#
# Features in Version 1.1
# - Use alias to make the script shorter. Thanks Modern Algebra for suggestion.
# Features in Version 1.0
# - Set Default Max Level for Actor that doesn't need Specific Max Level
# - Allow to Set Specific Max Level for Specific Character
#
# How to Set Max Level
# - For all the Actors that don't need specific max level,
# set their Max Level in DEFAULT_LV_MAX = ...
# For example, DEFAULT_LV_MAX = 20
# This will make all the characters that you didn't set their specific max level
# have their max level at 20.
#
# - For the Actors that need specific max level,
# set their Max Level by:
# CHAR[actor's id from database] = ...
# For example, CHAR[7] = 10
# This will make character no.7 in database has max level at 10.
#==============================================================================
module Wormaxlv
CHAR = Array.new
#------------------------------------
# SETUP MAX Level HERE
#------------------------------------
DEFAULT_LV_MAX = 99 # Set Default Max Level
CHAR[1] = 5 # This make Character No.1 has max level at 5
end
class Scene_Battle < Scene_Base
def display_level_up
exp = $game_troop.exp_total
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(exp, true)
end
wait_for_message
end
end
class Game_Actor < Game_Battler
attr_accessor :max_lv
alias wor_actor_setup setup
def setup(actor_id)
wor_actor_setup(actor_id)
if Wormaxlv::CHAR[actor_id] == nil
@max_lv = Wormaxlv::DEFAULT_LV_MAX
else
@max_lv = Wormaxlv::CHAR[actor_id]
end
end
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0 and @level <= (@max_lv - 1)
level_up
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
display_level_up(skills - last_skills)
end
end
end
เครดิต วอราม่อน
Similar topics
» [สคริปต์] Exp Level Reset (เมื่อเลเวลขึ้น exp กลับเป็น 0)
» สคริปต์ MOG - TP System V2.0
» [สคริปต์] FF5 Battle System
» [สคริปต์] ระบบเดินยิงกึ่งสคริปต์ (Re shooting system Ver 2.1 )
» [สคริปต์] Faces Battle System
» สคริปต์ MOG - TP System V2.0
» [สคริปต์] FF5 Battle System
» [สคริปต์] ระบบเดินยิงกึ่งสคริปต์ (Re shooting system Ver 2.1 )
» [สคริปต์] Faces Battle System
หน้า 1 จาก 1
Permissions in this forum:
คุณไม่สามารถพิมพ์ตอบ