VX 스크립트

#===============================================================
# ● [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
Comment '7'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
217 상점 상점 무기, 방어구 능력치 비교 스크립트! 18 불독 2008.12.25 3611
216 기타 이벤트 위치 저장 스크립트 10 Tofuman 2008.12.11 2096
215 기타 디스크 체인져 VX!! (업데이트..) 30 file Tofuman 2008.12.02 3168
214 기타 Crissaegrim Farm BETA 1.0.0 10 Man... 2008.11.22 3093
213 이름입력 모그 이름 바꾸기 한글 변역! 2 Man.... 2008.11.04 4114
212 HUD Crissaegrim HUD 2.0!! 13 Man... 2008.10.29 2852
211 제작도구 최대한 한글로 변혁 했음Window Maker V1.0(대박) 15 Man... 2008.10.29 4672
210 메뉴 Adding Extra Menu in lafia Script 2 Man... 2008.10.29 1574
209 장비 Disposable Ammo(또 있는 곳을 잘 읽으셔야 합니다.) 2 Man... 2008.10.29 1696
208 상점 Shopoholic(한글 설명) 11 Man... 2008.10.29 3185
207 SephirothSpawn's Slanted Bars in VX 1.1 2 Man... 2008.10.28 1572
206 Direction Movement Style 4 Man... 2008.10.28 1719
205 퍼스 스크립트 5 Man... 2008.10.28 1679
204 Repel Effect 1 Man... 2008.10.28 1753
203 전투 Fomars indiviivdual battle 2 Man... 2008.10.28 1339
» 아이템 Item Price Changer 7 Man... 2008.10.28 1530
201 Simple Fon Chage 3 Man... 2008.10.28 1212
200 Screen Resolution 3 Man... 2008.10.28 1171
199 Enable Usage of Rmxp 캐릭터(?) 5 Man... 2008.10.28 2413
198 Multi-threader snippet by Omegazion Man... 2008.10.28 1107
Board Pagination Prev 1 ... 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Next
/ 32