Ace 스크립트

itemRarity1.jpg

이 스크립트는 아이템 등급을 아이템과 장비에 할당하도록 허용합니다.

 

아이템 등급은 이름 색상으로 표시됩니다.

 

기본적으로 모든 이름은 흰색입니다. 

다른 등급의 아이템을 다른 색상을 갖도록 사용자 정의 할 수 있습니다

 

- 사용법 -

아이템 등급에 대한 메모 태그 항목을 지정합니다.

 

----------------------------------------------------------------

<item rarity: x>

----------------------------------------------------------------

 

여기서 x는 숫자입니다.

구성에서는 각각의 아이템 등급과 관련된 색상을 설정할 수 있습니다 . 

색상은 RGB 형식으로 지정됩니다. 몇 가지 샘플 항목이 제공됩니다.

 

출처: http://himeworks.com/2014/03/item-rarity/






#===============================================================================
 Title: Item Rarity
 Author: Hime
 Date: Mar 26, 2014
 URL: http://www.himeworks.com/2014/03/25/item-rarity/
--------------------------------------------------------------------------------
 ** Change log
 Apr 11, 2014
   - fixed bug where item color affects other rows as well
 Mar 26, 2014
   - Fixed bug where loading skills crashed. You can now tag skills with rarity
   - Extended to all base item objects
 Mar 25, 2014
   - Initial release
--------------------------------------------------------------------------------   
 ** Terms of Use
 * Free to use in non-commercial projects
 * Contact me for commercial use
 * No real support. The script is provided as-is
 * Will do bug fixes, but no compatibility patches
 * Features may be requested but no guarantees, especially if it is non-trivial
 * Credits to Hime Works in your project
 * Preserve this header
--------------------------------------------------------------------------------
 ** Description
 
 This script allows you to assign item rarities to items and equips.
 
 Rarity is indicated by name colour: by default, all names are white. 
 You can customize this so that different rarity levels have different
 colours.
 
--------------------------------------------------------------------------------
 ** Installation
 
 In the script editor, place this script below Materials and above Main

--------------------------------------------------------------------------------
 ** Usage 
 
 To specify rarity, note-tag items and equips with
 
   <item rarity: x>
   
 Where x is a number.
 In the configuration, you can set up the colours associated with each rarity
 level.
 
#===============================================================================
=end
$imported = {} if $imported.nil?
$imported[:TH_ItemRarity] = true
#===============================================================================
# ** Configuration
#===============================================================================
module TH
  module Item_Rarity
    
    # Colours associated with each rarity. The colours are specified as
    # RGB values. So for example, White is [255, 255, 255]
    Colour_Map = {
      1 => [255, 255, 255],
      2 => [204, 255, 137],
      3 => [197, 122, 255],
      4 => [255, 84, 0],
    }
    
    Regex = /<item[-_ ]rarity:\s*(\d+)\s*>/i
    
#===============================================================================
# ** Rest of script
#===============================================================================
    @@rarity_colour_map = nil
    
    def self.rarity_colour_map
      unless @@rarity_colour_map
        @@rarity_colour_map = {}
        Colour_Map.each do |i, arr|
          @@rarity_colour_map[i] = Color.new(*arr)
        end
      end
      return @@rarity_colour_map
    end
  end
end

module RPG
 
  class BaseItem
    def rarity
      load_notetag_item_rarity unless @rarity
      return @rarity
    end
    
    def load_notetag_item_rarity
      @rarity = 1
      res = self.note.match(TH::Item_Rarity::Regex)
      if res
        @rarity = res[1].to_i
      end
    end
    
    def rarity_colour
      TH::Item_Rarity.rarity_colour_map[self.rarity]
    end
  end
end

class Window_Base < Window
  
  #-----------------------------------------------------------------------------
  # Replaced
  #-----------------------------------------------------------------------------
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    draw_icon(item.icon_index, x, y, enabled)
    change_color(item.rarity_colour, enabled)
    draw_text(x + 24, y, width, line_height, item.name)
		change_color(normal_color, enabled)
  end
end


#===============================================================================
# Instance Item extension
#===============================================================================
if $imported["TH_InstanceItems"]
  module RPG
    class BaseItem
      alias :th_item_rarity_refresh :refresh
      def refresh
        th_item_rarity_refresh
        refresh_item_rarity
      end
      
      def refresh_item_rarity
        var = InstanceManager.get_template(self).rarity
        @rarity = make_item_rarity(InstanceManager.make_full_copy(var))
      end

      def make_item_rarity(rarity)
        rarity
      end
    end
  end
end
Atachment
첨부 '1'
  • ?
    크크섬 2019.08.01 13:56
    감사합니다
  • ?
    크크섬 2019.08.01 14:26
    제일 윗줄에 =begin 한 줄 추가해줘야 정상적으로 작동합니다.
    그리고 레어리티 적용은 각 아이템 메모란에 <item rarity: 등급별 숫자> 를 입력해주시면 됩니다.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 5110
공지 RPG VX ACE 유용한 링크 모음 16 아방스 2012.01.03 28927
197 전투 자동전투 명령어 추가 스크립트 2 스리아씨 2013.10.11 1953
196 기타 이동제한 스크립트 5 file 스리아씨 2013.09.23 1769
195 기타 유용한 외국 스크립트사이트 하나 발견했네요 영어조금하시면 이해가능하실꺼에요 2 game 光 ㅋㅋ 2013.01.07 2574
194 기타 원하는 글씨체로 변경하기 12 조말생 2012.04.20 8847
193 기타 없는 것 같아서 올립니다. VX ACE 한계 돌파 스크립트입니다. 24 빙룡군 2012.07.07 5597
192 아이템 양손무기 작착 스크립트 [Dual Wield -> Free Hands Version 1.0] 7 file 아방스 2012.01.31 4633
191 액터 액터 스탯 분배 스크립트 14 file 스리아씨 2013.09.23 2678
190 맵/타일 안개 시스템 ( VXA ) 8 홍색의환상향 2013.05.19 4090
189 기타 아이템 합성 스크립트 4 file 스리아씨 2013.09.26 3138
188 아이템 아이템 팝업 스크립트 15 스리아씨 2013.10.17 3243
187 메시지 아이템 정보 메세지가 뜨는 아이템 획득 1 폴라 2015.05.21 2244
186 메뉴 아이템 설명 메뉴 스크립트 (Crazyninjaguy) 2 file IZEN 2013.04.18 4780
» HUD 아이템 레어리티 스크립트 (번역기 돌림) 2 file 부초 2017.07.21 1425
184 타이틀/게임오버 시작 전 로고 띄우기 7 file 냐냐 2014.12.04 3370
183 메뉴 시스템 칼라 스크립트 3 file 스리아씨 2013.10.27 3238
182 기타 시디 플레이어 1.0 by 77er 1 file 77ER. 2013.08.20 1627
181 메뉴 스텟을 랭크로 나타내기 7 file Yeolde 2014.05.10 3536
180 전투 스킬 캐스팅 시스템 3 스리아씨 2013.10.12 32167
179 스킬 스킬 스틸 시스템 5 아르피쥐 2011.12.18 3880
178 스킬 스킬 숙련도 시스템 8 아이미르 2012.02.24 4918
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 Next
/ 11