Server.Mobiles.BaseCreature.CheckControlChance C# (CSharp) Méthode

CheckControlChance() public méthode

public CheckControlChance ( Server.Mobile m ) : bool
m Server.Mobile
Résultat bool
        public virtual bool CheckControlChance( Mobile m )
        {
            if ( GetControlChance( m ) > Utility.RandomDouble() )
            {
                Loyalty += 1;
                return true;
            }

            PlaySound( GetAngerSound() );

            if ( Body.IsAnimal )
                Animate( 10, 5, 1, true, false, 0 );
            else if ( Body.IsMonster )
                Animate( 18, 5, 1, true, false, 0 );

            Loyalty -= 3;
            return false;
        }

Usage Example

Exemple #1
0
        private void DoClaim(Mobile from, BaseCreature pet, PetClaimTicket petClaimTicket)
        {
            pet.SetControlMaster(from);

            pet.ControlTarget = from;
            pet.ControlOrder  = OrderType.Follow;

            pet.MoveToWorld(from.Location, from.Map);

            pet.IsStabled = false;
            pet.StabledBy = null;

            petClaimTicket.Stabled = null;
            petClaimTicket.Delete();

            pet.CheckControlChance(from);
        }
BaseCreature