Últimos temas
» [Sugerencia]Limpieza de recursos viejos en el foro.
por Cuyo1786 Hoy a las 9:52 am

» Busco grupo para un inexperta pero con ganas
por BACA Hoy a las 1:41 am

» Buscando pixel artista, trabajo pagado.
por pixeloid Ayer a las 11:33 pm

» [MV]Butterfly Paradox
por DopellSerch Ayer a las 9:44 pm

» LMD - Lunas de Magia Divina
por Zaabos Ayer a las 12:46 am

» LA BRÚJULA DE ZAZA [VXACE]
por Pocari Dom Oct 20, 2019 1:29 pm

» [VXA]Resident Evil Menu
por DorFenn Dom Oct 20, 2019 1:42 am

» (RMMV) Precognition
por JapoZero Jue Oct 17, 2019 11:40 pm

» Ayuda, duda
por BACA Miér Oct 16, 2019 7:38 pm

» Duda con ventana de comandos en Script
por DorFenn Lun Oct 14, 2019 1:46 am

» Índice Scripts RGSS3
por ZororoWhite Dom Oct 13, 2019 12:24 am

» [VX Ace] Script para duplicar tamaño y escala de ventana del juego
por ZororoWhite Dom Oct 13, 2019 12:23 am


(Ace) Multiples monedas + Multiples monedas en tiendas (Euphoria)

Ir abajo

(Ace) Multiples monedas + Multiples monedas en tiendas (Euphoria) Empty (Ace) Multiples monedas + Multiples monedas en tiendas (Euphoria)

Mensaje por JapoZero el Jue Ago 21, 2014 1:42 am

Alternate Currencies V1.1 by Euphoria
(Ace) Multiples monedas + Multiples monedas en tiendas (Euphoria) Untitled-12
(Ace) Multiples monedas + Multiples monedas en tiendas (Euphoria) Untitled-21
Este script permite crear y usar diferentes tipos de monedas en el juego. Puedes usar hasta 7, y escoger 1 de esas 7. Como dice el autor, usa tu imaginación un poco y hay muchas posibilidades.
Créditos a Euphoria por el script. Cuenta con un script aparte con el cual usar las múltiples monedas en tiendas.

SCRIPT 1 - Base
Código:

#┌──────────────────────────────────────────────────────────────────────────────
#│
#│                          *Alternate Currencies*
#│                              Version: 1.1
#│                            Author: Euphoria
#│                            Date: 8/17/2014
#│                        Euphoria337.wordpress.com
#│                        
#├──────────────────────────────────────────────────────────────────────────────
#│■ Important: This script CAN overwrite methods in: Scene_Menu
#├──────────────────────────────────────────────────────────────────────────────
#│■ History: 1.1) added compatibility for Euphoria - Alternate Currency Shops                        
#├──────────────────────────────────────────────────────────────────────────────
#│■ Terms of Use: This script is free to use in non-commercial games only as
#│                long as you credit me (the author). For Commercial use contact
#│                me.
#├──────────────────────────────────────────────────────────────────────────────                          
#│■ Instructions: This is my second time writing the instructions because I'm
#│                stupid and canceled out of the editor when I finished.
#│                Anyways, edit the settings in the editable region to fit your
#│                needs. The NEW_GOLD_WINDOW will add a new window displaying up
#│                to seven new currencies, along with gold, to the menu.
#│                SET_MENU_COMMAND will add the currency view option to the menu
#│                if you want currencies to be accessible from the menu, set it
#│                to true. SET_MENU_NAME will be the name of the menu option for
#│                the currency view scene.
#│
#│                To edit/add currencies to your game you MUST follow the format
#│                used by the example currencies in the editable region, of
#│                course, you could just edit those. But if you want to add more
#│                currencies than seven for some reason(I know it says DO NOT
#│                ADD MORE, but that's for people who don't read the
#│                instructions(also note that only up to seven currencies can be
#│                displayed in the NEW_GOLD_WINDOW)), the format is:
#│
#│                "Currency Name" => {      keep the currency's name in quotes
#│                :ENABLED => true or false, true will enable the currency
#│                :SYMBOL  => "Currency Symbol", keep the symbol in quotes
#│                :DESC    => "Short Description of Currency", keep the quotes
#│                :ICON    => Icon ID number you wish to use
#│                :MAX     => the maximum amount the party can have
#│                },            DO NOT FORGET THE BRACKET AND ADD COMMAS AFTER
#│                              EACH VARIABLE AS SEEN IN THE EXAMPLES
#│
#│                To actually use the currencies, you will have to use script
#│                calls, the following are the script calls you will need to
#│                know:
#│
#│                $ECurrency.set_currency("currency_name", amount)
#│
#│                $ECurrency.increase_currency("currency_name", amount)
#│
#│                $ECurrency.decrease_currency("currency_name", amount)
#│
#│                These will help you manage your currencies. set_currency will
#│                change whatever current value the currency has to the new
#│                amount. increase_currency will increase the named currency by
#│                the amount given. You can probably guess what
#│                decrease_currency does.
#│
#│                There is a fourth call that will most likely only be used in
#│                conditional branch script calls, it is:
#│
#│                $ECurrency.amount("currency_name")
#│
#│                This call simply returns the party's current total of the
#│                currency named. Here are some examples of how to use it in a
#│                conditional branch script call:
#│
#│                $ECurrency.amount("currency_name") == 50
#│                                   or
#│                $ECurrency.amount("currency_name") >= 50
#│                                   or
#│                $ECurrency.amount("currency_name") <= 50
#│
#│                With these you can check the parties currency amount to sell
#│                or buy special items, or whatever your imagination can come up
#│                with! Of course, after the check you would probably use one of
#│                the previous calls to set, increase, or decrease the currency.
#│                
#│                If you have any questions or suggestions feel free to ask at
#│                my website or wherever I post the script link. Enjoy!
#└──────────────────────────────────────────────────────────────────────────────
$imported ||= {}
$imported["EuphoriaAlternateCurrencies"] = true
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Editable Region
#└──────────────────────────────────────────────────────────────────────────────
module Euphoria
  module Currencies
    
    NEW_GOLD_WINDOW = true #If True, Creates A Window In Place Of Gold To
                           #Display All Currencies. WARNING: This Will Overwrite
                           #Parts Of Scene_Menu, If You Have A Custom Menu, Set
                           #It To false
    
    SET_MENU_COMMAND = true #Add the currency view as a menu option, this is
                             #the ugly way to add it, if you know how to add
                             #the command the pretty way, I recommend that.
                              
    SET_MENU_NAME = "Currencies" #The name of the menu option, only applies if
                                 #SET_MENU_COMMAND is set to true
                            
    CURR_HASH = { #DO NOT TOUCH!
    #DO NOT ADD MORE!
    
      "Currency1" => {
      :ENABLED => true,
      :SYMBOL  => "$",
      :DESC    => "Short Description",
      :ICON    => 30,
      :MAX     => 100,
      },
    
      "Currency2" => {
      :ENABLED => true,
      :SYMBOL  => "¢",
      :DESC    => "Short Description",
      :ICON    => 31,
      :MAX     => 9999999,
      },
    
      "Currency3" => {
      :ENABLED => true,
      :SYMBOL  => "*",
      :DESC    => "Short Description",
      :ICON    => 32,
      :MAX     => 100,
      },
    
      "Currency4" => {
      :ENABLED => false,
      :SYMBOL  => "₩",
      :DESC    => "Short Description",
      :ICON    => 32,
      :MAX     => 100,
      },
      
      "Currency5" => {
      :ENABLED => false,
      :SYMBOL  => "Ω",
      :DESC    => "Short Description",
      :ICON    => 32,
      :MAX     => 100,
      },
      
      "Currency6" => {
      :ENABLED => false,
      :SYMBOL  => "※",
      :DESC    => "Short Description",
      :ICON    => 32,
      :MAX     => 100,
      },
      
      "Currency7" => {
      :ENABLED => false,
      :SYMBOL  => "₫",
      :DESC    => "Short Description",
      :ICON    => 32,
      :MAX     => 100,
      },
      
    #DO NOT ADD MORE!
    } #DO NOT TOUCH!
    
  end
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ DO NOT EDIT BELOW HERE
#└──────────────────────────────────────────────────────────────────────────────
 
 
#┌──────────────────────────────────────────────────────────────────────────────
#│■ DataManager
#└──────────────────────────────────────────────────────────────────────────────
class << DataManager
  
  #ALIAS - CREATE_GAME_OBJECTS
  alias euphoria_multcurrency_datamanager_creategameobjects_24 create_game_objects
  def create_game_objects
    euphoria_multcurrency_datamanager_creategameobjects_24
    $ECurrency = ExtraCurrencies.new
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ ExtraCurrencies
#└──────────────────────────────────────────────────────────────────────────────
class NewCurrency
  attr_accessor :name
  attr_accessor :symbol
  attr_accessor :desc
  attr_accessor :icon
  attr_accessor :max
  attr_accessor :amount
  attr_accessor :enabled
  
  #NEW - INITIALIZE
  def initialize(name, symbol, desc, icon, max, amount, enabled)
    @name = name
    @symbol = symbol
    @desc = desc
    @icon = icon
    @max = max
    @amount = amount
    @enabled = enabled
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ ExtraCurrencies
#└──────────────────────────────────────────────────────────────────────────────
class ExtraCurrencies
  
  #NEW - INITIALIZE
  def initialize
    @ecurrencies = []
    add_currencies
  end
  
  #NEW - ADD_CURRENCIES
  def add_currencies
    Euphoria::Currencies::CURR_HASH.each {|name, val|
      currency = NewCurrency.new(name, val[:SYMBOL], val[:DESC],
          val[:ICON], val[:MAX], 0, val[:ENABLED])
      @ecurrencies.push(currency) if currency.enabled
    }
  end
  
  #NEW - ECURRENCIES_ARRAY
  def ecurrencies_array
    return @ecurrencies
  end
    
  #NEW - INCREASE_CURRENCY
  def increase_currency(curr_name, amt)
    currency = @ecurrencies.find {|cur| cur.name == curr_name }
    return false if currency.nil?
    currency.amount = [[currency.amount + amt, 0].max, currency.max].min
  end
  
  #NEW - DECREASE_CURRENCY
  def decrease_currency(curr_name, amt)
    currency = @ecurrencies.find {|cur| cur.name == curr_name }
    return false if currency.nil?
    currency.amount = [[currency.amount - amt, 0].max, currency.max].min
  end
  
  #NEW - SET_CURRENCY
  def set_currency(curr_name, amt)
    currency = @ecurrencies.find {|cur| cur.name == curr_name }
    return false if currency.nil?
    currency.amount = [[amt, 0].max, currency.max].min
  end
 
  #NEW - AMOUNT
  def amount(curr_name)
    currency = @ecurrencies.find {|cur| cur.name == curr_name }
    return false if currency.nil?
    return currency.amount
  end
  
  #NEW - SET_CURRENCY
  def set_currency(curr_name)
    currency = @ecurrencies.find {|cur| cur.name == curr_name }
    return false if currency.nil?
    return currency
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Window_Gold
#└──────────────────────────────────────────────────────────────────────────────  
class Window_ECurrencies < Window_Base
  
  #NEW - INITIALIZE
  def initialize
    case $ECurrency.ecurrencies_array.size
    when 7
      super(0, 0, window_width, 216)
    when 6
      super(0, 0, window_width, 192)
    when 5
      super(0, 0, window_width, 168)
    when 4
      super(0, 0, window_width, 144)
    when 3
      super(0, 0, window_width, 120)
    when 2
      super(0, 0, window_width, 96)
    when 1
      super(0, 0, window_width, 72)
    else
      super(0, 0, window_width, 48)
    end
    refresh
  end
  
  #NEW - WINDOW_WIDTH
  def window_width
    return 160
  end
  
  #NEW - REFRESH
  def refresh
    contents.clear
    draw_currency_value(value, currency_unit, 4, 0, contents.width -
    if $ECurrency.ecurrencies_array[0]
      draw_currency_value(val_one, unit_one, 4, 24, contents.width -
    end
    if $ECurrency.ecurrencies_array[1]
      draw_currency_value(val_two, unit_two, 4, 48, contents.width -
    end
    if $ECurrency.ecurrencies_array[2]
      draw_currency_value(val_thr, unit_thr, 4, 72, contents.width -
    end
    if $ECurrency.ecurrencies_array[3]
      draw_currency_value(val_for, unit_for, 4, 96, contents.width -
    end
    if $ECurrency.ecurrencies_array[4]
      draw_currency_value(val_fiv, unit_fiv, 4, 120, contents.width -
    end
    if $ECurrency.ecurrencies_array[5]
      draw_currency_value(val_six, unit_six, 4, 144, contents.width -
    end
    if $ECurrency.ecurrencies_array[6]
      draw_currency_value(val_svn, unit_svn, 4, 168, contents.width -
    end
  end
 
  #NEW - VALUE
  def value
    $game_party.gold
  end
 
  #NEW - CURRENCY_UNIT
  def currency_unit
    Vocab::currency_unit
  end
  
  #NEW - VAL_ONE
  def val_one
    return $ECurrency.ecurrencies_array[0].amount.to_i
  end
  
  #NEW - UNIT_ONE
  def unit_one
    return $ECurrency.ecurrencies_array[0].symbol.to_s
  end
  
  #NEW - VAL_TWO
  def val_two
    return $ECurrency.ecurrencies_array[1].amount.to_i
  end
  
  #NEW - UNIT_TWO
  def unit_two
    return $ECurrency.ecurrencies_array[1].symbol.to_s
  end
  
  #NEW - VAL_THR
  def val_thr
    return $ECurrency.ecurrencies_array[2].amount.to_i
  end
  
  #NEW - UNIT_THR
  def unit_thr
    return $ECurrency.ecurrencies_array[2].symbol.to_s
  end
  
  #NEW - VAL_FOR
  def val_for
    return $ECurrency.ecurrencies_array[3].amount.to_i
  end
  
  #NEW - UNIT_FOR
  def unit_for
    return $ECurrency.ecurrencies_array[3].symbol.to_s
  end
  
  #NEW - VAL_FIV
  def val_fiv
    return $ECurrency.ecurrencies_array[4].amount.to_i
  end
  
  #NEW - UNIT_FIV
  def unit_fiv
    return $ECurrency.ecurrencies_array[4].symbol.to_s
  end
  
  #NEW - VAL_SIX
  def val_six
    return $ECurrency.ecurrencies_array[5].amount.to_i
  end
  
  #NEW - UNIT_SIX
  def unit_six
    return $ECurrency.ecurrencies_array[5].symbol.to_s
  end
  
  #NEW - VAL_SVN
  def val_svn
    return $ECurrency.ecurrencies_array[6].amount.to_i
  end
  
  #NEW - UNIT_SVN
  def unit_svn
    return $ECurrency.ecurrencies_array[6].symbol.to_s
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Window_ECurrencyList
#└──────────────────────────────────────────────────────────────────────────────  
class Window_ECurrencyList < Window_Selectable
  
  #NEW - INITIALIZE
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @data = []
    activate
    select(0)
    refresh
  end
 
  #NEW - ITEM_MAX
  def item_max
    @data ? @data.size : 1
  end
  
  #NEW - REFRESH
  def refresh
    make_currency_list
    create_contents
    draw_all_items
  end
  
  #NEW - DRAW_ALL_ITEMS
  def draw_all_items
    item_max.times {|i| draw_currency(i) }
  end
  
  #NEW - DRAW_CURRENCY
  def draw_currency(index)
    currency = @data[index]
    if currency
      if currency.enabled
        rect = item_rect(index)
        draw_text(rect, currency.name, 1)
      end
    end
  end
 
  #NEW - CURRENCY
  def currency
    @data && index >= 0 ? @data[index] : nil
  end
  
  #NEW MAKE_CURRENCY_LIST
  def make_currency_list
    @data = $ECurrency.ecurrencies_array
  end
  
  #NEW - UPDATE_HELP
  def update_help
    data = @data[index]
    @help_window.set_currency(data)
  end
    
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Window_ECurrencyInfo
#└──────────────────────────────────────────────────────────────────────────────  
class Window_ECurrencyInfo < Window_Base
  
  #NEW - INITIALIZE
  def initialize(x, y, width, height)
    super(x, y, width, height)
  end
  
  #NEW - CURRENCY=
  def currency=(index)
    return if @currency == index
    @currency = index
    refresh
  end
  
  #NEW - REFRESH
  def refresh
    contents.clear
    draw_currency_info
    return if @currency
  end
  
  #NEW - SET_CURRENCY
  def set_currency(currency)
    @currency = currency
    refresh
  end
  
  #NEW - DRAW_CURRENCY_INFO
  def draw_currency_info
    draw_icon(@currency.icon, 185, 0)
    header = @currency.name
    make_font_bigger
    draw_text(0, 30, 394, 48, header, 1)
    make_font_smaller
    draw_icon(@currency.icon, 185, 80)
    owned = "Amount Owned:"
    ownednum = @currency.amount
    draw_text(0, 108, 394, line_height, owned, 1)
    draw_text(0, 132, 394, line_height, ownednum, 1)
    offsymbol = "Official Symbol: "
    realsymbol = @currency.symbol
    draw_text(0, 176, 394, line_height, offsymbol, 1)
    draw_text(0, 200, 394, line_height, realsymbol, 1)
    desc = @currency.desc
    draw_text(0, 248, 394, line_height, desc, 1)
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Window_ECurrencyHelp
#└──────────────────────────────────────────────────────────────────────────────
class Window_ECurrencyHelp < Window_Base
  
  #NEW - INITIALIZE
  def initialize(x, y, width, height)
    super(x, y, width, height)
    refresh
  end
  
  #NEW - REFRESH
  def refresh
    contents.clear
    draw_currency_help
  end
  
  #NEW - DRAW_CURRENCY_HELP
  def draw_currency_help
    text = "View Currency Information"
    make_font_bigger
    draw_text(0, 0, 544, 48, text, 1)
    make_font_smaller
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Scene_CurrencyView
#└──────────────────────────────────────────────────────────────────────────────
class Scene_CurrencyView < Scene_MenuBase
  
  #NEW - START
  def start
    super
    create_cur_list
    create_cur_info
    create_cur_help
  end
  
  #NEW - CREATE_CUR_LIST
  def create_cur_list
    @cur_list = Window_ECurrencyList.new(0, 72, 150, 344)
    @cur_list.viewport = @viewport
    @cur_list.set_handler(:cancel, method(:return_scene))
  end
  
  #NEW - CREATE_CUR_INFO
  def create_cur_info
    @cur_info = Window_ECurrencyInfo.new(150, 72, 394, 344)
    @cur_info.viewport = @viewport
    @cur_list.help_window = @cur_info
  end
  
  #NEW - CREATE_CUR_HELP
  def create_cur_help
    @help_window = Window_ECurrencyHelp.new(0, 0, 544, 72)
    @help_window.viewport = @viewport
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Scene_Menu
#└──────────────────────────────────────────────────────────────────────────────
if Euphoria::Currencies::NEW_GOLD_WINDOW == true
class Scene_Menu < Scene_MenuBase
  
  #OVERWRITE
  def start
    super
    create_command_window
    create_new_gold_window
    create_status_window
  end
  
  #NEW - CREATE_NEW_GOLD_WINDOW
  def create_new_gold_window
    @gold_window = Window_ECurrencies.new
    @gold_window.x = 0
    @gold_window.y = Graphics.height - @gold_window.height
  end
 
end
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Window_MenuCommand
#└──────────────────────────────────────────────────────────────────────────────
class Window_MenuCommand < Window_Command
  
  #ALIAS - ADD_MAIN_COMMANDS
  alias euphoria_multcurrency_windowmenucommand_addmaincommands_24 add_main_commands
  def add_main_commands
    euphoria_multcurrency_windowmenucommand_addmaincommands_24
    if Euphoria::Currencies::SET_MENU_COMMAND == true
      add_command(Euphoria::Currencies::SET_MENU_NAME, :currency)
    end
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Scene_Menu
#└──────────────────────────────────────────────────────────────────────────────
class Scene_Menu < Scene_MenuBase
  
  #ALIAS - CREATE_COMMAND_WINDOW
  alias euphoria_multcurrency_scenemenu_createcommandwindow_24 create_command_window
  def create_command_window
    euphoria_multcurrency_scenemenu_createcommandwindow_24
    if Euphoria::Currencies::SET_MENU_COMMAND == true
      @command_window.set_handler(:currency, method(:command_currency))
    end
  end
  
  #NEW - COMMAND_CURRENCY
  def command_currency
    SceneManager.call(Scene_CurrencyView)
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ End Script
#└──────────────────────────────────────────────────────────────────────────────
SCRIPT 2 - TIENDAS
Código:

#┌──────────────────────────────────────────────────────────────────────────────
#│
#│                         *Alternate Currency Shops*
#│                              Version: 1.0
#│                            Author: Euphoria
#│                            Date: 8/20/2014
#│                        Euphoria337.wordpress.com
#│                        
#├──────────────────────────────────────────────────────────────────────────────
#│■ Important: None
#├──────────────────────────────────────────────────────────────────────────────
#│■ History: None                        
#├──────────────────────────────────────────────────────────────────────────────
#│■ Terms of Use: This script is free to use in non-commercial games only as
#│                long as you credit me (the author). For Commercial use contact
#│                me.
#├──────────────────────────────────────────────────────────────────────────────                          
#│■ Instructions: This script REQUIRES "Euphoria - Alternate Currencies" V1.1 or
#│                higher to work!
#│                
#│                You can now create shops for your Alternate Currencies! to do
#│                so you must go into the editable region and create your shop!
#│                The format for creating a shop is:
#│
#│                "Shop Name" => {
#│                :ITEMS => [x, x, x],
#│                  note: replace x with the item ID numbers, you can have more
#│                        than three or less than three or none, its up to you
#│                :ITEMS_P => [x, x, x],    
#│                  note: replace x with the desired price for the corresponding
#│                        item, there MUST be the same number of prices as items
#│                :WEAPONS => [x, x],
#│                  note: same rules as :ITEMS
#│                :WEAPONS_P => [x, x],
#│                  note: same rules as :ITEMS_P
#│                :ARMORS => [x, x, x],
#│                  note: same rules as :ITEMS
#│                :ARMORS_P => [x, x, x],
#│                  note: same rules as :ITEMS_P
#│                },
#│
#│                When setting up a shop, DO NOT INCLUDE THE NOTES, those are
#│                simply for instruction. You'll see examples below of what the
#│                shop setup looks like without the notes in between. Also DO
#│                NOT FORGET to add a comma (,) after each set of brackets, and
#│                after the ending curly bracket you can already see this is
#│                done in the examples above and below.
#│
#│                OKAY! So now you have your shop(s) set up (you can make as
#│                many as you want). Now you need to call your shop. You will be
#│                calling each shop by name and the currency you want it to use,
#│                so it is important that each shop name is unique. The call for
#│                opening the shop in an event is:
#│
#│                $EShop.call("shop name", "currency name", purchase only = x)
#│
#│                Replace "shop name" with your shops name, but keep it in
#│                quotes! Replace "currency name" with the name of your currency
#│                (created in Euphoria - Alternate Currencies) you wish to use.
#│                ONLY type in purchase_only if you want to set the x to true,
#│                if not you may leave out the purchase_only option as it is set
#│                to false by default. Here are some examples:
#│
#│                A shop that you can buy or sell at named "shop1" with "money"
#│                as the currency (note: money must be a created and enabled
#│                currency in the other script):
#│
#│                $EShop.call("Shop1", "Money")
#│
#│                Notice how purchase_only is left out, because we want it set
#│                to false! Now, for a shop that only allows the user to buy,
#│                has the name "awesome shop" and uses the currency "Currency":
#│
#│                $EShop.call("awesome shop", "Currency", purchase_only = true)
#│
#│                Purchase_only is in this call ONLY because we wish to set it
#│                to true! I think you should get it by now, but feel free to
#│                ask any questions you still have on my website or in the topic
#│                where I post the link to this script! Enjoy!          
#└──────────────────────────────────────────────────────────────────────────────
if $imported["EuphoriaAlternateCurrencies"] != true
msgbox_p("Euphoria - Alternate Currencies REQUIRED")
exit
else
$imported ||= {}
$imported["EuphoriaAlternateShops"] = true
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Editable Region
#└──────────────────────────────────────────────────────────────────────────────
module Euphoria
  module CurrencyShops
 
 
    CURRENCY_SHOPS = { #DO NOT TOUCH
 
      "Shop1" => {
      :ITEMS      => [ 1,  2,  3],
      :ITEMS_P    => [50, 20, 10],
      :WEAPONS    => [  1,  2],
      :WEAPONS_P  => [100, 75],
      :ARMORS     => [],
      :ARMORS_P   => [],
      },
      
      "Shop2" => {
      :ITEMS      => [ 5,  7,  9],
      :ITEMS_P    => [25, 20, 15],
      :WEAPONS    => [  7, 10],
      :WEAPONS_P  => [180, 90],
      :ARMORS     => [ 1,  3,   7],
      :ARMORS_P   => [66, 53, 107],
      },
      
    }#DO NOT TOUCH
    
  end
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ DO NOT EDIT BELOW HERE
#└──────────────────────────────────────────────────────────────────────────────
 
 
#┌──────────────────────────────────────────────────────────────────────────────
#│■ DataManager
#└──────────────────────────────────────────────────────────────────────────────
class << DataManager
  
  #ALIAS - CREATE_GAME_OBJECTS
  alias euphoria_currshops_datamanager_creategameobjects_25 create_game_objects
  def create_game_objects
    euphoria_currshops_datamanager_creategameobjects_25
    $EShop = EShop.new
  end
 
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ EShop
#└──────────────────────────────────────────────────────────────────────────────
class EShop
  
  #NEW - INITIALIZE
  def initialize
    @inventory = []
    @shop_name = ""
  end
  
  #NEW - INVENTORY
  def inventory
    @inventory
  end
  
  #NEW - CALL
  def call(shop_name, currency, purchase_only = false)
    $EShop.items_for_creation(shop_name)
    SceneManager.call(Scene_ECurrencyShop)
    SceneManager.scene.prepare($EShop.inventory, currency, purchase_only)
  end
  
  #NEW - ITEMS_FOR_CREATION
  def items_for_creation(shop_name)
    Euphoria::CurrencyShops::CURRENCY_SHOPS.each {|name, val|
      if name == shop_name && Euphoria::CurrencyShops::CURRENCY_SHOPS.has_key?(shop_name)
        @shop_name = shop_name
        if val[:ITEMS].size != 0
          val[:ITEMS].size.times {|id|
            item = create_item(0, val[:ITEMS][id], val[:ITEMS_P][id])
            @inventory.push(item) unless @inventory.include?(item)
          }
        end
        if val[:WEAPONS].size !=0
          val[:WEAPONS].size.times {|id|
            item = create_item(1, val[:WEAPONS][id], val[:WEAPONS_P][id])
            @inventory.push(item) unless @inventory.include?(item)
          }
        end
        if val[:ARMORS].size != 0
          val[:ARMORS].size.times {|id|
            item = create_item(2, val[:ARMORS][id], val[:ARMORS_P][id])
            @inventory.push(item) unless @inventory.include?(item)
          }
        end
      end
    }
  end
      
  #NEW - CREATE_ITEM
  def create_item(item_type, item_id, price)
    item = EItem.new(item_type, item_id, price)
    goods = [item.type, item.id, item.price]
    return goods
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ EItem
#└──────────────────────────────────────────────────────────────────────────────
class EItem
  attr_accessor :type
  attr_accessor :id
  attr_accessor :price
  
  #NEW - INITIALIZE
  def initialize(item_type, item_id, item_price)
    @type = item_type
    @id = item_id
    @price = item_price
  end
    
  #NEW - GET_ITEMS
  def get_items
    if @type == 0
      return @data_items[@id]
    end  
    if @type == 1
      return @data_weapons[@id]
    end
    if @type == 2
      return @data_armors[@id]
    end
  end
    
  #NEW - PRICE
  def price
    return @price
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Window_ECurrencyShopBuy
#└──────────────────────────────────────────────────────────────────────────────
class Window_ECurrencyShopBuy < Window_ShopBuy
  
  #NEW - MAKE_ITEM_LIST
  def make_item_list
    @data = []
    @price = {}
    @shop_goods.each do |goods|
      case goods[0]
      when 0;  item = $data_items[goods[1]]
      when 1;  item = $data_weapons[goods[1]]
      when 2;  item = $data_armors[goods[1]]
      end
      if item
        @data.push(item)
        @price[item] = goods[2]
      end
    end
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Window_ECurrencyShopGold
#└──────────────────────────────────────────────────────────────────────────────
class Window_ECurrencyShopGold < Window_Base
  
  #NEW - INITIALIZE
  def initialize(currency)
    super(384, 72, 160, 48)
    @currency = currency
    refresh
  end
 
  #NEW - REFRESH
  def refresh
    contents.clear
    draw_currency_value(amount, currency_symbol, 4, 0, contents.width -
  end
  
  #NEW - CURRENCY_SYMBOL
  def currency_symbol
    @currency.symbol
  end
  
  #NEW - AMOUNT
  def amount
    @currency.amount
  end
  
  #NEW - OPEN
  def open
    refresh
    super
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ Scene_ECurrencyShop
#└──────────────────────────────────────────────────────────────────────────────
class Scene_ECurrencyShop < Scene_Shop
  
  #NEW - PREPARE
  def prepare(inventory, currency, purchase_only = false)
    @items = inventory
    @currency = $ECurrency.set_currency(currency)
    @purchase_only = purchase_only
  end
 
  #NEW - START
  def start
    super
    create_gold_window
    create_command_window
    create_dummy_window
    create_number_window
    create_status_window
    create_buy_window
    create_category_window
    create_sell_window
  end
  
  #NEW - CREATE_GOLD_WINDOW
  def create_gold_window
    @gold_window = Window_ECurrencyShopGold.new(@currency)
    @gold_window.viewport = @viewport
    @gold_window.x = Graphics.width - @gold_window.width
  end
 
  #NEW - CREATE_BUY_WINDOW
  def create_buy_window
    @buy_window = Window_ECurrencyShopBuy.new(0, 120, 296, @items)
    @buy_window.viewport = @viewport
    @buy_window.help_window = @help_window
    @buy_window.status_window = @status_window
    @buy_window.hide
    @buy_window.set_handler(:ok,     method(:on_buy_ok))
    @buy_window.set_handler(:cancel, method(:on_buy_cancel))
  end
  
  #NEW - DO_BUY
  def do_buy(number)
    $ECurrency.decrease_currency(@currency.name, number * buying_price)
    $game_party.gain_item(@item, number)
  end
  
  #NEW - DO_SELL
  def do_sell(number)
    $ECurrency.increase_currency(@currency.name, number * selling_price)
    $game_party.lose_item(@item, number)
  end
 
  #NEW - MONEY
  def money
    @currency.amount
  end
  
  #NEW - CURRENCY_UNIT
  def currency_unit
    @currency.symbol
  end
  
end
#┌──────────────────────────────────────────────────────────────────────────────
#│■ End Script
#└──────────────────────────────────────────────────────────────────────────────
Espero que les sirva. Salu2
JapoZero
JapoZero
Héroe
Héroe

Masculino
Chile
RPG Maker : MV
Mensajes : 708
Monedas : 4365
Reputación : 289
Localización : Chile

Volver arriba Ir abajo

Volver arriba


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