XP 스크립트

이벤트에서 스크립트로 Window_ItemAcquired.new(갯수, 타입, ID)로 화면 상단에 아이템 입수창을 띄우는 스크립트입니다.

#==============================================================================
# ** Window_ItemAcquired
#------------------------------------------------------------------------------
# This window displays a message when the player acquires an item.
# Script version 1.1 written by SiliconHero (09/22/2005)
#
# To use this in an event, use the Script command and type the following:
# Window_ItemAcquired.new(quantity, type, index)
# quantity = the number of items that have been found
# type = the type of item that is found (1 = item, 2 = weapon, 3 = armor)
# index = the item index (see the database)
#
# 1.1 (9/22/2005) - Window fades out when the "C" button is pressed.
# 1.0 (9/18/2005) - First version of the script.
#
# Special thanks to MagicMagor and Huitzilopoctli from RMXP.net for
# ideas and help.
#==============================================================================

class Window_ItemAcquired < Window_Base
def initialize(quantity, type, index)
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@quantity = quantity
@type = type
@index = index
self.pause = false
self.back_opacity = 127

self.contents.font.color = normal_color
# Process the item type
# type: 1 = item, 2 = weapon, 3 = armor
case @type
when 1
item = $data_items[@index]
when 2
item = $data_weapons[@index]
when 3
item = $data_armors[@index]
end
# Piece together the item acquisition string
# If more than one item is found, add the quantity to the message string
if @quantity > 1 then
text = "Acquired " + item.name + " ×" + @quantity.to_s + "!"
else
text = "Acquired " + item.name + "!"
end
# Play Item Acquired SE
Audio.se_play("Audio/SE/056-Right02.ogg", 100, 100)
self.pause = true
# draw the window
while not Input.trigger?(Input::C)
Input.update
Graphics.update
self.contents.clear
self.contents.draw_text(4, 0, self.width - 40, 32, text, 1)
end
# Fade out the window
while self.opacity > 0
self.opacity -= 24
Graphics.update
end
self.dispose
end
end

**주의: C버튼으로 창을 사라지게 만들기 때문에 이벤트에 아이템 입수 후 스위치가 설정되지 않았다면 C버튼(또는 거기에 해당하는 키)을 누를때마다 창이 뜹니다.(즉, 무한......) 

**이 스크립트는 아이템 입수창만 띄우므로 이벤트에서 별도로 아이템 입수를 지정해야 합니다.  만일 스크립트로 아이템창을 띄우면서 바로 아이템을 추가하고 싶다면

case @type
when 1
item = $data_items[@index]
when 2
item = $data_weapons[@index]
when 3
item = $data_armors[@index]
end

이 부분을

case @type
    when 1
      item = $data_items[@index]
      $game_party.gain_item(@index,@quantity) #
    when 2
      item = $data_weapons[@index]
      $game_party.gain_weapon(@index,@quantity) #
    when 3
      item = $data_armors[@index]
      $game_party.gain_armor(@index,@quantity) #
    end   

이렇게 수정하면 됩니다.

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
34 아이템 아이템 소지수 한계돌파(중복일 확률 높음) 3 캉쿤 2011.09.13 1478
33 아이템 Categorized Items Menu 1.3 by albertfish 1 file Alkaid 2010.09.09 1795
32 아이템 아이템창변경 27 카르닉스 2010.02.26 3631
31 아이템 아이템소지수 한계돌파 (중복일지도) 12 카르닉스 2010.02.26 1498
30 아이템 [LPG] 아이템 상세정보 - ◇ Last Update : 2009/08/11 ◇ 11 file Claymore 2009.08.16 3307
29 아이템 CSSR14-아이템 합성 3 file 백호 2009.02.22 2833
28 아이템 아이템 사용 클래스 한정 스크립트! 2 백호 2009.02.22 1146
27 아이템 지정한 아이템 갯수 제한 3 백호 2009.02.22 1282
26 아이템 아이템 단축키로 구입 스크립트 3 백호 2009.02.22 1243
25 아이템 [신기술 체험] 인벤토리 8 file 백호 2009.02.22 2962
24 아이템 Easy Item & Gold Gain by SephirothSpawn (SDK호환) 백호 2009.02.22 880
23 아이템 Additional Item Drop by SephirothSpawn (SDK호환) 1 백호 2009.02.22 891
22 아이템 SG_Item Break by sandgolem (SDK호환) 백호 2009.02.22 897
21 아이템 SG_Escape Only Items by sandgolem (SDK호환) 백호 2009.02.22 850
20 아이템 SG_Hide free item cose by sandgolem (SDK호환) 백호 2009.02.22 935
» 아이템 Item Acquired Window by SiliconHero@rmxp.net 백호 2009.02.22 1096
18 아이템 아이템 인벤토리 2 file 백호 2009.02.22 3354
17 아이템 아이템을 얻으면 자동으로 아이템 입수 메세지윈도우 띄우기 4 백호 2009.02.22 2279
16 아이템 소지/구입 아이템 갯수 99개 이상 가능(약간 수정) 2 백호 2009.02.22 1103
15 아이템 아이템 정리기능 S크립T 1 file 백호 2009.02.21 1080
Board Pagination Prev 1 2 Next
/ 2