Пример #1
0
        public virtual void DoEffects(BaseCreature creature, Mobile combatant)
        {
            if (creature.Map == null || creature.Map == Map.Internal)
            {
                return;
            }

            IPooledEnumerable eable    = creature.GetMobilesInRange(EffectRange);
            List <Mobile>     toAffect = new List <Mobile>();

            foreach (Mobile m in eable)
            {
                if (m != creature && m.Alive && !m.IsDeadBondedPet &&
                    m.CanBeHarmful(creature, false) &&
                    SpellHelper.ValidIndirectTarget(creature, m) &&
                    creature.InLOS(m))
                {
                    toAffect.Add(m);
                }
            }
            eable.Free();

            foreach (var m in toAffect)
            {
                DoEffect(creature, m);
            }

            if (toAffect.Count > 0)
            {
                OnAfterEffects(creature, combatant);
            }

            ColUtility.Free(toAffect);
        }
Пример #2
0
        public virtual void DoEffects(BaseCreature creature, Mobile combatant)
        {
            if (creature.Map == null || creature.Map == Map.Internal)
            {
                return;
            }

            IPooledEnumerable eable    = creature.GetMobilesInRange(EffectRange);
            List <Mobile>     toAffect = new List <Mobile>();

            foreach (Mobile m in eable)
            {
                if (ValidTarget(creature, m))
                {
                    toAffect.Add(m);
                }
            }
            eable.Free();

            foreach (var m in toAffect)
            {
                DoEffect(creature, m);
            }

            if (toAffect.Count > 0)
            {
                OnAfterEffects(creature, combatant);
            }

            ColUtility.Free(toAffect);
        }
        //END MASS PEACE

        //BEGIN MASS PROVOKE

        public static void DoMassProvoke(BaseCreature mobile, Mobile player)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in mobile.GetMobilesInRange(15))
            {
                if (m == mobile || !m.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature)
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }

            foreach (Mobile m in list)
            {
                m.DoHarmful(m);
                player.Combatant = null;
                m.Combatant      = player;
                m.PlaySound(0x403);
                m.Emote("*you see {0} looks furious*", m.Name);
            }
        }
Пример #4
0
        public override void DoEffects(BaseCreature creature, Mobile defender, ref int damage)
        {
            if (creature.Map == null)
            {
                return;
            }

            List <Mobile>     list  = new List <Mobile>();
            IPooledEnumerable eable = creature.GetMobilesInRange(8);

            foreach (Mobile m in eable)
            {
                if (AreaEffect.ValidTarget(creature, m))
                {
                    list.Add(m);
                }
            }

            eable.Free();

            foreach (Mobile m in list)
            {
                creature.DoHarmful(m, false);

                m.FixedParticles(0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist);
                m.PlaySound(0x231);

                m.SendMessage("You feel the mana drain out of you!");

                int toDrain = Utility.RandomMinMax(40, 60);

                creature.Mana += toDrain;
                m.Mana        -= toDrain;
            }
        }
        //END WATER AREA ATTACK

        //BEGIN AIR AREA ATTACK

        public static void DoAirAreaAttack(BaseCreature mobile, Mobile player)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in mobile.GetMobilesInRange(10))
            {
                if (m == mobile || !m.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team))
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }

            foreach (Mobile m in list)
            {
                m.DoHarmful(m);

                m.FixedParticles(0x3728, 50, 50, 5052, EffectLayer.Waist);
                m.PlaySound(655);

                m.SendMessage("Your lose your breath as the air hits you!");

                int toStrike = Utility.RandomMinMax(25, 35);

                m.Damage(toStrike, mobile);
            }
        }
        //END BOMBER

        //BEGIN MASS PEACE


        public static void DoMassPeace(BaseCreature mobile, Mobile player)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in mobile.GetMobilesInRange(15))
            {
                if (m == mobile || !m.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team))
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }

            foreach (Mobile m in list)
            {
                m.DoHarmful(m);
                m.Combatant = null;
                m.PlaySound(0x418);
                m.Emote("*you see {0} looks peacful*", m.Name);
            }
        }
        //END STAM DRAIN ATTACK

        //BEGIN MANA DRAIN ATTACK

        public static void DoManaDrainAttack(BaseCreature mobile)
        {
            foreach (Mobile m in mobile.GetMobilesInRange(3))
            {
                if (m != null && m.Mana >= 50 && m.AccessLevel == AccessLevel.Player)
                {
                    mobile.Mana += 5;
                }
            }
        }
        //END AIR AREA ATTACK

        //BEGIN HITS DRAIN ATTACK

        public static void DoHitsDrainAttack(BaseCreature mobile)
        {
            foreach (Mobile m in mobile.GetMobilesInRange(3))
            {
                if (m != null && m.Hits >= 50 && m.AccessLevel == AccessLevel.Player)
                {
                    mobile.Hits += 2;
                }
            }
        }
Пример #9
0
        public static IEnumerable <Mobile> FindValidTargets(BaseCreature creature, int range)
        {
            IPooledEnumerable eable = creature.GetMobilesInRange(range);

            foreach (Mobile m in eable.OfType <Mobile>())
            {
                if (ValidTarget(creature, m))
                {
                    yield return(m);
                }
            }

            eable.Free();
        }
Пример #10
0
        public override void DoEffects(BaseCreature creature, Mobile defender, ref int damage)
        {
            IPooledEnumerable eable = creature.GetMobilesInRange(3);
            List <Mobile>     list  = new List <Mobile>();

            list.Add(defender);

            foreach (Mobile m in eable)
            {
                if (AreaEffect.ValidTarget(creature, m))
                {
                    list.Add(m);
                }
            }

            eable.Free();
            Poison p = creature.GetHitPoison();

            if (p == null)
            {
                return;
            }

            foreach (var m in list)
            {
                defender.PlaySound(0xDD);
                defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

                m.SendLocalizedMessage(1008097, false, creature.Name); //  : poisoned you!

                m.ApplyPoison(creature, p);
            }

            if (creature.Controlled && list.Count > 0)
            {
                var profile = PetTrainingHelper.GetAbilityProfile(creature);

                if ((profile != null && profile.HasAbility(MagicalAbility.Poisoning)) || 0.2 > Utility.RandomDouble())
                {
                    creature.CheckSkill(SkillName.Poisoning, 0, creature.Skills[SkillName.Poisoning].Cap);
                }
            }

            ColUtility.Free(list);
        }
        public static void DoHumanReveal(BaseCreature mobile)
        {
            foreach (Mobile m in mobile.GetMobilesInRange(10))
            {
                if (m != null && m.Hidden && m.AccessLevel == AccessLevel.Player)
                {
                    m.Hidden = false;
                }
            }

            if (s_HumanTalked == false)
            {
                s_HumanTalked = true;
                SayHumanRandom(humansay, mobile);
                HumanSpamTimer t = new HumanSpamTimer();
                t.Start();
            }
        }
        public static void DoRobotReveal(BaseCreature mobile)
        {
            foreach (Mobile m in mobile.GetMobilesInRange(10))
            {
                if (m != null && m.Hidden && m.AccessLevel == AccessLevel.Player)
                {
                    m.Hidden = false;
                }
            }

            if (s_RoboTalked == false)
            {
                s_RoboTalked = true;
                SayRobotRandom(robotsay, mobile);
                RobotSpamTimer t = new RobotSpamTimer();
                t.Start();
            }
        }
        //END HUMAN REVEALER

        //BEGIN AREA FIRE ATTACK

        public static void DoFireAreaAttack(BaseCreature mobile, Mobile player)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in mobile.GetMobilesInRange(10))
            {
                if (m == mobile || !m.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team))
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }

            foreach (Mobile m in list)
            {
                /*if ( CheckResisted( m ) )
                 * {
                 * m.DoHarmful( m );
                 * int Strike = Utility.RandomMinMax( 5, 15 );
                 * m.Damage( Strike, mobile );
                 * m.SendMessage( "Your feel the heat of fire!" );
                 * return;
                 * }*/
                m.DoHarmful(m);

                m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.Waist);
                m.PlaySound(0x208);

                m.SendMessage("Your skin blisters as the fire burns you!");

                //int toStrike = Utility.RandomMinMax( 25, 35 );

                m.Damage(((Utility.Random(25, 35)) - (m.FireResistance / 2)));
                //m.Damage( toStrike, mobile );
            }
        }
        //END FIRE AREA ATTACK

        //BEGIN WATER  ATTACK

        public static void DoWaterAreaAttack(BaseCreature mobile, Mobile player)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in mobile.GetMobilesInRange(10))
            {
                if (m == mobile || !m.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team))
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }

            foreach (Mobile m in list)
            {
                m.DoHarmful(m);

                m.FixedParticles(0x1fb7, 50, 50, 5052, EffectLayer.Waist);
                m.PlaySound(279);
                m.PlaySound(280);

                m.SendMessage("Your skin numbs as the cold freezes you!");

                //int toStrike = Utility.RandomMinMax( 25, 35 );

                m.Damage(((Utility.Random(25, 35)) - (m.ColdResistance / 2)));
                //m.Damage( toStrike, mobile );
            }
        }