Beispiel #1
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() < .2)
            {
                TimedStatic ichor = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5);
                ichor.Hue  = 2051;
                ichor.Name = "ichor";
                ichor.MoveToWorld(defender.Location, Map);

                for (int a = 0; a < 4; a++)
                {
                    ichor      = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5);
                    ichor.Hue  = 2051;
                    ichor.Name = "ichor";
                    ichor.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z), Map);
                }

                Effects.PlaySound(defender.Location, defender.Map, 0x580);
                defender.FixedParticles(0x374A, 10, 20, 5021, 1107, 0, EffectLayer.Head);

                defender.SendMessage("You have been covered in an evil ichor!");

                SpecialAbilities.EntangleSpecialAbility(1.0, this, defender, 1.0, 3, -1, false, "", "", "-1");
                SpecialAbilities.PierceSpecialAbility(1.0, this, defender, 50, 15, -1, false, "", "", "-1");
                SpecialAbilities.CrippleSpecialAbility(1.0, this, defender, .2, 15, -1, false, "", "", "-1");
                SpecialAbilities.DisorientSpecialAbility(1.0, this, defender, .10, 15, -1, false, "", "", "-1");
            }
        }
Beispiel #2
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() < .20)
            {
                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, DamageMax, 8.0, -1, true, "", "Their claws rip through your armor and causes you to bleed!", "-1");
                SpecialAbilities.PierceSpecialAbility(1.0, this, defender, 50, 10, -1, true, "", "", "-1");
            }
        }
Beispiel #3
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .25;

            if (Controlled && ControlMaster != null)
            {
                if (ControlMaster is PlayerMobile)
                {
                    if (defender is PlayerMobile)
                    {
                        effectChance = .01;
                    }
                }
            }

            SpecialAbilities.PierceSpecialAbility(effectChance, this, defender, 50, 10, -1, true, "", "Their acid momentarily weakens your armor!", "-1");
        }
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            SpecialAbilities.PierceSpecialAbility(.5, this, defender, 50, 15, -1, true, "", "Their acid momentarily weakens your armor!", "-1");

            Acid acid = new Acid();

            acid.MoveToWorld(defender.Location, Map);

            Effects.PlaySound(defender.Location, Map, Utility.RandomList(0x22F));

            int acidAmount = Utility.RandomMinMax(1, 3);

            for (int a = 0; a < acidAmount; a++)
            {
                Acid extraAcid = new Acid();
                extraAcid.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z), Map);
            }
        }
Beispiel #5
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            SpecialAbilities.PierceSpecialAbility(0.05, this, defender, 50, 10, -1, true, "", "Their spear pierces your armor!", "-1");
        }
Beispiel #6
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;
            });
        }
Beispiel #7
0
        public override void OnThink()
        {
            base.OnThink();

            //Prevent Melee Attacks
            LastSwingTime = DateTime.UtcNow + TimeSpan.FromSeconds(30);

            if (DateTime.UtcNow >= m_NextVoidAttackAllowed && AIObject.currentCombatRange != CombatRange.Withdraw && AIObject.Action != ActionType.Flee)
            {
                Mobile combatant = Combatant;

                if (combatant != null && !CantWalk && !Frozen && Alive && !IsDeadPet && !IsDeadBondedPet)
                {
                    if (combatant.Alive && InLOS(combatant) && GetDistanceToSqrt(combatant) <= 8)
                    {
                        RevealingAction();

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

                        double entangleDuration = 3;
                        double pierceAmount     = .25;
                        double crippleAmount    = .20;

                        TimeSpan attackCooldown = NextPvMVoidAttackDelay;

                        double effectChance = .10;
                        double damageScalar = 1.0;

                        if (Controlled && ControlMaster != null)
                        {
                            if (ControlMaster is PlayerMobile)
                            {
                                if (combatant is PlayerMobile)
                                {
                                    effectChance = .01;
                                }

                                else
                                {
                                    effectChance = .25;
                                }
                            }
                        }

                        if (ControlMaster is PlayerMobile && combatant is PlayerMobile)
                        {
                            entangleDuration = 1;
                            attackCooldown   = NextPvPVoidAttackDelay;
                        }

                        m_NextVoidAttackAllowed = DateTime.UtcNow + attackCooldown;

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

                        BaseWeapon weapon = Weapon as BaseWeapon;

                        if (weapon == null)
                        {
                            return;
                        }

                        bool hitSuccessful = false;

                        if (weapon.CheckHit(this, combatant))
                        {
                            hitSuccessful = true;
                        }

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

                        MovingEffect(combatant, 0x573E, 8, 1, false, false, 2200, 0);

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

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

                        if (hitSuccessful)
                        {
                            Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                            {
                                if (Deleted || !Alive || IsDeadPet || IsDeadBondedPet)
                                {
                                    return;
                                }
                                if (!SpecialAbilities.IsDamagable(combatant))
                                {
                                    return;
                                }
                                if (Utility.GetDistance(Location, combatant.Location) >= 20)
                                {
                                    return;
                                }

                                TimedStatic voidResidue = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5);
                                voidResidue.Hue         = 2051;
                                voidResidue.Name        = "void residue";
                                voidResidue.MoveToWorld(new Point3D(combatant.X, combatant.Y, combatant.Z), Map);

                                if (Utility.RandomDouble() <= effectChance)
                                {
                                    Effects.PlaySound(combatant.Location, combatant.Map, 0x5DC);

                                    for (int a = 0; a < 3; a++)
                                    {
                                        voidResidue      = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5);
                                        voidResidue.Hue  = 2051;
                                        voidResidue.Name = "void residue";

                                        Point3D voidResidueLocation = new Point3D(combatant.X + Utility.RandomMinMax(-1, 1), combatant.Y + Utility.RandomMinMax(-1, 1), combatant.Z);
                                        SpellHelper.AdjustField(ref voidResidueLocation, combatant.Map, 12, false);

                                        voidResidue.MoveToWorld(voidResidueLocation, combatant.Map);
                                    }

                                    combatant.SendMessage("You have been covered in void residue!");
                                    combatant.FixedParticles(0x374A, 10, 15, 5021, 2051, 0, EffectLayer.Waist);

                                    SpecialAbilities.EntangleSpecialAbility(1.0, this, combatant, 1, entangleDuration, 0, false, "", "", "-1");
                                    SpecialAbilities.PierceSpecialAbility(1.0, this, combatant, pierceAmount, 50, 0, false, "", "", "-1");
                                    SpecialAbilities.CrippleSpecialAbility(1.0, this, combatant, crippleAmount, 10, 0, false, "", "", "-1");
                                }

                                weapon.OnHit(this, combatant, damageScalar);
                            });
                        }
                    }
                }
            }
        }
Beispiel #8
0
        public void TriggerTrap()
        {
            if (!SpecialAbilities.Exists(m_Owner))
            {
                return;
            }

            Point3D location = Location;
            Map     map      = Map;
            Mobile  owner    = m_Owner;

            double effectInterval = .5;
            int    loops          = 20;

            Timer.DelayCall(TimeSpan.FromSeconds((effectInterval * loops) + .1), delegate
            {
                if (this == null)
                {
                    return;
                }

                Delete();
            });

            switch (m_TrapType)
            {
            case TrapType.Spikes:
                TimedStatic trap = new TimedStatic(4513, effectInterval * (double)loops);
                trap.Name = "spike trap";
                trap.Hue  = 0;
                trap.MoveToWorld(location, map);

                trap      = new TimedStatic(4507, effectInterval * (double)loops);
                trap.Name = "spike trap";
                trap.Hue  = 0;
                trap.MoveToWorld(location, map);

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

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

                        bool hitMobile = false;

                        IPooledEnumerable nearbyMobiles = map.GetMobilesInRange(location, 1);

                        Queue m_Queue = new Queue();

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

                            m_Queue.Enqueue(mobile);
                            hitMobile = true;
                        }

                        nearbyMobiles.Free();

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

                            double bleedDamage = 8;

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

                            SpecialAbilities.BleedSpecialAbility(1.0, null, mobile, bleedDamage, 8.0, -1, true, "", "The trap cuts into you deeply, causing you to bleed.", "-1");
                        }

                        if (hitMobile)
                        {
                            Effects.PlaySound(location, map, 0x524);
                        }
                    });
                }
                break;

            case TrapType.Saw:
                Point3D adjustedLocation = location;

                trap      = new TimedStatic(4525, effectInterval * (double)loops);
                trap.Name = "saw trap";
                trap.Hue  = 2118;
                trap.MoveToWorld(adjustedLocation, map);

                trap      = new TimedStatic(4530, effectInterval * (double)loops);
                trap.Name = "saw trap";
                trap.Hue  = 2118;
                trap.MoveToWorld(adjustedLocation, map);

                adjustedLocation.Y++;

                trap      = new TimedStatic(4530, effectInterval * (double)loops);
                trap.Name = "saw trap";
                trap.Hue  = 2118;
                trap.MoveToWorld(adjustedLocation, map);

                adjustedLocation.Y--;
                adjustedLocation.X++;

                trap      = new TimedStatic(4525, effectInterval * (double)loops);
                trap.Name = "saw trap";
                trap.Hue  = 2118;
                trap.MoveToWorld(adjustedLocation, map);

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

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

                        bool hitMobile = false;

                        IPooledEnumerable nearbyMobiles = map.GetMobilesInRange(location, 1);

                        Queue m_Queue = new Queue();

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

                            m_Queue.Enqueue(mobile);
                            hitMobile = true;
                        }

                        nearbyMobiles.Free();

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

                            SpecialAbilities.PierceSpecialAbility(1.0, null, mobile, 15, 60, -1, true, "", "The trap pierces your armor, temporarily weakening it!", "-1");

                            double damage = (double)Utility.RandomMinMax(4, 8);

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

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

                        if (hitMobile)
                        {
                            Effects.PlaySound(location, map, 0x21C);
                        }
                    });
                }
                break;
            }
        }
Beispiel #9
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            SpecialAbilities.PierceSpecialAbility(.20, this, defender, 50, 20, -1, true, "", "Their crushing bite momentarily weakens your armor!", "-1");
        }