Aportes de Scripts RPG-Maker

Estado
Cerrado para nuevas respuestas
Mensajes
657
Reacciones
0
Puntos
0
Ubicación
EMUDESC, el mejor sitio de Emulación de todo Inter
Ahí voy:
Mansage Ex:
=begin
MESSAGE EX

#===============================================================================
# By Xiderowg / 桜雅 在土
# http://xms.rdy.jp/
# http://scriptshelf.jpn.org/x/
#===============================================================================

FUNÇÃO
Sistema avançado de apresentação de mensssagens.

UTILIZAÇÃO
Os códigos devem ser colocados na janela de mensagens

Nota I - Quando estiver escrito n no código significa que você deve colocar
um numero.
--------------------------------------------------------------------------------
JANELA INFORMATIVA

\Info

Permite que a janela se estenda até os limites da tela

--------------------------------------------------------------------------------
DEIXAR A JANELA DE MENSAGEM PERMANENTE NA TELA

\hold

--------------------------------------------------------------------------------
EFEITO FADE APÓS O TERMINIO DA MENSSAGEM

\fade

O Texto desaparece lentamente

--------------------------------------------------------------------------------
APRESENTAR UMA JANELA SEPARADA COM NOME

\name[NOME]

No lugar do nome coloque o nome do personagem.

--------------------------------------------------------------------------------
POSIÇÃO DA JANELA

\p[n]

No lugar do n coloque o numero ID do evento para que a janela se
posicione no evento.
Caso quiser que a janela se posicione no herói coloque 0

--------------------------------------------------------------------------------
TEXTO CENTRALIZADO

\center

--------------------------------------------------------------------------------
TEXTO DO LADO DIREITO

\right

--------------------------------------------------------------------------------
FONTE EM NEGRITO

\B

--------------------------------------------------------------------------------
TAMANHO DA FONTE

\h[n]

No lugar do n coloque o valor do tamanho da fonte de 6 a 32

--------------------------------------------------------------------------------
TRANSPARÊNCIA DA FONTE

\o[n]

No lugar do n coloque o valor da transparência (De 0 a 255)

--------------------------------------------------------------------------------
ADICIONAR ESPAÇO

\b[n]

--------------------------------------------------------------------------------
PULAR UMA LINHA PARA BAIXO

\n

--------------------------------------------------------------------------------
JUNTAR VÁRIAS JANELAS DE MENSAGENS EM APENAS UMA JANELA,

\next

Logo que terminar de escrever a ultima sentença do texto coloque
o código \next para poder juntar a próxima janela.

--------------------------------------------------------------------------------
MOSTRAR FACE DE UM PERSONAGEM

\f[NOME]

No lugar do nome coloque o nome do arquivo de imagem, este arquivo
deve estar na pasta pictures.

É possível usar o código desta maneira

\f[NOME,n]

O código permite apresentar a face por parte divididas de 1 à 16.
Exemplo

\f[Alex,4]

No exemplo o script vai dividir a imagem por 16 e vai apresentar a parte
numero 4.

--------------------------------------------------------------------------------
VELOCIDADE DA MENSAGEM

\s[n]

No lugar do n coloque a valor numérico da velocidade (de 0 a 19)

--------------------------------------------------------------------------------
APRESENTAR O VALOR DA VARIÁVEL

\v[n]

No lugar do n coloque o numero ID da variável

--------------------------------------------------------------------------------
APRESENTAR DINHEIRO

\g

--------------------------------------------------------------------------------
FONTE EM ITÁLICO

\I

--------------------------------------------------------------------------------
PAUSA ENTRE UMA PALAVRA E OUTRA

\!

--------------------------------------------------------------------------------
FECHAMENTO AUTOMÁTICO DA JANELA

\~

--------------------------------------------------------------------------------
APRESENTAR O NOME DO PERSONAGEM

\n[n]

No lugar do n coloque o numero ID do personagem.

--------------------------------------------------------------------------------
COR DO TEXTO

\c[n]

No lugar do n coloque estes números.

0 = Branco
1 = Azul escuro
2 = Vermelho
3 = Verde
4 = Azul claro
5 = Roxo
6 = Amarelo

--------------------------------------------------------------------------------
MOVER-SE ENQUANTO A MENSAGEM ESTÁ ATIVA

\pass

Permite que o personagem possa se mover enquanto a janela de mensagem estiver
ativa

--------------------------------------------------------------------------------
APRESENTAR NOMES DOS ITENS,ARMAS e ARMADURAS + A IMAGEM DO ÍCONE

\V[]

Permite apresentar o nome e a imagem do ícone dos itens,armaduras e armas.
Dentro dos colchetes coloque estas letras seguidas do seu numero ID.
i = Item
w = Arma
a = Armadura(Equipamento de defesa.
Exemplo de uso
---------
\V[i3]
---------
No exemplo definimos que a imagem ira apresentar o item numero ID 3, que
corresponde ao Full Potion

--------------------------------------------------------------------------------
CARACTERES EM PICTURES

\e[n]

Apresenta uma letra em pictures de 24x24, permitindo a possibilidades de
colocar qualquer tipo caractere que desejar, inclusive com textura.
É necessário ter uma imagem com o nome de Gaiji.png na pasta pictures.
A imagem deve ter de 24 de altura, por X de largura.
O n é a posição que o script vai ler o arquivo de imagem, ou seja,caso
colocarmos o código \e[2] o mensagem vai apresentar a imagem do arquivo na
posição 60 de largura.
--------------------------------------------------------------------------------

=end
class Window_Message < Window_Selectable
# Nome da fonte das letras da janela de mensagem.
DEFAULT_FONT_NAME = "Arial"
# Tamanho da fonte da janela de mensagem.
DEFAULT_FONT_SIZE = 18
# Espaço entre uma linha de texto e outra.
DEFAULT_LINE_SPACE = 28
# Nome do arquivo de imagem que ficará atrás da janela de mensagem
DEFAULT_BG_PICTURE = ""
# Posição da imagem padrão na horizontal.
DEFAULT_BG_X = 0
# Posição da imagem padrão na vertical.
DEFAULT_BG_Y = 320
# Rect.new (X, Y, L, A)
# X = Posição na horizontal.
# Y = Posição na vertical.
# L = Largura da janela.
# A = Altura da janela.
DEFAULT_RECT = Rect.new(80, 304, 496, 160)
# Transparência da janela de mensagem, de 0 a 255.
DEFAULT_BACK_OPACITY = 160
# Ajuste automático do tamanho da janela, ou seja, caso você escrever
#além dos limites do tamanho da janela, o script vai ajustar
#automaticamente o tamanho da janela conforme o tamanho da fonte e
#a quantidade de letras, coloque true ou false.
DEFAULT_STRETCH_ENABLE = true
# Extender tamanho da janela.
INFO_RECT = Rect.new(-16, 64, 672, DEFAULT_LINE_SPACE + 40)
# Janela de informação
# Rect.new (X, Y, L, A, DEFAULT_LINE_SPACE)
# X = Posição na horizontal.
# Y = Posição na vertical.
# L = Largura da janela.
# A = Altura da janela.
# DEFAULT_LINE_SPACE = Espaço entre as extremidades da linha.
DEFAULT_TYPING_ENABLE = true
# Ativar apresentação de leitura de letras, coloque false se
#quiser que o texto apareça instantaneamente
SOUNDNAME_ON_SPEAK = ""
# Definição do nome do arquivo de som .
KEY_SHOW_ALL = Input::B
# Cancela a leitura de letras.
KEY_MESSAGE_SKIP = Input::L
# Pular a próxima mensagem.
HISKIP_ENABLE_SWITCH_ID = 0
# Definição da Switch que ativará a apresentação instantânea da mensagem.
SKIP_BAN_SWITCH_ID = 0
# Definição da Switch que cancela a função das teclas B, L e S
FACE_STRETCH_ENABLE = true # Extender o tamanho da face.
FACE_WIDTH = 96 # Largura da face.
FACE_HEIGHT = 96 # Altura da face.
CHARPOP_HEIGHT = 48
end
module XRXS9
NAME_WINDOW_TEXT_COLOR = Color.new(192,240,255,255) # Cor da fonte.
NAME_WINDOW_TEXT_SIZE = 20 # Tamanho da fonte.
NAME_WINDOW_SPACE = 10 # Espaço da janela.
NAME_WINDOW_OFFSET_X = 0 # Posição X.
NAME_WINDOW_OFFSET_Y = -26 # Posição Y.
FOBT_DURATION = 40 # Tempo de fade.
end
class Window_Message < Window_Selectable
LEFT = 0
CENTER = 1
RIGHT = 2
def line_height
return DEFAULT_LINE_SPACE
end
alias xrxs9_initialize initialize
def initialize
@stand_pictuers = []
@held_windows = []
@extra_windows = []
@extra_sprites = []
xrxs9_initialize
@opacity_text_buf = Bitmap.new(32, 32)
end
alias xrxs9_dispose dispose
def dispose
@held_windows.each {|window| window.dispose}
@held_windows.clear
if @gaiji_cache != nil and not @gaiji_cache.disposed?
@gaiji_cache.dispose
end
unless @opacity_text_buf.disposed?
@opacity_text_buf.dispose
end
xrxs9_dispose
end
alias xrxs9_terminate_message terminate_message
def terminate_message
@passable = false
$game_player.messaging_moving = false
if @bgframe_sprite != nil
@bgframe_sprite.dispose
end
if @window_hold
@held_windows.push(Window_Copy.new(self))
for window in @extra_windows
next if window.disposed?
@held_windows.push(Window_Copy.new(window))
end
for sprite in @extra_sprites
next if sprite.disposed?
@held_windows.push(Sprite_Copy.new(sprite))
end
self.opacity = 0
self.contents_opacity = 0
@extra_windows.clear
@extra_sprites.clear
else
@held_windows.each {|object| object.dispose}
@held_windows.clear
end
if @name_window_frame != nil
@name_window_frame.dispose
@name_window_frame = nil
end
if @name_window_text != nil
@name_window_text.dispose
@name_window_text = nil
end
xrxs9_terminate_message
end
def pop_character=(character_id)
@pop_character = character_id
end
def pop_character
return @pop_character
end
def clear
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = DEFAULT_FONT_SIZE
self.contents.font.name = DEFAULT_FONT_NAME if DEFAULT_FONT_NAME != ""
self.opacity = 255
self.back_opacity = DEFAULT_BACK_OPACITY
self.contents_opacity = 255
@mid_stop = false
@face_file = nil
@current_name = nil
@window_hold = false
@stand_pictuer_hold = false
@passable = false
@inforesize = false
@x = @y = @indent = @line_index = 0
@cursor_width = @write_speed = @write_wait = @lines_max = 0
@line_widths = []
@line_aligns = []
self.pop_character = nil
end
def refresh
if DEFAULT_BG_PICTURE != ""
bitmap = RPG::Cache.picture(DEFAULT_BG_PICTURE)
@bgframe_sprite = Sprite.new
@bgframe_sprite.x = DEFAULT_BG_X
@bgframe_sprite.y = DEFAULT_BG_Y
@bgframe_sprite.bitmap = bitmap
@bgframe_sprite.z += 5
end
self.clear
if $game_temp.message_text != nil
@now_text = $game_temp.message_text
if (/\\_\n/.match(@now_text)) != nil
$game_temp.choice_start -= 1
@now_text.gsub!(/\\_\n/) { "" }
end
if (/\\[Ff]\[(.+?)(\,*?)([0-9]*?)\]/.match(@now_text)) != nil
if RPG_FileTest.picture_exist?($1)
@face_file = $1 + ".png"
@face_index = $3.to_i
src = RPG::Cache.picture(@face_file)
if $2 == ""
@face_index = -1
end
if FACE_STRETCH_ENABLE
@indent += FACE_WIDTH
elsif $2 == ""
@indent += src.width
else
@indent += src.width/4
end
end
@now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
end
@inforesize = (@now_text.gsub!(/\\info/) { "" } != nil)
@window_hold = (@now_text.gsub!(/\\hold/) { "" } != nil)
@now_text.gsub!(/\\[v]\[([0-9]+)\]/) { $game_variables[$1.to_i].to_s }
begin
last_text = @now_text.clone
@now_text.gsub!(/\\[V]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
end until @now_text == last_text
@now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
if @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
@current_name = $1
end
if @now_text.gsub!(/\\[Pp]\[([0-9]+)\]/) { "" }
self.pop_character = $1.to_i
end
if (/\\n/.match(@now_text)) != nil
$game_temp.choice_start += 1
@now_text.gsub!(/\\n/) { "\n" }
end
if @now_text.gsub!(/\\fade/) { "" }
@fade_count_before_terminate = XRXS9::FOBT_DURATION
end
if @now_text.gsub!(/\\pass/) { "" }
@passable = true
$game_player.messaging_moving = true
end
nil while( @now_text.sub!(/\n\n\z/) { "\n" } )
@lines_max = @now_text.scan(/\n/).size
rxs = [/\\\w\[(\w+)\]/, /\\[.]/, /\\[|]/, /\\[>]/, /\\[<]/, /\\[!]/,
/\\[~]/, /\\/, /\\[Oo]\[([0-9]+)\]/, /\\[Hh]\[([0-9]+)\]/,
/\\\[([0-9]+)\]/, /\\[Rr]\[(.*?)\]/, /\\/, /\\/]
@max_choice_x = 0
lines = @now_text.split(/\n/)
for i in 0..@lines_max
line = lines[@lines_max - i]
next if line == nil
line.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" }
for rx in rxs
line.gsub!(rx) { "" }
end
@line_aligns[@lines_max - i] =
line.sub!(/\\center/) {""} ? CENTER :
line.sub!(/\\right/) {""} ? RIGHT :
LEFT
cx = contents.text_size(line).width
@line_widths[@lines_max - i] = cx
end
choices = @line_widths[$game_temp.choice_start, @line_widths.size]
@max_choice_x = choices == nil ? 0 : choices.max + 8
@now_text.gsub!(/\\center/) {""}
@now_text.gsub!(/\\right/) {""}
@line_aligns[0] = CENTER if @inforesize
if self.pop_character != nil and self.pop_character >= 0
max_x = @line_widths.max
self.width = max_x + 32 #+ @indent + DEFAULT_FONT_SIZE/2
self.height = [@lines_max * line_height, @indent].max + 32
end
@now_text.gsub!(/\\\\/) { "\000" }
@now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
@now_text.gsub!(/\\[Gg]/) { "\002" }
@now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
@now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
@now_text.gsub!(/\\[.]/) { "\005" }
@now_text.gsub!(/\\[|]/) { "\006" }
@now_text.gsub!(/\\[>]/) { "\016" }
@now_text.gsub!(/\\[<]/) { "\017" }
@now_text.gsub!(/\\[!]/) { "\020" }
@now_text.gsub!(/\\[~]/) { "\021" }
@now_text.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" }
@now_text.gsub!(/\\/) { "\023" }
@now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
@now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
@now_text.gsub!(/\\\[([0-9]+)\]/) { "\026[#{$1}]" }
@now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "\027[#{$1}]" }
@now_text.gsub!(/\\/) { "\031" }
@now_text.gsub!(/\\/) { "\032" }
reset_window
if @current_name != nil
self.contents.font.size = XRXS9::NAME_WINDOW_TEXT_SIZE
x = self.x + XRXS9::NAME_WINDOW_OFFSET_X
y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y
w = self.contents.text_size(@current_name).width + 8 + XRXS9::NAME_WINDOW_SPACE
h = 26 + XRXS9::NAME_WINDOW_SPACE
@name_window_frame = Window_Base.new(x, y, w, h)
@name_window_frame.opacity = 160
@name_window_frame.z = self.z + 2
x = self.x + XRXS9::NAME_WINDOW_OFFSET_X + 3 + XRXS9::NAME_WINDOW_SPACE / 2
y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y + 1 + XRXS9::NAME_WINDOW_SPACE / 2
@name_window_text = Air_Text.new(x,y, @current_name, XRXS9::NAME_WINDOW_TEXT_SIZE, XRXS9::NAME_WINDOW_TEXT_COLOR)
@name_window_text.z = self.z + 3
self.contents.font.size = DEFAULT_FONT_SIZE
@extra_windows.push(@name_window_frame)
@extra_windows.push(@name_window_text)
end
end
reset_window
self.contents = Bitmap.new(self.width - 32, self.height - 32)
self.contents.font.color = normal_color
self.contents.font.name = DEFAULT_FONT_NAME if DEFAULT_FONT_NAME != ""
unless @face_file.nil?
src = RPG::Cache.picture(@face_file)
if @face_index == -1
w = src.width
h = src.height
x = 0
y = 0
else
w = src.width/4
h = src.height/4
x = (@face_index-1) % 4 * w
y = (@face_index-1) / 4 * h
end
if FACE_STRETCH_ENABLE
self.contents.stretch_blt(Rect.new(0,0,FACE_WIDTH,FACE_HEIGHT), src, Rect.new(x, y, w, h))
else
self.contents.blt(0, 0, src, Rect.new(x, y, w, h))
end
end
if $game_temp.choice_max > 0
@item_max = $game_temp.choice_max
self.active = true
self.index = 0
end
if $game_temp.num_input_variable_id > 0
digits_max = $game_temp.num_input_digits_max
number = $game_variables[$game_temp.num_input_variable_id]
@input_number_window = Window_InputNumber.new(digits_max)
@input_number_window.number = number
@input_number_window.x = self.x + 8 + @indent
@input_number_window.y = self.y + $game_temp.num_input_start * 32
end
self.contents.font.size = DEFAULT_FONT_SIZE
line_reset
update unless DEFAULT_TYPING_ENABLE
end
def line_reset
case @line_aligns[@line_index]
when LEFT
@x = @indent
@x += 8 if $game_temp.choice_start <= @line_index
when CENTER
@x = self.width / 2 - 16 - @line_widths[@line_index].to_i / 2
when RIGHT
@x = self.width - 40 - @line_widths[@line_index].to_i
end
end
def update
if @passable and not $game_player.messaging_moving
self.opacity = 0
terminate_message
return
end
super
update_main
end
def update_main
if !self.pop_character.nil? and self.pop_character >= 0
update_reset_window
end
if skippable_now? and Input.press?(KEY_MESSAGE_SKIP)
self.contents_opacity = 255
@fade_in = false
elsif @fade_in
self.contents_opacity += 24
if @input_number_window != nil
@input_number_window.contents_opacity += 24
end
if self.contents_opacity == 255
@fade_in = false
end
return
end
@now_text = nil if @now_text == ""
if @now_text != nil and @mid_stop == false
if @write_wait > 0
@write_wait -= 1
return
end
text_not_skip = DEFAULT_TYPING_ENABLE
while true
if (c = @now_text.slice!(/./m)) != nil
if c == "\000"
c = "\\"
end
if c == "\001"
@now_text.sub!(/\[([0-9]+)\]/, "")
color = $1.to_i
if color >= 0 and color <= 7
self.contents.font.color = text_color(color)
if @opacity != nil
color = self.contents.font.color
self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255)
end
end
c = ""
end
if c == "\002"
if @gold_window == nil
@gold_window = Window_Gold.new
@gold_window.x = 560 - @gold_window.width
if $game_temp.in_battle
@gold_window.y = 192
else
@gold_window.y = self.y >= 128 ? 32 : 384
end
@gold_window.opacity = self.opacity
@gold_window.back_opacity = self.back_opacity
end
c = ""
end
if c == "\003"
@now_text.sub!(/\[([0-9]+)\]/, "")
speed = $1.to_i
if speed >= 0 and speed <= 19
@write_speed = speed
end
c = ""
end
if c == "\005"
@write_wait += 5
c = ""
end
if c == "\006"
@write_wait += 20
c = ""
end
if c == "\016"
text_not_skip = false
c = ""
end
if c == "\017"
text_not_skip = true
c = ""
end
if c == "\020"
@mid_stop = true
c = ""
end
if c == "\021"
terminate_message
return
end
if c == "\023"
@indent = @x
c = ""
end
if c == "\024"
@now_text.sub!(/\[([0-9]+)\]/, "")
@opacity = $1.to_i
color = self.contents.font.color
self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255)
c = ""
end
if c == "\025"
@now_text.sub!(/\[([0-9]+)\]/, "")
self.contents.font.size = [[$1.to_i, 6].max, 32].min
c = ""
end
if c == "\026"
@now_text.sub!(/\[([0-9]+)\]/, "")
@x += $1.to_i
c = ""
end
if c == "\027"
process_ruby
if SOUNDNAME_ON_SPEAK != ""
Audio.se_play("Audio/SE/" + SOUNDNAME_ON_SPEAK)
end
c = ""
end
if c == "\030"
@now_text.sub!(/\[(.*?)\]/, "")
self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
if SOUNDNAME_ON_SPEAK != ""
Audio.se_play("Audio/SE/" + SOUNDNAME_ON_SPEAK)
end
@x += 24
c = ""
end
if c == "\n"
@y += 1
@line_index += 1
line_reset
if @line_index >= $game_temp.choice_start
@cursor_width = @max_choice_x
end
c = ""
end
if c == "\022"
@now_text.sub!(/\[([0-9]+)\]/, "")
@x += draw_gaiji(4 + @x, @y * line_height + (line_height - self.contents.font.size), $1.to_i)
if SOUNDNAME_ON_SPEAK != "" then
Audio.se_play("Audio/SE/" + SOUNDNAME_ON_SPEAK)
end
c = ""
end
if c == "\031"
self.contents.font.bold ^= true
c = ""
end
if c == "\032"
self.contents.font.italic ^= true
c = ""
end
if c != ""
self.contents.draw_text(4+@x, line_height * @y, 40, line_height, c)
@x += self.contents.text_size(c).width
if SOUNDNAME_ON_SPEAK != "" then
Audio.se_play("Audio/SE/" + SOUNDNAME_ON_SPEAK)
end
end
if skippable_now? and
(Input.press?(KEY_SHOW_ALL) or Input.press?(KEY_MESSAGE_SKIP)) and
(SKIP_BAN_SWITCH_ID == 0 ? true : !$game_switches[SKIP_BAN_SWITCH_ID])
text_not_skip = false
end
else
text_not_skip = true
break
end
break if text_not_skip
end
@write_wait += @write_speed
return
end
if @input_number_window != nil
@input_number_window.update
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
$game_variables[$game_temp.num_input_variable_id] = @input_number_window.number
$game_map.need_refresh = true
@input_number_window.dispose
@input_number_window = nil
terminate_message
end
return
end
if @contents_showing
if $game_temp.choice_max == 0
self.pause = true
end
unless @fade_phase_before_terminate
if Input.trigger?(Input::B)
if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
$game_system.se_play($data_system.cancel_se)
$game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
terminate_message
return
end
end
if Input.trigger?(Input::C) or
(skippable_now? and Input.press?(KEY_MESSAGE_SKIP))
if $game_temp.choice_max > 0
$game_system.se_play($data_system.decision_se)
$game_temp.choice_proc.call(self.index)
end
if @mid_stop
@mid_stop = false
return
elsif @fade_count_before_terminate.to_i > 0
@fade_phase_before_terminate = true
else
terminate_message
end
end
end
if @fade_phase_before_terminate
@fade_count_before_terminate = 0 if @fade_count_before_terminate == nil
@fade_count_before_terminate -= 1
opacity = @fade_count_before_terminate * (256 / XRXS9::FOBT_DURATION)
self.contents_opacity = opacity
if @fade_count_before_terminate <= 0
@fade_count_before_terminate = 0
@fade_phase_before_terminate = false
terminate_message
end
end
return
end
if @fade_out == false and $game_temp.message_text != nil
@contents_showing = true
$game_temp.message_window_showing = true
refresh
Graphics.frame_reset
self.visible = true
self.contents_opacity = 0
if @input_number_window != nil
@input_number_window.contents_opacity = 0
end
@fade_in = true
return
end
if self.visible
@fade_out = true
self.opacity -= 48
if self.opacity == 0
self.visible = false
@fade_out = false
$game_temp.message_window_showing = false
end
return
end
end
def reset_window
if @inforesize
RectalCopy.copy(self, INFO_RECT)
elsif self.pop_character != nil and self.pop_character >= 0
update_reset_window
else
RectalCopy.copy(self, DEFAULT_RECT)
case ($game_temp.in_battle ? 0 : $game_system.message_position)
when 0
self.y = [16, -XRXS9::NAME_WINDOW_OFFSET_Y + 4].max
when 1
self.y = 160
end
if DEFAULT_STRETCH_ENABLE and @lines_max >= 4
d = @lines_max * DEFAULT_LINE_SPACE + 32 - self.height
if d > 0
self.height += d
case $game_system.message_position
when 1
self.y -= d/2
when 2
self.y -= d
end
end
end
if @face_file != nil
self.width += FACE_WIDTH
self.x -= FACE_WIDTH/2
end
end
if $game_system.message_frame == 0
self.back_opacity = DEFAULT_BACK_OPACITY
@name_window_frame.back_opacity = DEFAULT_BACK_OPACITY unless @name_window_frame.nil?
else
self.opacity = 0
@name_window_frame.back_opacity = 0 unless @name_window_frame.nil?
end
end
def update_reset_window
if self.pop_character == 0 or $game_map.events[self.pop_character] != nil
character = get_character(self.pop_character)
x = character.screen_x - self.width / 2
case $game_system.message_position
when 0
if @name_window_frame != nil and @name_window_frame.y <= 4
y = 4 - XRXS9::NAME_WINDOW_OFFSET_Y
else
y = character.screen_y - CHARPOP_HEIGHT - self.height
end
else
y = character.screen_y
end
self.x = [[x, 4].max, 636 - self.width ].min
self.y = [[y, 4].max, 476 - self.height].min
if @name_window_frame != nil
@name_window_frame.x = self.x + XRXS9::NAME_WINDOW_OFFSET_X
@name_window_frame.y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y
@name_window_text.x = self.x + XRXS9::NAME_WINDOW_OFFSET_X + 1 + XRXS9::NAME_WINDOW_SPACE/2 - 16
@name_window_text.y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y + 1 + XRXS9::NAME_WINDOW_SPACE/2 - 16
end
end
end
def update_cursor_rect
if @index >= 0
n = $game_temp.choice_start + @index
self.cursor_rect.set(8 + @indent, n * line_height, @cursor_width, line_height)
else
self.cursor_rect.empty
end
end
def get_character(parameter)

case parameter
when 0
return $game_player
else
events = $game_map.events
return events == nil ? nil : events[parameter]
end
end
def skippable_now?
return ((SKIP_BAN_SWITCH_ID == 0 ? true : !$game_switches[SKIP_BAN_SWITCH_ID]) and
(HISKIP_ENABLE_SWITCH_ID == 0 ? true : $game_switches[HISKIP_ENABLE_SWITCH_ID]))
end
def visible=(b)
@name_window_frame.visible = b unless @name_window_frame.nil?
@name_window_text.visible = b unless @name_window_text.nil?
@input_number_window.visible = b unless @input_number_window.nil?
super
end
def process_ruby
end
def draw_gaiji(x, y, num)
end
def convart_value(option, index)
end
end
class Air_Text < Window_Base
def initialize(x, y, designate_text, size, text_color)
super(x-16, y-16, 32 + designate_text.size * 12, 56)
self.opacity = 0
self.contents = Bitmap.new(self.width - 32, self.height - 32)
w = self.contents.width
h = self.contents.height
self.contents.font.size = size
self.contents.font.color = text_color
self.contents.draw_text(0, 0, w, h, designate_text)
end
end
class Window_Copy < Window_Base
def initialize(window)
super(window.x, window.y, window.width, window.height)
self.contents = window.contents.dup unless window.contents.nil?
self.opacity = window.opacity
self.back_opacity = window.back_opacity
self.z = window.z
end
end
class Sprite_Copy < Sprite
def initialize(sprite)
super()
self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
self.opacity = sprite.opacity
self.x = sprite.x
self.y = sprite.y
self.z = sprite.z
self.ox = sprite.ox
self.oy = sprite.oy
end
end
class Interpreter
def command_101
if $game_temp.message_text != nil
return false
end
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
$game_temp.message_text = @list[@index].parameters[0] + "\n"
line_count = 1
loop do
if @list[@index+1].code == 401
$game_temp.message_text += @list[@index+1].parameters[0] + "\n"
line_count += 1
else
if @list[@index+1].code == 101
if (/\\next\Z/.match($game_temp.message_text)) != nil
$game_temp.message_text.gsub!(/\\next/) { "" }
$game_temp.message_text += @list[@index+1].parameters[0] + "\n"
@index += 1
next
end
elsif @list[@index+1].code == 102
if @list[@index+1].parameters[0].size <= 4 - line_count
@index += 1
$game_temp.choice_start = line_count
setup_choices(@list[@index].parameters)
end
elsif @list[@index+1].code == 103
if line_count < 4
@index += 1
$game_temp.num_input_start = line_count
$game_temp.num_input_variable_id = @list[@index].parameters[0]
$game_temp.num_input_digits_max = @list[@index].parameters[1]
end
end
return true
end
@index += 1
end
end
end
class Game_Player < Game_Character
attr_accessor :messaging_moving
end
module RectalCopy
def self.copy(rect1, rect2)
rect1.x = rect2.x
rect1.y = rect2.y
rect1.width = rect2.width
rect1.height = rect2.height
end
end
#--------------------------------------------------------------------------
class Window_Message < Window_Selectable
GAIJI_FILE = "gaiji.png" # Nome do arquivo de imagem.
GAIJI_SIZE = 24 # Tamanho de leitura da imagem.
end
class Interpreter
def pretend_stopping=(b)
@pretend_stopping = b
end
alias xrxs9_running? running?
def running?
return (not @pretend_stopping and xrxs9_running?)
end
end
class Game_Player < Game_Character
alias xrxs9_update update
def update
return xrxs9_update unless @messaging_moving
last_showing = $game_temp.message_window_showing
$game_system.map_interpreter.pretend_stopping = true
$game_temp.message_window_showing = false
xrxs9_update
$game_temp.message_window_showing = last_showing
$game_system.map_interpreter.pretend_stopping = nil
end
end
class Game_Event < Game_Character
alias xrxs9_start start
def start
xrxs9_start
if @starting and $game_player.messaging_moving
$game_player.messaging_moving = false
end
end
end
class Window_Message < Window_Selectable
def draw_gaiji(x, y, num)
if @gaiji_cache == nil
if RPG_FileTest.picture_exist?(GAIJI_FILE)
@gaiji_cache = RPG::Cache.picture(GAIJI_FILE)
else
return 0
end
end
if @gaiji_cache.width < num * GAIJI_SIZE
return 0
end
size = GAIJI_SIZE
self.contents.stretch_blt(Rect.new(x, y, size, size), @gaiji_cache, Rect.new(num * GAIJI_SIZE, 0, GAIJI_SIZE, GAIJI_SIZE))
if SOUNDNAME_ON_SPEAK != "" then
Audio.se_play(SOUNDNAME_ON_SPEAK)
end
return size
end
def convart_value(option, index)
option == nil ? option = "" : nil
option.downcase!
case option
when "i"
unless $data_items[index].name == nil
r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
end
when "w"
unless $data_weapons[index].name == nil
r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
end
when "a"
unless $data_armors[index].name == nil
r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
end
when "s"
unless $data_skills[index].name == nil
r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
end
else
r = $game_variables[index]
end

r == nil ? r = "" : nil
return r
end
end
class Window_Message < Window_Selectable
def process_ruby
@now_text.sub!(/\[(.*?)\]/, "")
x = @x
y = @y * line_height
w = 40
h = line_height
@x += self.contents.draw_ruby_text(x, y, w, h, $1)
end
end
class Bitmap
def draw_ruby_text(x, y, w, h, str)
sizeback = self.font.size
self.font.size * 3 / 2 > 32 ? rubysize = 32 - self.font.size : rubysize = self.font.size / 2
rubysize = [rubysize, 6].max
split_s = str.split(/,/)
split_s[0] = "" if split_s[0] == nil
split_s[1] = "" if split_s[1] == nil
height = sizeback + rubysize
width = self.text_size(split_s[0]).width
self.font.size = rubysize
ruby_width = self.text_size(split_s[1]).width
self.font.size = sizeback
buf_width = [self.text_size(split_s[0]).width, ruby_width].max
width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
self.font.size = rubysize
self.draw_text(x + sub_x, 4 + y - self.font.size, self.text_size(split_s[1]).width, self.font.size, split_s[1])
self.font.size = sizeback
self.draw_text(x, y, width, h, split_s[0])
return width
end
end
#-------------------------------------------------------------------------------
module XRXS9
BACKLOG_KEY = Input::Y # Definição da tecla da janela de Log
BACKLOG_MAX_HEIGHT = 1600 # Altura maxima da janela de log
BACKLOG_MAX_INDEX = 12 # Quantidade maxima de frases.
end
class Window_Message < Window_Selectable
alias xrxs9ax_initialize initialize
def initialize
xrxs9ax_initialize
@log_window = Window_MessageLog.new
@log_window.z = self.z + 100
end
alias xrxs9ax_terminate_message terminate_message
def terminate_message
@log_window.add_log(@current_name, self.contents)
xrxs9ax_terminate_message
end
alias xrxs9ax_update_main update_main
def update_main
if Input.trigger?(XRXS9::BACKLOG_KEY) and $game_temp.message_window_showing
self.visible = false
@log_window.show
self.visible = true
return
end
xrxs9ax_update_main
end
end
class Window_MessageLog < Window_Base
def initialize
super(0,0,640,480)
self.visible = false
self.back_opacity = 160
self.contents = Bitmap.new(width - 32, XRXS9::BACKLOG_MAX_HEIGHT)
self.contents.font.color = XRXS9::NAME_WINDOW_TEXT_COLOR
self.contents.font.size = XRXS9::NAME_WINDOW_TEXT_SIZE
@names = []
@contetns = []
end
def show
self.refresh
self.visible = true
loop do
Graphics.update
Input.update
self.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
self.visible = false
break
end
end
end
def update
super
if Input.repeat?(Input::UP) and self.oy >= 32
$game_system.se_play($data_system.cursor_se)
self.oy -= 32
return
end
if Input.repeat?(Input::DOWN) and self.oy <= XRXS9::BACKLOG_MAX_HEIGHT - 448
$game_system.se_play($data_system.cursor_se)
self.oy += 32
return
end
end
def cut_excess(limit_index)
for i in [email protected]
next if @contetns.nil?
@contetns.dispose
@contetns = nil
@names = nil
end
@contetns.compact!
@names.compact!
end
def add_log(name, contents)
@names.insert(0, name.to_s)
@contetns.insert(0, contents.dup)
cut_excess(XRXS9::BACKLOG_MAX_INDEX)
end
def refresh
y = XRXS9::BACKLOG_MAX_HEIGHT
index = 0
self.contents.clear
loop do
contents = @contetns[index]
if contents.nil? or y <= 0
break
end
self.contents.blt(4, y - contents.height, contents, contents.rect)
y -= contents.height
self.contents.draw_text(4, y-24, 600, 24, @names[index].to_s)
y -= 32
index += 1
end
cut_excess(index)
self.oy = XRXS9::BACKLOG_MAX_HEIGHT - 416
end
def dispose
for contents in @contetns
next if contents.nil?
contents.dispose
end
super
end
end
#------------------------------------------------------------------------------
module XRXS9C
SWITCH_ID = 8 #Definição da Switch que ativa a mensagem cinematografica.
RECT = Rect.new(0,400,640,96)#X,Y,H,L,D da janela de mensagem cine.
end
class Window_Message < Window_Selectable
alias xrxs9c_reset_window reset_window
def reset_window
if $game_switches[XRXS9C::SWITCH_ID]
RectalCopy.copy(self, XRXS9C::RECT)
self.opacity = 0
@line_aligns[0] = CENTER
@line_aligns[1] = CENTER
return
end
xrxs9c_reset_window
end
end
class Scene_Map
alias xrxs9c_main main
def main
black = Color.new(0,0,0,255)
@cinemasks = []
mask = Sprite.new
mask.bitmap = Bitmap.new(640,48)
mask.bitmap.fill_rect(0,0,640,48, black)
mask.x = 0
mask.y = -48
mask.z = 5001
@cinemasks[0] = mask
mask = Sprite.new
mask.bitmap = Bitmap.new(640,72)
mask.bitmap.fill_rect(0,0,640,72, black)
mask.x = 0
mask.y = 480
mask.z = 5001
@cinemasks[1] = mask
mask = Sprite.new
mask.bitmap = Bitmap.new(640,480)
mask.bitmap.fill_rect(0,0,640,480, black)
mask.x = 0
mask.y = 0
mask.z = 199
mask.opacity = 0
@cinemasks[2] = mask
@cinema_fadecount = 24
xrxs9c_main
@cinemasks.each{|sprite| sprite.dispose }
end
alias xrxs9c_update update
def update
update_cinema
xrxs9c_update
end
def update_cinema
if ( $game_switches[XRXS9C::SWITCH_ID] and @cinema_fadecount > 0) or
(not $game_switches[XRXS9C::SWITCH_ID] and @cinema_fadecount < 24)
@cinema_fadecount += ($game_switches[XRXS9C::SWITCH_ID] ? -1 : 1)
@cinemasks[0].y = 0 - 6 * @cinema_fadecount / 3
@cinemasks[1].y = 480 - 9 * (24 - @cinema_fadecount) / 3
@cinemasks[2].opacity = 4 * (24 - @cinema_fadecount)
end
end
end
#-------------------------------------------------------------------------------
class Window_Message < Window_Selectable
def pop_character=(character_id)
@pop_character = character_id
$mes_id = character_id
end
end

Solo páguenlo encima de Main y ya está. Pronto más.
 
Mensajes
944
Reacciones
0
Puntos
0
Ubicación
En los Cuarteles del Clan Uchiha [Jefazo]
Estoy Trabajando en un Script Hecho por un Tipo que sirve para crear a tu gusto el Pj antes de empezar a jugar,el script esta echo y muy bien echo lo malo es .. los recursos utilizados en este scrip,t asi que toy modificando algunas imagenes y otras cosas y lo pondre para compartir, el script se llama Easy Character creator!


Noche y Día
Descripción:
Se hace de noche o de día dependiendo de la hora.

Instrucciones:
Poner encima de Main en una nueva clase.
Para que funcione es necesario poner un * al final del nombre de los mapas.

Script:
Código:
#=======================================#
class Game_Time

attr_accessor :minute_length
attr_accessor :hours
attr_accessor :minutess
attr_accessor :timess

def initialize
@minute_length= 60.0      #length of game minute in real seconds
@hour_length= 60.0      #minute in an hour
@day_length=24.0        #hours in a day
@month_length=30.0    #days in a month
@year_length=12.0       #months in a year
@minutes=0                 #starting minute count
@timess=Time.now           #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end

def get_time
@timess=Time.now           #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end
def get_tone
get_time
hour=hours
minutes=minutess + hour*@hour_length
phase_shift=Math::PI*(minutes/(@hour_length*@day_length))
illumination=  -150+ 165*Math.sin(phase_shift)
tone=Tone.new(illumination,illumination,illumination,0)
return tone
end

end # of class Game_Time  

#=======================================#
# ââ€â€œ¦nbsp; class Window_Time                                                            #
# written by Deke                                                                      #
#------------------------------------------------------------------------------#
#=======================================#
class Window_Time < Window_Base

#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype  # "Time" window font
self.contents.font.size = $defaultfontsize
refresh
end

#--------------------------------------------------------------------------
def refresh
$game_time.get_time
self.contents.clear
@total_sec = Graphics.frame_count / Graphics.frame_rate
@minute=$game_time.minutess
hour = $game_time.hours
pm_flag= hour >=12 ? true : false
hour= hour >= 12 ? hour-12 : hour
if hour.floor==0
 text=sprintf("%02d:%02d",12,@minute)
else
 text=sprintf("%02d:%02d",hour,@minute)
end
if pm_flag
 text += " PM"
else
 text += " AM"
end
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, text, 2)
end

#--------------------------------------------------------------------------
def update
$game_time.get_time
if $game_time.minutess != @minute
 refresh
end
end
end # of class

#=======================================
class Game_Temp
#--------------------------------------------------------------------------
# ââ€â€? Refer setup to Game Temp
#--------------------------------------------------------------------------
alias dns_game_temp_initalize initialize
#--------------------------------------------------------------------------
# ââ€â€? Refer the Attr
#--------------------------------------------------------------------------
attr_reader    :map_infos  #Added Lines
attr_reader    :outside_array  #Added Lines
#--------------------------------------------------------------------------
# ââ€â€? Refer setup to Scene Map
#--------------------------------------------------------------------------
def initialize
dns_game_temp_initalize
@outside_array = Array.new
@map_infos = load_data("Data/MapInfos.rxdata")
for key in @map_infos.keys
    @outside_array[key] = @map_infos[key].name.include?("*")
end
end
end

#=======================================
class Scene_Map
#--------------------------------------------------------------------------
# ââ€â€? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_map_main main
alias dns_scene_map_update update
#--------------------------------------------------------------------------
# ââ€â€? Main
#--------------------------------------------------------------------------
def main
 if $game_temp.outside_array[$game_map.map_id]
   tone=$game_time.get_tone
 $game_time.get_time
  @minute=$game_time.minutess
  $game_screen.start_tone_change(tone, 0)
end
    # スãÆ'â€â€ãÆ'©ã‚¤ãÆ'ˆã‚»ãÆ'Æ'ãÆ'ˆã‚’ä½Å“æˆ?
@spriteset = Spriteset_Map.new
# ãÆ'¡ãÆ'Æ'ã‚»ãÆ'¼ã‚¸ã‚¦ã‚£ãÆ'³ãÆ'‰ã‚¦ã‚’ä½Å“æˆ?
@message_window = Window_Message.new
# ãÆ'ˆãÆ'©ãÆ'³ã‚¸ã‚·ãÆ'§ãÆ'³å®Å¸è¡Å'
Graphics.transition
# ãÆ'¡ã‚¤ãÆ'³ãÆ'«ãÆ'¼ãÆ'â€â€
loop do
  $light_effects.refresh
  # ゲãÆ'¼ãÆ' ç※é?¢ã‚’æ›´æâ€â€œ°
  Graphics.update
  # 入力æÆ'â€¦å ±ã‚’æ›´æâ€â€œ°
  Input.update
  # ãÆ'•ãÆ'¬ãÆ'¼ãÆ' æ›´æâ€â€œ°
  update
  # ç※é?¢ã?Å'切り替ã‚?ã?£ã?Ÿã‚‰ãÆ'«ãÆ'¼ãÆ'â€â€ã‚’ä¸*æâ€â€œ*
  if $scene != self
    break
  end
end
# ãÆ'ˆãÆ'©ãÆ'³ã‚¸ã‚·ãÆ'§ãÆ'³æºâ€â€œå‚™
Graphics.freeze
# スãÆ'â€â€ãÆ'©ã‚¤ãÆ'ˆã‚»ãÆ'Æ'ãÆ'ˆã‚’解æ‾
@spriteset.dispose
# ãÆ'¡ãÆ'Æ'ã‚»ãÆ'¼ã‚¸ã‚¦ã‚£ãÆ'³ãÆ'‰ã‚¦ã‚’解æ‾
@message_window.dispose
# タイãÆ'ˆãÆ'«ç※é?¢ã?«åˆ‡ã‚Šæ›¿ã?ˆä¸*ã?®å ´å?ˆ
if $scene.is_a?(Scene_Title)
  # ç※é?¢ã‚’ãÆ'•ã‚§ãÆ'¼ãÆ'‰ã‚¢ã‚¦ãÆ'ˆ
  Graphics.transition
  Graphics.freeze
end
$light_effects.hide
end
#--------------------------------------------------------------------------
# ââ€â€? Update
#--------------------------------------------------------------------------
def update
$game_time.get_time
$light_effects.update
 conditional1 =$game_temp.outside_array[$game_map.map_id] and $game_time.minutess != @minute
 conditional2 =$game_temp.outside_array[$game_map.map_id] and @current_id != $game_map.map_id
 if  conditional1 or conditional2    
       tone=$game_time.get_tone
       $game_screen.start_tone_change(tone, 0)
       @minute = $game_time.minutess
       $game_map.need_refresh=true
       @current_id=$game_map.map_id
 end
 if $game_temp.outside_array[$game_map.map_id] == false and @current_id != $game_map.map_id
    $game_screen.start_tone_change(Tone.new(0,0,0,0),0)
    @current_id=$game_map.map_id
end
dns_scene_map_update
end
end

#======================================================
class Scene_Title
#--------------------------------------------------------------------------
# ââ€â€? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_title_update update
#--------------------------------------------------------------------------
# ââ€â€? Refer setup to Scene Map
#--------------------------------------------------------------------------
def update
$game_time=Game_Time.new
#Dubealex Addition (from XRXS) to show Map Name on screen
dns_scene_title_update
end
end

class Game_Map
#--------------------------------------------------------------------------
# ââ€â€? Refer the attr
#--------------------------------------------------------------------------
attr_reader   :outside
attr_reader   :map_id
#--------------------------------------------------------------------------
# ââ€â€? Outside
#--------------------------------------------------------------------------
def outside
 return $game_temp.outside_array[@map_id]
end
end

#==============================================================================
# ââ€â€œ¦nbsp; Light Effect System
#------------------------------------------------------------------------------
#  By: Near Fantastica
#   Date: 13/2/05
#
#   Addes light Effects to the DNS so objects glow and have ground effect lighting...
#==============================================================================

class Light_Effect_System
#--------------------------------------------------------------------------
# ââ€â€? Refer the attr
#--------------------------------------------------------------------------
attr_accessor    :picture_le
attr_accessor    :event_list
attr_accessor    :type_list
#--------------------------------------------------------------------------
# ââ€â€? Initialization
#--------------------------------------------------------------------------
def initialize
@event_counter = 0
@picture_le = Array.new
@event_list = Array.new
@type_list = Array.new
end
#--------------------------------------------------------------------------
# ââ€â€? Setup Light Effects on Map Change
#--------------------------------------------------------------------------
def setup
# Setup Event Max
@event_counter = 0
for i in 1..999
  if $game_map.map.events[i].id > @event_counter
    @event_counter = $game_map.map.events[i].id
  end
end
#
for i in 1..@event_counter
  if  $game_map.map.events[i] == nil
    next
  end
  case $game_map.map.events[i].name
  when "Ground"
    ground(i)
  when "Fire"
    fire(i)
  when "Lamp Post"
    lamp(i)
  when "Left Lantern"
    left_lantern(i)
  when "Right Lantern"
    right_lantern(i)
  end
end
end
#--------------------------------------------------------------------------
# ââ€â€? Updates the Array based on time of day
#--------------------------------------------------------------------------
def update
$game_time.get_time
if $game_time.hours > 7 and $game_time.hours < 14
  hide
else
  show
end
end
#--------------------------------------------------------------------------
# ââ€â€? Updates the XY of the sprites
#--------------------------------------------------------------------------
def refresh
for i in 0..$light_effects.picture_le.size - 1
  case $light_effects.type_list[i]
  when "Ground"
    $light_effects.picture_le[i].x = ($game_map.events[$light_effects.event_list[i]].real_x - 200 - $game_map.display_x) / 4
    $light_effects.picture_le[i].y = ($game_map.events[$light_effects.event_list[i]].real_y - 200 - $game_map.display_y) / 4
    $light_effects.picture_le[i].visible = true
  when "Fire"
    $light_effects.picture_le[i].x = ($game_map.events[$light_effects.event_list[i]].real_x - 300 - $game_map.display_x) / 4
    $light_effects.picture_le[i].y = ($game_map.events[$light_effects.event_list[i]].real_y - 300 - $game_map.display_y) / 4
    $light_effects.picture_le[i].visible = true
  when "Left Lamp Post"
    $light_effects.picture_le[i].x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list[i]].x * 32) - 5
    $light_effects.picture_le[i].y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list[i]].y * 32) - 15
  when "Right Lamp Post"
    $light_effects.picture_le[i].x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list[i]].x * 32) - 25
    $light_effects.picture_le[i].y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list[i]].y * 32) - 15
    $light_effects.picture_le[i].visible = true
  when "Left Lantern"
    $light_effects.picture_le[i].x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list[i]].x * 32) - 20
      $light_effects.picture_le[i].y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list[i]].y * 32) - 5
      $light_effects.picture_le[i].visible = true
  when "Right Lantern"
    $light_effects.picture_le[i].x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list[i]].x * 32) - 10
    $light_effects.picture_le[i].y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list[i]].y * 32) - 5
    $light_effects.picture_le[i].visible = true
  end
end
end
#--------------------------------------------------------------------------
# ââ€â€? Redraws the Array
#--------------------------------------------------------------------------
def redraw
if @picture_le != []
  for i in 0..@picture_le.size - 1
    @picture_le[i].bitmap.dispose
  end
  @picture_le = Array.new
  @event_list = Array.new
  @type_list = Array.new
end
end
#--------------------------------------------------------------------------
# ââ€â€? Shows Array
#--------------------------------------------------------------------------
def show
if @picture_le != []
  for i in 0..@picture_le.size - 1
    @picture_le[i].visible = true
  end
end
end
#--------------------------------------------------------------------------
# ââ€â€? Hides Array
#--------------------------------------------------------------------------
def hide
if @picture_le != []
  for i in 0..@picture_le.size - 1
     @picture_le[i].visible = false
  end
end
end
#--------------------------------------------------------------------------
# ââ€â€? Setup Light Effects for Ground
#--------------------------------------------------------------------------
def ground(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.zoom_x = 200 / 100.0
light_effects.zoom_y = 200 / 100.0
light_effects.z = 1000
light_effects.opacity = 50
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Ground")
end
#--------------------------------------------------------------------------
# ââ€â€? Setup Light Effects for Fire
#--------------------------------------------------------------------------
def fire(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.zoom_x = 300 / 100.0
light_effects.zoom_y = 300 / 100.0
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Fire")
end
#--------------------------------------------------------------------------
# ââ€â€? Setup Light Effects for Lamp
#--------------------------------------------------------------------------
def lamp(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Left Lamp Post")
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Right Lamp Post")
end
#--------------------------------------------------------------------------
# ââ€â€? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def left_lantern(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 150
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Left Lantern")
end
#--------------------------------------------------------------------------
# ââ€â€? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def right_lantern(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 150
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Right Lantern")
end
end

#==============================================================================
# ââ€â€œ¦nbsp; Game_Map
#------------------------------------------------------------------------------
#  Add defenision of the names to Game Map Class
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# ââ€â€? Refer the attr
#--------------------------------------------------------------------------
attr_accessor :map
#--------------------------------------------------------------------------
# ââ€â€? Refer setup to Game Map
#--------------------------------------------------------------------------
alias les_game_map_setup setup
#--------------------------------------------------------------------------
# ââ€â€? Refers the Map Setup
#--------------------------------------------------------------------------
def setup(map_id)
$light_effects.redraw
les_game_map_setup(map_id)
$light_effects.setup
end
end

#==============================================================================
# ââ€â€œ¦nbsp; Scene_Title
#------------------------------------------------------------------------------
#  It is the class which processes the title picture
#==============================================================================

class Scene_Title
#--------------------------------------------------------------------------
# ââ€â€? Refer setup to Scene Title
#--------------------------------------------------------------------------
alias les_scene_title_update update
#--------------------------------------------------------------------------
# ââ€â€? Sets up the ABS
#--------------------------------------------------------------------------
def update
$light_effects = Light_Effect_System.new
les_scene_title_update
end
end

Créditos a "Desconocido"

Advance Equip System

Descripción:
Un sistema avanzado de la pantalla equipo, que sustituye a la que hay por defecto. Con la opción de optimizar el equipo, para un personaje en concreto.

Instalación:
Simplemente, pegar arriba del Main y probar el juego:

Código:
#=============================================================
=================
# Harts Horn's Equip Screen
#------------------------------------------------------------------------------
# Ventana de Equipamiento personalizada con opcion para optimizar.
#==============================================================================

class Harts_Window_EquipTitle < Window_Base
#--------------------------------------------------------------------------
# Inicializacion de Objetos
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, $data_system.words.equip, 1)
end
end

#==============================================================================
# Ventana de comandos
#------------------------------------------------------------------------------
# Esta es la ventana que muestra los comandos =P
#==============================================================================

class Harts_Window_EquipCommand < Window_Selectable
#--------------------------------------------------------------------------
# Inicializacion de Objetos
#--------------------------------------------------------------------------
def initialize
super(160, 0, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 3
@column_max = 3
@commands = ["Modificar", "Optimizar", "Salir"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# Actualizacion
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
x = index * 160 + 4
self.contents.draw_text(x, 0, 128, 32, @commands[index], 1)
end
end

#==============================================================================
# Harts_Window_EquipItem
#==============================================================================

class Harts_Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# Inicializacion de Objetos
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
super(272, 256, 368, 160)
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
def max_item_id
if @equip_type == 0
if @actor.weapon_id == 0
max = 0
else
max = $data_weapons[@actor.weapon_id].atk
end
elsif @equip_type == 1
if @actor.armor1_id == 0
max = 0
else
max = $data_armors[@actor.armor1_id].pdef
end
elsif @equip_type == 2
if @actor.armor2_id == 0
max = 0
else
max = $data_armors[@actor.armor2_id].pdef
end
elsif @equip_type == 3
if @actor.armor3_id == 0
max = 0
else
max = $data_armors[@actor.armor3_id].pdef
end
end
for i in [email protected]
if @equip_type == 0
if max <= $data_weapons[@data[i].id].atk
max = $data_weapons[@data[i].id].atk
item_id = @data[i].id
end
elsif @equip_type >= 1
if max <= $data_armors[@data[i].id].pdef
max = $data_armors[@data[i].id].pdef
item_id = @data[i].id
end
end
end
return item_id
end
#--------------------------------------------------------------------------
# Actualizacion
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
if @equip_type >= 1
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4
y = index * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 280, y, 16, 32, ":", 1)
self.contents.draw_text(x + 296, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end

#==============================================================================
# Harts_Window_EquipLeft
#==============================================================================

class Harts_Window_EquipLeft < Window_Base
#--------------------------------------------------------------------------
# Inicializacion de Objetos
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 352)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 32, 64)
draw_actor_name(@actor, 4 + 96, 0)
draw_actor_level(@actor, 4 + 96, 32)
draw_actor_parameter(@actor, 4, 80, 0)
draw_actor_parameter(@actor, 4, 112, 1)
draw_actor_parameter(@actor, 4, 144, 2)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
if @new_atk != nil and @new_atk != @actor.atk
if @new_atk > @actor.atk
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 80, 40, 32, "?", 1)
self.contents.draw_text(200, 80, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil and @new_pdef != @actor.pdef
if @new_pdef > @actor.pdef
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 112, 40, 32, "?", 1)
self.contents.draw_text(200, 112, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil and @new_mdef != @actor.mdef
if @new_mdef > @actor.mdef
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 144, 40, 32, "?", 1)
self.contents.draw_text(200, 144, 36, 32, @new_mdef.to_s, 2)
end
if @new_str != nil and @new_str != @actor.str
if @new_str > @actor.str
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 192, 40, 32, "?", 1)
self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil and @new_dex != @actor.dex
if @new_dex > @actor.dex
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 224, 40, 32, "?", 1)
self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil and @new_agi != @actor.agi
if @new_agi > @actor.agi
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 256, 40, 32, "?", 1)
self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil and @new_int != @actor.int
if @new_int > @actor.int
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 288, 40, 32, "?", 1)
self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
end
end
#--------------------------------------------------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
refresh
end
end
end

#==============================================================================
# Harts_Scene_Equip
#==============================================================================

class Scene_Equip
#--------------------------------------------------------------------------
# Inicializacion de Objetos
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = -1, command_index = 0, equip_active = false, command_active = true)
@actor_index = actor_index
@equip_index = equip_index
@command_index = command_index
@equip_active = equip_active
@command_active = command_active
end
#--------------------------------------------------------------------------
# Metodo principal
#--------------------------------------------------------------------------
def main
@actor = $game_party.actors[@actor_index]
@title_window = Harts_Window_EquipTitle.new
@command_window = Harts_Window_EquipCommand.new
@help_window = Window_Help.new
@help_window.y = 416
@left_window = Harts_Window_EquipLeft.new(@actor)
@right_window = Window_EquipRight.new(@actor)
@item_window0 = Harts_Window_EquipItem.new(@actor, -1)
@item_window1 = Harts_Window_EquipItem.new(@actor, 0)
@item_window2 = Harts_Window_EquipItem.new(@actor, 1)
@item_window3 = Harts_Window_EquipItem.new(@actor, 2)
@item_window4 = Harts_Window_EquipItem.new(@actor, 3)
@item_window5 = Harts_Window_EquipItem.new(@actor, 4)
@right_window.help_window = @help_window
@item_window0.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
@command_window.index = @command_index
@right_window.index = @equip_index
@command_window.active = @command_active
@right_window.active = @equip_active
refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@title_window.dispose
@command_window.dispose
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window0.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
end
#--------------------------------------------------------------------------
# Actualizacion
#--------------------------------------------------------------------------
def refresh
@item_window0.visible = (@right_window.index == -1)
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
item1 = @right_window.item
case @right_window.index
when -1
@item_window = @item_window0
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
if @right_window.active
@left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
end
if @item_window.active
item2 = @item_window.item
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
end
end
#--------------------------------------------------------------------------
# Actualizacion
#--------------------------------------------------------------------------
def update
@title_window.update
@command_window.update
@left_window.update
@right_window.update
@item_window.update
refresh
if @command_window.active
update_command
return
end
if @right_window.active
update_right
return
end
if @item_window.active
update_item
return
end
end
#--------------------------------------------------------------------------
# Actualizacion de los comandos
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(2)
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
@right_window.active = true
@command_window.active = false
@right_window.index = 0
@command_window.index = -1
return
when 1
$game_system.se_play($data_system.equip_se)
max_weapon_id = @item_window1.max_item_id
max_armor1_id = @item_window2.max_item_id
max_armor2_id = @item_window3.max_item_id
max_armor3_id = @item_window4.max_item_id
@actor.equip(0, max_weapon_id)
@actor.equip(1, max_armor1_id)
@actor.equip(2, max_armor2_id)
@actor.equip(3, max_armor3_id)
@right_window.refresh
@left_window.refresh
@item_window1.refresh
@item_window2.refresh
@item_window3.refresh
@item_window4.refresh
return
when 2
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(2)
return
end
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
return
end
end
#--------------------------------------------------------------------------
def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = false
@command_window.active = true
@right_window.index = -1
@command_window.index = 0
return
end
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
return
end
end
#--------------------------------------------------------------------------
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @item_window.item
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
@right_window.refresh
@item_window.refresh
return
end
end
end


Creditos: Harts Horn
 
Mensajes
657
Reacciones
0
Puntos
0
Ubicación
EMUDESC, el mejor sitio de Emulación de todo Inter
Subir de nivel al estilo final fántasy:
Script Subir Nivel al Estilo Final Fantasy

Pasos para subir nivel al estilo Final Fantasy

1.Lee con mucha atención los textos en rojo de este documento, el resto es solo copiar y pegar

2. Entra a la ventana de Scripts

3. Ve a la ventana Game_Actor y sustituye todo lo que hay por esto:

#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  Esta clase trata los personajes.
#==============================================================================

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# - Creamos las variables...
#--------------------------------------------------------------------------
attr_reader :name # Nombre
attr_reader :character_name # Nombre del personaje
attr_reader :character_hue # Color del personaje
attr_reader :class_id # ID de profesion
attr_reader :weapon_id # ID de arma
attr_reader :armor1_id # ID de escudo
attr_reader :armor2_id # ID de casco
attr_reader :armor3_id # ID de armadura
attr_reader :armor4_id # ID de accesiorios
attr_reader :level # Nivel
attr_reader :exp # Experiencia (EXP)
attr_reader :skills # Habilidades
#--------------------------------------------------------------------------
# - Inicio de Objetos...
# actor_id : ID del Personaje
#--------------------------------------------------------------------------
def initialize(actor_id)
super()
setup(actor_id)
end
#--------------------------------------------------------------------------
# - Opciones
# actor_id : ID del Personaje
#--------------------------------------------------------------------------
def setup(actor_id)
actor = $data_actors[actor_id]
@actor_id = actor_id
@name = actor.name
@character_name = actor.character_name
@character_hue = actor.character_hue
@battler_name = actor.battler_name
@battler_hue = actor.battler_hue
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@level = actor.initial_level
@exp_list = Array.new(101)
make_exp_list
@exp = @exp_list[@level]
@skills = []
@hp = maxhp
@sp = maxsp
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
# Uso de habilidades
for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
learn_skill(j.skill_id)
end
end
end
# Actualizar estado auto.
update_auto_state(nil, $data_armors[@armor1_id])
update_auto_state(nil, $data_armors[@armor2_id])
update_auto_state(nil, $data_armors[@armor3_id])
update_auto_state(nil, $data_armors[@armor4_id])
end
#--------------------------------------------------------------------------
# - Uso de ID de Personaje
#--------------------------------------------------------------------------
def id
return @actor_id
end
#--------------------------------------------------------------------------
# - Uso de Indice
#--------------------------------------------------------------------------
def index
return $game_party.actors.index(self)
end
#--------------------------------------------------------------------------
# - Calculo de 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..100
if i > actor.final_level
@exp_list = 0
else
n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
@exp_list = @exp_list[i-1] + Integer(n)
end
end
end
#--------------------------------------------------------------------------
# - Uso del valor compensado del atributo
# element_id : ID de elemento
#--------------------------------------------------------------------------
def element_rate(element_id)
# Uso del valor numerico que correspondiente al grado de atributo
table = [0,200,150,100,50,0,-100]
result = table[$data_classes[@class_id].element_ranks[element_id]]
# Partir en 2 cuando se defiende con el protector
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors
if armor != nil and armor.guard_element_set.include?(element_id)
result /= 2
end
end
# Partir en 2 cuando se defiende con el estado
for i in @states
if $data_states.guard_element_set.include?(element_id)
result /= 2
end
end
# Fin del Metodo
return result
end
#--------------------------------------------------------------------------
# - Uso del grado de estado
#--------------------------------------------------------------------------
def state_ranks
return $data_classes[@class_id].state_ranks
end
#--------------------------------------------------------------------------
# - Juicio de estado de defensa
# state_id : ID de estado
#--------------------------------------------------------------------------
def state_guard?(state_id)
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors
if armor != nil
if armor.guard_state_set.include?(state_id)
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# - Uso del atributo de un ataque normal
#--------------------------------------------------------------------------
def element_set
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.element_set : []
end
#--------------------------------------------------------------------------
# - Uso del cambio de estado de un ataque normal (+)
#--------------------------------------------------------------------------
def plus_state_set
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.plus_state_set : []
end
#--------------------------------------------------------------------------
# - Uso del cambio de estado de un ataque normal (-)
#--------------------------------------------------------------------------
def minus_state_set
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.minus_state_set : []
end
#--------------------------------------------------------------------------
# - Uso de MaxPV
#--------------------------------------------------------------------------
def maxhp
n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states.maxhp_rate / 100.0
end
n = [[Integer(n), 1].max, 9999].min
return n
end
#--------------------------------------------------------------------------
# - Uso basico de MaxPV
#--------------------------------------------------------------------------
def base_maxhp
return $data_actors[@actor_id].parameters[0, @level]
end
#--------------------------------------------------------------------------
# - Uso basico de MaxPM
#--------------------------------------------------------------------------
def base_maxsp
return $data_actors[@actor_id].parameters[1, @level]
end
#--------------------------------------------------------------------------
# - Uso basico de Fuerza Fisica
#--------------------------------------------------------------------------
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, 999].min
end
#--------------------------------------------------------------------------
# - Uso basico de Destreza
#--------------------------------------------------------------------------
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, 999].min
end
#--------------------------------------------------------------------------
# - Uso basico de Agilidad
#--------------------------------------------------------------------------
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, 999].min
end
#--------------------------------------------------------------------------
# - Uso basico de magia
#--------------------------------------------------------------------------
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, 999].min
end
#--------------------------------------------------------------------------
# - Uso basico de Ataque
#--------------------------------------------------------------------------
def base_atk
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.atk : 0
end
#--------------------------------------------------------------------------
# - Uso basico de defensa
#--------------------------------------------------------------------------
def base_pdef
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]
pdef1 = weapon != nil ? weapon.pdef : 0
pdef2 = armor1 != nil ? armor1.pdef : 0
pdef3 = armor2 != nil ? armor2.pdef : 0
pdef4 = armor3 != nil ? armor3.pdef : 0
pdef5 = armor4 != nil ? armor4.pdef : 0
return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
end
#--------------------------------------------------------------------------
# - Uso basico de defensa magica
#--------------------------------------------------------------------------
def base_mdef
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]
mdef1 = weapon != nil ? weapon.mdef : 0
mdef2 = armor1 != nil ? armor1.mdef : 0
mdef3 = armor2 != nil ? armor2.mdef : 0
mdef4 = armor3 != nil ? armor3.mdef : 0
mdef5 = armor4 != nil ? armor4.mdef : 0
return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
end
#--------------------------------------------------------------------------
# - Uso basico de Correccion de evasion
#--------------------------------------------------------------------------
def base_eva
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
eva1 = armor1 != nil ? armor1.eva : 0
eva2 = armor2 != nil ? armor2.eva : 0
eva3 = armor3 != nil ? armor3.eva : 0
eva4 = armor4 != nil ? armor4.eva : 0
return eva1 + eva2 + eva3 + eva4
end
#--------------------------------------------------------------------------
# - Ataque normal. Uso de la ID de la animacion de ataque lateral.
#--------------------------------------------------------------------------
def animation1_id
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.animation1_id : 0
end
#--------------------------------------------------------------------------
# - Ataque normal. Uso de la ID de la animacion de objeto lateral.
#--------------------------------------------------------------------------
def animation2_id
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.animation2_id : 0
end
#--------------------------------------------------------------------------
# - Uso del nombre de la Profesion
#--------------------------------------------------------------------------
def class_name
return $data_classes[@class_id].name
end
#--------------------------------------------------------------------------
# - Uso de secuencia de caracteres de EXP
#--------------------------------------------------------------------------
def exp_s
return @exp_list[@level+1] > 0 ? @exp.to_s : "-------"
end
#--------------------------------------------------------------------------
# - Siguiente nivel. Uso de secuencia de caracteres de EXP
#--------------------------------------------------------------------------
def next_exp_s
return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "-------"
end
#--------------------------------------------------------------------------
# - Subir al siguiente nivel. Uso de secuencia de caracteres de EXP
#--------------------------------------------------------------------------
def next_rest_exp_s
return @exp_list[@level+1] > 0 ?
(@exp_list[@level+1] - @exp).to_s : "-------"
end
#--------------------------------------------------------------------------
# - Renovacion de Estado auto.
# old_armor : Protector removido
# new_armor : Protector equipado
#--------------------------------------------------------------------------
def update_auto_state(old_armor, new_armor)
# Estado autom. del protector removido es cancelado
if old_armor != nil and old_armor.auto_state_id != 0
remove_state(old_armor.auto_state_id, true)
end
# Estado autom. del protector equipado es cancelado
if new_armor != nil and new_armor.auto_state_id != 0
add_state(new_armor.auto_state_id, true)
end
end
#--------------------------------------------------------------------------
# - Juicio de equipo fijo
# equip_type : Tipo de equipo
#--------------------------------------------------------------------------
def equip_fix?(equip_type)
case equip_type
when 0 # Brazos
return $data_actors[@actor_id].weapon_fix
when 1 # Escudo
return $data_actors[@actor_id].armor1_fix
when 2 # Casco
return $data_actors[@actor_id].armor2_fix
when 3 # Armadura
return $data_actors[@actor_id].armor3_fix
when 4 # Accesorios
return $data_actors[@actor_id].armor4_fix
end
return false
end
#--------------------------------------------------------------------------
# - Cambio de equipamiento
# equip_type : Tipo de equipo
# id : ID de Brazos o protectores (Si es 0 lanzar equipamiento)
#--------------------------------------------------------------------------
def equip(equip_type, id)
case equip_type
when 0 # Brazos
if id == 0 or $game_party.weapon_number(id) > 0
$game_party.gain_weapon(@weapon_id, 1)
@weapon_id = id
$game_party.lose_weapon(id, 1)
end
when 1 # Escudo
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor1_id], $data_armors[id])
$game_party.gain_armor(@armor1_id, 1)
@armor1_id = id
$game_party.lose_armor(id, 1)
end
when 2 # Casco
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor2_id], $data_armors[id])
$game_party.gain_armor(@armor2_id, 1)
@armor2_id = id
$game_party.lose_armor(id, 1)
end
when 3 # Armadura
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor3_id], $data_armors[id])
$game_party.gain_armor(@armor3_id, 1)
@armor3_id = id
$game_party.lose_armor(id, 1)
end
when 4 # Accesorios
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor4_id], $data_armors[id])
$game_party.gain_armor(@armor4_id, 1)
@armor4_id = id
$game_party.lose_armor(id, 1)
end
end
end
#--------------------------------------------------------------------------
# - Juicio de equipamiento
# item : Objeto
#--------------------------------------------------------------------------
def equippable?(item)
# Si Brazos
if item.is_a?(RPG::Weapon)
# Cuando los brazos estan utilizados puedes equipar la clase presente
if $data_classes[@class_id].weapon_set.include?(item.id)
return true
end
end
# Si Protector
if item.is_a?(RPG::Armor)
# Cuando los protectores estan utilizados puedes equipar la clase presente
if $data_classes[@class_id].armor_set.include?(item.id)
return true
end
end
return false
end
#--------------------------------------------------------------------------
# - Cambio de EXP
# exp : Nueva EXP
#--------------------------------------------------------------------------
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
# Mejoracion
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# Uso de habilidades
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
# Agravante
while @exp < @exp_list[@level]
@level -= 1
end
# El PV corriente se corregira, si el PM sobrepasa el maximo
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# - Cambio de nivel
# level : Nuevo nivel
#--------------------------------------------------------------------------
def level=(level)
# Subir chequeo minimo
level = [[level, $data_actors[@actor_id].final_level].min, 1].max
# Cambiar EXP
self.exp = @exp_list[level]
end
#--------------------------------------------------------------------------
# - Memorizar Habilidad
# skill_id : ID de la Habilidad
#--------------------------------------------------------------------------
def learn_skill(skill_id)
if skill_id > 0 and not skill_learn?(skill_id)
@skills.push(skill_id)
@skills.sort!
end
end
#--------------------------------------------------------------------------
# - Olvidar Habilidad
# skill_id : ID de la Habilidad
#--------------------------------------------------------------------------
def forget_skill(skill_id)
@skills.delete(skill_id)
end
#--------------------------------------------------------------------------
# - Juicio dominado de habilidad
# skill_id : ID de la Habilidad
#--------------------------------------------------------------------------
def skill_learn?(skill_id)
return @skills.include?(skill_id)
end
#--------------------------------------------------------------------------
# - Juicio de la habilidad que puede usarse
# skill_id : ID de la Habilidad
#--------------------------------------------------------------------------
def skill_can_use?(skill_id)
if not skill_learn?(skill_id)
return false
end
return super
end
#--------------------------------------------------------------------------
# - Cambio de nombre
# name : Nuevo nombre
#--------------------------------------------------------------------------
def name=(name)
@name = name
end
#--------------------------------------------------------------------------
# - Cambio de ID de profesion
# class_id : ID de profesion
#--------------------------------------------------------------------------
def class_id=(class_id)
if $data_classes[class_id] != nil
@class_id = class_id
# Objeto imposible de equipar es removido
unless equippable?($data_weapons[@weapon_id])
equip(0, 0)
end
unless equippable?($data_armors[@armor1_id])
equip(1, 0)
end
unless equippable?($data_armors[@armor2_id])
equip(2, 0)
end
unless equippable?($data_armors[@armor3_id])
equip(3, 0)
end
unless equippable?($data_armors[@armor4_id])
equip(4, 0)
end
end
end
#--------------------------------------------------------------------------
# - Cambio de graficos
# character_name : Nombre de archivo del nuevo Personaje
# character_hue : Color de nuevo Personaje
# battler_name : Nombre de archivo del nuevo Personaje de Batalla
# battler_hue : Color de nuevo Personaje de Batalla
#--------------------------------------------------------------------------
def set_graphic(character_name, character_hue, battler_name, battler_hue)
@character_name = character_name
@character_hue = character_hue
@battler_name = battler_name
@battler_hue = battler_hue
end
#--------------------------------------------------------------------------
# - Pantalla de batalla. Uso de la coodenada X
#--------------------------------------------------------------------------
def screen_x
# Desde el orden de una fila en el grupo, las coor X se calculan y devuelven
if self.index != nil
return self.index * 160 + 80
else
return 0
end
end
#--------------------------------------------------------------------------
# - Pantalla de batalla. Uso de la coodenada Y
#--------------------------------------------------------------------------
def screen_y
return 464
end
#--------------------------------------------------------------------------
# - Pantalla de batalla. Uso de la coodenada Z
#--------------------------------------------------------------------------
def screen_z
# Desde el orden de una fila en el grupo, las coor Z se calculan y devuelven
if self.index != nil
return 4 - self.index
else
return 0
end
end
end


4. Debajo de la ventana Window_DebugRight , crea uno nuevo llamado Window_Level_Up y
pon esto:

#=================================
#Window_LevelUp
# Written by: David Schooley
#=================================

class Window_LevelUp < Window_Base

#----------------------------------------------------------------
def initialize(actor, pos)
@actor = actor
y = (pos * 120)
super(280, y, 360, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.back_opacity = 255
if $d_dum == false
refresh
end
end

#----------------------------------------------------------------
def dispose
super
end

#----------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 260, 75)
draw_actor_name(@actor, 0, 0)
draw_actor_level(@actor, 75, 0)
self.contents.font.color = system_color
self.contents.draw_text(0, 30, 80, 32, "EXP actual")
self.contents.draw_text(0, 60, 80, 32, "Siguiente Nivel")
self.contents.font.color = normal_color
self.contents.draw_text(84, 30, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(84, 60, 84, 32, @actor.next_rest_exp_s, 2)
end


#----------------------------------------------------------------
def level_up
self.contents.font.color = system_color
self.contents.draw_text(230, 55, 80, 32, "Nivel arriba!")
end



#----------------------------------------------------------------
def learn_skill(skill)
self.contents.font.color = normal_color
self.contents.draw_text(160, 0, 80, 32, "Aprendes:")
self.contents.font.color = system_color
self.contents.draw_text(235, 0, 90, 32, skill)
end


#----------------------------------------------------------------
def draw_shadow
# Draw Shadow
end


#----------------------------------------------------------------
def update
super
end

end # of Window_LevelUp


5. Debajo de Window_Level_Up, crea uno nuevo llamado Window_Exp y pon o
siguiente:
#============================================================
# After Battle Changes
#------------------------------------------------------------------------------
# by Slipknot
#============================================================

module Battle_End_Options
#--------------------------------------------------------------------------
# Split experience received?
#--------------------------------------------------------------------------
Split_Exp = true
#--------------------------------------------------------------------------
# Full recover when actor increase level?
#--------------------------------------------------------------------------
Level_Up_Recover = true
#--------------------------------------------------------------------------
# End wait time, in frames
#--------------------------------------------------------------------------
End_Frames = 80
end

class Scene_Battle
#--------------------------------------------------------------------------
include Battle_End_Options
#--------------------------------------------------------------------------
def start_phase5
@phase = 5
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
exp = gold = 0
treasures = []
for enemy in $game_troop.enemies
unless enemy.hidden
exp += enemy.exp
gold += enemy.gold
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
treasures = treasures[0..5]
psize = $game_party.actors.size-1
if Split_Exp
can_get = 0
0.upto(psize) do can_get += 1 end
exp = (exp /= can_get).ceil if can_get > 0
end
for i in 0..psize
actor = $game_party.actors
unless actor.cant_get_exp?
last_level = actor.level
actor.exp += exp
if actor.level > last_level
@status_window.level_up(i)
if Level_Up_Recover
actor.hp = actor.maxhp
actor.sp = actor.maxsp
end
end
end
end
$game_party.gain_gold(gold)
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
@result_window = Window_BattleResult.new(exp, gold, treasures)
@phase5_wait_count = End_Frames
end
end

#=================================
#Window_EXP
# Written by: David Schooley
#=================================

class Window_EXP < Window_Base

#----------------------------------------------------------------
def initialize(exp)
super(0, 0, 280, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.back_opacity = 255
refresh(exp)
end

#----------------------------------------------------------------
def dispose
super
end

#----------------------------------------------------------------
def refresh(exp)
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 150, 32, "Experiencia:")
self.contents.font.color = normal_color
self.contents.draw_text(180, 0, 54, 32, exp.to_s, 2)
end


#----------------------------------------------------------------
def draw_shadow
# Draw Shadow
end


#----------------------------------------------------------------
def update
super
end

end # of Window_EXP


6. Debajo de Window_exp crea uno nuevo llamado Window_Money_Items y pon lo siguiente:
#=================================
#Window_Money_Items
# Written by: David Schooley
#=================================

class Window_Money_Items < Window_Base

#----------------------------------------------------------------
def initialize(money, treasures)
@treasures = treasures
super(0, 60, 280, 420)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.back_opacity = 255
refresh(money)
end

#----------------------------------------------------------------
def dispose
super
end

#----------------------------------------------------------------
def refresh(money)
@money = money
self.contents.clear

self.contents.font.color = system_color
self.contents.draw_text(4, 4, 100, 32, "Objetos Obtenidos:")
self.contents.font.color = normal_color

y = 32
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end

cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 340, 220-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(4, 300, 220-cx-2, 32, "+ " + @money.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 340, cx + 100, 32, $data_system.words.gold, 2)
end


#----------------------------------------------------------------
def draw_shadow
# Draw Shadow
end


#----------------------------------------------------------------
def update
super
end

end # of Window_Money_Items


7. Luego ve a Scene_battle 1 y sustituye todo por esto:


#==============================================================================
# ■ Scene_Battle (1)
#------------------------------------------------------------------------------

class Scene_Battle
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
def main

# NEW - David
#$battle_end = false
@lvup_window = []
@show_dummies = true # Show dummy windows or not?

# 戦闘用の各種一時データを初期化
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# バトルイベント用インタプリタを初期化
$game_system.battle_interpreter.setup(nil, 0)
# トループを準備
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# アクターコマンドウィンドウを作成
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
# その他のウィンドウを作成
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# スプライトセットを作成
@spriteset = Spriteset_Battle.new
# ウェイトカウントを初期化
@wait_count = 0
# トランジション実行
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# プレバトルフェーズ開始
start_phase1
# メインループ
loop do
# ゲーム画面を更新
Graphics.update
# 入力情報を更新
Input.update
# フレーム更新
update
# 画面が切り替わったらループを中断
if $scene != self
break
end
end
# マップをリフレッシュ
$game_map.refresh
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose

# NEW - David
@lvup_window = nil
@level_up = nil
@ch_stats = nil
@ch_compare_stats = nil

if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# スプライトセットを解放

# NEW - David
#@spriteset.dispose

# タイトル画面に切り替え中の場合
if $scene.is_a?(Scene_Title)
# 画面をフェードアウト
Graphics.transition
Graphics.freeze
end
# 戦闘テストからゲームオーバー画面以外に切り替え中の場合
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
#--------------------------------------------------------------------------
# ● 勝敗判定
#--------------------------------------------------------------------------
def judge
# 全滅判定が真、またはパーティ人数が 0 人の場合
if $game_party.all_dead? or $game_party.actors.size == 0
# 敗北可能の場合
if $game_temp.battle_can_lose
# バトル開始前の BGM に戻す
$game_system.bgm_play($game_temp.map_bgm)
# バトル終了
battle_end(2)
# true を返す
return true
end
# ゲームオーバーフラグをセット
$game_temp.gameover = true
# true を返す
return true
end
# エネミーが 1 体でも存在すれば false を返す
for enemy in $game_troop.enemies
if enemy.exist?
return false
end
end
# アフターバトルフェーズ開始 (勝利)
start_phase5
# true を返す
return true
end
#--------------------------------------------------------------------------
# ● バトル終了
# result : 結果 (0:勝利 1:敗北 2:逃走)
#--------------------------------------------------------------------------
def battle_end(result)
# 戦闘中フラグをクリア
$game_temp.in_battle = false
# パーティ全員のアクションをクリア
$game_party.clear_actions
# バトル用ステートを解除
for actor in $game_party.actors
actor.remove_states_battle
end
# エネミーをクリア
$game_troop.enemies.clear
# バトル コールバックを呼ぶ
if $game_temp.battle_proc != nil
$game_temp.battle_proc.call(result)
$game_temp.battle_proc = nil
end
# マップ画面に切り替え
$scene = Scene_Map.new

# NEW - David
@status_window.visible = false
@spriteset.dispose
Graphics.transition
if result == 0
display_lv_up(@exp, @gold, @treasures)
loop do
Graphics.update
Input.update
if Input.trigger?(Input::C)
break
end
end
trash_lv_up
end

end
#--------------------------------------------------------------------------
# ● バトルイベントのセットアップ
#--------------------------------------------------------------------------
def setup_battle_event
# バトルイベント実行中の場合
if $game_system.battle_interpreter.running?
return
end
# バトルイベントの全ページを検索
for index in 0...$data_troops[@troop_id].pages.size
# イベントページを取得
page = $data_troops[@troop_id].pages[index]
# イベント条件を c で参照可能に
c = page.condition
# 何も条件が指定されていない場合は次のページへ
unless c.turn_valid or c.enemy_valid or
c.actor_valid or c.switch_valid
next
end
# 実行済みの場合は次のページへ
if $game_temp.battle_event_flags[index]
next
end
# ターン 条件確認
if c.turn_valid
n = $game_temp.battle_turn
a = c.turn_a
b = c.turn_b
if (b == 0 and n != a) or
(b > 0 and (n < 1 or n < a or n % b != a % b))
next
end
end
# エネミー 条件確認
if c.enemy_valid
enemy = $game_troop.enemies[c.enemy_index]
if enemy == nil or enemy.hp * 100.0 / enemy.maxhp > c.enemy_hp
next
end
end
# アクター 条件確認
if c.actor_valid
actor = $game_actors[c.actor_id]
if actor == nil or actor.hp * 100.0 / actor.maxhp > c.actor_hp
next
end
end
# スイッチ 条件確認
if c.switch_valid
if $game_switches[c.switch_id] == false
next
end
end
# イベントをセットアップ
$game_system.battle_interpreter.setup(page.list, 0)
# このページのスパンが [バトル] か [ターン] の場合
if page.span <= 1
# 実行済みフラグをセット
$game_temp.battle_event_flags[index] = true
end
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
# バトルイベント実行中の場合
if $game_system.battle_interpreter.running?
# インタプリタを更新
$game_system.battle_interpreter.update
# アクションを強制されているバトラーが存在しない場合
if $game_temp.forcing_battler == nil
# バトルイベントの実行が終わった場合
unless $game_system.battle_interpreter.running?
# 戦闘継続の場合、バトルイベントのセットアップを再実行
unless judge
setup_battle_event
end
end
# アフターバトルフェーズでなければ
if @phase != 5
# ステータスウィンドウをリフレッシュ
@status_window.refresh
end
end
end
# システム (タイマー)、画面を更新
$game_system.update
$game_screen.update
# タイマーが 0 になった場合
if $game_system.timer_working and $game_system.timer == 0
# バトル中断
$game_temp.battle_abort = true
end
# ウィンドウを更新
@help_window.update
@party_command_window.update
@actor_command_window.update
@status_window.update
@message_window.update
# スプライトセットを更新
@spriteset.update
# トランジション処理中の場合
if $game_temp.transition_processing
# トランジション処理中フラグをクリア
$game_temp.transition_processing = false
# トランジション実行
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# メッセージウィンドウ表示中の場合
if $game_temp.message_window_showing
return
end
# エフェクト表示中の場合
if @spriteset.effect?
return
end
# ゲームオーバーの場合
if $game_temp.gameover
# ゲームオーバー画面に切り替え
$scene = Scene_Gameover.new
return
end
# タイトル画面に戻す場合
if $game_temp.to_title
# タイトル画面に切り替え
$scene = Scene_Title.new
return
end
# バトル中断の場合
if $game_temp.battle_abort
# バトル開始前の BGM に戻す
$game_system.bgm_play($game_temp.map_bgm)
# バトル終了
battle_end(1)
return
end
# ウェイト中の場合
if @wait_count > 0
# ウェイトカウントを減らす
@wait_count -= 1
return
end
# アクションを強制されているバトラーが存在せず、
# かつバトルイベントが実行中の場合
if $game_temp.forcing_battler == nil and
$game_system.battle_interpreter.running?
return
end
# フェーズによって分岐
case @phase
when 1
update_phase1
when 2
update_phase2
when 3
update_phase3
when 4
update_phase4
when 5
update_phase5
end
end
end


8. Luego ve a Scene_Battle 2 y sustituye todo por esto:
#==============================================================================
# ■ Scene_Battle (2)
#------------------------------------------------------------------------------
class Scene_Battle
#--------------------------------------------------------------------------
def start_phase1
@phase = 1
$game_party.clear_actions
setup_battle_event
end
#--------------------------------------------------------------------------
def update_phase1
if judge
return
end
start_phase2
end
#--------------------------------------------------------------------------
def start_phase2
@phase = 2
@actor_index = -1
@active_battler = nil
@party_command_window.active = true
@party_command_window.visible = true
@actor_command_window.active = false
@actor_command_window.visible = false
$game_temp.battle_main_phase = false
$game_party.clear_actions
unless $game_party.inputable?
start_phase4
end
end
#--------------------------------------------------------------------------
def update_phase2
if Input.trigger?(Input::C)
case @party_command_window.index
when 0
$game_system.se_play($data_system.decision_se)
start_phase3
when 1
if $game_temp.battle_can_escape == false
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
update_phase2_escape
end
return
end
end
#--------------------------------------------------------------------------
def update_phase2_escape
enemies_agi = 0
enemies_number = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
enemies_number += 1
end
end
if enemies_number > 0
enemies_agi /= enemies_number
end
actors_agi = 0
actors_number = 0
for actor in $game_party.actors
if actor.exist?
actors_agi += actor.agi
actors_number += 1
end
end
if actors_number > 0
actors_agi /= actors_number
end
success = rand(100) < 50 * actors_agi / enemies_agi
if success
$game_system.se_play($data_system.escape_se)
$game_system.bgm_play($game_temp.map_bgm)
battle_end(1)
else
$game_party.clear_actions
start_phase4
end
end
#--------------------------------------------------------------------------
def start_phase5
@phase = 5
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
exp = 0
gold = 0
treasures = []
for enemy in $game_troop.enemies
unless enemy.hidden
exp += enemy.exp
gold += enemy.gold
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
treasures = treasures[0..5]



# NEW - David
@treasures = treasures
@exp = exp
@gold = gold


# NEW - David
# for i in 0...$game_party.actors.size
# actor = $game_party.actors
# if actor.cant_get_exp? == false
# last_level = actor.level
# actor.exp += exp
# if actor.level > last_level
# @status_window.level_up(i)

# NEW - David
# @level_up = true
# @are_level_ups = true

# end
# end
# end
# $game_party.gain_gold(gold)


for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end

# NEW - David
#@result_window = Window_BattleResult.new(exp, gold, treasures)
@phase5_wait_count = 100
end
#--------------------------------------------------------------------------
def update_phase5
if @phase5_wait_count > 0
@phase5_wait_count -= 1
if @phase5_wait_count == 0

# NEW - David
#@result_window.visible = true
$game_temp.battle_main_phase = false
#@status_window.refresh
end
return
end
# NEW - David
# if Input.trigger?(Input::C)
battle_end(0)
# end
end
end


9. despues de Scene_Battle 4, crea uno nuevo llamado Scene_Battle D y pon lo
siguiente:

#==============================================================================
# Scene_Battle D
# Written by: David Schooley
#==============================================================================

class Scene_Battle

def display_lv_up(exp, gold, treasures)

$d_dum = false
d_extra = 0
i = 0
for actor in $game_party.actors
# Fill up the Lv up windows
@lvup_window = Window_LevelUp.new($game_party.actors, i)
i += 1
end

# Make Dummies
if @show_dummies == true
$d_dum = true
for m in i..3
@lvup_window[m] = Window_LevelUp.new(m, m)
end
end

@exp_window = Window_EXP.new(exp)
@m_i_window = Window_Money_Items.new(gold, treasures)
@press_enter = nil
gainedexp = exp
@level_up = [0, 0, 0, 0]
@d_new_skill = ["", "", "", ""]
@d_breakout = false
@m_i_window.refresh(gold)
wait_for_OK

@d_remember = $game_system.bgs_memorize
Audio.bgs_play("Audio/SE/032-Switch01.ogg", 100, 300)

# NEW - David
for n in 0..gainedexp - 1
exp -= 1
if @d_breakout == false
Input.update
end

for i in 0...$game_party.actors.size
actor = $game_party.actors

if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += 1

# Fill up the Lv up windows
if @d_breakout == false
@lvup_window.refresh
@exp_window.refresh(exp)
end

if actor.level > last_level
@level_up = 10
Audio.se_play("Audio/SE/056-Right02.ogg", 70, 150)
if $d_new_skill
@d_new_skill = $d_new_skill
end
end

if @level_up == 0
@d_new_skill = ""
end

if @level_up > 0
@lvup_window.level_up
if @d_new_skill != ""
@lvup_window.learn_skill(@d_new_skill)
end
end

if Input.trigger?(Input::C)
@d_breakout = true
end

end

if @d_breakout == false
if @level_up >0
@level_up -= 1
end
Graphics.update
end
end

if @d_breakout == true
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor.cant_get_exp? == false
actor.exp += exp
end
end
exp = 0
break
end

end

Audio.bgs_stop
@d_remember = $game_system.bgs_restore

for i in 0...$game_party.actors.size
@lvup_window.refresh
end
@exp_window.refresh(exp)

Audio.se_play("Audio/SE/006-System06.ogg", 70, 150)
$game_party.gain_gold(gold)
@m_i_window.refresh(0)
Graphics.update

end

def trash_lv_up

# NEW - David
i=0
for i in 0 ... 4
@lvup_window.visible = false
end
@exp_window.visible = false
@m_i_window.visible = false
@lvup_window = nil
@exp_window = nil
@m_i_window = nil

end



# Wait until OK key is pressed
def wait_for_OK
loop do
Input.update
Graphics.update
if Input.trigger?(Input::C)
break
end
end
end

end


Eso es todo. Pronto más
 
Mensajes
116
Reacciones
0
Puntos
0
Ubicación
Colina, Region Metropolitana, Chile
INTRODUCCION
Bueno este scripts es para elegir entre varios personajes al principio del juego

SCREENSHOT
U255-1191078876.jpg

U255-1191078931.jpg

DEMOSTRACION
http://rapidshare.com/files/59091580/MOG_Char_Select.rar.html
SCRIPT
Código:
#_________________________________________________
# MOG_Character Select Screen V1.1          
#_________________________________________________
# By Moghunter  
# http://www.atelier-rgss.com
#_________________________________________________
module MOG
#Transition Type(Name).  
CSTR = "006-Stripe02"  
end
$mogscript = {} if $mogscript == nil
$mogscript["char_select"] = true
############
# Win Char #
############
class Win_Char < Window_Selectable
def initialize
super(-600, 0, 150, 150)
@column_max = 2
self.opacity = 0
refresh    
self.index = 1
self.visible = false
end
def item
return @data[self.index]
end  
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@item_max = 8
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end end end  
def draw_item(index)
end end
##############
# Scene_Char #
##############
class Scene_Char
def main
@command_window = Win_Char.new
@command_window.back_opacity = 0
@command_window.visible = false
@command_window.index = 0    
@back = Plane.new
@back.bitmap = RPG::Cache.picture("MN_BK")
@back.z = 10
@char_back = Sprite.new
@char_back.bitmap = RPG::Cache.picture("CH_Menu0")
@char_back.z = 20
@char_back.opacity = 0
@char_sel = Sprite.new
@char_sel.bitmap =  RPG::Cache.picture("CH_ID1")
@char_sel.z = 100
@char_sel.opacity = 0
@char_name = Sprite.new
@char_name.bitmap = RPG::Cache.battler("001-Fighter01",0)
@char_name.z = 100
@char_name.x = -300
@char_name.y = 180    
@char_name.opacity = 0
@fundo6 = Plane.new
@fundo6.bitmap = RPG::Cache.fog("Fog01",0)
@fundo6.blend_type = 1
@fundo6.z = 15
@fundo6.opacity = 200   
actor = $data_actors[1]
@name = Sprite.new
@name.bitmap = Bitmap.new(200,100)
@name.bitmap.font.size = 48
@name.bitmap.font.bold = false
@name.bitmap.font.name = "Georgia"
@name.color.set(0,0,0)    
@name.x = 100
@name.y = 500
@name.z = 9998
@name.color.set(0,0,0,255)
@name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)
@name2 = Sprite.new
@name2.bitmap = Bitmap.new(160,100)
@name2.bitmap.font.size = 48
@name2.bitmap.font.bold = false
@name2.bitmap.font.name = "Georgia"
@name2.color.set(0,0,0)    
@name2.x = 102
@name2.y = 502
@name2.z = 9998
@name2.color.set(55,200,255,255)
@name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)
Graphics.transition(60, "Graphics/Transitions/" + MOG::CSTR,1)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end end
for i in 1..50
@char_back.zoom_x += 0.01
@char_back.opacity -= 10
@char_back.x -= 5
@char_name.x -= 3
@char_name.y -= 3
@char_name.zoom_x += 0.02
@char_name.zoom_y += 0.02    
@char_name.opacity -= 7
@char_sel.opacity -= 10
@char_sel.zoom_x += 0.01
@char_sel.opacity -= 10
@char_sel.x -= 5
@name.opacity -= 10
@name2.opacity -= 10    
Graphics.update  
end
Graphics.freeze
@command_window.dispose
@back.dispose
@char_back.dispose
@char_sel.dispose
@char_name.dispose
@fundo6.dispose
@name.dispose
@name2.dispose
$game_map.autoplay
end
def update
@back.ox -= 1
@fundo6.ox += 1
@fundo6.oy += 1    
@command_window.update    
@char_back.opacity += 10
@char_sel.opacity += 10
if @char_name.x < 100
@char_name.x += 20
@char_name.opacity += 6
@name.y -= 7
@name.opacity += 6
@name2.y -= 7
@name2.opacity += 6       
elsif @char_name.x >= 0  
@char_name.x = 100
@name.y = 370
@name.opacity = 255
@name2.y = 372
@name2.opacity = 255
@char_name.opacity = 255
@char_back.opacity = 255
@char_sel.opacity = 255
end    
case @command_window.index
when 0
actor = $data_actors[1]  
@char_sel.bitmap =  RPG::Cache.picture("CH_ID1")
@char_name.bitmap = RPG::Cache.battler("001-Fighter01",0)
@name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)    
@name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)    
when 1
actor = $data_actors[2]
@char_sel.bitmap =  RPG::Cache.picture("CH_ID2")
@char_name.bitmap = RPG::Cache.battler("010-Lancer02",0)
@name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s) 
@name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)      
when 2
actor = $data_actors[3]      
@char_sel.bitmap =  RPG::Cache.picture("CH_ID3")
@char_name.bitmap = RPG::Cache.battler("013-Warrior01",0)   
@name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)  
@name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)    
when 3
actor = $data_actors[4]      
@char_sel.bitmap = RPG::Cache.picture("CH_ID4")
@char_name.bitmap = RPG::Cache.battler("019-Thief04",0)
@name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)
@name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)        
when 4
actor = $data_actors[5]      
@char_sel.bitmap = RPG::Cache.picture("CH_ID5")
@char_name.bitmap = RPG::Cache.battler("008-Fighter08",0)
@name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s) 
@name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)      
when 5
actor = $data_actors[6]      
@char_sel.bitmap = RPG::Cache.picture("CH_ID6")  
@char_name.bitmap = RPG::Cache.battler("023-Gunner01",0)
@name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)  
@name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)     
when 6
actor = $data_actors[7]      
@char_sel.bitmap = RPG::Cache.picture("CH_ID7")  
@char_name.bitmap = RPG::Cache.battler("029-Cleric05",0)
@name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)
@name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)    
when 7
actor = $data_actors[8]      
@char_sel.bitmap =  RPG::Cache.picture("CH_ID8") 
@char_name.bitmap = RPG::Cache.battler("038-Mage06",0)    
@name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)
@name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)       
end
if Input.press?(Input.dir4)
@char_name.x = -300
@name.y = 500
@name.opacity = 0
@name2.y = 502
@name2.opacity = 0
@char_name.opacity = 0
@name.bitmap.clear
@name2.bitmap.clear
end
if Input.trigger?(Input::B)
$scene = Scene_Title.new  
end    
if Input.trigger?(Input::C)
Audio.se_play("Audio/SE/007-System07", 150,150)      
case @command_window.index
when 0 
$game_party.add_actor(1)
when 1      
$game_party.add_actor(2)
when 2
$game_party.add_actor(3)
when 3
$game_party.add_actor(4)
when 4
$game_party.add_actor(5)
when 5
$game_party.add_actor(6)   
when 6
$game_party.add_actor(7)  
when 7
$game_party.add_actor(8)    
end
$scene = Scene_Map.new 
end 
end
end
INSTRUCCIONES

deben de poner un llamar scripts y ponen esto
Código:
$scene = Scene_Char.new
uego poner esperar 1 frame
y por ultimo poner: Interruptor local: A= ON
deben de estar seguro que en pictures esten las caras en el orden y lugar correspondiente como en la demo.

PD:esto lo saque de otro foro asi que el credito no es mio
PD2:me podrian decir donde bajar el RPG MAKER XP en español es que me formatearon el PC y se me olvido grabarlo
 
Última edición:
Mensajes
15
Reacciones
0
Puntos
0
hola a todos , queria saber si alguien podia poner un scrip de un sistema de batalla visto de costado estilo los primeros final fantasy


saludos ...
 
Mensajes
725
Reacciones
14
Puntos
0
Ubicación
En Venezuela
bueno me encontre este script y lo estoy usando para mi juego de zelda

script de mini mapa

Código:
#============================================================================== 
# ■ Passability Mini Map 
#------------------------------------------------------------------------------ 
# made by squall // [mail][email protected][/mail] 
# released the 30th of May 2006 
#============================================================================== 

#============================================================================== 
# ■ Scene_Map 
#------------------------------------------------------------------------------ 
# draw the mini map 
# @corner is the corner you want the mini map to be displayed in. 
# 1 is upper left, 2 is upper right, 3 is bottom left and 4 is bottom right 
#============================================================================== 

class Scene_Map 
 alias main_passminimap main 
 alias update_passminimap update 
 alias transfer_passminimap transfer_player 
 #-------------------------------------------------------------------------- 
 # ● initialize 
 #-------------------------------------------------------------------------- 
 def initialize 
   @corner = 4 # 1 or 2 or 3 or 4 
 end 
 #-------------------------------------------------------------------------- 
 # ● main 
 #-------------------------------------------------------------------------- 
 def main 
   @mini_map = Map_Event.new(@corner) 
   main_passminimap 
   @mini_map.dispose 
 end 
 #-------------------------------------------------------------------------- 
 # ● update 
 #-------------------------------------------------------------------------- 
 def update 
   @mini_map.update 
   if $game_system.map_interpreter.running? 
     @mini_map.visible = false 
   elsif not $game_system.map_interpreter.running? and @mini_map.on? 
     @mini_map.visible = true 
   end 
   update_passminimap 
 end 
 #-------------------------------------------------------------------------- 
 # ● transfer_player 
 #-------------------------------------------------------------------------- 
 def transfer_player 
   transfer_passminimap 
   @mini_map.dispose 
   @mini_map = Map_Event.new(@corner) 
 end 
end 

#============================================================================== 
# ■ Map_Base 
#------------------------------------------------------------------------------ 
#  Base class for mini maps 
#============================================================================== 

class Map_Base < Sprite 
 #-------------------------------------------------------------------------- 
 # ● constants and instances 
 #-------------------------------------------------------------------------- 
 PMP_VERSION  = 6 
 ACTIVATED_ID = 26 # set the switch id for the minimap display (on/off) 
 attr_reader :event 
 #-------------------------------------------------------------------------- 
 # ● initialize 
 #-------------------------------------------------------------------------- 
 def initialize(corner) 
   super(Viewport.new(16, 16, width, height)) 
   viewport.z = 8000 
   @border = Sprite.new 
   @border.x = viewport.rect.x - 6 
   @border.y = viewport.rect.y - 6 
   @border.z = viewport.z - 1 
   @border.bitmap = RPG::Cache.picture("mapback") 
   self.visible = on? 
   self.opacity = 180 
   case corner 
   when 1 
     self.x = 16 
     self.y = 16 
   when 2 
     self.x = 640 - width - 16 
     self.y = 16 
   when 3 
     self.x = 16 
     self.y = 480 - height - 16 
   when 4 
     self.x = 640 - width - 16 
     self.y = 480 - height - 16 
   else 
     self.x = 16 
     self.y = 16 
   end 
   self.visible = on? 
 end 
 #-------------------------------------------------------------------------- 
 # ● dispose 
 #-------------------------------------------------------------------------- 
 def dispose 
   @border.dispose 
   super 
 end 
 #-------------------------------------------------------------------------- 
 # ● x= 
 #-------------------------------------------------------------------------- 
 def x=(x) 
   self.viewport.rect.x = x 
   @border.x = x - 6 
 end 
 #-------------------------------------------------------------------------- 
 # ● y= 
 #-------------------------------------------------------------------------- 
 def y=(y) 
   self.viewport.rect.y = y 
   @border.y = y - 6 
 end 
 #-------------------------------------------------------------------------- 
 # ● visible= 
 #-------------------------------------------------------------------------- 
 def visible=(bool) 
   super 
   self.viewport.visible = bool 
   @border.visible = bool 
 end 
 #-------------------------------------------------------------------------- 
 # ● minimap_on? 
 #-------------------------------------------------------------------------- 
 def on? 
   return $game_switches[ACTIVATED_ID] 
 end 
 #-------------------------------------------------------------------------- 
 # ● update 
 #-------------------------------------------------------------------------- 
 def update 
   super 
   self.visible = on? 
    
   if viewport.ox < display_x 
     viewport.ox += 1 
   elsif viewport.ox > display_x 
     viewport.ox -= 1 
   end 
   if viewport.oy < display_y 
     viewport.oy += 1 
   elsif viewport.oy > display_y 
     viewport.oy -= 1 
   end 
 end 
 #-------------------------------------------------------------------------- 
 # ● width 
 #-------------------------------------------------------------------------- 
 def width 
   return 120 
 end 
 #-------------------------------------------------------------------------- 
 # ● height 
 #-------------------------------------------------------------------------- 
 def height 
   return 90 
 end 
 #-------------------------------------------------------------------------- 
 # ● display_x 
 #-------------------------------------------------------------------------- 
 def display_x 
   return $game_map.display_x * 3 / 64 
 end 
 #-------------------------------------------------------------------------- 
 # ● display_y 
 #-------------------------------------------------------------------------- 
 def display_y 
   return $game_map.display_y * 3 / 64 
 end 
end 

#============================================================================== 
# ■ Map_Passability 
#------------------------------------------------------------------------------ 
#   draws the mini map 
# 
#  thanks to Fanha Giang (aka fanha99) for the autotile drawing method 
#============================================================================== 

class Map_Passability < Map_Base 
 #-------------------------------------------------------------------------- 
 # ● constants 
 #-------------------------------------------------------------------------- 
 INDEX  = 
 [ 
 26, 27, 32, 33,    4, 27, 32, 33,   26,  5, 32, 33,    4,  5, 32, 33,    
 26, 27, 32, 11,    4, 27, 32, 11,   26,  5, 32, 11,    4,  5, 32, 11,    
 26, 27, 10, 33,    4, 27, 10, 33,   26,  5, 10, 33,    4,  5, 10, 33, 
 26, 27, 10, 11,    4, 27, 10, 11,   26,  5, 10, 11,    4,  5, 10, 11,  
 24, 25, 30, 31,   24,  5, 30, 31,   24, 25, 30, 11,   24,  5, 30, 11,  
 14, 15, 20, 21,   14, 15, 20, 11,   14, 15, 10, 21,   14, 15, 10, 11, 
 28, 29, 34, 35,   28, 29, 10, 35,    4, 29, 34, 35,    4, 29, 10, 35, 
 38, 39, 44, 45,    4, 39, 44, 45,   38,  5, 44, 45,    4,  5, 44, 45, 
 24, 29, 30, 35,   14, 15, 44, 45,   12, 13, 18, 19,   12, 13, 18, 11, 
 16, 17, 22, 23,   16, 17, 10, 23,   40, 41, 46, 47,    4, 41, 46, 47, 
 36, 37, 42, 43,   36,  5, 42, 43,   12, 17, 18, 23,   12, 13, 42, 43, 
 36, 41, 42, 47,   16, 17, 46, 47,   12, 17, 42, 47,    0,  1,  6,  7 
 ] 
 X = [0, 1, 0, 1] 
 Y = [0, 0, 1, 1] 
 #-------------------------------------------------------------------------- 
 # ● initialize 
 #-------------------------------------------------------------------------- 
 def initialize(corner) 
   super(corner) 
   @autotile = RPG::Cache.picture("minimap_tiles") 
   setup() 
 end 
 #-------------------------------------------------------------------------- 
 # ● setup 
 #-------------------------------------------------------------------------- 
 def setup() 
   @map = load_data(sprintf("Data/Map%03d.rxdata", $game_map.map_id)) 
   tileset = $data_tilesets[@map.tileset_id] 
   @passages = tileset.passages 
   @priorities = tileset.priorities 
   redefine_tiles 
   refresh 
 end 
 #-------------------------------------------------------------------------- 
 # ● pass 
 #-------------------------------------------------------------------------- 
 def pass(tile_id) 
   return 15 if tile_id == nil 
   return @passages[tile_id] != nil ? @passages[tile_id] : 15 
 end 
 #-------------------------------------------------------------------------- 
 # ● passable 
 #-------------------------------------------------------------------------- 
 def passable(tile_id) 
   return pass(tile_id) < 15 
 end 
 #-------------------------------------------------------------------------- 
 # ● redefine_tile 
 #-------------------------------------------------------------------------- 
 def redefine_tiles 
   width = @map.width 
   height = @map.height 
   map = RPG::Map.new(width, height) 
   map.data = @map.data.dup 
   for x in 0...width 
     for y in 0...height 
       for level in [1, 2] 
         id = @map.data[x, y, level] 
         if id != 0 and @priorities[id] == 0 
           @map.data[x, y, 0] = id 
           @passages[@map.data[x, y, 0]] = @passages[id] 
         end 
       end 
     end 
   end 
   for x in 0...width 
     for y in 0...height 
       for level in [0] 
       tile = @map.data[x, y, level] 
       u = @map.data[x,   y-1, level] 
       l = @map.data[x-1, y,   level] 
       r = @map.data[x+1, y,   level] 
       d = @map.data[x,   y+1, level] 
       if !passable(tile) 
         map.data[x, y] = 0 
       else 
         if tile == 0 
           map.data[x, y, level] = 0 
           next 
         end 
         if pass(tile) < 15 
           if !passable(u) and !passable(l) and !passable(r) and !passable(d) 
             map.data[x, y, level] = 0 
           elsif !passable(u) and !passable(l) and !passable(r) and passable(d) 
             map.data[x, y, level] = 90 
           elsif !passable(u) and !passable(l) and !passable(d) and passable(r) 
             map.data[x, y, level] = 91 
           elsif !passable(u) and !passable(r) and !passable(d) and passable(l) 
             map.data[x, y, level] = 93 
           elsif !passable(l) and !passable(r) and !passable(d) and passable(u) 
             map.data[x, y, level] = 92 
           elsif !passable(u) and !passable(d) and passable(r) and passable(l) 
             map.data[x, y, level] = 81 
           elsif !passable(u) and !passable(r) and passable(d) and passable(l) 
             map.data[x, y, level] = 84 
           elsif !passable(u) and !passable(l) and passable(d) and passable(r) 
             map.data[x, y, level] = 82 
           elsif !passable(d) and !passable(r) and passable(l) and passable(u) 
             map.data[x, y, level] = 86 
           elsif !passable(d) and !passable(l) and passable(r) and passable(u) 
             map.data[x, y, level] = 88 
           elsif !passable(r) and !passable(l) and passable(d) and passable(u) 
             map.data[x, y, level] = 80 
           elsif !passable(u) and passable(d) and passable(r) and passable(l) 
             map.data[x, y, level] = 68 
           elsif !passable(d) and passable(u) and passable(r) and passable(l) 
             map.data[x, y, level] = 76 
           elsif !passable(r) and passable(d) and passable(u) and passable(l) 
             map.data[x, y, level] = 72 
           elsif !passable(l) and passable(d) and passable(u) and passable(r) 
             map.data[x, y, level] = 64 
           else 
             map.data[x, y, level] = 48 
           end 
         else 
           map.data[x, y, level] = 0 
         end 
       end 
       end 
     end 
   end 
   @map = map.dup 
   map = nil 
 end 
 #-------------------------------------------------------------------------- 
 # ● refresh 
 #-------------------------------------------------------------------------- 
 def refresh 
   self.visible = false 
   self.bitmap = Bitmap.new(@map.width * 6, @map.height * 6) 
   bitmap = Bitmap.new(@map.width * 6, @map.height * 6) 
   rect1 = Rect.new(6, 0, 6, 6) 
   for y in [email protected] 
     for x in [email protected] 
       for level in [0] 
         tile_id = @map.data[x, y, level] 
         next if tile_id == 0 
         id = tile_id / 48 - 1 
         tile_id %= 48 
         for g in 0..3 
           h = 4 * tile_id + g 
           y1 = INDEX[h] / 6 
           x1 = INDEX[h] % 6 
           rect2 = Rect.new(x1 * 3, y1 * 3, 3, 3) 
           bitmap.blt(x * 6 + X[g] *  3, y * 6 + Y[g] * 3, @autotile, rect2) 
         end 
       end 
     end 
   end 
   d_rect = Rect.new(0, 0, @map.width * 6, @map.height * 6) 
   s_rect = Rect.new(0, 0, bitmap.width, bitmap.height) 
   self.bitmap.stretch_blt(d_rect, bitmap, s_rect) 
   self.viewport.ox = display_x 
   self.viewport.oy = display_y 
   bitmap.clear 
   bitmap.dispose 
 end 
end 

#============================================================================== 
# ■ Map_Event 
#------------------------------------------------------------------------------ 
#  draw the events and hero position 
#============================================================================== 

class Map_Event < Map_Passability 
 #-------------------------------------------------------------------------- 
 # ● initialize 
 #-------------------------------------------------------------------------- 
 def initialize(corner = 4) 
   super(corner) 
   @dots = [] 
   @player = Sprite.new(self.viewport) 
   @player.bitmap = RPG::Cache.picture("mm cursors") 
   @player.src_rect = Rect.new(0, 0, 15, 15) 
   @player.z = self.z + 3 
   @events = {} 
    
   for key in $game_map.events.keys 
     event = $game_map.events[key] 
     next if event.list == nil 
     for i in 0...event.list.size 
       next if event.list[i].code != 108 
       @events[key] = Sprite.new(self.viewport) 
       @events[key].z = self.z + 2 
       if event.list[i].parameters[0].include?("event") 
         @events[key].bitmap = RPG::Cache.picture("event") 
       elsif event.list[i].parameters[0].include?("enemy") 
         @events[key].bitmap = RPG::Cache.picture("enemy") 
       elsif event.list[i].parameters[0].include?("teleport") 
         @events[key].bitmap = RPG::Cache.picture("teleport") 
       elsif event.list[i].parameters[0].include?("chest") 
         @events[key].bitmap = RPG::Cache.picture("chest") 
       elsif event.list[i].parameters[0].include?("npc") 
         @events[key].bitmap = RPG::Cache.picture("npc") 
       elsif event.list[i].parameters[0].include?("savepoint") 
         @events[key].bitmap = RPG::Cache.picture("savepoint") 
       end 
     end 
   end 
 end 
 #-------------------------------------------------------------------------- 
 # ● dispose 
 #-------------------------------------------------------------------------- 
 def dispose 
   @player.dispose 
   for event in @events.values 
     event.dispose 
   end 
   super 
 end 
 #-------------------------------------------------------------------------- 
 # ● update 
 #-------------------------------------------------------------------------- 
 def update 
   super 
   @player.x = $game_player.real_x * 3 / 64 - 5 
   @player.y = $game_player.real_y * 3 / 64 - 4 
   @player.src_rect.x = ($game_player.direction / 2 - 1) * 15 
   for key in @events.keys 
     event = @events[key] 
     mapevent = $game_map.events[key] 
     event.x = mapevent.real_x * 3 / 64 
     event.y = mapevent.real_y * 3 / 64 
   end 
 end 
end

Instrucciones:

Coloca el script sobre main.

Para cambiar la esquina en la que aparece el minimapa busca '@corner = 4' y cambia el 4 por la esquina que quieras(Del 1 al 4).

Busca(si quieres modificar) 'ACTIVATED_ID = 1' para cambiar el interruptor que hace que se active o desactive el minimapa.

Instrucciones del mapa(esto deves ponerlo en anotaciones en el evento):

NPC = debes poner -npc

Teletransportadores= -teleport

Puntos d guardado= -savepoint

Enemigos(eventos)= - enemy

eventos y cosas raras(q usen eventos)= - event

cofres= -chest



recursos necesarios:

mapa:
mapback.png

cofre:
5818577-script-mini-mapa

enemigo:
enemy.png

evento:
event.png

grafico de tile:
minimap_tiles.png

flechas(personaje):
mmcursors.png

NPC:
npc.png

TELETRANSPORTADOR:
teleport.png

PUNTO GUARDADO:
savepoint.png


PD:encontre un script que emula la ocarina del tiempo pero el script es algo raro si alguien me pasa un demo y lo sonidos de la ocarina (ya saben el sonido que hacen cuando pisas arriba y todo eso)
script ocarina del tiempo:http://www.aldearpg.net/Foros/showthread.php?tid=1311
 
Última edición por un moderador:
Mensajes
944
Reacciones
0
Puntos
0
Ubicación
En los Cuarteles del Clan Uchiha [Jefazo]
aqui dejo un script ^^

Dificultad

Descripción:
Este script aumenta todos los parámetros del enemigo: PV máx, PM máx, fuerza, destreza, agilidad, magia, ataque, defensa física, defensa mágica y evasión de los enemigos si estás en el modo difícil o muy dífícil. Permanecen como en la base de datos si está en modo normal, o disminuye los parámetros del enemigo si está en modo fácil o muy fácil.
A mayor dificultad disminuye el oro y la experiencia que te da el enemigo.
Ni la frecuencia de combates ni el coste de los objetos se ven afectados.

Instrucciones:

Hay 5 modos de dificultad.

$difficulty_options.very_easy_difficulty
Para modo muy fácil.

$difficulty_options.easy_difficulty
Para modo fácil.

$difficulty_options.normal_difficulty
Para modo normal.

$difficulty_options.hard_difficulty
Para modo difícil.

$difficulty_options.very_hard_difficulty
Para modo muy difícil.

Pueden poner un evento de elecciones al comenzar el juego.

Script:
Código:
#======================================================================

# Difficulty Options
#--------------------------------------------------------------------------
# Created By SephirothSpawn (11.11.05)
# Last Updated: 11.11.05
#==============================================================================

#==============================================================================
# Module RPG
#==============================================================================
module RPG
#=========================================================================
# Class Enemy
#=========================================================================
class Enemy
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :b_maxhp, :b_maxsp, :b_str, :b_dex, :b_agi, :b_int
attr_accessor :b_atk, :b_pdef, :b_mdef, :b_eva, :b_exp, :b_gold
#--------------------------------------------------------------------------
# * Set Bases
#--------------------------------------------------------------------------
def set_bases
@b_maxhp, @b_maxsp = @maxhp, @maxsp
@b_str, @b_dex, @b_agi, @b_int = @str, @dex, @agi, @int
@b_atk, @b_pdef, @b_mdef, @b_eva = @atk, @pdef, @mdef, @eva
@b_exp, @b_gold = @exp, @gold
end
end
end

#==============================================================================
# Class Difficulty Options
#==============================================================================
class Difficulty_Options
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
normal_difficulty
end
#--------------------------------------------------------------------------
# * Very Easy Difficulty
#--------------------------------------------------------------------------
def very_easy_difficulty
@constant = 0.5
set_attributes
end
#--------------------------------------------------------------------------
# * Easy Difficulty
#--------------------------------------------------------------------------
def easy_difficulty
@constant = 0.75
set_attributes
end
#--------------------------------------------------------------------------
# * Normal Difficulty
#--------------------------------------------------------------------------
def normal_difficulty
@constant = 1
set_attributes
end
#--------------------------------------------------------------------------
# * Hard Difficulty
#--------------------------------------------------------------------------
def hard_difficulty
@constant = 1.5
set_attributes
end
#--------------------------------------------------------------------------
# * Very Hard Difficulty
#--------------------------------------------------------------------------
def very_hard_difficulty
@constant = 2
set_attributes
end
#--------------------------------------------------------------------------
# * Set Attributes
#--------------------------------------------------------------------------
def set_attributes
for i in 1...$data_enemies.size
$data_enemies[i].maxhp = $data_enemies[i].b_maxhp * @constant
$data_enemies[i].maxsp = $data_enemies[i].b_maxsp * @constant
$data_enemies[i].str = $data_enemies[i].b_str * @constant
$data_enemies[i].dex = $data_enemies[i].b_dex * @constant
$data_enemies[i].agi = $data_enemies[i].b_agi * @constant
$data_enemies[i].int = $data_enemies[i].b_int * @constant
$data_enemies[i].atk = $data_enemies[i].b_atk * @constant
$data_enemies[i].pdef = $data_enemies[i].b_pdef * @constant
$data_enemies[i].mdef = $data_enemies[i].b_mdef * @constant
$data_enemies[i].eva = $data_enemies[i].b_eva * @constant
$data_enemies[i].exp = $data_enemies[i].b_exp * @constant
$data_enemies[i].gold = $data_enemies[i].b_gold * @constant
end
end
end

#==============================================================================
# Class Scene Title
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Alias' New Game Method
#--------------------------------------------------------------------------
alias new_game command_new_game
#--------------------------------------------------------------------------
# * Adds Difficulty Game Variables
#--------------------------------------------------------------------------
def command_new_game
for i in 1...$data_enemies.size
$data_enemies[i].set_bases
end
$difficulty_options = Difficulty_Options.new
new_game
end
end

#==============================================================================
# Scene_Save
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Alias Save Data
#--------------------------------------------------------------------------
alias new_save write_save_data
#--------------------------------------------------------------------------
# * Write Save Data
#--------------------------------------------------------------------------
def write_save_data(file)
new_save(file)
Marshal.dump($difficulty_options, file)
end
end

#==============================================================================
# Scene_Load
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Alias Read Save Data
#--------------------------------------------------------------------------
alias new_load read_save_data
#--------------------------------------------------------------------------
# * Read Save Data
#--------------------------------------------------------------------------
def read_save_data(file)
new_load(file)
$difficulty_options = Marshal.load(file)
end
end

NOTA IMPORTANTE:
Puede haber un error referente al direno en las tiendas por lo que pueden buscar esta linea:

$data_enemies.gold = $data_enemies.b_gold * @constant
y sustituirla por esta:
$data_enemies.gold = $data_enemies.b_gold * 1.
Si este método tampoco funciona sólo borren la línea.


Pueden modificar el script para que algunos parámetros no aumenten ni disminuyan con la dificultad:
Ejemplo. (Para que el PM de los enemigos no aumente ni disminuye).
Busquen esta linea:
$data_enemies.maxsp = $data_enemies.b_maxsp * @constant
y cámbienla por esta:
$data_enemies.maxsp = $data_enemies.b_maxsp * 1.
El proceso es similar al del al anterior en todos los parámetros. Lo único que deben hacer sustituir "@constant" por "1"


Créditos a SephirothSpawn.
 

SeiferZXC

EMD Legend
Mensajes
1.869
Reacciones
138
Puntos
868
Ubicación
Chile
Nesesito ayuda urgente es que en el UMS cuando un mono me empiesa a ablar me sale error en la linea 1024 ayuda urgente plzzzzzz
 

Nana

THE END
Mensajes
3.368
Reacciones
2.497
Puntos
1.456
El script del UMS que habían posteado alguno está mal, el real es este:

CORRECCIÓN UNIVERSAL MESSAGE SYSTEM

Pon esto encima de main:

Código:
# *****************************************************************************
# *    Universal Message System
# *      v1.1
# *      by Ccoa
# *****************************************************************************
# Manual de Comandos (Traducido por xXDarkDragonXx de VoidZone 4.7):
=begin

EN MENSAJE (CODIGOS) >>>>:

  \b          - Activa / Desactiva texto en negrita
  \c[i]       - Cambia el color del texto (por defecto del RPG Maker)
  \e[i]       - Pone caja de texto sobre evento i (0 = jugador, -1 no evento)
  \face[name] - Cambia el gráfico de "face" a name.png (dejar en blanco [] para 
                no poner "face")
  \fl         - Pone la "face" a la izquierda
  \font[name] - Cambia la fuente usada, dejar en blanco [] para regresar a fuen-
                te por defecto
  \fr         - Pone la "face" a la derecha
  \g          - Muestra caja que te dice el dinero que tienes
  \height     - Alto de la caja de texto, solo funciona en Modo Normal
  \i          - Activa / Desactica texto en itílico
  \ignr       - No escribir nada en la línea en ques escribes este comando, solo
                procesa los códigos, debe ser lo primero en la línea
  \jc         - Alínea la caja de texto al centro, ignorado si usas \e
  \jl         - Alínea la caja de texto a la izquierda, ignorado si usas \e
  \jr         - Alínea la caja de texto a la derecha, ignorado si usas \e
  \m          - toggle mode between normal and fit window to text
  \n[i]       - Muestra el nombre del personaje i (i = ID del personaje en Base
                de Datos > Personajes)
  \nm[name]   - Muestra nombre / texto en la caja de nombre, dejar en blanco [] 
                para remover la caja de nombre
  \oa[i]      - Muestra el icono y nombre de la armadura i (i = ID de armadura
                en Base de Datos > Protectores)
  \oi[i]      - Muestra el icono y nombre de un objeto i (i = ID de objeto
                en Base de Datos > Objeto)
  \os[i]      - Muestra el icono y nombre de la habilidad i (i = ID de habilidad
                en Base de Datos > Habilidades)
  \ow[i]      - Muestra el icono y nombre de la arma i (i = ID de arma
                en Base de Datos > Armas)
  \p[i]       - Pausa por i frames antes de escribir la letra siguiente (i = #
                de frames)
  \pt         - Activa / Desactiva el símbolo de "pausa" en la caja de texto
  \s          - Activa / Desactiva texto con sombra
  \shk[i]     - Pone la caja de texto a temblar, mientras más alto sea el número
                reemplazado por i, mayor será el temblor
  \skip       - Activa / Desactiva el "salto" de texto
  \t1         - Cambia un poco la caja de texto a una de comic de como si estu-
                viera hablando normal (usa imagen talk1)
  \t2         - Cambia un poco la caja de texto a una de comic de como si estu-
                viera gritando (usa imagen talk2)
  \tc         - Alínea el texto al centro, este comando debe ponerse al 
                principio de una línea en el mensaje
  \th         - Cambia un poco la caja de texto a una de comic de como si estu-
                viera pensando algo (usa imagen thought.png)
  \tl         - Alínea el texto a la izquierda, este comando debe ponerse al 
                principio de una línea en el mensaje
  \tr         - Alínea el texto a la derecha, este comando debe ponerse al prin-
                cipio de una línea en el mensaje
  \v[i]       - Muestra variable (el valor), reemplazar i por el mismo
  \width      - Ancho de la caja de texto, solo funciona en Modo Normal
  \w[i]       - Espera por los frames indicados, y luego cierra ventana
  \ws[i]      - Cambia la velocidad a la que sale el texto, reemplaza i por la
                misma
  \slv[name]  - Pone esta ventana el nombre de la "ventana esclava", o muestra
                el nombre de la misma
  
COMANDOS QUE NO SON CODIGOS EN MENSAJES (usar comando 'Llamar script...' para 
estos):

$game_system.ums_mode = NORMAL_MODE - Cambia a Modo Normal
$game_system.ums_mode = FIT_WINDOW_TO_TEXT - Cambia al modo que el texto automá-
                                             ticamente encaje en la caja de tex-
                                             to
$game_system.text_skip = true - Activa el "salto" de texto
$game_system.text_skip = false
true                           - Desactiva el "salto" de texto (true es necesa-
                                 rio ponerlo)
$game_system.text_mode = WRITE_FASTER - Cambia la velocidad en que el texto sale
                                        a r?pido
$game_system.text_mode = WRITE_ALL - Cambia el modo de salto a que escriba todo
                                     el texto
$game_system.write_speed = i - Cambia la velocidad a la que sale el texto, reem-
                               plaza i por la misma
$game_system.window_height = i - Cambia el alto de la ventana de texto a i (i =
                                 el alto)
$game_system.window_width = i - Cambia el ancho de la ventana de texto a i (i =
                                 el ancho)
$game_system.window_justification = RIGHT - Alínea la caja de texto a la derecha
$game_system.window_justification = LEFT - Alínea la caja de texto a la izquier-
                                           da
$game_system.window_justification = CENTER - Alínea la caja de texto al centro
$game_system.face_graphic = "filename" - Cambia el gráfico de "face" a 
                                         filename.png (puedes cambiar nombre de
                                         archivo, obiviamente, y puedes usar más
                                         de una "face")
$game_system.face_graphic = "" - Cambia el gráfico de "face" a ninguno
$game_system.face_graphic_justification = LEFT - Pone la "face" a la izquierda
$game_system.face_graphic_justification = RIGHT - Pone la "face" a la derecha
$game_system.face_graphic_position = TOP - Pone la "face" arriba de la ventana
$game_system.face_graphic_position = CENTER - Pone la "face" centrada en la ven-
                                              tana
$game_system.face_graphic_position = BOTTOM - Pone la "face" a lo más bajo de la
                                              ventana de texto
$game_system.shadow_text = true - Activa texto con sombra
$game_system.shadow_text = false
true                            - Desactiva texto con sombra (true es necesario)
$game_system.shadow_color = Color.new(red, blue, green, alpha) - change shadow color
$game_system.message_event = what event to put the message over (0 = player, -1 = no event)
$game_system.comic_enabled = false 
true                               - Desactiva lo del comic (true es necesario)
$game_system.comic_enabled = true  - turn on comic thingy (only works with message_event not -1)
$game_system.comic_style = TALK1   - Cambia un poco la caja de texto a una de 
                                     comic de como si estuviera hablando normal 
                                     (usa imagen talk1)
$game_system.comic_style = TALK2   - Cambia un poco la caja de texto a una de 
                                     comic de como si estuviera gritando 
                                     (usa imagen talk2)
$game_system.comic_style = THOUGHT - Cambia un poco la caja de texto a una de 
                                     comic de como si estuviera pensando algo
                                     (usa imagen thought.png)
$game_system.name = "name" - Cambia el nombre escrito en la ventana de nombre a
                             lo que escribas entre " "
$game_system.name = "" - Desactiva ventana de nombre
$game_system.font = "name" - Cambia nombre de fuente (obivamente reemplazar 
                             "name" por nombre de fuente)
$game_system.font = "" - Cambia la fuente a por defecto
$game_system.text_justification = CENTER - Alínea texto al centro
$game_system.text_justification = LEFT - Alínea texto a la izquierda
$game_system.text_justification = RIGHT - Alínea texto a la derecha
$game_system.show_pause = true - Activa el símbolo de "pausa" en la caja de tex-
                                 to
$game_system.show_pause = false - Desactiva el símbolo de "pausa" en la caja de 
                                  texto
$game_system.shake = 0 - Desactiva el temblor
$game_system.shake = i - Pone la caja de texto a temblar, mientras más alto sea
                         el número reemplazado por i, mayor será el temblor
$game_system.sound_effect = "" - Desactiva el sonido de letra-por-letra (sonido 
                                 es un SE)
$game_system.sound_effect = "sename" - Nombre de archivo del sonido a escuchar
                                       en el letra-por-letra
$game_system.choice_position = ABOVE - Pone la caja de elecciones arriba
$game_system.choice_position = BOTTOM - Pone la caja de elecciones abajo
$game_system.choice_position = LEFT - Pone la caja de elecciones a la izquierda
$game_system.choice_position = RIGHT - Pone la caja de elecciones a la derecha

=end
# *****************************************************************************
#  CONSTANTS
# *****************************************************************************

# Modos
NORMAL_MODE        = 0 #Modo Normal, su ID
FIT_WINDOW_TO_TEXT = 1 #Modo de Encajar Texto a Caja de Texto, su ID

# Modos de "Salto" de Texto
WRITE_FASTER = 0
WRITE_ALL    = 1

# Alineacions 
RIGHT  = 0
CENTER = 1
LEFT   = 2

# Posiciones para las "faces", la caja de elecciones, etc.
ABOVE  = 0  # Pone el objeto / lo deseado arriba, su ID
CENTER = 1  # Pone el objeto / lo deseado en el centro, su ID
BOTTOM = 2  # Pone el objeto / lo deseado a lo más bajo de la ventana de texto, 
            # su ID
SIDE   = 3  # Pone el objeto / lo deseado a los lados (que lado depende de ali-
            # neación, su ID

# Modo Comic
TALK1   = 0 # Hablando Normal
TALK2   = 1 # Gritando
THOUGHT = 2 # Pensativo


# *****************************************************************************
#  Changes to Game_System.  This allows any changes made to be saved when the
#     game is saved.
# *****************************************************************************

class Game_System
  attr_accessor :ums_mode # what mode the UMS is in
  attr_accessor :text_skip # whether or not text skip is activated
  attr_accessor :skip_mode # write the text faster while C is pressed, or just skip to the end
  attr_accessor :write_speed # frame delay between characters
  
  attr_accessor :window_height # default height of message window
  attr_accessor :window_width # default width of message window
  attr_accessor :window_justification # default justification of window
  
  attr_accessor :face_graphic # current face graphic
  attr_accessor :face_graphic_justification # justification of face graphic
  attr_accessor :face_graphic_position # position of face graphic
  
  attr_accessor :shadowed_text # whether or not to draw a shadow behind the text
  attr_accessor :shadow_color # the shadow color
  
  attr_accessor :choice_justification # where the choice window is located
  attr_accessor :choice_position # prefered position of choice window
  
  attr_accessor :message_event # what event to center the text over (0 player, -1 to not)
  
  attr_accessor :comic_enabled # using "talk" icons?
  attr_accessor :comic_style   # what type of comic image to use
  
  attr_accessor :name # the text for the name window
  
  attr_accessor :font # the name of the font
  
  attr_accessor :text_justification # the justification of the window text
  
  attr_accessor :show_pause # whether or not to show the pause icon
  
  attr_accessor :shake # the amount of shake for the window
  
  attr_accessor :sound_effect # SE to play with each letter
  
  attr_accessor :slave_windows # hash of slave windows
  attr_accessor :indy_windows  # hash of independent windows
  
  attr_reader :shortcuts  # user-defined shortcuts
  
  alias ums_initialize initialize
  def initialize
    ums_initialize
    @ums_mode = NORMAL_MODE
    
    @skip_mode = WRITE_ALL
    @text_skip = true
    @write_speed = 2
    
    @window_height = 128
    @window_width = 480
    @window_justification = CENTER
    
    @face_graphic = ""
    @face_graphic_justification = LEFT
    @face_graphic_position = CENTER
    
    @shadowed_text = false
    @shadow_color = Color.new(0, 0, 0, 100)
    
    @choice_justification = RIGHT
    @choice_position = SIDE
    
    @message_event = -1
    
    @comic_enabled = false
    @comic_style = TALK1
    
    @name = ""
    
    @font = ""
    
    @text_justification = LEFT
    
    @show_pause = true
    
    @shake = 0
    
    @sound_effect = ""
    
    @slave_windows = {}
    @indy_windows  = {}
    
    @used_codes = ['\v', '\n', '\c', '\g', '\skip', '\m', '\height', '\width', 
                   '\jr', '\jc', '\jl', '\face', '\fl', '\fr', '\b', '\i', '\s',
                   '\e', '\t1', '\t2', '\th', '\nm', '\font', '\p', '\w', '\ws',
                   '\oa', '\oi', '\os', '\ow', '\tl', '\tr', '\tc', '\ignr', 
                   '\shk', '\slv', '\ind']
                   
    @shortcuts = {}
  end
  
  def add_shortcut(shortcut, code)
    text = shortcut.downcase
    if !@used_codes.include?(text)
      @shortcuts[shortcut] = code
    end
  end
end

# *****************************************************************************
#  Changes to Window_Message.  This is the bulk of the script
# *****************************************************************************
#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
#  This message window is used to display text.
#==============================================================================

class Window_Message < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # x-coordinate depends on justification
    if $game_system.window_justification == RIGHT
      x = 640 - self.width
    elsif $game_system.window_justification == LEFT
      x = 0
    else # center
      x = (640 - $game_system.window_width) / 2
    end
    # y-coordinate depends on height
    y = 480 - $game_system.window_height - 16
    super(x, y, $game_system.window_width, $game_system.window_height)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.visible = false
    self.z = 9998
    @fade_in = false
    @fade_out = false
    @contents_showing = false
    
    # face graphic sprite
    @face = Sprite.new
    @face.opacity = 0
    @face.z = self.z + 1
    @face_offset = 0
    
    # choice window
    @choice_window = Window_Choice.new([])
    @choice_window.back_opacity = 160
    
    # comic sprite
    @comic = Sprite.new
    @comic.opacity = 0
    @comic.z = self.z + 1
    if $game_system.comic_style == TALK1
      @comic.bitmap = RPG::Cache.windowskin("talk1") 
      # talk1 es el nombre del archivo en Graphics\Pictures que se usará para el
      # modo comic que habla normal
    elsif $game_system.comic_style == TALK2
      @comic.bitmap = RPG::Cache.windowskin("talk2")
      # talk2 es el nombre del archivo en Graphics\Pictures que se usará para el
      # modo comic que grita
    else # thought
      @comic.bitmap = RPG::Cache.windowskin("thought")
      # thought es el nombre del archivo en Graphics\Pictures que se usará para 
      # el modo comic que es pensativo
    end
    
    # name window
    @name_window = Window_Name.new
    @name_window.z = self.z + 1
    
    @pause = 0
    @wait = 0
    
    @show = false
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    terminate_message
    $game_temp.message_window_showing = false
    if @input_number_window != nil
      @input_number_window.dispose
    end
    @face.dispose
    @choice_window.dispose
    @comic.dispose
    @name_window.dispose
    super
  end
  #--------------------------------------------------------------------------
  # * Terminate Message
  #--------------------------------------------------------------------------
  def terminate_message
    @show = false
    self.active = false
    self.pause = false
    self.contents.clear
    # Clear showing flag
    @contents_showing = false
    # Call message callback
    if $game_temp.message_proc != nil
      $game_temp.message_proc.call
    end
    # Clear variables related to text, choices, and number input
    $game_temp.message_text = nil
    $game_temp.message_proc = nil
    $game_temp.choice_start = 99
    $game_temp.choice_max = 0
    $game_temp.choice_cancel_type = 0
    $game_temp.choice_proc = nil
    $game_temp.num_input_start = 99
    $game_temp.num_input_variable_id = 0
    $game_temp.num_input_digits_max = 0
    # Open gold window
    if @gold_window != nil
      @gold_window.dispose
      @gold_window = nil
    end
    @choice_window.visible = false
    @choice_window.active = false
    @comic.opacity = 0
    $game_system.slave_windows.each_pair {|name, window| 
      if window.show == true
        window.dispose
        $game_system.slave_windows.delete(name)
      end
    }
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    @show = true
    @x = @y = 0

    # If waiting for a message to be displayed
    if $game_temp.message_text != nil
      @text = $game_temp.message_text
      
      # replace shortcuts with original code
      $game_system.shortcuts.each { |shortcut, code|
        @text.gsub!(shortcut, code)
      }
      
      # VERY first thing.  Check to see if this is being set up as a slave
      #  or independent window.
      if @text.index(/\\[Ss][Ll][Vv]\[(.*?)\]/) != nil
        # is this a new slave window, or a request to display it?
        if !$game_system.slave_windows.has_key?($1.to_s)
          # there is no such slave window yet.  Set it up.
          @text.gsub!(/\\[Ss][Ll][Vv]\[(.*?)\]/, "")
          $game_system.slave_windows[$1.to_s] = Window_Slave.new(@text)
          @text = ""
          @show = false
          terminate_message
          return
        end
      end
      
      # Control text processing
      begin
        last_text = @text.clone
        @text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
      end until @text == last_text
      @text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
      end
      
      # window mode
      if @text.index(/\\[Mm]/) != nil
        if $game_system.ums_mode == NORMAL_MODE
          $game_system.ums_mode = FIT_WINDOW_TO_TEXT
        else
          $game_system.ums_mode = NORMAL_MODE
        end
        @text.gsub!(/\\[Mm]/) { "" }
      end
      
      # window height
      @text.gsub!(/\\[Hh][Ee][Ii][Gg][Hh][Tt]\[([0-9]+)\]/) do
        $game_system.window_height = $1.to_i
        ""
      end
      
      # window width
      @text.gsub!(/\\[Ww][Ii][Dd][Tt][Hh]\[([0-9]+)\]/) do
        $game_system.window_width = $1.to_i
        ""
      end
      
      # justification
      @text.gsub!(/\\[Jj][Rr]/) do
        $game_system.window_justification = RIGHT
        reset_window
        ""
      end
      @text.gsub!(/\\[Jj][Cc]/) do
        $game_system.window_justification = CENTER
        reset_window
        ""
      end      
      @text.gsub!(/\\[Jj][Ll]/) do
        $game_system.window_justification = LEFT
        reset_window
        ""
      end
      
      # face graphics
      @text.gsub!(/\\[Ff][Aa][Cc][Ee]\[(.*?)\]/) do
        $game_system.face_graphic = $1.to_s
        if $1.to_s == ""
          @face.opacity = 0
        end
        ""
      end
      @text.gsub!(/\\[Ff][Ll]/) do
        $game_system.face_graphic_justification = LEFT
        ""
      end
      @text.gsub!(/\\[Ff][Rr]/) do
        $game_system.face_graphic_justification = RIGHT
        ""
      end
      
      # event centering
      @text.gsub!(/\\[Ee]\[([0-9]+)\]/) do
        $game_system.message_event = $1.to_i
        ""
      end
      
      # comic thingy
      @text.gsub!(/\\[Tt]1/) do
        $game_system.comic_style = TALK1
        @comic.bitmap = RPG::Cache.windowskin("talk1.png")
        ""
      end
      @text.gsub!(/\\[Tt]2/) do
        $game_system.comic_style = TALK2
        @comic.bitmap = RPG::Cache.windowskin("talk2.png")
        ""
      end
      @text.gsub!(/\\[Tt][Hh]/) do
        $game_system.comic_style = THOUGHT
        @comic.bitmap = RPG::Cache.windowskin("thought.png")
        ""
      end
      
      # name window
      @text.gsub!(/\\[Nn][Mm]\[(.*?)\]/) do
        $game_system.name = $1.to_s
        if $1.to_s == ""
          @name_window.visible = false
        end
        ""
      end
      
      # toggle pause
      @text.gsub!(/\\[Pp][Tt]/) do
        $game_system.show_pause = !$game_system.show_pause
        ""
      end
      
      # shaking
      @text.gsub!(/\\[Ss][Hh][Kk]\[([0-9]+)\]/) do
        $game_system.shake = $1.to_i
        ""
      end
      
      # Change "\\\\" to "\000" for convenience
      @text.gsub!(/\\\\/) { "\000" }
      # Change "\\C" to "\001" and "\\G" to "\002"
      @text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
      @text.gsub!(/\\[Gg]/) { "\002" }
      
      # text skip code
      @text.gsub!(/\\[Ss][Kk][Ii][Pp]/) { "\003" }
      
      # ignore code
      @text.gsub!(/\\[Ii][Gg][Nn][Rr]/) { "\023" }
      
      # bold and italics
      @text.gsub!(/\\[Bb]/) { "\004" }
      @text.gsub!(/\\[Ii]/) { "\005" }
      
      # slave and indy windows
      @text.gsub!(/\\[Ss][Ll][Vv]\[(.*?)\]/) { "\024[#{$1}]" }
      
      # shadow
      @text.gsub!(/\\[Ss]/) { "\006" }
      
      # font
      @text.gsub!(/\\[Ff][Oo][Nn][Tt]\[(.*?)\]/) { "\007[#{$1}]" }
      
      # pause and wait
      @text.gsub!(/\\[Pp]\[([0-9]+)\]/) { "\010[#{$1}]" }
      @text.gsub!(/\\[Ww]\[([0-9]+)\]/) { "\011[#{$1}]" }
      
      # write speed
      @text.gsub!(/\\[Ww][Ss]\[([0-9]+)\]/) { "\013[#{$1}]" }
            
      # armor, items, skills, and weapons
      @text.gsub!(/\\[Oo][Aa]\[([0-9]+)\]/) { 
        item = $data_armors[$1.to_i]
        "\014[#{$1}]" + "  " + item.name
      }
      @text.gsub!(/\\[Oo][Ii]\[([0-9]+)\]/) { 
        item = $data_items[$1.to_i]
        "\015[#{$1}]" + "  " + item.name
      }
      @text.gsub!(/\\[Oo][Ss]\[([0-9]+)\]/) { 
        item = $data_skills[$1.to_i]
        "\016[#{$1}]" + "  " + item.name
      }
      @text.gsub!(/\\[Oo][Ww]\[([0-9]+)\]/) { 
        item = $data_weapons[$1.to_i]
        "\017[#{$1}]" + "  " + item.name
      }
      
      # text justification
      @text.gsub!(/\\[Tt][Cc]/) { "\020" }
      @text.gsub!(/\\[Tt][Ll]/) { "\021" }
      @text.gsub!(/\\[Tt][Rr]/) { "\022" }
      
      # Resize the window to fit the contents?
      if $game_system.ums_mode == FIT_WINDOW_TO_TEXT
        width = 1
        text = @text.split("\n")
        height = 0
        for line in text
          # don't count this line's width if it has the ignr code
          if !line.include?("\023")
            width = [width, self.contents.text_size(line).width].max
            height += self.contents.text_size(line).height + 6
          end
        end
         
        self.width = width + 48
        self.height = height + 46 
        self.contents = Bitmap.new(width + 16, height + 16)
        self.contents.font.color = normal_color
      else
        if self.width != $game_system.window_height or self.height != $game_system.window_width
          self.width = $game_system.window_width
          self.height = $game_system.window_height
          self.contents = Bitmap.new(self.width - 32, self.height - 32)
          self.contents.font.color = normal_color
        end
      end
      
      reset_window
      
      get_x_value
      
      @count = Graphics.frame_count
      @pause = 0
      @ignore = false
      @ascending = true
      @target_x = self.x + $game_system.shake
    end
    
    
    
    # If number input
    if $game_temp.num_input_variable_id > 0
      digits_max = $game_temp.num_input_digits_max
      number = $game_variables[$game_temp.num_input_variable_id]
      @input_number_window = Window_InputNumber.new(digits_max)
      @input_number_window.number = number
      @input_number_window.x = self.x + 8
      @input_number_window.y = self.y + $game_temp.num_input_start * 32
    end
  end
  #--------------------------------------------------------------------------
  # * Set Window Position and Opacity Level
  #--------------------------------------------------------------------------
  def reset_window (change_opacity = true)
    # x-coordinate depends on justification
    if $game_system.message_event == -1
      if $game_system.window_justification == RIGHT
        self.x = 640 - $game_system.window_width
      elsif $game_system.window_justification == LEFT
        self.x = 0
      else # center
        self.x = (640 - self.width) / 2
      end
    else
      if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
        # center on player
        event_x = $game_player.screen_x
      else
        # center on the event specified
        event_x = $game_map.events[$game_system.message_event].screen_x
      end
      self.x = event_x - self.width / 2
      @comic.x = self.x + (self.width / 2) + 4
    end
    
    if $game_temp.in_battle
      self.y = 16
    else
      if $game_system.message_event == -1
        case $game_system.message_position
          when 0  # up
            self.y = 16
          when 1  # middle
            self.y = (480 - $game_system.window_height) / 2
          when 2  # down
            self.y = 480 - $game_system.window_height - 24
        end
      else
        if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
          # above player
          self.y = $game_player.screen_y - self.height - 48
        else
          # above event specified
          self.y = $game_map.events[$game_system.message_event].screen_y - self.height - 48
        end
        @comic.y = self.y + self.height - 2
      end
    end
    if self.y < 0 + ($game_system.name == "" ? 0 : 16)
      self.y = 0 + ($game_system.name == "" ? 0 : 16)
    elsif self.y > 480 - self.height 
      self.y = 480 - self.height
    end
    if self.x < 0 
      self.x = 0
    elsif self.x > 680 - self.width - 48
      self.x = 640 - self.width
    end
    
    if change_opacity
      if $game_system.message_frame == 0
        self.opacity = 255
      else
        self.opacity = 0
      end
      self.back_opacity = 160
    end
    
    # face stuff
      if $game_system.face_graphic != ""  
        # the player has chosen to show a face graphic
        @face.bitmap = RPG::Cache.picture($game_system.face_graphic)
        
        # picture y-coordinate
        if $game_system.face_graphic_position == ABOVE
          @face.y = self.y - @face.bitmap.height
          @face_offset = 0
        elsif $game_system.face_graphic_position == CENTER
          delta = (@face.bitmap.height - self.height) / 2
          @face.y = self.y - delta
          @x = @face_offset = @face.bitmap.width + 16
        elsif $game_system.face_graphic_position == BOTTOM 
          @face.y = self.y + self.height - @face.bitmap.height
          @x = @face_offset = @face.bitmap.width + 16
        else # side
          delta = (@face.bitmap.height - self.height) / 2
          @face.y = self.y - delta
          @face_offset = 0
        end
        
        # picture x-coordinate
        if $game_system.face_graphic_justification == LEFT
          if $game_system.face_graphic_position == SIDE
            @face.x = self.x - @face.bitmap.width
          else
            @face.x = self.x + 10
          end
        else
          if $game_system.face_graphic_position == SIDE
            @face.x = self.x + self.width
          else
            @face.x = self.x + self.width - @face.bitmap.width - 10
            @x = @face_offset = 0
          end
        end
      end
      
      # name window
      if $game_system.name != ""
        @name_window.set_name($game_system.name)
        @name_window.x = self.x
        @name_window.y = self.y - 36
      end
      
      # If choice
    if $game_temp.choice_max > 0
      @choice_window.set_choices($game_temp.choices)
      # determine x and y coords for choice window
      if $game_system.choice_justification == LEFT
        @choice_window.x = self.x
      else
        @choice_window.x = self.x + self.width - @choice_window.width
      end
      if $game_system.choice_position == ABOVE
        # check to make sure there is enough room above the textbox
        if self.y < @choice_window.height
          # not enough room above, place below
          @choice_window.y = self.y + self.height
        else
          # draw above
          @choice_window.y = self.y - @choice_window.height
        end
      elsif $game_system.choice_position == BOTTOM
        # check to make sure there is enough room below the textbox
        if (480 - self.y - self.height) < @choice_window.height
          # not enough room below, place above
          @choice_window.y = self.y - @choice_window.height
        else
          # draw below 
          @choice_window.y = self.y + self.height
        end
      else # side
        if $game_system.choice_justification == LEFT
          # check to make sure there's room on the left side
          if self.y < @choice_window.width
            # not enough room on the side, check to make sure there's room below
            if (480 - self.y - self.height) < @choice_window.height
              # not enough room below, place above
              @choice_window.y = self.y - @choice_window.height
            else
              # draw below 
              @choice_window.y = self.y + self.height
            end
          else
            # place on the left side
            @choice_window.y = self.y
            @choice_window.x = self.x - @choice_window.width
          end
        else # right
          # check to make sure there's room on the right side
          if (680 - (self.y + self.width)) < @choice_window.width
            # not enough room on the side, check to make sure there's room below
            if (480 - self.y - self.height) < @choice_window.height
              # not enough room below, place above
              @choice_window.y = self.y - @choice_window.height
            else
              # draw below 
              @choice_window.y = self.y + self.height
            end
          else
            # place on the left side
            @choice_window.y = self.y
            @choice_window.x = self.x + self.width
          end
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    
    if @contents_showing and $game_system.message_event != -1 and $game_system.shake == 0
      reset_window(false)
    end
    
    if $game_system.shake != 0  # shake the window
      if @ascending
        if @target_x != self.x
          self.x += 1
        else
          @ascending = false
          @target_x = self.x - ($game_system.shake * 2)
        end
      else 
        if @target_x != self.x
          self.x -= 1
        else
          @ascending = true
          @target_x = self.x + ($game_system.shake * 2)
        end
      end
    end
    
    if @wait > 0
      @wait -= 1
      if @wait == 0
        terminate_message
        return
      end
    end
    
    # If fade in
    if @fade_in
      self.contents_opacity += 24
      if $game_system.face_graphic != ""
        @face.opacity += 24
      end
      if $game_system.comic_enabled and $game_system.message_event != -1
        @comic.opacity += 24
      end
      if $game_system.name != ""
        @name_window.visible = true
      end
      if @input_number_window != nil
        @input_number_window.contents_opacity += 24
      end
      if self.contents_opacity == 255
        @fade_in = false
      end
      return
    end
    
    # write the text
    if @text != nil and @text != ""
      speed = $game_system.write_speed
      if $game_system.text_skip
        if $game_system.skip_mode == WRITE_FASTER and Input.press?(Input::C)
          # the player is holding the action button, write faster
          speed /= 3
        elsif $game_system.skip_mode == WRITE_ALL and Input.trigger?(Input::C)
          # the player pressed the action button, write all the text
          while (c = @text.slice!(/./m)) != nil
            write_char(c)
          end
          $game_system.slave_windows.each_value { |window| window.write_all }
          return
        end
      end
      while @ignore
        c = @text.slice!(/./m)
        if c != nil
          write_char(c)
        end
      end
      if @pause > 0
        @pause -= 1
        return
      end
      if Graphics.frame_count - @count >= speed
        if $game_system.sound_effect != ""
          Audio.se_play("Audio/SE/" + $game_system.sound_effect, 80, 100)
        end
        @count = Graphics.frame_count
        c = @text.slice!(/./m)
        if c != nil
          write_char(c)
        end
      end
      return
    end
    
    # If inputting number
    if @input_number_window != nil
      @input_number_window.update
      # Confirm
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        $game_variables[$game_temp.num_input_variable_id] =
          @input_number_window.number
        $game_map.need_refresh = true
        # Dispose of number input window
        @input_number_window.dispose
        @input_number_window = nil
        terminate_message
      end
      return
    end
    
    if @wait != 0
      return
    end
    
    # If message is being displayed and contents are all written
    if @contents_showing
      # if choice
      if $game_temp.choice_max > 0
        if !@choice_window.active
          @choice_window.visible = true
          @choice_window.active = true
          @choice_window.index = 0
        end
        @choice_window.update
      else
        # If choice isn't being displayed, show pause sign
        self.pause = $game_system.show_pause
      end
        # Cancel
        if Input.trigger?(Input::B)
          if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
            $game_system.se_play($data_system.cancel_se)
            $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
            terminate_message
          end
        end
        # Confirm
        if Input.trigger?(Input::C)
          if $game_temp.choice_max > 0
            $game_system.se_play($data_system.decision_se)
            $game_temp.choice_proc.call(@choice_window.index)
          end
          terminate_message
        end
        return
    end
    # If display wait message or choice exists when not fading out
    if @fade_out == false and $game_temp.message_text != nil
      @contents_showing = true
      $game_temp.message_window_showing = true
      reset_window
      refresh
      Graphics.frame_reset
      if @show
        self.visible = true
      end
      self.contents_opacity = 0
      if @input_number_window != nil
        @input_number_window.contents_opacity = 0
      end
      @fade_in = true
      return
    end
    # If message which should be displayed is not shown, but window is visible
    if self.visible
      @fade_out = true
      self.opacity -= 48
      @name_window.opacity -= 48
      @comic.opacity -= 48
      @face.opacity -= 48
      if self.opacity == 0
        self.visible = false
        @face.opacity = 0
        @choice_window.visible = false
        @choice_window.active = false
        @comic.opacity = 0
        @name_window.visible = false
        @fade_out = false
        $game_temp.message_window_showing = false
      end
      return
    end
  end
  
  #--------------------------------------------------------------------------
  # * Process and write the given character
  #--------------------------------------------------------------------------
  def write_char(c)
    if c == "\000"
      # Return to original text
      c = "\\"
    end
    # If \C[n]
    if c == "\001"
    # Change text color
      @text.sub!(/\[([0-9]+)\]/, "")
      color = $1.to_i
      if color >= 0 and color <= 7
        self.contents.font.color = text_color(color)
      end
      # go to next text
      return
    end
    # If \G
    if c == "\002"
      # Make gold window
      if @gold_window == nil
        @gold_window = Window_Gold.new
        @gold_window.x = 560 - @gold_window.width
        if $game_temp.in_battle
          @gold_window.y = 192
        else
          @gold_window.y = self.y >= 128 ? 32 : 384
        end
        @gold_window.opacity = self.opacity
        @gold_window.back_opacity = self.back_opacity
      end
      # go to next text
      return
    end
    # If \skip
    if c == "\003"
      # toggle text skipping
      $game_system.text_skip = !$game_system.text_skip
      # go to next text
      return
    end
    # If \b
    if c == "\004"
      # toggle bold
      self.contents.font.bold = !self.contents.font.bold
      # go to next text
      return
    end
    # If \i
    if c == "\005"
      # toggle italics
      self.contents.font.italic = !self.contents.font.italic
      # go to next text
      return
    end
    # If \s
    if c == "\006"
      # toggle shadow
      $game_system.shadowed_text = !$game_system.shadowed_text
      # go to next text
      return
    end
    # If \font
    if c == "\007"
      # change font
      @text.sub!(/\[(.*?)\]/, "")
      font = $1.to_s
      $game_system.font = font
      if font == ""
        self.contents.font.name = Font.default_name
      else
        self.contents.font.name = font
      end
      # go to next text
      return
    end
    # If \p[n]
    if c == "\010"
      @text.sub!(/\[([0-9]+)\]/, "")
      @pause = $1.to_i

      # go to next text
      return
    end
    
    # If \w[n]
    if c == "\011"
      @text.sub!(/\[([0-9]+)\]/, "")
      @wait = $1.to_i

      # go to next text
      return
    end
    
    # If \ws[n]
    if c == "\013"
      @text.sub!(/\[([0-9]+)\]/, "")
      $game_system.write_speed = $1.to_i

      # go to next text
      return
    end 
    # If \oa[n]
    if c == "\014"
      @text.sub!(/\[([0-9]+)\]/, "")
      index = $1.to_i
      @text.sub!("  ", "")
      item = $data_armors[index]
      # draw the icon
      icon = RPG::Cache.icon(item.icon_name)
      self.contents.blt(@x + 2, (@y * 32) + 4, icon, Rect.new(0, 0, 24, 24))
      @x += 24

      # go to next text
      return
    end
    
    # If \oi[n]
    if c == "\015"
      @text.sub!(/\[([0-9]+)\]/, "")
      index = $1.to_i
      @text.sub!("  ", "")
      item = $data_items[index]
      # draw the icon
      icon = RPG::Cache.icon(item.icon_name)
      self.contents.blt(@x + 2, (@y * 32) + 4, icon, Rect.new(0, 0, 24, 24))
      @x += 24

      # go to next text
      return
    end
    
    # If \os[n]
    if c == "\016"
      @text.sub!(/\[([0-9]+)\]/, "")
      index = $1.to_i
      @text.sub!("  ", "")
      item = $data_skills[index]
      # draw the icon
      icon = RPG::Cache.icon(item.icon_name)
      self.contents.blt(@x + 2, (@y * 32) + 4, icon, Rect.new(0, 0, 24, 24))
      @x += 24

      # go to next text
      return
    end
    
    # If \ow[n]
    if c == "\017"
      @text.sub!(/\[([0-9]+)\]/, "")
      index = $1.to_i
      @text.sub!("  ", "")
      item = $data_weapons[index]
      # draw the icon
      icon = RPG::Cache.icon(item.icon_name)
      self.contents.blt(@x + 2, (@y * 32) + 4, icon, Rect.new(0, 0, 24, 24))
      @x += 24
      
      # go to next text
      return
    end
    
    # If \tc
    if c == "\020"
      # center justify
      $game_system.text_justification = CENTER
      get_x_value
      # go to next text
      return
    end
    
    # If \tl
    if c == "\021"
      # left justify
      $game_system.text_justification = LEFT
      get_x_value
      # go to next text
      return
    end
    
    # If \tr
    if c == "\022"
      # right justify
      $game_system.text_justification = RIGHT
      get_x_value
      # go to next text
      return
    end
    
    # If \ignr
    if c == "\023"
      # set ignore flage
      @ignore = true
      # go to next text
      return
    end
    
    # if \slv
    if c == "\024"
      # we need to show a slave window
      @text.sub!(/\[(.*?)\]/, "")
      name = $1.to_s
      $game_system.slave_windows[name].show = true
    end
    
    # If new line text
    if c == "\n"
      # Add 1 to y
      if !@ignore
        @y += 1
      end
      if @text != ""
        get_x_value
      end
      @ignore = false

      # go to next text
      return
    end
    if @ignore
      return
    end
    # Draw text
    if $game_system.shadowed_text
      old_color = self.contents.font.color.clone
      self.contents.font.color = $game_system.shadow_color
      self.contents.draw_text(6 + @x, 32 * @y + 2, 40, 32, c)
      self.contents.font.color = old_color
    end
    self.contents.draw_text(4 + @x, 32 * @y, 40, 32, c)
    # Add x to drawn text width
    @x += self.contents.text_size(c).width
  end
  
  def get_x_value
    # text justification - offset for first line
    if $game_system.text_justification == CENTER
      # get the length of the current line
      w = self.contents.text_size(@text.split("\n")[0]).width
      @x = (self.width - w - 48) / 2
    elsif $game_system.text_justification == RIGHT
      # get the length of the current line
      w = self.contents.text_size(@text.split("\n")[0]).width
      @x = self.width - w - 48
    else # left
      if $game_system.face_graphic == ""
        @x = 0
      else
        @x = @face_offset
      end
    end
  end
    
end

class Interpreter
  #--------------------------------------------------------------------------
  # * Show Text
  #--------------------------------------------------------------------------
  def command_101
    # If other text has been set to message_text
    if $game_temp.message_text != nil
      # End
      return false
    end
    # Set message end waiting flag and callback
    @message_waiting = true
    $game_temp.message_proc = Proc.new { @message_waiting = false }
    # Set message text on first line
    $game_temp.message_text = @list[@index].parameters[0] + "\n"
    line_count = 1
    # Loop
    loop do
      # If next event command text is on the second line or after
      if @list[@index + 1].code == 401
        # Add the second line or after to message_text
        $game_temp.message_text += @list[@index + 1].parameters[0] + "\n"
        line_count += 1
      # If event command is not on the second line or after
      else
        # If next event command is show choices
        if @list[@index+1].code == 102
          # If choices fit on screen
          #if @list[@index+1].parameters[0].size <= 4 - line_count
            # Advance index
            @index += 1
            # Choices setup
            $game_temp.choice_start = line_count
            setup_choices(@list[@index].parameters)
          #end
        # If next event command is input number
        elsif @list[@index+1].code == 103
          # If number input window fits on screen
          if line_count < 4
            # Advance index
            @index += 1
            # Number input setup
            $game_temp.num_input_start = line_count
            $game_temp.num_input_variable_id = @list[@index].parameters[0]
            $game_temp.num_input_digits_max = @list[@index].parameters[1]
          end
        end
        # Continue
        return true
      end
      # Advance index
      @index += 1
    end
  end
  #--------------------------------------------------------------------------
  # * Setup Choices
  #--------------------------------------------------------------------------
  def setup_choices(parameters)
    # Set choice item count to choice_max
    $game_temp.choice_max = parameters[0].size
    # Set choice to message_text
    $game_temp.choices = parameters[0]
    # Set cancel processing
    $game_temp.choice_cancel_type = parameters[1]
    
    # Set callback
    current_indent = @list[@index].indent
    $game_temp.choice_proc = Proc.new { |n| @branch[current_indent] = n }
  end
  
  #--------------------------------------------------------------------------
  # * Script
  #--------------------------------------------------------------------------
  def command_355
    # Set first line to script
    script = @list[@index].parameters[0] + "\n"
    # Loop
    loop do
      # If next event command is second line of script or after
      if @list[@index + 1].code == 655
        # Add second line or after to script
        script += @list[@index + 1].parameters[0] + "\n"
      # If event command is not second line or after
      else
        # Abort loop
        break
      end
      # Advance index
      @index += 1
    end
    # Evaluation
    result = eval(script)

    # Continue
    return true
  end
end

#==============================================================================
# ** Window_Choice
#------------------------------------------------------------------------------
#  This message window is used to display choices.
#==============================================================================
class Window_Choice < Window_Selectable
  def initialize (choices)
    super(0, 0, 32, choices.size * 32)
    self.visible = false
    self.active = false
    @index = 0
    @item_max = choices.size
    @choices = choices
    self.contents = Bitmap.new(32, 32)
  end
  
  def refresh
    # determine necessary width
    width = 64
    for line in @choices
      width = [width, (self.contents.text_size(line).width + 48)].max
    end
    self.width = width
    self.height = @choices.size * 32 + 32
    self.contents = Bitmap.new(width - 32, height - 32)
    
    # draw choices
    y = 0
    for line in @choices
      self.contents.draw_text(4, y * 32, width, 32, line) 
      y += 1
    end
  end
      
  def set_choices(choices)
    @choices = choices
    @item_max = @choices.size
    refresh
  end
end

#==============================================================================
# ** Window_Name
#------------------------------------------------------------------------------
#  This window is used to display names above the message window.  Uncomment
#   and modify the various sections to customize.
#==============================================================================
class Window_Name < Window_Base
  def initialize
    super(0, 0, 32, 64)
    self.contents = Bitmap.new(32, 32)
    self.opacity = 0
    self.visible = false
  end
  
  def set_name(name)
    @name = name
    refresh
  end
  
  def refresh
    if @name == nil
      return
    end
    self.width = self.contents.text_size(@name).width + 48
    self.contents = Bitmap.new(width - 32, height - 32)
    # uncomment this and change the font to give the name window a fancy font
    #self.contents.font.name = "Ariel"
    self.contents.font.color = Color.new(0, 0, 0, 255)
    self.contents.draw_text(0, 0, self.width, 32, @name)
    self.contents.draw_text(0, 2, self.width, 32, @name)
    self.contents.draw_text(2, 0, self.width, 32, @name)
    self.contents.draw_text(2, 2, self.width, 32, @name)
    # change the color to give the name window a seperate color
    self.contents.font.color = normal_color
    self.contents.draw_text(1, 1, self.width, 32, @name)
  end
end


#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#  This class handles temporary data that is not included with save data.
#  Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
  attr_accessor :choices
end

class Scene_Map
  alias ums_update update
  def update
    $game_system.slave_windows.each_value { |window| window.update }
    ums_update
  end
end

#==============================================================================
# ** Window_Slave
#------------------------------------------------------------------------------
#  These are slave windows to the main message window.  They will close when 
#   the user terminates them.  Initial settings are identical to the main 
#   message window, with one exception.  When in normal mode, it will apear
#   above if the main message is below, below if it is above or centered.  Use
#   message codes to change the settings for this window.
#==============================================================================
class Window_Slave < Window_Base
  attr_accessor :show
  
  def write_all
    @write_all = true
  end
  
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize (text)
    super(0, 0, 33, 33)
    @text = text
    
    # x-coordinate depends on justification
    if @justification == RIGHT
      self.x = 640 - self.width
    elsif @justification == LEFT
      self.x = 0
    else # center
      self.x = (640 - self.width) / 2
    end
    # y-coordinate depends on height
    self.y = 480 - $game_system.window_height - 16
    self.contents = Bitmap.new(width - 32, height - 32)
    self.visible = false
    self.z = 9998
    @fade_in = false
    @fade_out = false
    @contents_showing = false
    
    # face graphic sprite
    @face = Sprite.new
    @face.opacity = 0
    @face.z = self.z + 1
    @face_offset = 0
    
    # choice window
    @choice_window = Window_Choice.new([])
    @choice_window.back_opacity = 160
    
    @comic_style = $game_system.comic_style
    @name = $game_system.name
    
    # comic sprite
    @comic = Sprite.new
    @comic.opacity = 0
    @comic.z = self.z + 1
    if @comic_style == TALK1
      @comic.bitmap = RPG::Cache.windowskin("talk1")
    elsif @comic_style == TALK2
      @comic.bitmap = RPG::Cache.windowskin("talk2")
    else # thought
      @comic.bitmap = RPG::Cache.windowskin("thought")
    end
    
    
    
    @pause = 0
    @wait = 0
    
    @mode = $game_system.ums_mode
    self.height = $game_system.window_height
    self.width = $game_system.window_width
    @justification = $game_system.window_justification
    @face_graphic = $game_system.face_graphic
    @face_graphic_justification = $game_system.face_graphic_justification
    @message_event = $game_system.message_event
    if $game_system.message_position == 2 # down
      @message_position = 0
    else
      @message_postion = 2
    end
    @face_graphic_position = $game_system.face_graphic_position
    if $game_system.font == ""
      @font = Font.default_name
    else
      @font = $game_system.font
    end
    @text_justification = $game_system.text_justification
    
    @shake = $game_system.shake
    
    refresh
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    terminate_message
    $game_temp.message_window_showing = false
    if @input_number_window != nil
      @input_number_window.dispose
    end
    @face.dispose
    @choice_window.dispose
    @comic.dispose
    if @name_window != nil
      @name_window.dispose
    end
    super
  end
  #--------------------------------------------------------------------------
  # * Terminate Message
  #--------------------------------------------------------------------------
  def terminate_message
    self.active = false
    self.pause = false
    self.contents.clear
    # Clear showing flag
    @contents_showing = false
    # Call message callback
    if $game_temp.message_proc != nil
      $game_temp.message_proc.call
    end
    # Clear variables related to text, choices, and number input
    $game_temp.message_text = nil
    $game_temp.message_proc = nil
    $game_temp.choice_start = 99
    $game_temp.choice_max = 0
    $game_temp.choice_cancel_type = 0
    $game_temp.choice_proc = nil
    $game_temp.num_input_start = 99
    $game_temp.num_input_variable_id = 0
    $game_temp.num_input_digits_max = 0
    # Open gold window
    if @gold_window != nil
      @gold_window.dispose
      @gold_window = nil
    end
    @choice_window.visible = false
    @choice_window.active = false
    @comic.opacity = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    
    self.contents.clear
    self.contents.font.color = normal_color
    @x = @y = 0

    # If waiting for a message to be displayed
    if @text != nil
      # replace shortcuts with original code
      $game_system.shortcuts.each { |shortcut, code|
        @text.gsub!(shortcut, code)
      }
      
      # Control text processing
      begin
        last_text = @text.clone
        @text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
      end until @text == last_text
      @text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
      end
      
      # window mode
      if @text.index(/\\[Mm]/) != nil
        if $game_system.ums_mode == NORMAL_MODE
          @mode = FIT_WINDOW_TO_TEXT
        else
          @mode = NORMAL_MODE
        end
        @text.gsub!(/\\[Mm]/) { "" }
      end
      
      # window height
      @text.gsub!(/\\[Hh][Ee][Ii][Gg][Hh][Tt]\[([0-9]+)\]/) do
        self.height = $1.to_i
        ""
      end
      
      # window width
      @text.gsub!(/\\[Ww][Ii][Dd][Tt][Hh]\[([0-9]+)\]/) do
        self.width = $1.to_i
        ""
      end
      
      # justification
      @text.gsub!(/\\[Jj][Rr]/) do
        @justification = RIGHT
        reset_window
        ""
      end
      @text.gsub!(/\\[Jj][Cc]/) do
        @justification = CENTER
        reset_window
        ""
      end      
      @text.gsub!(/\\[Jj][Ll]/) do
        @justification = LEFT
        reset_window
        ""
      end
      
      # face graphics
      @text.gsub!(/\\[Ff][Aa][Cc][Ee]\[(.*?)\]/) do
        @face_graphic = $1.to_s
        if $1.to_s == ""
          @face.opacity = 0
        end
        ""
      end
      @text.gsub!(/\\[Ff][Ll]/) do
        @face_graphic_justification = LEFT
        ""
      end
      @text.gsub!(/\\[Ff][Rr]/) do
        @face_graphic_justification = RIGHT
        ""
      end
      
      # event centering
      @text.gsub!(/\\[Ee]\[([0-9]+)\]/) do
        @message_event = $1.to_i
        ""
      end
      
      # comic thingy
      @text.gsub!(/\\[Tt]1/) do
        @comic_style = TALK1
        @comic.bitmap = RPG::Cache.windowskin("talk1.png")
        ""
      end
      @text.gsub!(/\\[Tt]2/) do
        @comic_style = TALK2
        @comic.bitmap = RPG::Cache.windowskin("talk2.png")
        ""
      end
      @text.gsub!(/\\[Tt][Hh]/) do
        @comic_style = THOUGHT
        @comic.bitmap = RPG::Cache.windowskin("thought.png")
        ""
      end
      
      # name window
      @text.gsub!(/\\[Nn][Mm]\[(.*?)\]/) do
        @name = $1.to_s
        if $1.to_s == "" and @name_window != nil
          @name_window.visible = false
        end
        ""
      end
      if @name != ""
        # name window
        @name_window = Window_Name.new
        @name_window.z = self.z + 1
        @name_window.set_name(@name)
      end
      
      # shaking
      @text.gsub!(/\\[Ss][Hh][Kk]\[([0-9]+)\]/) do
        @shake = $1.to_i
        ""
      end
      
      # Change "\\\\" to "\000" for convenience
      @text.gsub!(/\\\\/) { "\000" }
      # Change "\\C" to "\001" and "\\G" to "\002"
      @text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
      @text.gsub!(/\\[Gg]/) { "\002" }
      
      # text skip code
      @text.gsub!(/\\[Ss][Kk][Ii][Pp]/) { "\003" }
      
      # ignore code
      @text.gsub!(/\\[Ii][Gg][Nn][Rr]/) { "\023" }
      
      # bold and italics
      @text.gsub!(/\\[Bb]/) { "\004" }
      @text.gsub!(/\\[Ii]/) { "\005" }
      
      # shadow
      @text.gsub!(/\\[Ss]/) { "\006" }
      
      # font
      @text.gsub!(/\\[Ff][Oo][Nn][Tt]\[(.*?)\]/) { "\007[#{$1}]" }
      
      # pause and wait
      @text.gsub!(/\\[Pp]\[([0-9]+)\]/) { "\010[#{$1}]" }
      @text.gsub!(/\\[Ww]\[([0-9]+)\]/) { "\011[#{$1}]" }
      
      # write speed
      @text.gsub!(/\\[Ww][Ss]\[([0-9]+)\]/) { "\013[#{$1}]" }
            
      # armor, items, skills, and weapons
      @text.gsub!(/\\[Oo][Aa]\[([0-9]+)\]/) { 
        item = $data_armors[$1.to_i]
        "\014[#{$1}]" + "  " + item.name
      }
      @text.gsub!(/\\[Oo][Ii]\[([0-9]+)\]/) { 
        item = $data_items[$1.to_i]
        "\015[#{$1}]" + "  " + item.name
      }
      @text.gsub!(/\\[Oo][Ss]\[([0-9]+)\]/) { 
        item = $data_skills[$1.to_i]
        "\016[#{$1}]" + "  " + item.name
      }
      @text.gsub!(/\\[Oo][Ww]\[([0-9]+)\]/) { 
        item = $data_weapons[$1.to_i]
        "\017[#{$1}]" + "  " + item.name
      }
      
      # text justification
      @text.gsub!(/\\[Tt][Cc]/) { "\020" }
      @text.gsub!(/\\[Tt][Ll]/) { "\021" }
      @text.gsub!(/\\[Tt][Rr]/) { "\022" }
      
      # Resize the window to fit the contents?
      if @mode == FIT_WINDOW_TO_TEXT
        width = 1
        text = @text.split("\n")
        height = 0
        for line in text
          # don't count this line's width if it has the ignr code
          if !line.include?("\023")
            width = [width, self.contents.text_size(line).width].max
            height += self.contents.text_size(line).height + 6
          end
        end
         
        self.width = width + 48
        self.height = height + 46 
        self.contents = Bitmap.new(width + 16, height + 16)
      else
        if self.width != $game_system.window_height or self.height != $game_system.window_width
          self.width = $game_system.window_width
          self.height = $game_system.window_height
          self.contents = Bitmap.new(self.width - 32, self.height - 32)
        end
      end
      
      reset_window
      
      get_x_value
      
      @count = Graphics.frame_count
      @pause = 0
      @ignore = false
    end
    
    
    
    # If number input
    if $game_temp.num_input_variable_id > 0
      digits_max = $game_temp.num_input_digits_max
      number = $game_variables[$game_temp.num_input_variable_id]
      @input_number_window = Window_InputNumber.new(digits_max)
      @input_number_window.number = number
      @input_number_window.x = self.x + 8
      @input_number_window.y = self.y + $game_temp.num_input_start * 32
    end
  end
  #--------------------------------------------------------------------------
  # * Set Window Position and Opacity Level
  #--------------------------------------------------------------------------
  def reset_window (change_opacity = true)
    # x-coordinate depends on justification
    if @message_event == -1
      if @justification == RIGHT
        self.x = 640 - self.width
      elsif @justification == LEFT
        self.x = 0
      else # center
        self.x = (640 - self.width) / 2
      end
    else
      if @message_event == 0 or $game_map.events[@message_event] == nil
        # center on player
        event_x = $game_player.screen_x
      else
        # center on the event specified
        event_x = $game_map.events[@message_event].screen_x
      end
      self.x = event_x - self.width / 2
      @comic.x = self.x + (self.width / 2) + 4
    end
    
    if $game_temp.in_battle
      self.y = 16
    else
      if @message_event == -1
        case @message_position
          when 0  # up
            self.y = 16
          when 1  # middle
            self.y = (480 - self.height) / 2
          when 2  # down
            self.y = 480 - self.height - 24
        end
      else
        if @message_event == 0 or $game_map.events[@message_event] == nil
          # above player
          self.y = $game_player.screen_y - self.height - 48
        else
          # above event specified
          self.y = $game_map.events[@message_event].screen_y - self.height - 48
        end
        @comic.y = self.y + self.height - 2
      end
    end
    if self.y < 0 + (@name == "" ? 0 : 16)
      self.y = 0 + (@name == "" ? 0 : 16)
    elsif self.y > 480 - self.height 
      self.y = 480 - self.height
    end
    if self.x < 0 
      self.x = 0
    elsif self.x > 680 - self.width - 48
      self.x = 640 - self.width
    end
    
    if change_opacity
      if $game_system.message_frame == 0
        self.opacity = 255
      else
        self.opacity = 0
      end
      self.back_opacity = 160
    end
    
    # face stuff
      if @face_graphic != ""  
        # the player has chosen to show a face graphic
        @face.bitmap = RPG::Cache.picture(@face_graphic)
        
        # picture y-coordinate
        if @face_graphic_position == ABOVE
          @face.y = self.y - @face.bitmap.height
          @face_offset = 0
        elsif @face_graphic_position == CENTER
          delta = (@face.bitmap.height - self.height) / 2
          @face.y = self.y - delta
          @x = @face_offset = @face.bitmap.width + 16
        elsif @face_graphic_position == BOTTOM 
          @face.y = self.y + self.height - @face.bitmap.height
          @x = @face_offset = @face.bitmap.width + 16
        else # side
          delta = (@face.bitmap.height - self.height) / 2
          @face.y = self.y - delta
          @face_offset = 0
        end
        
        # picture x-coordinate
        if @face_graphic_justification == LEFT
          if @face_graphic_position == SIDE
            @face.x = self.x - @face.bitmap.width
          else
            @face.x = self.x + 10
          end
        else
          if @face_graphic_position == SIDE
            @face.x = self.x + self.width
          else
            @face.x = self.x + self.width - @face.bitmap.width - 10
            @x = @face_offset = 0
          end
        end
      end
      
      # name window
      if @name != "" and @name != nil
        @name_window.set_name(@name)
        @name_window.x = self.x
        @name_window.y = self.y - 36
      end
      
      # If choice
    if $game_temp.choice_max > 0
      @choice_window.set_choices($game_temp.choices)
      # determine x and y coords for choice window
      if $game_system.choice_justification == LEFT
        @choice_window.x = self.x
      else
        @choice_window.x = self.x + self.width - @choice_window.width
      end
      if $game_system.choice_position == ABOVE
        # check to make sure there is enough room above the textbox
        if self.y < @choice_window.height
          # not enough room above, place below
          @choice_window.y = self.y + self.height
        else
          # draw above
          @choice_window.y = self.y - @choice_window.height
        end
      elsif $game_system.choice_position == BOTTOM
        # check to make sure there is enough room below the textbox
        if (480 - self.y - self.height) < @choice_window.height
          # not enough room below, place above
          @choice_window.y = self.y - @choice_window.height
        else
          # draw below 
          @choice_window.y = self.y + self.height
        end
      else # side
        if $game_system.choice_justification == LEFT
          # check to make sure there's room on the left side
          if self.y < @choice_window.width
            # not enough room on the side, check to make sure there's room below
            if (480 - self.y - self.height) < @choice_window.height
              # not enough room below, place above
              @choice_window.y = self.y - @choice_window.height
            else
              # draw below 
              @choice_window.y = self.y + self.height
            end
          else
            # place on the left side
            @choice_window.y = self.y
            @choice_window.x = self.x - @choice_window.width
          end
        else # right
          # check to make sure there's room on the right side
          if (680 - (self.y + self.width)) < @choice_window.width
            # not enough room on the side, check to make sure there's room below
            if (480 - self.y - self.height) < @choice_window.height
              # not enough room below, place above
              @choice_window.y = self.y - @choice_window.height
            else
              # draw below 
              @choice_window.y = self.y + self.height
            end
          else
            # place on the left side
            @choice_window.y = self.y
            @choice_window.x = self.x + self.width
          end
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    
    if !@show
      return
    else
      self.visible = true
      if @face_graphic != ""
        @face.opacity = 255
      end
      if $game_system.comic_enabled and @message_event != -1
        @comic.opacity = 255
      end
      if @name != ""
        @name_window.visible = true
      end
      if @input_number_window != nil
        @input_number_window.contents_opacity = 255
      end
      reset_window
    end
    
    
    if @contents_showing and $game_system.message_event != -1 and @shake == 0
      reset_window(false)
    end
    
    if $game_system.shake != 0  # shake the window
      if @ascending
        if @target_x != self.x
          self.x += 1
        else
          @ascending = false
          @target_x = self.x - ($game_system.shake * 2)
        end
      else 
        if @target_x != self.x
          self.x -= 1
        else
          @ascending = true
          @target_x = self.x + ($game_system.shake * 2)
        end
      end
    end
    
    if @wait > 0
      @wait -= 1
      if @wait == 0
        terminate_message
        return
      end
    end
    
    # If fade in
    if @fade_in
      self.contents_opacity += 24
      if @face_graphic != ""
        @face.opacity += 24
      end
      if $game_system.comic_enabled and @message_event != -1
        @comic.opacity += 24
      end
      if @name != ""
        @name_window.visible = true
      end
      if @input_number_window != nil
        @input_number_window.contents_opacity += 24
      end
      if self.contents_opacity == 255
        @fade_in = false
      end
      return
    end
    
    # write the text
    if @text != nil and @text != ""
      speed = $game_system.write_speed
      if $game_system.text_skip
        if $game_system.skip_mode == WRITE_FASTER and Input.press?(Input::C)
          # the player is holding the action button, write faster
          speed /= 3
        elsif $game_system.skip_mode == WRITE_ALL and @write_all
          # the player pressed the action button, write all the text
          while (c = @text.slice!(/./m)) != nil
            write_char(c)
          end
          return
        end
      end
      while @ignore
        c = @text.slice!(/./m)
        if c != nil
          write_char(c)
        end
      end
      if @pause > 0
        @pause -= 1
        return
      end
      if Graphics.frame_count - @count >= speed
        if $game_system.sound_effect != ""
          Audio.se_play("Audio/SE/" + $game_system.sound_effect, 80, 100)
        end
        @count = Graphics.frame_count
        c = @text.slice!(/./m)
        if c != nil
          write_char(c)
        end
      end
      return
    end
    
    # If inputting number
    if @input_number_window != nil
      @input_number_window.update
      # Confirm
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        $game_variables[$game_temp.num_input_variable_id] =
          @input_number_window.number
        $game_map.need_refresh = true
        # Dispose of number input window
        @input_number_window.dispose
        @input_number_window = nil
        terminate_message
      end
      return
    end
    
    if @wait != 0
      return
    end
    
    # If message is being displayed and contents are all written
    if @contents_showing
      # if choice
      if $game_temp.choice_max > 0
        if !@choice_window.active
          @choice_window.visible = true
          @choice_window.active = true
          @choice_window.index = 0
        end
        @choice_window.update
      else
        # If choice isn't being displayed, show pause sign
        self.pause = true
      end
      return
    end
  end
  
  #--------------------------------------------------------------------------
  # * Process and write the given character
  #--------------------------------------------------------------------------
  def write_char(c)
    if c == "\000"
      # Return to original text
      c = "\\"
    end
    # If \C[n]
    if c == "\001"
    # Change text color
      @text.sub!(/\[([0-9]+)\]/, "")
      color = $1.to_i
      if color >= 0 and color <= 7
        self.contents.font.color = text_color(color)
      end
      # go to next text
      return
    end
    # If \G
    if c == "\002"
      # Make gold window
      if @gold_window == nil
        @gold_window = Window_Gold.new
        @gold_window.x = 560 - @gold_window.width
        if $game_temp.in_battle
          @gold_window.y = 192
        else
          @gold_window.y = self.y >= 128 ? 32 : 384
        end
        @gold_window.opacity = self.opacity
        @gold_window.back_opacity = self.back_opacity
      end
      # go to next text
      return
    end
    # If \skip
    if c == "\003"
      # toggle text skipping
      #$game_system.text_skip = !$game_system.text_skip
      # go to next text
      return
    end
    # If \b
    if c == "\004"
      # toggle bold
      self.contents.font.bold = !self.contents.font.bold
      # go to next text
      return
    end
    # If \i
    if c == "\005"
      # toggle italics
      self.contents.font.italic = !self.contents.font.italic
      # go to next text
      return
    end
    # If \s
    if c == "\006"
      # toggle shadow
      #$game_system.shadowed_text = !$game_system.shadowed_text
      # go to next text
      return
    end
    # If \font
    if c == "\007"
      # change font
      @text.sub!(/\[(.*?)\]/, "")
      font = $1.to_s
      @font = font
      if font == ""
        self.contents.font.name = Font.default_name
      else
        self.contents.font.name = font
      end
      # go to next text
      return
    end
    # If \p[n]
    if c == "\010"
      @text.sub!(/\[([0-9]+)\]/, "")
      @pause = $1.to_i

      # go to next text
      return
    end
    
    # If \w[n]
    if c == "\011"
      @text.sub!(/\[([0-9]+)\]/, "")
      @wait = $1.to_i

      # go to next text
      return
    end
    
    # If \ws[n]
    if c == "\013"
      @text.sub!(/\[([0-9]+)\]/, "")
      $game_system.write_speed = $1.to_i

      # go to next text
      return
    end 
    # If \oa[n]
    if c == "\014"
      @text.sub!(/\[([0-9]+)\]/, "")
      index = $1.to_i
      @text.sub!("  ", "")
      item = $data_armors[index]
      # draw the icon
      icon = RPG::Cache.icon(item.icon_name)
      self.contents.blt(@x + 2, (@y * 32) + 4, icon, Rect.new(0, 0, 24, 24))
      @x += 24

      # go to next text
      return
    end
    
    # If \oi[n]
    if c == "\015"
      @text.sub!(/\[([0-9]+)\]/, "")
      index = $1.to_i
      @text.sub!("  ", "")
      item = $data_items[index]
      # draw the icon
      icon = RPG::Cache.icon(item.icon_name)
      self.contents.blt(@x + 2, (@y * 32) + 4, icon, Rect.new(0, 0, 24, 24))
      @x += 24

      # go to next text
      return
    end
    
    # If \os[n]
    if c == "\016"
      @text.sub!(/\[([0-9]+)\]/, "")
      index = $1.to_i
      @text.sub!("  ", "")
      item = $data_skills[index]
      # draw the icon
      icon = RPG::Cache.icon(item.icon_name)
      self.contents.blt(@x + 2, (@y * 32) + 4, icon, Rect.new(0, 0, 24, 24))
      @x += 24

      # go to next text
      return
    end
    
    # If \ow[n]
    if c == "\017"
      @text.sub!(/\[([0-9]+)\]/, "")
      index = $1.to_i
      @text.sub!("  ", "")
      item = $data_weapons[index]
      # draw the icon
      icon = RPG::Cache.icon(item.icon_name)
      self.contents.blt(@x + 2, (@y * 32) + 4, icon, Rect.new(0, 0, 24, 24))
      @x += 24
      
      # go to next text
      return
    end
    
    # If \tc
    if c == "\020"
      # center justify
      @text_justification = CENTER
      get_x_value
      # go to next text
      return
    end
    
    # If \tl
    if c == "\021"
      # left justify
      @text_justification = LEFT
      get_x_value
      # go to next text
      return
    end
    
    # If \tr
    if c == "\022"
      # right justify
      @text_justification = RIGHT
      get_x_value
      # go to next text
      return
    end
    
    # If \ignr
    if c == "\023"
      # set ignore flage
      @ignore = true
      # go to next text
      return
    end
    
    # If new line text
    if c == "\n"
      # Add 1 to y
      if !@ignore
        @y += 1
      end
      if @text != ""
        get_x_value
      end
      @ignore = false

      # go to next text
      return
    end
    if @ignore
      return
    end
    # Draw text
    if $game_system.shadowed_text
      old_color = self.contents.font.color.clone
      self.contents.font.color = $game_system.shadow_color
      self.contents.draw_text(6 + @x, 32 * @y + 2, 40, 32, c)
      self.contents.font.color = old_color
    end
    self.contents.draw_text(4 + @x, 32 * @y, 40, 32, c)
    # Add x to drawn text width
    @x += self.contents.text_size(c).width
  end
  
  def get_x_value
    # text justification - offset for first line
    if @text_justification == CENTER
      # get the length of the current line
      w = self.contents.text_size(@text.split("\n")[0]).width
      @x = (self.width - w - 48) / 2
    elsif @text_justification == RIGHT
      # get the length of the current line
      w = self.contents.text_size(@text.split("\n")[0]).width
      @x = self.width - w - 48
    else # left
      if @face_graphic == ""
        @x = 0
      else
        @x = @face_offset
      end
    end
  end
end
 
Última edición por un moderador:
Mensajes
92
Reacciones
0
Puntos
0
no me sale el scrpit o es que n esta.. si alguien lo tiene me lo puede poner??

lo del (XMS Action Battle System)
 
OP

*LeGeNt*Of*ST

Platinum User
Mensajes
2.886
Reacciones
36
Puntos
932
Ubicación
._.
Si sale.. en un post que coloco akasuki
http://www.emudesc.net/foros/449659-post6.html

Para los demás, sobre los Scripts de VX que están saliendo.. no habrá más temas.. ya que las reglas están claras y este tema es en el que se deben postear los scrips... si hay diferencia en scripts, por lo tanto solo se separaran por un titulo.
 
Mensajes
944
Reacciones
0
Puntos
0
Ubicación
En los Cuarteles del Clan Uchiha [Jefazo]
Bueno ya ke el Mod ya hablo abra ke hacerle caso ¬¬....


RGSS2



Mog Animated Title Screen Miria V 1.0

VX_Menu01_IM01.gif


Idioma. portuges xD

CARACTERÍSTICAS
- Tela de titulo animada.- Fondo Animado
- Efeito de Wave no texto do titulo.- Efecto Wave En texto y Titulo
- Comandos em pictures.- comandos en Imagenes
- Opção de Full Screen automático.- Algo Automatico xD

UTILIZAÇÃO
Dentro da pasta Graphics crie uma pasta com o nome deTitle e coloque todas as imagens dentro dela.
São necessárias as seguintes imagens. - Dentro de la Carpeta Graphics Pega las imagens que son las SIguientes:

Title - Imagem que contem o texto do titulo - Imagen que Contiene texto o Titulo
Transition - Imagem da transição de tela - imagen de Transicion de fondo
Plane1 - Imagem da camada 1- Imagen rotatoria 1
Plane2 - Imagem da camada 2- Imagen rotatoria 2
Plane3 - Imagem da camada 3- Imagen rotatoria 3
Com_01 - Imagem do menu seleção NEW GAME - Imagen de Seleccion Nuevo Juego
Com_02 - Imagem do menu seleção CONTINUE- Imagen de Seleccion Continuar
Com_03 - Imagem do menu seleção EXIT- Imagen de Seleccion Salir

DESCARGAR

atelier-rgss
 
Mensajes
92
Reacciones
0
Puntos
0
haber me lo he descargado...pero exactamente, en la herramienta de scripts que he de cambiar??
gracias...:surprice::surprice:

UN par de cuestiones:

-hay alguna script k aga k kuando yo presione una tecla el personaje salte?..si es asi que alguien lo pongo si lo conoce plis...GraX

-como puedo hacer, (supongo k kon scripts) para que antes del título me salga un video de introduccion?
otra.
-Hay algunas canciones que tardan mucho en empezar..como lo soluciono..?


eso es todo...
 
Última edición:
Mensajes
1.557
Reacciones
0
Puntos
0
Ubicación
I don't live in this world...
Advanced Real Time Battle System V 0.9
by Samo, The thief.
Las "inovaciones":
En el mapa:
-Los heroes pueden ser elegidos y se les puede dar ordenes por separado.
-Se pueden usar armas de rango
-Cuando los enemigos te vean te van a tratar de matar y si te vas muy lejos se van a quedar parados donde estan
-Se pueden usar skills
-La batalla es en tiempo real
-Se puede poner el juego en pausa y darle ordenes a los personajes en pausa.
-LO DEMAS DESCUBRANLO USTEDES...
bajalo de aca: http://www.zshare.net/download/2507783450e970/ <- Pesa 75 Mb pero vale la pena...

Screens:
screen3mw8.png

screen4pq5.png

screen5mc8.png

screen6od6.png

screen7vx1.png
 
Mensajes
572
Reacciones
0
Puntos
0
Ubicación
Mas allá de lo que ves... a______a
Hey matsumoto. El modo de batalla Xas Hero es muy dificil de pasar, ya que tiene como 20 scaripts. Te recomiendo que empieses un juego de ahí, borra todos los mapas y crea un proyecto.
¿Un modo de batalla lateral? Mira a ver si esta demo te complace.


ese sistema de batalla lateral no es el que busco necesito uno que sea lo mas parecido al 2003

de paso colaboro con este script que encontre para poner faceset en el rpg maker xp
instrucciones:
tienes que cambiar el contenido del script Window_Message por lo siguiente
Código:
#==============================================================================
#  Window_Message
#------------------------------------------------------------------------------
#
#==============================================================================

class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # 
  #--------------------------------------------------------------------------
  def initialize
    super(80, 304, 480, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font = Font.new("Arial")
    self.visible = false
    self.z = 9998
    @fade_in = false
    @fade_out = false
    @contents_showing = false
    @cursor_width = 0
    @pic_width = 96
    @pic_height = 96
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # 
  #--------------------------------------------------------------------------
  def dispose
    terminate_message
    $game_temp.message_window_showing = false
    if @input_number_window != nil
      @input_number_window.dispose
    end
    super
  end
  #--------------------------------------------------------------------------
  # 
  #--------------------------------------------------------------------------
  def terminate_message
    self.active = false
    self.pause = false
    self.index = -1
    self.contents.clear
    @contents_showing = false

    if $game_temp.message_proc != nil
      $game_temp.message_proc.call
    end

    $game_temp.message_text = nil
    $game_temp.message_proc = nil
    $game_temp.choice_start = 99
    $game_temp.choice_max = 0
    $game_temp.choice_cancel_type = 0
    $game_temp.choice_proc = nil
    $game_temp.num_input_start = 99
    $game_temp.num_input_variable_id = 0
    $game_temp.num_input_digits_max = 0

    if @gold_window != nil
      @gold_window.dispose
      @gold_window = nil
    end
  end
  #--------------------------------------------------------------------------
  # 
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    x = y = 0
    @cursor_width = 0

    if $game_temp.choice_start == 0
      x = 8
    end

    if $game_temp.message_text != nil
      text = $game_temp.message_text

      begin
        last_text = text.clone
        text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
      end until text == last_text
      text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
      end
      text.gsub!(/\\[Ww]\[([0-9]+)\]/) do
        @pic_width = $1.to_i
        ""
      end
      text.gsub!(/\\[Hh]\[([0-9]+)\]/) do
        @pic_height = $1.to_i
        ""
      end
      text.gsub!(/\\[Ff]\[([\w]+)\]/) do
        temp = RPG::Cache.picture($1)
        pic_x = self.contents.width - @pic_width - 10
        pic_y = self.contents.height / 2 - @pic_height / 2
        dest = Rect.new(pic_x,pic_y,@pic_width, @pic_height)
        src = Rect.new(0,0,temp.width, temp.height)
        self.contents.stretch_blt(dest, temp, src) 
        ""
      end   

      text.gsub!(/\\\\/) { "\000" }
      text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
      text.gsub!(/\\[Gg]/) { "\002" }

      while ((c = text.slice!(/./m)) != nil)

        if c == "\000"
          c = "\\"
        end

        if c == "\001"
          text.sub!(/\[([0-9]+)\]/, "")
          color = $1.to_i
          if color >= 0 and color <= 7
            self.contents.font.color = text_color(color)
          end
          next
        end

        if c == "\002"
          if @gold_window == nil
            @gold_window = Window_Gold.new
            @gold_window.x = 560 - @gold_window.width
            if $game_temp.in_battle
              @gold_window.y = 192
            else
              @gold_window.y = self.y >= 128 ? 32 : 384
            end
            @gold_window.opacity = self.opacity
            @gold_window.back_opacity = self.back_opacity
          end
          next
        end

        if c == "\n"
          if y >= $game_temp.choice_start
            @cursor_width = [@cursor_width, x].max
          end
          y += 1
          x = 0

          if y >= $game_temp.choice_start
            x = 8
          end
          next
        end

        self.contents.draw_text(4 + x, 32 * y, 40, 32, c)

        x += self.contents.text_size(c).width
      end
    end

    if $game_temp.choice_max > 0
      @item_max = $game_temp.choice_max
      self.active = true
      self.index = 0
    end

    if $game_temp.num_input_variable_id > 0
      digits_max = $game_temp.num_input_digits_max
      number = $game_variables[$game_temp.num_input_variable_id]
      @input_number_window = Window_InputNumber.new(digits_max)
      @input_number_window.number = number
      @input_number_window.x = self.x + 8
      @input_number_window.y = self.y + $game_temp.num_input_start * 32
    end
  end
  #--------------------------------------------------------------------------
  # 
  #--------------------------------------------------------------------------
  def reset_window
    if $game_temp.in_battle
      self.y = 16
    else
      case $game_system.message_position
      when 0  # ?
        self.y = 16
      when 1  # ?
        self.y = 160
      when 2  # ?
        self.y = 304
      end
    end
    if $game_system.message_frame == 0
      self.opacity = 255
    else
      self.opacity = 0
    end
    self.back_opacity = 160
  end
  #--------------------------------------------------------------------------
  # 
  #--------------------------------------------------------------------------
  def update
    super

    if @fade_in
      self.contents_opacity += 24
      if @input_number_window != nil
        @input_number_window.contents_opacity += 24
      end
      if self.contents_opacity == 255
        @fade_in = false
      end
      return
    end

    if @input_number_window != nil
      @input_number_window.update

      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        $game_variables[$game_temp.num_input_variable_id] =
          @input_number_window.number
        $game_map.need_refresh = true

        @input_number_window.dispose
        @input_number_window = nil
        terminate_message
      end
      return
    end

    if @contents_showing

      if $game_temp.choice_max == 0
        self.pause = true
      end

      if Input.trigger?(Input::B)
        if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
          $game_system.se_play($data_system.cancel_se)
          $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
          terminate_message
        end
      end

      if Input.trigger?(Input::C)
        if $game_temp.choice_max > 0
          $game_system.se_play($data_system.decision_se)
          $game_temp.choice_proc.call(self.index)
        end
        terminate_message
      end
      return
    end

    if @fade_out == false and $game_temp.message_text != nil
      @contents_showing = true
      $game_temp.message_window_showing = true
      reset_window
      refresh
      Graphics.frame_reset
      self.visible = true
      self.contents_opacity = 0
      if @input_number_window != nil
        @input_number_window.contents_opacity = 0
      end
      @fade_in = true
      return
    end

    if self.visible
      @fade_out = true
      self.opacity -= 48
      if self.opacity == 0
        self.visible = false
        @fade_out = false
        $game_temp.message_window_showing = false
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  #
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index >= 0
      n = $game_temp.choice_start + @index
      self.cursor_rect.set(8, n * 32, @cursor_width, 32)
    else
      self.cursor_rect.empty
    end
  end
end
para hacerlo funcionar pon las faces en la carpeta pictures del proyecto y en el juego al poner un mesaje con face pon al principio
Código:
 \f[filename]
reemplazando filename por el nombre de la imagen sin la terminacion de la imagen
Nota: la imagen debe ser como minimo de 96x96
 
Última edición:
Mensajes
959
Reacciones
3
Puntos
0
mm bueno aqui un scritp este scrpt no es mio
RM XP
Descripción:
Este script permite que en las tiendas, aparte del precio normal, se cobre un impuesto extra que se puede modificar en cualquier momento. Sería algo así como el I.V.A.
Script:
#============================================================================
# Tax Script 1.2
#----------------------------------------------------------------------------
# By The_Darklord
# Thanks to SephirothSpawn for help
#----------------------------------------------------------------------------
# The following methods are rewritten:
# Window_ShopBuy(draw_iten(index), Scene_Shop(update_buy, update_number)
# Window_ShopStatus(refresh)
#============================================================================

class Game_System
attr_accessor :tax
alias declaration initialize
def initialize
declaration
@tax = 0
end
end

class Window_ShopBuy < Window_Selectable
alias make_item draw_item
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
a = item.price
item.price = Integer(a * ( (100 + $game_system.tax) / 100.0))
make_item(index)
item.price = a
end
end

#------------------------------------------------------------------------------

class Scene_Shop
#--------------------------------------------------------------------------
# * Frame Update (when buy window is active)
#--------------------------------------------------------------------------
def update_buy
# Set status window item
@status_window.item = @buy_window.item
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Change windows to initial mode
@command_window.active = true
@dummy_window.visible = true
@buy_window.active = false
@buy_window.visible = false
@status_window.visible = false
@status_window.item = nil
# Erase help text
@help_window.set_text("")
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get item
@item = @buy_window.item
a = @item.price
@item.price = Integer(a * ( (100 + $game_system.tax) / 100.0))
# If item is invalid, or price is higher than money possessed
if @item == nil or @item.price > $game_party.gold
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Get items in possession count
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
# If 99 items are already in possession
if number == 99
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Calculate maximum amount possible to buy
max = @item.price == 0 ? 99 : $game_party.gold / @item.price
max = [max, 99 - number].min
# Change windows to quantity input mode
@buy_window.active = false
@buy_window.visible = false
@number_window.set(@item, max, @item.price)
@number_window.active = true
@number_window.visible = true
@item.price = a
end
end
#--------------------------------------------------------------------------
# * Frame Update (when quantity input window is active)
#--------------------------------------------------------------------------
def update_number
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Set quantity input window to inactive / invisible
@number_window.active = false
@number_window.visible = false
# Branch by command window cursor position
case @command_window.index
when 0 # buy
# Change windows to buy mode
@buy_window.active = true
@buy_window.visible = true
when 1 # sell
# Change windows to sell mode
@sell_window.active = true
@sell_window.visible = true
@status_window.visible = false
end
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play shop SE
$game_system.se_play($data_system.shop_se)
# Set quantity input window to inactive / invisible
@number_window.active = false
@number_window.visible = false
# Branch by command window cursor position
case @command_window.index
when 0 # buy
# Buy process
a = @item.price
@item.price = Integer(a * ( (100 + $game_system.tax) / 100.0))
$game_party.lose_gold(@number_window.number * @item.price)
case @item
when RPG::Item
$game_party.gain_item(@item.id, @number_window.number)
when RPG::Weapon
$game_party.gain_weapon(@item.id, @number_window.number)
when RPG::Armor
$game_party.gain_armor(@item.id, @number_window.number)
end
@item.price = a
# Refresh each window
@gold_window.refresh
@buy_window.refresh
@status_window.refresh
# Change windows to buy mode
@buy_window.active = true
@buy_window.visible = true
when 1 # sell
# Sell process
$game_party.gain_gold(@number_window.number * (@item.price / 2))
case @item
when RPG::Item
$game_party.lose_item(@item.id, @number_window.number)
when RPG::Weapon
$game_party.lose_weapon(@item.id, @number_window.number)
when RPG::Armor
$game_party.lose_armor(@item.id, @number_window.number)
end
# Refresh each window
@gold_window.refresh
@sell_window.refresh
@status_window.refresh
# Change windows to sell mode
@sell_window.active = true
@sell_window.visible = true
@status_window.visible = false
end
return
end
end
end

#------------------------------------------------------------------------------

class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @item == nil
return
end
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 32, "Tienes")
self.contents.font.color = normal_color
self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
self.contents.font.color = system_color
if $game_system.tax > 0
self.contents.draw_text(4, 0, 200, 86, "Impuesto actual")
self.contents.font.color = normal_color
self.contents.draw_text(172, 0, 64, 86, $game_system.tax.to_s + "%", 2)
end
if 0 > $game_system.tax
self.contents.draw_text(4, 0, 200, 86, "Descuento")
self.contents.font.color = normal_color
self.contents.draw_text(172, 0, 64, 86, $game_system.tax.to_s + "%", 2)
end
if @item.is_a?(RPG::Item)
return
end
# Equipment adding information
for i in 0...$game_party.actors.size
# Get actor
actor = $game_party.actors
# If equippable, then set to normal text color. If not, set to
# invalid text color.
if actor.equippable?(@item)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
# Draw actor's name
self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
# Get current equipment
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.weapon_id]
elsif @item.kind == 0
item1 = $data_armors[actor.armor1_id]
elsif @item.kind == 1
item1 = $data_armors[actor.armor2_id]
elsif @item.kind == 2
item1 = $data_armors[actor.armor3_id]
else
item1 = $data_armors[actor.armor4_id]
end
# If equippable
if actor.equippable?(@item)
# If weapon
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
change = atk2 - atk1
end
# If armor
if @item.is_a?(RPG::Armor)
pdef1 = item1 != nil ? item1.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
pdef2 = @item != nil ? @item.pdef : 0
mdef2 = @item != nil ? @item.mdef : 0
change = pdef2 - pdef1 + mdef2 - mdef1
end
# Draw parameter change values
self.contents.draw_text(124, 64 + 64 * i, 112, 32,
sprintf("%+d", change), 2)
end
# Draw item
if item1 != nil
x = 4
y = 64 + 64 * i + 32
bitmap = RPG::Cache.icon(item1.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item1.name)
end
end
end
end

Instrucciones:
+ Coloca el script sobre Main.

+ Siempre que quieras cambiar el impuesto usa llamar script:
QUOTE
$game_system.tax = *IMPUESTO*

Cambia *Impuesto* por el porcentaje de impuesto que quieres en las tiendas.

+ También puedes poner impuestos negativos (vamos, rebajas). En la screen podeis ver que el impuesto era del 4% (En el script ya está traducido), pero si el impuesto es negativo, en vez de poner Impuesto pondrá Descuento.

Crédito:
Script creado por: Darklord
Corrección de un error por: SephirothSpaw
 
Estado
Cerrado para nuevas respuestas
Arriba Pie