Dinastia Maker
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

[Script]-Visual equipament

Ir para baixo

[Script]-Visual equipament Empty [Script]-Visual equipament

Mensagem  Splinter Qui Ago 28, 2008 9:43 pm

Nome: Visual Equipament
Descrição: Exibe o equipamento do jogador no mapa.
Autor: Geso Chisku

Script:

#==============================================================================
# ¦ Visual Equipment (traduzido)
#------------------------------------------------------------------------------
# Geso Chisku
# Version 2
# 14.02.06
#============================================================================
# Tradução para Português : ArcanjoAlef
#============================================================================
# *****(Nota do Tradudor)*****
# Bem não preciso nem dizer que esse script não eh meu né,
# só passei para nossa ligua para melhor aplicarmos
# usem e abusem,deem os merecidos creditos ao autor, o original
# está disponivel no site www.netplayplus.net
#============================================================================
# Caracteristicas:
# - Exibe o Equipamento do Jogador no Mapa
# - Exibe o equipamento do NPC no mapa e eventos
# - Compativel com Caterpillar e SBABS
# - Exibe uma Janela de Equipamentos
#------------------------------------------------------------------------------
# Trabalho Futuro
# - Compativel com Guillaume multi-equip
# - Compativel com Netplay
# - Compativel com different size graphics
# - Compativel com shadows/reflection (that is gonna be hard)
#------------------------------------------------------------------------------
# BUGS
# - Não funciona com shadow/reflection script
#------------------------------------------------------------------------------
# Fazendo seus Proprios Graficos
# - Todos os Graficos devem ter o tamanho 128 x 192 size
# - Para o Personagem principal, fazer apenas os cabelos e os olhos
# - Use os Modelos adequados
#------------------------------------------------------------------------------
# Configurando seu Jogo
# Para assumir o modelo de corpo, procurar por "DEFAULT_ACTOR_BODY"
#
# Para colocar graficos e equipamentos, proucurar por "def equip_character"
#
# Adicionar visual equipamento a um evento,
#adicionar comentários neste formato :
#
# Comment: Visual Equipment
# Comment: Body [charset] [hue]
# Comment: Armor [charset] [hue]
# Comment: Helmet [charset] [hue]
# Comment: Weapon [charset] [hue]
# Comment: Accessory [charset] [hue]
# Comment: Shield [charset] [hue]
# Subistituir [charset] Com o nome de arquivo do equipamento ou com nenhum
# e [hue] com o grafico hue, o default hue é 0
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Visual Equipment', 'Geso Chisku', 2, '14.02.06')

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Visual Equipment') == true
#--------------------------------------------------------------------------
# Este metodo devolve o nome do Char baseado no tipo de Equipamento e no ID
# para adiciaonar um item na lista, add a seguinte linha:
# return [char_name, hue] if id == item_id
# Para add o charset 'equip-helmet', hue 0, para item 8 add o seguinte:
# return ['equip-helmet', 0] if id == 8
#--------------------------------------------------------------------------
def equip_character(type, id)
if type == 2
# Grafico das Armas
# Add os Graficos das armas aqui
return ['equip\\weapon-sword01', 0] if id == 1
else
# ARMORS, HELMETS, SHIELDS, ACCESSORIES GRAPHICS
# Add suas armaduras aqui:
return ['equip\\head-helmet01', 0] if id == 1
return ['equip\\head-helmet02', 0] if id == 2
return ['equip\\body-armor01', 0] if id == 3
return ['equip\\body-armor01', 170] if id == 4
return ['equip\\body-armor03', 0] if id == 5
return ['equip\\extra-amulet01', 0] if id == 6
return ['equip\\body-clothes01', 0] if id == 7
return ['equip\\body-cape01', 0] if id == 8
return ['equip\\body-robe01', 0] if id == 9
return ['equip\\body-robe02', 0] if id == 10
return ['equip\\body-robe03', 0] if id == 11
return ['equip\\head-bunny', 0] if id == 12
return ['equip\\body-bunny', 0] if id == 13
return ['equip\\head-hat01', 0] if id == 14
return ['equip\\head-hat02', 0] if id == 15
return ['equip\\head-hat03', 0] if id == 16
return ['equip\\head-sailor01', 0] if id == 17
return ['equip\\head-ninja', 0] if id == 18
return ['equip\\body-ninja', 0] if id == 19

return ['equip\\body-armor02', 0] if id == 20
return ['equip\\body-armor04', 0] if id == 21
return ['equip\\body-armor05', 0] if id == 22
return ['equip\\body-clothes02', 0] if id == 23
return ['equip\\body-clothes04', 0] if id == 24
return ['equip\\body-clothes03', 0] if id == 25
return ['equip\\body-clothes05', 0] if id == 26
return ['equip\\body-robe04', 0] if id == 27

end
return false
end
#----------------------------------------------------------------------------
# ** Game_Actor
#----------------------------------------------------------------------------
class Game_Actor < Game_Battler
attr_accessor :body
#--------------------------------------------------------------------------
DEFAULT_ACTOR_BODY = ['body-male', 'body-male', 'body-male', 'body-male']
#--------------------------------------------------------------------------
alias geso_visual_actor_init initialize
def initialize(actor_id)
geso_visual_actor_init(actor_id)
@body = DEFAULT_ACTOR_BODY[actor_id]
end
#--------------------------------------------------------------------------
def equip_char_array
equips = []
equips.push([@body, 0])
item = equip_character(0, actor_equip_id(0, self))
equips.push(item) unless item == false
equips.push([@character_name, @character_hue])
for i in 1..4
item = equip_character(i, actor_equip_id(i, self))
equips.push(item) unless item == false
end
return equips
end
end
#----------------------------------------------------------------------------
# ** Game_Event
#----------------------------------------------------------------------------
class Game_Event < Game_Character
attr_reader :page
end
#--------------------------------------------------------------------------
# Determine a ordem dos equipamentos
#--------------------------------------------------------------------------
def actor_equip_id(i, actor)
case i
when 0 # Body
return actor.armor3_id
when 1 # Helmet
return actor.armor2_id
when 2 # Weapon
return actor.weapon_id
when 3 # Accessory
return actor.armor4_id
when 4 # Shield
return actor.armor1_id
end
end
#----------------------------------------------------------------------------
# ** Sprite_Character
#----------------------------------------------------------------------------
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
alias geso_visual_equip_sprite_char_init initialize
def initialize(viewport, character = nil)
if character.is_a?(Game_Player)
@actor = $game_party.actors[0]
elsif SDK.state('SBABS') == true and character.is_a?(Game_Ally)
@actor = $game_party.actors[character.actor_id]
elsif SDK.state('Caterpillar') == true and character.is_a?(Game_Party_Actor)
@actor = character.actor
else
@actor = nil
end
@equips_id = [0, 0, 0, 0, 0]
geso_visual_equip_sprite_char_init(viewport, character)
end
#--------------------------------------------------------------------------
def equip_changed?
if SDK.state('Caterpillar') == true
if @character.is_a?(Game_Party_Actor)
if @character.actor != @actor
@actor = @character.actor
return true
end
end
end
if SDK.state('SBABS') == true
if @character.is_a?(Game_Ally)
if $game_party.actors[@character.actor_id] != @actor
return true
end
end
end
if @character.is_a?(Game_Player)
if $game_party.actors[0] != @actor
@actor = $game_party.actors[0]
return true
end
elsif @character.is_a?(Game_Event)
if @page != @character.page
@page = @character.page
return true
end
return false
end
if @actor == nil
return false
end
for i in 0..4
return true if @equips_id[i] != actor_equip_id(i, @actor)
end
return false
end
#--------------------------------------------------------------------------
def adv_update
@character_name = ''
update
end
#--------------------------------------------------------------------------
def update
# If character is a event
super
# If tile ID, file name, hue or equipment are different from current ones
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue or
equip_changed?
# Remember tile ID, file name and hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# If tile ID value is valid
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 = 16
self.oy = 32
# If tile ID value is invalid
else
equips = []
# If handling a event
if @character.is_a?(Game_Event) == true
# Check for comment input
parameters = SDK.event_comment_input(@character, 6, 'Visual Equipment')
if parameters.nil?
equips.push([@character_name, @character_hue])
else
for i in 0..5
item = parameters[i].split
hue = item.size > 2 ? item[2] : 0
equips.push([item[1], hue]) if item[1] != 'none'
if i == 1
equips.push([@character_name, @character_hue])
end
end
end
# If handling the player
elsif @actor != nil
equips = @actor.equip_char_array
end
# Dispose old bitmap
self.bitmap.dispose unless self.bitmap == nil
# Draws the character 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)
# If character fits the size
if equips.size > 0 and bmp.width == 128 and bmp.height == 192
size = equips.size -1
for i in 0..size
next if equips[i] == false or equips[i][0] == false or equips[i][0] == nil
bmp2 = RPG::Cache.character(equips[i][0], equips[i][1].to_i)
self.bitmap.blt(0, 0, bmp2, src_rect, 255)
end
else
src_rect = Rect.new(0, 0, bmp.width, bmp.height)
self.bitmap.blt(0, 0, bmp, src_rect, 255)
end
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
# Set visible situation
self.visible = (not @character.transparent)
# If graphic is character
if @tile_id == 0
# Set rectangular transfer
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
# Set sprite coordinates
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
# Set opacity level, blend method, and bush depth
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# Animation
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
#--------------------------------------------------------------------------
end
#----------------------------------------------------------------------------
# ** Window_Base
#----------------------------------------------------------------------------
class Window_Base < Window
#--------------------------------------------------------------------------
def draw_actor_graphic(actor, x, y)
bmp = RPG::Cache.character(actor.character_name, actor.character_hue)
bitmap = Bitmap.new(bmp.width, bmp.height)
src_rect = Rect.new(0, 0, bmp.width, bmp.height)

# Setup actor equipment
equips = actor.equip_char_array

# If character fits the size
if equips.size > 0 and bmp.width == 128 and bmp.height == 192
size = equips.size -1
for i in 0..size
next if equips[i] == false or equips[i][0] == false or equips[i][0] == nil
bmp2 = RPG::Cache.character(equips[i][0], equips[i][1].to_i)
bitmap.blt(0, 0, bmp2, src_rect, 255)
end
else
bitmap.blt(0, 0, bmp, src_rect, 255)
end

cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end
end
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
Splinter
Splinter
Lenda
Lenda

Mensagens : 16
Data de inscrição : 27/08/2008
Idade : 31

https://dinastiamaker.directorioforuns.com

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos