示例#1
0
        // Every member in the target's party is effected by whatever you coded in SpellEffect.
        public void DoPartyEffect(BlueSpell spell, Mobile target)
        {
            Party p = Party.Get(target);

            if (p == null)
            {
                return;
            }

            for (int i = 0; i < p.Members.Count; ++i)
            {
                PartyMemberInfo pmi = (PartyMemberInfo)p.Members[i];

                if (pmi == null)
                {
                    continue;
                }

                Mobile member = pmi.Mobile;

                if (member == null)
                {
                    continue;
                }

                if (target.Map == member.Map && target.CanSee(member))
                {
                    spell.SpellEffect(member);
                }
            }

            FinishSequence();
        }
示例#2
0
        public static void BeginGuardOff(Mobile m, Mobile caster)
        {
            if (m_Table.ContainsKey(m.Serial))
            {
                Timer timer = m_Table[m.Serial];
                timer.Stop();
                m_Table.Remove(m.Serial);
            }

            List <ResistanceMod> mods = new List <ResistanceMod>();

            mods.Add(new ResistanceMod(ResistanceType.Physical, -(m.PhysicalResistance / 2)));
            mods.Add(new ResistanceMod(ResistanceType.Fire, -(m.FireResistance / 2)));
            mods.Add(new ResistanceMod(ResistanceType.Cold, -(m.ColdResistance / 2)));
            mods.Add(new ResistanceMod(ResistanceType.Poison, -(m.PoisonResistance / 2)));
            mods.Add(new ResistanceMod(ResistanceType.Energy, -(m.EnergyResistance / 2)));

            Double duration = (BlueSpell.ScaleBySkill(caster, SkillName.Forensics) * 3.0);

            InternalTimer timertostart = new InternalTimer(m, mods, duration);

            timertostart.Start();
            m_Table.Add(m.Serial, timertostart);

            for (int i = 0; i < mods.Count; ++i)
            {
                m.AddResistanceMod(mods[i]);
            }

            m.SendMessage("Your guard has been lowered");
        }
        // The main method used
        public static bool UseBluePower(Mobile from, Type t)
        {
            if (t == null)
            {
                return(false);
            }
            else if (Array.IndexOf(m_Spells, t) == -1)
            {
                return(false);
            }
            else if (t.IsSubclassOf(typeof(BlueMove)))
            {
                BlueMove bluemove = NewMove(t, from);

                if (bluemove != null)
                {
                    BlueMove.SetCurrentMove(from, bluemove);
                    from.SendMessage("You prepare to use a monster's special attack");
                    return(true);
                }
            }
            else if (t.IsSubclassOf(typeof(BlueSpell)))
            {
                BlueSpell bluespell = BlueSpellInfo.NewSpell(t, from);

                if (bluespell != null)
                {
                    bluespell.Cast();
                    return(true);
                }
            }

            return(false);
        }
示例#4
0
        public override bool OnMoveOver(Mobile m)
        {
            Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
            Ability.Aura(Location, Map, m_Spell.Caster, BlueSpell.GetDamage(m_Spell.Caster, m, m_Spell.DamageSkill, 1.5), BlueSpell.GetDamage(m_Spell.Caster, m, m_Spell.DamageSkill, 1.5), ResistanceType.Fire, 0, null, "", false, false);
            //SpellHelper.Damage( m_Spell, m, BlueSpell.GetDamage( m_Spell.Caster, m, m_Spell.DamageSkill, 1.5 ), 0, 0, 0, 0, 100 );
            m_JustRemove = true;

            return(true);
        }
示例#5
0
        private void Check()
        {
            if (Deleted)
            {
                return;
            }
            if (m_JustRemove)
            {
                Delete();
            }
            else if (!(DateTime.Now >= m_RemoveAt))
            {
                Timer.DelayCall(TimeSpan.FromSeconds(0.05), new TimerCallback(Check));
            }
            else
            {
                Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                //Ability.Aura( Location, Map, m_From, m_Damage, m_Damage, ResistanceType.Fire, 0, null, "", false, false );
                Ability.Aura(Location, Map, m_Spell.Caster, BlueSpell.GetDamage(m_Spell.Caster, null, m_Spell.DamageSkill, 1.5), BlueSpell.GetDamage(m_Spell.Caster, null, m_Spell.DamageSkill, 1.5), ResistanceType.Fire, 0, null, "", false, false);

                /*
                 * List<Mobile> mobiles = new List<Mobile>();
                 *
                 * foreach( Mobile m in GetMobilesInRange( 0 ) )
                 * {
                 *      if ( m != null && BlueSpell.CanTarget( m_Spell.Caster, m, true ) )
                 *              mobiles.Add( m );
                 * }
                 *
                 * for ( int i = 0; i < mobiles.Count; i++ )
                 * {
                 *      if ( mobiles[i] != null )
                 *              SpellHelper.Damage( m_Spell, mobiles[i], BlueSpell.GetDamage( m_Spell.Caster, mobiles[i], m_Spell.DamageSkill, 2.0 ), 0, 0, 0, 0, 100 );
                 * }
                 */

                Delete();
            }
        }
示例#6
0
		/*
		X>-3-2-1 0 1 2 3
		-3|U|U|_|_|_|_|_|
		-2|U|U|U|_|_|_|_|
		-1|_|U|U|U|_|_|_|
		 0|_|_|U|X|X|_|_|
		 1|_|_|_|X|D|D|_|
		 2|_|_|_|_|D|D|D|
		 3|_|_|_|_|_|D|D|
		*/
		// Produces three lines parrel with each other.
		public void DoWideLineEffect( BlueSpell spell )
		{
			Direction direction = Caster.Direction;
			Point3D point = new Point3D( Caster.X, Caster.Y, Caster.Z );

			switch( direction )
			{
				case (Direction)0x0: case (Direction)0x80: // North
				{
					DoLineEffect( spell, direction, new Point3D( point.X - 1, point.Y + 1, point.Z ) );
					DoLineEffect( spell, direction, new Point3D( point.X + 1, point.Y + 1, point.Z ) );
					break;
				}
				case (Direction)0x1: case (Direction)0x81: // Right
				{
					DoLineEffect( spell, direction, new Point3D( point.X - 1, point.Y, point.Z ) );
					DoLineEffect( spell, direction, new Point3D( point.X, point.Y + 1, point.Z ) );
					break;
				}
				case (Direction)0x2: case (Direction)0x82: // East
				{
					DoLineEffect( spell, direction, new Point3D( point.X - 1, point.Y + 1, point.Z ) );
					DoLineEffect( spell, direction, new Point3D( point.X - 1, point.Y - 1, point.Z ) );
					break;
				}
				case (Direction)0x3: case (Direction)0x83: // Down
				{
					DoLineEffect( spell, direction, new Point3D( point.X, point.Y - 1, point.Z ) );
					DoLineEffect( spell, direction, new Point3D( point.X - 1, point.Y, point.Z ) );
					break;
				}
				case (Direction)0x4: case (Direction)0x84: // South
				{
					DoLineEffect( spell, direction, new Point3D( point.X - 1, point.Y - 1, point.Z ) );
					DoLineEffect( spell, direction, new Point3D( point.X + 1, point.Y - 1, point.Z ) );
					break;
				}
				case (Direction)0x5: case (Direction)0x85:  // Left
				{
					DoLineEffect( spell, direction, new Point3D( point.X, point.Y - 1, point.Z ) );
					DoLineEffect( spell, direction, new Point3D( point.X + 1, point.Y, point.Z ) );
					break;
				}
				case (Direction)0x6: case (Direction)0x86: // West
				{
					DoLineEffect( spell, direction, new Point3D( point.X + 1, point.Y - 1, point.Z ) );
					DoLineEffect( spell, direction, new Point3D( point.X + 1, point.Y + 1, point.Z ) );
					break;
				}
				case (Direction)0x7: case (Direction)0x87: // Up
				{
					DoLineEffect( spell, direction, new Point3D( point.X + 1, point.Y, point.Z ) );
					DoLineEffect( spell, direction, new Point3D( point.X, point.Y + 1, point.Z ) );
					break;
				}
			}

			DoLineEffect( spell, direction, point );
		}
示例#7
0
		// An overload.
		public void DoAreaEffect( BlueSpell spell, Point3D target )
		{
			DoAreaEffect( spell, target, false );
		}
		public static bool CheckKnown( Mobile m, BlueSpell spell, bool learn )
		{
			return CheckKnown( m, spell.GetType(), learn );
		}
示例#9
0
 // An overload.
 public void DoAreaEffect(BlueSpell spell, Point3D target)
 {
     DoAreaEffect(spell, target, false);
 }
示例#10
0
		// Spffy Cone thing
		public void DoConeEffect( BlueSpell spell )
		{
			int x = Caster.X, y = Caster.Y, xoffset = 0, yoffset = 0;
			List<Mobile> mobiles = new List<Mobile>();
			List<Point3D> points = new List<Point3D>();

			foreach ( Mobile m in Caster.GetMobilesInRange( Range ) )
			{
				if ( m != null )
					if ( CanTarget( Caster, m, spell.IsHarmful ) )
						mobiles.Add( m );
			}

			switch( Caster.Direction )
			{
				case (Direction)0x0: case (Direction)0x80: yoffset--; break; //North
				case (Direction)0x1: case (Direction)0x81: { xoffset++; yoffset--; break; } //Right
				case (Direction)0x2: case (Direction)0x82: xoffset++; break; //East
				case (Direction)0x3: case (Direction)0x83: { xoffset++; yoffset++; break; } //Down
				case (Direction)0x4: case (Direction)0x84: yoffset++; break; //South
				case (Direction)0x5: case (Direction)0x85: { xoffset--; yoffset++; break; } //Left
				case (Direction)0x6: case (Direction)0x86: xoffset--; break; //West
				case (Direction)0x7: case (Direction)0x87: { xoffset--; yoffset--; break; } //Up
				default: { break; }
			}

			for ( int i = 0; i < Range; i++ ) // goes to the sides
			{
				for ( int j = i + 1; j <= Range; j++ ) // j goes forward
				{
					if ( j >= i + 1 )
					{
						Point3D point = new Point3D( 0, 0, 0 );
						point.X = ( x + j * xoffset - i * yoffset );
						point.Y = ( y + j * yoffset + i * xoffset );
						point.Z = Caster.Map.GetAverageZ( point.X, point.Y );
						points.Add( point );

						if ( i > 0 )
						{
							point.X = ( x + j * xoffset + i * yoffset );
							point.Y = ( y + j * yoffset - i * xoffset );
							point.Z = Caster.Map.GetAverageZ( point.X, point.Y );
							points.Add( point );
						}
					}
				}
			}

			for ( int i = 0; i < points.Count; i++ )
			{
				if ( mobiles.Count > 0 )
				{
					for ( int j = mobiles.Count - 1; j > -1; j-- )
					{
						if ( mobiles[j].X == points[i].X && mobiles[j].Y == points[i].Y )
						{
							spell.SpellEffect( mobiles[j] );

							if ( mobiles[j] != null )
								mobiles.Remove( mobiles[j] );
						}
					}
				}

				spell.VisualEffects( points[i] );
			}

			mobiles.Clear();
			points.Clear();
		}
示例#11
0
        // Spffy Cone thing
        public void DoConeEffect(BlueSpell spell)
        {
            int            x = Caster.X, y = Caster.Y, xoffset = 0, yoffset = 0;
            List <Mobile>  mobiles = new List <Mobile>();
            List <Point3D> points  = new List <Point3D>();

            foreach (Mobile m in Caster.GetMobilesInRange(Range))
            {
                if (m != null)
                {
                    if (CanTarget(Caster, m, spell.IsHarmful))
                    {
                        mobiles.Add(m);
                    }
                }
            }

            switch (Caster.Direction)
            {
            case (Direction)0x0:
            case (Direction)0x80: yoffset--; break;                                          //North

            case (Direction)0x1:
            case (Direction)0x81: { xoffset++; yoffset--; break; }                                          //Right

            case (Direction)0x2:
            case (Direction)0x82: xoffset++; break;                                          //East

            case (Direction)0x3:
            case (Direction)0x83: { xoffset++; yoffset++; break; }                                          //Down

            case (Direction)0x4:
            case (Direction)0x84: yoffset++; break;                                          //South

            case (Direction)0x5:
            case (Direction)0x85: { xoffset--; yoffset++; break; }                                          //Left

            case (Direction)0x6:
            case (Direction)0x86: xoffset--; break;                                          //West

            case (Direction)0x7:
            case (Direction)0x87: { xoffset--; yoffset--; break; }                                          //Up

            default: { break; }
            }

            for (int i = 0; i < Range; i++)               // goes to the sides
            {
                for (int j = i + 1; j <= Range; j++)      // j goes forward
                {
                    if (j >= i + 1)
                    {
                        Point3D point = new Point3D(0, 0, 0);
                        point.X = (x + j * xoffset - i * yoffset);
                        point.Y = (y + j * yoffset + i * xoffset);
                        point.Z = Caster.Map.GetAverageZ(point.X, point.Y);
                        points.Add(point);

                        if (i > 0)
                        {
                            point.X = (x + j * xoffset + i * yoffset);
                            point.Y = (y + j * yoffset - i * xoffset);
                            point.Z = Caster.Map.GetAverageZ(point.X, point.Y);
                            points.Add(point);
                        }
                    }
                }
            }

            for (int i = 0; i < points.Count; i++)
            {
                if (mobiles.Count > 0)
                {
                    for (int j = mobiles.Count - 1; j > -1; j--)
                    {
                        if (mobiles[j].X == points[i].X && mobiles[j].Y == points[i].Y)
                        {
                            spell.SpellEffect(mobiles[j]);

                            if (mobiles[j] != null)
                            {
                                mobiles.Remove(mobiles[j]);
                            }
                        }
                    }
                }

                spell.VisualEffects(points[i]);
            }

            mobiles.Clear();
            points.Clear();
        }
示例#12
0
 // Just an overload to DoAreaEffect.
 public void DoBurstEffect(BlueSpell spell, Point3D target)
 {
     DoAreaEffect(spell, target, true);
 }
示例#13
0
        // Creates a line, and gets everyone standing in the line.
        public void DoLineEffect(BlueSpell spell, Direction direction, Point3D point)
        {
            List <Mobile> targets          = new List <Mobile>();
            List <Mobile> potentialtargets = new List <Mobile>();

            foreach (Mobile mob in Caster.GetMobilesInRange(spell.Range))
            {
                if (mob != null)
                {
                    if (CanTarget(Caster, mob, spell.IsHarmful))
                    {
                        potentialtargets.Add(mob);
                    }
                }
            }

            for (int i = 1; i < spell.Range + 1; i++)
            {
                switch (direction)
                {
                case (Direction)0x0:
                case (Direction)0x80: point.Y--; break;                                              //North

                case (Direction)0x1:
                case (Direction)0x81: { point.X++; point.Y--; break; }                                              //Right

                case (Direction)0x2:
                case (Direction)0x82: point.X++; break;                                              //East

                case (Direction)0x3:
                case (Direction)0x83: { point.X++; point.Y++; break; }                                              //Down

                case (Direction)0x4:
                case (Direction)0x84: point.Y++; break;                                              //South

                case (Direction)0x5:
                case (Direction)0x85: { point.X--; point.Y++; break; }                                              //Left

                case (Direction)0x6:
                case (Direction)0x86: point.X--; break;                                              //West

                case (Direction)0x7:
                case (Direction)0x87: { point.X--; point.Y--; break; }                                              //Up

                default: { break; }
                }

                if (!Caster.CanSee(point))
                {
                    break;
                }

                spell.VisualEffects(point);

                // Running a 0 range check on each square in the line may be better than running a massive area foreach and checking every's X/Y location in it I think.
                foreach (Mobile mob in potentialtargets)
                {
                    if (mob != null && mob.X == point.X && mob.Y == point.Y)                       // Ignore Z axis per RunUO's spells.
                    {
                        targets.Add(mob);
                    }
                }
            }

            for (int i = targets.Count - 1; i > 0; i--)
            {
                spell.SpellEffect(targets[i]);
            }

            targets.Clear();
            FinishSequence();
        }
示例#14
0
 // Overload: Single line from caster effect.
 public void DoLineEffect(BlueSpell spell)
 {
     DoLineEffect(spell, Caster.Direction, new Point3D(Caster.X, Caster.Y, Caster.Z));
 }
示例#15
0
        /*
         * X>-3-2-1 0 1 2 3
         * -3|U|U|_|_|_|_|_|
         * -2|U|U|U|_|_|_|_|
         * -1|_|U|U|U|_|_|_|
         * 0|_|_|U|X|X|_|_|
         * 1|_|_|_|X|D|D|_|
         * 2|_|_|_|_|D|D|D|
         * 3|_|_|_|_|_|D|D|
         */
        // Produces three lines parrel with each other.
        public void DoWideLineEffect(BlueSpell spell)
        {
            Direction direction = Caster.Direction;
            Point3D   point     = new Point3D(Caster.X, Caster.Y, Caster.Z);

            switch (direction)
            {
            case (Direction)0x0:
            case (Direction)0x80:                                          // North
            {
                DoLineEffect(spell, direction, new Point3D(point.X - 1, point.Y + 1, point.Z));
                DoLineEffect(spell, direction, new Point3D(point.X + 1, point.Y + 1, point.Z));
                break;
            }

            case (Direction)0x1:
            case (Direction)0x81:                                          // Right
            {
                DoLineEffect(spell, direction, new Point3D(point.X - 1, point.Y, point.Z));
                DoLineEffect(spell, direction, new Point3D(point.X, point.Y + 1, point.Z));
                break;
            }

            case (Direction)0x2:
            case (Direction)0x82:                                          // East
            {
                DoLineEffect(spell, direction, new Point3D(point.X - 1, point.Y + 1, point.Z));
                DoLineEffect(spell, direction, new Point3D(point.X - 1, point.Y - 1, point.Z));
                break;
            }

            case (Direction)0x3:
            case (Direction)0x83:                                          // Down
            {
                DoLineEffect(spell, direction, new Point3D(point.X, point.Y - 1, point.Z));
                DoLineEffect(spell, direction, new Point3D(point.X - 1, point.Y, point.Z));
                break;
            }

            case (Direction)0x4:
            case (Direction)0x84:                                          // South
            {
                DoLineEffect(spell, direction, new Point3D(point.X - 1, point.Y - 1, point.Z));
                DoLineEffect(spell, direction, new Point3D(point.X + 1, point.Y - 1, point.Z));
                break;
            }

            case (Direction)0x5:
            case (Direction)0x85:                                           // Left
            {
                DoLineEffect(spell, direction, new Point3D(point.X, point.Y - 1, point.Z));
                DoLineEffect(spell, direction, new Point3D(point.X + 1, point.Y, point.Z));
                break;
            }

            case (Direction)0x6:
            case (Direction)0x86:                                          // West
            {
                DoLineEffect(spell, direction, new Point3D(point.X + 1, point.Y - 1, point.Z));
                DoLineEffect(spell, direction, new Point3D(point.X + 1, point.Y + 1, point.Z));
                break;
            }

            case (Direction)0x7:
            case (Direction)0x87:                                          // Up
            {
                DoLineEffect(spell, direction, new Point3D(point.X + 1, point.Y, point.Z));
                DoLineEffect(spell, direction, new Point3D(point.X, point.Y + 1, point.Z));
                break;
            }
            }

            DoLineEffect(spell, direction, point);
        }
示例#16
0
		// Overload: Single line from caster effect.
		public void DoLineEffect( BlueSpell spell )
		{
			DoLineEffect( spell, Caster.Direction, new Point3D( Caster.X, Caster.Y, Caster.Z ) );
		}
示例#17
0
        // It gets everyone near the center, if burst is true (which the DoBurstEffect ovverload handles) it does the math to make it a circle.
        public void DoAreaEffect(BlueSpell spell, Point3D target, bool burst)
        {
            if (Caster.Map == null || spell.Range == 0)
            {
                return;
            }

            List <Mobile> targets = new List <Mobile>();

            foreach (Mobile mob in Caster.Map.GetMobilesInRange(target, spell.Range))
            {
                if (mob == null)
                {
                    continue;
                }

                if (CanTarget(Caster, mob, spell.IsHarmful))
                {
                    /*if ( !Caster.Map.LineOfSight( target, mob.Location ) )
                     * {
                     *      Caster.Say("LOS fail. X:" + mob.X.ToString() + " Y:" + mob.Y.ToString() );
                     *      continue;
                     * }
                     * else /*/if (burst)
                    {
                        if (GetDist(target, mob.Location) > ((double)Range + 0.1))
                        {
                            continue;
                        }
                    }

                    targets.Add(mob);
                }
            }

            if (burst)
            {
                Point3D point = new Point3D();

                for (int i = -Range; i < Range + 1; i++)
                {
                    for (int j = -Range; j < Range + 1; j++)
                    {
                        point.X = target.X + i;
                        point.Y = target.Y + j;

                        if (GetDist(target, point) < ((double)Range + 0.1))
                        {
                            point.Z = Caster.Map.GetAverageZ(point.X, point.Y);
                            spell.VisualEffects(point);
                        }
                    }
                }
            }

            for (int i = targets.Count - 1; i > 0; i--)
            {
                spell.SpellEffect(targets[i]);
            }

            targets.Clear();
            FinishSequence();
        }
示例#18
0
		// Creates a line, and gets everyone standing in the line.
		public void DoLineEffect( BlueSpell spell, Direction direction, Point3D point )
		{
			List<Mobile> targets = new List<Mobile>();
			List<Mobile> potentialtargets = new List<Mobile>();

			foreach ( Mobile mob in Caster.GetMobilesInRange( spell.Range ) )
			{
				if ( mob != null )
					if ( CanTarget( Caster, mob, spell.IsHarmful ) )
						potentialtargets.Add( mob );
			}

			for ( int i = 1; i < spell.Range+1; i++ )
			{
				switch( direction )
				{
					case (Direction)0x0: case (Direction)0x80: point.Y--; break; //North
					case (Direction)0x1: case (Direction)0x81: { point.X++; point.Y--; break; } //Right
					case (Direction)0x2: case (Direction)0x82: point.X++; break; //East
					case (Direction)0x3: case (Direction)0x83: { point.X++; point.Y++; break; } //Down
					case (Direction)0x4: case (Direction)0x84: point.Y++; break; //South
					case (Direction)0x5: case (Direction)0x85: { point.X--; point.Y++; break; } //Left
					case (Direction)0x6: case (Direction)0x86: point.X--; break; //West
					case (Direction)0x7: case (Direction)0x87: { point.X--; point.Y--; break; } //Up
					default: { break; }
				}

				if ( !Caster.CanSee( point ) )
					break;

				spell.VisualEffects( point );

				// Running a 0 range check on each square in the line may be better than running a massive area foreach and checking every's X/Y location in it I think.
				foreach ( Mobile mob in potentialtargets )
				{
					if ( mob != null && mob.X == point.X && mob.Y == point.Y ) // Ignore Z axis per RunUO's spells.
							targets.Add( mob );
				}
			}

			for ( int i = targets.Count - 1; i > 0; i-- )
				spell.SpellEffect( targets[i] );

			targets.Clear();
			FinishSequence();
		}
示例#19
0
		// Every member in the target's party is effected by whatever you coded in SpellEffect.
		public void DoPartyEffect( BlueSpell spell, Mobile target )
		{
			Party p = Party.Get( target );

			if ( p == null )
				return;

			for ( int i = 0; i < p.Members.Count; ++i )
			{
				PartyMemberInfo pmi = (PartyMemberInfo)p.Members[i];

				if ( pmi == null )
					continue;

				Mobile member = pmi.Mobile;

				if ( member == null )
					continue;

				if ( target.Map == member.Map && target.CanSee( member ) )
				{
					spell.SpellEffect( member );
				}
			}

			FinishSequence();
		}
示例#20
0
		// Just an overload to DoAreaEffect.
		public void DoBurstEffect( BlueSpell spell, Point3D target )
		{
			DoAreaEffect( spell, target, true );
		}
示例#21
0
			public BlueSpellTarget( BlueSpell owner, TargetFlags flags, bool allowobjects ) : base( 12, allowobjects, flags )
			{
				m_Owner = owner;
				m_AllowObjects = allowobjects;
			}
示例#22
0
		// It gets everyone near the center, if burst is true (which the DoBurstEffect ovverload handles) it does the math to make it a circle.
		public void DoAreaEffect( BlueSpell spell, Point3D target, bool burst )
		{
			if ( Caster.Map == null || spell.Range == 0 )
				return;

			List<Mobile> targets = new List<Mobile>();

			foreach ( Mobile mob in Caster.Map.GetMobilesInRange( target, spell.Range ) )
			{
				if ( mob == null )
					continue;

				if ( CanTarget( Caster, mob, spell.IsHarmful ) )
				{
					/*if ( !Caster.Map.LineOfSight( target, mob.Location ) )
					{
						Caster.Say("LOS fail. X:" + mob.X.ToString() + " Y:" + mob.Y.ToString() );
						continue;
					}
					else /*/if ( burst )
					{
						if ( GetDist( target, mob.Location ) > ((double)Range + 0.1) )
							continue;
					}

					targets.Add( mob );
				}
			}

			if ( burst )
			{
				Point3D point = new Point3D();

				for ( int i = -Range; i < Range + 1; i++ )
					for ( int j = -Range; j < Range + 1; j++ )
					{
						point.X = target.X + i;
						point.Y = target.Y + j;

						if ( GetDist( target, point ) < ((double)Range + 0.1) )
						{
								point.Z = Caster.Map.GetAverageZ( point.X, point.Y );
								spell.VisualEffects( point );
						}	
					}
			}

			for ( int i = targets.Count - 1; i > 0; i-- )
				spell.SpellEffect( targets[i] );

			targets.Clear();
			FinishSequence();
		}
示例#23
0
        public bool AddMods()
        {
            if (Owner == null)
            {
                return(false);
            }

            BonusNumber++;

            if (BonusNumber > 5)
            {
                return(false);
            }

            // @100.0 Forensics bonus's value is 10.
            double          bonus      = (BlueSpell.ScaleBySkill(Owner, SkillName.Forensics) / 2.0);
            StatMod         stat       = null;
            DefaultSkillMod skill      = null;
            ResistanceMod   resist     = null;
            int             intdiff    = 0;
            double          doublediff = 0.0;

            // Str (+10 @ GM)
            intdiff = (int)(m_StrCap - (Owner.RawStr + bonus));

            if (intdiff > 0)
            {
                stat = new StatMod(StatType.Str, ("DragonForceStr" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours(24));
                Owner.AddStatMod(stat);
                StatMods.Add(stat);
            }

            // Dex (+10 @ GM)
            intdiff = (int)(m_DexCap - (Owner.RawDex + bonus));

            if (intdiff > 0)
            {
                stat = new StatMod(StatType.Dex, ("DragonForceDex" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours(24));
                Owner.AddStatMod(stat);
                StatMods.Add(stat);
            }

            // Tactics (+5.0 @ GM)
            doublediff = m_TacticsCap - (Owner.Skills[SkillName.Tactics].Value + bonus);

            if (doublediff > 0.0)
            {
                skill = new DefaultSkillMod(SkillName.Tactics, true, (bonus / 2));
                Owner.AddSkillMod(skill);
                SkillMods.Add(skill);
            }

            // Wrestling (+5.0 @ GM)
            doublediff = m_WrestlingCap - (Owner.Skills[SkillName.Tactics].Value + bonus);

            if (doublediff > 0.0)
            {
                skill = new DefaultSkillMod(SkillName.Wrestling, true, bonus);
                Owner.AddSkillMod(skill);
                SkillMods.Add(skill);
            }

            // Lose all Magic Resist in preparation of negative resistances.
            if (Owner.Skills[SkillName.MagicResist].Value > 0)
            {
                skill = new DefaultSkillMod(SkillName.MagicResist, true, -Owner.Skills[SkillName.MagicResist].Value);
                Owner.AddSkillMod(skill);
                SkillMods.Add(skill);
            }

            if (!Status.Enabled)
            {
                // Lower Magery (-30 @ GM)
                if (Owner.Skills[SkillName.Magery].Value > 0)
                {
                    skill = new DefaultSkillMod(SkillName.Magery, true, -(bonus * 3));
                    Owner.AddSkillMod(skill);
                    SkillMods.Add(skill);
                }

                // Lower Necromancy (-30 @ GM)
                if (Owner.Skills[SkillName.Necromancy].Value > 0)
                {
                    skill = new DefaultSkillMod(SkillName.Necromancy, true, -(bonus * 3));
                    Owner.AddSkillMod(skill);
                    SkillMods.Add(skill);
                }

                // Lower Chivalry (-30 @ GM)
                if (Owner.Skills[SkillName.Chivalry].Value > 0)
                {
                    skill = new DefaultSkillMod(SkillName.Chivalry, true, -(bonus * 3));
                    Owner.AddSkillMod(skill);
                    SkillMods.Add(skill);
                }

                // Lower Bushido (-30 @ GM)
                if (Owner.Skills[SkillName.Bushido].Value > 0)
                {
                    skill = new DefaultSkillMod(SkillName.Bushido, true, -(bonus * 3));
                    Owner.AddSkillMod(skill);
                    SkillMods.Add(skill);
                }

                // Lower Ninjitsu (-30 @ GM)
                if (Owner.Skills[SkillName.Ninjitsu].Value > 0)
                {
                    skill = new DefaultSkillMod(SkillName.Ninjitsu, true, -(bonus * 3));
                    Owner.AddSkillMod(skill);
                    SkillMods.Add(skill);
                }

                // Lower Spellweaving (-30 @ GM)
                if (Owner.Skills[SkillName.Spellweaving].Value > 0)
                {
                    skill = new DefaultSkillMod(SkillName.Spellweaving, true, -(bonus * 3));
                    Owner.AddSkillMod(skill);
                    SkillMods.Add(skill);
                }

                // Lower Mysticism (-30 @ GM)
                if (Owner.Skills[SkillName.Mysticism].Value > 0)
                {
                    skill = new DefaultSkillMod(SkillName.Mysticism, true, -(bonus * 3));
                    Owner.AddSkillMod(skill);
                    SkillMods.Add(skill);
                }
            }

            // Physical (+5 @ GM)
            intdiff = m_PhysicalResistCap - (int)(Owner.PhysicalResistance + (bonus / 2));

            if (intdiff > 0)
            {
                resist = new ResistanceMod(ResistanceType.Physical, intdiff);
                Owner.AddResistanceMod(resist);
                ResistMods.Add(resist);
            }

            // Fire (+10 @ GM)
            intdiff = m_FireResistCap - (int)(Owner.FireResistance + bonus);

            if (intdiff > 0)
            {
                resist = new ResistanceMod(ResistanceType.Fire, (int)(bonus));
                Owner.AddResistanceMod(resist);
                ResistMods.Add(resist);
            }

            // Cold (-20 @ GM)
            resist = new ResistanceMod(ResistanceType.Cold, (int)(-(bonus * 2)));
            Owner.AddResistanceMod(resist);
            ResistMods.Add(resist);

            // Energy (-10 @ GM)
            resist = new ResistanceMod(ResistanceType.Energy, (int)(-bonus));
            Owner.AddResistanceMod(resist);
            ResistMods.Add(resist);

            return(true);
        }
示例#24
0
			public BlueSpellTarget( BlueSpell owner, TargetFlags flags ) : this( owner, flags, false )
			{
				m_Owner = owner;
			}
示例#25
0
 public BlueSpellTarget(BlueSpell owner, TargetFlags flags) : this(owner, flags, false)
 {
     m_Owner = owner;
 }
示例#26
0
 public BlueSpellTarget(BlueSpell owner, TargetFlags flags, bool allowobjects) : base(12, allowobjects, flags)
 {
     m_Owner        = owner;
     m_AllowObjects = allowobjects;
 }
 public static bool CheckKnown(Mobile m, BlueSpell spell, bool learn)
 {
     return(CheckKnown(m, spell.GetType(), learn));
 }