Ejemplo n.º 1
0
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            base.OnDamage(amount, from, willKill);

            if (!willKill && amount > 10 && Utility.RandomDouble() < .2)
            {
                Effects.PlaySound(Location, Map, 0x208);

                SingleFireField singleFireField = new SingleFireField(this, 0, 1, 20, 3, 5, false, false, true, -1, true);
                singleFireField.Hue = Hue;
                singleFireField.MoveToWorld(Location, Map);
            }
        }
Ejemplo n.º 2
0
        protected override bool OnMove(Direction d)
        {
            if (Utility.RandomDouble() < .25)
            {
                Effects.PlaySound(Location, Map, 0x208);

                SingleFireField singleFireField = new SingleFireField(this, 0, 1, 20, 3, 5, false, false, true, -1, true);
                singleFireField.Hue = Hue;
                singleFireField.MoveToWorld(Location, Map);
            }

            return(base.OnMove(d));
        }
Ejemplo n.º 3
0
        public void FlameMark()
        {
            if (!SpecialAbilities.Exists(this))
            {
                return;
            }

            IPooledEnumerable nearbyMobiles = Map.GetMobilesInRange(Location, FireBarrageRange);

            int mobileCount = 0;

            foreach (Mobile mobile in nearbyMobiles)
            {
                if (mobile == this)
                {
                    continue;
                }
                if (!SpecialAbilities.MonsterCanDamage(this, mobile))
                {
                    continue;
                }
                if (!Map.InLOS(Location, mobile.Location))
                {
                    continue;
                }
                if (mobile.Hidden)
                {
                    continue;
                }

                mobileCount++;
            }

            nearbyMobiles.Free();
            nearbyMobiles = Map.GetMobilesInRange(Location, FireBarrageRange);

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

            foreach (Mobile mobile in nearbyMobiles)
            {
                if (mobile == this)
                {
                    continue;
                }
                if (!SpecialAbilities.MonsterCanDamage(this, mobile))
                {
                    continue;
                }
                if (!Map.InLOS(Location, mobile.Location))
                {
                    continue;
                }
                if (mobile.Hidden)
                {
                    continue;
                }
                if (Combatant != null)
                {
                    if (mobileCount > 1 && mobile == Combatant)
                    {
                        continue;
                    }
                }

                m_NearbyMobiles.Add(mobile);
            }

            nearbyMobiles.Free();

            if (m_NearbyMobiles.Count == 0)
            {
                return;
            }

            Mobile mobileTarget = m_NearbyMobiles[Utility.RandomMinMax(0, m_NearbyMobiles.Count - 1)];

            Point3D targetLocation = mobileTarget.Location;
            Map     targetMap      = mobileTarget.Map;

            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            double directionDelay = .25;
            double initialDelay   = 2;
            double totalDelay     = 1 + directionDelay + initialDelay;

            int maxRadius = 4;
            int radius    = 2 + (int)(Math.Ceiling((double)maxRadius * spawnPercent));

            m_NextFlameMarkAllowed = DateTime.UtcNow + NextFlameMarkDelay + TimeSpan.FromSeconds(totalDelay);
            m_NextAbilityAllowed   = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay);

            AbilityInProgress = true;

            Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate
            {
                if (SpecialAbilities.Exists(this))
                {
                    AbilityInProgress = false;
                }
            });

            SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1");

            Direction = Utility.GetDirection(Location, targetLocation);

            Timer.DelayCall(TimeSpan.FromSeconds(directionDelay), delegate
            {
                if (!SpecialAbilities.Exists(this))
                {
                    return;
                }
                if (DamageIntervalInProgress)
                {
                    return;
                }

                Animate(29, 22, 1, true, false, 0);
                PlaySound(GetAngerSound());

                PublicOverheadMessage(MessageType.Regular, 0, false, "*points a mighty claw*");

                TimedStatic flamemark = new TimedStatic(6571, initialDelay);
                flamemark.Hue         = 2591;
                flamemark.Name        = "flamemark";
                flamemark.MoveToWorld(targetLocation, targetMap);

                Timer.DelayCall(TimeSpan.FromSeconds(initialDelay), delegate
                {
                    if (!SpecialAbilities.Exists(this))
                    {
                        return;
                    }

                    int damage = DamageMin;

                    int minRange = radius * -1;
                    int maxRange = radius;

                    int effectHue = 2602;

                    Effects.PlaySound(targetLocation, targetMap, 0x306);

                    for (int a = minRange; a < maxRange + 1; a++)
                    {
                        for (int b = minRange; b < maxRange + 1; b++)
                        {
                            Point3D newPoint = new Point3D(targetLocation.X + a, targetLocation.Y + b, targetLocation.Z);
                            SpellHelper.AdjustField(ref newPoint, targetMap, 12, false);

                            int distance = Utility.GetDistance(targetLocation, newPoint);

                            double effectChance = 1.0 - ((double)distance * .05);

                            if (Utility.RandomDouble() > effectChance)
                            {
                                continue;
                            }

                            Timer.DelayCall(TimeSpan.FromSeconds(distance * .10), delegate
                            {
                                if (Utility.RandomDouble() <= .1)
                                {
                                    SingleFireField singleFireField = new SingleFireField(this, 0, 2, 30, 3, 5, false, false, true, -1, true);
                                    singleFireField.Hue             = 2603;
                                    singleFireField.MoveToWorld(newPoint, targetMap);
                                }

                                Effects.PlaySound(newPoint, targetMap, Utility.RandomList(0x4F1, 0x5D8, 0x5DA, 0x580));
                                Effects.SendLocationParticles(EffectItem.Create(newPoint, targetMap, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 30, effectHue, 0, 5029, 0);

                                IPooledEnumerable mobilesOnTile = targetMap.GetMobilesInRange(newPoint, 0);

                                Queue m_Queue = new Queue();

                                foreach (Mobile mobile in mobilesOnTile)
                                {
                                    if (mobile == this)
                                    {
                                        continue;
                                    }
                                    if (!SpecialAbilities.MonsterCanDamage(this, mobile))
                                    {
                                        continue;
                                    }

                                    m_Queue.Enqueue(mobile);
                                }

                                mobilesOnTile.Free();

                                while (m_Queue.Count > 0)
                                {
                                    Mobile mobile = (Mobile)m_Queue.Dequeue();

                                    if (mobile is BaseCreature)
                                    {
                                        damage *= 3;
                                    }

                                    new Blood().MoveToWorld(mobile.Location, mobile.Map);
                                    AOS.Damage(mobile, this, damage, 100, 0, 0, 0, 0);
                                }
                            });
                        }
                    }
                });
            });
        }
Ejemplo n.º 4
0
        public void HeartyWingBuffet()
        {
            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            int    wings      = 50 + (int)(Math.Ceiling(150 * spawnPercent));
            int    loops      = (int)(Math.Ceiling((double)wings / 10));
            double totalDelay = loops + 2.5;

            SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1");

            m_NextHeartyWingBuffetAllowed = DateTime.UtcNow + NextHeartyWingBuffetDelay;
            m_NextAbilityAllowed          = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay);

            AbilityInProgress = true;

            Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate
            {
                if (!SpecialAbilities.Exists(this))
                {
                    return;
                }

                AbilityInProgress = false;
            });

            Effects.PlaySound(Location, Map, 0x4d7);

            PublicOverheadMessage(MessageType.Regular, 0, false, "*prepares hearty wing buffet*");

            Point3D location = Location;
            Map     map      = Map;

            PlaySound(GetAngerSound());
            Animate(16, 8, 1, true, false, 0);

            int radius = 10;

            Timer.DelayCall(TimeSpan.FromSeconds(1.0), delegate
            {
                if (!SpecialAbilities.Exists(this))
                {
                    return;
                }

                for (int a = 0; a < loops; a++)
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(a * 1), delegate
                    {
                        if (!SpecialAbilities.Exists(this))
                        {
                            return;
                        }

                        Animate(16, 8, 1, true, false, 0);

                        PlaySound(GetAngerSound());
                        Effects.PlaySound(location, map, 0x5CF);
                    });
                }

                for (int a = 0; a < wings; a++)
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(a * .1), delegate
                    {
                        if (!SpecialAbilities.Exists(this))
                        {
                            return;
                        }

                        Point3D wingLocation = new Point3D(location.X + Utility.RandomMinMax(radius * -1, radius), location.Y + Utility.RandomMinMax(radius * -1, radius), location.Z);

                        IEntity startLocation = new Entity(Serial.Zero, new Point3D(wingLocation.X - 1, wingLocation.Y - 1, wingLocation.Z + 100), map);
                        IEntity endLocation   = new Entity(Serial.Zero, new Point3D(wingLocation.X, wingLocation.Y, wingLocation.Z + 5), map);

                        int particleSpeed = 8 + (int)(Math.Round(8 * (double)spawnPercent));

                        int itemId = Utility.RandomList(5641, 2489, 5639);

                        Effects.SendMovingParticles(startLocation, endLocation, itemId, particleSpeed, 0, false, false, 0, 0, 9501, 0, 0, 0x100);

                        double impactDelay = .75 - (.375 * spawnPercent);

                        Timer.DelayCall(TimeSpan.FromSeconds(impactDelay), delegate
                        {
                            if (!SpecialAbilities.Exists(this))
                            {
                                return;
                            }

                            Effects.PlaySound(endLocation, map, Utility.RandomList(0x357, 0x359));
                            Effects.SendLocationParticles(endLocation, 0x3709, 10, 20, 0, 0, 5029, 0);

                            Item item = null;

                            switch (itemId)
                            {
                                //case 5641: item = new LambLeg(); item.Name = "chicken drumstick"; break;
                                //case 2489: item = new CookedBird();  break;
                                //case 5639: item = new ChickenLeg(); break;
                            }

                            Point3D foodLocation = new Point3D(wingLocation.X, wingLocation.Y, wingLocation.Z);

                            item.MoveToWorld(foodLocation, map);

                            double firefieldChance = .15 + (.15 * spawnPercent);

                            if (Utility.RandomDouble() <= firefieldChance)
                            {
                                Timer.DelayCall(TimeSpan.FromSeconds(.25), delegate
                                {
                                    SingleFireField singleFireField = new SingleFireField(null, 0, 1, 30, 3, 5, false, false, true, -1, true);
                                    singleFireField.MoveToWorld(foodLocation, map);
                                });
                            }

                            IPooledEnumerable mobilesOnTile = map.GetMobilesInRange(wingLocation, 1);

                            Queue m_Queue = new Queue();

                            foreach (Mobile mobile in mobilesOnTile)
                            {
                                if (mobile == this)
                                {
                                    continue;
                                }
                                if (!SpecialAbilities.MonsterCanDamage(this, mobile))
                                {
                                    continue;
                                }

                                m_Queue.Enqueue(mobile);
                            }

                            mobilesOnTile.Free();

                            while (m_Queue.Count > 0)
                            {
                                Mobile mobile = (Mobile)m_Queue.Dequeue();

                                double damage = DamageMax;

                                if (mobile is BaseCreature)
                                {
                                    damage *= 2;
                                }

                                new Blood().MoveToWorld(mobile.Location, mobile.Map);
                                AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0);
                            }
                        });
                    });
                }
            });
        }
Ejemplo n.º 5
0
        public override void OnThink()
        {
            base.OnThink();

            if (Combatant != null && m_NextSunburstAllowed < DateTime.UtcNow && m_NextAbilityAllowed < DateTime.UtcNow)
            {
                if (Combatant.Alive && !Combatant.Hidden && InLOS(Combatant) && Utility.GetDistance(Location, Combatant.Location) <= 8)
                {
                    m_NextSunburstAllowed = DateTime.UtcNow + NextSunburstDelay;
                    m_NextAbilityAllowed  = DateTime.UtcNow + NextAbilityAllowedDelay;

                    Point3D location          = Location;
                    Point3D combatantLocation = Combatant.Location;
                    Map     map = Map;

                    int effectRadius = Utility.RandomMinMax(6, 10);

                    int rows    = (effectRadius * 2) + 1;
                    int columns = (effectRadius * 2) + 1;

                    List <Point3D> m_EffectLocations = new List <Point3D>();

                    for (int a = 1; a < rows + 1; a++)
                    {
                        for (int b = 1; b < columns + 1; b++)
                        {
                            Point3D newPoint = new Point3D(location.X + (-1 * (effectRadius + 1)) + a, location.Y + (-1 * (effectRadius + 1)) + b, location.Z);
                            SpellHelper.AdjustField(ref newPoint, map, 12, false);

                            if (!map.InLOS(newPoint, location))
                            {
                                continue;
                            }

                            if (!m_EffectLocations.Contains(newPoint))
                            {
                                m_EffectLocations.Add(newPoint);
                            }
                        }
                    }

                    int explosionHue = 2515; //2586;

                    int cycles = 50;

                    int minDamage = DamageMin;
                    int maxDamage = DamageMax;

                    if (m_EffectLocations.Count > 0)
                    {
                        for (int a = 0; a < cycles; a++)
                        {
                            Timer.DelayCall(TimeSpan.FromSeconds(a * .1), delegate
                            {
                                Effects.PlaySound(location, map, 0x5CF);

                                Point3D newLocation = m_EffectLocations[Utility.RandomMinMax(0, m_EffectLocations.Count - 1)];
                                SpellHelper.AdjustField(ref newLocation, map, 12, false);

                                Effects.SendLocationParticles(EffectItem.Create(newLocation, map, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 30, explosionHue, 0, 5029, 0);

                                IPooledEnumerable mobilesOnTile = map.GetMobilesInRange(newLocation, 0);

                                Queue m_Queue = new Queue();

                                foreach (Mobile mobile in mobilesOnTile)
                                {
                                    if (!mobile.CanBeDamaged() || !mobile.Alive || mobile.AccessLevel > AccessLevel.Player)
                                    {
                                        continue;
                                    }

                                    bool validTarget = false;

                                    PlayerMobile pm_Target = mobile as PlayerMobile;
                                    BaseCreature bc_Target = mobile as BaseCreature;

                                    if (pm_Target != null)
                                    {
                                        validTarget = true;
                                    }

                                    if (bc_Target != null)
                                    {
                                        if (bc_Target.Controlled && bc_Target.ControlMaster is PlayerMobile)
                                        {
                                            validTarget = true;
                                        }
                                    }

                                    if (validTarget)
                                    {
                                        m_Queue.Enqueue(mobile);
                                    }
                                }

                                mobilesOnTile.Free();

                                while (m_Queue.Count > 0)
                                {
                                    Mobile mobile = (Mobile)m_Queue.Dequeue();

                                    double damage = Utility.RandomMinMax(minDamage, maxDamage);

                                    if (mobile is BaseCreature)
                                    {
                                        damage *= 1.5;
                                    }

                                    new Blood().MoveToWorld(mobile.Location, mobile.Map);

                                    SingleFireField singleFireField = new SingleFireField(this, explosionHue, 1, 20, 3, 5, false, false, true, -1, true);
                                    singleFireField.MoveToWorld(mobile.Location, map);

                                    AOS.Damage(mobile, this, (int)(Math.Round(damage)), 0, 100, 0, 0, 0);
                                }
                            });
                        }
                    }

                    return;
                }
            }

            if (Combatant != null && m_NextFireBlastAllowed < DateTime.UtcNow && m_NextAbilityAllowed < DateTime.UtcNow)
            {
                if (Combatant.Alive && !Combatant.Hidden && InLOS(Combatant) && GetDistanceToSqrt(Combatant) <= 12)
                {
                    m_NextFireBlastAllowed = DateTime.UtcNow + NextFireBlastDelay;
                    m_NextAbilityAllowed   = DateTime.UtcNow + NextAbilityAllowedDelay;

                    double effectTime      = 1.5;
                    double actionsCooldown = 3;

                    PlaySound(GetAngerSound());

                    AIObject.NextMove = DateTime.UtcNow + TimeSpan.FromSeconds(effectTime);
                    LastSwingTime     = LastSwingTime + TimeSpan.FromSeconds(effectTime);

                    NextSpellTime = NextSpellTime + TimeSpan.FromSeconds(actionsCooldown);
                    NextCombatHealActionAllowed    = NextCombatHealActionAllowed + TimeSpan.FromSeconds(actionsCooldown);
                    NextCombatSpecialActionAllowed = NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(actionsCooldown);
                    NextCombatEpicActionAllowed    = NextCombatEpicActionAllowed + TimeSpan.FromSeconds(actionsCooldown);

                    Animate(6, 10, 1, true, false, 0);

                    int itemId  = 0x36D4;
                    int itemHue = 2515;      //2613;

                    int explosionHue = 2515; //2586;

                    int minDamage = DamageMin;
                    int maxDamage = DamageMin;

                    Point3D location       = Location;
                    Point3D targetLocation = Combatant.Location;
                    Map     map            = Combatant.Map;

                    Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
                    {
                        if (this == null)
                        {
                            return;
                        }
                        if (Deleted || !Alive)
                        {
                            return;
                        }

                        Effects.PlaySound(targetLocation, map, 0x5FC);

                        IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 20), map);
                        IEntity endLocation   = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 10), map);

                        Effects.SendMovingParticles(startLocation, endLocation, itemId, 8, 0, false, false, itemHue, 0, 9501, 0, 0, 0x100);

                        double distance         = GetDistanceToSqrt(targetLocation);
                        double destinationDelay = (double)distance * .06;

                        Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                        {
                            Effects.PlaySound(targetLocation, map, 0x357);

                            int radius = Utility.RandomMinMax(2, 4);

                            int minRange = radius * -1;
                            int maxRange = radius;

                            for (int a = minRange; a < maxRange + 1; a++)
                            {
                                for (int b = minRange; b < maxRange + 1; b++)
                                {
                                    Point3D newPoint = new Point3D(targetLocation.X + a, targetLocation.Y + b, targetLocation.Z);
                                    SpellHelper.AdjustField(ref newPoint, map, 12, false);

                                    if (!map.InLOS(targetLocation, newPoint))
                                    {
                                        continue;
                                    }

                                    int distanceDelay = Utility.GetDistance(targetLocation, newPoint);

                                    Timer.DelayCall(TimeSpan.FromSeconds(distanceDelay * .15), delegate
                                    {
                                        Effects.PlaySound(newPoint, map, Utility.RandomList(0x4F1, 0x5D8, 0x5DA, 0x580));
                                        Effects.SendLocationParticles(EffectItem.Create(newPoint, map, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 30, explosionHue, 0, 5029, 0);

                                        IPooledEnumerable mobilesOnTile = map.GetMobilesInRange(newPoint, 0);

                                        Queue m_Queue = new Queue();

                                        foreach (Mobile mobile in mobilesOnTile)
                                        {
                                            if (!mobile.CanBeDamaged() || !mobile.Alive || mobile.AccessLevel > AccessLevel.Player)
                                            {
                                                continue;
                                            }

                                            bool validTarget = false;

                                            PlayerMobile pm_Target = mobile as PlayerMobile;
                                            BaseCreature bc_Target = mobile as BaseCreature;

                                            if (pm_Target != null)
                                            {
                                                validTarget = true;
                                            }

                                            if (bc_Target != null)
                                            {
                                                if (bc_Target.Controlled && bc_Target.ControlMaster is PlayerMobile)
                                                {
                                                    validTarget = true;
                                                }
                                            }

                                            if (validTarget)
                                            {
                                                m_Queue.Enqueue(mobile);
                                            }
                                        }

                                        mobilesOnTile.Free();

                                        while (m_Queue.Count > 0)
                                        {
                                            Mobile mobile = (Mobile)m_Queue.Dequeue();

                                            double damage = Utility.RandomMinMax(minDamage, maxDamage);

                                            if (mobile is BaseCreature)
                                            {
                                                damage *= 1.5;
                                            }

                                            new Blood().MoveToWorld(mobile.Location, mobile.Map);
                                            AOS.Damage(mobile, this, (int)(Math.Round(damage)), 0, 100, 0, 0, 0);
                                        }
                                    });
                                }
                            }
                        });
                    });
                }
            }

            if (Utility.RandomDouble() < .01 && DateTime.UtcNow > m_NextAIChangeAllowed)
            {
                Effects.PlaySound(Location, Map, GetAngerSound());

                switch (Utility.RandomMinMax(1, 5))
                {
                case 1:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 0;
                    break;

                case 2:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 10;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 0;
                    break;

                case 3:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 10;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 0;
                    break;

                case 4:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 10;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 0;
                    break;

                case 5:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 10;
                    break;
                }

                m_NextAIChangeAllowed = DateTime.UtcNow + NextAIChangeDelay;
            }
        }
Ejemplo n.º 6
0
        public override void OnThink()
        {
            base.OnThink();

            if (Combatant != null && DateTime.UtcNow > m_NextMeteorRainAllowed && DateTime.UtcNow > m_NextAbilityAllowed)
            {
                double spawnPercent = (double)intervalCount / (double)totalIntervals;

                int meteors = 30 + (int)(Math.Ceiling(50 * spawnPercent));

                int loops = (int)(Math.Ceiling((double)meteors / 10));

                double stationaryDelay = loops + 2.5;

                m_NextMeteorRainAllowed = DateTime.UtcNow + NextMeteorRainDelay + TimeSpan.FromSeconds(stationaryDelay);
                m_NextAbilityAllowed    = DateTime.UtcNow + NextAbilityAllowedDelay + TimeSpan.FromSeconds(stationaryDelay);

                PlaySound(GetAngerSound());

                AIObject.NextMove = DateTime.UtcNow + TimeSpan.FromSeconds(stationaryDelay);
                LastSwingTime     = LastSwingTime + TimeSpan.FromSeconds(stationaryDelay);

                NextSpellTime = NextSpellTime + TimeSpan.FromSeconds(stationaryDelay);
                NextCombatHealActionAllowed    = NextCombatHealActionAllowed + TimeSpan.FromSeconds(stationaryDelay);
                NextCombatSpecialActionAllowed = NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(stationaryDelay);
                NextCombatEpicActionAllowed    = NextCombatEpicActionAllowed + TimeSpan.FromSeconds(stationaryDelay);

                Animate(23, 10, 1, true, false, 0);

                PublicOverheadMessage(MessageType.Regular, 0, false, "*rains down hellfire*");

                Point3D location = Location;
                Map     map      = Map;

                Timer.DelayCall(TimeSpan.FromSeconds(1.0), delegate
                {
                    if (this == null)
                    {
                        return;
                    }
                    if (this.Deleted)
                    {
                        return;
                    }

                    for (int a = 0; a < loops; a++)
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(a * 1), delegate
                        {
                            if (this == null)
                            {
                                return;
                            }
                            if (Deleted || !Alive)
                            {
                                return;
                            }

                            Animate(23, 10, 1, true, false, 0);

                            PlaySound(GetAngerSound());
                            Effects.PlaySound(location, map, 0x5CF);
                        });
                    }

                    for (int a = 0; a < meteors; a++)
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(a * .1), delegate
                        {
                            if (this == null)
                            {
                                return;
                            }
                            if (Deleted || !Alive)
                            {
                                return;
                            }

                            Point3D meteorLocation = new Point3D(location.X + Utility.RandomMinMax(-8, 8), location.Y + Utility.RandomMinMax(-8, 8), location.Z);

                            IEntity startLocation = new Entity(Serial.Zero, new Point3D(meteorLocation.X - 1, meteorLocation.Y - 1, meteorLocation.Z + 100), map);
                            IEntity endLocation   = new Entity(Serial.Zero, new Point3D(meteorLocation.X, meteorLocation.Y, meteorLocation.Z + 5), map);

                            int particleSpeed = 8 + (int)(Math.Round(8 * (double)spawnPercent));

                            Effects.SendMovingParticles(startLocation, endLocation, 0x36D4, particleSpeed, 0, false, false, 2613, 0, 9501, 0, 0, 0x100);

                            double impactDelay = .75 - (.375 * spawnPercent);

                            Timer.DelayCall(TimeSpan.FromSeconds(impactDelay), delegate
                            {
                                if (this == null)
                                {
                                    return;
                                }
                                if (Deleted || !Alive)
                                {
                                    return;
                                }

                                Effects.PlaySound(endLocation, map, 0x56E);
                                Effects.SendLocationParticles(endLocation, 0x3709, 10, 20, 2613, 0, 5029, 0);

                                Blood rocks  = new Blood();
                                rocks.Name   = "rocks";
                                rocks.Hue    = 2615;
                                rocks.ItemID = Utility.RandomList(4967, 4970, 4973);

                                Point3D rockLocation = new Point3D(meteorLocation.X, meteorLocation.Y, meteorLocation.Z);

                                rocks.MoveToWorld(rockLocation, map);

                                double firefieldChance = .20 + (.20 * spawnPercent);

                                if (Utility.RandomDouble() <= firefieldChance)
                                {
                                    Timer.DelayCall(TimeSpan.FromSeconds(.25), delegate
                                    {
                                        SingleFireField singleFireField = new SingleFireField(null, 2613, 1, 30, 3, 5, false, false, true, -1, true);
                                        singleFireField.MoveToWorld(rockLocation, map);
                                    });
                                }

                                IPooledEnumerable mobilesOnTile = map.GetMobilesInRange(meteorLocation, 1);

                                Queue m_Queue = new Queue();

                                foreach (Mobile mobile in mobilesOnTile)
                                {
                                    if (!mobile.CanBeDamaged() || !mobile.Alive || mobile.AccessLevel > AccessLevel.Player)
                                    {
                                        continue;
                                    }

                                    bool validTarget = false;

                                    PlayerMobile pm_Target = mobile as PlayerMobile;
                                    BaseCreature bc_Target = mobile as BaseCreature;

                                    if (pm_Target != null)
                                    {
                                        validTarget = true;
                                    }

                                    if (bc_Target != null)
                                    {
                                        if (bc_Target.Controlled && bc_Target.ControlMaster is PlayerMobile)
                                        {
                                            validTarget = true;
                                        }
                                    }

                                    if (validTarget)
                                    {
                                        m_Queue.Enqueue(mobile);
                                    }
                                }

                                mobilesOnTile.Free();

                                while (m_Queue.Count > 0)
                                {
                                    Mobile mobile = (Mobile)m_Queue.Dequeue();

                                    double damage = Utility.RandomMinMax((int)(Math.Round((double)DamageMin / 2)), DamageMin);

                                    if (mobile is BaseCreature)
                                    {
                                        damage *= 1.5;
                                    }

                                    new Blood().MoveToWorld(mobile.Location, mobile.Map);
                                    AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0);
                                }
                            });
                        });
                    }
                });

                return;
            }

            if (Combatant != null && DateTime.UtcNow > m_NextFireBlastAllowed && DateTime.UtcNow > m_NextAbilityAllowed)
            {
                if (Combatant.Alive && !Combatant.Hidden && InLOS(Combatant) && GetDistanceToSqrt(Combatant) <= 12)
                {
                    m_NextFireBlastAllowed = DateTime.UtcNow + NextFireBlastDelay;
                    m_NextAbilityAllowed   = DateTime.UtcNow + NextAbilityAllowedDelay;

                    double effectTime      = 1.5;
                    double actionsCooldown = 3;

                    PlaySound(GetAngerSound());

                    AIObject.NextMove = DateTime.UtcNow + TimeSpan.FromSeconds(effectTime);
                    LastSwingTime     = LastSwingTime + TimeSpan.FromSeconds(effectTime);

                    NextSpellTime = NextSpellTime + TimeSpan.FromSeconds(actionsCooldown);
                    NextCombatHealActionAllowed    = NextCombatHealActionAllowed + TimeSpan.FromSeconds(actionsCooldown);
                    NextCombatSpecialActionAllowed = NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(actionsCooldown);
                    NextCombatEpicActionAllowed    = NextCombatEpicActionAllowed + TimeSpan.FromSeconds(actionsCooldown);

                    Animate(6, 10, 1, true, false, 0);

                    int itemId  = 0x573E;
                    int itemHue = 0;

                    Point3D location       = Location;
                    Point3D targetLocation = Combatant.Location;
                    Map     map            = Combatant.Map;

                    Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
                    {
                        if (this == null)
                        {
                            return;
                        }
                        if (Deleted || !Alive)
                        {
                            return;
                        }

                        Effects.PlaySound(targetLocation, map, 0x5FC);

                        IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 20), map);
                        IEntity endLocation   = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 10), map);

                        Effects.SendMovingParticles(startLocation, endLocation, 0x36D4, 8, 0, false, false, 2613, 0, 9501, 0, 0, 0x100);

                        double distance         = GetDistanceToSqrt(targetLocation);
                        double destinationDelay = (double)distance * .06;

                        Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                        {
                            double spawnPercent = (double)intervalCount / (double)totalIntervals;

                            Effects.PlaySound(targetLocation, map, 0x357);

                            Dictionary <Point3D, double> m_ExplosionLocations = new Dictionary <Point3D, double>();

                            m_ExplosionLocations.Add(targetLocation, 0);

                            int radius = 2 + (int)(Math.Ceiling(6 * spawnPercent));

                            int minRange = -1 * radius;
                            int maxRange = radius + 1;

                            for (int a = minRange; a < maxRange; a++)
                            {
                                for (int b = minRange; b < maxRange; b++)
                                {
                                    Point3D explosionPoint = new Point3D(targetLocation.X + a, targetLocation.Y + b, targetLocation.Z);

                                    int distanceFromCenter = Utility.GetDistance(targetLocation, explosionPoint);

                                    double fireburstChance = .25 + (.25 * spawnPercent);

                                    if (Utility.RandomDouble() <= fireburstChance)
                                    {
                                        if (!m_ExplosionLocations.ContainsKey(explosionPoint))
                                        {
                                            m_ExplosionLocations.Add(explosionPoint, distance);
                                        }
                                    }
                                }
                            }

                            foreach (KeyValuePair <Point3D, double> pair in m_ExplosionLocations)
                            {
                                Timer.DelayCall(TimeSpan.FromSeconds(pair.Value * .10), delegate
                                {
                                    Point3D explosionLocation = pair.Key;
                                    SpellHelper.AdjustField(ref explosionLocation, map, 12, false);

                                    Effects.PlaySound(pair.Key, map, 0x56D);
                                    Effects.SendLocationParticles(EffectItem.Create(explosionLocation, map, TimeSpan.FromSeconds(0.5)), 0x36BD, 20, 10, 2613, 0, 5044, 0);

                                    IPooledEnumerable mobilesOnTile = map.GetMobilesInRange(pair.Key, 0);

                                    Queue m_Queue = new Queue();

                                    foreach (Mobile mobile in mobilesOnTile)
                                    {
                                        if (!mobile.CanBeDamaged() || !mobile.Alive || mobile.AccessLevel > AccessLevel.Player)
                                        {
                                            continue;
                                        }

                                        bool validTarget = false;

                                        PlayerMobile pm_Target = mobile as PlayerMobile;
                                        BaseCreature bc_Target = mobile as BaseCreature;

                                        if (pm_Target != null)
                                        {
                                            validTarget = true;
                                        }

                                        if (bc_Target != null)
                                        {
                                            if (bc_Target.Controlled && bc_Target.ControlMaster is PlayerMobile)
                                            {
                                                validTarget = true;
                                            }
                                        }

                                        if (validTarget)
                                        {
                                            m_Queue.Enqueue(mobile);
                                        }
                                    }

                                    mobilesOnTile.Free();

                                    while (m_Queue.Count > 0)
                                    {
                                        Mobile mobile = (Mobile)m_Queue.Dequeue();

                                        double damage = DamageMin;

                                        if (mobile is BaseCreature)
                                        {
                                            damage *= 1.5;
                                        }

                                        new Blood().MoveToWorld(mobile.Location, mobile.Map);
                                        AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0);
                                    }
                                });
                            }
                        });
                    });
                }

                return;
            }

            if (Utility.RandomDouble() < .01 && DateTime.UtcNow > m_NextAIChangeAllowed)
            {
                Effects.PlaySound(Location, Map, GetAngerSound());

                switch (Utility.RandomMinMax(1, 5))
                {
                case 1:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 0;
                    break;

                case 2:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 10;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 0;
                    break;

                case 3:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 10;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 0;
                    break;

                case 4:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 10;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 0;
                    break;

                case 5:
                    DictCombatTargetingWeight[CombatTargetingWeight.Player]           = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.Closest]          = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0;
                    DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints]  = 10;
                    break;
                }

                m_NextAIChangeAllowed = DateTime.UtcNow + NextAIChangeDelay;
            }
        }