protected override void OnTarget(Mobile m, object o) { if (o is Item) { Item IT = (Item)o; if (IT.Parent != m.Backpack) { m.SendLocalizedMessage(1042001); box.NG(m, box); } else if (IT is BaseTool) { BaseTool j = (BaseTool)IT; int uses = j.UsesRemaining; box.AddTool(m, j, uses, box); } else if (IT is BaseHarvestTool) { BaseHarvestTool j = (BaseHarvestTool)IT; int uses = j.UsesRemaining; box.AddTool(m, j, uses, box); } //Modded this from to else if (IT is Hatchet || IT is SturdyHatchet || IT is Pickaxe || IT is SturdyPickaxe) else if (IT is Hatchet || IT is Pickaxe || IT is SturdyPickaxe) { BaseAxe j = (BaseAxe)IT; int uses = j.UsesRemaining; box.AddTool(m, j, uses, box); } else if (IT is ProspectorsTool) { ProspectorsTool j = (ProspectorsTool)IT; int uses = j.UsesRemaining; box.AddTool(m, j, uses, box); } else if (IT is GargoylesPickaxe) { GargoylesPickaxe j = (GargoylesPickaxe)IT; int uses = j.UsesRemaining; box.AddTool(m, j, uses, box); } else if (IT is BaseAxe) { m.SendMessage("I do not take axe other than pickaxe and gargoyle pickaxe."); box.NG(m, box); } else { m.SendMessage("I'm sorry but I do not recognize this type"); box.NG(m, box); } } else { m.SendMessage("I'm sorry but I do not recognize this type"); box.NG(m, box); } }
public void AddTool( Mobile m , Item tar, int uses, ToolBox box ) { if ( ( tar is BaseTool || tar is BaseHarvestTool ) && uses > 0 ) { if ( tar is Hammer || tar is SmithHammer || tar is Tongs ) { this.i_S += uses; tar.Consume(); box.OW( m ); } else if ( tar is TinkerTools ) { this.i_Ti += uses; tar.Consume(); box.OW( m ); } else if ( tar is Skillet || tar is RollingPin || tar is FlourSifter ) { this.i_Co += uses; tar.Consume(); box.OW( m ); } else if ( tar is DovetailSaw || tar is Saw || tar is DrawKnife || tar is Froe || tar is Inshave || tar is JointingPlane || tar is MouldingPlane || tar is Nails || tar is Scorp || tar is SmoothingPlane ) { this.i_C += uses; tar.Consume(); box.OW( m ); } else if ( tar is Shovel || tar is Pickaxe ) { this.i_M += uses; tar.Consume(); box.OW( m ); } else if ( tar is Blowpipe ) { this.i_G += uses; tar.Consume(); box.OW( m ); } else if ( tar is MalletAndChisel ) { this.i_St += uses; tar.Consume(); box.OW( m ); } else if ( tar is SewingKit ) { this.i_T += uses; tar.Consume(); box.OW( m ); } else if ( tar is FletcherTools ) { this.i_F += uses; tar.Consume(); box.OW( m ); } else if ( tar is MortarPestle ) { this.i_A += uses; tar.Consume(); box.OW( m ); } else if ( tar is MapmakersPen ) { this.i_Ca += uses; tar.Consume(); box.OW( m ); } else if ( tar is ScribesPen ) { this.i_Sc += uses; tar.Consume(); box.OW( m ); } else { m.SendMessage( "I do not recognize this type." ); box.NG( m, box ); } } else { m.SendMessage( "This is not the appropriate type of item or it has no uses left." ); box.NG( m, box ); } }
public void AddTool(Mobile m, Item tar, int uses, ToolBox box) { if ((tar is BaseTool || tar is BaseHarvestTool) && uses > 0) { if (tar is Hammer || tar is SmithHammer || tar is Tongs) { this.i_S += uses; tar.Consume(); box.OW(m); } else if (tar is TinkerTools) { this.i_Ti += uses; tar.Consume(); box.OW(m); } else if (tar is Skillet || tar is RollingPin || tar is FlourSifter) { this.i_Co += uses; tar.Consume(); box.OW(m); } else if (tar is DovetailSaw || tar is Saw || tar is DrawKnife || tar is Froe || tar is Inshave || tar is JointingPlane || tar is MouldingPlane || tar is Nails || tar is Scorp || tar is SmoothingPlane) { this.i_C += uses; tar.Consume(); box.OW(m); } else if (tar is Shovel || tar is Pickaxe) { this.i_M += uses; tar.Consume(); box.OW(m); } else if (tar is Blowpipe) { this.i_G += uses; tar.Consume(); box.OW(m); } else if (tar is MalletAndChisel) { this.i_St += uses; tar.Consume(); box.OW(m); } else if (tar is SewingKit) { this.i_T += uses; tar.Consume(); box.OW(m); } else if (tar is FletcherTools) { this.i_F += uses; tar.Consume(); box.OW(m); } else if (tar is MortarPestle) { this.i_A += uses; tar.Consume(); box.OW(m); } else if (tar is MapmakersPen) { this.i_Ca += uses; tar.Consume(); box.OW(m); } else if (tar is ScribesPen) { this.i_Sc += uses; tar.Consume(); box.OW(m); } else { m.SendMessage("I do not recognize this type."); box.NG(m, box); } } else { m.SendMessage("This is not the appropriate type of item or it has no uses left."); box.NG(m, box); } }
protected override void OnTarget(Mobile m, object o) { if (o is Item) { Item IT = (Item)o; if (IT.Parent != m.Backpack) { m.SendLocalizedMessage(1042001); box.NG(m, box); } else if (IT is BaseTool) { BaseTool j = (BaseTool)IT; int uses = j.UsesRemaining; box.AddTool(m, j, uses, box); } else if (IT is BaseHarvestTool) { BaseHarvestTool j = (BaseHarvestTool)IT; int uses = j.UsesRemaining; box.AddTool(m, j, uses, box); } else { m.SendMessage("I'm sorry but I do not recognize this type"); box.NG(m, box); } } else { m.SendMessage("I'm sorry but I do not recognize this type"); box.NG(m, box); } }