Exemple #1
0
        public override void LockPick(Mobile from)
        {
            base.LockPick(from);

            if (m_Level >= 3)
            {
                m_Guardian = SpawnGuardian("Pirate", m_Level, from.Skills[SkillName.Hiding].Value);
            }

            if (m_Guardian != null)
            {
                m_Guardian.AggressiveAction(from);
            }
        }
Exemple #2
0
            public override bool OnMoveOver(Mobile m)
            {
                if ((m is PlayerMobile || (m is BaseCreature && ((BaseCreature)m).GetMaster() is PlayerMobile)) && m.CanBeHarmful(Owner, false))
                {
                    m.Freeze(TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10)));

                    if (Owner.CanBeHarmful(m))
                    {
                        m.AggressiveAction(Owner);
                        Owner.InitialFocus = m;
                        Owner.Combatant    = m;
                    }
                }

                return(true);
            }
        protected override void OnTick()
        {
            if (m_Caster == null)
            {
                return;
            }

            if (m_Caster.Alive && m_Target.Alive)
            {
                /*
                 * if (RunCount == 1)
                 * {
                 *  m_Target.PublicOverheadMessage(MessageType.Regular, 2117, false, "*You see " + m_Target.Name + " catch fire");
                 * }
                 */
                RunCount++;

                int hpdrainamount = (m_Caster.PlayerLevel * 2 - (RunCount * 2)) + Utility.RandomMinMax(-1, 2);

                if (hpdrainamount <= 1)
                {
                    m_Target.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist);
                    m_Target.SendMessage("You are extinguished");
                    return;
                }

                m_Target.FixedParticles(0x19AB, 10, 5, 5052, EffectLayer.Waist);
                m_Target.PlaySound(0x208);
                m_Target.SendLocalizedMessage(503000);
                AOS.Damage(m_Target, m_Caster, hpdrainamount, 0, 100, 0, 0, 0);
                m_Target.AggressiveAction(m_Caster, false);

                if (RunCount == MaxCount)
                {
                    m_Target.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist);
                }

                else if (RunCount < MaxCount)
                {
                    if (m_Target.Alive)
                    {
                        Timer m_Timer = new IgniteTimer(m_Caster, m_Target, RunCount, MaxCount, DateTime.Now + TimeSpan.FromSeconds(1.5));
                        m_Timer.Start();
                    }
                }
            }
        }
Exemple #4
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile attacker = Caster, source = Caster;

                SpellHelper.Turn(Caster, m);

                attacker.AggressiveAction(m, attacker.IsHarmfulCriminal(m));

                SpellHelper.CheckReflect((int)this.Circle, ref source, ref m);

                InternalTimer t = new InternalTimer(this, attacker, source, m);
                t.Start();
            }

            FinishSequence();
        }
        public virtual bool ExecuteTrap( Mobile from )
        {
            if ( m_TrapType != TrapType.None && m_Trapped )
            {
                if ( from.AccessLevel != AccessLevel.Player )
                {
                    if ( from.AccessLevel >= AccessLevel.GameMaster )
                        from.SendAsciiMessage( "Note: This container is trapped." );
                    return false;
                }

                if ( m_Trapper != null && !m_Trapper.Deleted )
                    m_Trapper.Attack( from );
                //	from.AggressiveAction( m_Trapper, false );
                // should m_Trapper be flagged for their trap being opened?

                switch ( m_TrapType )
                {
                    case TrapType.DartTrap:
                    {
                        from.SendLocalizedMessage( 502999 ); // You set off a trap!
                        from.SendAsciiMessage( "A dart embeds itself in your flesh!" );

                        if ( from != m_Trapper && m_Trapper != null && !m_Trapper.Deleted )
                            from.AggressiveAction( m_Trapper );//AggressiveActionNoRegion( m_Trapper, from, Notoriety.Compute( m_Trapper, from ) == Notoriety.Innocent );

                        AOS.Damage( from, Utility.Random( 1, 15 ) + m_TrapPower, 100, 0, 0, 0, 0 );
                        Effects.SendMovingEffect( this, from, 0x1BFE, 18, 1, false, false );
                        break;
                    }
                    case TrapType.PoisonTrap:
                    {
                        from.SendLocalizedMessage( 502999 ); // You set off a trap!

                        if ( from.InRange( GetWorldLocation(), 2 ) )
                        {
                            from.Poison = Poison.GetPoison( m_TrapPower - 1 );
                            from.SendAsciiMessage( "A cloud of green gas engulfs your body!" );

                            if ( from != m_Trapper && m_Trapper != null && !m_Trapper.Deleted )
                                from.AggressiveAction( m_Trapper );
                        }

                        Point3D loc = GetWorldLocation();
                        Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z ), Map, 0x11a6, 15 );
                        break;
                    }
                    case TrapType.ExplosionTrap:
                    {
                        from.SendLocalizedMessage( 502999 ); // You set off a trap!

                        int damage = 20*( m_TrapPower - 1 ) + Utility.Random( 25 );
                        if ( this.RootParent is Mobile && this.RootParent != from )
                        {
                            Mobile mob = (Mobile)this.RootParent;
                            AOS.Damage( mob, damage / 3, 0, 100, 0, 0, 0 );
                            damage -= damage/3;
                            mob.SendLocalizedMessage( 503000 ); // Your skin blisters from the heat!

                            if ( mob != m_Trapper && m_Trapper != null && !m_Trapper.Deleted )
                                from.AggressiveAction( m_Trapper );
                        }

                        if ( from.InRange( GetWorldLocation(), 2 ) )
                        {
                            AOS.Damage( from, damage, 0, 100, 0, 0, 0 );
                            from.SendLocalizedMessage( 503000 ); // Your skin blisters from the heat!

                            if ( from != m_Trapper && m_Trapper != null && !m_Trapper.Deleted )
                                from.AggressiveAction( m_Trapper );
                        }

                        Point3D loc = GetWorldLocation();
                        Effects.PlaySound( loc, Map, 0x307 );
                        Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z - 11 ), Map, 0x36BD, 15 );
                        break;
                    }
                    case TrapType.MagicTrap:
                    {
                        if ( from.InRange( GetWorldLocation(), 1 ) )
                        {
                            double damage = Spells.Spell.GetPreUORDamage( Spells.SpellCircle.Second ) * 0.75;
                            if ( from.CheckSkill( SkillName.MagicResist, damage * 2.5 - 25.0, damage * 2.5 + 25.0 ) )
                            {
                                damage *= 0.5;
                                from.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
                            }
                            if ( damage < 1 )
                                damage = 1;
                            from.Damage( (int)damage );
                            //AOS.Damage( from, m_TrapPower, 0, 100, 0, 0, 0 );
                        }

                        Point3D loc = GetWorldLocation();

                        Effects.PlaySound( loc, Map, 0x307 );

                        Effects.SendLocationEffect( new Point3D( loc.X - 1, loc.Y, loc.Z ), Map, 0x36BD, 15 );
                        Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y, loc.Z ), Map, 0x36BD, 15 );

                        Effects.SendLocationEffect( new Point3D( loc.X, loc.Y - 1, loc.Z ), Map, 0x36BD, 15 );
                        Effects.SendLocationEffect( new Point3D( loc.X, loc.Y + 1, loc.Z ), Map, 0x36BD, 15 );

                        Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z + 11 ), Map, 0x36BD, 15 );

                        break;
                    }
                }

                m_Trapped = false;
                return true;
            }

            return false;
        }
        public virtual bool ExecuteTrap(Mobile from)
        {
            if (m_TrapType != TrapType.None && m_Trapped)
            {
                if (from.AccessLevel != AccessLevel.Player)
                {
                    if (from.AccessLevel >= AccessLevel.GameMaster)
                    {
                        from.SendAsciiMessage("Note: This container is trapped.");
                    }
                    return(false);
                }

                if (m_Trapper != null && !m_Trapper.Deleted)
                {
                    m_Trapper.Attack(from);
                }
                //	from.AggressiveAction( m_Trapper, false );
                // should m_Trapper be flagged for their trap being opened?

                switch (m_TrapType)
                {
                case TrapType.DartTrap:
                {
                    from.SendLocalizedMessage(502999);                               // You set off a trap!
                    from.SendAsciiMessage("A dart embeds itself in your flesh!");

                    if (from != m_Trapper && m_Trapper != null && !m_Trapper.Deleted)
                    {
                        from.AggressiveAction(m_Trapper);                                  //AggressiveActionNoRegion( m_Trapper, from, Notoriety.Compute( m_Trapper, from ) == Notoriety.Innocent );
                    }
                    AOS.Damage(from, Utility.Random(1, 15) + m_TrapPower, 100, 0, 0, 0, 0);
                    Effects.SendMovingEffect(this, from, 0x1BFE, 18, 1, false, false);
                    break;
                }

                case TrapType.PoisonTrap:
                {
                    from.SendLocalizedMessage(502999);                               // You set off a trap!

                    if (from.InRange(GetWorldLocation(), 2))
                    {
                        from.Poison = Poison.GetPoison(m_TrapPower - 1);
                        from.SendAsciiMessage("A cloud of green gas engulfs your body!");

                        if (from != m_Trapper && m_Trapper != null && !m_Trapper.Deleted)
                        {
                            from.AggressiveAction(m_Trapper);
                        }
                    }

                    Point3D loc = GetWorldLocation();
                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z), Map, 0x11a6, 15);
                    break;
                }

                case TrapType.ExplosionTrap:
                {
                    from.SendLocalizedMessage(502999);                               // You set off a trap!

                    int damage = 20 * (m_TrapPower - 1) + Utility.Random(25);
                    if (this.RootParent is Mobile && this.RootParent != from)
                    {
                        Mobile mob = (Mobile)this.RootParent;
                        AOS.Damage(mob, damage / 3, 0, 100, 0, 0, 0);
                        damage -= damage / 3;
                        mob.SendLocalizedMessage(503000);                                   // Your skin blisters from the heat!

                        if (mob != m_Trapper && m_Trapper != null && !m_Trapper.Deleted)
                        {
                            from.AggressiveAction(m_Trapper);
                        }
                    }

                    if (from.InRange(GetWorldLocation(), 2))
                    {
                        AOS.Damage(from, damage, 0, 100, 0, 0, 0);
                        from.SendLocalizedMessage(503000);                                   // Your skin blisters from the heat!

                        if (from != m_Trapper && m_Trapper != null && !m_Trapper.Deleted)
                        {
                            from.AggressiveAction(m_Trapper);
                        }
                    }

                    Point3D loc = GetWorldLocation();
                    Effects.PlaySound(loc, Map, 0x307);
                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z - 11), Map, 0x36BD, 15);
                    break;
                }

                case TrapType.MagicTrap:
                {
                    if (from.InRange(GetWorldLocation(), 1))
                    {
                        double damage = Spells.Spell.GetPreUORDamage(Spells.SpellCircle.Second) * 0.75;
                        if (from.CheckSkill(SkillName.MagicResist, damage * 2.5 - 25.0, damage * 2.5 + 25.0))
                        {
                            damage *= 0.5;
                            from.SendLocalizedMessage(501783);                                       // You feel yourself resisting magical energy.
                        }
                        if (damage < 1)
                        {
                            damage = 1;
                        }
                        from.Damage((int)damage);
                        //AOS.Damage( from, m_TrapPower, 0, 100, 0, 0, 0 );
                    }

                    Point3D loc = GetWorldLocation();

                    Effects.PlaySound(loc, Map, 0x307);

                    Effects.SendLocationEffect(new Point3D(loc.X - 1, loc.Y, loc.Z), Map, 0x36BD, 15);
                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y, loc.Z), Map, 0x36BD, 15);

                    Effects.SendLocationEffect(new Point3D(loc.X, loc.Y - 1, loc.Z), Map, 0x36BD, 15);
                    Effects.SendLocationEffect(new Point3D(loc.X, loc.Y + 1, loc.Z), Map, 0x36BD, 15);

                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z + 11), Map, 0x36BD, 15);

                    break;
                }
                }

                m_Trapped = false;
                return(true);
            }

            return(false);
        }
			public static void AGGRESSIVEACTION(TriggerObject trigObject, Mobile from, Mobile to, bool isCriminal)
			{
				if (from != null && to != null)
				{
					to.AggressiveAction(from, isCriminal);
				}
			}