module Quest
# Quest Names
Names = {1 => "Sera's Mirror",
2 => "Roger's Apple",
3 => "Sen's Diner Menu",
4 => "Todd's How To Hunt",
5 => "Sam's Suggestion",
6 => "Sam's Advice",
7 => "Mai's Training",
8 => "Mai's Final Training",
9 => "A Letter To Lucas",
10 => "Lucas' Reply",
11 => "Lucas' Cute Daughter",
12 => "Pio And The Recycling",
13 => "Bigg's Collection Of Items",
14 => "Here Little Piggy",
15 => "Rain's Maple Quiz",
16 => "To Lith Harbor",
17 => "A Lesson On Job Advancement",
18 => "The Path Of Warrior",
19 => "The Path Of Bowman",
20 => "The Path Of Thief",
21 => "The Path Of Magician",
22 => "Graham Cracked",
23 => "Nella's Dream",
24 => "Fanzy's Red Furball",
25 => "Icarus Is Bored",
26 => "Visiting Mr.Spot",
27 => "Beauty Or Beast",
28 => "Eurek The Alchemist",
29 => "Marr The Fairy",
30 => "I Need To Find My Daughter",
31 => "Interstellar Relics"}
end
#----Scene_Quests--------------------------------------------------------------
class Scene_Quests
def initialize(menu_index = 0)
@menu_index = menu_index
# * Update the number of quests you wish to have in the quest window here.
#@quests = 31
end
def main
# if @quests == 31
$cmd_window = Window_Command.new(205, Quest::Names.values)#[s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23, s24, s25, s26, s27, s28, s29, s30, s31])
# end
$cmd_window.index = @menu_index
$cmd_window.y = 50
$cmd_window.height = 420
$cmd_window.width = 230
$cmd_window.opacity = 0
$cmd_window.back_opacity = 0
$cmd_window.contents.font.color = Color.new(0, 0, 0, 255)
@quest_bck = Sprite.new
@quest_bck.bitmap = RPG::Cache.picture("Quest/Quest.bck")
@quest_bck.x = 0
@quest_bck.y = 0
@quests_status = Window_QuestsStatus.new
@quests_window = Window_Quests.new
@reward_window = Window_Reward.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
$cmd_window.dispose
@quests_status.dispose
@quests_window.dispose
@reward_window.dispose
@quest_bck.dispose
@quest_bck.bitmap.dispose
end
def update
@quests_window.update
@quests_status.update
@reward_window.update
$cmd_window.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
end
end
#----Window_QuestsStatus-------------------------------------------------------
class Window_QuestsStatus < Window_Base
def initialize
super(250, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 10
self.contents.font.bold = true
self.opacity = 0
self.back_opacity = 0
update_commands
end
def update
if $cmd_window.active
self.contents.clear
update_commands
return
end
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@names.dispose
end
def update_commands
#case $cmd_window.index
#when 0
@names = Quest::Names[$cmd_window.index + 1]
refresh
return
end
def refresh
self.contents.font.color = system_color
self.contents.draw_text(25, -181, 640, 480, @names.to_s)
end
end
class Window_Quests < Window_Selectable
def initialize
super(250, 60, 410, 340)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 10
self.contents.font.bold = false
self.opacity = 0
self.back_opacity = 0
@switch1 = Quest::Start_Switch[1]
@switch2 = Quest::End_Switch[1]
@actor = $game_party.actors[0]
@lvreq = 1
refresh
end
def update
if $cmd_window.active
self.contents.clear
update_commands
return
end
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@info.dispose
@info2.dispose
@info3.dispose
@info4.dispose
@info5.dispose
@info6.dispose
@info7.dispose
@lvreq.dispose
@switch1.dispose
@switch2.dispose
@start.dispose
@status.dispose
@status.bitmap.dispose
end
def update_commands
@info = Quest::Info[$cmd_window.index + 1]
@info2 = Quest::Info2[$cmd_window.index + 1]
@info3 = Quest::Info3[$cmd_window.index + 1]
@info4 = Quest::Info4[$cmd_window.index + 1]
@info5 = Quest::Info5[$cmd_window.index + 1]
@info6 = Quest::Info6[$cmd_window.index + 1]
@info7 = Quest::Info7[$cmd_window.index + 1]
@lvreq = Quest::Lvreq[$cmd_window.index + 1]
@start = Quest::Start[$cmd_window.index + 1]
@switch1 = Quest::Start_Switch[$cmd_window.index + 1]
@switch2 = Quest::End_Switch[$cmd_window.index + 1]
refresh
end
def refresh
self.contents.font.bold = true
self.contents.font.color = system_color
self.contents.draw_text(10, 30, 320, 32, "Quest Description :")
self.contents.font.bold = false
self.contents.font.color = Color.new(0, 0, 0, 255)
if $game_switches[@switch1] == false
self.contents.draw_text(10, 52, 500, 32, @info.to_s)
self.contents.draw_text(10, 74, 500, 32, @info2.to_s)
elsif $game_switches[@switch1] == true and $game_switches[@switch2] == false
self.contents.draw_text(10, 52, 500, 32, @info3.to_s)
self.contents.draw_text(10, 74, 500, 32, @info4.to_s)
self.contents.draw_text(10, 96, 500, 32, @info5.to_s)
elsif $game_switches[@switch2] == true
self.contents.draw_text(10, 52, 500, 32, @info6.to_s)
self.contents.draw_text(10, 74, 500, 32, @info7.to_s)
end
self.contents.font.bold = true
self.contents.font.color = system_color
self.contents.draw_text(10, 126, 320, 32, "Starting Location :")
self.contents.font.bold = false
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(10, 148, 500, 32, @start.to_s)
self.contents.font.bold = true
self.contents.font.color = system_color
self.contents.draw_text(10, 178, 320, 32,"Quest Status :")
self.contents.draw_text(10, 220, 320, 32,"Level Requirement :")
self.contents.font.bold = false
self.contents.font.color = Color.new(0, 0, 0, 255)
if @lvreq == 1
self.contents.draw_text(10, 245, 320, 32,"There is no level requirement for this quest.")
else
if @lvreq > 99
bitmap = RPG::Cache.icon("Level - (#{@lvreq})")
self.contents.blt(107, 272, bitmap, Rect.new(0, 0, 100, 100))
self.contents.draw_text(10, 245, 320, 32,"You have to be level")
self.contents.draw_text(145, 245, 320, 32,"or higher to do this quest.")
elsif @lvreq > 9
bitmap = RPG::Cache.icon("Level - (#{@lvreq})")
self.contents.blt(107, 272, bitmap, Rect.new(0, 0, 100, 100))
self.contents.draw_text(10, 245, 320, 32,"You have to be level")
self.contents.draw_text(135, 245, 320, 32,"or higher to do this quest.")
else
bitmap = RPG::Cache.icon("Level - (#{@lvreq})")
self.contents.blt(107, 272, bitmap, Rect.new(0, 0, 100, 100))
self.contents.draw_text(10, 245, 320, 32,"You have to be level")
self.contents.draw_text(125, 245, 320, 32,"or higher to do this quest.")
end
end
if $game_switches[@switch1] == false
self.contents.draw_text(10, 200, 320, 32, "This quest is not started yet.")
elsif $game_switches[@switch1] == true and $game_switches[@switch2] == false
self.contents.draw_text(10, 200, 320, 32, "This quest is currently in progress.")
elsif $game_switches[@switch2] == true
self.contents.draw_text(10, 200, 320, 32, "This quest has been completed.")
end
end
end
#----Window_Reward-------------------------------------------------------------
class Window_Reward < Window_Base
def initialize
super(250, 400, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 10
self.contents.font.bold = false
self.opacity = 0
self.back_opacity = 0
@reward = Quest::Reward[1]
@switch2 = Quest::End_Switch[1]
update_commands
end
def update
if $cmd_window.active
self.contents.clear
update_commands
return
end
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@reward.dispose
end
def update_commands
#case $cmd_window.index
#when 0
@reward = Quest::Reward[$cmd_window.index + 1]
@switch2 = Quest::End_Switch[$cmd_window.index + 1]
refresh
return
end
def refresh
if $game_switches[@switch2] == false
self.contents.font.bold = true
self.contents.font.color = system_color
self.contents.draw_text(-0, -0, 640, 480, "Reward :")
self.contents.font.bold = false
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(-0, -0, 640, 480, @reward.to_s)
elsif if $game_switches[@switch2] == true
self.contents.font.bold = true
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 640, 480, "Reward :")
self.contents.font.bold = false
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(0, 0, 640, 480, @reward.to_s)
end
end
end
end