Class: Wowr::Classes::ItemDropCreature

Inherits:
Object
  • Object
show all
Defined in:
lib/wowr/item.rb

Overview

Creatures that drop the item <creature name=“Giant Marsh Frog” minLevel=“1” type=“Critter” maxLevel=“1” dropRate=“6” id=“23979” classification=“0” area=“Dustwallow Marsh”></creature> <creature name=“Nalorakk” minLevel=“73” title=“Bear Avatar” url=“fl=dungeon&amp;fl=normal&amp;fl=23576” type=“Humanoid” maxLevel=“73” dropRate=“2” id=“23576” classification=“3” areaUrl=“fl=dungeon&amp;fl=all&amp;fl=normal&amp;fl=3805” area=“Zul’Aman”></creature>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ ItemDropCreature

Returns a new instance of ItemDropCreature.



441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/wowr/item.rb', line 441

def initialize(elem)
	@name 					= elem[:name]
	@id 						= elem[:id].to_i
	@min_level 			= elem[:minLevel].to_i
	@max_level 			= elem[:maxLevel].to_i
	@drop_rate 			= elem[:dropRate].to_i
	@classification = elem[:classification].to_i
	@area 					= elem[:area]
		
	# optional boss stuff
	@title 		= elem[:title]		if elem[:title] # TODO: not nil when no property?
	@url			= elem[:url]			if elem[:url]
	@type			= elem[:type]			if elem[:type] # Humanoid etc.
	@area_url = elem[:areaUrl]	if elem[:areaUrl]
end

Instance Attribute Details

#areaObject (readonly)

Returns the value of attribute area.



439
440
441
# File 'lib/wowr/item.rb', line 439

def area
  @area
end

#classificationObject (readonly)

Returns the value of attribute classification.



439
440
441
# File 'lib/wowr/item.rb', line 439

def classification
  @classification
end

#drop_rateObject (readonly)

Returns the value of attribute drop_rate.



439
440
441
# File 'lib/wowr/item.rb', line 439

def drop_rate
  @drop_rate
end

#idObject (readonly)

Returns the value of attribute id.



439
440
441
# File 'lib/wowr/item.rb', line 439

def id
  @id
end

#max_levelObject (readonly)

Returns the value of attribute max_level.



439
440
441
# File 'lib/wowr/item.rb', line 439

def max_level
  @max_level
end

#min_levelObject (readonly)

Returns the value of attribute min_level.



439
440
441
# File 'lib/wowr/item.rb', line 439

def min_level
  @min_level
end

#nameObject (readonly)

Returns the value of attribute name.



439
440
441
# File 'lib/wowr/item.rb', line 439

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



439
440
441
# File 'lib/wowr/item.rb', line 439

def type
  @type
end