Maker Palace

¡El Reino del RpgMaker y del Ocio!
 
ÍndiceBuscarGrupos de UsuariosScriptsRecursosTutorialesPalaceJuegosPalaceWikiFAQRegistrarseConectarse
Conectarse
Nombre de Usuario:
Contraseña:
Entrar automáticamente en cada visita: 
:: Recuperar mi contraseña
Temas similares
Buscar
 
 

Resultados por:
 
Rechercher Búsqueda avanzada
Últimos temas
» Reparación de Conjuros
por kyonides-arkanthos Jue Oct 12, 2017 12:22 am

» Screenshot del nuevo KUnits XP oon menú
por LinkLuis55 Sáb Sep 23, 2017 10:03 pm

» Dando una vuelta por acá
por LinkLuis55 Dom Ago 20, 2017 2:56 pm

» Heroes del Crimen 2 DEMO
por jasuso Mar Ago 01, 2017 12:04 am

» The Legend of Celestia II: A World of Twilight Shadows Demo
por Jlopez_96 Vie Jul 28, 2017 6:20 pm

» The Legend of Celestia: Four Cristals
por Jlopez_96 Mar Abr 25, 2017 4:59 pm

» [VXAce] Burando Doragon
por gantzer49 Dom Abr 23, 2017 7:43 pm

Recomendados
RPG en RPG Maker
La importancia de un Backup
Que requiere un sistema de Batalla para ser exitoso
9 Minutos de Juegos por fans
Guía de Subforos para Tontos de Maker Palace
Indice de Scripts Locales XP
Falcao Pearl ABS Liquid
¿Quién está en línea?
En total hay 9 usuarios en línea: 0 Registrados, 0 Ocultos y 9 Invitados :: 1 Motor de búsqueda

Ninguno

La mayor cantidad de usuarios en línea fue 179 el Mar Ago 30, 2011 10:06 pm.
MiniChat
Mejores posteadores
Raiden (3346)
 
DaviX (2740)
 
Frikilangelo (2461)
 
SagahonArturo (1806)
 
Falcao (1775)
 
kyonides-arkanthos (1768)
 
Mur-mai-der (1755)
 
Ares (1613)
 
LinkLuis55 (1558)
 
Webmaster24 (1354)
 
Afiliados
Crear foro Mundo Maker Foro de anime y RM2k3/XP/VX Computer mix
Flag Counter
free counters
Visitas


Comparte | 
 

 (ayuda)con escript las armas enseñan habilidades (que las habilidades del script se muestren tambien al cargar una partida guardada)

Ver el tema anterior Ver el tema siguiente Ir abajo 
AutorMensaje
wachuflame2
Caballero Experimentado
Caballero Experimentado


Cantidad de envíos : 229
Miembro desde : 31/01/2010
Localización : en tus pesadillas..
Sexo : Masculino


MensajeTema: (ayuda)con escript las armas enseñan habilidades (que las habilidades del script se muestren tambien al cargar una partida guardada)   Dom Oct 17, 2010 10:48 am

buenas tengo un problema con un script el escript es el de las armas enseñan habilidades tipo ffIX
se trata del skill learnig system. mi problema es el siguiente si agrego en el script distintas habilidades a lo largo del juego y cargo partida las habilidades que no estaban antes de ke yo iniciara una partida.
no se muestran en la partida cargada lo cual es una carga porke tengo ke hacer un juego nuevo cada vez que un arma enseñe una habilidad keria saber si eso es posible cambiarlo.....


gracias
Volver arriba Ir abajo
Ver perfil de usuario
SagahonArturo
Moderador
Moderador
avatar

Cantidad de envíos : 1806
Miembro desde : 19/12/2010
Edad : 23
Sexo : Masculino

Maker : RMXP

Logros MP :




MensajeTema: solucion   Dom Dic 19, 2010 10:18 pm

Hay una forma de hacerlo pero es un poco compleja...
se necesitan varios scripts y hay que especificar cada cosa:
primero seria necesario que tubieras todas las habilidades en una lista antes de empezar.
segundo pegar unos scripts arriba de main: con el nombre de

Bitmap, Draw Face 1.1 y pegar ahi esto:

#==============================================================================
# ■ BITMAP
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# ● Draw Text Bordered
#--------------------------------------------------------------------------
def draw_text_bordered(x, y, width, height, text, align = 1)
color2=font.color.clone
font.color.set(0, 0, 0)
draw_text(x+1, y+1, width, height, text, align)
font.color = color2
draw_text(x, y, width, height, text, align)
end
#--------------------------------------------------------------------------
# ● Draw Text Shadowed
#--------------------------------------------------------------------------
def draw_text_shadowed(x, y, width, height, text, align = 1)
color2=font.color.clone
font.color.set(0, 0, 0)
draw_text(x+1, y+1, width, height, text, align)
font.color = color2
draw_text(x, y, width, height, text, align)
end
#--------------------------------------------------------------------------
# ● Draw Text Shadowed 2 (double shadow)
#--------------------------------------------------------------------------
def draw_text_shadowed_2(x, y, width, height, text, align = 1)
color2=font.color.clone
font.color.set(0, 0, 0)
draw_text(x+2, y+1, width, height, text, align)
draw_text(x+1, y+2, width, height, text, align)
draw_text(x+1, y+1, width, height, text, align)
font.color = color2
draw_text(x, y, width, height, text, align)
end
end

#==============================================================================
# ■ RPG Cache
#==============================================================================
module RPG
module Cache
#--------------------------------------------------------------------------
# ● Face
#--------------------------------------------------------------------------
def self.face(filename, hue)
begin
self.load_bitmap("Graphics/Faces/", filename, hue)
rescue
self.load_bitmap("Graphics/Faces/", "", hue)
end
end
end
end
#==============================================================================
# ■ RPG Cache
#==============================================================================
module RPG
module Cache
#--------------------------------------------------------------------------
# ● Turn
#--------------------------------------------------------------------------
def self.turn(filename)
begin
self.load_bitmap("Graphics/Pictures/turns/", filename)
rescue
self.load_bitmap("Graphics/Pictures/turns/", "")
end
end
end
end

#==============================================================================
# ■ WINDOW BASE
#==============================================================================
class Window_Base
#--------------------------------------------------------------------------
# ● Draw Actor Face
#--------------------------------------------------------------------------
def draw_actor_face(actor, x, y, size=0)
bitmap = RPG::Cache.face(actor.name, actor.character_hue)
return if bitmap==nil
cw = bitmap.width
ch = bitmap.height
if size>0
dst_cw=size
dst_ch=size
else
dst_cw = bitmap.width
dst_ch = bitmap.height
end
dst_rect = Rect.new(x, y, dst_cw, dst_ch)
src_rect = Rect.new(0, 0, cw, ch)
self.contents.stretch_blt(dst_rect, bitmap, src_rect)
#self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#--------------------------------------------------------------------------
# ● Draw Actor Face Small
#--------------------------------------------------------------------------
def draw_actor_face_small(actor, x, y, size=0)
bitmap = RPG::Cache.face(actor.name+"-small", actor.character_hue)
# Fallback
if bitmap == RPG::Cache.face("", actor.character_hue)
bitmap = RPG::Cache.face(actor.name, actor.character_hue)
end
return if bitmap==nil
cw = bitmap.width
ch = bitmap.height
if size>0
dst_cw=size
dst_ch=size
else
dst_cw = bitmap.width
dst_ch = bitmap.height
end
dst_rect = Rect.new(x, y, dst_cw, dst_ch)
src_rect = Rect.new(0, 0, cw, ch)
self.contents.stretch_blt(dst_rect, bitmap, src_rect)
#self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end

en otro espacio en main poner debajo de esa la siguiente con este nombre:

Window_Base Add On 2.4 y pegar ahi esto:

class Window_Base

attr_accessor :parameter_name_size
attr_accessor :parameter_value_size
attr_accessor :bar_size
attr_accessor :hp_sp_size
attr_accessor :hp_sp_n1_size
attr_accessor :hp_sp_n2_size
attr_accessor :exp_string_size
attr_accessor :exp_value_size
attr_accessor :level_string_size
attr_accessor :level_value_size
# support for multiple states
alias addon_initialize initialize
def initialize(x, y, width, height)
addon_initialize(x, y, width, height)
@counter=0
@num_state=0
@parameter_name_size=100
@parameter_value_size=64
@bar_size=0
@hp_sp_size=20
@hp_sp_n1_size=32
@hp_sp_n2_size=32
@exp_string_size=24
@exp_value_size=84
@level_string_size=24
@level_value_size=32
end


#--------------------------------------------------------------------------
# * draw actor name methods
#--------------------------------------------------------------------------
def draw_actor_name_bordered(actor, x, y, row_height=32)
self.contents.font.color = normal_color
self.contents.draw_text_bordered(x, y, 120, row_height, actor.name, 0)
end
#--------------------------------------------------------------------------
def draw_actor_name_shadowed(actor, x, y, row_height=32)
self.contents.font.color = normal_color
self.contents.draw_text_shadowed(x, y, 120, row_height, actor.name, 0)
end
#--------------------------------------------------------------------------
def draw_actor_name_shadowed_2(actor, x, y, row_height=32)
self.contents.font.color = normal_color
self.contents.draw_text_shadowed_2(x, y, 120, row_height, actor.name, 0)
end
#--------------------------------------------------------------------------
def draw_actor_name_shadowed_3(actor, x, y, row_height=32)
self.contents.draw_text_shadowed_2(x, y, 120, row_height, actor.name, 0)
end
#--------------------------------------------------------------------------
def draw_actor_name_effect(actor, x, y, effect, row_height=32)
# effects: 0 bordered
# 1 single shadow
# 2 double shadow
self.contents.font.color = normal_color
case effect
when 0
self.contents.draw_text_bordered(x, y, 120, 32, actor.name, 0)
when 1
self.contents.draw_text_shadowed(x, y, 120, row_height, actor.name, 0)
when 2
self.contents.draw_text_shadowed_2(x, y, 120, row_height, actor.name, 0)
end
end
#--------------------------------------------------------------------------
# * draw actor state methods
#--------------------------------------------------------------------------
def draw_actor_state_shadowed(actor, x, y, width = 120, row_height=32)
text = make_battler_state_text_changing(actor, width, true)
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text_shadowed(x, y, width, row_height, text, 0)
end
#--------------------------------------------------------------------------
def draw_actor_state_shadowed_2(actor, x, y, width = 120, row_height=32)
text = make_battler_state_text_changing(actor, width, true)
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text_shadowed_2(x, y, width, row_height, text, 0)
end
#--------------------------------------------------------------------------
# * draw_actor_battle_graphic_opacity
#--------------------------------------------------------------------------
def draw_actor_battle_graphic_opacity(actor, x, y, opacity=255)
bitmap = RPG::Cache.battler(actor.character_name, actor.character_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, bitmap, src_rect, opacity)
end
#--------------------------------------------------------------------------
# * Make State Text String for Drawing
# actor : actor
# width : draw spot width
# need_normal : Whether or not [normal] is needed (true / false)
#--------------------------------------------------------------------------
def make_battler_state_text_changing(battler, width, need_normal)
# Get width of brackets
brackets_width = self.contents.text_size("[]").width
# Make text string for state names
text = ""
if battler.states.size() > 1
state_to_show=battler.state_shown%battler.states.size()
else
state_to_show=0
end
for i in battler.states
if state_to_show<1
if $data_states[i].rating >= 1
text = $data_states[i].name
break
end
else
state_to_show=state_to_show-1
end
end
# If text string for state names is empty, make it [normal]
if text == ""
if need_normal
text = "[Nor]"#"[Normal]"
end
else
# Attach brackets
text = "[" + text[0,3] + "]"#"[" + text + "]"
end
battler.state_shown=battler.state_shown+1
# Return completed text string
return text
end
#--------------------------------------------------------------------------
# * draw_actor_hp_color
#--------------------------------------------------------------------------
def draw_actor_hp_color(actor, x, y, color_id, width = 144)
self.contents.font.color = text_color(color_id)
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s, 2)
end
end
#--------------------------------------------------------------------------
# * draw_actor_sp_color
#--------------------------------------------------------------------------
def draw_actor_sp_color(actor, x, y, color_id, width = 144)
self.contents.font.color = text_color(color_id)
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s,2)
end
end
#--------------------------------------------------------------------------
# * draw_actor_hp_2
#--------------------------------------------------------------------------
def draw_actor_hp_2(actor, x, y)
#self.contents.font.name = "Batang"#"Hansa"
self.contents.font.color = original_system_color
self.contents.font.size-=3
self.contents.draw_text_shadowed_2(x, y+3, 32, @row_height, $data_system.words.hp, 0)
hp_x = x + 32
#self.contents.font.name = "Batang"#"Hansa"
self.contents.font.size+=3
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text_shadowed_2(hp_x, y, 32, @row_height, actor.hp.to_s, 2)
self.contents.draw_text_shadowed_2(hp_x + 32, y, 12, @row_height, "/", 1)
self.contents.draw_text_shadowed_2(hp_x + 48, y, 32, @row_height, actor.maxhp.to_s, 0)
end
#--------------------------------------------------------------------------
# * draw_actor_hp_3
#--------------------------------------------------------------------------
def draw_actor_hp_3(actor, x, y)
self.contents.font.color = original_system_color
self.contents.font.size-=3
self.contents.draw_text_shadowed_2(x, y+3, @hp_sp_size, @row_height, $data_system.words.hp, 0)
hp_x = x + @hp_sp_size
#self.contents.font.name = "Batang"#"Hansa"
self.contents.font.size+=3
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text_shadowed_2(hp_x, y, @hp_sp_n1_size, @row_height, actor.hp.to_s, 2)
self.contents.draw_text_shadowed_2(hp_x + @hp_sp_n1_size, y, 12, @row_height, "/", 1)
self.contents.draw_text_shadowed_2(hp_x + @hp_sp_n1_size + 12, y, @hp_sp_n2_size, @row_height, actor.maxhp.to_s, 0)
end
#--------------------------------------------------------------------------
# * draw_actor_hp_4
#--------------------------------------------------------------------------
def draw_actor_hp_4(actor, x, y)
fontsize=self.contents.font.size
self.contents.font.color = original_system_color
self.contents.draw_text_shadowed_2(x, y, @hp_sp_size, fontsize, $data_system.words.hp, 0)
hp_x = x + @hp_sp_size
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text_shadowed_2(hp_x, y, @hp_sp_n1_size, fontsize, actor.hp.to_s, 2)
self.contents.draw_text_shadowed_2(hp_x + @hp_sp_n1_size, y, 12, fontsize, "/", 1)
self.contents.draw_text_shadowed_2(hp_x + @hp_sp_n1_size + 12, y, @hp_sp_n2_size, fontsize, actor.maxhp.to_s, 0)
end
#--------------------------------------------------------------------------
# * draw_actor_sp_2
#--------------------------------------------------------------------------
def draw_actor_sp_2(actor, x, y)
#self.contents.font.name = "Batang"#"Hansa"
self.contents.font.color = crisis_color
self.contents.font.size-=3
self.contents.draw_text_shadowed_2(x, y+3, 32, @row_height, $data_system.words.sp, 0)
self.contents.font.size+=3
sp_x = x + 32
#self.contents.font.name = "Batang"#"Hansa"
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text_shadowed_2(sp_x, y, 32, @row_height, actor.sp.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text_shadowed_2(sp_x + 32, y, 12, @row_height, "/", 1)
self.contents.draw_text_shadowed_2(sp_x + 48, y, 32, @row_height, actor.maxsp.to_s, 0)
end
#--------------------------------------------------------------------------
# * draw_actor_sp_3
#--------------------------------------------------------------------------
def draw_actor_sp_3(actor, x, y)
self.contents.font.color = crisis_color
self.contents.font.size-=3
self.contents.draw_text_shadowed_2(x, y+3, @hp_sp_size, @row_height, $data_system.words.sp, 0)
hp_x = x + @hp_sp_size
#self.contents.font.name = "Batang"#"Hansa"
self.contents.font.size+=3
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text_shadowed_2(hp_x, y, @hp_sp_n1_size, @row_height, actor.sp.to_s, 2)
self.contents.draw_text_shadowed_2(hp_x + @hp_sp_n1_size, y, 12, @row_height, "/", 1)
self.contents.draw_text_shadowed_2(hp_x + @hp_sp_n1_size + 12, y, @hp_sp_n2_size, @row_height, actor.maxsp.to_s, 0)
end
#--------------------------------------------------------------------------
# * draw_actor_sp_4
#--------------------------------------------------------------------------
def draw_actor_sp_4(actor, x, y)
fontsize=self.contents.font.size
self.contents.font.color = crisis_color
self.contents.draw_text_shadowed_2(x, y, @hp_sp_size, fontsize, $data_system.words.sp, 0)
hp_x = x + @hp_sp_size
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text_shadowed_2(hp_x, y, @hp_sp_n1_size, fontsize, actor.sp.to_s, 2)
self.contents.draw_text_shadowed_2(hp_x + @hp_sp_n1_size, y, 12, fontsize, "/", 1)
self.contents.draw_text_shadowed_2(hp_x + @hp_sp_n1_size + 12, y, @hp_sp_n2_size, fontsize, actor.maxsp.to_s, 0)
end
#--------------------------------------------------------------------------
# * draw_actor_parameter_color
#--------------------------------------------------------------------------
def draw_actor_parameter_color(actor, x, y, type, color_id, shadow=0)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
when 7
parameter_name = "Evasion"
parameter_value = actor.eva
end
if shadow > 0
self.contents.font.color = text_color(color_id)
self.contents.draw_text_shadowed(x, y, @parameter_name_size, self.contents.font.size, parameter_name,1)
[email=x+=@bar_size]x+=@bar_size[/email]
self.contents.font.color = normal_color
self.contents.draw_text_shadowed(x + @parameter_name_size, y, @parameter_value_size, self.contents.font.size, parameter_value.to_s, 2)
else
self.contents.font.color = text_color(color_id)
self.contents.draw_text(x, y, @parameter_name_size, self.contents.font.size, parameter_name)
[email=x+=@bar_size]x+=@bar_size[/email]
self.contents.font.color = normal_color
self.contents.draw_text(x + @parameter_name_size, y, @parameter_value_size, self.contents.font.size, parameter_value.to_s, 2)
end
end
#--------------------------------------------------------------------------
# * draw_actor_parameter_2
#--------------------------------------------------------------------------
def draw_actor_parameter_2(actor, x, y, type, first, second)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
when 7
parameter_name = "Evasion"
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, first, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + first, y, second, 32, parameter_value.to_s, 2)
end

#--------------------------------------------------------------------------
# * draw_actor_level2
#--------------------------------------------------------------------------
def draw_actor_level2(actor, x, y,width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, "Lv")
self.contents.font.color = normal_color
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.draw_text(hp_x, y, 48, 32, actor.level.to_s, 2)
end

#--------------------------------------------------------------------------
# * COLORS
#--------------------------------------------------------------------------
def text_color(n)
case n
when 0
return Color.new(255, 255, 255, 255) #normal_color
when 1
return Color.new(128, 128, 255, 255)
when 2
return Color.new(255, 128, 128, 255)
when 3
return Color.new(128, 255, 128, 255)
when 4
return Color.new(128, 255, 255, 255)
when 5
return Color.new(255, 128, 255, 255)
when 6
return Color.new(255, 255, 128, 255)
when 7
return Color.new(192, 192, 192, 255)#grigio
when 8
return Color.new(220,220,220,255)#grigio chiaro
when 9
return Color.new(235,235,235,255)#grigio molto chiaro
when 12
return Color.new(192, 224, 255, 255) #original system color
when 11
return Color.new(212, 244, 255, 255) #system color più chiaro
when 10
return Color.new(150, 20, 20, 255) #rosso sangue
when 13
return Color.new(20, 100, 20, 255) #verde scuro
when 14
return Color.new(255,240,25,255) #giallo oro
when "white"
return Color.new(255,255,255,255)
when "black"
return Color.new(0,0,0,255)
else
normal_color
end
end
#--------------------------------------------------------------------------
def white
return Color.new(255, 255, 255, 255)
end
#--------------------------------------------------------------------------
def grigio
return Color.new(192, 192, 192, 255)#grigio
end
#--------------------------------------------------------------------------
def grigio_chiaro
return Color.new(220,220,220,255)#grigio chiaro
end
#--------------------------------------------------------------------------
def original_system_color
return Color.new(192, 224, 255, 255) #system color
end
#--------------------------------------------------------------------------
def original_system_color_chiaro
return Color.new(212, 244, 255, 255) #system color più chiaro
end
#--------------------------------------------------------------------------
# * draw_item_name_size
#--------------------------------------------------------------------------
def draw_item_name_size(item, x, y, size=24)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
cw = bitmap.width
ch = bitmap.height
dst_cw=size
dst_ch=size
dst_rect = Rect.new(x, y, dst_cw, dst_ch)
src_rect = Rect.new(0, 0, cw, ch)
self.contents.stretch_blt(dst_rect, bitmap, src_rect)
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, size, item.name)
end
#--------------------------------------------------------------------------
# * draw_actor_next_exp
#--------------------------------------------------------------------------
def draw_actor_next_exp(actor, x, y)
fontsize=self.contents.font.size
self.contents.font.color = system_color
self.contents.draw_text(x, y, @exp_string_size, fontsize, "Sig")
self.contents.font.color = normal_color
self.contents.draw_text(x + @exp_string_size, y, @exp_value_size, fontsize, actor.next_exp_s, 2)
end
#--------------------------------------------------------------------------
# * draw_actor_exp_only
#--------------------------------------------------------------------------
def draw_actor_exp_only(actor, x, y)
fontsize=self.contents.font.size
self.contents.font.color = system_color
self.contents.draw_text(x, y, @exp_string_size, fontsize, "Exp")
self.contents.font.color = normal_color
self.contents.draw_text(x + @exp_string_size, y, @exp_value_size, fontsize, actor.exp_s, 2)
end
#--------------------------------------------------------------------------
# * draw_actor_class_2
#--------------------------------------------------------------------------
def draw_actor_class_2(actor, x, y, width)
fontsize=self.contents.font.size
self.contents.draw_text(x, y, width, fontsize, actor.class_name)
end
#--------------------------------------------------------------------------
# * draw_actor_level_2
#--------------------------------------------------------------------------
def draw_actor_level_2(actor, x, y)
fontsize=self.contents.font.size
self.contents.font.color = crisis_color
self.contents.draw_text_shadowed_2(x, y, @level_string_size, fontsize, "Nivel", 0)
self.contents.font.color = normal_color
self.contents.draw_text_shadowed_2(x + @level_string_size, y, @level_value_size, fontsize, actor.level.to_s, 2)
end

end
Volver arriba Ir abajo
Ver perfil de usuario http://gamejolt.com/freeware/games/rpg/mundo-abismal/9212/
SagahonArturo
Moderador
Moderador
avatar

Cantidad de envíos : 1806
Miembro desde : 19/12/2010
Edad : 23
Sexo : Masculino

Maker : RMXP

Logros MP :




MensajeTema: Re: (ayuda)con escript las armas enseñan habilidades (que las habilidades del script se muestren tambien al cargar una partida guardada)   Dom Dic 19, 2010 10:19 pm

despues de esa otro debajo con el nombre de: Bar 1.4 y pegar:

#==============================================================================
# ** Bar ver. 1.4
# ** Author: Charlie Lee
#==============================================================================
#==============================================================================
# ■ BAR
#==============================================================================
class Bar
attr_accessor :highlight_complete
attr_accessor :back_opacity
attr_accessor :opacity
attr_accessor :bar
attr_accessor :bar_background
attr_accessor :bar_complete
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(x,y,width,height,bitmap)
@highlight_complete=false
@back_opacity=255
@opacity=255
@x=x
@y=y
@width=width
@height=height
@bitmap=bitmap
@bar_background="bar background"
@bar="bar"
@bar_complete="bar complete"
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh(value,max)
@bar_bg=RPG::Cache.picture(@bar_background)
@bar_fg=RPG::Cache.picture(@bar)
@src_bg = Rect.new(0, 0, @bar_bg.width, @bar_bg.height)
@src_fg = Rect.new(0, 0, @bar_fg.width, @bar_fg.height)
value=[value,max].min
if value==max and @highlight_complete
@bar_fg=RPG::Cache.picture(@bar_complete)
end
[email=x_ratio=@width/200.0]x_ratio=@width/200.0[/email]
[email=y_ratio=@height/32.0]y_ratio=@height/32.0[/email]
dest = Rect.new(@x, @y, @width, @height)
@bitmap.stretch_blt(dest, @bar_bg, @src_bg, @back_opacity)
dest = Rect.new((@x+4*x_ratio).ceil, @y+4*y_ratio, ((@width-8*x_ratio)*value/max).ceil, (@height-8*y_ratio))
@bitmap.stretch_blt(dest, @bar_fg, @src_fg, @opacity)
end
end

hacer otro con el nombre de: Configuration y pegar: ATENCION!! dentro de este te explico que es cada cosa...

CLASS_BASED_LEARNING = false # If true, actors will only be able to learn
# skills available for their classes
NO_LEVEL_UP_LEARNING = true # Disable the standard rmxp learning system
LEARN_LEVEL_ONE_SKILLS = true # Decide if actors automatically learn the
# skills specified for level 1
# Intergration with Charlie Lee's CTB
REMOVED_ACTORS_LEARNING_EXP_QUOTA=0.5
TRANSFORMED_ACTORS_LEARNING_EXP_QUOTA=0.5
SWITCHED_ACTORS_LEARNING_EXP_QUOTA=0.5

#==============================================================================
EQUIPMENT_LEARNINGS=
{
# "weapon/armor_name" => [ skill_id_1, skill_id_2]
"Espada de Orión" => [108], ***aqui pones el nombre del arma y entre corchetes la habilidad que aprende...

"Espada Voltaje" => [68, 69], *** si quieres que aprenda mas de una por arma se pone con comas...

}

#==============================================================================
SKILLS_EXP_LEVELS=
{
1 => 150, ***aqui es cuanta experiencia necesitas ganar para aprenderla aqui quiere decir que en el SKILL numero 1 necesitas 150 de exp para aprenderla (recuerda debes tener esa arma equipada para ir sumando los puntos de exp.
2 => 750,
3 => 1750,
4 => 5350,
5 => 10950,
}
#==============================================================================
EQUIPMENT_SKILLS=
{
}
#==============================================================================
SKILLS_REQUIREMENTS=
{
}


bien el que sigue.... ponerle nombre de SLS Windows y pegar adentro:

#==============================================================================
# ** Skills Learning System (SLS) by Charlie Lee
#
# Version: 2.1
# Author: Charlie Lee
#==============================================================================
#==============================================================================
#========= SKILL LEARNING RESULTS
#==============================================================================
class Window_BattleResultSkillLearning < Window_Selectable
attr_accessor :learnings
#--------------------------------------------------------------------------
# learnings
#--------------------------------------------------------------------------
def initialize()
@learnings = []
super(160, 0, 320, learnings.size * 32 + 32)
# self.y = 160 - height / 2
self.active=false
self.opacity=160
self.back_opacity=255
self.contents_opacity=255
self.z = 203
self.visible = false
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def refresh
# print(@learnings.size.to_s)
self.height=[learnings.size * 32 + 32, 192].min
@item_max=@learnings.size
self.y = 160 - height / 2
self.contents = Bitmap.new(width - 32, @item_max * 32)
self.contents.clear
x = 4
y = 4
for learning in @learnings
self.contents.draw_text(x,y,260,32,learning)
# print(learning)
y += 32
end
end
end

################################################################################
# STATUS WINDOWS #
################################################################################


#==============================================================================
# ■ Window_Status_Info
#------------------------------------------------------------------------------
class Window_Status_Info < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor : アクター
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.bold=true
self.contents.font.size = 14
self.back_opacity = 255
self.opacity = 255
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------

def refresh
self.contents.clear
x = 16
y = 0
actor = @actor
self.contents.font.size = 24
self.contents.font.bold = true
draw_actor_name_bordered(actor, x, y, self.contents.font.size)
x = 0
y += self.contents.font.size + 2
self.contents.font.bold = false
draw_actor_face(actor, x, y, 112)
x = 120
self.contents.font.size=20
draw_actor_class_2(actor, x, y, 200)
y += 22
@level_string_size = 32
@level_value_size = 84
@exp_string_size = 32
self.contents.font.bold = true
draw_actor_level_2(actor, x, y)
y += 22
self.contents.font.size=16
draw_actor_exp_only(actor, x, y)
y += 18
draw_actor_next_exp(actor, x, y)

x=320
y=0
self.contents.font.color = system_color
self.contents.font.size=16
self.contents.draw_text(x+4, y, 64, 32, $data_system.words.weapon)
self.contents.draw_text(x+4, y+24, 64, 32, $data_system.words.armor1)
self.contents.draw_text(x+4, y+48, 64, 32, $data_system.words.armor2)
self.contents.draw_text(x+4, y+72, 64, 32, $data_system.words.armor3)
self.contents.draw_text(x+5, y+96, 64, 32, $data_system.words.armor4)
self.contents.font.color = normal_color
self.contents.font.bold=false
self.contents.font.size=20
x += 80
y += 4

draw_item_name_size($data_weapons[@actor.weapon_id], x, y, 24)
y+=24
draw_item_name_size($data_armors[@actor.armor1_id], x, y, 24)
y+=24
draw_item_name_size($data_armors[@actor.armor2_id], x , y, 24)
y+=24
draw_item_name_size($data_armors[@actor.armor3_id], x, y, 24)
y+=24
draw_item_name_size($data_armors[@actor.armor4_id], x , y, 24)
end

end

#==============================================================================
# ■ Window_Equipment_Skill
#------------------------------------------------------------------------------
class Window_Equipment_Skill < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# equip_type: equip_type
# equip_id : equip_id
#--------------------------------------------------------------------------
attr_accessor :equip_type
attr_accessor :equip_id
attr_accessor :target_x
attr_accessor :target_y
attr_accessor :actor
def initialize()
super(0, 256+16, 320-32, 224-32)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 20
self.contents.font.bold = true
self.back_opacity = 230
self.opacity = 255
self.contents_opacity=255
self.z=103
self.visible=false
@equip_type=-1
@equip_id=-1
@target_x=self.x
@target_y=self.y
if $scene.is_a?(Scene_Shop)
@actor_index=0
@actor=$game_party.actors[@actor_index]
else
@actor=nil
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
x = 0
y = 0
if $scene.is_a?(Scene_Shop)
draw_actor_name(@actor, x, y)
y+=24
end
self.contents.font.color=system_color
self.contents.draw_text(x,y,320,self.contents.font.size,"Habilidades a Aprender")
y+=self.contents.font.size+2
self.contents.font.color=normal_color
if @equip_type==0 and @equip_id!=0 and $game_party.
learning_db[$data_weapons[@equip_id].name]!=nil
for learning in $game_party.
learning_db[$data_weapons[@equip_id].name].learnings
skill=$data_skills[learning.skill_id]
rect = Rect.new(x, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24), opacity)
if @actor!=nil
self.contents.font.color=(@actor.can_learn?(learning.skill_id)) ? normal_color : disabled_color
end
self.contents.draw_text(x + 28, y, 172, self.contents.font.size, ""+skill.name, 0)
s=""
if @actor!=nil and (@actor.skill_learn?(skill.id) or learning.level==0)
s=s+"A"
end
if @actor!=nil and @actor.experience_points_skills[skill.id] >= learning.level
s=s+"" unless learning.level==0
end
#self.contents.draw_text(x + 200, y, 48, self.contents.font.size, skill.sp_cost.to_s, 2)
self.contents.draw_text(x + 200, y, 48, self.contents.font.size, s, 2)
y+=24
end
end
if @equip_type==0 and @equip_id!=0 and $game_party.
equip_skills_db[$data_weapons[@equip_id].name]!=nil
for learning in $game_party.
equip_skills_db[$data_weapons[@equip_id].name].learnings
skill=$data_skills[learning.skill_id]
rect = Rect.new(x, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24), opacity)
if @actor!=nil
self.contents.font.color=(@actor.can_learn?(learning.skill_id)) ? normal_color : disabled_color
end
self.contents.draw_text(x + 28, y, 172, self.contents.font.size, ""+skill.name, 0)
s=""
if @actor!=nil and (@actor.skill_learn?(skill.id))
s=s+"A"
end
if @actor!=nil and @actor.experience_points_skills[skill.id] >= learning.level
s=s+"" unless learning.level==0
end
#self.contents.draw_text(x + 200, y, 48, self.contents.font.size, skill.sp_cost.to_s, 2)
self.contents.draw_text(x + 200, y, 48, self.contents.font.size, s, 2)
y+=24
end
end
if @equip_type>0 and @equip_id!=0 and $game_party.
learning_db[$data_armors[@equip_id].name]!=nil
for learning in $game_party.
learning_db[$data_armors[@equip_id].name].learnings
skill=$data_skills[learning.skill_id]
rect = Rect.new(x, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24), opacity)
if @actor!=nil
self.contents.font.color=(@actor.can_learn?(learning.skill_id)) ? normal_color : disabled_color
end
self.contents.draw_text(x + 28, y, 172, self.contents.font.size, ""+skill.name, 0)
s=""
if @actor!=nil and (@actor.skill_learn?(skill.id) or learning.level==0)
s=s+""
end
if @actor!=nil and @actor.experience_points_skills[skill.id] >= learning.level
s=s+"A" unless learning.level==0
end
#self.contents.draw_text(x + 200, y, 48, self.contents.font.size, skill.sp_cost.to_s, 2)
self.contents.draw_text(x + 200, y, 48, self.contents.font.size, s, 2)
y+=24
end
end
if @equip_type>0 and @equip_id!=0 and $game_party.
equip_skills_db[$data_armors[@equip_id].name]!=nil
for learning in $game_party.
equip_skills_db[$data_armors[@equip_id].name].learnings
skill=$data_skills[learning.skill_id]
rect = Rect.new(x, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24), opacity)
if @actor!=nil
self.contents.font.color=(@actor.can_learn?(learning.skill_id)) ? normal_color : disabled_color
end
self.contents.draw_text(x + 28, y, 172, self.contents.font.size, ""+skill.name, 0)
s=""
if @actor!=nil and (@actor.skill_learn?(skill.id))
s=s+"A"
end
if @actor!=nil and @actor.experience_points_skills[skill.id] >= learning.level
s=s+"" unless learning.level==0
end
#self.contents.draw_text(x + 200, y, 48, self.contents.font.size, skill.sp_cost.to_s, 2)
self.contents.draw_text(x + 200, y, 48, self.contents.font.size, s, 2)
y+=24
end
end
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update(type,id)
if [email=type!=@equip_type]type!=@equip_type[/email] or [email=id!=@equip_id]id!=@equip_id[/email]
@equip_type=type
@equip_id=id
refresh
end
self.x+=0.3*(@target_x-self.x)
self.y+=0.3*(@target_y-self.y)
end
#--------------------------------------------------------------------------
# * Next actor
#--------------------------------------------------------------------------
def next_actor()
@actor_index=(@actor_index+1)%$game_party.actors.size
@actor=$game_party.actors[@actor_index]
refresh
end

def set_x(value)
self.x=value
@target_x=value
end

def set_y(value)
self.y=value
@target_y=value
end

end

#==============================================================================
# ■ Window_Equipment_Needed
#------------------------------------------------------------------------------
class Window_Equipment_Needed < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# equip_type: equip_type
# equip_id : equip_id
#--------------------------------------------------------------------------
attr_accessor :equip_type
attr_accessor :equip_id
attr_accessor :target_x
attr_accessor :target_y
def initialize()
super(0, 0, 320-16, 52)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 20
self.contents.font.bold = true
self.back_opacity = 230
self.opacity = 255
self.contents_opacity=255
self.z=103
self.visible=false
@equip_type=-1
@equip_id=-1
@target_x=self.x
@target_y=self.y
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------

def set_x(value)
self.x=value
@target_x=value
end

def set_y(value)
self.y=value
@target_y=value
end
end

el siguiente: poner de nombre; Skills Learning System pegar en el...

$charlie_lee_sls = true
class Game_Party
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :learning_db
attr_accessor :equip_skills_db
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias sls_initialize initialize
def initialize
# original call
sls_initialize
@learning_db = {}
@equip_skills_db = {}
end
def print_db
outfile = File.new("db.txt", "w")
outfile.write "LEARNING DATABASE\n\n"
for key in 0 ... @learning_db.keys.length
outfile.write "Weapon/Armor: "[email=+@learning_db.keys[key]+"\n]+@learning_db.keys[key]+"\n[/email]"
[email=entry=@learning_db[@learning_db.keys[key]entry=@learning_db[@learning_db.keys[key[/email]]]
for learning in entry.learnings
outfile.write "Skill: "+learning.skill_name+" Id: "+learning.skill_id.to_s+"\n"
end
outfile.write "\n"
end
outfile.write "SKILLS DATABASE\n\n"
for key in 0 ... @equip_skills_db.keys.length
outfile.write "Weapon/Armor: "[email=+@equip_skills_db.keys[key]+"\n]+@equip_skills_db.keys[key]+"\n[/email]"
[email=entry=@equip_skills_db[@equip_skills_db.keys[key]entry=@equip_skills_db[@equip_skills_db.keys[key[/email]]]
for learning in entry.learnings
outfile.write "Skill: "+learning.skill_name+" Id: "+learning.skill_id.to_s+"\n"
end
outfile.write "\n"
end
outfile.close
end
end
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs title screen processing.
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
alias sls_command_new_game command_new_game
def command_new_game
# original call
sls_command_new_game
# build learnings database
for equip_name in EQUIPMENT_LEARNINGS.keys
count=0
learnings=[]
for skill_id in EQUIPMENT_LEARNINGS[equip_name]
learnings[count]=Learning.new
learnings[count].skill_name=$data_skills[skill_id].name
learnings[count].level=SKILLS_EXP_LEVELS[skill_id]
learnings[count].skill_id=skill_id
$game_party.learning_db[equip_name]=
SLS_DB_Entry.new(equip_name,learnings)
count+=1
end
end
for equip_name in EQUIPMENT_SKILLS.keys
count=0
learnings=[]
for skill_id in EQUIPMENT_SKILLS[equip_name]
learnings[count]=Learning.new
learnings[count].skill_name=$data_skills[skill_id].name
learnings[count].skill_id=skill_id
$game_party.equip_skills_db[equip_name]=
SLS_DB_Entry.new(equip_name,learnings)
count+=1
end
end
$game_party.print_db
for actor in $game_party.actors
actor.learn_initial_equipment_skills
end
end
end
class Learning
attr_accessor :skill_name
attr_accessor :level
attr_accessor :skill_id
def initialize
@skill_name=""
@level=0
@skill_id=0
end
end
class SLS_DB_Entry
attr_accessor :learnings
attr_accessor :name
def initialize(name,learnings)
@name=name
@learnings=learnings
end
end
################################################################################
# SCENE_BATTLE #
################################################################################
class Scene_Battle
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias update_skl update
def update
update_skl
# If waiting
if @wait_count > 0
# Decrease wait count
@wait_count -= 1
return
end
case @phase
when 5.1 # after battle phase skill learning
update_phase5_1
end
end
#--------------------------------------------------------------------------
# * Start After Battle Phase
#--------------------------------------------------------------------------
alias start_phase5_skl start_phase5
def start_phase5
# Make windows
@learning_window=Window_BattleResultSkillLearning.new
exp = 0
# Loop
for enemy in $game_troop.enemies
# If enemy is not hidden
unless enemy.hidden
# Add EXP and amount of gold obtained
exp += enemy.exp
end
end
# Obtaining SKILL EXP POINTS
# p "Obtaining SKILL EXP POINTS"
# This is processed BEFORE return party in CHARLIE LEE'S CTB
@actors_to_check=[]
if $charlie_lee_ctb !=nil # DETECTS CHARLIE LEE'S CTB
# Actors removed for summon
for a in $game_party.removed_actors
@actors_to_check.push(a)
end
# Original form of transformed actors
for a in $game_party.transformed_actors
@actors_to_check.push(a)
end
# Actors in the backup party
for a in $game_party.backup_actors
@actors_to_check.push(a)
end
end
for a in $game_party.actors
@actors_to_check.push(a)
end
exp_base=exp
for actor in @actors_to_check
exp=exp_base
if actor.cant_get_exp? == false
if $charlie_lee_ctb !=nil # DETECTS CHARLIE LEE'S CTB
# Actors removed for summon
if $game_party.removed_actors.include?(actor)
exp=Integer(exp_base * REMOVED_ACTORS_LEARNING_EXP_QUOTA)
end
# Original form of transformed actors
if $game_party.transformed_actors.include?(actor)
if $game_party.removed_actors.include?($game_actors[actor.transformed_form_id])
exp=Integer(exp_base * TRANSFORMED_ACTORS_LEARNING_EXP_QUOTA * REMOVED_ACTORS_LEARNING_EXP_QUOTA)
elsif $game_party.backup_actors.include?($game_actors[actor.transformed_form_id])
exp=Integer(exp_base * TRANSFORMED_ACTORS_LEARNING_EXP_QUOTA * SWITCHED_ACTORS_LEARNING_EXP_QUOTA)
else
exp=Integer(exp_base * TRANSFORMED_ACTORS_LEARNING_EXP_QUOTA)
end
end
# Actors in the backup party
if $game_party.backup_actors.include?(actor)
exp=Integer(exp_base * SWITCHED_ACTORS_LEARNING_EXP_QUOTA)
end
end
if $data_weapons[actor.weapon_id] != nil and
$game_party.learning_db[$data_weapons[actor.weapon_id].name] != nil
for learning in $game_party.
learning_db[$data_weapons[actor.weapon_id].name].learnings
skill_name=learning.skill_name
skill_level=learning.level
skill_id=learning.skill_id
if actor.can_learn?(skill_id)
# add exp point for the skill
actor.experience_points_skills[skill_id]+=exp
if (actor.experience_points_skills[skill_id] >= skill_level) and
(actor.experience_points_skills[skill_id]-exp < skill_level)
#LEARN SKILL
actor.perm_learn_skill(skill_id)
@learning_window.learnings.push(actor.name+" Aprendiste: "+
skill_name)
end
end
end
end
for armor_id in [actor.armor1_id,actor.armor2_id,actor.armor3_id,actor.armor4_id]
if $data_armors[armor_id] != nil and
$game_party.learning_db[$data_armors[armor_id].name] != nil
for learning in $game_party.
learning_db[$data_armors[armor_id].name].learnings
skill_name=learning.skill_name
skill_level=learning.level
skill_id=learning.skill_id
if actor.can_learn?(skill_id)
# add exp point for the skill
actor.experience_points_skills[skill_id]+=exp
if (actor.experience_points_skills[skill_id] >= skill_level) and
(actor.experience_points_skills[skill_id]-exp < skill_level)
#LEARN SKILL
actor.perm_learn_skill(skill_id)
@learning_window.learnings.push(actor.name+" Aprendiste: "+
skill_name)
end
end
end
end
end
end
end
if not @learning_window.learnings.empty?
@learning_window.index=0
end
# Original call
start_phase5_skl
end
#--------------------------------------------------------------------------
# * Frame Update (after battle phase)
#--------------------------------------------------------------------------
alias update_phase5_skl update_phase5
def update_phase5
# If wait count is larger than 0
if @phase5_wait_count > 0
update_phase5_skl
else
# If C button was pressed
if Input.trigger?(Input::C)
if not @learning_window.learnings.empty?
@learning_window.visible=true
@learning_window.refresh
@learning_window.active=true
@result_window.visible = false
@phase=5.1
@wait_count = 16
else
# Dispose learning window
@learning_window.dispose
battle_end(0)
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (after battle phase - SKILL LEARNING WINDOW)
#--------------------------------------------------------------------------
def update_phase5_1
#print("update_phase5_1")
# Update learning window
@learning_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# Dispose learning window
@learning_window.dispose
battle_end(0)
return
end
end
end

################################################################################
# GAME_ACTOR #
################################################################################
#===============================================================================
# EXP POINTS FOR WEAPONS AND SKILLS
#===============================================================================
class Game_Actor < Game_Battler
attr_accessor :experience_points_skills
attr_accessor :perm_skills
#
alias setup_skl setup
def setup(actor_id)
setup_skl(actor_id)
#INITIALIZE EXPERIENCE POINTS FOR SKILLS
@experience_points_skills={}
@perm_skills=[]
#print ("initializing exp points for skills")
for skill_id in 0 .. $data_skills.length
if $data_skills[skill_id] != nil
@experience_points_skills[skill_id]=0
end
end
end
end

class Game_Actor
#--------------------------------------------------------------------------
# * Setup
# actor_id : actor ID
#--------------------------------------------------------------------------
alias sls_setup setup
def setup(actor_id)
# Call the original script
sls_setup(actor_id)
if NO_LEVEL_UP_LEARNING
# Forget all the skills
for id in 1...$data_skills.size
@skills.delete(id)
end
end
# Learn the skills for the initial equipment
learn_sls_skills(0,@weapon_id)
learn_sls_skills(1,@armor1_id)
learn_sls_skills(2,@armor2_id)
learn_sls_skills(3,@armor3_id)
learn_sls_skills(4,@armor4_id)
# Perm learn the skills for the initial level
for j in $data_classes[@class_id].learnings
if j.level == 1
perm_learn_skill(j.skill_id, true) unless LEARN_LEVEL_ONE_SKILLS==false
end
end
for i in [email=2..@level]2..@level[/email]
for j in $data_classes[@class_id].learnings
if j.level == i
perm_learn_skill(j.skill_id, true) unless NO_LEVEL_UP_LEARNING==true
end
end
end
end
def learn_initial_equipment_skills
# Learn the skills for the initial equipment
learn_sls_skills(0,@weapon_id)
learn_sls_skills(1,@armor1_id)
learn_sls_skills(2,@armor2_id)
learn_sls_skills(3,@armor3_id)
learn_sls_skills(4,@armor4_id)
end

#--------------------------------------------------------------------------
# * Change Equipment
# equip_type : type of equipment
# id : weapon or armor ID (If 0, remove equipment)
#--------------------------------------------------------------------------
alias sls_equip equip
def equip(equip_type, id)
case equip_type
when 0 # Weapon
if id == 0 or $game_party.weapon_number(id) > 0
forget_sls_skills(equip_type,@weapon_id)
learn_sls_skills(equip_type, id)
end
when 1 # Shield
if id == 0 or $game_party.armor_number(id) > 0
forget_sls_skills(equip_type,@armor1_id)
learn_sls_skills(equip_type, id)
end
when 2 # Head
if id == 0 or $game_party.armor_number(id) > 0
forget_sls_skills(equip_type,@armor2_id)
learn_sls_skills(equip_type, id)
end
when 3 # Body
if id == 0 or $game_party.armor_number(id) > 0
forget_sls_skills(equip_type,@armor3_id)
learn_sls_skills(equip_type, id)
end
when 4 # Accessory
if id == 0 or $game_party.armor_number(id) > 0
forget_sls_skills(equip_type,@armor4_id)
learn_sls_skills(equip_type, id)
end
end
# Call the original script
sls_equip(equip_type, id)
end
def forget_sls_skills(equip_type,id)
if id > 0
case equip_type
when 0 # Weapon
if $game_party.
equip_skills_db[$data_weapons[id].name]!=nil
for learning in $game_party.
equip_skills_db[$data_weapons[id].name].learnings
# Get skill name and skill id
skill_name =learning.skill_name
skill_id =learning.skill_id
skill_level =learning.level
if SKILLS_EXP_LEVELS[skill_id]!=nil
# Forget the skill if the actor does not master it
if @experience_points_skills[skill_id] # Forget Skill
forget_skill(skill_id) unless perm_skill_learn?(skill_id)
end
end
end
end
learn_sls_skills(1,@armor1_id)
learn_sls_skills(2,@armor2_id)
learn_sls_skills(3,@armor3_id)
learn_sls_skills(4,@armor4_id)
when 1,2,3,4 # Armors
if $game_party.
equip_skills_db[$data_armors[id].name]!=nil
for learning in $game_party.
equip_skills_db[$data_armors[id].name].learnings
# Get skill name and skill id
skill_name =learning.skill_name
skill_id =learning.skill_id
skill_level =learning.level
if SKILLS_EXP_LEVELS[skill_id]!=nil
# Forget the skill if the actor does not master it
if @experience_points_skills[skill_id] # Forget Skill
forget_skill(skill_id) unless perm_skill_learn?(skill_id)
end
end
end
end
learn_sls_skills(0,@weapon_id)
learn_sls_skills(1,@armor1_id) unless equip_type==1
learn_sls_skills(2,@armor2_id) unless equip_type==2
learn_sls_skills(3,@armor3_id) unless equip_type==3
learn_sls_skills(4,@armor4_id) unless equip_type==4
end
end
end

def learn_sls_skills(equip_type,id)
if id > 0
case equip_type
when 0 # Weapon
data=$data_weapons
when 1,2,3,4 # Armors
data=$data_armors
end
if $game_party.
equip_skills_db[data[id].name]!=nil
for learning in $game_party.
equip_skills_db[data[id].name].learnings
# Get skill name and skill id
skill_name =learning.skill_name
skill_id =learning.skill_id
skill_level =learning.level
if can_learn?(skill_id)
# Learn Skill
learn_skill(skill_id)
end
end
end
if $game_party.
learning_db[data[id].name]!=nil
for learning in $game_party.
learning_db[data[id].name].learnings
# Get skill name and skill id
skill_name =learning.skill_name
skill_id =learning.skill_id
skill_level =learning.level
if can_learn?(skill_id)
# Learn the skill if it requires 0 exp points to be learned
if skill_level==0
perm_learn_skill(skill_id)
end
end
end
end
end
end
def can_learn?(skill_id)
return true unless CLASS_BASED_LEARNING
for learning_no in 0 ... $data_classes[@class_id].learnings.length
if $data_classes[@class_id].
learnings[learning_no].skill_id == skill_id
return true
end
end
return false
end
end
class Game_Actor
#--------------------------------------------------------------------------
# * Change EXP
# exp : new EXP
#--------------------------------------------------------------------------


def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
# Level up
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# Learn skill
unless NO_LEVEL_UP_LEARNING
for j in $data_classes[@class_id].learnings
if j.level == @level
perm_learn_skill(j.skill_id)
end
end
end
end
# Level down
while @exp < @exp_list[@level]
@level -= 1
end
# Correction if exceeding current max HP and max SP
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end

def perm_learn_skill(skill_id, forcing=false)
if skill_id > 0 and not skill_learn?(skill_id)
@skills.push(skill_id)
@perm_skills.push(skill_id)
@skills.sort!
elsif forcing==true and skill_id > 0
@perm_skills.push(skill_id)
end
end

def perm_skill_learn?(skill_id)
return @perm_skills.include?(skill_id)
end

def perm_forget_skill(skill_id)
@skills.delete(skill_id)
@perm_skills.delete(skill_id)
end
def get_sls_exp(exp)
if cant_get_exp? == false
if $data_weapons[@weapon_id] != nil and
$game_party.learning_db[$data_weapons[@weapon_id].name] != nil
for learning in $game_party.
learning_db[$data_weapons[@weapon_id].name].learnings
skill_name=learning.skill_name
skill_level=learning.level
skill_id=learning.skill_id
if can_learn?(skill_id)
# add exp point for the skill
@experience_points_skills[skill_id]+=exp
if (@experience_points_skills[skill_id] >= skill_level) and
(@experience_points_skills[skill_id]-exp < skill_level)
#LEARN SKILL
perm_learn_skill(skill_id)
end
end
end
end
for armor_id in [@armor1_id,@armor2_id,@armor3_id,@armor4_id]
if $data_armors[armor_id] != nil and
$game_party.learning_db[$data_armors[armor_id].name] != nil
for learning in $game_party.
learning_db[$data_armors[armor_id].name].learnings
skill_name=learning.skill_name
skill_level=learning.level
skill_id=learning.skill_id
if can_learn?(skill_id)
# add exp point for the skill
@experience_points_skills[skill_id]+=exp
if (@experience_points_skills[skill_id] >= skill_level) and
(@experience_points_skills[skill_id]-exp < skill_level)
#LEARN SKILL
perm_learn_skill(skill_id)
end
end
end
end
end
end
end
def get_skill_exp(skill_id, exp)
if cant_get_exp? == false
if can_learn?(skill_id)
# add exp point for the skill
@experience_points_skills[skill_id]+=exp
skill_level=SKILLS_EXP_LEVELS[skill_id]
if (@experience_points_skills[skill_id] >= skill_level) and
(@experience_points_skills[skill_id]-exp < skill_level)
#LEARN SKILL
perm_learn_skill(skill_id)
end
end
end
end

alias sls_skill_can_use? skill_can_use?
def skill_can_use?(skill_id)
if SKILLS_REQUIREMENTS[skill_id]!=nil
if SKILLS_REQUIREMENTS[skill_id][0]==1
if @weapon_id!=SKILLS_REQUIREMENTS[skill_id][1]
return false
end
else
unless [@armor1_id,@armor2_id,@armor3_id,@armor4_id].
include?(SKILLS_REQUIREMENTS[skill_id][1])
return false
end
end
end
return sls_skill_can_use?(skill_id)
end
end
class Game_Party
def get_skill_exp(name,skill_id,exp)
@actors.each do |actor| actor.get_skill_exp(skill_id,exp) if (actor.name == name) end
if $charlie_lee_ctb != nil
@backup_actors.each do |actor| actor.get_skill_exp(skill_id,exp) if (actor.name == name) end
end
end
def get_sls_exp(name,exp)
@actors.each do |actor| actor.get_sls_exp(exp) if (actor.name == name) end
if $charlie_lee_ctb != nil
@backup_actors.each do |actor| actor.get_sls_exp(exp) if (actor.name == name) end
end
end
end
class Interpreter
#--------------------------------------------------------------------------
# * Change Skills
#--------------------------------------------------------------------------
def command_318
# Get actor
actor = $game_actors[@parameters[0]]
# Change skill
if actor != nil
if @parameters[1] == 0
actor.perm_learn_skill(@parameters[2])
else
actor.perm_forget_skill(@parameters[2])
end
end
# Continue
return true
end
end
Volver arriba Ir abajo
Ver perfil de usuario http://gamejolt.com/freeware/games/rpg/mundo-abismal/9212/
SagahonArturo
Moderador
Moderador
avatar

Cantidad de envíos : 1806
Miembro desde : 19/12/2010
Edad : 23
Sexo : Masculino

Maker : RMXP

Logros MP :




MensajeTema: Re: (ayuda)con escript las armas enseñan habilidades (que las habilidades del script se muestren tambien al cargar una partida guardada)   Dom Dic 19, 2010 10:20 pm

el que sigue.... poner de nombre: Scene_Learning_Status pegar en el...

class Game_Temp
attr_accessor :show_all_learnings
alias sls_initialize initialize
def initialize
sls_initialize
@show_all_learnings=false
end
end
class Scene_Learning_Status
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
@actor_index = actor_index
if $charlie_lee_ctb != nil
# Warning! This makes copies of the actors, do it for read access only
@actors=$game_party.actors+$game_party.backup_actors
else
@actors=$game_party.actors
end
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Get actor
@actor = @actors[@actor_index]
# Make status windows
@status_window_info = Window_Status_Info.new(@actor)
# Make window equipment skills
@equip_skills_window = Window_Equipment_Skills.new
# Make learnings window
@learnings_window = Window_Learnings.new(@actor)
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@learnings_window.dispose
@status_window_info.dispose
@equip_skills_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@learnings_window.update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(0)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play cancel SE
$game_system.se_play($data_system.decision_se)
$game_temp.show_all_learnings=!$game_temp.show_all_learnings
@learnings_window.refresh
@equip_skills_window.refresh
return
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= @actors.size
# Switch to different status screen
$scene = Scene_Learning_Status.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += @actors.size - 1
@actor_index %= @actors.size
# Switch to different status screen
$scene = Scene_Learning_Status.new(@actor_index)
return
end
end
end
#==============================================================================
# ■ Window_Learnings
#------------------------------------------------------------------------------
class Window_Learnings < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 224, 640, 248)

self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 14
self.contents.font.bold = true
self.back_opacity = 0
self.opacity = 0
self.contents_opacity=255
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# build the list of learnings
learnings={}
if (@actor.weapon_id != 0) and
$game_party.learning_db[$data_weapons[@actor.weapon_id].name]!=nil
for learning in $game_party.
learning_db[$data_weapons[@actor.weapon_id].name].learnings
if !learnings.keys.include?(learning.skill_name)
learnings[learning.skill_name]=LearningAndEquipEntry.new(learning)
end
learnings[learning.skill_name].weapon_id=@actor.weapon_id
end
end
if (@actor.armor1_id != 0) and
$game_party.learning_db[$data_armors[@actor.armor1_id].name] != nil
for learning in $game_party.
learning_db[$data_armors[@actor.armor1_id].name].learnings
if !learnings.keys.include?(learning.skill_name)
learnings[learning.skill_name]=LearningAndEquipEntry.new(learning)
end
learnings[learning.skill_name].armor1_id=@actor.armor1_id
end
end
if (@actor.armor2_id != 0) and
$game_party.learning_db[$data_armors[@actor.armor2_id].name] != nil
for learning in $game_party.
learning_db[$data_armors[@actor.armor2_id].name].learnings
if !learnings.keys.include?(learning.skill_name)
learnings[learning.skill_name]=LearningAndEquipEntry.new(learning)
end
learnings[learning.skill_name].armor2_id=@actor.armor2_id
end
end
if (@actor.armor3_id != 0) and
$game_party.learning_db[$data_armors[@actor.armor3_id].name] != nil
for learning in $game_party.
learning_db[$data_armors[@actor.armor3_id].name].learnings
if !learnings.keys.include?(learning.skill_name)
learnings[learning.skill_name]=LearningAndEquipEntry.new(learning)
end
learnings[learning.skill_name].armor3_id=@actor.armor3_id
end
end
if (@actor.armor4_id != 0) and
$game_party.learning_db[$data_armors[@actor.armor4_id].name] != nil
for learning in $game_party.
learning_db[$data_armors[@actor.armor4_id].name].learnings
if !learnings.keys.include?(learning.skill_name)
learnings[learning.skill_name]=LearningAndEquipEntry.new(learning)
end
learnings[learning.skill_name].armor4_id=@actor.armor4_id
end
end
if $game_temp.show_all_learnings
for skill_id in 0 .. $data_skills.length
if $data_skills[skill_id] != nil
if @actor.experience_points_skills[skill_id]>0
skill_name=$data_skills[skill_id].name
if !learnings.keys.include?(skill_name)
l=Learning.new
l.skill_name=$data_skills[skill_id].name
l.level=SKILLS_EXP_LEVELS[skill_id]
l.skill_id=skill_id
learnings[l.skill_name]=LearningAndEquipEntry.new(l)
end
end
end
end
end
self.contents.dispose
self.contents = Bitmap.new(width - 32, [24*learnings.size,24].max)
x = 0
y = 0
[email=actor=@actor]actor=@actor[/email]

i=0
# Cursor control
@item_max=learnings.size
if learnings.size > 0
self.index=0
self.active=true
end

# keys are the names
for lkey in learnings.keys
i+=1
if i%2==0
rect = Rect.new(x, y, 640-32-120, 24)
self.contents.fill_rect(rect, Color.new(255, 255, 255, 10))
end

self.contents.font.size=18
self.contents.font.color=normal_color
l=learnings[lkey]
skill_name=l.learning.skill_name
skill_id=l.learning.skill_id
skill=$data_skills[skill_id]
rect = Rect.new(x, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24), 255)
self.contents.font.color=(@actor.can_learn?(skill_id)) ? normal_color : disabled_color
self.contents.draw_text(x + 28, y, 132, 24,
skill.name, 0)
self.contents.draw_text(x+240,y,80,24,
[l.learning.level, @actor.experience_points_skills[skill_id]].min.to_s+
" / "+(l.learning.level).to_s) unless l.learning.level==0
bar=Bar.new(x+160,8+y,76,8,self.contents)
bar.highlight_complete=true
bar.refresh([l.learning.level,
@actor.experience_points_skills[skill_id]].min,(l.learning.level)) unless l.learning.level==0
if @actor.experience_points_skills[skill_id] >= l.learning.level
self.contents.draw_text(x+320,y,80,32,"")
end
if actor.perm_skill_learn?(skill_id)
self.contents.draw_text(x+400,y,80,32,"Aprendida!")
elsif actor.skill_learn?(skill_id)
self.contents.draw_text(x+400,y,80,32,"")
end
self.contents.font.size=10
self.contents.font.color=crisis_color
if l.weapon_id > 0
weapon = $data_weapons[l.weapon_id]
rect = Rect.new(x+488, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(weapon.icon_name)
self.contents.blt(x+488, y, bitmap, Rect.new(0, 0, 24, 24), 255)
if EQUIPMENT_SKILLS[weapon.name]!=nil and
EQUIPMENT_SKILLS[weapon.name].include?(skill_id)
self.contents.draw_text_shadowed_2(x+488+12, y+12, 12, 12, "●")
end
end
if l.armor1_id > 0
armor = $data_armors[l.armor1_id]
rect = Rect.new(x+488+24, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(armor.icon_name)
self.contents.blt(x+488+24, y, bitmap, Rect.new(0, 0, 24, 24), 255)
if EQUIPMENT_SKILLS[armor.name]!=nil and
EQUIPMENT_SKILLS[armor.name].include?(skill_id)
self.contents.draw_text_shadowed_2(x+488+12+24, y+12, 12, 12, "●")
end
end
if l.armor2_id > 0
armor = $data_armors[l.armor2_id]
rect = Rect.new(x+488+48, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(armor.icon_name)
self.contents.blt(x+488+48, y, bitmap, Rect.new(0, 0, 24, 24), 255)
if EQUIPMENT_SKILLS[armor.name]!=nil and
EQUIPMENT_SKILLS[armor.name].include?(skill_id)
self.contents.draw_text_shadowed_2(x+488+48+12, y+12, 12, 12, "●")
end
end
if l.armor3_id > 0
armor = $data_armors[l.armor3_id]
rect = Rect.new(x+488+72, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(armor.icon_name)
self.contents.blt(x+488+72, y, bitmap, Rect.new(0, 0, 24, 24), 255)
if EQUIPMENT_SKILLS[armor.name]!=nil and
EQUIPMENT_SKILLS[armor.name].include?(skill_id)
self.contents.draw_text_shadowed_2(x+488+72+12, y+12, 12, 12, "●")
end
end
if l.armor4_id > 0
armor = $data_armors[l.armor4_id]
rect = Rect.new(x+488+96, y, 24, 24)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(armor.icon_name)
self.contents.blt(x+488+96, y, bitmap, Rect.new(0, 0, 24, 24), 255)
if EQUIPMENT_SKILLS[armor.name]!=nil and
EQUIPMENT_SKILLS[armor.name].include?(skill_id)
self.contents.draw_text_shadowed_2(x+488+96+12, y+12, 12, 12, "●")
end
end
y+=24
end
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = self.width / @column_max - 32
# Calculate cursor coordinates
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 24 - self.oy
# Update cursor rectangle
self.cursor_rect.set(x, y, cursor_width, 24)
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
# Divide y-coordinate of window contents transfer origin by 1 row
# height of 24
return self.oy / 24
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
# If row is less than 0, change it to 0
if row < 0
row = 0
end
# If row exceeds row_max - 1, change it to row_max - 1
if row > row_max - 1
row = row_max - 1
end
# Multiply 1 row height by 24 for y-coordinate of window contents
# transfer origin
self.oy = row * 24
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
# Subtract a frame height of 32 from the window height, and divide it by
# 1 row height of 32
return (self.height - 32) / 24
end
end
class LearningAndEquipEntry
attr_accessor :learning
attr_accessor :weapon_id
attr_accessor :armor1_id
attr_accessor :armor2_id
attr_accessor :armor3_id
attr_accessor :armor4_id
def initialize(l)
@learning=l
@weapon_id=0
@armor1_id=0
@armor2_id=0
@armor3_id=0
@armor4_id=0
end
end
class Window_Equipment_Skills < Window_Base
def initialize
super(0, 160, 640, 320)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh
self.contents.clear
self.contents.font.bold = true
self.back_opacity = 255
self.opacity = 255
self.contents_opacity=255
self.contents.font.size=20
self.contents.font.color=system_color
if $game_temp.show_all_learnings
self.contents.draw_text(0,0,320,32,"Habilidades en Estudio (Lista Completa)")
else
self.contents.draw_text(0,0,320,32,"Habilidades en Estudio (En Estudio)")
end
end
end

el que sigue... nombrar como Scene Equip Add-On pegar en el:

class Scene_Equip
alias sls_main main
def main
@equipment_skill_window=Window_Equipment_Skill.new
@equipment_skill_window.actor=$game_party.actors[@actor_index]
@equipment_skill_window_visible=$game_temp.equip_equipment_skill_window_visible
@equipment_skill_window.set_x(336)
@equipment_skill_window.set_y(128)
# Original call
sls_main
@equipment_skill_window.dispose
end

alias sls_update update
def update
if Input.trigger?(Input::A)
$game_temp.equip_equipment_skill_window_visible=!$game_temp.equip_equipment_skill_window_visible
end
if @item_window1.active
@equipment_skill_window.target_x=((@item_window1.index+1)%2)*320+16
@equipment_skill_window.target_y=272
@equipment_skill_window.update(0,@item_window1.item.id)
@equipment_skill_window.visible=(true and $game_temp.equip_equipment_skill_window_visible)
elsif @item_window3.active
@equipment_skill_window.target_x=((@item_window3.index+1)%2)*320+16
@equipment_skill_window.target_y=272
@equipment_skill_window.update(2,@item_window3.item.id)
@equipment_skill_window.visible=(true and $game_temp.equip_equipment_skill_window_visible)
elsif @item_window4.active
@equipment_skill_window.target_x=((@item_window4.index+1)%2)*320+16
@equipment_skill_window.target_y=272
@equipment_skill_window.update(3,@item_window4.item.id)
@equipment_skill_window.visible=(true and $game_temp.equip_equipment_skill_window_visible)
elsif @item_window5.active
@equipment_skill_window.target_x=((@item_window5.index+1)%2)*320+16
@equipment_skill_window.target_y=272
@equipment_skill_window.update(4,@item_window5.item.id)
@equipment_skill_window.visible=(true and $game_temp.equip_equipment_skill_window_visible)
elsif @right_window.active
@equipment_skill_window.target_x=320+16
@equipment_skill_window.target_y=128+32*@right_window.index
@equipment_skill_window.update(@right_window.index,@right_window.item.id)
@equipment_skill_window.visible=(true and $game_temp.equip_equipment_skill_window_visible)
else
@equipment_skill_window.visible=false
end
# Original call
sls_update
end
end
class Game_Temp
attr_accessor :equip_equipment_skill_window_visible
alias equip_add_on_initialize initialize
def initialize
@equip_equipment_skill_window_visible=true
equip_add_on_initialize
end
end

el que sigue... nombrar: Scene Skill Add-On y pegar en el...

class Scene_Skill
alias sls_main main
def main
@equipment_needed_window=Window_Equipment_Needed.new
# Original call
sls_main
@equipment_needed_window.dispose
end

class Game_Temp
attr_accessor :skill_equipment_needed_window_visible
alias skill_add_on_initialize initialize
def initialize
@skill_equipment_needed_window_visible=true
skill_add_on_initialize
end
end end


Bien hasta aqui esta eso ahora.... necesitas un script que te ayude aque cada magia o habilidad se pueda solo hacer con un arma de cierto tipo por ejemplo (espada - lanza- hacha etc etc)

este script te ayudara.... ATENCION!!! DENTRO DEL SCRIPT PONGO LA EXPLICACION!! ASI QUE OJO!

llamalo como: Weapon Specific Skills

y pega esto


module Aqua
module WeaponSpecificSkills

****AQUI DONDE DICE DUMMY ELEMENT debes poner el id que esta en database en la pestaña de System, tienes que dar de alta los Element Names por ejemplo ahi dice... 9, 10, 11... etc etc el debes poner el elemento del arma por ejemplo el 9 es para espadas, ahora... en el Database en la pestaña de Skills debes tener en la lista de Element el alta de dicho elemento entonces solo debes palomear el skill con el elemento que quiereas que necesite para usar dicha habilidad.... de la misma forma en Database en Weapons debes poner el arma con el elemento que es si es Espada, Hacha etc...

DUMMY_ELEMENT = [9, 10, 11, 12, 13, 14, 15, 16]

end
end

class Game_Actor
alias aqua_weapon_specific_skill_can_use? skill_can_use?
def skill_can_use?(skill_id)
for i in 0...Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.size
dummyele = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT[i]
weapon = $data_weapons[self.weapon_id]
if weapon == nil && $data_skills[skill_id].element_set.include?(dummyele)
return false
end
if $data_skills[skill_id].element_set.include?(dummyele) &&
weapon.element_set.include?(dummyele)
return super
end
end
a = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.any? {|e|
$data_skills[skill_id].element_set.include?(e)}
return false if a == true
aqua_weapon_specific_skill_can_use?(skill_id)
end
end
if $DUMMY_ELEMENTS != nil
$DUMMY_ELEMENTS |= Aqua::WeaponSpecificSkills::DUMMY_ELEMENT
else
$DUMMY_ELEMENTS = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.clone
end
class Game_Battler
def elements_correct(elements)
multiplier = size = 0
elements.each {|i|
unless $DUMMY_ELEMENTS.include?(i)
multiplier += self.element_rate(i)
size += 1
end}
return (size == 0 ? 100 : multiplier/size)
end

end


espero que me alla explicado bien SUERTE!, espero que te sirva de algo...
Volver arriba Ir abajo
Ver perfil de usuario http://gamejolt.com/freeware/games/rpg/mundo-abismal/9212/
Contenido patrocinado




MensajeTema: Re: (ayuda)con escript las armas enseñan habilidades (que las habilidades del script se muestren tambien al cargar una partida guardada)   

Volver arriba Ir abajo
 
(ayuda)con escript las armas enseñan habilidades (que las habilidades del script se muestren tambien al cargar una partida guardada)
Ver el tema anterior Ver el tema siguiente Volver arriba 
Página 1 de 1.
 Temas similares
-
» ayuda para crear habilidades Tankentai
» [Evento Marine] Llamada a las armas.
» Ayuda con Ace Attorney :U
» MI ARMAS xDD
» Sistema de juego individual

Permisos de este foro:No puedes responder a temas en este foro.
Maker Palace :: RGSS Scripts :: Scripts Maker XP-
Cambiar a: