mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 16:51:37 +00:00
Fix mining.
This commit is contained in:
@@ -22,7 +22,7 @@ class MiningAction < DistancedAction
|
|||||||
def find_pickaxe
|
def find_pickaxe
|
||||||
PICKAXE_IDS.each do |id|
|
PICKAXE_IDS.each do |id|
|
||||||
weapon = mob.equipment.get(EquipmentConstants::WEAPON)
|
weapon = mob.equipment.get(EquipmentConstants::WEAPON)
|
||||||
if weapon.id == id
|
if weapon != nil && weapon.id == id
|
||||||
return PICKAXES[id]
|
return PICKAXES[id]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ class MiningAction < DistancedAction
|
|||||||
|
|
||||||
if mob.inventory.add(ore.id)
|
if mob.inventory.add(ore.id)
|
||||||
ore_def = ItemDefinition.lookup(@ore.id) # TODO: split off into some method
|
ore_def = ItemDefinition.lookup(@ore.id) # TODO: split off into some method
|
||||||
name = ore_def.name.sub(/ ore$/, "").downcase
|
name = ore_def.name.sub(/ ore$/, '').downcase
|
||||||
|
|
||||||
mob.send_message("You manage to mine some #{name}.")
|
mob.send_message("You manage to mine some #{name}.")
|
||||||
skills.add_experience(MINING_SKILL_ID, ore.exp)
|
skills.add_experience(MINING_SKILL_ID, ore.exp)
|
||||||
@@ -124,11 +124,11 @@ class ProspectingAction < DistancedAction
|
|||||||
if not @started
|
if not @started
|
||||||
@started = true
|
@started = true
|
||||||
|
|
||||||
mob.send_message("You examine the rock for ores...")
|
mob.send_message('You examine the rock for ores...')
|
||||||
mob.turn_to(@position)
|
mob.turn_to(@position)
|
||||||
else
|
else
|
||||||
ore_def = ItemDefinition.lookup(@ore.id)
|
ore_def = ItemDefinition.lookup(@ore.id)
|
||||||
name = ore_def.name.sub(/ ore$/, "").downcase
|
name = ore_def.name.sub(/ ore$/, '').downcase
|
||||||
|
|
||||||
mob.send_message("This rock contains #{name}.")
|
mob.send_message("This rock contains #{name}.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user