Já viram qual a arte dessa semana?Exposição dos Artistas #8
3 Respostas   357 Visualizações
0 Membros e 1 Visitante estão vendo este tópico.
#==============================================================================## VMS - Quest_List ##------------------------------------------------------------------------------## To : RMB By : DeadMaker Date : 12/06/2012 ##==============================================================================## ~Não poste ou modifique o script sem permissão~ ##------------------------------------------------------------------------------## Comandos : ##------------------------------------------------------------------------------## ## $game_system.add_new_quest(id da quest) #=> Adiciona nova quest ## ## $game_system.quest_complete(nome da quest) #=> Completa quest manualmente ## ## vms_check_quest(id da quest) #=> Dar premio da quest completa ## ## quest_has_complete?(nome da quest) #=> Apenas chechar se quest foi completa ## ##==============================================================================## Dúvidas ? Acesse : http://www.rpgmakerbrasil.net/forum/profile/?u=54 ##------------------------------------------------------------------------------## Me envie uma MP que ajudarei ;) ##==============================================================================#class Game_System attr_accessor :vms_quests_addattr_accessor :vms_quests_sta def add_new_quest(id) $game_system.vms_quests_add.push(Vms_Quests_Add::Quests_List[id]) $game_system.vms_quests_sta[id] = Vms_Quests_Config::Course_Text end def quest_complete(name) maker = 0 for i in $game_system.vms_quests_add maker += 1 range = i if range["Quest_Name"] == name $game_system.vms_quests_sta[maker-1] = Vms_Quests_Config::Complete_Text end end end def vms_quest_give_prize(id) quest_data = Vms_Quests_Add::Quests_List[id] quest_required = quest_data["Required_Items"] quest_gain = quest_data["Quest_Prizes"] for i in quest_gain case i[0] when "I" $game_party.gain_item($data_items[i[1]],i[2]) when "A" $game_party.gain_item($data_armors[i[1]],i[2]) when "W" $game_party.gain_item($data_weapons[i[1]],i[2]) when "E" $game_party.members[0].gain_exp(i[1]) end end for z in quest_required case z[0] when "I" $game_party.lose_item($data_items[z[1]],z[2]) when "A" $game_party.lose_item($data_armors[z[1]],z[2]) when "W" $game_party.lose_item($data_weapons[z[1]],z[2]) end end end endclass Game_Interpreter def vms_check_quest(id) make = id quest_data = Vms_Quests_Add::Quests_List[id] quest_required = quest_data["Required_Items"] quest_swtich = quest_data["Required_Switches"] quest_variable = quest_data["Required_Variable"] quest_name = quest_data["Quest_Name"] for i in quest_required case i[0] when "I" object = $data_items[i[1]] when "W" object = $data_weapons[i[1]] when "A" object = $data_armors[i[1]] when "T" object = "Text" end if object != "Text" if $game_party.has_item?(object,i[3]) $game_system.vms_quests_sta[id] = Vms_Quests_Config::Complete_Text else $game_system.vms_quests_sta[id] = Vms_Quests_Config::Course_Text end end end if quest_swtich != nil if $game_switches[quest_swtich] == true $game_system.vms_quests_sta[id] = Vms_Quests_Config::Complete_Text else $game_system.vms_quests_sta[id] = Vms_Quests_Config::Course_Text end end if quest_variable != nil if $game_variables[quest_variable[0]] >= quest_variable[1] $game_system.vms_quests_sta[id] = Vms_Quests_Config::Complete_Text else $game_system.vms_quests_sta[id] = Vms_Quests_Config::Course_Text end end if $game_system.vms_quests_sta[id] == Vms_Quests_Config::Complete_Text $game_system.vms_quest_give_prize(make) else return false end end def quest_has_complete?(name) maker = 0 for i in $game_system.vms_quests_add maker += 1 range = i if range["Quest_Name"] == name if $game_system.vms_quests_sta[maker-1] == Vms_Quests_Config::Complete_Text return true else return false end end end end endclass Vms_Quest_Book < Scene_Base def start super create_background create_quest_commands create_view_windows create_quest_windows update end def create_background if Vms_Quests_Config::Map_Background == true @background = Sprite.new @background.bitmap = SceneManager.background_bitmap end end def create_quest_commands @command = Vms_Quest_Book_Command.new @command.set_handler(:cancel, method(:vms_return)) end def create_view_windows @title = Vms_Window_Title_Quest.new @progress = Vms_Window_Progress_Quest.new @status = Vms_Window_Status_Quest.new end def create_quest_windows @window = Vms_Window_Book_Quest.new end def update super @window.refresh(@command.index) @status.refresh(@command.index) end def vms_go_to SceneManager.return end def vms_return SceneManager.return end def terminate super end endclass Vms_Quest_Book_Command < Window_Command include Vms_Quests_Addinclude Vms_Quests_Config def initialize super(0, 48) end def window_width return 200 end def window_height return 320 end def visible_line_number $game_system.vms_quests_add.compact.size end def make_command_list if $game_system.vms_quests_add.compact.size == 0 add_command(No_Quest_Text, nil) else for z in 0..$game_system.vms_quests_add.compact.size-1 range = $game_system.vms_quests_add.compact[z] add_command(range["Quest_Name"], nil) end end end def process_ok @@last_command_symbol = current_symbol super end def select_last select_symbol(@@last_command_symbol) end endclass Vms_Window_Book_Quest < Window_Base include Vms_Quests_Configinclude Vms_Quests_Add def initialize super(200, 48, 344, 368) refresh(0) end def refresh(id) self.contents.clear if $game_system.vms_quests_add.compact.size > 0 range = $game_system.vms_quests_add.compact[id] list = range self.contents.font.size = 22 change_color(Requeriment_Text_Color) draw_text(85, (line_height * 7) - 5, 150, line_height, Requeriment_Text,1) change_color(Prize_Color) draw_text(88, (line_height * 11) - 5, 150, line_height, Prize_Text,1) change_color(Quest_Name_Color) plus_icon = contents.text_size(list["Quest_Name"]).width x = (344 / 2) - (plus_icon / 2) - 6 draw_text(x, 0, 280, line_height, list["Quest_Name"]) draw_icon(list["Quest_Icon"], x - 28, -1) change_color(Local_Text_Color) l_text_w = contents.text_size(Local_Text).width draw_text(30, (line_height * 6) - 12, l_text_w+10, line_height, Local_Text) draw_icon(list["Local_Icon"], 0, (line_height * 6) - 12) self.contents.font.size = 18 change_color(normal_color) draw_text(l_text_w + 28, (line_height * 6) - 11, 150, line_height, list["Quest_Local"]) vqb = 0 for n in list["Quest_Text"] vqb += 1 place = contents.text_size(n).width draw_text(0, (line_height * vqb)+10, place+10, line_height, n) end r = 8 ; p = 12 line = space = 0 check = list["Required_Items"] market = check[0] if market[0] != "T" for i in check line += 1 if line == 3 space += 3 r += 1 end case i[0] when "I" object = $data_items[i[1]] when "A" object = $data_armors[i[1]] when "W" object = $data_weapons[i[1]] end if line == 1 or line == 3 make_icon(0,(line_height * r),object.icon_index,space) make_text(27,(line_height * r),object.name,space,i[2]) elsif line == 2 or line == 4 make_icon(162,(line_height * r),object.icon_index,space) make_text(189,(line_height * r),object.name,space,i[2]) end end else medit = contents.text_size(market[1]).width draw_text(0, (line_height*8) + 18, medit+10, line_height, market[1]) if list["Required_Variable"] != nil place_up = list["Required_Variable"] var = $game_variables[place_up[0]] ; var_tol = place_up[1] draw_text(medit+2,(line_height*8)+18,100,line_height,"("+"#{var}"+"/"+"#{var_tol}"+")") end end line = space = 0 for z in list["Quest_Prizes"] line += 1 if line == 3 space += 3 p += 1 end case z[0] when "I" object2 = $data_items[z[1]] when "A" object2 = $data_armors[z[1]] when "W" object2 = $data_weapons[z[1]] end if line == 1 or line == 3 if z[0] == "E" make_icon(0,(line_height * p),Experience_Icon,space) make_exp_text(27,(line_height * p),Experience_Text,space,z[1]) else make_icon(0,(line_height * p),object2.icon_index,space) make_text(27,(line_height * p),object2.name,space,z[2]) end elsif line == 2 or line == 4 if z[0] == "E" make_icon(162,(line_height * p),Experience_Icon,space) make_exp_text(189,(line_height * p),Experience_Text,space,z[1]) else make_icon(162,(line_height * p),object2.icon_index,space) make_text(189,(line_height * p),object2.name,space,z[2]) end end end ; end end def make_icon(x,y,obj,space) draw_icon(obj, x, y + space) end def make_text(x,y,obj,space,number) draw_text(x, y + space, 145, line_height+8, obj + " x " + "#{number}") end def make_exp_text(x,y,obj,space,number) change_color(Exp_Text_Color) width = contents.text_size(obj).width draw_text(x, y + space, width+10, line_height+8, obj) change_color(normal_color) w2 = contents.text_size("#{number}").width draw_text(x + width, y + space, w2+10, line_height+8, "#{number}") end endclass Scene_Map alias vms_quest_book_create_main main def main $game_system.vms_quests_add = [] if $game_system.vms_quests_add == nil $game_system.vms_quests_sta = [] if $game_system.vms_quests_sta == nil vms_quest_book_create_main end endclass Vms_Window_Title_Quest < Window_Base include Vms_Quests_Config def initialize super(200, 0, 344, 48) refresh end def refresh self.contents.clear change_color(Title_Color) width = contents.text_size(Title_Text).width x = (344 / 2) - (width / 2) - 12 draw_text(x, 0, width+10, line_height, Title_Text) end endclass Vms_Window_Status_Quest < Window_Base include Vms_Quests_Config def initialize super(0, 368, 200, 48) refresh(0) end def refresh(id) self.contents.clear self.contents.font.size = 20 change_color(Status_Text_Color) width = contents.text_size(Status_Text).width draw_text(0, 2, width+10, line_height, Status_Text) case $game_system.vms_quests_sta.compact[id] when Course_Text change_color(Course_Text_Color) when Complete_Text change_color(Complete_Text_Color) end if $game_system.vms_quests_add.compact.size == 0 change_color(normal_color) draw_text(width+10, 2, 160, line_height, No_Quest_Text) end draw_text(width+10, 2, 160, line_height, $game_system.vms_quests_sta.compact[id]) end endclass Vms_Window_Progress_Quest < Window_Base include Vms_Quests_Config def initialize super(0, 0, 200, 48) @percent = [] refresh end def refresh self.contents.clear width = contents.text_size(Progress_Text).width change_color(Progress_Text_Color) draw_text(0, 0, width+10, line_height, Progress_Text) total = $game_system.vms_quests_add.compact.size for i in $game_system.vms_quests_sta.compact @percent.push(1) if i == Complete_Text end change_color(normal_color) if total > 0 acount = @percent.size * 100 / total draw_text(13, 0, 160, line_height, "#{acount}" + "%",2) else draw_text(13, 0, 160, line_height, "0" + "%",2) end end end#==============================================================================## Fim das Modificações ##------------------------------------------------------------------------------#
#==============================================================================## VMS - Quest_List ##------------------------------------------------------------------------------## To : RMB By : DeadMaker Date : 12/06/2012 ##==============================================================================## ~Não poste ou modifique o script sem permissão~ ##------------------------------------------------------------------------------## Comandos : ##------------------------------------------------------------------------------## ## $game_system.add_new_quest(id da quest) #=> Adiciona nova quest ## ## $game_system.quest_complete(nome da quest) #=> Completa quest manualmente ## ## vms_check_quest(id da quest) #=> Dar premio da quest completa ## ## quest_has_complete?(nome da quest) #=> Apenas chechar se quest foi completa ## ##==============================================================================## Dúvidas ? Acesse : http://www.rpgmakerbrasil.net/forum/profile/?u=54 ##------------------------------------------------------------------------------## Me envie uma MP que ajudarei ;) ##==============================================================================#class Game_System attr_accessor :vms_quests_addattr_accessor :vms_quests_sta def add_new_quest(id) $game_system.vms_quests_add.push(Vms_Quests_Add::Quests_List[id]) $game_system.vms_quests_sta[id] = Vms_Quests_Config::Course_Text end def quest_complete(name) maker = 0 for i in $game_system.vms_quests_add maker += 1 range = i if range["Quest_Name"] == name $game_system.vms_quests_sta[maker-1] = Vms_Quests_Config::Complete_Text end end end def vms_quest_give_prize(id) quest_data = Vms_Quests_Add::Quests_List[id] quest_required = quest_data["Required_Items"] quest_gain = quest_data["Quest_Prizes"] for i in quest_gain case i[0] when "I" $game_party.gain_item($data_items[i[1]],i[2]) when "A" $game_party.gain_item($data_armors[i[1]],i[2]) when "W" $game_party.gain_item($data_weapons[i[1]],i[2]) when "E" $game_party.members[0].gain_exp(i[1]) end end for z in quest_required case z[0] when "I" $game_party.lose_item($data_items[z[1]],z[2]) when "A" $game_party.lose_item($data_armors[z[1]],z[2]) when "W" $game_party.lose_item($data_weapons[z[1]],z[2]) end end end endclass Game_Interpreter def vms_check_quest(id) make = id quest_data = Vms_Quests_Add::Quests_List[id] quest_required = quest_data["Required_Items"] quest_swtich = quest_data["Required_Switches"] quest_variable = quest_data["Required_Variable"] quest_name = quest_data["Quest_Name"] for i in quest_required case i[0] when "I" object = $data_items[i[1]] when "W" object = $data_weapons[i[1]] when "A" object = $data_armors[i[1]] when "T" object = "Text" end if object != "Text" if $game_party.has_item?(object,i[3]) $game_system.vms_quests_sta[id] = Vms_Quests_Config::Complete_Text else $game_system.vms_quests_sta[id] = Vms_Quests_Config::Course_Text end end end if quest_swtich != nil if $game_switches[quest_swtich] == true $game_system.vms_quests_sta[id] = Vms_Quests_Config::Complete_Text else $game_system.vms_quests_sta[id] = Vms_Quests_Config::Course_Text end end if quest_variable != nil if $game_variables[quest_variable[0]] >= quest_variable[1] $game_system.vms_quests_sta[id] = Vms_Quests_Config::Complete_Text else $game_system.vms_quests_sta[id] = Vms_Quests_Config::Course_Text end end if $game_system.vms_quests_sta[id] == Vms_Quests_Config::Complete_Text $game_system.vms_quest_give_prize(make) else return false end end def quest_has_complete?(name) maker = 0 for i in $game_system.vms_quests_add maker += 1 range = i if range["Quest_Name"] == name if $game_system.vms_quests_sta[maker-1] == Vms_Quests_Config::Complete_Text return true else return false end end end end endclass Vms_Quest_Book < Scene_Base def start super create_background create_quest_commands create_view_windows create_quest_windows update end def create_background if Vms_Quests_Config::Map_Background == true @background = Sprite.new @background.bitmap = SceneManager.background_bitmap end end def create_quest_commands @command = Vms_Quest_Book_Command.new @command.set_handler(:cancel, method(:vms_return)) end def create_view_windows @title = Vms_Window_Title_Quest.new @progress = Vms_Window_Progress_Quest.new @status = Vms_Window_Status_Quest.new end def create_quest_windows @window = Vms_Window_Book_Quest.new end def update super @window.refresh(@command.index) @status.refresh(@command.index) end def vms_go_to SceneManager.return end def vms_return SceneManager.return end def terminate super end endclass Vms_Quest_Book_Command < Window_Command include Vms_Quests_Addinclude Vms_Quests_Config def initialize super(0, 50) end def window_width return 200 end def window_height return 380 end def visible_line_number $game_system.vms_quests_add.compact.size end def make_command_list if $game_system.vms_quests_add.compact.size == 0 add_command(No_Quest_Text, nil) else for z in 0..$game_system.vms_quests_add.compact.size-1 range = $game_system.vms_quests_add.compact[z] add_command(range["Quest_Name"], nil) end end end def process_ok @@last_command_symbol = current_symbol super end def select_last select_symbol(@@last_command_symbol) end endclass Vms_Window_Book_Quest < Window_Base include Vms_Quests_Configinclude Vms_Quests_Add def initialize super(200, 50, 344, 430) refresh(0) end def refresh(id) self.contents.clear if $game_system.vms_quests_add.compact.size > 0 range = $game_system.vms_quests_add.compact[id] list = range self.contents.font.size = 22 change_color(Requeriment_Text_Color) draw_text(85, (line_height * 7) - 5, 150, line_height, Requeriment_Text,1) change_color(Prize_Color) draw_text(88, (line_height * 11) - 5, 150, line_height, Prize_Text,1) change_color(Quest_Name_Color) plus_icon = contents.text_size(list["Quest_Name"]).width x = (344 / 2) - (plus_icon / 2) - 6 draw_text(x, 0, 280, line_height, list["Quest_Name"]) draw_icon(list["Quest_Icon"], x - 28, -1) change_color(Local_Text_Color) l_text_w = contents.text_size(Local_Text).width draw_text(30, (line_height * 6) - 12, l_text_w+10, line_height, Local_Text) draw_icon(list["Local_Icon"], 0, (line_height * 6) - 12) self.contents.font.size = 18 change_color(normal_color) draw_text(l_text_w + 28, (line_height * 6) - 11, 150, line_height, list["Quest_Local"]) vqb = 0 for n in list["Quest_Text"] vqb += 1 place = contents.text_size(n).width draw_text(0, (line_height * vqb)+10, place+10, line_height, n) end r = 8 ; p = 12 line = space = 0 check = list["Required_Items"] market = check[0] if market[0] != "T" for i in check line += 1 if line == 3 space += 3 r += 1 end case i[0] when "I" object = $data_items[i[1]] when "A" object = $data_armors[i[1]] when "W" object = $data_weapons[i[1]] end if line == 1 or line == 3 make_icon(0,(line_height * r),object.icon_index,space) make_text(27,(line_height * r),object.name,space,i[2]) elsif line == 2 or line == 4 make_icon(162,(line_height * r),object.icon_index,space) make_text(189,(line_height * r),object.name,space,i[2]) end end else medit = contents.text_size(market[1]).width draw_text(0, (line_height*8) + 18, medit+10, line_height, market[1]) if list["Required_Variable"] != nil place_up = list["Required_Variable"] var = $game_variables[place_up[0]] ; var_tol = place_up[1] draw_text(medit+2,(line_height*8)+18,100,line_height,"("+"#{var}"+"/"+"#{var_tol}"+")") end end line = space = 0 for z in list["Quest_Prizes"] line += 1 if line == 3 space += 3 p += 1 end case z[0] when "I" object2 = $data_items[z[1]] when "A" object2 = $data_armors[z[1]] when "W" object2 = $data_weapons[z[1]] end if line == 1 or line == 3 if z[0] == "E" make_icon(0,(line_height * p),Experience_Icon,space) make_exp_text(27,(line_height * p),Experience_Text,space,z[1]) else make_icon(0,(line_height * p),object2.icon_index,space) make_text(27,(line_height * p),object2.name,space,z[2]) end elsif line == 2 or line == 4 if z[0] == "E" make_icon(162,(line_height * p),Experience_Icon,space) make_exp_text(189,(line_height * p),Experience_Text,space,z[1]) else make_icon(162,(line_height * p),object2.icon_index,space) make_text(189,(line_height * p),object2.name,space,z[2]) end end end ; end end def make_icon(x,y,obj,space) draw_icon(obj, x, y + space) end def make_text(x,y,obj,space,number) draw_text(x, y + space, 145, line_height+8, obj + " x " + "#{number}") end def make_exp_text(x,y,obj,space,number) change_color(Exp_Text_Color) width = contents.text_size(obj).width draw_text(x, y + space, width+10, line_height+8, obj) change_color(normal_color) w2 = contents.text_size("#{number}").width draw_text(x + width, y + space, w2+10, line_height+8, "#{number}") end endclass Scene_Map alias vms_quest_book_create_main main def main $game_system.vms_quests_add = [] if $game_system.vms_quests_add == nil $game_system.vms_quests_sta = [] if $game_system.vms_quests_sta == nil vms_quest_book_create_main end endclass Vms_Window_Title_Quest < Window_Base include Vms_Quests_Config def initialize super(200, 0, 440, 50) refresh end def refresh self.contents.clear change_color(Title_Color) width = contents.text_size(Title_Text).width x = (344 / 2) - (width / 2) - 12 draw_text(x, 0, width+10, line_height, Title_Text) end endclass Vms_Window_Status_Quest < Window_Base include Vms_Quests_Config def initialize super(0, 430, 200, 50) refresh(0) end def refresh(id) self.contents.clear self.contents.font.size = 20 change_color(Status_Text_Color) width = contents.text_size(Status_Text).width draw_text(0, 2, width+10, line_height, Status_Text) case $game_system.vms_quests_sta.compact[id] when Course_Text change_color(Course_Text_Color) when Complete_Text change_color(Complete_Text_Color) end if $game_system.vms_quests_add.compact.size == 0 change_color(normal_color) draw_text(width+10, 2, 160, line_height, No_Quest_Text) end draw_text(width+10, 2, 160, line_height, $game_system.vms_quests_sta.compact[id]) end endclass Vms_Window_Progress_Quest < Window_Base include Vms_Quests_Config def initialize super(0, 0, 200, 50) @percent = [] refresh end def refresh self.contents.clear width = contents.text_size(Progress_Text).width change_color(Progress_Text_Color) draw_text(0, 0, width+10, line_height, Progress_Text) total = $game_system.vms_quests_add.compact.size for i in $game_system.vms_quests_sta.compact @percent.push(1) if i == Complete_Text end change_color(normal_color) if total > 0 acount = @percent.size * 100 / total draw_text(13, 0, 160, line_height, "#{acount}" + "%",2) else draw_text(13, 0, 160, line_height, "0" + "%",2) end end end#==============================================================================## Fim das Modificações ##------------------------------------------------------------------------------#