public void SendShadowIronIngot(Mobile from) { Container backpack = this.Backpack; from = this.ControlMaster; BankBox bank1 = from.BankBox; ShadowIngot shad = (ShadowIngot)backpack.FindItemByType(typeof(ShadowIngot)); if (shad is BaseIngot) { BaseIngot m_Ore3 = shad as BaseIngot; if (m_Ore3.Amount > 1000) { PlaceItemIn(bank1, 18, 169, shad); } } }
public override void OnThink() { if (this.Alive && this.m_Mine && this.m_NextUse <= DateTime.Now) { Container backpack = this.Backpack; if (backpack == null) { m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5); base.OnThink(); return; } if (backpack.TotalWeight > (backpack.MaxWeight - 100)) { this.Say("I'm full !! I'm AutoConverting Ore in Ingot !"); m_Mine = true; this.Hue = 0; ControlOrder = OrderType.Stay; ConvertOretoIngot(this); base.OnThink(); return; } Shovel shovel1 = (Shovel)backpack.FindItemByType(typeof(Shovel)); Pickaxe shovel2 = (Pickaxe)backpack.FindItemByType(typeof(Pickaxe)); IBShovel shovel3 = (IBShovel)backpack.FindItemByType(typeof(IBShovel)); if (shovel1 != null) { if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this)) { shovel1.UsesRemaining -= 1; if (shovel1 != null && !shovel1.Deleted && shovel1.UsesRemaining <= 0) { shovel1.Delete(); } } } if (shovel2 != null) { if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this)) { shovel2.UsesRemaining -= 1; if (shovel2 != null && !shovel2.Deleted && shovel2.UsesRemaining <= 0) { shovel2.Delete(); } } } if (shovel3 != null) { if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this)) { shovel3.UsesRemaining -= 1; if (shovel3 != null && !shovel3.Deleted && shovel3.UsesRemaining <= 0) { shovel3.Delete(); } } } m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5); if ((shovel1 == null) && (shovel2 == null) && (shovel3 == null)) { this.Say("I require a tool to dig"); m_Mine = false; this.Hue = 0; ControlOrder = OrderType.Follow; } IronIngot iron1 = (IronIngot)backpack.FindItemByType(typeof(IronIngot)); if (iron1 is BaseIngot) { BaseIngot m_Ore1 = iron1 as BaseIngot; if (m_Ore1.Amount > 1000) { SendIronIngot(this); } } DullcopperIngot dull1 = (DullcopperIngot)backpack.FindItemByType(typeof(DullcopperIngot)); if (dull1 is BaseIngot) { BaseIngot m_Ore2 = dull1 as BaseIngot; if (m_Ore2.Amount > 1000) { SendDullCopperIngot(this); } } ShadowIngot shad1 = (ShadowIngot)backpack.FindItemByType(typeof(ShadowIngot)); if (shad1 is BaseIngot) { BaseIngot m_Ore3 = shad1 as BaseIngot; if (m_Ore3.Amount > 1000) { SendShadowIronIngot(this); } } BronzeIngot bron1 = (BronzeIngot)backpack.FindItemByType(typeof(BronzeIngot)); if (bron1 is BaseIngot) { BaseIngot m_Ore4 = bron1 as BaseIngot; if (m_Ore4.Amount > 1000) { SendBronzeIngot(this); } } GoldIngot gold1 = (GoldIngot)backpack.FindItemByType(typeof(GoldIngot)); if (gold1 is BaseIngot) { BaseIngot m_Ore5 = gold1 as BaseIngot; if (m_Ore5.Amount > 1000) { SendGoldIngot(this); } } CopperIngot copp1 = (CopperIngot)backpack.FindItemByType(typeof(CopperIngot)); if (copp1 is BaseIngot) { BaseIngot m_Ore6 = copp1 as BaseIngot; if (m_Ore6.Amount > 1000) { SendCopperIngot(this); } } AgapiteIngot agap1 = (AgapiteIngot)backpack.FindItemByType(typeof(AgapiteIngot)); if (agap1 is BaseIngot) { BaseIngot m_Ore7 = agap1 as BaseIngot; if (m_Ore7.Amount > 1000) { SendAgapiteIngot(this); } } VeriteIngot veri1 = (VeriteIngot)backpack.FindItemByType(typeof(VeriteIngot)); if (veri1 is BaseIngot) { BaseIngot m_Ore8 = veri1 as BaseIngot; if (m_Ore8.Amount > 1000) { SendVeriteIngot(this); } } ValoriteIngot valo1 = (ValoriteIngot)backpack.FindItemByType(typeof(ValoriteIngot)); if (valo1 is BaseIngot) { BaseIngot m_Ore9 = valo1 as BaseIngot; if (m_Ore9.Amount > 1000) { SendValoriteIngot(this); } } } base.OnThink(); }
public override void OnComponentUsed( AddonComponent c, Mobile from ) { BaseHouse house = BaseHouse.FindHouseAt( this ); /* * Unique problems have unique solutions. OSI does not have a problem with 1000s of mining carts * due to the fact that they have only a miniscule fraction of the number of 10 year vets that a * typical RunUO shard will have (RunUO's scaled down account aging system makes this a unique problem), * and the "freeness" of free accounts. We also dont have mitigating factors like inactive (unpaid) * accounts not gaining veteran time. * * The lack of high end vets and vet rewards on OSI has made testing the *exact* ranging/stacking * behavior of these things all but impossible, so either way its just an estimation. * * If youd like your shard's carts/stumps to work the way they did before, simply replace the check * below with this line of code: * * if (!from.InRange(GetWorldLocation(), 2) * * However, I am sure these checks are more accurate to OSI than the former version was. * */ if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this) || !((from.Z - Z) > -3 && (from.Z - Z) < 3)) { from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } else if ( house != null && house.HasSecureAccess( from, SecureLevel.Friends ) ) { switch ( m_CartType ) { case MiningCartType.OreSouth: case MiningCartType.OreEast: if ( m_Ore > 0 ) { Item ingots = null; switch ( Utility.Random( 9 ) ) { case 0: ingots = new IronIngot(); break; case 1: ingots = new DullcopperIngot(); break; case 2: ingots = new ShadowIngot(); break; case 3: ingots = new CopperIngot(); break; case 4: ingots = new BronzeIngot(); break; case 5: ingots = new GoldIngot(); break; case 6: ingots = new AgapiteIngot(); break; case 7: ingots = new VeriteIngot(); break; case 8: ingots = new ValoriteIngot(); break; } int amount = Math.Min( 10, m_Ore ); ingots.Amount = amount; if ( !from.PlaceInBackpack( ingots ) ) { ingots.Delete(); from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again. } else { PublicOverheadMessage(MessageType.Regular, 0, 1094724, amount.ToString() ); // Ore: ~1_COUNT~ m_Ore -= amount; } } else from.SendLocalizedMessage( 1094725 ); // There are no more resources available at this time. break; case MiningCartType.GemSouth: case MiningCartType.GemEast: if ( m_Gems > 0 ) { Item gems = null; switch ( Utility.Random( 15 ) ) { case 0: gems = new Amber(); break; case 1: gems = new Amethyst(); break; case 2: gems = new Citrine(); break; case 3: gems = new Diamond(); break; case 4: gems = new Emerald(); break; case 5: gems = new Ruby(); break; case 6: gems = new Sapphire(); break; case 7: gems = new StarSapphire(); break; case 8: gems = new Tourmaline(); break; // Mondain's Legacy gems case 9: gems = new PerfectEmerald(); break; case 10: gems = new DarkSapphire(); break; case 11: gems = new Turquoise(); break; case 12: gems = new EcruCitrine(); break; case 13: gems = new FireRuby(); break; case 14: gems = new BlueDiamond(); break; } int amount = Math.Min( 5, m_Gems ); gems.Amount = amount; if ( !from.PlaceInBackpack( gems ) ) { gems.Delete(); from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again. } else { PublicOverheadMessage( MessageType.Regular, 0, 1094723, amount.ToString() ); // Gems: ~1_COUNT~ m_Gems -= amount; } } else from.SendLocalizedMessage( 1094725 ); // There are no more resources available at this time. break; } } else from.SendLocalizedMessage( 1061637 ); // You are not allowed to access this. }