#Ae galerinha da Aldeia, eu tava meio que sem o que fazer então decidi criar essa pequena atualização da Window_Guild. Ela acrescenta um sistema de lvls a guild, e a cada lvl a guild tem um título diferente. Essa "atualização" da Windows_Guild, é muito simples, porém útil para quem não sabe desenvolver scripts.
Screens
Script
Screens
- Spoiler:
Script
- Código:
#==============================================================================
# ** Guild
#------------------------------------------------------------------------------
# By Marlos Gama
#==============================================================================
module TIT
VAR_TITU = 16
TITU1 = "Guerreiros"
TITU2 = "Guerreiros Gregos"
TITU3 = "Atenienses"
TITU4 = "Espartanos"
end
class Window_Guild < Window_Base
def initialize(x,y,a,b)
super(x,y,a,b)
self.contents = Bitmap.new(self.width-32, self.height-32)
self.back_opacity = 200
@dragable = true
@closable = true
self.z = 99999
@sair_guild2 = Button.new(self,10,180,"Exit") {sair}
@member_guild = Button.new(self,98+5+5,180,"Miembros") { $member_list.refresh;self.visible = false; self.active = false; $flag2.visible = false; $member_list.visible = true; $member_list.active = true }
@quest_guild = Button.new(self,50,180,"Quest") {volver}
if $guild_position == "Lider"
$guild_created_input = Text_Box.new(self,64,137,77,10)
$guild_created_input2 = Text_Box.new(self,64,157,77,10)
@ok_guild = Button.new(self,145,137,"ADD") {ok}
@delet_guild = Button.new(self,145,157,"DEL ") {del}
else
$guild_created_input = Text_Box.new(self,200,207,77,10)
end
refresh
end
def on_close
self.visible = false
self.active = false
$flag2.visible = false
$member_list.visible = false
$member_list.active = false
$fechando_ativar = true
end
def update
super
refresh if something_changed?
end
def something_changed?
return true if @old_guild != $game_party.actors[0].guild
return true if @old_position != $guild_position
return true if @old_pontos != $guild_points
return true if @old_lider != $guild_lider_name
return false
end
def refresh
self.contents.font.color = Color.new(0,0,0)
@old_guild = $game_party.actors[0].guild
@old_position = $guild_position
@old_pontos = $guild_points
@old_lider = $guild_lider_name
self.contents.clear
self.contents.draw_text(47, 0, self.width-64 + 20, 42, $game_party.actors[0].guild)
self.contents.draw_text(0,30, self.width-64 + 20, 42, "Posição: " + $guild_position.to_s)
self.contents.draw_text(0,50, self.width-64 + 20, 42, "Level: " + $game_variables[15].to_s)
self.contents.draw_text(0,70, self.width-64 + 20, 42, "Pontos: " + $guild_points.to_s)
self.contents.draw_text(0,90, self.width-64 + 20, 42, "Título: ")
# Exibe a Casa do Personagem (Pronto)
if $game_variables[TIT::VAR_TITU] == 0
self.contents.draw_text(35,90, self.width-64 + 20, 42, TIT::TITU1,0)
end
if $game_variables[TIT::VAR_TITU] == 1
self.contents.draw_text(35,90, self.width-64 + 20, 42, TIT::TITU2,0)
end
if $game_variables[TIT::VAR_TITU] == 2
self.contents.draw_text(35,90, self.width-64 + 20, 42, TIT::TITU3,0)
end
if $game_variables[TIT::VAR_TITU] == 3
self.contents.draw_text(35,90, self.width-64 + 20, 42, TIT::TITU4,0)
end
#Términos de títulos
if $guild_position == "Lider"
self.contents.draw_text(0, 110, self.width-64 + 20, 42, "Convidar:")
self.contents.draw_text(0, 130, self.width-64 + 20, 42, "Expulsar:")
else
self.contents.draw_text(0, 70, self.width-64 + 20, 42, "Lider: "+$guild_lider_name.to_s)
end
end
def del
$game_system.se_play($data_system.decision_se)
for p in Network::Main.players.values
if p.nome == $guild_created_input2.text
if p.guild == $game_party.actors[0].guild
jogador = p.nome
return if p.position == "Lider"
Network::Main.pchat(p.netid,"[COM] [GDS] #{jogador}")
end
end
end
end
def volver
$game_system.se_play($data_system.decision_se)
$guild_created.visible = false; $guild_created.active = false;$flag2.visible = false
$qg.refresh; $qg.visible = true; $qg.active = true
end
def ok
$game_system.se_play($data_system.decision_se)
for p in Network::Main.players.values
if p.nome == $guild_created_input.text
flag = $flag.to_s
jogador = p.nome
lider_name = $game_party.actors[0].name
Network::Main.pchat(p.netid,"[COM] [GDD] #{$guild_name} #{jogador} #{flag} #{lider_name}")
end
end
end
def sair
if $guild_position == "Lider"
Network::Main.send_register($guild_name.to_s+"-Guild-DEL" , $guild_name.to_s)
end
$guild_created.visible = false
$guild_created.active = false
$member_list.visible = false
$member_list.active = false
$guild_name = ""
$game_party.actors[0].guild = ""
$game_player.refresh
$scene = Scene_Map.new
Network::Main.send_start
$guild_position = "Membro"
$guild_points = 0
$flag2.visible = false
$fechando_ativar = true
end
end