#=========================================================================================
# ■ Gold, Silver and Copper
# ■ Made to work with FF Tactics Advance Shop System By Mac
#=========================================================================================
# script by: Jackolas
# Version number: V 0.90 Beta
# Last edit date: 3-11-09
# Thanks for help: Game_Guy (helping sort increase gold problem)
# Taiine (for requesting this script)
#
# Used to convert the normal gold to Gold, Silver and Copper
# The change is purely superficial and only changes the window displays,
# no changes to actual gold calculations.
#
# Every price in the editor will be using Copper as basic number
# So an item of normal 12500 Gold wil cost now 1 gold, 25 silver and 00 copper
#==============================================================================
module Jackolas_Gold
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Basic Configuration below
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Font_size = 18 # Font size of gold, normal is 22 but i recommend 18.
Modif_Font_size = false # change all font sizes to the same of the gold
Max_gold = 999 # max gold (look out for the space you have to draw it)
Gold_Icon = 'goldcoin' # icon of the gold in the menu (put in icon map and 18x18 pix)
Silver_Icon = 'silvercoin' # icon of the silver in the menu (put in icon map and 18x18 pix)
Copper_Icon = 'coppercoin' # icon of the copper in the menu (put in icon map and 18x18 pix)
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Basic Configuration above
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Max_gild = Max_gold * 10000 + 9999 #Do not edit
Ferror = (Font_size - 17)/2 #Do not edit
end
module RPG
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Gold Configuration below
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
class Item
def price
case @id
when 1 then return 100 #1 silver 00 copper
#when 2 than return 200 etc
end
return @price
end
end
class Weapon
def price
case @id
when 1 then return 15000 #1 gold, 50 silver, 00 copper
#when 2 than return 200 etc
end
return @price
end
end
class Armor
def price
case @id
when 1 then return 24999 #2 gold, 49 silver, 99 copper
#when 2 than return 200 etc
end
return @price
end
end
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Gold Configuration above
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#===================================================
# ▼ CLASS Game_Party additional code begins
#===================================================
class Game_Party
def gain_gold(n)
@gold = [[@gold + n, 0].max, Jackolas_Gold::Max_gild].min
end
end
#===================================================
# ▲ CLASS Game_Party additional code ends
#===================================================
#===================================================
# ▼ CLASS Window_Gold additional code begins
#===================================================
class Window_Gold < Window_Base #Hijack the gold code in main menu
alias Jackolas_gold_refresh refresh
def refresh
#Calculate Gold, Silver and Copper
@totalmoney = $game_party.gold
gild = @totalmoney / 10000
silver = @totalmoney / 100 % 100
copper = @totalmoney % 100
moneygold = sprintf("%s", gild.to_s)
moneysilver = sprintf("%02d", silver)
moneycopper = sprintf("%02d", copper)
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
rect = Rect.new(0, 0, 18, 18)
self.contents.font.color = normal_color
self.contents.font.size = Jackolas_Gold::Font_size
if gild >= 1
self.contents.draw_text(0, 0, 34, 32, moneygold.to_s, 2)
self.contents.blt(32, 8, RPG::Cache.icon(Jackolas_Gold::Gold_Icon), rect)
end
if silver >= 1
self.contents.draw_text(4, 0, 66, 32, moneysilver.to_s, 2)
self.contents.blt(68, 8, RPG::Cache.icon(Jackolas_Gold::Silver_Icon), rect)
else
if gild >= 1
self.contents.draw_text(4, 0, 66, 32, moneysilver.to_s, 2)
self.contents.blt(68, 8, RPG::Cache.icon(Jackolas_Gold::Silver_Icon), rect)
end
end
self.contents.draw_text(4, 0, 102, 32, moneycopper.to_s, 2)
self.contents.blt(104, 8, RPG::Cache.icon(Jackolas_Gold::Copper_Icon), rect)
self.contents.font.color = system_color
end
end
#===================================================
# ▲ CLASS Window_Gold additional code ends
#===================================================
#===================================================
# ▼ CLASS Window_ShopBuy additional code begins
#===================================================
module FFT_ShopSystem #Hijack the script
class Window_ShopBuy < ::Window_ShopBuy #Hijack buy window
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
# Gets item Number
item = @data[index]
# Gets Number Owned & Equipped
case item
when RPG::Item
number = $game_party.item_number(item.id)
equipped_number = 0
when RPG::Weapon
number = $game_party.weapon_number(item.id)
equipped_number = $game_party.equipped_weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
equipped_number = $game_party.equipped_armor_number(item.id)
end
# Clears Area
rect = Rect.new(0, index * 32, contents.width, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
# Draws Icon
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
if Jackolas_Gold::Modif_Font_size
self.contents.font.size = Jackolas_Gold::Font_size
else
self.contents.font.size = Font.default_size
end
self.contents.blt(4, index * 32 + 4, bitmap, Rect.new(0, 0, 24, 24),
opacity)
# Draws Item Name, Total, Equipped and Price
self.contents.draw_text(32, index * 32, 212, 32, item.name, 0)
self.contents.draw_text(334, index * 32, 88, 32,
(number + equipped_number).to_s, 2)
self.contents.draw_text(254, index * 32, 88, 32, equipped_number.to_s, 2)
#Calculate Gold, Silver and Copper
rect = Rect.new(0, 0, 18, 18)
@moneycost = item.price
gild = @moneycost / 10000
silver = @moneycost / 100 % 100
copper = @moneycost % 100
moneygold = sprintf("%s", gild.to_s)
moneysilver = sprintf("%02d", silver)
moneycopper = sprintf("%02d", copper)
# Draw Gold, Silver and Copper
self.contents.font.size = Jackolas_Gold::Font_size
if gild >= 1
self.contents.draw_text(4, 0+index*32, 476, 32, moneygold.to_s, 2)
self.contents.blt(478, 8+index*32, RPG::Cache.icon(Jackolas_Gold::Gold_Icon), rect)
end
if silver >= 1
self.contents.draw_text(4, 0+index*32, 512, 32, moneysilver.to_s, 2)
self.contents.blt(514, 8+index*32, RPG::Cache.icon(Jackolas_Gold::Silver_Icon), rect)
else
if gild >= 1
self.contents.draw_text(4, 0+index*32, 512, 32, moneysilver.to_s, 2)
self.contents.blt(514, 8+index*32, RPG::Cache.icon(Jackolas_Gold::Silver_Icon), rect)
end
end
self.contents.draw_text(4, 0+index*32, 548, 32, moneycopper.to_s, 2)
self.contents.blt(550, 8+index*32, RPG::Cache.icon(Jackolas_Gold::Copper_Icon), rect)
end
end
#===================================================
# ▲ CLASS Window_ShopBuy additional code ends
#===================================================
#===================================================
# ▼ CLASS Window_ShopSell additional code begins
#===================================================
class Window_ShopSell < ::Window_ShopSell #Hijack sell window
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
# Gets Item Data
item = @data[index]
# Gets Number & Equipped Number
case item
when RPG::Item
number = $game_party.item_number(item.id)
equipped_number = 0
when RPG::Weapon
number = $game_party.weapon_number(item.id)
equipped_number = $game_party.equipped_weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
equipped_number = $game_party.equipped_armor_number(item.id)
end
# Adjust Font Color By Price
if item.price > 0
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
# Clears Area
rect = Rect.new(0, index * 32, contents.width, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
# Draws Icon
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
if Jackolas_Gold::Modif_Font_size
self.contents.font.size = Jackolas_Gold::Font_size
else
self.contents.font.size = Font.default_size
end
self.contents.blt(4, index * 32 + 4, bitmap, Rect.new(0, 0, 24, 24),
opacity)
# Draws Item Name, Total Owned, Equipped and Price
self.contents.draw_text(32, index * 32, 212, 32, item.name, 0)
self.contents.draw_text(334, index * 32, 88, 32,
(number + equipped_number).to_s, 2)
self.contents.draw_text(254, index * 32, 88, 32, equipped_number.to_s, 2)
#Calculate Gold, Silver and Copper
rect = Rect.new(0, 0, 18, 18)
@moneycost = item.price / 2
gild = @moneycost / 10000
silver = @moneycost / 100 % 100
copper = @moneycost % 100
moneygold = sprintf("%s", gild.to_s)
moneysilver = sprintf("%02d", silver)
moneycopper = sprintf("%02d", copper)
# Draw Gold, Silver and Copper
self.contents.font.size = Jackolas_Gold::Font_size
if gild >= 1
self.contents.draw_text(4, 0+index*32, 476, 32, moneygold.to_s, 2)
self.contents.blt(478, 8+index*32, RPG::Cache.icon(Jackolas_Gold::Gold_Icon), rect)
end
if silver >= 1
self.contents.draw_text(4, 0+index*32, 512, 32, moneysilver.to_s, 2)
self.contents.blt(514, 8+index*32, RPG::Cache.icon(Jackolas_Gold::Silver_Icon), rect)
else
if gild >= 1
self.contents.draw_text(4, 0+index*32, 512, 32, moneysilver.to_s, 2)
self.contents.blt(514, 8+index*32, RPG::Cache.icon(Jackolas_Gold::Silver_Icon), rect)
end
end
self.contents.draw_text(4, 0+index*32, 548, 32, moneycopper.to_s, 2)
self.contents.blt(550, 8+index*32, RPG::Cache.icon(Jackolas_Gold::Copper_Icon), rect)
end
end
#===================================================
# ▲ CLASS Window_ShopSell additional code ends
#===================================================
end