Item Rarity/Rating
Authors: game_guy
Version: 1.5
Type: Item Rating Script
Key Term: Custom Item System
IntroductionIn some games I've seen Item Ratings or Rarity's etc. This script mimics that.
I use this for item rarity on how hard it is to find an item. It can be used to
rate items though on how good they are.
Features
- Gives items "Stars" times the amount of its rating/rarity
Screenshots(http://i307.photobucket.com/albums/nn318/bahumat27/items.png)
DemoNEW DEMO 1.5
Demo 1.5 (http://www.sendspace.com/file/gzagg2)
Script
#==============================================================================#
# Item Rarity/rating Script
# By: game_guy
# Data: May 24th, 2009
#==============================================================================#
=begin
Intro:
In some games I've seen Item Ratings or Rarity's etc. This script mimics that.
I use this for item rarity on how hard it is to find an item. It can be used to
rate items though on how good they are.
Instructions:
And do change the name of the icon to your liking where it says
IconName = "icon name here between quotes"
Go to # BEGIN CONFIG and type this below that line
when item_id then return rarity/rating
Features:
Gives items "Stars" times the amount of its rating/rarity
Credits:
game_guy - for making it
ryexander - helping me understand the bitmap better
=end
#======================================#
# ICONNAME = "Icon name here" # name of icon to display rating
# RARITYNAME = "Rarity name here" # word you want to call the rarity/rating
#======================================#
ICONNAME = "star"
RARITYNAME = "Rating"
module RPG
class Item
def rarity
case id
#======================================#
# BEGIN CONFIG
#======================================#
when 1 then return 1
when 2 then return 3
when 32 then return 5
when 8 then return 2
#======================================#
# END CONFIG
#======================================#
end
return 1
end
end
class Weapon
def rarity
case id
#======================================#
# BEGIN CONFIG
#======================================#
when 1 then return 1
when 2 then return 3
when 32 then return 5
when 8 then return 2
#======================================#
# END CONFIG
#======================================#
end
return 1
end
end
class Armor
def rarity
case id
#======================================#
# BEGIN CONFIG
#======================================#
when 1 then return 1
when 2 then return 3
when 32 then return 5
when 8 then return 2
#======================================#
# END CONFIG
#======================================#
end
return 1
end
end
end
class Window_Item < Window_Selectable
def initialize
super(0, 64, 640, 352)
@column_max = 1
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
item.rarity.times do |i|
src_rect = Rect.new(0, 0, 24, 24)
self.contents.blt(300 + 32 * i + 16, y + 3, RPG::Cache.icon(ICONNAME.to_s), src_rect)
end
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
class Window_ItemName < Window_Base
def initialize
super(0, 0, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 640, 32, "Item Name", 0)
end
end
class Window_Rating < Window_Base
def initialize
super(320, 0, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 640, 32, RARITYNAME, 0)
end
end
class Scene_Item
def main
@help_window = Window_Help.new
@help_window.y = 416
@xtrinfo = Window_ItemName.new
@rare = Window_Rating.new
@item_window = Window_Item.new
@item_window.help_window = @help_window
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@rare.dispose
@xtrinfo.dispose
@item_window.dispose
@target_window.dispose
end
end
InstructionsAnd do change the name of the icon to your liking where it says
IconName = "icon name here between quotes"
Go to # BEGIN CONFIG and type this below that line
when item_id then return rarity/rating
Make sure to do it for each type: Items, Weapons, and Armors
Icon Used in Screenie if you want it
(http://i307.photobucket.com/albums/nn318/bahumat27/star.png)
CompatibilityNot tested with SDK. Wont work with other Custom Item Systems.
Credits and Thanks
- game_guy - For making it
- Ryexander - Helping my understand the bitmap displayed in windows
Author's NotesGive credits if used and enjoy!
just like fable! is it easy to set-up?
Its easy as long as you read the instructions and its pretty easy just gotta define the items.
when item_id then rating/rarity
EDIT:
Updated it and fixed a major bug I found
It would be cool if you could display both or have each (rarity AND rating) built into the script as toggled functions. basically, my idea is this: The name of the object is colored to indicate rarity (and have option in script to turn this part off) while the user can either use the icons like you, or use a icon for each rating(have ability to turn this part off, too) for example, i fry a boss in your game, and get a Gold Spear its better than other Spears because its stats so it would have a higher rating. It would also be much more rare than an average spear. and the name displayed would just be 'Spear' but in gold coloring... just an idea, i doubt you'll like it
I might do it for my next update. Good idea by teh way!
ty cant wait to try out those features (if you do decide to use them)
Hey Game_Guy ...
Can I make a request for an aesthetics upgrade for this script?
Depends. Last time you said that in my script I tried it and was never able to do it xD
Post your idea.
Nah, this is different. Just adding windows, and moving windows.
Well go ahead and post your idea
Okay, start by putting the help window at the bottom of the screen, and where the help window currently is ... add a new window(the same size) and if you wanted to, split it in half. 2windows at 240, or one at 480, it doesn't really matter.
Anyway, in the top window to the left, add the text "Item" or "Item Name," and on the right side, directly above where the stars begin, add the text "Rarity" or whatever.
Finally ... Slide the stars over like 32pixels, and to the left of them, add the abbreviation "LV" to all of them, and so on ...
I think these few things would help the appearance of the script.
Well I'll work on it when I have time. I do agree it would help thnx calintz.
Of course.
No problem ...
I look forward to seeing it if you decide to do it.
BTW:
I on the other hand must go work on the Well in the Woods.
@calintz: Added it the way you said except the level.
Updated to 1.5