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 6563
437 Simple Fon Chage 3 Man... 2008.10.28 1221
» 아이템 Item Price Changer 7 Man... 2008.10.28 1586
435 전투 Fomars indiviivdual battle 2 Man... 2008.10.28 1375
434 Repel Effect 1 Man... 2008.10.28 1763
433 퍼스 스크립트 5 Man... 2008.10.28 1690
432 Direction Movement Style 4 Man... 2008.10.28 1723
431 SephirothSpawn's Slanted Bars in VX 1.1 2 Man... 2008.10.28 1584
430 상점 Shopoholic(한글 설명) 11 Man... 2008.10.29 3259
429 장비 Disposable Ammo(또 있는 곳을 잘 읽으셔야 합니다.) 2 Man... 2008.10.29 1723
428 메뉴 Adding Extra Menu in lafia Script 2 Man... 2008.10.29 1591
427 제작도구 최대한 한글로 변혁 했음Window Maker V1.0(대박) 15 Man... 2008.10.29 4699
426 HUD Crissaegrim HUD 2.0!! 13 Man... 2008.10.29 2872
425 이름입력 모그 이름 바꾸기 한글 변역! 2 Man.... 2008.11.04 4139
424 기타 Crissaegrim Farm BETA 1.0.0 10 Man... 2008.11.22 3115
423 기타 디스크 체인져 VX!! (업데이트..) 30 file Tofuman 2008.12.02 3184
422 기타 이벤트 위치 저장 스크립트 10 Tofuman 2008.12.11 2126
421 상점 상점 무기, 방어구 능력치 비교 스크립트! 18 불독 2008.12.25 3643
420 타이틀/게임오버 타이틀 화면에 매뉴창 이동방법 5 석산 2009.01.06 2864
419 온라인 넷VX - 온라인 스크립트 29 아방스 2009.01.06 6798
418 맵/타일 VX Mode 7 스크립트!!!! 42 file Tofuman 2009.01.07 4330
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32