- Joined
- Mar 28, 2014
- Messages
- 62
- Reaction score
- 23
- First Language
- English
- Primarily Uses
Latest Working Build (With Event Switches)
UPDATE: Thread has been solved and can be closed
#===============================================================================
# ViperX420's Guild Menu updated: 04/02/2014
# author: Venka
#------------------------------------------------------------------------------
# - Introduction -
#------------------------------------------------------------------------------
# This script allows you to keep track of your guilds.
# I've tried to use comments so you know what I'm doing.
#
# This script works best when using KilloZapit's Word Wrapping script found
# at http://www.rpgmakervxace.net/topic/6964-word-wrapping-message-boxes/
#===============================================================================
module Venka
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Font Settings -
#----------------------------------------------------------------------------
# Font_Name - can be an array of font names. ex ["Arial", "Coper Std"]
# Size - Font size
# Color - Can be [Red, Green, Blue, Alpha] -or- a window skin code
# Bold/Outline/Shadow - true/false for each
# Font = [["Font_Name"], Size, Color, Bold, Outline, Shadow]
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Header_Font = [["After_Disaster"], 35, [255, 255, 255], false, true, false]
Font = [["After_Disaster"], 17, [255, 255, 255], false, true, false]
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Windowskin Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Windowskin = "SAOWindow" # Custom windowskin. Can set to nil for none
Back_Opacity = 255 # Sets the back opacity
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Guild Settings -
#----------------------------------------------------------------------------
Guild_Info ||= {} # <- DO NOT REMOVE THIS LINE
# Guild_Info[iD] = { ID - unique ID (numbers can't repeat)
# :name => "Guild_Name" Set Guild's Name for display
# :leader => "NPC_Name" Set the Guild Leader's name
#
icture => "filename" pic's filename in Graphics/Picture
# :switch => switch_id Switch ID for when guild is activated
# :description => "" Guild's description text
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Guild_Info[1] = {
:name => "Moonlit Black Cats",
:leader => "Keita",
icture => "SAOFace1",
:switch => 77,
:description => "Moonlit Black Cats was a mid-level guild with relatively few members, although all of them, except for Kirito, knew each other offline as the guild was formed from the members of a school's computer club.",
} # <- DO NOT REMOVE
Guild_Info[2] = {
:name => "Furrinkazan",
:leader => "Klein",
icture => "SAOFace2",
:switch => 78,
:description => "The Fuurinkazan is a guild started by Klein and a group of his friends from the real world. They had waited in line for a long time in order for each of them to obtain one of the 10,000 copies of the game. All of the members of Fuurinkazen have known each other since before SAO started. Klein had protected and guided all of them, until all of them had become well-capable players on the front-lines.",
} # <- DO NOT REMOVE
Guild_Info[3] = {
:name => "Divine Dragon Alliance",
:leader => "Schmitt",
icture => "SAOFace3",
:switch => 79,
:description => "They were known as one of the top clearing guilds in the death game, and often did anything to expand their power. Klein once stated that they would do almost everything to obtain rare items, even becoming orange to be the ones to attack a Flag Mob.[1] For example, they attempted to follow Klein to obtain the Divine Stone of Returning Soul rare drop from the Christmas event boss Nicholas The Renegade, but were held off by the Fuurinkazan. They also insist on having the Last Attack on the boss during Floor clearing boss fights.",
} # <- DO NOT REMOVE
Guild_Info[4] = {
:name => "Titan's Hand",
:leader => "Rosalia",
icture => "SAOFace4",
:switch => 80,
:description => "The leader of the orange guild was Rosalia, a green player who lured other players to areas where she had stationed members of the guild. After the players were lured into a trap, her guild would attack and loot them. If the victim did not have any items or money worth taking, the guild members would even resort to killing the players.",
} # <- DO NOT REMOVE
Guild_Info[5] = {
:name => "Laughing Coffin",
:leader => "PoH",
icture => "SAOFace5",
:switch => 81,
:description => "The Laughing Coffin is a guild started by PoH and other orange players. Before the foundation, they were simply orange players that surrounded solo players or small player groups they ambushed to steal their items in exchange for their lives, however, such encounters did not result in murder. At some point, PoH started spreading the belief that it was all right to kill others. As the orange players admired PoH for the opposite reason that the clearers admired Heathcliff, more orange members joined their ranks.",
} # <- DO NOT REMOVE
Guild_Info[6] = {
:name => "Knights of the Blood Oath",
:leader => "Heatcliff",
icture => "SAOFace6",
:switch => 82,
:description => "The need for a new guild leading the battle and motivating the players on the front arose and the Knights of the Blood were formed, with its leader, Heathcliff, personally inviting the first members. Proudly marching in at the time of the first field boss strategy meeting on the 26th floor with customized white and red equipment with Asuna, the second in command, standing at the head of the group, the newly-formed guild greatly increased the morale of the clearing group and has stood at the front lines ever since.",
} # <- DO NOT REMOVE
Guild_Info[7] = {
:name => "Aincrad Liberation Force",
:leader => "Thinker",
icture => "SAOFace7",
:switch => 83,
:description => "Initially, the main goal of the ALS was to clear the game, while the goal of MTD was to spread information and resources equally among as many players as possible, but, after the merge of the two guilds, the congregation which later became ALF was formed and turned into an organization for maintaining order among players. They were nicknamed 'The Army' after they began to wear armored uniforms.",
} # <- DO NOT REMOVE
Guild_Info[8] = {
:name => "Silver Flags",
:leader => "Unknown",
icture => "SAOFace8",
:switch => 84,
:description => "The guild is briefly mentioned when Kirito told Rosalia that he had been asked by the guild's leader, and the sole survivor of her guild's attack on the «Silver Flags», to send «Titan's Hand» to the Black Iron Palace's prison with a corridor crystal that the leader had spent all his money to buy to avenge his fallen guild.",
} # <- DO NOT REMOVE
Guild_Info[9] = {
:name => "Golden Apple",
:leader => "Griselda",
icture => "SAOFace9",
:switch => 85,
:description => "The members of Golden Apple had a dispute over a certain ring drop that the group had found while hunting down a powerful monster in a dungeon. The ring gave additional statistics to the holder, +20 Agility and Strength. They end up selling the ring, since only three members wanted to keep it. Griselda goes to the front lines to get the ring appraised, however she never returns. The rest of the guild eventually learn that she died. After that, the guild disbanded due to disagreements.",
} # <- DO NOT REMOVE
end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
#----------------------------------------------------------------------------
# ○ new method: set_font - quick way to set font in other windows
#----------------------------------------------------------------------------
def set_font(name, size, color, bold, outline, shadow)
contents.font.name = name
contents.font.size = size
# This checks if the color is an array (r,g,b,a) color
if color.is_a?(Array)
contents.font.color.set(*color)
else
# if color isn't an array, then it should be an interger (or you'll get
# an error message at this point). This will read the interger as a
# windowskin color code. The number can range from 0 to 31
contents.font.color = text_color(color)
end
contents.font.bold = bold
contents.font.outline = outline
contents.font.shadow = shadow
end
end
#==============================================================================
# ** SAO_Guild_Header - This window just draws the guild scene header text
#==============================================================================
class SAO_Guild_Header < Window_Base
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
# Sets the windowskin defined in customize, unless it's set to nil
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
# Sets the windowskin transparency
self.back_opacity = Venka::Back_Opacity
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: set_text - text show for the window
#----------------------------------------------------------------------------
def set_text(text)
# This will clear any text that was previously drawn (not really needed here
# but it's good practice to clear stuff before making new stuff show up
contents.clear
# use the method created earlier to set all the font settings at once
set_font(*Venka::Header_Font)
# draw the text string set in the Scene_Guilds when this window is created
draw_text(0, 0, contents.width, contents.height, text, 1)
end
end
#==============================================================================
# ** GuildLists_Window - window that lists the guilds
#==============================================================================
class GuildLists_Window < Window_Selectable
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize(y)
active_guilds # Gets info on unlocked guilds
super(Graphics.width * 0.4, y, Graphics.width * 0.6, Graphics.height - 72)
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
self.back_opacity = Venka::Back_Opacity
select(0) # select the first item in the list
activate # activate this window when it's created in the scene
refresh # refresh the contents shown
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Gets the item_max by the number of active guilds
def item_max; @guild_list.size; end
# Get the height based off the font's size
def item_height; Venka::Font[1]; end
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: active_guilds
#----------------------------------------------------------------------------
def active_guilds
@guild_list = []
# Pulls the Guild Information
guilds = Venka::Guild_Info
# Cycle through the Guild info
guilds.each do |guild|
# Skip any guilds that haven't been activated via a switch
next unless $game_switches[guild[1][:switch]]
# Adds the guild's id to the list if it's been activated
@guild_list << guild[0]
end
end
#----------------------------------------------------------------------------
# ● upgraded method: draw_item
#----------------------------------------------------------------------------
def draw_item(index)
return unless @guild_list.size > 0 # exit this method if the list is empty
set_font(*Venka::Font) # set the font style
# Use the @guild_list to look up active guild info
guild = Venka::Guild_Info[@guild_list[index]]
# define the area that each guild's name will be drawn
rect = item_rect(index)
# set the text to display a list number followed by the guild's name
text = "#{index + 1}. #{guild[:name]}"
# draws the text
draw_text(rect.x + 2, rect.y, rect.width, rect.height, text)
end
end
#==============================================================================
# ** Guild_Name_Window
#==============================================================================
class Guild_Name_Window < Window_Base
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
self.back_opacity = Venka::Back_Opacity
hide # hide this window (will show it later on)
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: guild_info
#----------------------------------------------------------------------------
def guild_info=(guild_info)
# sets the guild info used in this window, only do it if the info has changed
return if @guild_info == guild_info
@guild_info = guild_info
# refresh the information shown
refresh
end
#----------------------------------------------------------------------------
# ○ new method: refresh
#----------------------------------------------------------------------------
def refresh
contents.clear
set_font(*Venka::Header_Font)
# exit out of this method no guilds are active
return unless @guild_info
# Figure's the text string depending on the windows y axis
# If it's the first window it shows the guilds name, if it's the lower
# window, then it shows the guild leader's name
text = self.y == 0 ? @guild_info[:name] : "Leader: #{@guild_info[:leader]}"
draw_text(0, 0, contents.width, contents.height, text)
end
end
#==============================================================================
# ** Guild_Pic_Window
#==============================================================================
class Guild_Pic_Window < Window_Selectable
# Notice this window is based off of Window_Selectable and not Window_Base
# like the others. This is so that one of the guild information windows
# can be active and make use of the set_handler method.
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
self.back_opacity = Venka::Back_Opacity
hide
unselect # use unselect because we don't need a cursor for this window
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: guild_info
#----------------------------------------------------------------------------
def guild_info=(guild_info)
# This is basically the same as the guild_info= method defined in the
# previous window but calling the draw_picture method instead of refresh
return if @guild_info == guild_info
@guild_info = guild_info
draw_picture(@guild_info[
icture])
end
#----------------------------------------------------------------------------
# ○ new method: draw_picture
#----------------------------------------------------------------------------
def draw_picture(filename)
# sets the bitmap to the picture in the Graphics/Picture folder. You can
# change the folder directory if you want to and feel confident doing so.
bitmap = Cache.picture(filename)
# sets the rectangle size to select the image. Starting at pixel 0, 0 and
# going to the width and height of the picture. You can change this to
# select only parts of the picture. Play with the number if you feel like it
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
# calculations to make the image centered in the window
x = (contents.width - bitmap.width) / 2
y = (contents.height - bitmap.height) / 2
# this is the method to actual place the image in the window it basically
# says to draw the image (bitmap) shown within the rect(rectangle) at x, y
contents.blt(x, y, bitmap, rect)
# now that the image is drawn, we can throw it away (it's fine.. really)
bitmap.dispose
end
end
#==============================================================================
# ** Guild_Description_Window
#==============================================================================
class Guild_Description_Window < Window_Base
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize
y = Graphics.height - fitting_height(7)
super(0, y, Graphics.width, fitting_height(7))
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
self.back_opacity = Venka::Back_Opacity
hide
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: guild_info
#----------------------------------------------------------------------------
def guild_info=(guild_info)
return if @guild_info == guild_info
@guild_info = guild_info
refresh
end
#----------------------------------------------------------------------------
# ● upgraded method: draw_text_ex
#----------------------------------------------------------------------------
# took out the reset font settings for custom text
def draw_text_ex(x, y, text)
text = convert_escape_characters(text)
pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
process_character(text.slice!(0, 1), text, pos) until text.empty?
end
#----------------------------------------------------------------------------
# ○ new method: refresh
#----------------------------------------------------------------------------
def refresh
contents.clear
set_font(*Venka::Font)
return unless @guild_info
# this is the method that will be effected by KilloZapit's word wrapper
# as well as any other window that uses this method. So read that script
# for information on how to set it up best for your needs.
draw_text_ex(0, 0, @guild_info[:description])
end
end
#==============================================================================
# ** Scene_Guilds
#==============================================================================
class Scene_Guilds < Scene_MenuBase
#----------------------------------------------------------------------------
# ● upgraded method: start - builds on Scene_MenuBase's start method
#----------------------------------------------------------------------------
def start
super
# this is the same method that we defined earlier but it needs to be made
# here as well. Calling at the start of the scene since we need the info
active_guilds
create_header_window
create_guild_list_window
create_guild_info_windows
create_guild_description
end
#----------------------------------------------------------------------------
# ○ new method: active_guilds
#----------------------------------------------------------------------------
def active_guilds
@guild_list = []
guilds = Venka::Guild_Info
guilds.each do |guild|
next unless $game_switches[guild[1][:switch]]
@guild_list << guild[0]
end
end
#----------------------------------------------------------------------------
# ○ new method: create_header_window
#----------------------------------------------------------------------------
def create_header_window
# Create the header window for the scene
@guild_info = SAO_Guild_Header.new(48, 0, Graphics.width - 48, 72)
# sets the text the window displays
@guild_info.set_text("Guild Information Database")
# sets the viewport the window will be created in. If you forget to set the
# viewport, it's not the end of the world.
@guild_info.viewport = @viewport
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_list_window
#----------------------------------------------------------------------------
def create_guild_list_window
# creates the list window with the guild's names. just need to set y position
@guild_list_window = GuildLists_Window.new(@guild_info.height)
@guild_list_window.viewport = @viewport
# setting what happends when keys are pressed. Ok is when the action key is
# used. It will call the method show_guild_info. Cancel is esc key.
@guild_list_window.set_handler
ok, method
show_guild_info))
@guild_list_window.set_handler
cancel, method
return_scene))
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_info_windows
#----------------------------------------------------------------------------
def create_guild_info_windows
x = Graphics.width - 160
@face_window = Guild_Pic_Window.new(x, 0, 160, 144)
@face_window.viewport = @viewport
@face_window.set_handler
cancel, method
return_to_list))
# set handeling when page up/down used.
@face_window.set_handler
pagedown, method
next_guild))
@face_window.set_handler
pageup, method
prev_guild))
@guild_info_windows = Array.new(2) do |i|
Guild_Name_Window.new(0, i * 72, Graphics.width - 160, 72)
end
@guild_info_windows.each {|window| window.viewport = @viewport}
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_description
#----------------------------------------------------------------------------
def create_guild_description
@description_window = Guild_Description_Window.new
@description_window.viewport = @viewport
end
#----------------------------------------------------------------------------
# ○ new method: show_guild_info
#----------------------------------------------------------------------------
def show_guild_info
# setting up an index to use for the guild information windows. Set the
# index when the guild info windows are shown so it updates to the
# current list's index
@index = @guild_list_window.index
# this says forget about this method and return to the list window if
# there are no active guilds to display
return return_to_list unless @guild_list.size > 0
# hide the main windows when the info windows are shown/called
@guild_info.hide
@guild_list_window.hide
update_guild_info # refresh info displayed
# activate the pic window so we can control it and the other windows
@face_window.activate
end
#----------------------------------------------------------------------------
# ○ new method: update_guild_info
#----------------------------------------------------------------------------
def update_guild_info
# uses the @index we set up earlier to determine the information shown
# if you use the consol while play testing you'll see some info printed there
print "@guild_list: "; p @guild_list
print "@index: "; p @index
# @guild_list is the list we made with the active_guilds method. It shows
# the guild ID's that are currently activated. @index will be the the
# postion we are in on that list (starts with 0 and works it's way up)
# feel free to delete those two print command lines when you're done
# playing with them.
info = Venka::Guild_Info[@guild_list[@index]]
# the following windows will update their info to the new guild information
@face_window.guild_info=(info)
@face_window.show
@guild_info_windows.each {|window| window.guild_info=(info); window.show}
@description_window.guild_info=(info)
@description_window.show
# we remind the scene that the picture window is still the active window
@face_window.activate
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_info_windows
#----------------------------------------------------------------------------
def next_guild
# we add one to the @index unless we reach the last item, then it starts over
@index = (@index + 1) % @guild_list.size
update_guild_info # refreshes the info displayed
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_info_windows
#----------------------------------------------------------------------------
def prev_guild
# lowers the index number or jumps to the end of the list if needed
@index = (@index + @guild_list.size - 1) % @guild_list.size
update_guild_info
end
#----------------------------------------------------------------------------
# ○ new method: return_to_list
#----------------------------------------------------------------------------
def return_to_list
# return to the main windows and hide all the info windows
@guild_info.show
@guild_list_window.show.activate
@face_window.hide
@description_window.hide
@guild_info_windows.each {|window| window.hide}
end
end
# ViperX420's Guild Menu updated: 04/02/2014
# author: Venka
#------------------------------------------------------------------------------
# - Introduction -
#------------------------------------------------------------------------------
# This script allows you to keep track of your guilds.
# I've tried to use comments so you know what I'm doing.
#
# This script works best when using KilloZapit's Word Wrapping script found
# at http://www.rpgmakervxace.net/topic/6964-word-wrapping-message-boxes/
#===============================================================================
module Venka
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Font Settings -
#----------------------------------------------------------------------------
# Font_Name - can be an array of font names. ex ["Arial", "Coper Std"]
# Size - Font size
# Color - Can be [Red, Green, Blue, Alpha] -or- a window skin code
# Bold/Outline/Shadow - true/false for each
# Font = [["Font_Name"], Size, Color, Bold, Outline, Shadow]
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Header_Font = [["After_Disaster"], 35, [255, 255, 255], false, true, false]
Font = [["After_Disaster"], 17, [255, 255, 255], false, true, false]
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Windowskin Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Windowskin = "SAOWindow" # Custom windowskin. Can set to nil for none
Back_Opacity = 255 # Sets the back opacity
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Guild Settings -
#----------------------------------------------------------------------------
Guild_Info ||= {} # <- DO NOT REMOVE THIS LINE
# Guild_Info[iD] = { ID - unique ID (numbers can't repeat)
# :name => "Guild_Name" Set Guild's Name for display
# :leader => "NPC_Name" Set the Guild Leader's name
#
# :switch => switch_id Switch ID for when guild is activated
# :description => "" Guild's description text
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Guild_Info[1] = {
:name => "Moonlit Black Cats",
:leader => "Keita",
:switch => 77,
:description => "Moonlit Black Cats was a mid-level guild with relatively few members, although all of them, except for Kirito, knew each other offline as the guild was formed from the members of a school's computer club.",
} # <- DO NOT REMOVE
Guild_Info[2] = {
:name => "Furrinkazan",
:leader => "Klein",
:switch => 78,
:description => "The Fuurinkazan is a guild started by Klein and a group of his friends from the real world. They had waited in line for a long time in order for each of them to obtain one of the 10,000 copies of the game. All of the members of Fuurinkazen have known each other since before SAO started. Klein had protected and guided all of them, until all of them had become well-capable players on the front-lines.",
} # <- DO NOT REMOVE
Guild_Info[3] = {
:name => "Divine Dragon Alliance",
:leader => "Schmitt",
:switch => 79,
:description => "They were known as one of the top clearing guilds in the death game, and often did anything to expand their power. Klein once stated that they would do almost everything to obtain rare items, even becoming orange to be the ones to attack a Flag Mob.[1] For example, they attempted to follow Klein to obtain the Divine Stone of Returning Soul rare drop from the Christmas event boss Nicholas The Renegade, but were held off by the Fuurinkazan. They also insist on having the Last Attack on the boss during Floor clearing boss fights.",
} # <- DO NOT REMOVE
Guild_Info[4] = {
:name => "Titan's Hand",
:leader => "Rosalia",
:switch => 80,
:description => "The leader of the orange guild was Rosalia, a green player who lured other players to areas where she had stationed members of the guild. After the players were lured into a trap, her guild would attack and loot them. If the victim did not have any items or money worth taking, the guild members would even resort to killing the players.",
} # <- DO NOT REMOVE
Guild_Info[5] = {
:name => "Laughing Coffin",
:leader => "PoH",
:switch => 81,
:description => "The Laughing Coffin is a guild started by PoH and other orange players. Before the foundation, they were simply orange players that surrounded solo players or small player groups they ambushed to steal their items in exchange for their lives, however, such encounters did not result in murder. At some point, PoH started spreading the belief that it was all right to kill others. As the orange players admired PoH for the opposite reason that the clearers admired Heathcliff, more orange members joined their ranks.",
} # <- DO NOT REMOVE
Guild_Info[6] = {
:name => "Knights of the Blood Oath",
:leader => "Heatcliff",
:switch => 82,
:description => "The need for a new guild leading the battle and motivating the players on the front arose and the Knights of the Blood were formed, with its leader, Heathcliff, personally inviting the first members. Proudly marching in at the time of the first field boss strategy meeting on the 26th floor with customized white and red equipment with Asuna, the second in command, standing at the head of the group, the newly-formed guild greatly increased the morale of the clearing group and has stood at the front lines ever since.",
} # <- DO NOT REMOVE
Guild_Info[7] = {
:name => "Aincrad Liberation Force",
:leader => "Thinker",
:switch => 83,
:description => "Initially, the main goal of the ALS was to clear the game, while the goal of MTD was to spread information and resources equally among as many players as possible, but, after the merge of the two guilds, the congregation which later became ALF was formed and turned into an organization for maintaining order among players. They were nicknamed 'The Army' after they began to wear armored uniforms.",
} # <- DO NOT REMOVE
Guild_Info[8] = {
:name => "Silver Flags",
:leader => "Unknown",
:switch => 84,
:description => "The guild is briefly mentioned when Kirito told Rosalia that he had been asked by the guild's leader, and the sole survivor of her guild's attack on the «Silver Flags», to send «Titan's Hand» to the Black Iron Palace's prison with a corridor crystal that the leader had spent all his money to buy to avenge his fallen guild.",
} # <- DO NOT REMOVE
Guild_Info[9] = {
:name => "Golden Apple",
:leader => "Griselda",
:switch => 85,
:description => "The members of Golden Apple had a dispute over a certain ring drop that the group had found while hunting down a powerful monster in a dungeon. The ring gave additional statistics to the holder, +20 Agility and Strength. They end up selling the ring, since only three members wanted to keep it. Griselda goes to the front lines to get the ring appraised, however she never returns. The rest of the guild eventually learn that she died. After that, the guild disbanded due to disagreements.",
} # <- DO NOT REMOVE
end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
#----------------------------------------------------------------------------
# ○ new method: set_font - quick way to set font in other windows
#----------------------------------------------------------------------------
def set_font(name, size, color, bold, outline, shadow)
contents.font.name = name
contents.font.size = size
# This checks if the color is an array (r,g,b,a) color
if color.is_a?(Array)
contents.font.color.set(*color)
else
# if color isn't an array, then it should be an interger (or you'll get
# an error message at this point). This will read the interger as a
# windowskin color code. The number can range from 0 to 31
contents.font.color = text_color(color)
end
contents.font.bold = bold
contents.font.outline = outline
contents.font.shadow = shadow
end
end
#==============================================================================
# ** SAO_Guild_Header - This window just draws the guild scene header text
#==============================================================================
class SAO_Guild_Header < Window_Base
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
# Sets the windowskin defined in customize, unless it's set to nil
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
# Sets the windowskin transparency
self.back_opacity = Venka::Back_Opacity
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: set_text - text show for the window
#----------------------------------------------------------------------------
def set_text(text)
# This will clear any text that was previously drawn (not really needed here
# but it's good practice to clear stuff before making new stuff show up
contents.clear
# use the method created earlier to set all the font settings at once
set_font(*Venka::Header_Font)
# draw the text string set in the Scene_Guilds when this window is created
draw_text(0, 0, contents.width, contents.height, text, 1)
end
end
#==============================================================================
# ** GuildLists_Window - window that lists the guilds
#==============================================================================
class GuildLists_Window < Window_Selectable
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize(y)
active_guilds # Gets info on unlocked guilds
super(Graphics.width * 0.4, y, Graphics.width * 0.6, Graphics.height - 72)
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
self.back_opacity = Venka::Back_Opacity
select(0) # select the first item in the list
activate # activate this window when it's created in the scene
refresh # refresh the contents shown
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Gets the item_max by the number of active guilds
def item_max; @guild_list.size; end
# Get the height based off the font's size
def item_height; Venka::Font[1]; end
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: active_guilds
#----------------------------------------------------------------------------
def active_guilds
@guild_list = []
# Pulls the Guild Information
guilds = Venka::Guild_Info
# Cycle through the Guild info
guilds.each do |guild|
# Skip any guilds that haven't been activated via a switch
next unless $game_switches[guild[1][:switch]]
# Adds the guild's id to the list if it's been activated
@guild_list << guild[0]
end
end
#----------------------------------------------------------------------------
# ● upgraded method: draw_item
#----------------------------------------------------------------------------
def draw_item(index)
return unless @guild_list.size > 0 # exit this method if the list is empty
set_font(*Venka::Font) # set the font style
# Use the @guild_list to look up active guild info
guild = Venka::Guild_Info[@guild_list[index]]
# define the area that each guild's name will be drawn
rect = item_rect(index)
# set the text to display a list number followed by the guild's name
text = "#{index + 1}. #{guild[:name]}"
# draws the text
draw_text(rect.x + 2, rect.y, rect.width, rect.height, text)
end
end
#==============================================================================
# ** Guild_Name_Window
#==============================================================================
class Guild_Name_Window < Window_Base
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
self.back_opacity = Venka::Back_Opacity
hide # hide this window (will show it later on)
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: guild_info
#----------------------------------------------------------------------------
def guild_info=(guild_info)
# sets the guild info used in this window, only do it if the info has changed
return if @guild_info == guild_info
@guild_info = guild_info
# refresh the information shown
refresh
end
#----------------------------------------------------------------------------
# ○ new method: refresh
#----------------------------------------------------------------------------
def refresh
contents.clear
set_font(*Venka::Header_Font)
# exit out of this method no guilds are active
return unless @guild_info
# Figure's the text string depending on the windows y axis
# If it's the first window it shows the guilds name, if it's the lower
# window, then it shows the guild leader's name
text = self.y == 0 ? @guild_info[:name] : "Leader: #{@guild_info[:leader]}"
draw_text(0, 0, contents.width, contents.height, text)
end
end
#==============================================================================
# ** Guild_Pic_Window
#==============================================================================
class Guild_Pic_Window < Window_Selectable
# Notice this window is based off of Window_Selectable and not Window_Base
# like the others. This is so that one of the guild information windows
# can be active and make use of the set_handler method.
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
self.back_opacity = Venka::Back_Opacity
hide
unselect # use unselect because we don't need a cursor for this window
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: guild_info
#----------------------------------------------------------------------------
def guild_info=(guild_info)
# This is basically the same as the guild_info= method defined in the
# previous window but calling the draw_picture method instead of refresh
return if @guild_info == guild_info
@guild_info = guild_info
draw_picture(@guild_info[
end
#----------------------------------------------------------------------------
# ○ new method: draw_picture
#----------------------------------------------------------------------------
def draw_picture(filename)
# sets the bitmap to the picture in the Graphics/Picture folder. You can
# change the folder directory if you want to and feel confident doing so.
bitmap = Cache.picture(filename)
# sets the rectangle size to select the image. Starting at pixel 0, 0 and
# going to the width and height of the picture. You can change this to
# select only parts of the picture. Play with the number if you feel like it
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
# calculations to make the image centered in the window
x = (contents.width - bitmap.width) / 2
y = (contents.height - bitmap.height) / 2
# this is the method to actual place the image in the window it basically
# says to draw the image (bitmap) shown within the rect(rectangle) at x, y
contents.blt(x, y, bitmap, rect)
# now that the image is drawn, we can throw it away (it's fine.. really)
bitmap.dispose
end
end
#==============================================================================
# ** Guild_Description_Window
#==============================================================================
class Guild_Description_Window < Window_Base
#----------------------------------------------------------------------------
# ● upgraded method: initialize
#----------------------------------------------------------------------------
def initialize
y = Graphics.height - fitting_height(7)
super(0, y, Graphics.width, fitting_height(7))
self.windowskin = Cache.system(Venka::Windowskin) if Venka::Windowskin
self.back_opacity = Venka::Back_Opacity
hide
end
#----------------------------------------------------------------------------
# ● window settings
#----------------------------------------------------------------------------
# Set's the window's color to black
def update_tone; self.tone.set(0, 0, 0, 0); end
#----------------------------------------------------------------------------
# ○ new method: guild_info
#----------------------------------------------------------------------------
def guild_info=(guild_info)
return if @guild_info == guild_info
@guild_info = guild_info
refresh
end
#----------------------------------------------------------------------------
# ● upgraded method: draw_text_ex
#----------------------------------------------------------------------------
# took out the reset font settings for custom text
def draw_text_ex(x, y, text)
text = convert_escape_characters(text)
pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
process_character(text.slice!(0, 1), text, pos) until text.empty?
end
#----------------------------------------------------------------------------
# ○ new method: refresh
#----------------------------------------------------------------------------
def refresh
contents.clear
set_font(*Venka::Font)
return unless @guild_info
# this is the method that will be effected by KilloZapit's word wrapper
# as well as any other window that uses this method. So read that script
# for information on how to set it up best for your needs.
draw_text_ex(0, 0, @guild_info[:description])
end
end
#==============================================================================
# ** Scene_Guilds
#==============================================================================
class Scene_Guilds < Scene_MenuBase
#----------------------------------------------------------------------------
# ● upgraded method: start - builds on Scene_MenuBase's start method
#----------------------------------------------------------------------------
def start
super
# this is the same method that we defined earlier but it needs to be made
# here as well. Calling at the start of the scene since we need the info
active_guilds
create_header_window
create_guild_list_window
create_guild_info_windows
create_guild_description
end
#----------------------------------------------------------------------------
# ○ new method: active_guilds
#----------------------------------------------------------------------------
def active_guilds
@guild_list = []
guilds = Venka::Guild_Info
guilds.each do |guild|
next unless $game_switches[guild[1][:switch]]
@guild_list << guild[0]
end
end
#----------------------------------------------------------------------------
# ○ new method: create_header_window
#----------------------------------------------------------------------------
def create_header_window
# Create the header window for the scene
@guild_info = SAO_Guild_Header.new(48, 0, Graphics.width - 48, 72)
# sets the text the window displays
@guild_info.set_text("Guild Information Database")
# sets the viewport the window will be created in. If you forget to set the
# viewport, it's not the end of the world.
@guild_info.viewport = @viewport
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_list_window
#----------------------------------------------------------------------------
def create_guild_list_window
# creates the list window with the guild's names. just need to set y position
@guild_list_window = GuildLists_Window.new(@guild_info.height)
@guild_list_window.viewport = @viewport
# setting what happends when keys are pressed. Ok is when the action key is
# used. It will call the method show_guild_info. Cancel is esc key.
@guild_list_window.set_handler
@guild_list_window.set_handler
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_info_windows
#----------------------------------------------------------------------------
def create_guild_info_windows
x = Graphics.width - 160
@face_window = Guild_Pic_Window.new(x, 0, 160, 144)
@face_window.viewport = @viewport
@face_window.set_handler
# set handeling when page up/down used.
@face_window.set_handler
@face_window.set_handler
@guild_info_windows = Array.new(2) do |i|
Guild_Name_Window.new(0, i * 72, Graphics.width - 160, 72)
end
@guild_info_windows.each {|window| window.viewport = @viewport}
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_description
#----------------------------------------------------------------------------
def create_guild_description
@description_window = Guild_Description_Window.new
@description_window.viewport = @viewport
end
#----------------------------------------------------------------------------
# ○ new method: show_guild_info
#----------------------------------------------------------------------------
def show_guild_info
# setting up an index to use for the guild information windows. Set the
# index when the guild info windows are shown so it updates to the
# current list's index
@index = @guild_list_window.index
# this says forget about this method and return to the list window if
# there are no active guilds to display
return return_to_list unless @guild_list.size > 0
# hide the main windows when the info windows are shown/called
@guild_info.hide
@guild_list_window.hide
update_guild_info # refresh info displayed
# activate the pic window so we can control it and the other windows
@face_window.activate
end
#----------------------------------------------------------------------------
# ○ new method: update_guild_info
#----------------------------------------------------------------------------
def update_guild_info
# uses the @index we set up earlier to determine the information shown
# if you use the consol while play testing you'll see some info printed there
print "@guild_list: "; p @guild_list
print "@index: "; p @index
# @guild_list is the list we made with the active_guilds method. It shows
# the guild ID's that are currently activated. @index will be the the
# postion we are in on that list (starts with 0 and works it's way up)
# feel free to delete those two print command lines when you're done
# playing with them.
info = Venka::Guild_Info[@guild_list[@index]]
# the following windows will update their info to the new guild information
@face_window.guild_info=(info)
@face_window.show
@guild_info_windows.each {|window| window.guild_info=(info); window.show}
@description_window.guild_info=(info)
@description_window.show
# we remind the scene that the picture window is still the active window
@face_window.activate
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_info_windows
#----------------------------------------------------------------------------
def next_guild
# we add one to the @index unless we reach the last item, then it starts over
@index = (@index + 1) % @guild_list.size
update_guild_info # refreshes the info displayed
end
#----------------------------------------------------------------------------
# ○ new method: create_guild_info_windows
#----------------------------------------------------------------------------
def prev_guild
# lowers the index number or jumps to the end of the list if needed
@index = (@index + @guild_list.size - 1) % @guild_list.size
update_guild_info
end
#----------------------------------------------------------------------------
# ○ new method: return_to_list
#----------------------------------------------------------------------------
def return_to_list
# return to the main windows and hide all the info windows
@guild_info.show
@guild_list_window.show.activate
@face_window.hide
@description_window.hide
@guild_info_windows.each {|window| window.hide}
end
end
UPDATE: Thread has been solved and can be closed
Last edited by a moderator:
