Пример #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)))
                {
                    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>
            }
Пример #2
0
            protected override void OnTick()
            {
                if (!m_Owner.Deleted)
                {
                    m_Owner.Criminal = false;
                    m_Owner.Karma    = 0;
                    m_Owner.Fame     = 0;
                    m_Owner.Kills    = 0;
                    m_Owner.Stam     = m_Owner.StamMax;

                    Mobile target = m_Owner.Focus;

                    if (target != null)
                    {
                        if (!target.Deleted && target.Alive && m_Owner.CanBeHarmful(target))                             //Dead, deleted, or invul
                        {
                            if (m_Owner.Weapon is Fists)
                            {
                                m_Owner.Kill();
                            }
                            else
                            {
                                if (m_Owner.Combatant != target)
                                {
                                    m_Owner.Combatant = target;
                                }

                                TeleportTo(target);
                                target.BoltEffect(0);

                                if (target is BaseCreature)
                                {
                                    ((BaseCreature)target).NoKillAwards = true;
                                }

                                target.Damage(target.HitsMax, m_Owner);
                                target.LastKiller = m_Owner;
                                target.Kill();                                 // just in case, maybe Damage is overridden on some shard

                                if (target.Player)
                                {
                                    if (Faction.Find(target) != null)
                                    {
                                        Faction.ApplySkillLoss(target);
                                    }
                                }
                                else if (target.Corpse != null)
                                {
                                    target.Corpse.Delete();
                                }
                            }
                        }

                        m_Owner.Focus = null;
                    }
                }

                Stop();
            }
Пример #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))
                {
                    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 );
                 * }*/
            }
Пример #4
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                m_Owner.Criminal         = false;
                m_Owner.ShortTermMurders = 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.LastKiller = null;
                    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.DropHolding();
                    target.Damage(target.HitsMax, m_Owner);
                    target.LastKiller = null;
                    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 ) )
                 * {
                 *      if ( !m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0 )
                 *              m_Owner.Say( "Reveal!" );
                 * }*/
            }
Пример #5
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;
                }

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

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

                else
                {
                    //wander around, kill and wait for timer to end
                    if ((m_Stage++ % 4) == 0 || !m_Owner.Move(m_Owner.Direction))
                    {
                        m_Owner.Direction = (Direction)Utility.Random(8);
                    }

                    //Time to talk
                    switch (Utility.Random(5))  //picks one of the following
                    {
                    case 0:
                    { m_Owner.Say("Whose life is it anyway?."); break; }

                    case 1:
                    { m_Owner.Say("The appearance of right oft leads us wrong."); break; }

                    case 2:
                    { m_Owner.Say("Go, and do thou likewise."); break; }

                    case 3:
                    { m_Owner.Say("What stings is justice."); break; }

                    case 4:
                    { m_Owner.Say("Dig the well before you are thirsty."); break; }
                    }

                    //Stop fighting and wait for next attack
                    //m_Owner.Focus = null;
                    //Stop();
                    //return;
                }
            }
Пример #6
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;
                }

                //10OCT2007 InstaKill for Creatures ONLY *** START ***

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

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

                else
                {
                    //kill creatures only
                    if (target is BaseCreature)
                    {
                        target.BoltEffect(0);
                        //((BaseCreature)target).NoKillAwards = true;
                        target.Kill(); // just in case, maybe Damage is overriden on some shard
                        m_Owner.Focus = null;
                        Stop();
                    }
                    else
                    {
                        //kill player if in a certian region
                        IPoint3D ip = m_Owner as IPoint3D;

                        if (ip != null)
                        {
                            Point3D p = new Point3D(ip);

                            Region reg = Region.Find(new Point3D(p), m_Owner.Map);

                            Console.WriteLine("Guards Called to: " + reg.Name);

                            if (reg.Name == "SafeZone")
                            {
                                target.Frozen = true;
                                target.BoltEffect(0);
                                target.BodyMod = Utility.RandomList(50, 56);

                                Timer.DelayCall(TimeSpan.FromSeconds(20.0), new TimerCallback(ReportKill));
                                target.BoltEffect(0);
                                //((BaseCreature)target).NoKillAwards = true;
                                target.Kill(); // just in case, maybe Damage is overriden on some shard

                                target.BodyMod = 0x0;
                                target.Frozen  = false;

                                m_Owner.Focus = null;
                                m_TeleportTo  = false;
                                Stop();
                            }
                            else
                            {
                                //Turn Off Guard
                                m_Owner.Focus = null;

                                //wander around and wait for timer to end
                                if ((m_Stage++ % 4) == 0 || !m_Owner.Move(m_Owner.Direction))
                                {
                                    m_Owner.Direction = (Direction)Utility.Random(8);
                                }

                                //Time to talk
                                switch (Utility.Random(5))  //picks one of the following
                                {
                                case 0:
                                { m_Owner.Say("Depend not on fortune, but on conduct."); break; }

                                case 1:
                                { m_Owner.Say("A great fortune in the hands of a fool is a great misfortune."); break; }

                                case 2:
                                { m_Owner.Say("To save time is to lengthen life."); break; }

                                case 3:
                                { m_Owner.Say("Rich gifts wax poor when givers prove unkind."); break; }

                                case 4:
                                { m_Owner.Say("Act the way you'd like to be and soon you'll be the way you act."); break; }
                                }
                            }
                        }
                    }
                }

                //10OCT2007 InstaKill for Creatures ONLY *** END  ***

                //{// <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 ) )
                //{
                //    if ( !m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0 )
                //        m_Owner.Say( "Reveal!" );
                //}*/
            }
Пример #7
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted || m_Owner == null)
                {
                    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 );
                 * BaseWeapon weapon = m_Owner.Weapon as BaseWeapon;
                 * weapon.PlaySwingAnimation(m_Owner);
                 * m_Owner.PlaySound(weapon.DefHitSound);
                 *
                 *
                 *      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>*/
                if (!m_Owner.InRange(target, 20))
                {
                    m_Owner.Focus = null;
                }
                else if (!m_Owner.InRange(target, 10) || !m_Owner.InLOS(target))
                {
                    if (!m_Owner.Move(m_Owner.GetDirectionTo(target) | Direction.Running))
                    {
                        TeleportTo(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 ) )
                 * {
                 *      if ( !m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0 )
                 *              m_Owner.Say( "Reveal!" );
                 * }*/
            }
Пример #8
0
            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;
                    }
                }
            }
Пример #9
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) || target.Map == Map.Internal)))
                {
                    foreach (Mobile m in m_Owner.GetMobilesInRange(15))
                    {
                        if (Misc.NotorietyHandlers.IsGuardCandidate(m))
                        {
                            Region        region        = (Region.Find(m.Location, m.Map));
                            GuardedRegion guardedRegion = (GuardedRegion)region.GetRegion(typeof(GuardedRegion));

                            //Player is in guarded
                            if (guardedRegion != null && !guardedRegion.Disabled)
                            {
                                target        = m;
                                m_Owner.Focus = m;
                                break;
                            }
                        }
                    }
                }

                if (target != null && (target.Deleted || !target.Alive || !m_Owner.CanBeHarmful(target) || target.Map == Map.Internal))
                {
                    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)
                {
                    m_Owner.Focus = null;
                    Stop();
                    return;
                }

                if (target.Hidden)
                {
                    target.RevealingAction();
                    target.SendLocalizedMessage(500814); // You have been revealed!
                }

                Region        from = (Region.Find(target.Location, target.Map));
                GuardedRegion reg  = (GuardedRegion)from.GetRegion(typeof(GuardedRegion));

                //Player is in unguarded
                if (reg == null || reg.Disabled)
                {
                    //Player is still within range, follow on foot
                    if (m_Owner.InRange(target, 30))
                    {
                        m_Owner.Move(m_Owner.GetDirectionTo(target));
                    }

                    //Player has gone away, remove guard
                    else
                    {
                        m_Owner.Focus = null;
                        Stop();
                        return;
                    }
                }
                //Player is in guarded, teleport
                else if (!m_Owner.InRange(target, 1))
                {
                    TeleportTo(target);
                }
            }
Пример #10
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!");
                    }
                }
            }