RPGXP 스크립트
2014.02.22 18:04

스텟찍기스크립트

조회 수 1761 추천 수 3 댓글 12
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
#=====================================================
# Drago del fato's Level Up Point Spend System
# ---------------------------------------------
# 출처:http://cafe.naver.com/rpg1229/33708
# Version 2.4
# 글 쓴 사람:RPGXP한글쓰는넘 (tjdtn8552)
#=====================================================

#--Res Text
PSPEND_LVUPTEXT = "당신은 레벨업 했습니다. 스탯을 올려주세요."
PSPEND_SPTEXT = "남은 스탯포인트:"
PSPEND_ANSWERS = ["올린다.","취소"]
PSPEND_HELP_TEXT = ["완력을 올린다.","민첩을 올린다.",
"지능을 올린다.","마력을 올린다.","최대 HP를 올린다.",
"최대 MP를 올린다.","스탯을 초기화한다.","스탯을 저장한다."]
PSPEND_B1 = "스탯 초기화"
PSPEND_B2 = "스탯 저장"
LVUP_TEXT = "스탯을 올리세요."
DESC_TEXT = "←키 - 스탯 깎기,→키 - 스탯 올리기,ESC - 취소"

#-- Other Res
SPADD = 3 #레벨업시 주는 포인트 님이 적은 수치의 항상 2배를 준다 ex) 2를 적으면 4라고나옴

AGILITY_ADD = 1 #1포인트당 어질+1
DEXTERITY_ADD = 1 #1포인트당 덱스 +1
INTELIGENCE_ADD = 1 #1포인트당 마력+1
STRENGTH_ADD = 1 #1포인트당 힘+1
HP_ADD = 8 #1포인트당 hp+10
SP_ADD = 8 #1포인트당 MP+10


#-- If you aren't experienced scripter then don't change lines below!!!

#--Global Variables
$PSPEND_POINTS = []
$PSPEND_ACTORS = []
$PSPEND_ADD = [1,1,1,1,1,1]
$PSPEND_ATTR = [1,1,1,1,1,1]
$PSPEND_RET = 0

#== Part One - Class for Setting and Getting Attributes from Actors

class PSPEND_GET_SET_ACTOR_ATRIBUTTES
def initialize(type)
if !$BTEST
case type
when 0
return
when 1
get_attributes
when 2
set_attributes
end
end
end

def get_attributes(actorid)
@actor = $game_actors[actorid]
$PSPEND_ATTR[1] = @actor.str
$PSPEND_ATTR[2] = @actor.agi
$PSPEND_ATTR[3] = @actor.dex
$PSPEND_ATTR[4] = @actor.int
$PSPEND_ATTR[5] = @actor.maxhp
$PSPEND_ATTR[6] = @actor.maxsp
end

def set_attributes(actorid)
@actor = $game_actors[actorid]
@actor.str = $PSPEND_ATTR[1]
@actor.agi = $PSPEND_ATTR[2]
@actor.dex = $PSPEND_ATTR[3]
@actor.int = $PSPEND_ATTR[4]
@actor.maxhp = $PSPEND_ATTR[5]
@actor.maxsp = $PSPEND_ATTR[6]
end

end

#-- End of Part One

#-- Part Two - Disabling actor attributes so that they have same attributes at the next level!

class Game_Actor

def exp=(exp)
@exp = [[exp, 999999999999999999999999999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
$actor_attr.get_attributes(@actor_id)
@level += 1
$actor_attr.set_attributes(@actor_id)
$PSPEND_POINTS[@actor_id - 1] += SPADD
$PSPEND_ACTORS[@actor_id - 1] = true
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]
$actor_attr.get_attributes(@actor_id)
@level -= 1
$actor_attr.set_attributes(@actor_id)
$PSPEND_ACTORS[@actor_id - 1] = false
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end

def level=(level)
if level < self.level
$actor_attr.get_attributes(@actor_id)
level = [[level, $data_actors[@actor_id].final_level].min, 1].max
$actor_attr.set_attributes(@actor_id)
$PSPEND_ACTORS[@actor_id - 1] = false
self.exp = @exp_list[level]
return
end
$actor_attr.get_attributes(@actor_id)
level = [[level, $data_actors[@actor_id].final_level].min, 1].max
$actor_attr.set_attributes(@actor_id)
$PSPEND_POINTS[@actor_id - 1] += SPADD
$PSPEND_ACTORS[@actor_id - 1] = true
self.exp = @exp_list[level]
return
end
end

#-- End of Part Two

#-- Part Three - Telling Scene Title that it's time to go to shop (just kidding...).
# Changing the code so that some other variables will be added...

class Scene_Title

def command_new_game
$game_system.se_play($data_system.decision_se)

Audio.bgm_stop

Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
#edit 
$actor_attr = PSPEND_GET_SET_ACTOR_ATRIBUTTES.new(0)
for i in 0..$data_actors.size - 2
$PSPEND_ACTORS.push(false)
$PSPEND_POINTS.push(0)
end
#end edit
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh


$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end

def battle_test


$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")

Graphics.frame_count = 0


$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
#edit 
$actor_attr = PSPEND_GET_SET_ACTOR_ATRIBUTTES.new(0)
for i in 0..$data_actors.size - 2
$PSPEND_ACTORS.push(false)
$PSPEND_POINTS.push(0)
end
#end edit
$game_party.setup_battle_test_members
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name


$game_system.se_play($data_system.battle_start_se)
$game_system.bgm_play($game_system.battle_bgm)

$scene = Scene_Battle.new
end
end

#End of Part Three

#Mid Part - Adding Draw Actor Battler

class Window_Base < Window 

def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw =bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw,ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end

def draw_actor_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
cx = self.contents.text_size(actor.name).width
if $PSPEND_ACTORS[actor.id - 1]
self.contents.font.color = crisis_color
self.contents.draw_text(x + cx, y, 90, 32, " " + LVUP_TEXT) 
end
self.contents.font.color = normal_color
end

end

#End of Mid Part

#Part Four - The Hard one! Making Custom Windows

class PSPEND_CUSTOM_WINDOW < Window_Selectable

def initialize(winactorid)
super(0, 64, 640, 480 - 64)
commands = [1,2,3,4,5,6,7,8]
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32,height - 32)
self.contents.font.name = "굴림"
self.contents.font.size = 20
@actor = $game_actors[winactorid + 1]
@y = 10
$PSPEND_RET = $PSPEND_POINTS[@actor.id - 1]
refresh(true)
self.index = 0
end

def refresh(ret = false)
self.contents.clear
@y = 10
if ret
$PSPEND_ADD[1] = @actor.str
$PSPEND_ADD[2] = @actor.agi
$PSPEND_ADD[3] = @actor.dex
$PSPEND_ADD[4] = @actor.int
$PSPEND_ADD[5] = @actor.maxhp
$PSPEND_ADD[6] = @actor.maxsp
$PSPEND_POINTS[@actor.id - 1] = $PSPEND_RET
ret = false
end
draw_actor_battler(@actor,20 + 100,@y + 200)
draw_actor_name(@actor,20 + 32,@y + 220)
cx = self.contents.text_size(PSPEND_SPTEXT + $PSPEND_POINTS[@actor.id - 1].to_s).width
self.contents.draw_text(52,@y + 252,cx,32,PSPEND_SPTEXT + $PSPEND_POINTS[@actor.id - 1].to_s)
cx = self.contents.text_size(DESC_TEXT).width
self.contents.draw_text(52,self.height - 32 - 40,cx,32,DESC_TEXT)
@y += 150
@x = 260

for i in 0...@item_max
draw_item(i, normal_color)
end
end

def draw_item(index, color)
if $PSPEND_POINTS[@actor.id - 1] <= 0 
self.contents.font.color = disabled_color
else
self.contents.font.color = color
end
rect = Rect.new(@x, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
case index
when 0
self.contents.draw_text(rect, $data_system.words.str)
cx = self.contents.text_size(@actor.str.to_s + " > " + $PSPEND_ADD[1].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.str.to_s + " > " + $PSPEND_ADD[1].to_s)
when 1
self.contents.draw_text(rect, $data_system.words.agi )
cx = self.contents.text_size(@actor.agi.to_s + " > " + $PSPEND_ADD[2].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.agi.to_s + " > " + $PSPEND_ADD[2].to_s)
when 2
self.contents.draw_text(rect, $data_system.words.dex )
cx = self.contents.text_size( @actor.dex.to_s + " > " + $PSPEND_ADD[3].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 , @actor.dex.to_s + " > " + $PSPEND_ADD[3].to_s)

when 3
self.contents.draw_text(rect, $data_system.words.int )
cx = self.contents.text_size(@actor.int.to_s + " > " + $PSPEND_ADD[4].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.int.to_s + " > " + $PSPEND_ADD[4].to_s)

when 4
self.contents.draw_text(rect, $data_system.words.hp )
cx = self.contents.text_size( @actor.maxhp.to_s + " > " + $PSPEND_ADD[5].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 , @actor.maxhp.to_s + " > " + $PSPEND_ADD[5].to_s)

when 5
self.contents.draw_text(rect, $data_system.words.sp )
cx = self.contents.text_size(@actor.maxsp.to_s + " > " + $PSPEND_ADD[6].to_s).width
self.contents.draw_text(self.width - 32 - cx,32 * index,cx ,32 ,@actor.maxsp.to_s + " > " + $PSPEND_ADD[6].to_s)

when 6
self.contents.font.color = color
self.contents.draw_text(rect,PSPEND_B1)
when 7
self.contents.font.color = color
self.contents.draw_text(rect,PSPEND_B2)
end
end

def disable_item(index)
draw_item(index, disabled_color)
end

def update_cursor_rect

if @index < 0
self.cursor_rect.empty
return
end

row = @index / @column_max

if row < self.top_row
self.top_row = row
end

if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end

cursor_width = self.width / @column_max - 32

x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy

self.cursor_rect.set(@x - 10, y, self.width - @x - 17, 32)
end
end

#End of Part Four

#Part Five - Making Scene_Status to show level up window when character
#get's a new level

class Scene_Status
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end

def main
@actor = $game_party.actors[@actor_index]
$ACTORD = @actor
@status_window = Window_Status.new(@actor)
Graphics.transition
if $PSPEND_ACTORS[@actor.id - 1]
@h = Window_Help.new
@h.set_text(PSPEND_LVUPTEXT)
@h.y = 100
@h.z = 9997
@c = Window_Command.new(140,PSPEND_ANSWERS)
@c.y = 170
@c.x = 200
@c.z = 9998
loop do
Graphics.update
Input.update
update_pspend_lvup_win

if $scene != self
break
end
end
Graphics.freeze
@h.z = 0
@c.z = 1
@status_window.z = 2
@status_window.dispose
@h.dispose
@c.dispose
return
end
loop do
Graphics.update
Input.update
update
if $scene != self
break
end 
end
@status_window.dispose
end

def update_pspend_lvup_win
@c.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$PSPEND_ACTORS[@actor.id - 1] = false
$scene = Scene_Menu.new
return
end
if Input.trigger?(Input::C)
case @c.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_PSPEND_Main_Screen.new(@actor.id - 1)
return
when 1
$game_system.se_play($data_system.cancel_se)
$PSPEND_ACTORS[@actor.id - 1] = false
$scene = Scene_Menu.new
return
end
end
end
end

#End of Part Five

#Part Six - Hell is coming...AAAAAAAAH!

class Scene_PSPEND_Main_Screen
def initialize(actor_id_index)
@actor_ind = actor_id_index
main
end

def main
@help = Window_Help.new
@spend = PSPEND_CUSTOM_WINDOW.new(@actor_ind)
@spend.y = 64
@spend.z = 99998
@help.z = 99998
Graphics.transition
loop do
Graphics.update
Input.update
update_spend_help_win
if $scene != self
break
end
end
Graphics.freeze
@spend.dispose
@help.dispose
end

def update_spend_help_win
@spend.update
@help.update
@help.set_text(PSPEND_HELP_TEXT[@spend.index])
if Input.trigger?(Input::B)


$scene = Scene_Menu.new
$PSPEND_POINTS[@actor_ind] = $PSPEND_RET
$PSPEND_ACTORS[@actor_ind] = false
return
end
if Input.repeat?(Input::RIGHT)
unless $PSPEND_POINTS[@actor_ind] > 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.cursor_se)
$PSPEND_POINTS[@actor_ind] -= 1
case @spend.index
when 0
$PSPEND_ADD[1] += STRENGTH_ADD
when 1
$PSPEND_ADD[2] += AGILITY_ADD
when 2
$PSPEND_ADD[3] += DEXTERITY_ADD
when 3
$PSPEND_ADD[4] += INTELIGENCE_ADD
when 4
$PSPEND_ADD[5] += HP_ADD
when 5
$PSPEND_ADD[6] += SP_ADD
when 6
$PSPEND_POINTS[@actor_ind] += 1
when 7
$PSPEND_POINTS[@actor_ind] += 1
end
@spend.refresh
return
end


if Input.repeat?(Input::LEFT)
unless $PSPEND_POINTS[@actor_ind] < $PSPEND_RET
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.cursor_se)
case @spend.index
when 0
if $PSPEND_ADD[1] <= $ACTORD.str
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[1] -= STRENGTH_ADD
when 1
if $PSPEND_ADD[2] <= $ACTORD.agi
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[2] -= AGILITY_ADD
when 2
if $PSPEND_ADD[3] <= $ACTORD.dex
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[3] -= DEXTERITY_ADD
when 3
if $PSPEND_ADD[4] <= $ACTORD.int
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[4] -= INTELIGENCE_ADD
when 4
if $PSPEND_ADD[5] <= $ACTORD.maxhp
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[5] -= HP_ADD
when 5
if $PSPEND_ADD[6] <= $ACTORD.maxsp
$game_system.se_play($data_system.buzzer_se)
return
end
$PSPEND_ADD[6] -= SP_ADD
when 6
$PSPEND_POINTS[@actor_ind] -= 1
when 7
$PSPEND_POINTS[@actor_ind] -= 1
end
$PSPEND_POINTS[@actor_ind] += 1
@spend.refresh

return
end


if Input.trigger?(Input::C)
case @spend.index
when 6
@spend.refresh(true)
when 7
$ACTORD.str = $PSPEND_ADD[1]
$ACTORD.agi = $PSPEND_ADD[2]
$ACTORD.dex = $PSPEND_ADD[3]
$ACTORD.int = $PSPEND_ADD[4]
$ACTORD.maxhp = $PSPEND_ADD[5]
$ACTORD.maxsp = $PSPEND_ADD[6]
$game_system.se_play($data_system.decision_se)
$scene = Scene_Menu.new
$PSPEND_ACTORS[@actor_ind] = false
return
end
end
end
end

#End of Part Six - Yipee!!! I made it!

#Part Seven - Save Load part!

class Scene_Save < Scene_File

def write_save_data(file)

characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue])
end

Marshal.dump(characters, file)
Marshal.dump(Graphics.frame_count, file)

$game_system.save_count += 1
$game_system.magic_number = $data_system.magic_number

Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
Marshal.dump($PSPEND_POINTS,file)
Marshal.dump($PSPEND_ACTORS,file)
Marshal.dump($actor_attr,file)
end
end

# -- And now for the load screen

class Scene_Load < Scene_File

def read_save_data(file)

characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)

$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
$PSPEND_POINTS = Marshal.load(file)
$PSPEND_ACTORS = Marshal.load(file)
$actor_attr = Marshal.load(file)

if $game_system.magic_number != $data_system.magic_number
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end

$game_party.refresh
end
end
?
  • ?
    월마령 2014.02.23 01:08
    보이나요?ㅎㅎ
    보입니다?ㅎㅎ

    근데 어떻게 하는건지 이해가 안감;
  • profile
    천둥번들 2014.02.24 18:42
    네 도움이 되셔서 감사하네요
  • ?
    월마령 2014.02.24 07:01
    감사합니다 ㅎ 해설까지 해주시고 ㅎㅎㄱㅅㄱㅅ
  • profile
    천둥번들 2014.02.23 01:52
    일단 복붙하시고, 전투에서 레벨업을 하세요.
    그리고 메뉴로가셔서 스테이터스 들어가서 올리기를 누르면됩니다.
  • ?
    게임쟁이 2014.03.02 00:08
    스크립트 아무데나복붙해두되나요?
  • profile
    천둥번들 2014.03.02 01:34
    아니요 오른쪽마우스로 클릭하시고 스크립트 추가 해서, 복붙하시면 됩니다,
  • ?
    아츠 2014.03.05 17:37
    이거 어디서부터 복붙해야되죠?
  • ?
    레이븐 2014.03.23 06:43
    좋은 스크립트네요.
    그런데 스텍을 감안할때 초기 스텟과 레벨별 상승도는 어느정도로 해야하는지가 문제입니다.
  • profile
    천둥번들 2014.03.06 01:51
    끝까지 하시면 됩니다
  • ?
    메르스 2014.04.06 04:52
    아.....이걸 다써야되나?
  • ?
    34 2014.06.09 02:44
    잘 사용하겠습니다. 감사합니다.
  • ?
    지브릴 2014.07.07 21:31
    와 좋은 스크립트네요 잘 쓰겠습니다....
    는 XP 라 사용할수가 없다아아아 ㅠㅠ

  1. 퀘스트 스크립트

  2. 메뉴에 퀘스트 있는거

  3. 문과 상자를 쉽게 만들수 있는 스크립트

  4. 이름조합스크립트

  5. 아이템 조합 스크립트

  6. 모션 스크립트

  7. 메세지에 얼굴, 이름등 다양한 기능 넣기 UMS 스크립트

  8. 타이틀 로고 띄우기 + 로고 SE 가능(예제있음)

  9. Rpg Vx Ace 에서 이벤트 이름 팝업

  10. 3D스크립트!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  11. AraLab_MultiStartingPoint (다중 출발점 스크립트, 캐릭터 선택 스크립트) ver.0.2beta

  12. 8방향 이동스크립트

  13. 달리기스크립트

  14. 스텟찍기스크립트

  15. 말풍선 메세지 스크립트

  16. 횡스크롤 점프 [버튼허용스위치추가]

  17. 얼굴표시/문장을 한글자씩 나타내주는 스크립트 (출처-히페리온)

  18. RPG Maker VX Ace용 로고 스크립트

  19. RPG Maker VX Ace용 640*480 리사이징 스크립트

  20. VX Ace 스크립트 사이트

Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 15 Next
/ 15






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)