protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

//Old Salty - commented this region because the check is now made in BaseGuard.cs
//				if ( m_Owner.Combatant != null )
//					m_Owner.Focus = m_Owner.Combatant;

                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();
                }
            }
Exemple #2
0
            private void TeleportTo(Mobile target)
            {
                Point3D from = m_Owner.Location;
                Point3D to   = target.Location;

                m_Owner.Location = to;

                Effects.SendLocationParticles(EffectItem.Create(from, m_Owner.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                Effects.SendLocationParticles(EffectItem.Create(to, m_Owner.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                m_Owner.PlaySound(0x1FE);
            }
Exemple #3
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted || (m_Owner.m_IsAutoGuard && m_Owner.Region is Regions.GuardedRegion))
                {
                    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();
                }
            }
Exemple #4
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();
                }
            }
            private void TeleportTo(Mobile target)
            {
                if (m_TeleportTo == true)
                {
                    m_TeleportTo = false;

                    Point3D from = m_Owner.Location;
                    //10OCT2007 Adjust InstaKill Distance *** START ***
                    //Instead of teleporting on top of the player, make it a few spaces away.
                    //Point3D to = target.Location;
                    Point3D toclose = target.Location;
                    Point3D to      = new Point3D(toclose.X + (Utility.RandomMinMax(-5, 5)), toclose.Y + (Utility.RandomMinMax(-5, 5)), toclose.Z);
                    //10OCT2007 Adjust InstaKill Distance *** END   ***

                    m_Owner.Location = to;

                    Effects.SendLocationParticles(EffectItem.Create(from, m_Owner.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                    Effects.SendLocationParticles(EffectItem.Create(to, m_Owner.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                    m_Owner.PlaySound(0x1FE);
                }
            }
Exemple #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;
                }
                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>

                /*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!" );
                 * }*/
            }
Exemple #7
0
            private void TeleportTo(Mobile target)
            {
                Point3D from = m_Owner.Location;
                Point3D to   = m_Owner.Location;

                Direction dir = m_Owner.GetDirectionTo(target);

                if (dir == Direction.North)
                {
                    to.Y -= 2;
                }
                else if (dir == Direction.South)
                {
                    to.Y += 2;
                }
                else if (dir == Direction.East)
                {
                    to.X += 2;
                }
                else if (dir == Direction.West)
                {
                    to.X -= 2;
                }
                else if (dir == Direction.Up)
                {
                    to.Y -= 2;
                    to.X -= 2;
                }
                else if (dir == Direction.Down)
                {
                    to.Y += 2;
                    to.X += 2;
                }
                else if (dir == Direction.Right)
                {
                    to.Y -= 2;
                    to.X += 2;
                }
                else if (dir == Direction.Left)
                {
                    to.Y += 2;
                    to.X -= 2;
                }
                else
                {
                    to = target.Location;
                }

                if (m_Owner.InRange(target, 1))
                {
                    to.Z = target.Location.Z;
                }
                else
                {
                    to.Z = m_Owner.Map.Tiles.GetLandTile(to.X, to.Y).Z;
                }

                m_Owner.Location = to;

                Effects.SendLocationParticles(EffectItem.Create(from, m_Owner.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                Effects.SendLocationParticles(EffectItem.Create(to, m_Owner.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                m_Owner.PlaySound(0x1FE);
            }
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

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

                    if (m_Stage > 16)
                    {
                        Stop();
                        Effects.SendLocationParticles(EffectItem.Create(m_Owner.Location, m_Owner.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                        m_Owner.PlaySound(0x1FE);
                        m_Owner.Delete();
                    }
                }
                else
                {
                    if (m_Mobile == null)
                    {
                        Stop();
                    }
                    else if (m_Stage++ % 4 == 0)
                    {
                        if (Utility.RandomBool())
                        {
                            switch (Utility.Random(5))
                            {                                   // say things just once
                            case 0: if (said[0]++ == 0)
                                {
                                    m_Owner.Say("Let that be a lesson to you {0}!", m_Mobile.Name);
                                }
                                break;

                            case 1: if (said[1]++ == 0)
                                {
                                    m_Owner.Say("Take heed citizens.");
                                }
                                break;

                            case 2: if (said[2]++ == 0)
                                {
                                    m_Owner.Say("{0} won’t be giving us any more trouble.", m_Mobile.Female ? "She" : "He");
                                }
                                break;

                            case 3: if (said[3]++ == 0)
                                {
                                    m_Owner.Say("{0} > {1}", m_Owner.Name, m_Mobile.Name);
                                }
                                break;

                            case 4: if (said[4]++ == 0)
                                {
                                    m_Owner.Whisper("That'll teach {0}.", m_Mobile.Female ? "her" : "him");
                                }
                                break;
                            }
                        }
                    }
                    else if (m_Stage > 16)
                    {                           // salute
                        m_Owner.Animate(33, 5, 1, true, false, 0);
                        Stop();
                    }
                }
            }