public override void AddCustomContextEntries( Mobile from, ArrayList list ) { if ( from.Alive ) { list.Add( new StableEntry( this, from ) ); if (from.HasStabled()) list.Add( new ClaimAllEntry( this, from ) ); } base.AddCustomContextEntries( from, list ); }
public void EndStable( Mobile from, BaseCreature pet ) { if ( Deleted || !from.CheckAlive() ) return; if ( !pet.Controled || 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.Body.IsHuman ) { SayTo( from, 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) ) { 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.HasStabled() && from.Stabled.Count >= GetMaxStabled(from)) { SayTo( from, 1042565 ); // You have too many pets in the stables! } else { Container bank = from.BankBox; 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; from.AddStabled(pet); SayTo( from, 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 { SayTo( from, 502677 ); // But thou hast not the funds in thy bank account! } } }
public void BeginStable( Mobile from ) { if ( Deleted || !from.CheckAlive() ) return; if (from.HasStabled() && from.Stabled.Count >= GetMaxStabled(from)) { SayTo( from, 1042565 ); // You have too many pets in the stables! } else { SayTo( from, 1042558 ); /* I charge 30 gold per pet for a real week's stable time. * I will withdraw it from thy bank account. * Which animal wouldst thou like to stable here? */ from.Target = new StableTarget( this ); } }
public void EndClaimList( Mobile from, BaseCreature pet ) { if (pet == null || pet.Deleted || from.Map != this.Map || !from.InRange(this, 14) || !from.HasStabled(pet) || !from.CheckAlive()) return; if ( (from.Followers + pet.ControlSlots) <= from.FollowersMax ) { pet.SetControlMaster( from ); if ( pet.Summoned ) pet.SummonMaster = from; pet.ControlTarget = from; pet.ControlOrder = OrderType.Follow; pet.MoveToWorld( from.Location, from.Map ); pet.IsStabled = false; from.RemoveStabled(pet); SayTo( from, 1042559 ); // Here you go... and good day to you! } else { SayTo( from, 1049612, pet.Name ); // ~1_NAME~ remained in the stables because you have too many followers. } }
public void SummonPet( Mobile from ) { BaseCreature pet = this.Pet; if ( Deleted || pet == null ) return; if ( Charges == 0 ) { SendLocalizedMessageTo( from, 1054122 ); // The Crystal Ball darkens. It must be charged before it can be used again. } else if ( pet is BaseMount && ((BaseMount)pet).Rider == from ) { MessageHelper.SendLocalizedMessageTo( this, from, 1054124, 0x36 ); // The Crystal Ball fills with a yellow mist. Why would you summon your pet while riding it? } else if ( pet.Map == Map.Internal && ( !pet.IsStabled || (from.Followers + pet.ControlSlots) > from.FollowersMax ) ) { MessageHelper.SendLocalizedMessageTo( this, from, 1054125, 0x5 ); // The Crystal Ball fills with a blue mist. Your pet is not responding to the summons. } else if ((!pet.Controled || pet.ControlMaster != from) && !from.HasStabled(pet)) { MessageHelper.SendLocalizedMessageTo( this, from, 1054126, 0x8FD ); // The Crystal Ball fills with a grey mist. You are not the owner of the pet you are attempting to summon. } else if ( !pet.IsBonded ) { MessageHelper.SendLocalizedMessageTo( this, from, 1054127, 0x22 ); // The Crystal Ball fills with a red mist. You appear to have let your bond to your pet deteriorate. } else if ( from.Map == Map.Ilshenar || from.Region is Server.Regions.Jail ) { from.Send( new AsciiMessage( this.Serial, this.ItemID, MessageType.Regular, 0x22, 3, "", "You cannot summon your pet to this location." ) ); } else { Charges--; if ( pet.IsStabled ) { pet.SetControlMaster( from ); if ( pet.Summoned ) pet.SummonMaster = from; pet.ControlTarget = from; pet.ControlOrder = OrderType.Follow; pet.IsStabled = false; from.RemoveStabled(pet); } pet.MoveToWorld( from.Location, from.Map ); MessageHelper.SendLocalizedMessageTo( this, from, 1054128, 0x43 ); // The Crystal Ball fills with a green mist. Your pet has been summoned. } }