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
57 메뉴 Adding Extra Menu in lafia Script 2 Man... 2008.10.29 1574
56 SephirothSpawn's Slanted Bars in VX 1.1 2 Man... 2008.10.28 1572
» 아이템 Item Price Changer 7 Man... 2008.10.28 1530
54 Path Finding 6 Man... 2008.10.08 1530
53 Sprite Mover 2 Man... 2008.10.27 1529
52 타이틀/게임오버 Title Skip System : 타이틀 스킵 file 허걱 2014.03.19 1510
51 기타 Drop Options 1.1 by Modern Algebra 4 Alkaid 2010.09.16 1509
50 Skill Delay VX 4 Man... 2008.10.28 1503
49 변수/스위치 Variable Criticals Man... 2008.10.28 1480
48 메뉴 Etude87's Menu Editor for VX 25 습작 2015.01.14 1461
47 오디오 사운드 자동 변환 설정 rukan 2009.07.01 1461
46 타이틀/게임오버 Random Title Screen 2 Man... 2008.10.28 1454
45 무슨 스크립트인지 모름 7 Man... 2008.10.26 1453
44 이동 및 탈것 대쉬금지의 변경 1 rukan 2009.07.02 1449
43 (?스크립트) 스크립트 읽어서 그래픽 넣으세요.(영어 잘하는 사람만 권장...) 2 Man... 2008.10.27 1444
42 KID's Luck Systems(무슨 뜻?) 4 Man... 2008.10.27 1378
41 영어 잘하는 사람만 보세요..저도 모르겠음(무슨 스크립트인지) 3 Man... 2008.10.27 1372
40 기타 페이드 시간 변경 2 rukan 2009.07.01 1360
39 기타 Resize and Scale by OriginalWij 1 습작 2013.05.13 1349
38 기타 MSX - XP Characters on VX/VX Ace 2 Alkaid 2013.01.26 1346
Board Pagination Prev 1 ... 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Next
/ 32