joaovitor2763 Membro
Sexo : Mensagens : 12
| Assunto: Tornado Quest Book Seg Jun 13, 2011 3:49 pm | |
| Conversão de Script do RMXP pro RMVX
Demo Script original por:StormCréditos por converter: joaovitor2763Créditos pro traduzir: joaovitor2763Script original: Clique aqui. Screen: Original:- Spoiler:
RMVX:- Spoiler:
Instruções:Coloque o script acima do main. # Use $scene = Scene_QuestBook.new para chamr o script. # # Use $game_party.add_quest(id) para adcionar uma quest. # # Use $game_party.delete_quest(id) para deletar uma quest. # # Use $game_party.finish_quest(id) para finalizar uma quest. # # Use $game_party.unfinish_quest(id) para detemrinar que uma quest falhou. Script: - Código:
-
#============================================================================== #============================================================================== # Tornado Quest Book # Version 2.0 # Autor Original: Storm # Autor RMVX: Joaovitor2763 # Creditos : Storm por criar # joaovitor2763 por converter e traduzir # Como usar # coloque o script antes do main. # # Use $scene = Scene_QuestBook.new para chamr o script. # # Use $game_party.add_quest(id) para adcionar uma quest. # # Use $game_party.delete_quest(id) para deletar uma quest. # # Use $game_party.finish_quest(id) para finalizar uma quest. # # Use $game_party.unfinish_quest(id) para detemrinar que uma quest falhou. # # In condition branch, at the script tab enter $game_party.quest_complete?(id) # to check if that quest have completed yet. # # Suporte: # Menus customizaveis. # Opacidade customizavel. # Cores customizaveis para o sctatus da quest. # # Possibilidade de retonar para a Scene desejada. # Texto automaticamente atualizado nas mensagens. # Atualização configravel. # # Compatibilidade: # RMVX # # Credits and Thanks (originais): # Storm - For making it. # Game_Guy - For teach me how to use array. # Credits and Thanks (novos): # Storm - For making it. # Game_Guy - For teach me how to use array. # Joaovitor2763 por traduzir e converter pro rmvx #============================================================================== #==============================================================================
module JV2763 #============================================================================ # Inicio das configurações #============================================================================ #============================== Configurações ============================== # Configurações Gerais #============================================================================ QB_Name = "Quest Book" #Nome do livro de quests Author_Name = "Autor" #Author da quest Title_Name = "Título" #Titulo da quest Reward_Name = "Recompensa" #Recompensa Status_Name = "Processo" #Status Complete = "Completo" #Completo Incomplete = "Incompleto" #Incompleto Unknown = "???" #Recompensa desconhecida Opacity = 200 #Opacidade da janela Screen = 1 #(0 = fundo preto,1 = mostrar mapa,"quoted string" = picture) Cmp_Color = Color.new(0, 255, 0, 255) #Completo cor Incmp_Color = Color.new(255, 0, 0, 255) #Incompleto cor Return = Scene_Map #Voltar para scene #================================ Ignorar =============================== # Ignore esta parte #============================================================================ Quest = [] #============================ Quests Configurações ============================ # Atualizações das quests # # Replace = ["text","replace"] # NOTE: O maximo de quests possiveis e igual a 10. # Cannot include {name1}, {name2}, {name3} and {name4} # # Completed Replacements: (Do not add) # {name1} = 1st actor's name # {name2} = 2nd actor's name # {name3} = 3rd actor's name # {name4} = 4th actor's name #============================================================================ Replace1 = ["",""] Replace2 = ["",""] Replace3 = ["",""] Replace4 = ["",""] Replace5 = ["",""] Replace6 = ["",""] Replace7 = ["",""] Replace8 = ["",""] Replace9 = ["",""] Replace10 = ["",""] #=============================== Quest Config =============================== # Configure as quests aqui. # # Quest[id] = ["Nome","Author","Descrição","Recompensa"] #============================================================================ #PART 1 Quest[1] = ["Explorando","Ankor","Encontre uma pena de galinha.","100G"] Quest[2] = ["Água rara","Karin","Busque um pote da água das fontes misticas.","200G"] Quest[3] = ["Trabalho Sujo","Maken","Me consiga a gosma de um slime.","Lucky Box"] Quest[4] = ["A Carta","keroke","Entregua a carta para Ankor.","Espada Curta"] Quest[5] = ["Guia","Halen","Encontre Mirna no deserto.","20Xp"] Quest[6] = ["Grande Soldado ","Cp. Marton","Vença 5 guerreiros Dwarven.","Lucky Box"] #============================================================================ # Fim das configurações #============================================================================ end
#==================== # Game_Party #==================== class Game_Party attr_accessor :quest attr_accessor :qComplete alias tnd_qb_init initialize def initialize @quest = [] @qComplete = [] tnd_qb_init end def add_quest(id) msg = JV2763::Quest[id] return if msg == nil unless @quest.include?(id) @qComplete.delete(id) @quest.push(id) end end def delete_quest(id) msg = JV2763::Quest[id] return if msg == nil if @quest.include?(id) @qComplete.delete(id) @quest.delete(id) end end def finish_quest(id) msg = JV2763::Quest[id] return if msg == nil if @quest.include?(id) @qComplete.push(id) end end def unfinish_quest(id) msg = JV2763::Quest[id] return if msg == nil if @quest.include?(id) @qComplete.delete(id) end end def quest_complete?(id) return if id == nil msg = JV2763::Quest[id] return if msg == nil if @qComplete.include?(id) return true else return false end end end
#==================== # Bitmap #==================== class Bitmap def format_text(text, width) words = text.split(' ') return words if words.size == 1 result, current_text = [], words.shift words.each_index {|i| if self.text_size("#{current_text} #{words[i]}").width > width result.push(current_text) current_text = words[i] else current_text = "#{current_text} #{words[i]}" end result.push(current_text) if i >= words.size - 1} return result end end
#==================== # Window_QuestTitle #==================== class Window_QuestTitle < Window_Base def initialize super(0, 0, 540, 60) self.back_opacity = JV2763::Opacity self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear self.contents.font.color = normal_color self.contents.font.size = 25 cx = contents.text_size(JV2763::QB_Name).width self.contents.draw_text(0, 0, cx, 37, JV2763::QB_Name) end end
#==================== # Window_QuestMain #==================== class Window_QuestMain < Window_Base def initialize super(240, 65, 300, 300) self.back_opacity = JV2763::Opacity self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh return if @quest_id == nil msg = JV2763::Quest[@quest_id] return if msg == nil self.contents.clear self.contents.font.size = 20 t = self.contents.text_size(JV2763::Title_Name+": ").width t2 = self.contents.text_size(JV2763::Author_Name+": ").width t3 = self.contents.text_size(JV2763::Reward_Name+": ").width t4 = self.contents.text_size(JV2763::Status_Name+": ").width self.contents.font.color = system_color self.contents.draw_text(0, 0, self.width, 32, JV2763::Title_Name+": ") self.contents.draw_text(0, 32, self.width, 32, JV2763::Author_Name+": ") self.contents.draw_text(0, 200, self.width, 32, JV2763::Reward_Name+": ") self.contents.draw_text(0, 232, self.width, 32, JV2763::Status_Name+": ") self.contents.font.color = normal_color self.contents.draw_text(t, 0, self.width, 32, msg[0]) self.contents.draw_text(t2, 32, self.width, 32, msg[1]) @text = msg[2] @text = @text.gsub(JV2763::Replace1[0], JV2763::Replace1[1]) @text = @text.gsub(JV2763::Replace2[0], JV2763::Replace2[1]) @text = @text.gsub(JV2763::Replace3[0], JV2763::Replace3[1]) @text = @text.gsub(JV2763::Replace4[0], JV2763::Replace4[1]) @text = @text.gsub(JV2763::Replace5[0], JV2763::Replace5[1]) @text = @text.gsub(JV2763::Replace6[0], JV2763::Replace6[1]) @text = @text.gsub(JV2763::Replace7[0], JV2763::Replace7[1]) @text = @text.gsub(JV2763::Replace8[0], JV2763::Replace8[1]) @text = @text.gsub(JV2763::Replace9[0], JV2763::Replace9[1]) @text = @text.gsub(JV2763::Replace10[0], JV2763::Replace10[1])
draw_msg(@text, 245, 65) if $game_party.qComplete.include?(@quest_id) self.contents.draw_text(t3, 200, self.width, 32, msg[3]) self.contents.font.color = JV2763::Cmp_Color self.contents.draw_text(t4, 232, self.width, 32, JV2763::Complete) else self.contents.draw_text(t3, 200, self.width, 32, JV2763::Unknown) self.contents.font.color = JV2763::Incmp_Color self.contents.draw_text(t4, 232, self.width, 32, JV2763::Incomplete) end end def draw_msg(msg, x, y) text = self.contents.format_text(msg, 300) text.each_index {|i|self.contents.draw_text(0, y + i*32, 245, 32, text[i])} end def set_quest(id) return if @quest_id == id @quest_id = id refresh end end
#==================== # Scene_QuestBook #==================== class Scene_QuestBook def main if JV2763::Screen.is_a?(Integer) if JV2763::Screen == 1 @back = Spriteset_Map.new end else @back = Sprite.new @back.bitmap = RPG::Cache.picture(JV2763::Screen) end #Command window setup @quest = $game_party.quest @msg = [] @quest.each {|i| @msg.push(JV2763::Quest[i][0]) } @msg = [""] if @msg.size < 1 #Create command window @command_window = Window_Command.new(180, @msg) @command_window.x = 0 @command_window.back_opacity = JV2763::Opacity @command_window.height = 240 @command_window.y = 65 j = 0 @quest.each{|i| if $game_party.qComplete.include?(i) @command_window.draw_item(j, JV2763::Cmp_Color) end j += 1} #Make main windows @title = Window_QuestTitle.new @main = Window_QuestMain.new Graphics.transition loop do Graphics.update Input.update #Update windows and inputs update inputUpdate #Break if scene is not Scene_QuestBook if $scene != self break end end Graphics.freeze #Dispose windows if JV2763::Screen == 1 @back.dispose end @command_window.dispose @title.dispose @main.dispose end def command_refresh @newIndex = @command_window.index @msg = [] @command_window.dispose @command_window = nil @quest.each {|i| @msg.push(JV2763::Quest[i][0]) } @msg = [""] if @msg.size < 1 @command_window = Window_Command.new(180, @msg) @command_window.x = 0 @command_window.back_opacity = JV2763::Opacity @command_window.height = 240 @command_window.y = 65 @command_window.index = @newIndex j = 0 @quest.each{|i| if $game_party.qComplete.include?(i) @command_window.draw_item(j, JV2763::Cmp_Color) end j += 1} end def inputUpdate if Input.trigger?(Input::B) #Play Cancel SE Sound.play_decision #Return to set scene $scene = JV2763::Return.new elsif Input.trigger?(Input::C) #Play Decision SE Sound.play_decision #Refresh quest data @main.set_quest(@quest[@command_window.index]) #Goto command_refresh command_refresh end end def update #Updates @command_window.update @title.update @main.update end end | |
|
LiNuS! Administradores!
Sexo : Mensagens : 340
| Assunto: Re: Tornado Quest Book Seg Jun 13, 2011 3:55 pm | |
| muito bom o sistema obrigada por disponibilizar +1 | |
|
joaovitor2763 Membro
Sexo : Mensagens : 12
| Assunto: Re: Tornado Quest Book Seg Jun 13, 2011 4:26 pm | |
| - LiNuS! escreveu:
- muito bom o sistema obrigada por disponibilizar +1
Não a de que. | |
|