Exemple #1
0
        public bool OnUsed(Mobile from, BaseCreature pet)
        {
            if (pet.GetStatMod("[Tasty Treat] Str") != null)
            {
                from.SendLocalizedMessage(1113051);                   // Your pet is still enjoying the last tasty treat!
                return(false);
            }
            else if (DateTime.Now < pet.NextTastyTreat)
            {
                from.SendLocalizedMessage(1113049);                   // Your pet is still recovering from the last tasty treat.
                return(false);
            }
            else
            {
                pet.SayTo(from, 1113050);                   // Your pet looks much happier.

                pet.FixedEffect(0x375A, 10, 15);
                pet.PlaySound(0x1E7);

                AddEffect(pet);

                pet.NextTastyTreat = DateTime.Now + Duration + Cooldown;

                if (this.Amount > 1)
                {
                    this.Amount -= 1;
                    from.Backpack.DropItem(this);
                }
                else
                {
                    Delete();
                }

                return(true);
            }
        }
Exemple #2
0
        public bool OnUsed( Mobile from, BaseCreature pet )
        {
            if ( pet.GetStatMod( "[Tasty Treat] Str" ) != null )
            {
                from.SendLocalizedMessage( 1113051 ); // Your pet is still enjoying the last tasty treat!
                return false;
            }
            else if ( DateTime.Now < pet.NextTastyTreat )
            {
                from.SendLocalizedMessage( 1113049 ); // Your pet is still recovering from the last tasty treat.
                return false;
            }
            else
            {
                pet.SayTo( from, 1113050 ); // Your pet looks much happier.

                pet.FixedEffect( 0x375A, 10, 15 );
                pet.PlaySound( 0x1E7 );

                AddEffect( pet );

                pet.NextTastyTreat = DateTime.Now + Duration + Cooldown;

                if ( this.Amount > 1 )
                {
                    this.Amount -= 1;
                    from.Backpack.DropItem( this );
                }
                else
                {
                    Delete();
                }

                return true;
            }
        }