collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: + [ Item Price Changer ] +  (Gelesen 1697 mal)

woratana

  • Gast
+ [ Item Price Changer ] +
« am: Juni 27, 2008, 12:32:34 »
Item Price Changer
Version 1.0
by Woratana
Release Date: 27/06/2008


Introduction
This script will allow you to change item/weapon/armor's price easily with call script.

So you can make item that its price can change all the time. :D

Enjoy~  :lol:


Screenshots
-No screenshot-


Script
Place it above main

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']#===============================================================
# ? [VX] ? Item Price Changer ? ?
# * Change item/weapon/armor's price in-game *
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 26/06/2008
# ? Version: 1.0
#--------------------------------------------------------------

#==================================================================
# ** HOW TO USE **
#-----------------------------------------------------------------
# ** To change item's price, call script:
#  Price_Edit.item(id, price)
#
# * id: ID of item you want to change price
# * price: New price
#
# ** To change weapon's price, call script:
#  Price_Edit.weapon(id, price)
#
# ** To change armor's price, call script:
#  Price_Edit.armor(id, price)
#
# ** You can leave the price blank to reset item's price:
#  Price_Edit.item(id)
#  Price_Edit.weapon(id)
#  Price_Edit.armor(id)
# * This will use default price you set in database.
#===============================================================

module Price_Edit
  def self.item(id, price = nil)
    price ||= $data_items[id].real_price
    $game_system.new_price['item'][id] = price
  end
  
  def self.weapon(id, price = nil)
    price ||= $data_weapons[id].real_price
    $game_system.new_price['weapon'][id] = price
  end
  
  def self.armor(id, price = nil)
    price ||= $data_armors[id].real_price
    $game_system.new_price['armor'][id] = price
  end
end

class Game_System
  def new_price
    if @new_price.nil?
      @new_price = {}
      @new_price['item'] = []
      @new_price['weapon'] = []
      @new_price['armor'] = []
    end
    return @new_price
  end
end

module RPG
  class BaseItem
    def real_price
      return @price
    end
  end
  
  class Item
    def price
      return $game_system.new_price['item'][@id].nil? ? @price :
    $game_system.new_price['item'][@id]
    end
  end
  
  class Weapon
    def price
      return $game_system.new_price['weapon'][@id].nil? ? @price :
    $game_system.new_price['weapon'][@id]
    end
  end
  
  class Armor
    def price
      return $game_system.new_price['armor'][@id].nil? ? @price :
    $game_system.new_price['armor'][@id]
    end
  end
end


Instruction
Place the script above main.

Zitat
#==================================================================
# ** HOW TO USE **
#-----------------------------------------------------------------
# ** To change item's price, call script:
#  Price_Edit.item(id, price)
#
# * id: ID of item you want to change price
# * price: New price
#
# ** To change weapon's price, call script:
#  Price_Edit.weapon(id, price)
#
# ** To change armor's price, call script:
#  Price_Edit.armor(id, price)
#
# ** You can leave the price blank to reset item's price:
#  Price_Edit.item(id)
#  Price_Edit.weapon(id)
#  Price_Edit.armor(id)
# * This will use default price you set in database.
#===============================================================



Author's Notes
Free for use in your work if credit is included.


Bug Report?
Please give me these informations:
Zitat
- What is it says in error window?
- When is it get error? (Right after run game, when you choose something, etc.)
- Do you have any other scripts running in your game that may crash with this script?

+ [ Item Price Changer ] +

Offline FL3X

  • Zahnfee
  • Mr. MACK-Tile
  • ***
  • Beiträge: 243
  • Spriter
    • RPG PIXEL
+ [ Item Price Changer ] +
« Antwort #1 am: Juni 27, 2008, 14:38:16 »
Nice Skript Woratana. I think it would be realy helpfull.





+ [ Item Price Changer ] +

Offline Master-M

  • FF IX Remaker
  • Mr. MACK-Tile
  • ***
  • Beiträge: 261
  • FF IX Remaken...
+ [ Item Price Changer ] +
« Antwort #2 am: Juni 27, 2008, 19:11:11 »
I think that's a good script
and maby I can use it.
Thank you for this script


Re: + [ Item Price Changer ] +

Kenshin

  • Gast
Re: + [ Item Price Changer ] +
« Antwort #3 am: Juni 30, 2008, 22:06:25 »
Thank you Woratane you help me  :o

 


 Bild des Monats

rooftop party

Views: 3581
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal