Esempio n. 1
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                if (m_Stage++ % 4 == 0 || !m_Owner.Move(m_Owner.Direction))
                {
                    m_Owner.Direction = (Direction)Utility.Random(8);
                }

                /*
                 * if ( m_Stage > 16 )
                 * {
                 *      Effects.SendLocationParticles( EffectItem.Create( m_Owner.Location, m_Owner.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
                 *      m_Owner.PlaySound( 0x1FE );
                 *
                 *      m_Owner.Delete();
                 * }
                 */
            }
Esempio n. 2
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                m_Owner.Criminal = false;
                m_Owner.Kills    = 0;
                m_Owner.Stam     = m_Owner.StamMax;

                Mobile target = m_Owner.Focus;

                if (target != null && (target.Deleted || !target.Alive || !m_Owner.CanBeHarmful(target)))
                {
                    m_Owner.Focus = null;
                    Stop();
                    return;
                }
                else if (m_Owner.Weapon is Fists)
                {
                    m_Owner.Kill();
                    Stop();
                    return;
                }

                if (target != null && m_Owner.Combatant != target)
                {
                    m_Owner.Combatant = target;
                }

                if (target == null)
                {
                    Stop();
                }

                /* else
                 * {// <instakill>
                 *      TeleportTo( target );
                 *      target.BoltEffect( 0 );
                 *
                 *      if ( target is BaseCreature )
                 *              ((BaseCreature)target).NoKillAwards = true;
                 *
                 *      target.Damage( target.HitsMax, m_Owner );
                 *      target.Kill(); // just in case, maybe Damage is overriden on some shard
                 *
                 *      if ( target.Corpse != null && !target.Player )
                 *              target.Corpse.Delete();
                 *
                 *      m_Owner.Focus = null;
                 *      Stop();
                 * }// </instakill> */
                else if (!m_Owner.InRange(target, 20))
                {
                    m_Owner.Focus = null;
                }
                else if (!m_Owner.InRange(target, 10) || !m_Owner.InLOS(target))
                {
                    TeleportTo(target);
                }
                else if (!m_Owner.InRange(target, 1))
                {
                    if (!m_Owner.Move(m_Owner.GetDirectionTo(target) | Direction.Running))
                    {
                        TeleportTo(target);
                    }
                }
                else if (!m_Owner.CanSee(target) && Utility.Random(50) == 0)
                {
                    if (Utility.Random(10) == 0)
                    {
                        target.RevealingAction();
                        m_Owner.Say("Ah, I have found you!");
                    }
                    else
                    {
                        m_Owner.Say("Reveal!");
                    }
                }
            }