#_________________________________________________
# MOG_Treasure_Name V1.7
#_________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_________________________________________________
module MOG
#Font Name.
MPFONT = "Georgia"
#Fade ON/OFF (True - False).
MPITFD = true
#Fade Time.
MPITTM = 7
#Window Position.
# 0 = Upper.
# 1 = Left.
# 2 = Right.
# 3 = Lower.
MPITPS = 0
# Disable Window Switch.
MPITVIS = 5
# SE played when item gain and item loss
MPITSE = "056-Right02"
MPITSE2 = "014-Move02"
end
#===============================================================================
# Game_Temp
#===============================================================================
class Game_Temp
attr_accessor :fdittm
attr_accessor :mpit_x
attr_accessor :mpit_y
attr_accessor :it_id
attr_accessor :item_typ
attr_accessor :item_qua
#--------------------------------------------------------------------------
# Update Status
#--------------------------------------------------------------------------
alias mog25_initialize initialize
def initialize
mog25_initialize
@fdittm = 0
@it_id = 1
@wp_id = 1
@ar_id = 1
@item_typ = 0
@mpit_x = 0
@mpit_y = 0
@item_qua = 1
end
end
#===============================================================================
# Interpreter
#===============================================================================
class Interpreter
#--------------------------------------------------------------------------
# Update Status
#--------------------------------------------------------------------------
alias mog25_command126 command_126
def command_126
mog25_command126
return if $game_switches[MOG::MPITVIS]
$game_temp.item_typ = 1
$game_temp.fdittm = 255 + 40 * MOG::MPITTM
$game_temp.it_id = @parameters[0]
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_temp.item_qua = value
if value > 0
Audio.se_play("Audio/SE/" + MOG::MPITSE, 100,100) rescue nil
else
Audio.se_play("Audio/SE/" + MOG::MPITSE2, 100,100) rescue nil
end
$ref = true
end
#--------------------------------------------------------------------------
# command_127
#--------------------------------------------------------------------------
alias mog25_command127 command_127
def command_127
mog25_command127
return if $game_switches[MOG::MPITVIS]
$game_temp.item_typ = 2
$game_temp.fdittm = 255 + 40 * MOG::MPITTM
$game_temp.it_id = @parameters[0]
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_temp.item_qua = value
if value > 0
Audio.se_play("Audio/SE/" + MOG::MPITSE, 100,100) rescue nil
else
Audio.se_play("Audio/SE/" + MOG::MPITSE2, 100,100) rescue nil
end
$ref = true
end
#--------------------------------------------------------------------------
# command_128
#--------------------------------------------------------------------------
alias mog25_command128 command_128
def command_128
mog25_command128
return if $game_switches[MOG::MPITVIS]
$game_temp.item_typ = 3
$game_temp.fdittm = 255 + 40 * MOG::MPITTM
$game_temp.it_id = @parameters[0]
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_temp.item_qua = value
if value > 0
Audio.se_play("Audio/SE/" + MOG::MPITSE, 100,100) rescue nil
else
Audio.se_play("Audio/SE/" + MOG::MPITSE2, 100,100) rescue nil
end
$ref = true
end
#--------------------------------------------------------------------------
# * Change Gold
#--------------------------------------------------------------------------
alias mog25_command125 command_125
def command_125
mog25_command125
return if $game_switches[MOG::MPITVIS]
$game_temp.item_typ = 4
$game_temp.fdittm = 255 + 40 * MOG::MPITTM
value = operate_value(@parameters[0], @parameters[1], @parameters[2])
$game_temp.item_qua = value
if value > 0
Audio.se_play("Audio/SE/" + MOG::MPITSE, 100,100) rescue nil
else
Audio.se_play("Audio/SE/" + MOG::MPITSE2, 100,100) rescue nil
end
$ref = true
end
end
#===============================================================================
# Game_Map
#===============================================================================
class Game_Map
attr_reader :map_id
#--------------------------------------------------------------------------
# mpitnm
#--------------------------------------------------------------------------
def mpitnm
$mpitnm = load_data("Data/Items.rxdata")
$mpitnm[$game_temp.it_id].name
end
#--------------------------------------------------------------------------
# mpwpnm
#--------------------------------------------------------------------------
def mpwpnm
$mpwpnm = load_data("Data/Weapons.rxdata")
$mpwpnm[$game_temp.it_id].name
end
#--------------------------------------------------------------------------
# mparnm
#--------------------------------------------------------------------------
def mparnm
$mparnm = load_data("Data/Armors.rxdata")
$mparnm[$game_temp.it_id].name
end
end
#===============================================================================
# Window_Base
#===============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# draw_mpitem
#--------------------------------------------------------------------------
def draw_mpitem(x,y)
if $game_temp.item_qua > 0
mapic = RPG::Cache.picture("Itname") rescue RPG::Cache.picture("")
else
mapic = RPG::Cache.picture("Itname2") rescue RPG::Cache.picture("")
end
cw = mapic.width
ch = mapic.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch + 65, mapic, src_rect)
self.contents.font.name = MOG::MPFONT
self.contents.font.size = 22
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x - 19, y + 19, 110, 32, $game_temp.item_qua.to_s + "X",1)
case $game_temp.item_typ
when 1 #==========================================
self.contents.draw_text(x + 80, y + 29, 110, 32, $game_map.mpitnm,1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 81, y + 30, 110, 32, $game_map.mpitnm,1)
self.contents.draw_text(x - 20, y + 18, 110, 32, $game_temp.item_qua.to_s + "X",1)
icon_name = $data_items[$game_temp.it_id].icon_name
when 2 #==========================================
self.contents.draw_text(x + 80, y + 30, 110, 32, $game_map.mpwpnm,1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 81, y + 29, 110, 32, $game_map.mpwpnm,1)
self.contents.draw_text(x - 20, y + 18, 110, 32, $game_temp.item_qua.to_s + "X",1)
icon_name = $data_weapons[$game_temp.it_id].icon_name
when 3 #==========================================
self.contents.draw_text(x + 80, y + 30, 110, 32, $game_map.mparnm,1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 81, y + 29, 110, 32, $game_map.mparnm,1)
self.contents.draw_text(x - 20, y + 18, 110, 32, $game_temp.item_qua.to_s + "X",1)
icon_name = $data_armors[$game_temp.it_id].icon_name
when 4
self.contents.draw_text(x + 80, y + 30, 110, 32, $data_system.words.gold,1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 81, y + 29, 110, 32, $data_system.words.gold,1)
self.contents.draw_text(x - 20, y + 18, 110, 32, $game_temp.item_qua.to_s + "X",1)
return
end
icon_pic = RPG::Cache.icon(icon_name.to_s)
self.contents.blt(x + 55, y + 34, icon_pic, Rect.new(0, 0, 24, 24), 255)
end
end
#===============================================================================
# Mpitem
#===============================================================================
class Mpitem < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super($game_temp.mpit_x, $game_temp.mpit_y, 250, 100)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_mpitem(10,0)
end
end
#===============================================================================
# Scene_Map
#===============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# main
#--------------------------------------------------------------------------
alias mog25_main main
def main
@mpit = Mpitem.new
if $game_switches[MOG::MPITVIS] == true
@mpit.visible = false
else
@mpit.visible = true
end
@mpit.contents_opacity = $game_temp.fdittm
mog25_main
@mpit.dispose
end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
alias mog25_update update
def update
mog25_update
if $ref == true
@mpit.refresh
if MOG::MPITPS == 0
@mpit.x = 200
@mpit.y = -150
elsif MOG::MPITPS == 1
@mpit.x = -240
@mpit.y = 200
elsif MOG::MPITPS == 2
@mpit.x = 640
@mpit.y = 200
else
@mpit.x = 200
@mpit.y = 480
end
$ref = false
end
if $game_switches[MOG::MPITVIS] == true or $game_temp.fdittm <= 0
@mpit.visible = false
else
@mpit.visible = true
end
$game_temp.mpit_x = @mpit.x
$game_temp.mpit_y = @mpit.y
if MOG::MPITPS == 0
if @mpit.y < 0
@mpit.y += 8
elsif @mpit.x >= 0
@mpit.y = 0
end
elsif MOG::MPITPS == 1
if @mpit.x < 0
@mpit.x += 10
elsif @mpit.x >= 0
@mpit.x = 0
end
elsif MOG::MPITPS == 2
if @mpit.x > 400
@mpit.x -= 10
elsif @mpit.x >= 400
@mpit.x = 400
end
else
if @mpit.y > 380
@mpit.y -= 8
elsif @mpit.y >= 380
@mpit.y = 380
end
end
@mpit.contents_opacity = $game_temp.fdittm
if MOG::MPITFD == true
$game_temp.fdittm -= 3 if $game_temp.fdittm > 0
end
end
end
$mog_rgss_Treasure_Name = true
Added all the features you guys posted. Removing item uses picture 'Itname2'. Added removal sound effect. Doing "Switch ON, Item Gain, Switch OFF" will disable the window (it wasn't how the game updated switches that was the problem, MOG didn't write the script correctly. In fact, there's a lot in this script that I don't agree with and changed it).