public void EndStable(Mobile from, BaseCreature pet) { if (Deleted || !from.CheckAlive()) { return; } if (pet.Body.IsHuman) { SayTo(from, 502672); // HA HA HA! Sorry, I am not an inn. } else if (!pet.Controlled) { SayTo(from, 1048053); // You can't stable that! } else if (pet.ControlMaster != from) { SayTo(from, 1042562); // You do not own that pet! } else if (pet.IsDeadPet) { SayTo(from, 1049668); // Living pets only, please. } else if (pet.Summoned) { SayTo(from, 502673); // I can not stable summoned creatures. } else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0)) { SayTo(from, 1042563); // You need to unload your pet. } else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map) { SayTo(from, 1042564); // I'm sorry. Your pet seems to be busy. } else if (from.Stabled.Count >= GetMaxStabled(from)) { SayTo(from, 1042565); // You have too many pets in the stables! } else { //Container bank = from.FindBankNoCreate(); if (from.AccessLevel >= AccessLevel.GameMaster || Banker.WithdrawPackAndBank(from, TypeOfCurrency, StablePrice)) { if (from is PlayerMobile) { ((PlayerMobile)from).StablePet(pet, true); } SayTo( from, "Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. " + "Thou mayst pay outstanding charges when thy pet is claimed."); } else { SayTo(from, 502677); // But thou hast not the funds in thy bank account! } } }
public void EndStable(Mobile from, BaseCreature pet) { if (this.Deleted || !from.CheckAlive()) return; if (!pet.Controlled || pet.ControlMaster != from) { from.SendLocalizedMessage(1042562); // You do not own that pet! } else if (pet.IsDeadPet) { from.SendLocalizedMessage(1049668); // Living pets only, please. } else if (pet.Summoned) { from.SendLocalizedMessage(502673); // I can not stable summoned creatures. } #region Mondain's Legacy else if (pet.Allured) { from.SendLocalizedMessage(1048053); // You can't stable that! } #endregion else if (pet.Body.IsHuman) { from.SendLocalizedMessage(502672); // HA HA HA! Sorry, I am not an inn. } else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0)) { from.SendLocalizedMessage(1042563); // You need to unload your pet. } else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map) { from.SendLocalizedMessage(1042564); // I'm sorry. Your pet seems to be busy. } else if (from.Stabled.Count >= GetMaxStabled(from)) { from.SendLocalizedMessage(1042565); // You have too many pets in the stables! } else { Container bank = from.FindBankNoCreate(); if (bank != null && bank.ConsumeTotal(typeof(Gold), 30)) { pet.ControlTarget = null; pet.ControlOrder = OrderType.Stay; pet.Internalize(); pet.SetControlMaster(null); pet.SummonMaster = null; pet.IsStabled = true; if (Core.SE) pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy from.Stabled.Add(pet); this.UsesRemaining -= 1; from.SendLocalizedMessage(502679); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed! } else { from.SendLocalizedMessage(502677); // But thou hast not the funds in thy bank account! } } }
public void EndStable( Mobile from, BaseCreature pet ) { if ( Deleted || !from.CheckAlive() ) return; if ( !pet.Controlled || pet.ControlMaster != from ) { Say( 1042562 ); // You do not own that pet! } else if ( pet.IsDeadPet ) { Say( 1049668 ); // Living pets only, please. } else if ( pet.Summoned ) { Say( 502673 ); // I can not stable summoned creatures. } else if ( pet.Body.IsHuman ) { Say( 502672 ); // HA HA HA! Sorry, I am not an inn. } else if ( (pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) ) { Say( 1042563 ); // You need to unload your pet. } else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map ) { Say( 1042564 ); // I'm sorry. Your pet seems to be busy. } else if ( from.Stabled.Count >= GetMaxStabled( from ) ) { Say( 1042565 ); // You have too many pets in the stables! } else { if ( Banker.Withdraw( from, 30 ) ) { if ( m_Sign != null ) m_Sign.Stone.CityTreasury += 30; pet.ControlTarget = null; pet.ControlOrder = OrderType.Stay; pet.Internalize(); pet.SetControlMaster( null ); pet.SummonMaster = null; pet.IsStabled = true; from.Stabled.Add( pet ); Say( 502679 ); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed! } else { Say( 502677 ); // But thou hast not the funds in thy bank account! } } }
/// <summary> /// Used for second Provocation target. /// </summary> /// <param name="first"></param> /// <returns></returns> public virtual Mobile GetSecondTarget(BaseCreature first) { if (first == null) return null; int range = BaseInstrument.GetBardRange(this, SkillName.Provocation); IPooledEnumerable eable = this.Map.GetMobilesInRange(Location, range); List<Mobile> possibles = new List<Mobile>(); foreach (Mobile m in eable) { if (m != first && m != this && first.InRange(m.Location, range)) { if (this.CanBeHarmful(m, false) && first.CanBeHarmful(m, false)) possibles.Add(m); } } eable.Free(); Mobile t = null; if (possibles.Count > 0) t = possibles[Utility.Random(possibles.Count)]; possibles.Clear(); possibles.TrimExcess(); return t; }
public void EndStable(Mobile from, BaseCreature pet) { if (Deleted || !from.CheckAlive()) { return; } if (pet.Body.IsHuman) { SayTo(from, 502672); // HA HA HA! Sorry, I am not an inn. } else if (!pet.Controlled) { SayTo(from, 1048053); // You can't stable that! } else if (pet.ControlMaster != from) { SayTo(from, 1042562); // You do not own that pet! } else if (pet.IsDeadPet) { SayTo(from, 1049668); // Living pets only, please. } else if (pet.Summoned) { SayTo(from, 502673); // I can not stable summoned creatures. } else if (pet.Allured) { SayTo(from, 1048053); // You can't stable that! } else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0)) { SayTo(from, 1042563); // You need to unload your pet. } else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map) { SayTo(from, 1042564); // I'm sorry. Your pet seems to be busy. } else if (from.Stabled.Count >= GetMaxStabled(from)) { SayTo(from, 1042565); // You have too many pets in the stables! } else if ((from.Backpack != null && from.Backpack.ConsumeTotal(typeof(Gold), 30)) || Banker.Withdraw(from, 30)) { pet.ControlTarget = null; pet.ControlOrder = OrderType.Stay; pet.Internalize(); pet.SetControlMaster(null); pet.SummonMaster = null; pet.IsStabled = true; pet.StabledBy = from; if (Core.SE) { pet.Loyalty = MaxLoyalty; // Wonderfully happy } from.Stabled.Add(pet); SayTo(from, Core.AOS ? 1049677 : 502679); // [AOS: Your pet has been stabled.] Very well, thy pet is stabled. // Thou mayst recover it by saying 'claim' to me. In one real world week, // I shall sell it off if it is not claimed! } else { SayTo(from, 502677); // But thou hast not the funds in thy bank account! } }
public void EndStable(Mobile from, BaseCreature pet) { if (Deleted || !from.CheckAlive()) { return; } if (pet.Body.IsHuman) { SayTo(from, 502672); // HA HA HA! Sorry, I am not an inn. } else if (!pet.Controlled) { SayTo(from, 1048053); // You can't stable that! } else if (pet.ControlMaster != from) { SayTo(from, 1042562); // You do not own that pet! } else if (pet.Summoned) { SayTo(from, 502673); // I can not stable summoned creatures. } else if ((pet is PackLlama || pet is PackHorse) && pet.Backpack != null && pet.Backpack.Items.Count > 0) { SayTo(from, 1042563); // You need to unload your pet. } else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map) { SayTo(from, 1042564); // I'm sorry. Your pet seems to be busy. } else if (from.Stabled.Count >= GetMaxStabled(from)) { SayTo(from, 1042565); // You have too many pets in the stables! } else { Container bank = from.FindBankNoCreate(); if (@from.Backpack != null && @from.Backpack.ConsumeTotal(typeof(Gold), 30) || bank != null && bank.ConsumeTotal(typeof(Gold), 30)) { pet.ControlTarget = null; pet.ControlOrder = OrderType.Stay; pet.Internalize(); pet.SetControlMaster(null); pet.SummonMaster = null; pet.IsStabled = true; pet.StabledBy = from; from.Stabled.Add(pet); SayTo(from, 502679); // [AOS: Your pet has been stabled.] Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed! } else { SayTo(from, 502677); // But thou hast not the funds in thy bank account! } } }
public void EndStable(Mobile from, BaseCreature pet) { if (Deleted || !from.CheckAlive()) { return; } if (!pet.Controlled || pet.ControlMaster != from) { SayTo(from, true, "You do not own that pet!"); // You do not own that pet! } else if (pet.IsDeadPet) { SayTo(from, true, "Living pets only, please."); // Living pets only, please. } else if (pet.Summoned) { SayTo(from, true, "I can not stable summoned creatures."); // I can not stable summoned creatures. } else if (pet.Body.IsHuman) { SayTo(from, true, "HA HA HA! Sorry, I am not an inn."); // HA HA HA! Sorry, I am not an inn. } else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0)) { SayTo(from, true, "You need to unload your pet."); // You need to unload your pet. } else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map) { SayTo(from, true, "I'm sorry. Your pet seems to be busy."); // I'm sorry. Your pet seems to be busy. } /*else if ( from.Stabled.Count >= GetMaxStabled( from ) ) * { * SayTo( from, true, "You have too many pets in the stables!" ); // You have too many pets in the stables! * }*/ else { Container bank = from.FindBankNoCreate(); if (bank != null && bank.ConsumeTotal(typeof(Gold), 30)) { pet.ControlTarget = null; pet.ControlOrder = OrderType.Stay; pet.Internalize(); pet.SetControlMaster(null); pet.SummonMaster = null; pet.IsStabled = true; if (Core.SE) { pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy } from.Stabled.Add(pet); SayTo(from, true, "Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!"); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed! } else { SayTo(from, true, "But thou hast not the funds in thy bank account!"); // But thou hast not the funds in thy bank account! } } }