Esempio n. 1
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))
                {
                    if (target != null && (!target.Alive || target.Deleted))
                    {
                        if (!target.Player && target.Corpse != null && !target.Corpse.Deleted)
                        {
                            target.Corpse.Delete();
                        }

                        target.RemoveAggressor(m_Owner);
                        target.RemoveAggressed(m_Owner);
                        m_Owner.RemoveAggressor(target);
                        m_Owner.RemoveAggressed(target);
                    }
                    Stop();
                    m_Owner.Focus           = m_Owner.Combatant = null;
                    m_Owner.AIObject.Action = ActionType.Wander;
                    return;
                }

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

                if (!m_Owner.InRange(target, 30) || !m_Owner.CanSee(target))
                {
                    m_Owner.Focus           = m_Owner.Combatant = null;
                    m_Owner.AIObject.Action = ActionType.Wander;
                }
                else if (!m_Owner.InRange(target, 5) || !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 );
                 * }*/
            }
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                m_Owner.Criminal        = false;
                m_Owner.LongTermMurders = 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 if (Core.UOSP || Core.UOMO)
                {                // <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)) && !PreferMagic())
                {
                    TeleportTo(target);
                }
                else if (!m_Owner.InRange(target, 1) && !PreferMagic())
                {
                    if (!m_Owner.Move(m_Owner.GetDirectionTo(target) | Direction.Running))
                    {
                        TeleportTo(target);
                    }
                }
                else if (!m_Owner.CanSee(target) && DateTime.Now > m_NextRevealChatter)
                {
                    bWasHidden          = true;
                    m_NextRevealChatter = DateTime.Now + TimeSpan.FromMilliseconds(850);
                    switch (Utility.Random(4))
                    {
                    case 0: m_Owner.Say("Reveal yourself!"); break;

                    case 1: m_Owner.Say("Reveal!"); break;

                    case 2: m_Owner.Say("I know you are here somewhere!"); break;

                    case 3: m_Owner.Say("I'll find you!"); break;
                    }
                }
                else if (m_Owner.CanSee(target) && bWasHidden)
                {
                    bWasHidden = false;
                    switch (Utility.Random(4))
                    {
                    case 0: m_Owner.Say("Ah ha! I have found you"); break;

                    case 1: m_Owner.Say("There you are you wretch!"); break;

                    case 2: m_Owner.Say("You can run but you cannot hide."); break;

                    case 3: m_Owner.Say("Gotcha!"); break;
                    }
                }
            }
Esempio n. 3
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 ) )  // edited by Matt - make it possible to run away
                 * {
                 *      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))
                {
                    if (!m_Owner.UseSkill(SkillName.DetectHidden) && Utility.Random(50) == 0)
                    {
                        m_Owner.Say("Reveal!");
                    }
                }
            }
Esempio n. 4
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();
                }
                // when uncommenting instakill, be sure to comment the remaining else ifs below.
                // <instakill>

                /*
                 * else
                 * {
                 *      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!");
                    }
                }
            }