26 January 2009 - 1:46pm — Chris Ess
-
class Item
-
attr_accessor :id, :name, :icon, :quality, :bonding, :class_id, :equip_inventory_type,
-
:equip_subclass, :strength, :agility, :stamina, :intellect, :spirit,
-
:armor, :added_armor, :sockets, :max_durability, :allowed_classes,
-
:required_level, :attack_power, :crit_rating, :expertise_rating,
-
:haste_rating, :hit_rating, :spellpower, :resilience, :spells, :item_set, :source
-
-
def initialize
-
@id = 0
-
@name = ''
-
@icon = ''
-
@quality = 0
-
-
@bonding = 0
-
@class_id = 0
-
@equip_inventory_type = 0
-
@equip_subclass = ''
-
-
@strength = 0
-
@agility = 0
-
@stamina = 0
-
@intellect = 0
-
@spirit = 0
-
@armor = 0
-
@added_armor = 0
-
@sockets = Array.new
-
-
@allowed_classes = Array.new
-
@required_level = 0
-
@attack_power = 0
-
@crit_rating = 0
-
@expertise_rating = 0
-
@haste_rating = 0
-
@hit_rating = 0
-
@spellpower = 0
-
@resilience = 0
-
-
@spells = 0
-
-
@item_set = nil
-
@source = nil
-
end
-
end
-
-
class Spell
-
attr_accessor :trigger, :desc
-
-
def initialize
-
@trigger = 0
-
@desc = ''
-
end
-
end
-
-
class ItemSet
-
attr_accessor :name, :items, :bonuses;
-
-
def initialize
-
@name = ''
-
@items = Array.new
-
@bonuses = Hash.new
-
end
-
end
-
-
class ItemSource
-
attr_accessor :source_type, :area_id, :area_name, :creature_id, :creature_name,
-
:difficulty, :drop_rate
-
-
def initialize
-
@source_type = ''
-
@area_id = 0
-
@creature_id = 0
-
@creature_name = ''
-
@difficulty = ''
-
@drop_rate = ''
-
end
-
end
This is the Item
class and helper classes for the Ruby XML parser implementations.
Articles:
Source code: