netplay master v4.9.2
Ajuda-me, eu não entendo, obrigado.
Acho que o nome de alianças bem e ícone não são cumpridas.
Scripts
[EXT] Event Text Display
Scripts
[SPR] Sprite_NetCharacter
Ajuda-me, eu não entendo, obrigado.
Acho que o nome de alianças bem e ícone não são cumpridas.
Scripts
[EXT] Event Text Display
- Código:
#==============================================================================
# ** Event_Text_Display
#==============================================================================
# By Áص¹
# Edit SephirothSpawn, Me™ and Valentine
#==============================================================================
SDK.log('Event Text Display', 'SephirothSpawn', 3, '15-06-14')
if SDK.state('Event Text Display') == true
#===============================================================================
# ** Game_Event
#===============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
alias seph_characterdisplay_gevent_refresh refresh
#--------------------------------------------------------------------------
# * Atualização
#--------------------------------------------------------------------------
def refresh
seph_characterdisplay_gevent_refresh
@text_display = [@event.name, Config::EVENT_COLOR] unless @event.name.strip == ""
@text_display = nil if @erased or ABS_Global.check_comment(@id, "Enemy Dead")
end
end
#===============================================================================
# ** Game_Player
#===============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
alias seph_characterdisplay_gplayer_refresh refresh
#--------------------------------------------------------------------------
# * Atualização
#--------------------------------------------------------------------------
def refresh
seph_characterdisplay_gplayer_refresh
if Network.group.downcase == 'admin'
@text_display = [$game_party.actors[0].name, Config::ADM_COLOR]
else
@text_display = [$game_party.actors[0].name, Config::PLAYER_COLOR]
end
if Config::GUILD_NAME == true
unless $game_party.actors[0].guild == ""
@guild_display = [$game_party.actors[0].guild, Config::GUILD_COLOR]
else
# Se o jogador sair da guild
@guild_display = nil
end
end
end
end
#===============================================================================
# ** Sprite_Character
#===============================================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
alias seph_characterdisplay_scharacter_update update
#--------------------------------------------------------------------------
# * Atualização do Frame
#--------------------------------------------------------------------------
def update
seph_characterdisplay_scharacter_update
update_display_text
end
#--------------------------------------------------------------------------
# * Desenhar Nome do Herói
#--------------------------------------------------------------------------
def create_display_sprite(args)
# Se for evento
if @character.is_a?(Game_Event)
# Se for inimigo
if $ABS.enemies[@character.id] != nil
return if @old_hp.to_i == $ABS.enemies[@character.id].hp.to_i
else
return if @_text_display != nil
end
# Se for o herói
elsif @character.is_a?(Game_Player)
return if @old_hp.to_i == $game_party.actors[0].hp.to_i
end
dispose_display_text
if @character.is_a?(Game_Event) and !$ABS.enemies[@character.id].nil? or @character.is_a?(Game_Player)
args = [$ABS.enemies[@character.id].name, Config::MONSTER_COLOR] unless @character.is_a?(Game_Player)
bitmap = Bitmap.new(200, 100)
else
bitmap = Bitmap.new(200, 100)
end
bitmap.font.size = 14
bitmap.font.draw_shadow = false if bitmap.font.respond_to?(:draw_shadow)
bitmap.font.color = Color.new(255, 255, 0)
#ไปทางขวา/
bitmap.draw_text(1, -1, 160, 24, args[0], 1)
bitmap.font.color = args[1]
bitmap.draw_text(0, -1, 160, 24, args[0], 1)
if @character.is_a?(Game_Event) and !$ABS.enemies[@character.id].nil?
@old_hp = $ABS.enemies[@character.id].hp
draw_gradient_bar(bitmap, 66, 85, $ABS.enemies[@character.id].hp, $ABS.enemies[@character.id].maxhp, HP_BAR, 35, 4)
elsif @character.is_a?(Game_Player)
@old_hp = $game_party.actors[0].hp
draw_gradient_bar(bitmap, 66, 85, $game_party.actors[0].hp, $game_party.actors[0].maxhp, "006-Greens02", 35, 4)
end
@_text_display = Sprite.new(self.viewport)
@_text_display.bitmap = bitmap
@_text_display.ox = 80
@_text_display.oy = 20
@_text_display.x = self.x
@_text_display.y = self.y - self.oy / 2 - 24
@_text_display.z = 30001
@_text_display.visible = self.visible
end
#--------------------------------------------------------------------------
# * Desenhar Nome da Guild
#--------------------------------------------------------------------------
def create_display_guild(args)
return if @_guild_display != nil and !@_guild_display.disposed?
bitmap = Bitmap.new(160, 24)
bitmap.font.name = "Diablo"
bitmap.font.size = 15
bitmap.font.draw_shadow = false if bitmap.font.respond_to?(:draw_shadow)
bitmap.font.color = Color.new(0, 0, 0)
bitmap.draw_text(6, 1, 160, 24, args[0], 1)
bitmap.font.color = args[1]
icon = RPG::Cache.flag("Flag#{$game_party.actors[0].guild_flag}")
bitmap.stretch_blt(Rect.new(78 - (bitmap.text_size(args[0]).width / 1.1), 0, icon.width / 1.5, icon.height / 1.5), icon, Rect.new(0, 0, icon.width, icon.height))
bitmap.draw_text(5, 0, 160, 24, args[0], 1)
@_guild_display = Sprite.new(self.viewport)
@_guild_display.bitmap = bitmap
@_guild_display.ox = 80
@_guild_display.oy = 24
@_guild_display.x = self.x
@_guild_display.y = self.y - self.oy / 4 - 24
@_guild_display.z = 30001
@_guild_display.visible = self.visible
end
#--------------------------------------------------------------------------
# * Exibição do Nome do Jogador
#--------------------------------------------------------------------------
def dispose_display_text
@_text_display.dispose unless @_text_display.nil?
@old_hp = nil unless @_text_display.nil?
end
#--------------------------------------------------------------------------
# * Exibição do Nome da Guild
#--------------------------------------------------------------------------
def dispose_display_guild
@_guild_display.dispose unless @_guild_display.nil?
end
#--------------------------------------------------------------------------
# * Atualização do Texto
#--------------------------------------------------------------------------
def update_display_text
unless @character.text_display.nil?
create_display_sprite(@character.text_display) if @character.is_a?(Game_Event) and $game_self_switches[[$game_map.map_id, @character.id, "A"]] == false or @_text_display.nil? or @character.is_a?(Game_Player)
@_text_display.x = self.x unless @_text_display.disposed?
@_text_display.y = self.y - self.oy / 2 - 35 unless @_text_display.disposed?
else
dispose_display_text unless @_text_display.nil?
end
if @character.is_a?(Game_Player)
unless @character.guild_display.nil?
create_display_guild(@character.guild_display)
@_guild_display.x = self.x unless @_guild_display.disposed?
@_guild_display.y = self.y - self.oy / 2 - 46 unless @_guild_display.disposed?
else
dispose_display_guild unless @_guild_display.nil? and $game_party.actors[0].guild == ""
end
end
end
end
end
Scripts
[SPR] Sprite_NetCharacter
- Código:
#==============================================================================
# ** Sprite_NetCharacter - Este sprite é usado para exibir o personagem. Ele
# observa a classe Game_Character e automaticamente
# altera as condições do sprite.
#------------------------------------------------------------------------------
# By Me™, Mr.Mo, Geso Chisku and Valentine
# Idea Destined
#==============================================================================
class Sprite_NetCharacter < RPG::Sprite
#--------------------------------------------------------------------------
# * Variáveis Públicas
#--------------------------------------------------------------------------
attr_accessor :character
attr_accessor :netid
#--------------------------------------------------------------------------
# * Inicialização dos Objetos
#--------------------------------------------------------------------------
def initialize(viewport, id, character = nil)
super(viewport)
@character = character
@netid = id
# Cria Bitmap
bitmap = Bitmap.new(250, 200)
# Desenhar sombra do texto
bitmap.font.size = 14
bitmap.font.draw_shadow = false if bitmap.font.respond_to?(:draw_shadow)
#เงากิลด์
bitmap.font.name = "Diablo"
if @character.guild != "" and Config::GUILD_NAME == true
bitmap.font.color = Color.new(0, 0, 0)
bitmap.draw_text(5, -15, 160, 24, @character.guild, 1)
# Mudar cor da fonte
bitmap.font.color = Config::GUILD_COLOR
# Desenhar bandeira da guild
icon = RPG::Cache.flag("Flag#{@character.flag}")
bitmap.stretch_blt(Rect.new(78 - (bitmap.text_size(@character.guild).width / 1.1), 0, icon.width / 1.5, icon.height / 1.5), icon, Rect.new(0, 0, icon.width, icon.height))
#ระดับชื่อกิลด์
# Desenhar texto
bitmap.draw_text(5, -15, 160, 24, @character.guild, 1)
end
# Desenhar sombra do texto เงาชื่อ
bitmap.font.size = 14
bitmap.font.color = Color.new(255, 255, 0)
bitmap.font.name = Font.default_name
bitmap.draw_text(1, -1, 160, 24, @character.name, 1)
# Desenhar texto ชื่อ
if @character.group.downcase == "admin"
bitmap.font.color = Config::ADM_COLOR
else
bitmap.font.color = Config::PLAYER_COLOR
end
bitmap.draw_text(0, -1, 160, 24, @character.name, 1)
# Desenhar HP เลือดหลอดเล็ก
draw_gradient_bar(bitmap, 66, 85, @character.hp, @character.maxhp, "006-Greens02", 35, 4)
# Criar Variável do Bitmap
@pet_spr = Sprite.new(self.viewport)
@pet_spr.bitmap = RPG::Cache.character(@character.pet, @character.character_hue)
@pet_spr.visible = self.visible
@_text_display = Sprite.new(self.viewport)
@_text_display.bitmap = bitmap
@_text_display.ox = 80
@_text_display.oy = 20
@_text_display.x = self.x
@_text_display.y = self.y - self.oy / 46 - 46
@_text_display.z = 30001
@_text_display.visible = self.visible
self.opacity = 80
update
end
#--------------------------------------------------------------------------
# * Definição dos Equipamentos do Personagem
#--------------------------------------------------------------------------
def equip_char_array
equips = []
# Vai do Elmo(0) até o Acessório(8)
for i in 0..8
item = equip_character(i, actor_equip_id(i, @character), @character.gender)
equips.push(item) unless item == false
end
return equips
end
#--------------------------------------------------------------------------
# * Exibição
#--------------------------------------------------------------------------
def dispose
@_text_display.dispose
super
end
#--------------------------------------------------------------------------
# * Atualização do Frame
#--------------------------------------------------------------------------
def update
super
# Caso o ID de tile, o nome do arquivo, ou a cor forem diferentes do atual
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
# Lembrar ao ID de tile, o nome do arquivo e a cor
update_tile
end
# Definir a situação como visível
self.visible = (not @character.transparent)
# Se o gráfico for de um herói
animate_player if @tile_id == 0
# Definir as coordenadas do Sprite
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
# Definir o nível de opacidade, a sinteticidade e a profundidade do gramado
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# Animação
update_ani if @character.animation_id != 0
if @character.damage_show != nil
damage(@character.damage_show, @character.show_critical)
@character.show_demage(nil, true)
end
# Balão do chat
if @character.chat_text != ""
@character.chat_text = Game_Chat.text_break(self.bitmap, @character.chat_text, 290)
show_chat(@character.chat_text)
@character.show_text("")
end
# Nome do herói
@_text_display.x = self.x
@_text_display.y = self.y - self.oy / 2 - 35
end
#--------------------------------------------------------------------------
# * Atualização dos Gráficos
#--------------------------------------------------------------------------
def update_tile
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 35
self.oy = 46
else
equips = equip_char_array
# Destruir Bitmap velho
self.bitmap.dispose unless self.bitmap == nil
# Desenhar o novo Bitmap
bmp = RPG::Cache.character(@character_name, @character_hue)
self.bitmap = Bitmap.new(bmp.width, bmp.height)
src_rect = Rect.new(0, 0, bmp.width, bmp.height)
# Desenhar roupa
self.bitmap.blt(0, 0, bmp, src_rect, 255)
# Desenhar cabelo
unless @character.character_hair == ""
bmp = RPG::Cache.hair(@character.character_hair, @character_hue)
self.bitmap.blt(0, 0, bmp, Rect.new(0, 0, bmp.width, bmp.height), 255)
end
# Se há equipamentos
if equips.size > 0
for i in 0..equips.size-1
next if equips[i] == false or equips[i][0] == false or equips[i][0] == nil
bmp = RPG::Cache.character(equips[i][0], equips[i][1].to_i)
self.bitmap.blt(0, 0, bmp, src_rect, 255)
end
end
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
#--------------------------------------------------------------------------
# * Atualização do Movimento do Jogador
#--------------------------------------------------------------------------
def animate_player
# Definir transferência retangular
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
#--------------------------------------------------------------------------
# * Atualização da Animação
#--------------------------------------------------------------------------
def update_ani
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end