Пример #1
0
        private static void Shoot(PlayerMobile from, Mobile target, INinjaWeapon weapon)
        {
            if (from != target && CanUseWeapon(from, weapon) && from.CanBeHarmful(target))
            {
                if (weapon.WeaponMinRange == 0 || !from.InRange(target, weapon.WeaponMinRange))
                {
                    from.NinjaWepCooldown = true;

                    from.Direction = from.GetDirectionTo(target);

                    from.RevealingAction();

                    weapon.AttackAnimation(from, target);

                    ConsumeUse(weapon);

                    if (CombatCheck(from, target))
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback<object[]>(OnHit), new object[] { from, target, weapon });
                    }

                    Timer.DelayCall(TimeSpan.FromSeconds(2.5), new TimerStateCallback<PlayerMobile>(ResetUsing), from);
                }
                else
                {
                    from.SendLocalizedMessage(1063303); // Your target is too close!
                }
            }
        }
Пример #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 );

		}
Пример #3
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
		}