Últimos temas
» [MV] ¿Cómo mover un sprite?
por Frägarach Hoy a las 2:19 am

» Como cambio esto?...
por Shy_Cream Hoy a las 2:09 am

» El Dia Z - Demo
por EdwarPlay Ayer a las 8:08 pm

» Pokemon Destiny
por Greninja555 Ayer a las 5:46 pm

» Animación Habilidad de Enemigos RPGMAKER VX ACE
por Metatron Ayer a las 3:16 am

» [VX] Cambio de Resolución
por luistop12 Vie Sep 13, 2019 6:51 am

» ¿Como Mover al jugador mientras hay una conversación?
por Zachy Vie Sep 13, 2019 2:05 am

» ¿Como hacer un menú/Galería de imágenes? (RPG VxAce)
por ZororoWhite Jue Sep 12, 2019 7:57 pm

» Inherited Sins [Juego Completo] [Definitive Edition]
por Nina Jue Sep 12, 2019 7:47 pm

» Zaza no konpasu (La Brújula de Zaza) [VXACE]
por Pocari Sáb Sep 07, 2019 12:28 pm

» Ayuda con el ABS
por DarkarPro0102 Sáb Sep 07, 2019 8:32 am

» Pop! Horror City Complementos
por EdwarPlay Jue Sep 05, 2019 10:59 pm


Chest Item Pop-Up 2 by OriginalWIJ

Ir abajo

Chest Item Pop-Up 2 by OriginalWIJ Empty Chest Item Pop-Up 2 by OriginalWIJ

Mensaje por JapoZero el Dom Abr 20, 2014 7:10 pm

Aportando cosas de mi baúl inexistente.

Nombre:ChestItemPopUp2
Autor:OriginalWij
Version:1.1

Efecto: Hace que cuando habras un cofre, salga un icono arriba del objeto, y un mensaje con el nombre, util si quieres darle buenos aspectos a tu juego.

Instrucciones de Uso:

1-Para activarlo se activa el Interruptor 5, para desactivarlo se desactiva el Interruptor 5.

2-Tambien sale en la batalla, asi que si quieres desactivarlo para que solo salga en los cofres, al inicio de cada batalla le pones desactivar interruptor 5, pero entonces en cada evento de cofres, le pones interruptor 5 activado, es tu decision, a mi me gusta en la batalla asi.

3-Hagan lo que hagan, el icono de moneda dejenlo en el lugar que esta en su iconset, ya que si lo cambian a otro lugar o ponen otro icono, digamos, al conseguir dinero en un cofre, saldra un icono de pergamino, hierba, etc.

4-El sonido que sale al conseguir algo, es Chime2, si desean poner otro, vayan a la linea 67, asi ponen a su gusto.

Código:
==============================================================================
# Chest Item Pop-Up 2
#==============================================================================
# Author  : OriginalWij
# Version : 1.1
#==============================================================================

#==============================================================================
# NOTE: The newest version is the ONLY supported version!
#
# v1.0
# - Initial release
#   NOTE: This supercedes Chest Item Pop-Up, therefore Chest Item Pop-Up is no
#         longer supported.
# v1.1
# - Popping up no longer pauses map
#==============================================================================

#==============================================================================
# To use:
#
# 1) Setup the options in configuration section below
# 2) Turn on the activation switch (defined in configuration section below)
# 3) Add items via event commands like normal
#
# NOTE1: this script will automatically pop-up if activation switch is on!
# NOTE2: turn activation switch OFF to add items WITHOUT popup
# NOTE3: when adding multiple (different) items, insert a WAIT(1) between them
# NOTE4: use WAIT(7) between a message & popup (allows message window to close)
#==============================================================================

#==============================================================================
# To call manually from any scene or from an event script command:
#
# NOTE: For scripters only!
#
#   (useful if using a break-limits script and popping-up 100+ of one item)
#
#   $scene.item_popup(type, amount, index)
#   $scene.item_popup(type, amount, index, add)
#          type : 0 :gold, 1 :items, 2 :weapons, 3 :armor
#        amount : number of items "gaining"
#         index : item ID (use 0 for gold)
#           add : adds items into inventory if true (optional, default = false)
#==============================================================================

#==============================================================================
# Start User Configuration
#==============================================================================

module OW_CHEST
  # Switch to activate/deactivate item pop-ups (switch ID)
  POPUP_SWITCH = 5
  # Pop-up speed [0 = fastest ... 4 = slowest]
  POPUP_SPEED = 4
  # Show item icon in item description? ('gold' icon is always shown)
  SHOW_DESC_ICON = true
  # Pop-up item description? [false = static description window]
  POPUP_DESC = true
  
  # "Gold" icon (icon ID)
  GOLD_ICON = 205
  
  # Play sound on popup?
  PLAY_SOUND = true
  # Sound to play upon popup [if PLAY_SOUND = true]
  S_NAME   = 'Audio/SE/Chime2'
  S_VOLUME = 100
  S_PITCH  = 150
  
  # Wait for button to close? [false = wait for time]
  BUTTON_WAIT = true
  # Buttons to wait for [if BUTTON_WAIT = true] (buttons can be the same)
  BUTTON_1 = Input::C
  BUTTON_2 = Input::B
  # Frames to wait [if BUTTON_WAIT = false] (in frames)
  TIME = 120
  
  # Popup items & gold at the end of battle?
  BATTLE_POP = true
  # Popup experience at end of battle? [if BATTLE_POP = true]
  XP_POP = false
  # Experience icon to show [if XP_POP = true] (icon ID)
  XP_ICON = 27
end

#==============================================================================
# End User Configuration
#==============================================================================

  ###########################################################################
  #    Do NOT modify ANYTHING below unless you know what you're doing!!!    #
  #    Failure to do so may result in hair-loss, blindness, or insanity!    #
  ###########################################################################

#==============================================================================
# Game_Interpreter
#==============================================================================

class Game_Interpreter
  #--------------------------------------------------------------------------
  # Command 125 [Change Gold] (Mod)
  #--------------------------------------------------------------------------
  alias ow_chest_command_125 command_125 unless $@
  def command_125
    value = operate_value(@params[0], @params[1], @params[2])
    if $game_switches[OW_CHEST::POPUP_SWITCH] and @params[0] == 0
      $scene.item_popup(0, value, 1)
    end
    ow_chest_command_125    
  end
  #--------------------------------------------------------------------------
  # Command 126 [Change Items] (Mod)
  #--------------------------------------------------------------------------
  alias ow_chest_command_126 command_126 unless $@
  def command_126
    value = operate_value(@params[1], @params[2], @params[3])
    if $game_switches[OW_CHEST::POPUP_SWITCH] and @params[1] == 0
      $scene.item_popup(1, value, @params[0])
    end
    ow_chest_command_126
  end
  #--------------------------------------------------------------------------
  # Command 127 [Change Weapons] (Mod)
  #--------------------------------------------------------------------------
  alias ow_chest_command_127 command_127 unless $@
  def command_127
    value = operate_value(@params[1], @params[2], @params[3])
    if $game_switches[OW_CHEST::POPUP_SWITCH] and @params[1] == 0
      $scene.item_popup(2, value, @params[0])
    end
    ow_chest_command_127
  end
  #--------------------------------------------------------------------------
  # Command 128 [Change Armor] (Mod)
  #--------------------------------------------------------------------------
  alias ow_chest_command_128 command_128 unless $@
  def command_128
    value = operate_value(@params[1], @params[2], @params[3])
    if $game_switches[OW_CHEST::POPUP_SWITCH] and @params[1] == 0
      $scene.item_popup(3, value, @params[0])
    end
    ow_chest_command_128
  end
end

#==============================================================================
# Scene_Base
#==============================================================================

class Scene_Base
  #--------------------------------------------------------------------------
  # Basic Update Processing (New)
  #--------------------------------------------------------------------------
  def update_basic
    Graphics.update
    Input.update
    $game_map.update
    @spriteset.update unless @spriteset.nil?
  end
  #--------------------------------------------------------------------------
  # Item Pop-Up (New)
  #--------------------------------------------------------------------------
  def item_popup(type, amount, index, add = false)
    case type
    when 0 # Gold
      $game_party.gain_gold(amount) if add
      item = nil
    when 1 # Items
      $game_party.gain_item($data_items[index], amount) if add
      item = $data_items[index]
    when 2 # Weapons
      $game_party.gain_item($data_weapons[index], amount) if add
      item = $data_weapons[index]
    when 3 # Armors
      $game_party.gain_item($data_armors[index], amount) if add
      item = $data_armors[index]
    when 4 # Xp (battle only : no add)
      item = nil
    end
    icon = (item == nil) ? OW_CHEST::GOLD_ICON : item.icon_index
    icon = OW_CHEST::XP_ICON if type == 4
    x = $game_player.screen_x - 26
    y = $game_player.screen_y - 48
    @popup_window = Window_Base.new(x, y, 56, 56)
    @popup_window.opacity = @popup_window.contents_opacity = 0
    if $game_temp.in_battle
      @popup_window.x = (Graphics.width - @popup_window.width) / 2
      @popup_window.y = Graphics.height / 2 - 64
    end
    @popup_window.draw_icon(icon, 0, 0)
    max = OW_CHEST::POPUP_SPEED * 4 + 16
    for i in 1..max
      @popup_window.contents_opacity = i * (256 / max)
      @popup_window.y -= (32 / max)
      @popup_window.update
      update_basic
    end
    if OW_CHEST::PLAY_SOUND
      Audio.se_play(OW_CHEST::S_NAME, OW_CHEST::S_VOLUME, OW_CHEST::S_PITCH)
    end
    text = (item == nil) ? amount.to_s : item.name
    prefix_text = (amount == 1 or item == nil) ? "" : amount.to_s + " x "
    width = @popup_window.contents.text_size(text).width + 28
    prefix_width = @popup_window.contents.text_size(prefix_text).width
    x = (Graphics.width - (width + prefix_width + 32)) / 2
    y = (Graphics.height - 56) / 2
    y += 32 if OW_CHEST::POPUP_DESC
    @name_window = Window_Base.new(x, y, width + prefix_width + 32, 56)
    @name_window.opacity = @name_window.contents_opacity = 0
    unless item == nil
      w = width + prefix_width
      if OW_CHEST::SHOW_DESC_ICON
        @name_window.contents.draw_text(0, 0, w, 24, prefix_text)
        @name_window.draw_item_name(item, prefix_width, 0)
      else
        @name_window.contents.draw_text(14, 0, w, 24, prefix_text)
        @name_window.contents.draw_text(prefix_width + 14, 0, w, 24, item.name)
      end
    else
      @name_window.contents.draw_text(2, 0, width, 24, text)
      @name_window.draw_icon(icon, width - 24, 0)
    end
    for i in 1..max
      @name_window.y -= (32 / max) if OW_CHEST::POPUP_DESC
      @name_window.contents_opacity = i * (256 / max)
      @name_window.opacity = i * (256 / max)
      @name_window.update
      update_basic
    end
    count = 0
    loop do
      update_basic
      count += 1 unless OW_CHEST::BUTTON_WAIT
      break if Input.trigger?(OW_CHEST::BUTTON_1) and OW_CHEST::BUTTON_WAIT
      break if Input.trigger?(OW_CHEST::BUTTON_2) and OW_CHEST::BUTTON_WAIT
      break if count == OW_CHEST::TIME and !OW_CHEST::BUTTON_WAIT
    end
    for i in 1..max
      @popup_window.contents_opacity = 256 - i * (256 / max)
      @name_window.opacity = 256 - i * (256 / max)
      @name_window.contents_opacity = 256 - i * (256 / max)
      @popup_window.update
      @name_window.update
      update_basic
    end
    @popup_window.dispose
    @name_window.dispose
    Input.update
  end
end

#==============================================================================
# Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # Display Gained Experience and Gold (Mod)
  #--------------------------------------------------------------------------
  alias ow_chest_display_exp_and_gold display_exp_and_gold unless $@
  def display_exp_and_gold
    if OW_CHEST::BATTLE_POP and $game_switches[OW_CHEST::POPUP_SWITCH]
      exp = $game_troop.exp_total
      gold = $game_troop.gold_total
      if exp > 0 and !OW_CHEST::XP_POP
        text = sprintf(Vocab::ObtainExp, exp)
        $game_message.texts.push('\.' + text)
        wait_for_message
      elsif exp > 0 and OW_CHEST::XP_POP
        item_popup(4, exp, 0)
      end
      item_popup(0, gold, 0, true)
    else
      ow_chest_display_exp_and_gold
    end
  end
  #--------------------------------------------------------------------------
  # Display Gained Drop Items (Mod)
  #--------------------------------------------------------------------------
  alias ow_chest_display_drop_items display_drop_items unless $@
  def display_drop_items
    if OW_CHEST::BATTLE_POP and $game_switches[OW_CHEST::POPUP_SWITCH]
      drop_items = $game_troop.make_drop_items
      for item in drop_items
        type = 1 if item.is_a?(RPG::Item)
        type = 2 if item.is_a?(RPG::Weapon)
        type = 3 if item.is_a?(RPG::Armor)
        item_popup(type, 1, item.id, true)
      end
    else
      ow_chest_display_drop_items
    end
  end
end
Que les sirva.
Salu2
JapoZero
JapoZero
Héroe
Héroe

Masculino
Chile
RPG Maker : MV
Mensajes : 706
Monedas : 4355
Reputación : 283
Localización : Chile

Volver arriba Ir abajo

Volver arriba


 
Permisos de este foro:
No puedes responder a temas en este foro.