Ejemplo n.º 1
0
        private void SpawnZombies()
        {
            PublicOverheadMessage(Server.Network.MessageType.Emote, Hue, true, "*flaming zombies crawl out of the monster's stomach*");

            int creatures = Utility.RandomMinMax(3, 3);

            for (int a = 0; a < creatures; a++)
            {
                List <Point3D> m_Locations = SpecialAbilities.GetSpawnableTiles(Location, false, true, Location, Map, 1, 10, 1, 2, true);

                Point3D newLocation = new Point3D();

                if (m_Locations.Count > 0)
                {
                    newLocation = m_Locations[0];
                }
                else
                {
                    newLocation = Location;
                }

                FlamingZombie flamingZombie = new FlamingZombie();
                flamingZombie.MoveToWorld(newLocation, Map);

                new Blood().MoveToWorld(flamingZombie.Location, Map);
            }

            spawnedZombies = true;
        }
Ejemplo n.º 2
0
        public override void OnThink()
        {
            base.OnThink();

            if (Utility.RandomDouble() < 0.05 && DateTime.UtcNow > m_NextVanishAllowed)
            {
                if (Combatant != null && !Hidden && !Paralyzed && !BardProvoked && !BardPacified)
                {
                    Point3D originalLocation = Location;

                    if (SpecialAbilities.VanishAbility(this, 1.0, true, -1, 3, 6, true, null))
                    {
                        int    projectiles           = 6;
                        int    particleSpeed         = 8;
                        double distanceDelayInterval = .12;

                        int minRadius = 1;
                        int maxRadius = 5;

                        List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(originalLocation, true, false, originalLocation, Map, projectiles, 20, minRadius, maxRadius, false);

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

                        for (int c = 0; c < projectiles; c++)
                        {
                            Point3D bloodLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                            IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 2), Map);
                            IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(bloodLocation.X, bloodLocation.Y, bloodLocation.Z + 50), Map);

                            Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F), particleSpeed, 0, false, false, 0, 0);
                        }
                    }

                    m_NextVanishAllowed = DateTime.UtcNow + NextVanishDelay;
                }
            }
        }
Ejemplo n.º 3
0
        public void ShootWebs(BaseCreature creature)
        {
            if (creature == null)
            {
                return;
            }
            if (!creature.Alive || creature.Deleted)
            {
                return;
            }

            double minWebs = 25;
            double maxWebs = 50;

            int minRadius = 1;
            int maxRadius = 20;

            double spawnPercent = (double)intervalCount / (double)totalIntervals;
            int    websToAdd    = (int)(minWebs + ((maxWebs - minWebs) * spawnPercent));

            for (int a = 0; a < websToAdd; a++)
            {
                List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, false, true, creature.Location, creature.Map, 1, 15, minRadius, maxRadius, true);

                if (m_ValidLocations.Count > 0)
                {
                    Point3D newLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                    int webId = Utility.RandomList(3811, 3812, 3813, 3814, 4306, 4307, 4308, 4308);

                    IEntity startLocation = new Entity(Serial.Zero, new Point3D(creature.Location.X, creature.Location.Y, creature.Location.Z), creature.Map);
                    IEntity endLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z), creature.Map);

                    Effects.PlaySound(newLocation, creature.Map, 0x4F1);
                    Effects.SendMovingEffect(startLocation, endLocation, webId, 5, 0, false, false, 0, 0);

                    double distance         = creature.GetDistanceToSqrt(newLocation);
                    double destinationDelay = (double)distance * .08;

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

                        Effects.SendLocationParticles(EffectItem.Create(newLocation, creature.Map, TimeSpan.FromSeconds(15)), webId, 5, 4000, 0, 0, 5029, 0);
                    });
                }
            }

            IPooledEnumerable eable = creature.Map.GetObjectsInRange(creature.Location, 20);

            foreach (object obj in eable)
            {
                if (obj is PlayerMobile)
                {
                    Mobile       mobile      = obj as Mobile;
                    PlayerMobile player      = obj as PlayerMobile;
                    BaseCreature bc_Creature = obj as BaseCreature;

                    if (mobile == null)
                    {
                        continue;
                    }
                    if (!mobile.Alive)
                    {
                        continue;
                    }

                    bool validTarget = false;

                    if (player != null)
                    {
                        if (player.AccessLevel == AccessLevel.Player)
                        {
                            validTarget = true;
                        }
                    }

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

                    double mobileWebChanceMin = .4;
                    double mobileWebChanceMax = .8;

                    double chance = mobileWebChanceMin + ((mobileWebChanceMax - mobileWebChanceMin) * spawnPercent);

                    if (creature.CanBeHarmful(mobile) && validTarget && !mobile.Hidden && Utility.RandomDouble() <= chance)
                    {
                        Effects.PlaySound(mobile.Location, player.Map, 0x580);
                        SpecialAbilities.HinderSpecialAbility(1.0, creature, mobile, 1.0, Utility.RandomMinMax(4, 8), false, -1, false, "", "You have been wrapped in a web!", "-1");

                        int webId = Utility.RandomList(3811, 3812, 3813, 3814, 4306, 4307, 4308, 4308);

                        IEntity startLocation = new Entity(Serial.Zero, new Point3D(creature.Location.X, creature.Location.Y, creature.Location.Z), creature.Map);
                        IEntity endLocation   = new Entity(Serial.Zero, new Point3D(mobile.X, mobile.Y, mobile.Z), creature.Map);

                        Effects.SendMovingEffect(startLocation, endLocation, webId, 5, 0, false, false, 0, 0);

                        double distance         = creature.GetDistanceToSqrt(mobile.Location);
                        double destinationDelay = (double)distance * .08;

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

                            Effects.SendLocationParticles(EffectItem.Create(mobile.Location, creature.Map, TimeSpan.FromSeconds(10)), webId, 0, 125, 0, 0, 5029, 0);
                        });
                    }
                }
            }

            eable.Free();
        }
Ejemplo n.º 4
0
        public void CallForAid()
        {
            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            double maxExtraCreatures = 4;
            int    creatures         = 2 + (int)(Math.Ceiling(maxExtraCreatures * spawnPercent));

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

            Combatant = null;

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

            PublicOverheadMessage(MessageType.Regular, 0, false, "*calls for aid*");

            Effects.PlaySound(Location, Map, GetAngerSound());

            AbilityInProgress        = true;
            DamageIntervalInProgress = true;
            m_NextAbilityAllowed     = DateTime.UtcNow + GetNextAbilityDelay();

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

                AbilityInProgress        = false;
                DamageIntervalInProgress = false;
                m_NextAbilityAllowed     = DateTime.UtcNow + GetNextAbilityDelay();
            });

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

                Animate(27, 16, 1, true, false, 0);
            });

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

                Effects.PlaySound(Location, Map, GetAngerSound());

                for (int a = 0; a < creatures; a++)
                {
                    Point3D targetLocation = Location;
                    Map map = Map;

                    List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, true, Location, Map, 1, 15, 1, 5, true);

                    if (m_ValidLocations.Count > 0)
                    {
                        targetLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                    }

                    BaseCreature bc_Creature = null;

                    if (spawnPercent <= .25)
                    {
                        switch (Utility.RandomMinMax(1, 1))
                        {
                        case 1: bc_Creature = new RoyalWhelp(); break;
                        }
                    }

                    else if (spawnPercent <= .50)
                    {
                        switch (Utility.RandomMinMax(1, 3))
                        {
                        case 1: bc_Creature = new RoyalWhelp(); break;

                        case 2: bc_Creature = new RoyalWhelp(); break;

                        case 3: bc_Creature = new RoyalDrake(); break;
                        }
                    }

                    else
                    {
                        switch (Utility.RandomMinMax(1, 3))
                        {
                        case 1: bc_Creature = new RoyalWhelp(); break;

                        case 2: bc_Creature = new RoyalDrake(); break;

                        case 3: bc_Creature = new RoyalDragon(); break;
                        }
                    }

                    if (bc_Creature != null)
                    {
                        m_Creatures.Add(bc_Creature);
                        bc_Creature.MoveToWorld(targetLocation, map);

                        bc_Creature.PlaySound(bc_Creature.GetIdleSound());

                        Effects.SendLocationParticles(EffectItem.Create(targetLocation, map, EffectItem.DefaultDuration), 0x3728, 10, 30, 0, 0, 2023, 0);
                    }
                }
            });
        }
Ejemplo n.º 5
0
        public void Activate(Mobile from)
        {
            if (this == null)
            {
                return;
            }
            if (from == null)
            {
                return;
            }

            Point3D m_RuneLocation = from.Location;

            //Necromancer Rune
            m_RuneType = (RuneType)Utility.RandomMinMax(0, 5);

            int runeHue = fireHue;

            switch (m_RuneType)
            {
            case RuneType.Fire: runeHue = fireHue; break;

            case RuneType.Ice: runeHue = iceHue; break;

            case RuneType.Earth: runeHue = earthHue; break;

            case RuneType.Energy: runeHue = energyHue; break;

            case RuneType.Poison: runeHue = poisonHue; break;

            case RuneType.Curse: runeHue = curseHue; break;
            }

            Dictionary <Point3D, int> m_RunePieces = new Dictionary <Point3D, int>();

            m_RunePieces.Add(new Point3D(m_RuneLocation.X - 1, m_RuneLocation.Y - 1, m_RuneLocation.Z), 0x3083);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X - 1, m_RuneLocation.Y, m_RuneLocation.Z), 0x3080);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X, m_RuneLocation.Y - 1, m_RuneLocation.Z), 0x3082);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X + 1, m_RuneLocation.Y - 1, m_RuneLocation.Z), 0x3081);

            m_RunePieces.Add(new Point3D(m_RuneLocation.X - 1, m_RuneLocation.Y + 1, m_RuneLocation.Z), 0x307D);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X, m_RuneLocation.Y, m_RuneLocation.Z), 0x307F);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X + 1, m_RuneLocation.Y, m_RuneLocation.Z), 0x307E);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X, m_RuneLocation.Y + 1, m_RuneLocation.Z), 0x307C);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X + 1, m_RuneLocation.Y + 1, m_RuneLocation.Z), 0x307B);

            foreach (KeyValuePair <Point3D, int> pair in m_RunePieces)
            {
                Blood runePiece = new Blood();
                runePiece.ItemID = pair.Value;
                runePiece.Name   = "a rune";
                runePiece.Hue    = runeHue;
                runePiece.MoveToWorld(pair.Key, Map);
            }

            Blood flame = new Blood();

            flame.ItemID = 0x19AB;
            flame.Name   = "a runeflame";
            flame.Hue    = runeHue;
            flame.MoveToWorld(new Point3D(m_RuneLocation.X, m_RuneLocation.Y, m_RuneLocation.Z), Map);

            Effects.SendLocationParticles(EffectItem.Create(m_RuneLocation, Map, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 125, runeHue, 0, 5029, 0);

            int projectiles = 20;

            int minRadius = 1;
            int maxRadius = 8;

            List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(m_RuneLocation, true, false, m_RuneLocation, Map, projectiles, 20, minRadius, maxRadius, false);

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

            m_NextUseAllowed = DateTime.UtcNow + UsageCooldown;

            int    particleSpeed         = 5;   //10
            double distanceDelayInterval = .12; //.08

            for (int a = 0; a < projectiles; a++)
            {
                double distance;
                double destinationDelay;

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

                    Point3D newLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                    IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(m_RuneLocation.X, m_RuneLocation.Y, m_RuneLocation.Z + 3), Map);
                    IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 6), Map);

                    newLocation.Z += 5;

                    switch (m_RuneType)
                    {
                    case RuneType.Fire:
                        Effects.PlaySound(m_RuneLocation, Map, 0x359);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x36D4, particleSpeed, 0, false, false, 0, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

                            Effects.PlaySound(newLocation, Map, 0x591);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(0.5)), 0x36BD, 20, 10, 5044);
                        });
                        break;

                    case RuneType.Ice:
                        Effects.PlaySound(m_RuneLocation, Map, 0x64F);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x36D4, particleSpeed, 0, false, false, 1153, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * .08;

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

                            Effects.PlaySound(newLocation, Map, 0x208);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 20, 1153, 0, 5029, 0);
                        });
                        break;

                    case RuneType.Earth:
                        int itemId = Utility.RandomList(4963, 4964, 4965, 4966, 4968, 4969, 4971, 4972);

                        Effects.PlaySound(m_RuneLocation, Map, 0x5D3);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, itemId, particleSpeed, 0, false, false, 0, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

                            Effects.PlaySound(newLocation, Map, 0x11D);

                            int mudItems = Utility.RandomMinMax(1, 2);

                            //Rubble
                            Blood dirt  = new Blood();
                            dirt.Name   = "rubble";
                            dirt.ItemID = Utility.RandomList(7681, 7682);

                            Point3D dirtLocation = new Point3D(newLocation.X, newLocation.Y, newLocation.Z);

                            dirt.MoveToWorld(dirtLocation, Map);
                        });
                        break;

                    case RuneType.Energy:
                        Effects.PlaySound(m_RuneLocation, Map, 0x211);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x3818, particleSpeed, 0, false, false, runeHue, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

                            Effects.PlaySound(newLocation, Map, 0x211);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(5)), 0x3973, 10, 125, 5029);
                        });
                        break;

                    case RuneType.Poison:
                        Effects.PlaySound(m_RuneLocation, Map, 0x22F);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x372A, particleSpeed, 0, false, false, runeHue, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

                            Effects.PlaySound(newLocation, Map, 0x22F);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(0.25)), 0x372A, 10, 20, runeHue, 0, 5029, 0);
                        });
                        break;

                    case RuneType.Curse:
                        Effects.PlaySound(m_RuneLocation, Map, 0x56E);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x573E, particleSpeed, 0, false, false, 0, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

                            Effects.PlaySound(newLocation, Map, 0x56E);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(0.25)), 0x376A, 10, 20, runeHue, 0, 5029, 0);
                        });
                        break;
                    }
                });
            }
        }
Ejemplo n.º 6
0
        public void PumpkinExplosion(Mobile from)
        {
            if (this == null)
            {
                return;
            }
            if (from == null)
            {
                return;
            }

            int pumpkins = 100;

            int minRadius = 1;
            int maxRadius = 8;

            List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(from.Location, true, false, from.Location, Map, pumpkins, 50, minRadius, maxRadius, false);

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

            m_NextUseAllowed = DateTime.UtcNow + UsageCooldown;

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

            for (int a = 0; a < pumpkins; a++)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(a * .025), delegate
                {
                    if (this == null)
                    {
                        return;
                    }
                    if (this.Deleted)
                    {
                        return;
                    }

                    Point3D newLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                    Effects.PlaySound(newLocation, Map, Utility.RandomList(0x5D3, 0x5D2, 0x5A2, 0x580));

                    IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 3), Map);
                    IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 5), Map);

                    int itemId = Utility.RandomList(3178, 3179, 3180);

                    Effects.SendMovingEffect(effectStartLocation, effectEndLocation, itemId, 5, 0, false, false, 0, 0);

                    double distance = Utility.GetDistanceToSqrt(Location, newLocation);

                    double destinationDelay = (double)distance * .10;

                    Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                    {
                        Effects.PlaySound(newLocation, Map, Utility.RandomList(0x5DE, 0x5DA, 0x5D8));

                        TimedStatic pumpkinExplosion = new TimedStatic(Utility.RandomList(4650, 4651, 4653, 4655), 5);
                        pumpkinExplosion.Name        = "smashed pumpkin";
                        pumpkinExplosion.Hue         = 1359;
                        pumpkinExplosion.MoveToWorld(newLocation, Map);
                    });
                });
            }
        }
Ejemplo n.º 7
0
        public void SummonTurkeys()
        {
            if (!SpecialAbilities.Exists(this))
            {
                return;
            }

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

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

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

            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, "*establishes new pecking order*");

            Point3D location = Location;
            Map     map      = Map;

            PlaySound(GetAngerSound());
            Animate(28, 10, 1, true, false, 0);

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

                PlaySound(0x468);

                int projectiles        = 50;
                double projectileDelay = .02;
                int particleSpeed      = 4;

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

                        Point3D newLocation = new Point3D(Location.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), Location.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), Location.Z);
                        SpellHelper.AdjustField(ref newLocation, Map, 12, false);

                        IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 5), Map);
                        IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 5), Map);

                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(3578, 3579), particleSpeed, 0, false, false, 0, 0);
                    });
                }

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

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

                    int turkeys = 5 + (int)(Math.Ceiling(7 * spawnPercent));

                    for (int a = 0; a < turkeys; a++)
                    {
                        Point3D creatureLocation = Location;
                        Map creatureMap          = Map;

                        List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, 1, 15, 1, 8, true);

                        if (m_ValidLocations.Count > 0)
                        {
                            creatureLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                        }

                        LesserGobbler creature = new LesserGobbler();
                        creature.MoveToWorld(creatureLocation, creatureMap);
                        creature.PlaySound(creature.GetAngerSound());

                        Effects.SendLocationParticles(EffectItem.Create(creature.Location, creature.Map, TimeSpan.FromSeconds(5)), 0x3728, 10, 10, 2023);

                        m_Creatures.Add(creature);
                    }
                });
            });
        }
Ejemplo n.º 8
0
        public static void DrunkardThrowBottle(Mobile from)
        {
            if (from == null)
            {
                return;
            }

            Point3D location = from.Location;
            Map     map      = from.Map;

            int throwSound = 0x5D3;
            int itemId     = Utility.RandomList(2459, 2463, 2503);
            int itemHue    = 0;
            int hitSound   = Utility.RandomList(0x38D, 0x38E, 0x38F, 0x390);

            bool    foundLocation  = false;
            Point3D targetLocation = new Point3D();

            List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(from.Location, true, false, from.Location, from.Map, 1, 25, 2, 8, true);

            if (m_ValidLocations.Count > 0)
            {
                targetLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                foundLocation  = true;

                from.Direction = from.GetDirectionTo(targetLocation);

                Timer.DelayCall(TimeSpan.FromSeconds(.25), delegate
                {
                    if (from == null)
                    {
                        return;
                    }
                    if (!from.Alive)
                    {
                        return;
                    }

                    from.Animate(31, 7, 1, true, false, 0); //Throw Bottle
                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*drunkenly throws bottle*");
                });
            }

            if (!foundLocation)
            {
                from.PublicOverheadMessage(MessageType.Regular, 0, false, "*drops bottle*");

                TimedStatic bottle = new TimedStatic(Utility.RandomList(0x38D, 0x38E, 0x38F, 0x390), 1);
                bottle.Name = "a drunkard's bottle";
                bottle.MoveToWorld(from.Location, from.Map);

                Effects.PlaySound(targetLocation, map, hitSound);

                return;
            }

            Timer.DelayCall(TimeSpan.FromSeconds(.75), delegate
            {
                if (from == null)
                {
                    return;
                }
                if (!from.Alive)
                {
                    return;
                }

                if (foundLocation)
                {
                    Effects.PlaySound(from.Location, from.Map, throwSound);

                    IEntity startLocation = new Entity(Serial.Zero, new Point3D(from.Location.X, from.Location.Y, from.Location.Z + 10), from.Map);
                    IEntity endLocation   = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 5), from.Map);

                    Direction direction = from.GetDirectionTo(targetLocation);

                    double speedModifier = .66;

                    Effects.SendMovingEffect(startLocation, endLocation, itemId, (int)(15 * speedModifier), 0, true, false, itemHue, 0);

                    double distance         = from.GetDistanceToSqrt(targetLocation);
                    double destinationDelay = (double)distance * .08 * (.5 / speedModifier);

                    Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                    {
                        Effects.PlaySound(targetLocation, map, hitSound);
                    });
                }
            });
        }
Ejemplo n.º 9
0
        public void CorpseExplosion(Mobile from)
        {
            if (this == null)
            {
                return;
            }
            if (from == null)
            {
                return;
            }

            int bodyParts = 20;

            int minRadius = 1;
            int maxRadius = 8;

            List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, bodyParts, 20, minRadius, maxRadius, false);

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

            m_NextUseAllowed = DateTime.UtcNow + UsageCooldown;

            for (int a = 0; a < bodyParts; a++)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(a * .025), delegate
                {
                    if (this == null)
                    {
                        return;
                    }
                    if (this.Deleted)
                    {
                        return;
                    }

                    Point3D newLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                    Effects.PlaySound(newLocation, Map, 0x4F1);

                    IEntity effectStartLocation = new Entity(Serial.Zero, Location, Map);
                    IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 2), Map);

                    int itemId = Utility.RandomList
                                 (
                        7389, 7397, 7398, 7395, 7402, 7408, 7407, 7393, 7584, 7405, 7585, 7600, 7587, 7602, 7394,
                        7404, 7391, 7396, 7399, 7403, 7406, 7586, 7599, 7588, 7601, 7392, 7392, 7583, 7597, 7390
                                 );

                    Effects.SendMovingEffect(effectStartLocation, effectEndLocation, itemId, 5, 0, false, false, 0, 0);

                    double distance = Utility.GetDistanceToSqrt(Location, newLocation);

                    double destinationDelay = (double)distance * .16;
                    double explosionDelay   = ((double)distance * .16) + 1;

                    Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                    {
                        new Blood().MoveToWorld(new Point3D(newLocation.X + Utility.RandomMinMax(-1, 1), newLocation.Y + Utility.RandomMinMax(-1, 1), newLocation.Z + 2), Map);
                        Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(2.0)), itemId, 0, 50, 0, 0, 5029, 0);
                    });

                    Timer.DelayCall(TimeSpan.FromSeconds(explosionDelay), delegate
                    {
                        DetonateCorpse(newLocation, Map);
                    });
                });
            }
        }
Ejemplo n.º 10
0
        public void SpawnCreatures()
        {
            if (!SpecialAbilities.Exists(this))
            {
                return;
            }

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

            int maxExtraCreatures = 8;
            int creatures         = 2 + (int)Math.Ceiling((double)maxExtraCreatures * spawnPercent);

            PublicOverheadMessage(MessageType.Regular, 0, false, "*creatures burst from maggot*");

            double stationaryDelay = 3;

            m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(.5);

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

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

                AbilityInProgress        = false;
                DamageIntervalInProgress = false;
                m_NextAbilityAllowed     = DateTime.UtcNow + NextAbilityDelay;
            });

            for (int a = 0; a < creatures; a++)
            {
                List <Point3D> m_Locations = SpecialAbilities.GetSpawnableTiles(Location, false, true, Location, Map, 1, 10, 1, 3, true);

                Point3D newLocation = new Point3D();

                if (m_Locations.Count > 0)
                {
                    newLocation = m_Locations[0];
                }

                else
                {
                    newLocation = Location;
                }

                //TEST
                //ADD PLAGUE BEAST

                if (Utility.RandomDouble() >= .2)
                {
                    Entrail entrail = new Entrail();
                    entrail.MoveToWorld(newLocation, Map);
                    m_Creatures.Add(entrail);

                    new Blood().MoveToWorld(entrail.Location, Map);
                }

                else
                {
                    DiseasedViscera diseasedViscera = new DiseasedViscera();
                    diseasedViscera.MoveToWorld(newLocation, Map);
                    m_Creatures.Add(diseasedViscera);

                    new Blood().MoveToWorld(diseasedViscera.Location, Map);
                }
            }
        }
Ejemplo n.º 11
0
        public void ShootWebs(Mobile from)
        {
            if (this == null)
            {
                return;
            }
            if (this.Deleted)
            {
                return;
            }
            if (from == null)
            {
                return;
            }

            int websToAdd = 20;

            int minRadius = 1;
            int maxRadius = 8;

            int websValid = 0;

            for (int a = 0; a < websToAdd; a++)
            {
                List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, 1, 20, minRadius, maxRadius, false);

                if (m_ValidLocations.Count > 0)
                {
                    websValid++;

                    Point3D newLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                    int webId = Utility.RandomList(3811, 3812, 3813, 3814, 4306, 4307, 4308, 4308);

                    IEntity startLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z), Map);
                    IEntity endLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z), Map);

                    Effects.PlaySound(newLocation, Map, 0x4F1);
                    Effects.SendMovingEffect(startLocation, endLocation, webId, 5, 0, false, false, 0, 0);

                    double distance         = Utility.GetDistanceToSqrt(Location, newLocation);
                    double destinationDelay = (double)distance * .08;

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

                        Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(15)), webId, 5, 4000, 0, 0, 5029, 0);
                    });
                }
            }

            if (websValid > 0)
            {
                m_NextUseAllowed = DateTime.UtcNow + UsageCooldown;
            }
        }
Ejemplo n.º 12
0
        public void IntervalEffect()
        {
            if (this == null)
            {
                return;
            }
            if (Deleted || !Alive)
            {
                return;
            }

            Point3D location = Location;
            Map     map      = Map;

            AbilityInProgress = true;

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

            int loreStatues = 3 + (int)(Math.Ceiling(7 * spawnPercent));

            int effectHue = Hue - 1;

            double stationaryDelay = 2;

            Combatant        = null;
            NextDecisionTime = DateTime.UtcNow + TimeSpan.FromSeconds(stationaryDelay);

            AIObject.NextMove              = AIObject.NextMove + 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);

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

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

                    CantWalk = true;
                    Frozen   = true;

                    PlaySound(GetAngerSound());
                    Animate(12, 12, 1, true, false, 0);
                });
            }

            Timer.DelayCall(TimeSpan.FromSeconds(2), delegate
            {
                if (Deleted || !Alive)
                {
                    return;
                }

                CantWalk = false;
                Frozen   = false;

                AbilityInProgress = false;
            });

            for (int a = 0; a < 4; a++)
            {
                double duration = 22 - (a * .5);

                Timer.DelayCall(TimeSpan.FromSeconds(a * .5), delegate
                {
                    Effects.PlaySound(location, map, 0x1EC);

                    for (int b = 0; b < loreStatues; b++)
                    {
                        if (Deleted || !Alive)
                        {
                            return;
                        }

                        Point3D runeLocation;

                        List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, false, false, Location, Map, 1, 10, 1, 18, true);

                        if (m_ValidLocations.Count > 0)
                        {
                            runeLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                        }
                        else
                        {
                            return;
                        }

                        TimedStatic forbiddenRunes = new TimedStatic(Utility.RandomList(3676, 3679, 3682, 3685, 3688), duration);
                        forbiddenRunes.Name        = "forbidden rune";
                        SpellHelper.AdjustField(ref runeLocation, map, 12, false);

                        forbiddenRunes.MoveToWorld(runeLocation, map);

                        TimedStatic timedStatic = new TimedStatic(0x3779, .5);
                        timedStatic.Hue         = effectHue;
                        timedStatic.Name        = "rune energy";
                        timedStatic.MoveToWorld(runeLocation, map);
                    }
                });
            }

            Timer.DelayCall(TimeSpan.FromSeconds(2), delegate
            {
                if (Deleted || !Alive)
                {
                    return;
                }

                for (int a = 0; a < loreStatues; a++)
                {
                    for (int b = 0; b < 3; b++)
                    {
                        List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(location, false, false, location, map, 1, 10, 1, 15, true);

                        if (m_ValidLocations.Count > 0)
                        {
                            location = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                        }

                        bool foundStatue = false;

                        IPooledEnumerable itemsNearby = map.GetItemsInRange(location, 2);
                        {
                            foreach (Item item in itemsNearby)
                            {
                                if (item is ForbiddenLoreStatue)
                                {
                                    foundStatue = true;
                                    break;
                                }
                            }
                        }

                        itemsNearby.Free();

                        if (foundStatue || location == Location)
                        {
                            continue;
                        }

                        int statueAttackInterval = Utility.RandomMinMax(4, 6);
                        int durationCount        = (int)(Math.Ceiling(30 / (double)statueAttackInterval));

                        ForbiddenLoreStatue statue = new ForbiddenLoreStatue(10, DamageMin, DamageMin, statueAttackInterval, durationCount);
                        statue.MoveToWorld(location, map);

                        break;
                    }
                }
            });
        }
Ejemplo n.º 13
0
        public void IntervalEffect()
        {
            if (this == null)
            {
                return;
            }
            if (Deleted || !Alive)
            {
                return;
            }

            AbilityInProgress = true;

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

            int pitTentacles = 2 + (int)(Math.Ceiling(8 * spawnPercent));

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

            double stationaryDelay = 2;

            Combatant        = null;
            NextDecisionTime = DateTime.UtcNow + TimeSpan.FromSeconds(stationaryDelay);

            AIObject.NextMove              = AIObject.NextMove + 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);

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

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

                    CantWalk = true;
                    Frozen   = true;

                    PlaySound(GetAngerSound());
                    Animate(12, 12, 1, true, false, 0);
                });
            }

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

                CantWalk = false;
                Frozen   = false;

                AbilityInProgress = false;
            });

            for (int a = 0; a < pitTentacles; a++)
            {
                Point3D location    = Location;
                Point3D pitLocation = Location;
                Map     map         = Map;

                List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, 1, 15, 1, 8, true);

                if (m_ValidLocations.Count > 0)
                {
                    pitLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                }

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

                        Effects.PlaySound(pitLocation, map, 0x4CF);

                        TimedStatic floorCrack = new TimedStatic(Utility.RandomList(6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920), 5);
                        floorCrack.Name        = "floor crack";

                        Point3D floorCrackLocation = new Point3D(pitLocation.X + Utility.RandomList(-1, 1), pitLocation.Y + Utility.RandomList(-1, 1), pitLocation.Z);
                        SpellHelper.AdjustField(ref floorCrackLocation, map, 12, false);

                        floorCrack.MoveToWorld(floorCrackLocation, map);
                    });
                }

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

                    TimedStatic floorHole = new TimedStatic(7025, 5);
                    floorHole.Name        = "pit to below";
                    floorHole.MoveToWorld(pitLocation, map);
                });

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

                    IEntity pitLocationEntity = new Entity(Serial.Zero, new Point3D(pitLocation.X, pitLocation.Y, pitLocation.Z), map);
                    Effects.SendLocationParticles(pitLocationEntity, 0x3709, 10, 30, 2053, 0, 5052, 0);

                    for (int b = 0; b < 4; b++)
                    {
                        TimedStatic pitPlasm = new TimedStatic(Utility.RandomList(4650, 4651, 4653, 4654, 4655), 5);
                        pitPlasm.Name        = "pit plasm";
                        pitPlasm.Hue         = 2052;

                        Point3D pitPlasmLocation = new Point3D(pitLocation.X + Utility.RandomList(-1, 1), pitLocation.Y + Utility.RandomList(-1, 1), pitLocation.Z);
                        SpellHelper.AdjustField(ref pitPlasmLocation, map, 12, false);

                        pitPlasm.MoveToWorld(pitPlasmLocation, map);
                    }

                    BaseCreature m_PitCreature = null;

                    double creatureResult = Utility.RandomDouble();

                    if (creatureResult <= .10)
                    {
                        m_PitCreature      = new FountainOfEvil();
                        m_PitCreature.Name = "enveloping darkness";
                        m_PitCreature.CorpseNameOverride = "enveloping darkness corpse";
                        m_PitCreature.Hue       = 2250;
                        m_PitCreature.BodyValue = 780;
                    }

                    else if (creatureResult <= .25)
                    {
                        m_PitCreature      = new HookHorror();
                        m_PitCreature.Name = "a clawfiend";
                        m_PitCreature.CorpseNameOverride = "a clawfiend's corpse";
                        m_PitCreature.Hue       = 1107;
                        m_PitCreature.BodyValue = 303;
                    }

                    else if (creatureResult <= .50)
                    {
                        m_PitCreature      = new SvirfneblinRogue();
                        m_PitCreature.Name = "an underling";
                        m_PitCreature.CorpseNameOverride = "an underling's corpse";
                        m_PitCreature.Hue       = 2076;
                        m_PitCreature.BodyValue = 776;
                    }

                    else
                    {
                        m_PitCreature = new PitTentacle();
                    }

                    if (m_PitCreature != null)
                    {
                        m_PitCreature.BossMinion = true;
                        m_PitCreature.MoveToWorld(pitLocation, map);

                        m_Creatures.Add(m_PitCreature);
                    }
                });
            }
        }
Ejemplo n.º 14
0
        public void SpawnSpiders(BaseCreature creature)
        {
            if (creature == null)
            {
                return;
            }
            if (!creature.Alive)
            {
                return;
            }

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

            int spiderCount = minSpiders + (int)Math.Ceiling(((double)maxSpiders - (double)minSpiders) * spawnPercent);

            int minRadius = 2;
            int maxRadius = 10;

            for (int a = 0; a < spiderCount; a++)
            {
                List <Point3D> locations = SpecialAbilities.GetSpawnableTiles(creature.Location, false, true, creature.Location, creature.Map, 1, 15, minRadius, maxRadius, true);

                Point3D newLocation = new Point3D();

                if (locations.Count > 0)
                {
                    newLocation = locations[0];
                }

                else
                {
                    bool validBackups = false;

                    if (m_BackupLocations != null)
                    {
                        if (m_BackupLocations.Count > 0)
                        {
                            validBackups = true;
                        }
                    }

                    if (Utility.RandomDouble() < .5 && validBackups)
                    {
                        newLocation = m_BackupLocations[Utility.RandomMinMax(0, m_BackupLocations.Count - 1)];
                    }
                    else
                    {
                        newLocation = Location;
                    }
                }

                IEntity startLocation = new Entity(Serial.Zero, new Point3D(creature.Location.X, creature.Location.Y, creature.Location.Z), creature.Map);
                IEntity endLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z), creature.Map);

                Effects.PlaySound(newLocation, creature.Map, 0x4F1);

                if (newLocation != Location)
                {
                    Effects.SendMovingEffect(startLocation, endLocation, 4313, 5, 0, false, false, 0, 0);
                }

                double distance = creature.GetDistanceToSqrt(newLocation);

                double destinationDelay = (double)distance * .08;

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

                    Effects.SendLocationParticles(EffectItem.Create(newLocation, creature.Map, TimeSpan.FromSeconds(1.5)), 4313, 5, 60, 0, 0, 5029, 0);
                });

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

                    Effects.PlaySound(newLocation, creature.Map, 0x4F1);
                    Effects.SendLocationParticles(EffectItem.Create(newLocation, creature.Map, TimeSpan.FromSeconds(2.0)), 0x11A6, 5, 25, 1149, 0, 5029, 0);

                    switch (Utility.RandomMinMax(1, 2))
                    {
                    case 1:
                        CorruptSpiderling corruptSpiderling = new CorruptSpiderling();
                        corruptSpiderling.MoveToWorld(newLocation, creature.Map);
                        m_Creatures.Add(corruptSpiderling);
                        break;

                    case 2:
                        Deathspinner deathSpinner = new Deathspinner();
                        deathSpinner.MoveToWorld(newLocation, creature.Map);
                        m_Creatures.Add(deathSpinner);
                        break;
                    }
                });
            }
        }
Ejemplo n.º 15
0
        public static void DamageCorpse(Point3D location, Map map, bool largeExplosion)
        {
            int projectiles   = 5;
            int particleSpeed = 8;

            int minRadius = 1;
            int maxRadius = 5;

            List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(location, true, false, location, map, projectiles, 20, minRadius, maxRadius, false);

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

            for (int b = 0; b < projectiles; b++)
            {
                Point3D newLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 2), map);
                IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 20), map);

                newLocation.Z += 5;

                Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(4651, 4652, 4653, 4654, 5701), particleSpeed, 0, false, false, 0, 0);
            }

            for (int a = 0; a < 4; a++)
            {
                Point3D newPoint = new Point3D(location.X + Utility.RandomList(-2, -1, 1, 2), location.Y + Utility.RandomList(-2, -1, 1, 2), location.Z);
                SpellHelper.AdjustField(ref newPoint, map, 12, false);

                new Blood().MoveToWorld(newPoint, map);
            }

            int radius         = 2;
            int explosionSound = Utility.RandomList(0x5DA, 0x580);

            if (largeExplosion)
            {
                explosionSound = 0x309;
                radius         = 4;

                List <int> m_ExtraParts = new List <int>();

                m_ExtraParts.Add(Utility.RandomList(7407)); //Entrail
                m_ExtraParts.Add(Utility.RandomList(6929)); //Bones
                m_ExtraParts.Add(Utility.RandomList(6930)); //Bones
                m_ExtraParts.Add(Utility.RandomList(6937)); //Bones
                m_ExtraParts.Add(Utility.RandomList(6938)); //Bones
                m_ExtraParts.Add(Utility.RandomList(6931)); //Bones
                m_ExtraParts.Add(Utility.RandomList(6932)); //Bones

                m_ExtraParts.Add(Utility.RandomList(4650)); //Blood
                m_ExtraParts.Add(Utility.RandomList(4651)); //Blood
                m_ExtraParts.Add(Utility.RandomList(4652)); //Blood
                m_ExtraParts.Add(Utility.RandomList(4653)); //Blood
                m_ExtraParts.Add(Utility.RandomList(4654)); //Blood
                m_ExtraParts.Add(Utility.RandomList(5701)); //Blood
                m_ExtraParts.Add(Utility.RandomList(4655)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7439)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7438)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7436)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7433)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7431)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7428)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7425)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7410)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7415)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7416)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7418)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7420)); //Blood
                m_ExtraParts.Add(Utility.RandomList(7425)); //Blood

                double extraPartChance = .5;

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

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

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

                        if (map.InLOS(location, newPoint))
                        {
                            m_ExplosionPoints.Add(newPoint);
                        }
                    }
                }

                for (int a = 0; a < m_ExplosionPoints.Count; a++)
                {
                    if (Utility.RandomDouble() <= extraPartChance)
                    {
                        Point3D explosionPoint = m_ExplosionPoints[a];

                        int itemId = m_ExtraParts[Utility.RandomMinMax(0, m_ExtraParts.Count - 1)];

                        int distance = Utility.GetDistance(location, explosionPoint);

                        Timer.DelayCall(TimeSpan.FromSeconds(distance * .15), delegate
                        {
                            TimedStatic gore = new TimedStatic(itemId, 10);
                            gore.Name        = "gore";
                            gore.MoveToWorld(explosionPoint, map);

                            if (Utility.RandomDouble() <= .5)
                            {
                                Item item = null;

                                switch (Utility.RandomMinMax(1, 8))
                                {
                                //case 1: item = new CookedBird(); break;
                                //case 2: item = new ChickenLeg(); break;
                                //case 3: item = new LambLeg(); item.Name = "chicken drumstick"; break;
                                case 4: item = new Feather(); break;

                                case 5: item = new Feather(); break;

                                case 6: item = new Feather(); break;

                                case 7: item = new Feather(); break;

                                case 8: item = new Feather(); break;
                                }

                                if (item != null)
                                {
                                    item.MoveToWorld(explosionPoint, map);
                                }
                            }
                        });
                    }
                }
            }

            Effects.PlaySound(location, map, explosionSound);
        }
Ejemplo n.º 16
0
        public void SummonSkullSpikes(BaseCreature creature)
        {
            if (creature == null)
            {
                return;
            }
            if (creature.Deleted || !creature.Alive)
            {
                return;
            }

            Point3D location = creature.Location;
            Map     map      = creature.Map;

            m_SummoningSkullSpikes = true;

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

            int stationaryDuration = 4 - (int)(Math.Ceiling(3 * spawnPercent));

            creature.Frozen   = true;
            creature.CantWalk = true;

            creature.AIObject.NextMove              = creature.AIObject.NextMove + TimeSpan.FromSeconds(stationaryDuration);
            creature.LastSwingTime                  = creature.LastSwingTime + TimeSpan.FromSeconds(stationaryDuration);
            creature.NextSpellTime                  = creature.NextSpellTime + TimeSpan.FromSeconds(stationaryDuration);
            creature.NextCombatHealActionAllowed    = creature.NextCombatHealActionAllowed + TimeSpan.FromSeconds(stationaryDuration);
            creature.NextCombatSpecialActionAllowed = creature.NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(stationaryDuration);
            creature.NextCombatEpicActionAllowed    = creature.NextCombatEpicActionAllowed + TimeSpan.FromSeconds(stationaryDuration);

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

            IPooledEnumerable mobilesInArea = Map.GetMobilesInRange(creature.Location, 15);

            foreach (Mobile mobile in mobilesInArea)
            {
                if (mobile == null)
                {
                    continue;
                }
                if (mobile == creature)
                {
                    continue;
                }
                if (mobile.Map != map)
                {
                    continue;
                }
                if (!mobile.Alive)
                {
                    continue;
                }
                if (!mobile.CanBeDamaged())
                {
                    continue;
                }
                if (mobile.AccessLevel > AccessLevel.Player)
                {
                    continue;
                }
                if (mobile.Hidden)
                {
                    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 (!creature.InLOS(mobile))
                {
                    validTarget = false;
                }

                if (validTarget)
                {
                    if (!m_Locations.Contains(mobile.Location))
                    {
                        m_Locations.Add(mobile.Location);
                    }
                }
            }

            mobilesInArea.Free();

            foreach (Point3D point in m_Locations)
            {
                int bonePileCount = 3;

                for (int a = 0; a < bonePileCount; a++)
                {
                    TimedStatic bonePile = new TimedStatic(Utility.RandomList(6922, 6923, 6924, 6925, 6926, 6927, 6928, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794), stationaryDuration);

                    bonePile.Name = "bones";
                    bonePile.MoveToWorld(point, Map);
                }
            }

            Effects.PlaySound(location, map, 0x222);

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

                    creature.Frozen   = true;
                    creature.CantWalk = true;

                    creature.PlaySound(GetIdleSound());
                    Animate(18, 5, 1, true, false, 0);
                });
            }

            Timer.DelayCall(TimeSpan.FromSeconds(stationaryDuration), delegate
            {
                if (creature == null)
                {
                    return;
                }
                if (creature.Deleted)
                {
                    return;
                }
                if (!creature.Alive)
                {
                    return;
                }

                foreach (Point3D point in m_Locations)
                {
                    Effects.SendLocationParticles(EffectItem.Create(point, map, TimeSpan.FromSeconds(0.25)), 8700, 10, 30, 0, 0, 5029, 0);

                    IPooledEnumerable spikePoint = map.GetMobilesInRange(point, 1);

                    bool hitMobile = false;

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

                    foreach (Mobile mobile in spikePoint)
                    {
                        if (mobile == creature)
                        {
                            continue;
                        }
                        if (mobile.Location != point)
                        {
                            continue;
                        }
                        if (mobile.Map != map)
                        {
                            continue;
                        }
                        if (!mobile.Alive)
                        {
                            continue;
                        }
                        if (!mobile.CanBeDamaged())
                        {
                            continue;
                        }
                        if (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)
                        {
                            continue;
                        }

                        m_MobilesHit.Add(mobile);
                    }

                    spikePoint.Free();

                    foreach (Mobile mobile in m_MobilesHit)
                    {
                        int damage = DamageMin;

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

                        SpecialAbilities.PierceSpecialAbility(1.0, this, mobile, 50, 30, -1, true, "", "Bone shards pierce your armor, reducing it's effectiveness!", "-1");

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

                    Effects.PlaySound(point, map, 0x11D);

                    for (int a = 0; a < 5; a++)
                    {
                        Blood dirt           = new Blood();
                        dirt.Name            = "bones";
                        dirt.ItemID          = Utility.RandomList(6929, 6930, 6937, 6938, 6933, 6934, 6935, 6936, 6939, 6940, 6880, 6881, 6882, 6883);
                        Point3D dirtLocation = new Point3D(point.X + Utility.RandomList(-1, 1), point.Y + Utility.RandomList(-1, 1), point.Z);
                        dirt.MoveToWorld(dirtLocation, Map);
                    }

                    int projectiles              = 10;
                    int particleSpeed            = 8;
                    double distanceDelayInterval = .12;

                    int minRadius = 1;
                    int maxRadius = 5;

                    List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(point, true, false, point, map, projectiles, 20, minRadius, maxRadius, false);

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

                    for (int a = 0; a < projectiles; a++)
                    {
                        Point3D newLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                        IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(point.X, point.Y, point.Z + 2), map);
                        IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 50), map);

                        newLocation.Z += 5;

                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(6929, 6930, 6937, 6938, 6933, 6934, 6935, 6936, 6939, 6940, 6880, 6881, 6882, 6883), particleSpeed, 0, false, false, 0, 0);
                    }

                    IEntity locationEntity = new Entity(Serial.Zero, new Point3D(point.X, point.Y, point.Z - 1), map);
                    Effects.SendLocationParticles(locationEntity, Utility.RandomList(0x36BD, 0x36BF, 0x36CB, 0x36BC), 30, 7, 2497, 0, 5044, 0);
                }

                m_NextSkullSpikesAllowed = DateTime.UtcNow + NextSkullSpikesDelay;
                m_SummoningSkullSpikes   = false;

                creature.Frozen   = false;
                creature.CantWalk = false;
            });
        }
Ejemplo n.º 17
0
        public void IntervalEffect()
        {
            if (Deleted || !Alive)
            {
                return;
            }

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

            AbilityInProgress = true;

            int    summonMotions  = 5 - (int)(Math.Ceiling(4 * spawnPercent));
            double summonDuration = 1;

            int creaturesToSummon = 2 + (int)(Math.Ceiling(8 * spawnPercent));

            double stationaryDelay = summonMotions * summonDuration + 1;

            double minRange = 8;
            double maxRange = 24;

            Point3D location = Location;
            Map     map      = Map;

            int range     = 10 + (int)(Math.Ceiling(20 * spawnPercent));
            int effectHue = Hue - 1;

            Combatant        = null;
            NextDecisionTime = DateTime.UtcNow + TimeSpan.FromSeconds(stationaryDelay);

            AIObject.NextMove              = AIObject.NextMove + 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);

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

            PublicOverheadMessage(MessageType.Regular, 0, false, "*draws upon the breath of the living*");

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

                    CantWalk = true;
                    Frozen   = true;

                    Effects.PlaySound(Location, Map, GetAngerSound());

                    Animate(12, 12, 1, true, false, 0);

                    Queue m_Queue = new Queue();

                    IPooledEnumerable mobilesInRange = map.GetMobilesInRange(location, range);

                    foreach (Mobile mobile in mobilesInRange)
                    {
                        if (mobile.Deleted)
                        {
                            continue;
                        }
                        if (!mobile.Alive)
                        {
                            continue;
                        }
                        if (mobile == this)
                        {
                            continue;
                        }
                        if (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);
                        }
                    }

                    mobilesInRange.Free();

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

                        mobile.MovingEffect(this, 0x3728, 5, 1, false, false, effectHue, 0);
                    }
                });
            }

            Timer.DelayCall(TimeSpan.FromSeconds((double)summonMotions * summonDuration), delegate
            {
                if (Deleted || !Alive)
                {
                    return;
                }

                CantWalk = false;
                Frozen   = false;

                AbilityInProgress = false;

                PlaySound(0x64F);

                Queue m_Queue = new Queue();

                IPooledEnumerable mobilesInRange = map.GetMobilesInRange(location, range);

                foreach (Mobile mobile in mobilesInRange)
                {
                    if (mobile.Deleted)
                    {
                        continue;
                    }
                    if (!mobile.Alive)
                    {
                        continue;
                    }
                    if (mobile == this)
                    {
                        continue;
                    }
                    if (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);
                    }
                }

                mobilesInRange.Free();

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

                    int distance = range - (int)GetDistanceToSqrt(mobile);

                    double damage = DamageMax;

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

                    Direction direction = Utility.GetDirection(location, mobileLocation);
                    int windId          = GetWindItemId(direction, false);
                    MovingEffect(mobile, windId, 5, 1, false, false, effectHue, 0);

                    SpecialAbilities.KnockbackSpecialAbility(1.0, Location, this, mobile, damage, distance, -1, "", "You are knocked back by the breath of life!");
                }

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

                    for (int a = 0; a < creaturesToSummon; a++)
                    {
                        Point3D spawnLocation = Location;

                        List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, 1, 15, 1, 10, true);

                        if (m_ValidLocations.Count > 0)
                        {
                            spawnLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                        }

                        int particleSpeed = 5;

                        IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 3), Map);
                        IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(spawnLocation.X, spawnLocation.Y, spawnLocation.Z + 3), map);

                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x3728, particleSpeed, 0, false, false, 0, 0);

                        double distance         = Utility.GetDistanceToSqrt(Location, spawnLocation);
                        double destinationDelay = (double)distance * .08;

                        Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                        {
                            if (Deleted || !Alive)
                            {
                                return;
                            }

                            Effects.PlaySound(spawnLocation, map, 0x653);

                            Effects.SendLocationParticles(effectEndLocation, 0x3709, 10, 20, effectHue, 0, 5029, 0);
                            Effects.SendLocationParticles(effectEndLocation, 0x3779, 10, 60, effectHue, 0, 5029, 0);
                            Effects.SendLocationParticles(effectEndLocation, 0x3996, 10, 60, effectHue, 0, 5029, 0);

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

                                BaseCreature monsterToSpawn = null;

                                int maxCreatureValue = 1 + (int)(Math.Ceiling(10 * spawnPercent));

                                if (maxCreatureValue > 10)
                                {
                                    maxCreatureValue = 10;
                                }

                                switch (Utility.RandomMinMax(1, maxCreatureValue))
                                {
                                case 1: monsterToSpawn = new Zombie(); break;

                                case 2: monsterToSpawn = new Skeleton(); break;

                                case 3: monsterToSpawn = new Ghoul(); break;

                                case 4: monsterToSpawn = new PatchworkSkeleton(); break;

                                case 5: monsterToSpawn = new ZombieMagi(); break;

                                case 6: monsterToSpawn = new SkeletalMage(); break;

                                case 7: monsterToSpawn = new SkeletalKnight(); break;

                                case 8: monsterToSpawn = new Mummy(); break;

                                case 9: monsterToSpawn = new SkeletalDrake(); break;

                                case 10: monsterToSpawn = new RottingCorpse(); break;
                                }

                                if (monsterToSpawn != null)
                                {
                                    monsterToSpawn.BossMinion = true;
                                    monsterToSpawn.MoveToWorld(spawnLocation, map);

                                    m_Creatures.Add(monsterToSpawn);
                                }
                            });
                        });
                    }
                });
            });
        }