Animate() public méthode

public Animate ( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay ) : void
action int
frameCount int
repeatCount int
forward bool
repeat bool
delay int
Résultat void
Exemple #1
0
        private static void EventSink_RacialAbilityUsed(RacialAbilityRequestEventArgs e)
        {
            PlayerMobile from = e.Mobile as PlayerMobile;

            if (from == null)
            {
                return;
            }

            switch (e.AbilityID)
            {
            case 1:
            {
                /*
                 * TODO (SA): ¿Dónde van estos CliLocs?
                 * - You must heal before flying.	1112454
                 * - You can't use this while flying!	1113414
                 * - You may not continue while flying.	1113589
                 */

                if (from.Race == Race.Gargoyle)
                {
                    if (!from.Flying)
                    {
                        if (from.Spell == null)
                        {
                            Spell spell = new FlySpell(from);

                            spell.Cast();
                        }
                    }
                    else if (IsValidLandLocation(from.Location, from.Map))
                    {
                        from.Animate(0xA);
                        from.Flying = false;
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1113081);                                           // You may not land here.
                    }
                }

                break;
            }
            }
        }
Exemple #2
0
		private static void Honor( PlayerMobile source, Mobile target )
		{
			IHonorTarget honorTarget = target as IHonorTarget;
			GuardedRegion reg = (GuardedRegion) source.Region.GetRegion( typeof( GuardedRegion ) );
			Map map = source.Map;

			if ( honorTarget == null )
				return;

			if ( honorTarget.ReceivedHonorContext != null )
			{
				if ( honorTarget.ReceivedHonorContext.Source == source )
					return;

				if ( honorTarget.ReceivedHonorContext.CheckDistance() )
				{
					source.SendLocalizedMessage( 1063233 ); // Somebody else is honoring this opponent
					return;
				}
			}

			if ( target.Hits < target.HitsMax )
			{
				source.SendLocalizedMessage( 1063166 ); // You cannot honor this monster because it is too damaged.
				return;
			}

			BaseCreature cret = target as BaseCreature;
			if ( target.Body.IsHuman && (cret == null || (!cret.AlwaysAttackable && !cret.AlwaysMurderer)) )
			{

				if( reg == null || reg.IsDisabled() )
				{				
					//Allow honor on blue if Out of guardzone
				}
				else if ( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
				{
					//Allow honor on blue if in Fel
				}
				else
				{
					source.SendLocalizedMessage( 1001018 ); // You cannot perform negative acts
					return;					//cannot honor in trammel town on blue
				}
			}

			if( Core.ML && target is PlayerMobile )
			{
				source.SendLocalizedMessage( 1075614 ); // You cannot honor other players.
				return;
			}

			if ( source.SentHonorContext != null )
				source.SentHonorContext.Cancel();

			new HonorContext( source, target );

			source.Direction = source.GetDirectionTo( target );

			if ( !source.Mounted )
				source.Animate( 32, 5, 1, true, true, 0 );

		}
		private static void Honor( PlayerMobile source, Mobile target )
		{
			IHonorTarget honorTarget = target as IHonorTarget;

			if ( honorTarget == null || !source.CanBeHarmful( target, true ) )
				return;

			if ( honorTarget.ReceivedHonorContext != null )
			{
				if ( honorTarget.ReceivedHonorContext.Source == source )
					return;

				if ( honorTarget.ReceivedHonorContext.CheckDistance() )
				{
					source.SendLocalizedMessage( 1063233 ); // Somebody else is honoring this opponent
					return;
				}
			}

			if ( target.Hits < target.HitsMax )
			{
				source.SendLocalizedMessage( 1063166 ); // You cannot honor this monster because it is too damaged.
				return;
			}

			if ( source.SentHonorContext != null )
				source.SentHonorContext.Cancel();

			new HonorContext( source, target );

			source.Direction = source.GetDirectionTo( target );

			if ( !source.Mounted )
				source.Animate( 32, 5, 1, true, true, 0 );

			// OSI apparently removed this message... it's nice though
			source.Say( 1063231 ); // I honor you
		}
            public InternalTimer(PlayerMobile from, int turn)
                : base(TimeSpan.FromSeconds(1.4))
            {
                if (from.Body.Type == BodyType.Human && !from.Mounted)
                    from.Animate(9, (5 - turn), 1, true, false, 0);

                m_From = from;
                m_turn = turn;
            }