#==============================================================================
# ** Title
#------------------------------------------------------------------------------
# By Valentine
# Editado para o Save in Server > RD12
#==============================================================================
class Scene_Title
def initialize
Graphics.frame_count = 0
$ABS = MrMo_ABS.new
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_netparty = Game_Party.new
$game_party.setup_starting_members
$game_netparty.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.update
@count_load = 0
end
def main
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
$Icon = []
@logbotao = []
@crebotao = []
@direita = []
@esquerda = []
@op_ = []
@deletechar = []
$scrollitemmax = []
$m_click = 0
@tempo = 0
$tempo = 0
@tempinho = 0
$sex = 0
$grafiche = Grafica.new
@current_grp = 0
$game_actors[1].set_chara($grafiche.sex[$game_actors[1].class_id][0])
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
loop do
@count_load += 1
loadcharacter(1) if @count_load == 1
loadcharacter(2) if @count_load == 999
loadcharacter(3) if @count_load == 9999
break if @count_load == 9999
end
delete
create
Graphics.transition
loop do
Graphics.update
Input.update
Network::Main.update
update
if $scene != self
break
end
end
Graphics.freeze
@sprite.dispose
@delete.dispose
$create.dispose
$Icon[4].dispose
$Icon[5].dispose
$Icon[6].dispose
if @barra_active == true or @barra_active_create == true
@barra.dispose
end
$create_box.dispose
end
def loadcharacter(id)
name = Network::Main.name
$sis_id = id
SiS.exist(id)
SiS.request(id)
for i in 0..99999
if i == 99999
Network::Main.update
if $char_exist == "true" and not @deletechar[id] == true
$Icon[id+3] = Load_Character.new(240,130,170,193,id)
@op_[id] = true
if id == 1
@direita[id] = Button.new($Icon[id+3],124,60," > ",0,1) {$Icon[4].visible = false; $Icon[4].active = false; $Icon[5].visible = true; $Icon[5].active = true; @id_c = 2}
@esquerda[id] = Button.new($Icon[id+3],15,60," < ",0,1) {$Icon[4].visible = false; $Icon[4].active = false; $Icon[6].visible = true; $Icon[6].active = true; @id_c = 3}
elsif id == 2
$Icon[id+3].visible = false
$Icon[id+3].active = false
@direita[id] = Button.new($Icon[5],124,60," > ",0,1)
@esquerda[id] = Button.new($Icon[5],15,60," < ",0,1) {$Icon[5].visible = false; $Icon[5].active = false; $Icon[4].visible = true; $Icon[4].active = true; @id_c = 1}
elsif id == 3
$Icon[id+3].visible = false
$Icon[id+3].active = false
@direita[id] = Button.new($Icon[6],124,60," > ",0,1) {$Icon[6].visible = false; $Icon[6].active = false; $Icon[4].visible = true; $Icon[4].active = true; @id_c = 1}
@esquerda[id] = Button.new($Icon[6],15,60," < ",0,1)
end
if $ban[id] != true
@logbotao[id] = Button.new($Icon[id+3],49,120,LANGUAGE::SELECTCHAR,3,1){@id_c = id;carregar}
end
@crebotao[id] = Button.new($Icon[id+3],49,142,LANGUAGE::DELETECHAR,3,1){@delete.visible = true; @delete.active = true;$char_id = id}
else
$Icon[id+3] = Load_Character.new(240,130,170,193,id)
if id == 1
@direita[id] = Button.new($Icon[id+3],124,60," > ",0,1) {$Icon[4].visible = false; $Icon[4].active = false; $Icon[5].visible = true; $Icon[5].active = true; @id_c = 2}
@esquerda[id] = Button.new($Icon[id+3],15,60," < ",0,1) {$Icon[4].visible = false; $Icon[4].active = false; $Icon[6].visible = true; $Icon[6].active = true; @id_c = 3}
elsif id == 2
$Icon[id+3].visible = false
$Icon[id+3].active = false
@direita[id] = Button.new($Icon[id+3],124,60," > ",0,1)
@esquerda[id] = Button.new($Icon[id+3],15,60," < ",0,1) {$Icon[5].visible = false; $Icon[5].active = false; $Icon[4].visible = true; $Icon[4].active = true; @id_c = 1}
elsif id == 3
$Icon[id+3].visible = false
$Icon[id+3].active = false
@direita[id] = Button.new($Icon[id+3],124,60," > ",0,1) {$Icon[6].visible = false; $Icon[6].active = false; $Icon[4].visible = true; $Icon[4].active = true; @id_c = 1}
@esquerda[id] = Button.new($Icon[id+3],15,60," < ",0,1)
end
@logbotao[id] = Button.new($Icon[id+3],49,120,LANGUAGE::CREATECHAR,3,1){createchar(id)}
end
end
end
end
def createchar(id)
@create_active = true
$create.refresh
if $create.visible != true
$create.visible = true
$create.active = true
end
$Icon[3+id].visible = false
$Icon[3+id].active = false
$char_id = id
$create_box.visible = true
$create_box.active = true
end
def delete
@delete = Window_Delete.new(380, 200, 115,72)
@delete.visible = false
@delete.active = false
@delbotao = Button.new(@delete,10,33,LANGUAGE::DELETEYES,0,1) {sim}
@canbotao = Button.new(@delete,55,33,LANGUAGE::DELETENO,0,1) {@delete.visible = false; @delete.active = false}
end
def sim
@delete.visible = false
@delete.active = false
if $Icon[4].visible == true
@deletechar[1] = true
name = Network::Main.name
SiS.delete(1)
@op_[1] = false
elsif $Icon[5].visible == true
@deletechar[2] = true
name = Network::Main.name
SiS.delete(2)
@op_[2] = false
elsif $Icon[6].visible == true
@deletechar[3] = true
name = Network::Main.name
SiS.delete(3)
@op_[3] = false
end
$scene = Scene_Title.new
end
def update
$create_box.update if $create.visible
@delete.update if @delete.visible
$Icon[4].update if Graphics.frame_count % 5 == 0
$Icon[5].update if Graphics.frame_count % 5 == 0
$Icon[6].update if Graphics.frame_count % 5 == 0
@name_box.active = true if $create.visible
if @barra_active == true or @barra_active_create == true
@barra.refresh
end
if @create_active == true
if Graphics.frame_count / Graphics.frame_rate != @total_sec
@tempo += 1
end
end
if @barra_active == true or @barra_active_create == true
if Graphics.frame_count / Graphics.frame_rate != @total_sec
@tempinho += 1
end
end
if @barra_active == true or @barra_active_create == true
if @tempinho == 5
$tempo += 1
@tempinho = 0
end
end
if $tempo == 103 and @barra_active == true
carregar2
end
if $tempo == 103 and @barra_active_create == true
criar_char2
end
if $tempo == 35
@sprite.bitmap = RPG::Cache.title(User_Edit::LOADING2)
end
if $tempo == 65
@sprite.bitmap = RPG::Cache.title(User_Edit::LOADING3)
end
if @create_active == true
if @tempo == 0.5 * 10
@tempo = 0
@create_active2 = true
@create_active = false
end
end
if @create_active2 == true
$create.update if $create.visible if Graphics.frame_count % 5 == 0
end
end
def create
actor = $game_party.actors[0]
$create = Create_Chars.new
$create.visible = false
$create.active = false
$create_box = Window_Dummys.new(200,126,150,60)
$create_box.opacity = 1
$create_box.visible = false
$create_box.active = false
$create_box.z = 999999
@name_box = Text_Box.new($create_box,10,17,102,10,1,true)
name = Network::Main.name
$sexo = LANGUAGE::MAN
@create_button = Button.new($create,10,170,LANGUAGE::CREATECHAR2,0,1) { criar_char }
@cancel = Button.new($create,85,170,LANGUAGE::CREATERETURN,0,1) { cancel }
@next_g = Button.new($create,137,105," > ",0,1) {next_gr}
@prev_g = Button.new($create,60,105," < ",0,1) {prev_gr}
@next_s = Button.new($create,137,51," > ",0,1) {@current_grp = 0;$game_party.actors[0].set_female; reset_gra ; if $sexo == LANGUAGE::MAN
$sexo = LANGUAGE::WOMAN
end;$create.refresh}
@prev_s = Button.new($create,60,51," < ",0,1) {@current_grp = 0;$game_party.actors[0].set_male; reset_gra ; if $sexo == LANGUAGE::WOMAN
$sexo = LANGUAGE::MAN
end;$create.refresh}
@next_c = Button.new($create,60,77," < ",0,1) {prev_class; $create.refresh } if User_Edit::NOSELECTCLASS == false
@next_D = Button.new($create,137,77," > ",0,1) {next_class; $create.refresh } if User_Edit::NOSELECTCLASS == false
if User_Edit::DISTRIBUIR_ACTIVE == true
@str = Button.new($create,270, 48, " + ",0,1) {str}
@dex = Button.new($create,270, 73, " + ",0,1) {dex}
@agi = Button.new($create,270, 98, " + ",0,1) {agi}
@int = Button.new($create,270, 123, " + ",0,1) {int}
end
end
def cancel
$create.visible = false
$create.active = false
$create_box.visible = false
$create_box.active = false
$Icon[$char_id+3].visible = true
$Icon[$char_id+3].active = true
@create_active2 = false
end
def carregar
if User_Edit::LOADING_ACTIVE == true
$Icon[4].visible = false
$Icon[4].active = false
$Icon[5].visible = false
$Icon[5].active = false
$Icon[6].visible = false
$Icon[6].active = false
@sprite.bitmap = RPG::Cache.title(User_Edit::LOADING)
@barra = Barra.new
@barra_active = true
else
carregar2
end
end
def carregar2
#==========Iniciar variáveis==========
Graphics.frame_count = 0
$ABS = MrMo_ABS.new
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_netparty = Game_Party.new
$game_party.setup_starting_members
$game_netparty.setup_starting_members
$game_party.actors[0].name = $SiS_Contents[@id_c][0]
$game_party.actors[0].character_name = $SiS_Contents[@id_c][1]
$game_party.actors[0].guild = $SiS_Contents[@id_c][2]
$guild_name = $SiS_Contents[@id_c][2]
$guild_lider_name = $SiS_Contents[@id_c][3]
$guild_position = $SiS_Contents[@id_c][4]
$game_party.actors[0].ban = $SiS_Contents[@id_c][5].to_i
$flag = $SiS_Contents[@id_c][6][0].to_i
$guild_points = $SiS_Contents[@id_c][6][1].to_i
$game_party.actors[0].class_id = $SiS_Contents[@id_c][6][2].to_i
$game_party.actors[0].level = $SiS_Contents[@id_c][6][3].to_i
$luva_ac = $data_armors[$SiS_Contents[@id_c][6][7].to_i]
$bota_ac = $data_armors[$SiS_Contents[@id_c][6][8].to_i]
$capa_ac = $data_armors[$SiS_Contents[@id_c][6][9].to_i]
$amuleto_ac = $data_armors[$SiS_Contents[@id_c][6][10].to_i]
$game_party.actors[0].weapon_id = $SiS_Contents[@id_c][6][11].to_i
$game_party.actors[0].armor1_id = $SiS_Contents[@id_c][6][12].to_i
$game_party.actors[0].armor2_id = $SiS_Contents[@id_c][6][13].to_i
$game_party.actors[0].armor3_id = $SiS_Contents[@id_c][6][14].to_i
$game_party.actors[0].armor4_id = $SiS_Contents[@id_c][6][15].to_i
$game_party.actors[0].hp = $SiS_Contents[@id_c][6][16].to_i
$game_party.actors[0].sp = $SiS_Contents[@id_c][6][17].to_i
$game_party.actors[0].exp += $SiS_Contents[@id_c][6][18].to_i
$game_party.actors[0].str = $SiS_Contents[@id_c][6][19].to_i
$game_party.actors[0].dex = $SiS_Contents[@id_c][6][20].to_i
$game_party.actors[0].agi = $SiS_Contents[@id_c][6][21].to_i
$game_party.actors[0].int = $SiS_Contents[@id_c][6][22].to_i
$distribuir_pontos = $SiS_Contents[@id_c][6][23].to_i
$genero = $SiS_Contents[@id_c][6][24].to_i
for i in 0..$SiS_Contents[@id_c][7].size
$game_variables[i] = $SiS_Contents[@id_c][7][i].to_i
end
for i in 0..$SiS_Contents[@id_c][8].size
swtf = false if $SiS_Contents[@id_c][8][i] == 0
swtf = true if $SiS_Contents[@id_c][8][i] == 1
$game_switches[i] = swtf
end
for i in 0..$SiS_Contents[@id_c][9].size-1
$game_party.gain_item(i, $SiS_Contents[@id_c][9][i])
end
for i in 0..$SiS_Contents[@id_c][10].size-1
$game_party.gain_weapon(i, $SiS_Contents[@id_c][10][i])
end
for i in 0..$SiS_Contents[@id_c][11].size-1
$game_party.gain_armor(i, $SiS_Contents[@id_c][11][i])
end
for i in 0..$SiS_Contents[@id_c][12].size-1
$game_party.actors[0].learn_skill($SiS_Contents[@id_c][12][i])
end
$game_map.setup($SiS_Contents[@id_c][6][4].to_i)
$game_player.moveto($SiS_Contents[@id_c][6][5].to_i, $SiS_Contents[@id_c][6][6].to_i)
$game_player.refresh
$game_map.update
$ABS.update
$game_party.refresh
$game_map.autoplay
Graphics.freeze
$char_id = @id_c
$divide_exp = false
if Network::Main.group == 'admin'
$game_party.actors[0].grupo = "Admin"
else
$game_party.actors[0].grupo = "Standard"
end
#Sair da Guild que foi deletada
if $guild_name != ""
if Network::Main.user_exist?($guild_name.to_s+"-Guild-DEL") == true
$guild_name = ""
$game_party.actors[0].guild = ""
$game_player.refresh
$guild_position = LANGUAGE::GUILDRANK
$guild_lider_name = ""
$guild_points = 0
return
end
end
if $guild_name == ""
$flag = 1
end
$game_player.refresh
$chat_ativo_agr = true
$scene = Scene_Map.new
$fechando_ativar = true
Network::Main.send_start
end
def criar_char
if Network::Main.user_exist?(@name_box.text+"-Char") == true
$erro = LANGUAGE::CREATEERRONAME
$create.refresh
return
end
arg = @name_box.text.split
#Evitar Falsos ADM's
if User_Edit::PROIBIR == true
if @name_box.text.include?("GM") or @name_box.text.include?("Gm") or @name_box.text.include?("gM") or @name_box.text.include?("gm")
$erro = "#{arg[0]} "+LANGUAGE::CREATEERROARG
$create.refresh
return
elsif @name_box.text.include?("ADM") or @name_box.text.include?("Adm") or @name_box.text.include?("aDm") or @name_box.text.include?("adM") or @name_box.text.include?("ADm") or @name_box.text.include?("aDM") or @name_box.text.include?("AdM") or @name_box.text.include?("adm")
$erro = "#{arg[0]} "+LANGUAGE::CREATEERROARG
$create.refresh
return
elsif @name_box.text.include?("[ADM]") or @name_box.text.include?("[Adm]") or @name_box.text.include?("[aDm]") or @name_box.text.include?("[adM]") or @name_box.text.include?("[ADm]") or @name_box.text.include?("[aDM]") or @name_box.text.include?("[AdM]") or @name_box.text.include?("[adm]")
$erro = "#{arg[0]} "+LANGUAGE::CREATEERROARG
$create.refresh
return
elsif @name_box.text.include?("GOD") or @name_box.text.include?("God") or @name_box.text.include?("gOd") or @name_box.text.include?("goD") or @name_box.text.include?("GOd") or @name_box.text.include?("gOD") or @name_box.text.include?("GoD") or @name_box.text.include?("god")
$erro = "#{arg[0]} "+LANGUAGE::CREATEERROARG
$create.refresh
return
end
end
if @name_box.text == "" or @name_box.text == " " or @name_box.text == " " or @name_box.text == " " or @name_box.text == " " or @name_box.text == " " or @name_box.text == " " or @name_box.text == " " or @name_box.text == " " or @name_box.text == " " or @name_box.text == " " or @name_box.text == " " or @name_box.text == " "
$erro = LANGUAGE::CREATENOTNAME
$create.refresh
return
end
if User_Edit::LOADING_ACTIVE == true
$create.visible = false
$create.active = false
$create_box.visible = false
$create_box.active = false
@sprite.bitmap = RPG::Cache.title(User_Edit::LOADING)
@barra = Barra.new
@barra_active_create = true
else
criar_char2
end
end
def criar_char2
$game_party.actors[0].name = @name_box.text
$game_player.refresh
$game_map.autoplay
Network::Main.send_start
Graphics.freeze
$chat_ativo_agr = true
$scene = Scene_Reinit.new
$fechando_ativar = true
if $sexo == LANGUAGE::MAN
$genero = 1
$game_party.actors[0].sexo = LANGUAGE::MAN
elsif $sexo == LANGUAGE::WOMAN
$genero = 2
$game_party.actors[0].sexo = LANGUAGE::WOMAN
end
$guild_name = ""
$guild_lider_name = ""
$guild_position = LANGUAGE::GUILDRANK
$flag = 1
$guild_points = 0
if Network::Main.group == 'admin'
$game_party.actors[0].grupo = "Admin"
end
Network::Main.send_register(@name_box.text+"-Char" , @name_box.text)
$game_temp.chat_log.push(LANGUAGE::NOMOTD)
autosave
end
def reset_gra
$grafiche.update
@current_grp = 0
$game_actors[1].set_chara($grafiche.sex[$game_actors[1].class_id][@current_grp])
end
def next_class
@current_grp = 0
$grafiche.update
if $game_actors[1].class_id <= $data_classes.size - 2
$game_actors[1].class_id += 1
else
$game_actors[1].class_id = 1
end
$game_actors[1].set_chara($grafiche.sex[$game_actors[1].class_id][@current_grp])
$create.refresh
end
def prev_class
@current_grp = 0
$grafiche.update
if $game_actors[1].class_id == $data_classes.size - 1
$game_actors[1].class_id -= 1
$game_actors[1].set_chara($grafiche.sex[$game_actors[1].class_id][@current_grp])
$grafiche.update
$create.refresh
return
end
if $game_actors[1].class_id == 1
$game_actors[1].class_id = $data_classes.size - 1
$game_actors[1].set_chara($grafiche.sex[$game_actors[1].class_id][@current_grp])
$grafiche.update
$create.refresh
return
end
if $game_actors[1].class_id <= $data_classes.size - 2
$game_actors[1].class_id -= 1
else
$game_actors[1].class_id = 1
end
$game_actors[1].set_chara($grafiche.sex[$game_actors[1].class_id][@current_grp])
$create.refresh
end
def next_gr
@act = $game_party.actors[0]
if @current_grp <= $grafiche.sex[@act.class_id].size-2
@current_grp += 1
$grafiche.update
$game_actors[1].set_chara($grafiche.sex[@act.class_id][@current_grp])
end
$create.refresh
end
def prev_gr
@act = $game_party.actors[0]
return if @current_grp == 0
if @current_grp >= $grafiche.sex[@act.class_id].size-2
@current_grp -= 1
$grafiche.update
$game_actors[1].set_chara($grafiche.sex[@act.class_id][@current_grp])
$create.refresh
return
end
if @current_grp <= $grafiche.sex[@act.class_id].size-2
@current_grp -= 1
$grafiche.update
$game_actors[1].set_chara($grafiche.sex[@act.class_id][@current_grp])
end
$create.refresh
end
def back_gr
@act = $game_party.actors[0]
if @current_grp > 0 then
@current_grp -= 1
$grafiche.update
$game_actors[1].set_chara($grafiche.sex[@act.class_id][@current_grp])
end
$create.refresh
end
def str
if $distribuir_pontos >= 1
$distribuir_pontos -= 1
$game_actors[1].str += 1
$create.refresh
else
$create.refresh
end
end
def dex
if $distribuir_pontos >= 1
$distribuir_pontos -= 1
$game_actors[1].dex += 1
$create.refresh
else
$create.refresh
end
end
def agi
if $distribuir_pontos >= 1
$distribuir_pontos -= 1
$game_actors[1].agi += 1
$create.refresh
else
$create.refresh
end
end
def int
if $distribuir_pontos >= 1
$distribuir_pontos -= 1
$game_actors[1].int += 1
$create.refresh
else
$create.refresh
end
end
# Fim da Scene Title
end