Bom amigos estoy ajudando um poco aqui no aldeia, por que to ausente por um tempo kkkkk
bom este sistema e sistema do sombra online global e del NP do Shocks
Bom espero que les aya ajudado ^.^!
Creditos :
Shocks
Kakashy Hatake
Marlos
bom este sistema e sistema do sombra online global e del NP do Shocks
- Spoiler:
- Código:
#==============================================================================
# Efeito de Sombra || Por Mendesx
# Modificado : Kakashy Hatake / Jonny
#------------------------------------------------------------------------------
# Este script cria uma sombra perto do herói e de eventos. A
# sombra é fiel ao formato do gráfico.
#==============================================================================
module CONF # Configurações
# Angulo da sombra
ANGLE = 325
# Cor da sombra
COLOR = [30, 20, 30, 255] # Em RGB
# Opacidade das sombras
OPA = 50
end
class Sprite_Character_Shadow < RPG::Sprite
def initialize(viewport, character = nil)
super(viewport)
@character1 = character
update_shadow
end
def update_shadow
if @tile_id2 != @character1.tile_id or
@character_name2 != @character1.character_name or
@character_hue2 != @character1.character_hue
# endif
@tile_id2 = @character1.tile_id
@character_name2 = @character1.character_name
@character_hue2 = @character1.character_hue
self.bitmap = RPG::Cache.character(@character1.character_name,
@character1.character_hue)
@cw2 = bitmap.width / 4
@ch2 = bitmap.height / 4
self.ox = @cw2 / 2
self.oy = @ch2
tmp = @character1.character_name
end
self.visible = (not @character1.transparent)
if @tile_id2 == 0
sx = @character1.pattern * @cw2
sy = (@character1.direction - 2) / 2 * @ch2
self.src_rect.set(sx, sy, @cw2, @ch2)
end
self.x = @character1.screen_x
self.y = @character1.screen_y - 5
self.z = @character1.screen_z - 10
if self.bitmap.width == 128 and self.bitmap.height == 192
self.angle = CONF::ANGLE
else
self.angle = 340
self.y -= (bitmap.height - 196) / 4
self.y += (bitmap.height - 196) / 4
end
self.opacity = CONF::OPA
self.color.set(CONF::COLOR[0], CONF::COLOR[1], CONF::COLOR[2], CONF::COLOR[3])
end
end
class Sprite_Shadow < RPG::Sprite
def initialize(viewport, character = nil)
super(viewport)
@character2 = character
update_shadow
end
def update_shadow
if @tile_id != @character2.tile_id or
@character2_name != @character2.character_name or
@character2_hue != @character2.character_hue
@tile_id2 = @character2.tile_id
@character2_name = @character2.character_name
@character2_hue = @character2.character_hue
self.bitmap = RPG::Cache.character(@character2.character_name, @character2.character_hue)
@cw1 = bitmap.width / 4
@ch1 = bitmap.height / 4
self.ox = @cw1 / 2
self.oy = @ch1
self.angle = CONF::ANGLE
end
self.visible = (not @character2.transparent)
sx = @character2.pattern * @cw1
sy = (@character2.direction - 2) / 2 * @ch1
self.src_rect.set(sx, sy, @cw1, @ch1)
self.x = @character2.screen_x
self.y = @character2.screen_y - 5
self.z = @character2.screen_z - 10
if self.bitmap.width == 128 and self.bitmap.height == 192
self.angle = CONF::ANGLE
else
self.angle = 340
self.y -= (bitmap.height - 196) / 4
self.y += (bitmap.height - 196) / 4
end
self.opacity = CONF::OPA
self.color.set(CONF::COLOR[0], CONF::COLOR[1], CONF::COLOR[2], CONF::COLOR[3])
end
end
class Spriteset_Map
alias sh initialize
alias dh dispose
alias uh update
def initialize
@character_shadows = []
for i in $game_map.events.values
next if i.list.nil?
for command in i.list
next if command.code != 108
next if command.parameters[0] != "Sombra"
shadow = Sprite_Shadow.new(@viewport1, i)
@character_shadows.push(shadow)
end
end
for player in Network::Main.mapplayers.values
next if player == nil
next if player.netid.to_i == Network::Main.id.to_i
next if player.character_name == nil or player.character_name == ""
next if player.map_id != $game_map.map_id
shadow = Sprite_Shadow.new(@viewport1, player)
@character_shadows.push(shadow)
end
@character_shadows.push(Sprite_Character_Shadow.new(@viewport1, $game_player))
sh
end
def dispose
for shadow in @character_shadows
shadow.dispose
end
dh
end
def update
if $game_temp.spriteset_refresh == true and @character_shadows != nil
for shadow in @character_shadows
shadow.dispose
end
@character_shadows = []
for i in $game_map.events.keys.sort
next if $game_map.events[i].list.nil?
for command in $game_map.events[i].list
next if command.code != 108
next if !command.parameters.include?("Sombra")
shadow = Sprite_Shadow.new(@viewport1, $game_map.events[i])
@character_shadows.push(shadow)
end
end
for player in Network::Main.mapplayers.values
next if player == nil
next if player.netid.to_i == Network::Main.id.to_i
next if player.character_name == nil or player.character_name == ""
next if player.map_id != $game_map.map_id
shadow = Sprite_Shadow.new(@viewport1, player)
@character_shadows.push(shadow)
end
@character_shadows.push(Sprite_Character_Shadow.new(@viewport1, $game_player))
end
if @character_shadows != nil
for shadow in @character_shadows
shadow.update_shadow
end
end
uh
end
end
Bom espero que les aya ajudado ^.^!
Creditos :
Shocks
Kakashy Hatake
Marlos