Olá pessoal venho aqui trazer mais uma modificação que eu fiz nas janelas da quest e vou mostrar como ficou.
Script:
Troque sua [WIN] Lista de Quests por essa
e troque sua [WIN] Window_Quests por essa
AGRADECIMENTOS
RD12 - Por esclarecer uma duvida
- Spoiler:
Script:
Troque sua [WIN] Lista de Quests por essa
- Spoiler:
- Código:
#==============================================================================
# ** Lista de Quests
#------------------------------------------------------------------------------
# By Marlos Gama
#==============================================================================
class Quest_list < Window_Selectable2
attr_accessor :data2
def initialize
super(100,80,207,230)
self.x = x
self.y = y
self.width = width
self.height = height
self.index = index
self.back_opacity = 200
self.z = 99999
self.index = 0
@dragable = true
@closable = true
refresh
end
def item
return @data[self.index]
end
def update
super
refresh if @old_quests != @data
if Input.trigger?(Input::C)
if $game_switches[Configurar_Quests::MISSION_START[index+1][0]] == true
else
return
end
return if @data[index] == nil
$quest_w.refresh
$quest_w.visible = true
$quest_w.active = true
end
end
def on_close
self.visible = false
self.active = false
$fechando_ativar = true
end
def refresh
@old_quests = @data
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add item
for p in 0..(Configurar_Quests::MISSION_NAME.size-1)
mission = Configurar_Quests::MISSION_NAME[p]
#for s in 0..(Configurar_Quests::MISSION_START.size-1)
#return if s != p
#if $game_switches[s[0]] == true
@data.push(mission)
#end
#end
end
a = @data.index(p)
@data[a] = nil if a != nil
@data = @data.compact
@item_max = @data.size
# If item count is not 0, make a bit map and draw all items
if @data.size > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@data.size
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
return if index > 19
if $game_switches[Configurar_Quests::MISSION_START[index+1][0]] == true
self.contents.font.color = Color.new(0,128,0)
else
self.contents.font.color = Color.new(128,0,0)
item = "------------------"
end
x = 4
y = index * 20
rect = Rect.new(x, y-6, self.contents.width - 8, 32)
self.contents.draw_text(rect, item, 1)
end
end
e troque sua [WIN] Window_Quests por essa
- Spoiler:
- Código:
##==============================================================================
# ** Quests
#------------------------------------------------------------------------------
# By Marlos Gama
#------------------------------------------------------------------------------
# Máximo de 20 Missões, caso queira um número maior, configure no
# Script: [NET] Switch & Variables
#------------------------------------------------------------------------------
module Configurar_Quests
MISSION_NAME = []
MISSION_START = []
MISSION = []
#Nome das Missões
MISSION_NAME[1] = ["Baú Mágico"]
MISSION_NAME[2] = ["Mate o Monstro"]
#Switches que Começa as Missões
MISSION_START[1] = [14]
MISSION_START[2] = [16]
#Informações das Missões
# Informação, Item Requerido, Gráfico do Monstro, Quantidade de Monstros, Switche, level, Item que Ganha, grafico npc da quest
MISSION[1] = ["Fale com o NPC de Quests", 14, "090-Monster04", 1, 15, 1, 1, "003-fighter03"]
MISSION[2] = ["Algo Aqui", 29, "075-Devil01", 1, 17, 2, 4, "003-fighter03"]
end
class Window_Quests < Window_Base
def initialize
super(310,80,232,230)
self.contents = Bitmap.new(width - 32, height - 32)
@dragable = true
@closable = true
self.z = 999999
self.back_opacity = 200
refresh
end
def update
super
#refresh if something_changed?
end
#def mission
#return @mission
#end
#def set_mission(mission)
#@mission = mission
#refresh
#end
def on_close
self.visible = false
self.active = false
$fechando_ativar = true
end
def refresh
@actor = $game_party.actors[0]
self.contents.clear
#for quest in 0..(Configurar_Quests::MISSION.size-1)
#@name = Configurar_Quests::MISSION[quest]
#return if quest != $quest_list.index
@id = $quest_list.index+1
@name = Configurar_Quests::MISSION_NAME[@id][0]
@information = Configurar_Quests::MISSION[@id][1-1]
@requeriments = Configurar_Quests::MISSION[@id][2-1]
@monsters = Configurar_Quests::MISSION[@id][3-1]
@quantidade = Configurar_Quests::MISSION[@id][4-1]
@gain_item = Configurar_Quests::MISSION[@id][7-1]
@level = Configurar_Quests::MISSION[@id][6-1]
@andamento = Configurar_Quests::MISSION[@id][5-1]
@npc = Configurar_Quests::MISSION[@id][8-1]
# Nome
self.contents.font.color = Color.new(255,0,0)
self.contents.draw_text(70, 2, 262, 32, "Informações")
self.contents.font.color = Color.new(0,0,0)
# Informação
rect2 = Rect.new(4, 25, self.contents.width - 8, 32)
self.contents.draw_text(rect2, @information.to_s, 1)
# Requerimentos
self.contents.draw_text(0, 50, 262, 32, "Requerimentos: "+$data_items[@requeriments].name)
draw_item_name2($data_items[@requeriments], 90-3, 50)
# Nível
self.contents.draw_text(0, 70, 262, 32, "Nível: " +@level.to_s)
# Status
self.contents.draw_text(0, 160, 262, 32, "Quest: ")
if $game_switches[@andamento] == true #and $game_party.actors[0].level == @level or $game_party.actors[0].level >= @level
@status_quest = "Concluida"
self.contents.font.color = Color.new(0,128,0)
elsif $game_switches[@andamento] == false
self.contents.font.color = Color.new(255,0,0)
@status_quest = "Em andamento"
end
self.contents.draw_text(40, 160, 262, 32, @status_quest.to_s)
self.contents.font.color = normal_color
# Recompensa
self.contents.draw_text(0, 130, 262, 32, "Recompensa: "+$data_items[@gain_item].name)
draw_item_name2($data_items[@gain_item], 70, 130)
# Monstros
self.contents.draw_text(0, 100, 262, 32, "Monstros: " +@quantidade.to_s+"x")
bitmap = RPG::Cache.character(@monsters,0)
cw = bitmap.width / 4
ch = bitmap.height / 4
facing = 0
src_rect = Rect.new(0, facing * ch, cw, ch)
self.contents.blt(59, 100-15, bitmap, src_rect)
#end
# Npc
self.contents.draw_text(10, 0, 262, 32, "")
bitmap2 = RPG::Cache.character(@npc,0)
cw2 = bitmap2.width / 4
ch2 = bitmap2.height / 4
facing = 0
src_rect = Rect.new(0, facing * ch2, cw2, ch2)
self.contents.blt(0, 32-15, bitmap2, src_rect)
#end
end
def something_changed?
return true if @name != @name
return true if @information != @name
return true if @requeriments != @name
return true if @monsters != @name
return true if @gain_item != @name
return true if @level != @name
return true if @npc != @name
return false
end
end
AGRADECIMENTOS
RD12 - Por esclarecer uma duvida