Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> + [ Item Price Changer ] +, * Change item/weapon/armor's price with call-script
woratana
post Jun 27 2008, 03:04 AM
Post #1


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




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. biggrin.gif

Enjoy~ laugh.gif


Screenshots
-No screenshot-


Script
Place it above main

CODE
CODE
#===============================================================
# ● [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.

QUOTE
#==================================================================
# ** 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:
QUOTE
- 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?

Attached File(s)
Attached File  VX_pricechange10.txt ( 2.31K ) Number of downloads: 60
 


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 27 2008, 03:31 AM
Post #2


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




Haha, this script is like a lite version of Tax system for XP. Definitely usefull for floating price of items smile.gif

cheers, puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
Learwolf
post Jun 27 2008, 07:00 AM
Post #3


Level 3
Group Icon

Group: Member
Posts: 35
Type: None
RM Skill: Beginner




Holy cow, I was just about to start looking for a script like this! Great work Woratana biggrin.gif


This post has been edited by Learwolf: Jun 27 2008, 08:11 AM


__________________________
-Lear
Go to the top of the page
 
+Quote Post
   
kingoftheroad
post Jun 27 2008, 10:18 AM
Post #4


Level 4
Group Icon

Group: Member
Posts: 49
Type: Mapper
RM Skill: Advanced




Great for making greedy shopkeepers:)


__________________________
Go to the top of the page
 
+Quote Post
   
woratana
post Jun 27 2008, 10:01 PM
Post #5


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




I'm glad you guys like this little script >_>"


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
drebenk
post Jun 28 2008, 01:44 AM
Post #6


Level 20
Group Icon

Group: Revolutionary
Posts: 405
Type: Event Designer
RM Skill: Skilled




@woratana man another great script from you. Good Job mate!

P.S. I'll wait for the minimap script to be released too. ^^


__________________________
Nobody dies a virgin. Sooner or later life f***s everybody.
Go to the top of the page
 
+Quote Post
   
Emp-groove
post Nov 26 2010, 04:25 PM
Post #7


Level 2
Group Icon

Group: Member
Posts: 25
Type: Artist
RM Skill: Beginner




Gosh Woratana, you've created the first ever Wall Street stock script for VX! This will definitely work well for a merchant game. In fact, I will use this in my game Yen-Ping.

The last post was in 2008. Don't necropost unless you have a bug report. ~Kread


__________________________
Hmm, when you break your model castle using a toy knight, it kindof is an inspiration.
----

Just how does helium make your voice squeaky? -A message from Alvin the Chipmunk



My name is Kyle.
Kyle is from a Scottish surname derived from the word 'caol', which in Gaelic means 'narrow strait', or 'little channel'.
Namesakes: Hurricane Kyle, 2002
My name was most popular around 1990.
Go to the top of the page
 
+Quote Post
   
Tacoghandi
post Jun 24 2011, 01:18 PM
Post #8


Level 1
Group Icon

Group: Member
Posts: 11
Type: None
RM Skill: Undisclosed




I put this on my game and when i try to call the script i get this error

SyntaxError occurred while running script.

Am i doing something wrong.

[edit] NVM found out i was entering in the item id wrong. [edit]

This post has been edited by Tacoghandi: Jun 24 2011, 01:41 PM
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd May 2013 - 08:55 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker