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
881 전투 펫 시스템(ABS 3.4v포함) 23 file 백호 2009.02.22 3458
880 메뉴 자작 메뉴 스크립트들(L's Simple CMS and menu scenes) (SDK 호환?) 10 Alkaid 2010.09.02 3455
879 미니맵 스크립트 이용하여 미니맵 만들기 16 file 아방스 2007.11.09 3452
878 전투 CTB by Charlie Fleed 3.2 - FF10 스타일의 전투 시스템 7 Alkaid 2010.10.14 3448
877 능력치 올리기 스크립트 21 file 아방스 2007.11.09 3447
876 이동 및 탈것 3D 캐릭 스크립트 7 백호 2009.02.22 3443
875 미니맵 던전용 미니맵 스크립트[사용법 추가] 16 file 배포 2008.03.02 3443
874 HUD 맵이름표시 ps인간 2009.01.23 3441
873 미니맵 미니맵(중복률100%? 한글번역!) 17 백호 2009.02.21 3423
872 메시지 ◆메세지 윈도우 개조 -KGC_MessageAlter◆ 3 백호 2009.02.22 3422
871 기타 FPLE 2 - First Person Labyrinth Explorer by MGC 1 Alkaid 2012.01.17 3415
870 이동 및 탈것 멈췄을때 행동. 17 file Bera 2010.10.17 3408
869 메뉴 스탯올리기 시스템 (액알가능) 27 file 백호 2009.02.22 3404
868 기타 한글 입력 스크립트 입니다. (vx -> xp) 23 file 헤르코스 2009.04.18 3397
867 메뉴 [자작]명성치 사용 스크립트 16 Rainsy 2009.03.22 3390
866 전투 ATB전투 5 백호 2009.02.22 3369
865 파티 [최강전사님 제공] 파티가 따라오게 하는 스크립트 24 file 아방스 2007.11.09 3365
864 아이템 아이템 인벤토리 2 file 백호 2009.02.22 3355
863 이동 및 탈것 최단경로 찾아가기 - (마우스 사용) 18 file 허걱 2009.02.02 3351
862 스탯 포인트 시스템 3차수정 ( ' 백호 ' 님이 올리신 자료 수정.) 26 카이어덱터 2010.01.04 3346
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52