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

            double effectChance = .25;

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

            SpecialAbilities.BleedSpecialAbility(effectChance, this, defender, DamageMax, 8.0, -1, true, "", "Their bite causes you to bleed!", "-1");

            effectChance = .20;

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

            SpecialAbilities.FrenzySpecialAbility(effectChance, this, defender, .25, 10, -1, true, "", "", "*becomes frenzied*");
        }
Beispiel #2
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() <= .2)
            {
                defender.SendMessage("The creature burrows inside of you, causing you immense pain and discomfort!");

                double damage = 30;

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

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, damage, 30, -1, true, "", "", "-1");

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

                new Blood().MoveToWorld(new Point3D(defender.X, defender.Y, defender.Z), defender.Map);

                for (int a = 0; a < 4; a++)
                {
                    new Blood().MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z), defender.Map);
                }

                Kill();
            }
        }
Beispiel #3
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

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

                for (int a = 0; a < 4; a++)
                {
                    Blood blood = new Blood();
                    blood.Hue    = 2051;
                    blood.Name   = "ichor";
                    blood.ItemID = Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655);
                    blood.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.BleedSpecialAbility(1.0, this, defender, DamageMax, 10, -1, false, "", "", "-1");
                SpecialAbilities.PierceSpecialAbility(1.0, this, defender, 50, 15, -1, false, "", "", "-1");
                SpecialAbilities.CrippleSpecialAbility(1.0, this, defender, .15, 15, -1, false, "", "", "-1");
                SpecialAbilities.DisorientSpecialAbility(1.0, this, defender, .10, 15, -1, false, "", "", "-1");
            }
        }
Beispiel #4
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .1;

            if (ControlMaster is PlayerMobile)
            {
                effectChance = .02;
            }

            if (Utility.RandomDouble() <= effectChance)
            {
                int healingAmount = (int)((double)HitsMax * .25);

                Hits += healingAmount;

                this.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);

                Blood blood = new Blood();
                blood.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z + 1), Map);

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, DamageMax, 8.0, 0x44D, true, "", "The creature sinks its fangs into you, healing itself and causing you to bleed!", "-1");
            }
        }
Beispiel #5
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

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

            double bloodlustChance = .20 + (.20 * spawnPercent);
            double bleedChance     = .20 + +(.20 * spawnPercent);

            if (Utility.RandomDouble() <= bloodlustChance && DateTime.UtcNow > m_NextBloodlustAllowed && DateTime.UtcNow > m_NextAbilityAllowed)
            {
                m_NextBloodlustAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(30 - (20 * spawnPercent));
                m_NextAbilityAllowed   = DateTime.UtcNow + TimeSpan.FromSeconds(10 - (8 * spawnPercent));

                Effects.PlaySound(Combatant.Location, Combatant.Map, 0x28a);

                SpecialAbilities.FrenzySpecialAbility(1.0, this, defender, 0.5, 30, -1, true, "", "", "*becomes consumed with bloodlust*");

                Effects.SendLocationParticles(EffectItem.Create(Location, Map, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 30, 2117, 0, 5029, 0);

                int bloodItem = 5 + (int)(Math.Ceiling(10 * spawnPercent));

                for (int a = 0; a < bloodItem; a++)
                {
                    new Blood().MoveToWorld(new Point3D(defender.Location.X + Utility.RandomMinMax(-3, 3), defender.Location.Y + Utility.RandomMinMax(-3, 3), defender.Location.Z), Map);
                }
            }

            else
            {
                SpecialAbilities.BleedSpecialAbility(bleedChance, this, defender, DamageMax, 8.0, -1, true, "", "Their attack causes you to bleed!", "-1");
            }
        }
Beispiel #6
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .15;

            SpecialAbilities.BleedSpecialAbility(effectChance, this, defender, DamageMax, 8.0, -1, true, "", "Their bite causes you to bleed!", "-1");
        }
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            defender.PlaySound(0x234);

            SpecialAbilities.BleedSpecialAbility(.25, this, defender, DamageMax, 8.0, -1, true, "", "Their precise shot causes you to bleed!", "-1");
        }
Beispiel #8
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            base.OnGaveMeleeAttack(defender);

            double effectChance = .10;

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

            if (Utility.RandomDouble() <= effectChance)
            {
                PublicOverheadMessage(MessageType.Regular, 0, false, "*burrows into opponent*");

                defender.SendMessage("The creature burrows inside of you, causing you immense pain and discomfort!");

                double damage = DamageMax * 5;

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, damage, 30, 0x4F1, true, "", "", "-1");

                int projectiles   = 6;
                int particleSpeed = 4;

                for (int a = 0; a < projectiles; a++)
                {
                    Point3D newLocation = SpecialAbilities.GetRandomAdjustedLocation(defender.Location, defender.Map, true, 4, false);

                    IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(defender.X, defender.Y, defender.Z + Utility.RandomMinMax(5, 10)), defender.Map);
                    IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + Utility.RandomMinMax(10, 20)), defender.Map);

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

                for (int a = 0; a < 4; a++)
                {
                    Point3D bloodLocation = SpecialAbilities.GetRandomAdjustedLocation(Location, Map, true, 1, false);
                    new Blood().MoveToWorld(bloodLocation, Map);
                }

                int selfDamage = 10;

                AOS.Damage(this, selfDamage, 0, 100, 0, 0, 0);
            }
        }
Beispiel #9
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 #10
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() <= .2)
            {
                PlaySound(GetAngerSound());

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, DamageMax, 8.0, -1, true, "", "The beast gores you with their horns, causing you to bleed!", "-1");
            }
        }
Beispiel #11
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double spawnPercent = (double)intervalCount / (double)totalIntervals;
            double bleedChance  = .10 + (.10 * spawnPercent);

            if (defender is PlayerMobile)
            {
                int sound = 0;

                if (defender.Female)
                {
                    sound = Utility.RandomList(0x14B, 0x14C, 0x14D, 0x14E, 0x14F, 0x57E, 0x57B);
                }
                else
                {
                    sound = Utility.RandomList(0x154, 0x155, 0x156, 0x159, 0x589, 0x5F6, 0x436, 0x437, 0x43B, 0x43C);
                }

                defender.PlaySound(sound);
            }

            if (Utility.RandomDouble() <= bleedChance)
            {
                PublicOverheadMessage(MessageType.Regular, 0, false, "*pecks with razor sharp beak*");

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, DamageMax, 8.0, -1, true, "", "Their razor sharp beak causes you to bleed!", "-1");
            }

            Point3D defenderLocation = defender.Location;
            Map     defenderMap      = defender.Map;

            Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
            {
                if (!SpecialAbilities.Exists(this))
                {
                    return;
                }
                if (defender == null)
                {
                    return;
                }

                if (!defender.Alive)
                {
                    defender.PublicOverheadMessage(MessageType.Regular, 0, false, "*turned to giblets*");

                    FeatherExplosion(defenderLocation, defenderMap, 20);
                    DamageCorpse(defenderLocation, defenderMap, true);
                }
            });
        }
Beispiel #12
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            int bloodItems = Utility.RandomMinMax(3, 6);

            for (int a = 0; a < bloodItems; a++)
            {
                Blood blood = new Blood();
                blood.ItemID = Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655);
                blood.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z), Map);
            }

            SpecialAbilities.BleedSpecialAbility(0.25, this, defender, DamageMax, 8.0, Utility.RandomList(0x5D9, 0x5DB), true, "", "Their attack causes you to bleed!", "-1");
        }
Beispiel #13
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            SpecialAbilities.BleedSpecialAbility(.33, this, defender, DamageMax, 8.0, -1, true, "", "Their attack causes you to bleed!", "-1");

            if (Utility.RandomDouble() < .10)
            {
                Effects.PlaySound(defender.Location, defender.Map, 0x580);
                Effects.SendLocationParticles(EffectItem.Create(defender.Location, defender.Map, TimeSpan.FromSeconds(5.0)), Utility.RandomList(3811, 3812, 3813, 3814, 4306, 4307, 4308, 4308), 0, 125, 0, 0, 5029, 0);

                defender.SendMessage("You have been wrapped in a web!");

                SpecialAbilities.HinderSpecialAbility(1.0, this, defender, 1.0, Utility.RandomMinMax(4, 6), false, -1, false, "", "", "-1");
            }
        }
Beispiel #14
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 = .20;
                    }
                }
            }

            SpecialAbilities.BleedSpecialAbility(effectChance, this, defender, DamageMax, 8.0, 0x516, true, "", "The beast gores you with it's horns, causing you to bleed!", "-1");
        }
Beispiel #15
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() <= .10 && Body != 317)
            {
                SpecialAbilities.FrenzySpecialAbility(1.0, this, defender, 0.5, 20, -1, true, "", "", "*begins to strike with unnatural quickness*");
            }

            if (Utility.RandomDouble() <= .10 && m_NextFeedAllowed <= DateTime.UtcNow && Body != 317)
            {
                IsFeeding = true;

                m_NextFeedAllowed = DateTime.UtcNow + NextFeedDelay;
                m_FeedExpiration  = DateTime.UtcNow + FeedDuration;

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

                FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);

                Blood blood = new Blood();
                blood.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z + 1), Map);

                double damage = DamageMax * 6;

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

                PublicOverheadMessage(MessageType.Regular, 0, false, "*begins to feed*");

                Animate(34, 5, 1, true, false, 0);

                SpecialAbilities.EntangleSpecialAbility(1.0, this, defender, 1.0, 10, -1, true, "", "", "-1");
                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, damage, 10.0, 0x44D, true, "", "The creature sinks its fangs into you, ensnaring and feeding upon your blood!", "-1");
            }
        }
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .15;

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

            SpecialAbilities.BleedSpecialAbility(effectChance, this, defender, DamageMax, 8.0, -1, true, "", "Their vicious attack causes you to bleed!", "-1");
        }
Beispiel #17
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .15;

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

            SpecialAbilities.BleedSpecialAbility(effectChance, this, defender, DamageMax, 8.0, 0x516, true, "", "The creature's blade cuts deep, causing you to bleed!", "-1");
        }
        public static void Trick(BaseCreature creature, PlayerMobile player)
        {
            if (creature == null || player == null)
            {
                return;
            }

            int trickTextHue = 0x22;

            creature.PublicOverheadMessage(MessageType.Regular, trickTextHue, false, "Trick it is then!");
            creature.PlaySound(0x246);

            double damageAmount = 0;
            int    duration     = 0;

            switch (Utility.RandomMinMax(1, 15))
            {
            case 1:
                SpecialAbilities.BacklashSpecialAbility(1.0, null, player, .75, 60, -1, true, "", "");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Ack! A curse! Causing your spellcasting proficiency to suffer!", player.NetState);
                }
                break;

            case 2:
                double bleedAmount = (double)player.HitsMax * .66;

                for (int a = 0; a < 5; a++)
                {
                    Point3D newLocation = new Point3D(player.Location.X + Utility.RandomList(-1, 1), player.Location.Y + Utility.RandomList(-1, 1), player.Location.Z);

                    new Blood().MoveToWorld(newLocation, player.Map);
                }

                SpecialAbilities.BleedSpecialAbility(1.0, null, player, bleedAmount, 8, -1, true, "", "", "-1");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Curses! A dagger hidden in an apple!", player.NetState);
                }
                break;

            case 3:
                Point3D creatureLocation = creature.Location;
                Point3D playerLocation   = player.Location;

                int projectiles   = 15;
                int particleSpeed = 8;

                for (int a = 0; a < projectiles; a++)
                {
                    Point3D newLocation = new Point3D(player.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Z);
                    SpellHelper.AdjustField(ref newLocation, player.Map, 12, false);

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

                    Effects.SendMovingParticles(effectStartLocation, effectEndLocation, 0x3818, particleSpeed, 0, false, false, 2603, 0, 9501, 0, 0, 0x100);
                }

                player.FixedParticles(0x3967, 10, 40, 5036, 2603, 0, EffectLayer.CenterFeet);

                int damage = (int)(Math.Round((double)player.HitsMax * .33));

                duration = 5;

                SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, duration, false, -1, false, "", "", "-1");

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

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Electric candy! What an age we live in!", player.NetState);
                }
                break;

            case 4:
                SpecialAbilities.DiseaseSpecialAbility(1.0, null, player, 3, 60, -1, true, "", "");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Blast! Expired candy!", player.NetState);
                }
                break;

            case 5:
                TimedStatic glue = new TimedStatic(4650, 30);
                glue.Name = "glue";
                glue.Hue  = 2067;
                glue.MoveToWorld(player.Location, player.Map);

                SpecialAbilities.EntangleSpecialAbility(1.0, null, player, 1.0, 30, -1, true, "", "", "-1");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Your feet have been glued to the floor!", player.NetState);
                }
                break;

            case 6:
                damageAmount = (double)player.HitsMax * .5;
                SpecialAbilities.FlamestrikeSpecialAbility(1.0, null, player, damageAmount, 1, -1, true, "", "Spicy candy! So hot!");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Spicy candy! So hot!", player.NetState);
                }
                break;

            case 7:
                damageAmount = (double)player.HitsMax * .5;

                Direction direction = Utility.GetDirection(creature.Location, player.Location);

                int windItemId = 8099;

                switch (direction)
                {
                case Direction.North: windItemId = 8099; break;

                case Direction.Right: windItemId = 8099; break;

                case Direction.West: windItemId = 8104; break;

                case Direction.Up: windItemId = 8104; break;

                case Direction.East: windItemId = 8109; break;

                case Direction.Down: windItemId = 8109; break;

                case Direction.South: windItemId = 8114; break;

                case Direction.Left: windItemId = 8114; break;
                }

                creature.MovingEffect(player, windItemId, 5, 1, false, false, 0, 0);
                player.PlaySound(0x64C);

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "This candy totally blows...", player.NetState);
                }

                SpecialAbilities.KnockbackSpecialAbility(1.0, creature.Location, null, player, damageAmount, 20, -1, "", "");
                break;

            case 8:
                SpecialAbilities.PetrifySpecialAbility(1.0, null, player, 1.0, 15, -1, true, "", "", "-1");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Rock candy!", player.NetState);
                }
                break;

            case 9:
                if (player.Poison == null)
                {
                    Poison poison = Poison.GetPoison(2);
                    player.ApplyPoison(null, poison);
                }

                player.FixedEffect(0x372A, 10, 30, 2208, 0);
                Effects.PlaySound(player.Location, player.Map, 0x22F);

                int residueCount = Utility.RandomMinMax(3, 4);

                for (int a = 0; a < residueCount; a++)
                {
                    Point3D poisonPoint = new Point3D(player.Location.X + Utility.RandomList(-1, 1), player.Location.Y + Utility.RandomList(-1, 1), player.Location.Z);
                    SpellHelper.AdjustField(ref poisonPoint, player.Map, 12, false);

                    TimedStatic poisonResidue = new TimedStatic(Utility.RandomList(0x1645, 0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F), 5);
                    poisonResidue.Hue  = 2208;
                    poisonResidue.Name = "poison residue";
                    poisonResidue.MoveToWorld(poisonPoint, player.Map);
                }

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Poisoned candy! Who would do such a thing!", player.NetState);
                }
                break;

            case 10:
                bool canPolymorph = true;

                if (!player.CanBeginAction(typeof(PolymorphSpell)))
                {
                    canPolymorph = false;
                }

                if (!player.CanBeginAction(typeof(PolymorphPotion)))
                {
                    canPolymorph = false;
                }

                if (!player.CanBeginAction(typeof(IncognitoSpell)) || player.IsBodyMod)
                {
                    canPolymorph = false;
                }

                if (DisguiseTimers.IsDisguised(player))
                {
                    canPolymorph = false;
                }

                if (KinPaint.IsWearingKinPaint(player))
                {
                    canPolymorph = false;
                }

                if (!canPolymorph)
                {
                    player.SendMessage("Hmm...Nothing seems to have happened. Or did it?");
                    return;
                }

                player.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head);

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

                m_PossibleBodyValues.Add(3);     //Zombie
                m_PossibleBodyValues.Add(50);    //Skeleton
                m_PossibleBodyValues.Add(56);    //Skeleton
                m_PossibleBodyValues.Add(153);   //Ghoul
                m_PossibleBodyValues.Add(302);   //Skeletal Critter
                m_PossibleBodyValues.Add(309);   //Patchwork Skeleton
                m_PossibleBodyValues.Add(148);   //Necromancer
                m_PossibleBodyValues.Add(793);   //Skeletal Horse
                m_PossibleBodyValues.Add(317);   //Giant Bat
                m_PossibleBodyValues.Add(252);   //Corpse Bride
                m_PossibleBodyValues.Add(57);    //Skeletal Knight
                m_PossibleBodyValues.Add(116);   //Nightmare
                m_PossibleBodyValues.Add(24);    //Lich
                m_PossibleBodyValues.Add(154);   //Mummy
                m_PossibleBodyValues.Add(104);   //Skeletal Drake
                m_PossibleBodyValues.Add(740);   //Skeletal Drake
                m_PossibleBodyValues.Add(308);   //Giant Skeleton

                player.BodyMod = m_PossibleBodyValues[Utility.RandomMinMax(0, m_PossibleBodyValues.Count - 1)];
                player.HueMod  = 0;

                player.PlaySound(0x3BD);

                BaseArmor.ValidateMobile(player);

                duration = 120;

                player.BeginAction(typeof(PolymorphPotion));
                Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate
                {
                    if (player == null)
                    {
                        return;
                    }

                    player.EndAction(typeof(PolymorphPotion));
                });

                player.BeginAction(typeof(PolymorphSpell));
                Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate
                {
                    if (player == null)
                    {
                        return;
                    }

                    player.BodyMod = 0;
                    player.HueMod  = -1;
                    player.EndAction(typeof(PolymorphSpell));

                    BaseArmor.ValidateMobile(player);
                });

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Hmm, something tastes odd about this candy.", player.NetState);
                }
                break;

            case 11:
                Item innerLegs = player.FindItemOnLayer(Layer.InnerLegs);
                Item outerLegs = player.FindItemOnLayer(Layer.OuterLegs);
                Item pants     = player.FindItemOnLayer(Layer.Pants);

                int layersFound = 0;

                if (innerLegs != null)
                {
                    player.Backpack.DropItem(innerLegs);
                    layersFound++;
                }

                if (outerLegs != null)
                {
                    player.Backpack.DropItem(outerLegs);
                    layersFound++;
                }

                if (pants != null)
                {
                    player.Backpack.DropItem(pants);
                    layersFound++;
                }

                if (layersFound > 0)
                {
                    player.PlaySound(0x503);

                    if (player.NetState != null)
                    {
                        player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Your pants appear to have fallen down. How embarrassing!", player.NetState);
                    }
                }

                else
                {
                    player.SendMessage("Nothing seems to have happened. Or did it?...");
                }
                break;

            case 12:

                player.FixedParticles(0x374A, 10, 15, 5028, 2604, 0, EffectLayer.Waist);
                player.PlaySound(0x5DA);

                player.Animate(22, 6, 1, true, false, 0);     //Fall Forward

                player.Stam = 0;

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "You feel drowsy and fall on your face!", player.NetState);
                }
                break;

            case 13:
                player.BAC = 60;
                player.PlaySound(0x5A9);

                BaseBeverage.CheckHeaveTimer(player);

                player.Animate(34, 5, 1, true, false, 0);

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "What was in that candy??? *hic*", player.NetState);
                }
                break;

            case 14:
                Warp(creature, player);
                break;

            case 15:
                Warp(creature, player);
                break;
            }
        }
Beispiel #19
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 #20
0
        public void Swallow()
        {
            if (!SpecialAbilities.Exists(this))
            {
                return;
            }
            if (!SpecialAbilities.Exists(Combatant))
            {
                return;
            }
            if (m_SwallowedMobiles.Contains(Combatant))
            {
                return;
            }

            Mobile mobileTarget = Combatant;

            Combatant = null;

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

            Direction direction = Utility.GetDirection(Location, mobileTarget.Location);

            PlaySound(0x5DA);

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

            m_NextSwallowAllowed = DateTime.UtcNow + NextSwallowDelay + TimeSpan.FromSeconds(totalDelay);
            m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay);

            AbilityInProgress = true;

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

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

                Animate(11, 15, 1, true, false, 0);
                PlaySound(0x5DA);

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

                int maxExtraSwallowDuration = 10;
                double swallowDuration      = 10 + (Math.Ceiling((double)maxExtraSwallowDuration * spawnPercent));

                PublicOverheadMessage(MessageType.Regular, 0, false, "*swallows " + mobileTarget.Name + "*");
                m_SwallowedMobiles.Add(mobileTarget);

                mobileTarget.Location = Location;

                double extraDamage = DamageMax;
                double damage      = (double)DamageMin + (extraDamage * spawnPercent);

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

                if (mobileTarget is PlayerMobile)
                {
                    damage *= .5;
                }

                SpecialAbilities.BleedSpecialAbility(1.0, this, mobileTarget, damage, swallowDuration, 0, true, "", "", "-1");
                SpecialAbilities.HinderSpecialAbility(1.0, null, mobileTarget, 1.0, swallowDuration, false, -1, false, "", "You have been 'engulfed' and cannot move or speak!", "-1");

                mobileTarget.Squelched = true;
                mobileTarget.Hidden    = true;

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

                    mobileTarget.Squelched = false;
                    mobileTarget.Hidden    = false;

                    if (!SpecialAbilities.Exists(this))
                    {
                        return;
                    }

                    if (m_SwallowedMobiles.Contains(mobileTarget))
                    {
                        m_SwallowedMobiles.Remove(mobileTarget);
                    }

                    if (!mobileTarget.Alive)
                    {
                        return;
                    }

                    PlaySound(0x56C);

                    PublicOverheadMessage(MessageType.Regular, 0, false, "*spits out " + mobileTarget.Name + "*");

                    int knockbackDistance = 10;
                    damage = 10;

                    SpecialAbilities.KnockbackSpecialAbility(1.0, Location, this, mobileTarget, damage, knockbackDistance, -1, "", "Maggot spits you out!");

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

                        Point3D newPoint = new Point3D(mobileTarget.Location.X + Utility.RandomList(-1, 1), mobileTarget.Location.Y + Utility.RandomList(-1, 1), mobileTarget.Location.Z);
                        SpellHelper.AdjustField(ref newPoint, mobileTarget.Map, 12, false);

                        ichor.MoveToWorld(newPoint, mobileTarget.Map);
                    }
                });
            });
        }
Beispiel #21
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            SpecialAbilities.BleedSpecialAbility(.3, this, defender, DamageMax, 8.0, -1, true, "", "Their attack causes you to bleed!", "-1");
        }
Beispiel #22
0
        protected override bool OnMove(Direction d)
        {
            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            Effects.PlaySound(Location, Map, Utility.RandomList(0x12E, 0x12D));

            if (m_IsCharging)
            {
                IPooledEnumerable nearbyMobiles = Map.GetMobilesInRange(Location, 1);

                Queue m_Queue = new Queue();

                foreach (Mobile mobile in nearbyMobiles)
                {
                    if (!mobile.CanBeDamaged() || !mobile.Alive || mobile.AccessLevel > AccessLevel.Player || m_Trampled.Contains(mobile))
                    {
                        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 (Combatant != null && Combatant == mobile)
                    {
                        validTarget = false;
                    }

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

                        m_Queue.Enqueue(mobile);
                    }
                }

                nearbyMobiles.Free();

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

                    Effects.PlaySound(Location, Map, Utility.RandomList(0x3BB, 0x3BA, 0x3B9));
                    Effects.PlaySound(mobile.Location, mobile.Map, mobile.GetHurtSound());

                    double damage = DamageMin;

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

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

                    int bloodCount = 1 + (int)(Math.Ceiling(3 * spawnPercent));

                    for (int a = 0; a < bloodCount; a++)
                    {
                        new Blood().MoveToWorld(new Point3D(Combatant.Location.X + Utility.RandomList(-2, 2), Combatant.Location.Y + Utility.RandomList(-2, 2), Combatant.Location.Z), Map);
                    }

                    new Blood().MoveToWorld(Combatant.Location, Combatant.Map);
                    SpecialAbilities.BleedSpecialAbility(1.0, this, Combatant, damage, 10.0, -1, true, "", "The reaver's lance impales you, causing you to bleed!", "-1");
                    AOS.Damage(Combatant, (int)damage, 100, 0, 0, 0, 0);

                    if (mobile is PlayerMobile)
                    {
                        mobile.Animate(21, 6, 1, true, false, 0);
                    }

                    else if (mobile is BaseCreature)
                    {
                        BaseCreature bc_Creature = mobile as BaseCreature;

                        if (bc_Creature.IsHighSeasBodyType)
                        {
                            bc_Creature.Animate(2, 14, 1, true, false, 0);
                        }

                        else if (bc_Creature.Body != null)
                        {
                            if (bc_Creature.Body.IsHuman)
                            {
                                bc_Creature.Animate(21, 6, 1, true, false, 0);
                            }

                            else
                            {
                                bc_Creature.Animate(2, 4, 1, true, false, 0);
                            }
                        }
                    }

                    SpecialAbilities.HinderSpecialAbility(1.0, this, mobile, 1.0, 2, false, -1, false, "", "You have been trampled and can't move!", "-1");
                }
            }

            CheckChargeResolved();

            return(base.OnMove(d));
        }
Beispiel #23
0
        public void CheckChargeResolved()
        {
            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            if (m_IsCharging)
            {
                bool chargeComplete = false;
                bool chargeFail     = false;

                if (Combatant == null || m_ChargeTarget == null)
                {
                    chargeFail = true;
                }

                else if (Combatant != m_ChargeTarget || !Combatant.Alive || Combatant.Hidden || GetDistanceToSqrt(Combatant.Location) > 24 || !InLOS(Combatant) || DateTime.UtcNow > m_ChargeTimeout)
                {
                    chargeFail = true;
                }

                if (chargeFail)
                {
                    m_IsCharging   = false;
                    m_ChargeTarget = null;

                    ActiveSpeed  = 0.4;
                    PassiveSpeed = 0.4;
                    CurrentSpeed = 0.4;
                }

                else
                {
                    if (GetDistanceToSqrt(Combatant) <= 1.5)
                    {
                        m_IsCharging   = false;
                        m_ChargeTarget = null;

                        ActiveSpeed  = 0.4;
                        PassiveSpeed = 0.4;
                        CurrentSpeed = 0.4;

                        m_NextChargeAllowed  = DateTime.UtcNow + TimeSpan.FromSeconds(30 - (20 * spawnPercent));
                        m_NextAbilityAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(10 - (8 * spawnPercent));

                        PublicOverheadMessage(MessageType.Regular, 0, false, "*tramples opponent*");

                        DictCombatTargetingWeight[CombatTargetingWeight.CurrentCombatant] = 4;

                        Effects.PlaySound(Location, Map, 0x59C);
                        Effects.PlaySound(Combatant.Location, Combatant.Map, Combatant.GetHurtSound());

                        double damage = DamageMax;

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

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

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

                        for (int a = 0; a < bloodCount; a++)
                        {
                            new Blood().MoveToWorld(new Point3D(Combatant.Location.X + Utility.RandomList(-2, 2), Combatant.Location.Y + Utility.RandomList(-2, 2), Combatant.Location.Z), Map);
                        }

                        new Blood().MoveToWorld(Combatant.Location, Combatant.Map);
                        SpecialAbilities.BleedSpecialAbility(1.0, this, Combatant, damage, 10.0, -1, true, "", "The reaver's lance impales you, causing you to bleed!", "-1");
                        AOS.Damage(Combatant, (int)damage, 100, 0, 0, 0, 0);

                        if (Combatant is PlayerMobile)
                        {
                            Combatant.Animate(21, 6, 1, true, false, 0);
                        }

                        else if (Combatant is BaseCreature)
                        {
                            BaseCreature bc_Combatant = Combatant as BaseCreature;

                            if (bc_Combatant.IsHighSeasBodyType)
                            {
                                bc_Combatant.Animate(2, 14, 1, true, false, 0);
                            }

                            else if (bc_Combatant.Body != null)
                            {
                                if (bc_Combatant.Body.IsHuman)
                                {
                                    bc_Combatant.Animate(21, 6, 1, true, false, 0);
                                }

                                else
                                {
                                    bc_Combatant.Animate(2, 4, 1, true, false, 0);
                                }
                            }
                        }

                        SpecialAbilities.HinderSpecialAbility(1.0, this, Combatant, 1.0, 3, false, -1, false, "", "You have been trampled and can't move!", "-1");
                    }
                }
            }

            else
            {
                DictCombatTargetingWeight[CombatTargetingWeight.CurrentCombatant] = 4;

                m_ChargeTarget = null;

                ActiveSpeed  = 0.4;
                PassiveSpeed = 0.4;
                CurrentSpeed = 0.4;
            }
        }
Beispiel #24
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() <= .15)
            {
                if (defender == null)
                {
                    return;
                }
                if (defender.Deleted || !defender.Alive)
                {
                    return;
                }

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

                double belowDuration = 15;

                double damage = 30;

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

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, damage, 30, -1, true, "", "", "-1");
                SpecialAbilities.HinderSpecialAbility(1.0, null, defender, 1.0, belowDuration, false, -1, false, "", "You have been 'taken below' and cannot move or speak!", "-1");

                Squelched = true;

                defender.Squelched = true;
                defender.Hidden    = true;

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

                    defender.Squelched = false;
                    defender.Hidden    = false;
                });

                Blessed = true;

                Effects.PlaySound(location, defender.Map, 0x246); //0x0FB

                PublicOverheadMessage(MessageType.Regular, 0, false, "*takes them down below...*");
                SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, belowDuration, false, -1, false, "", "", "-1");

                Effects.SendLocationParticles(EffectItem.Create(location, defender.Map, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 30, 2051, 0, 5029, 0);

                TimedStatic floorHole = new TimedStatic(7025, belowDuration + 1);
                floorHole.Name = "pit to below";
                floorHole.MoveToWorld(location, defender.Map);

                for (int a = 0; a < 6; a++)
                {
                    TimedStatic pitPlasm = new TimedStatic(Utility.RandomList(4650, 4651, 4653, 4654, 4655), belowDuration - 1);
                    pitPlasm.Name = "pit plasm";
                    pitPlasm.Hue  = 2052;

                    Point3D pitPlasmLocation = new Point3D(location.X + Utility.RandomList(-2, 2), location.Y + Utility.RandomList(-2, 2), location.Z);
                    SpellHelper.AdjustField(ref pitPlasmLocation, defender.Map, 12, false);

                    pitPlasm.MoveToWorld(pitPlasmLocation, defender.Map);
                }

                IEntity pitLocationEntity = new Entity(Serial.Zero, new Point3D(defender.X, defender.Y, defender.Z), defender.Map);
                Effects.SendLocationParticles(pitLocationEntity, 0x3709, 10, 60, 2053, 0, 5052, 0);

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

                    MoveToWorld(location, map);

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

                            Z--;
                        });
                    }

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

                        Blessed = false;
                        Delete();
                    });
                });
            }
        }
Beispiel #25
0
        public void SetTimedEgg(Point3D location, Map map, EggType eggType)
        {
            int eggHue = Hue = Utility.RandomMinMax(2, 362);

            DecoyEasterEgg decoyEasterEgg = new DecoyEasterEgg();

            decoyEasterEgg.Hue = eggHue;
            decoyEasterEgg.MoveToWorld(location, map);

            int delayTime = Utility.RandomMinMax(1, 10);

            Effects.SendLocationParticles(EffectItem.Create(location, map, TimeSpan.FromSeconds(0.25)), 0x9B5, 10, delayTime * 25, eggHue, 0, 5029, 0);

            Timer.DelayCall(TimeSpan.FromSeconds(delayTime), delegate
            {
                if (decoyEasterEgg != null)
                {
                    if (!decoyEasterEgg.Deleted)
                    {
                        if (decoyEasterEgg.ParentEntity is PlayerMobile)
                        {
                            PlayerMobile pm_Owner = decoyEasterEgg.ParentEntity as PlayerMobile;

                            pm_Owner.SendMessage("The eggs you gathered appear to be some sort of decoy, and they crumble in your backpack...");
                            pm_Owner.SendSound(0x134);
                        }

                        decoyEasterEgg.Delete();
                    }
                }

                int radius = 2;

                int effectSound = 0;

                switch (eggType)
                {
                case EggType.Explosive: effectSound = 0x359; break;

                case EggType.Entangle: effectSound = 0x211; break;

                case EggType.Poison: effectSound = 0x22F; break;

                case EggType.Ice: effectSound = 0x64F; break;

                case EggType.Banish: effectSound = 0x655; break;

                case EggType.Gust: effectSound = 0x64C; break;

                case EggType.Bloody: effectSound = 0x62B; break;
                }

                Effects.PlaySound(location, map, effectSound);

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

                m_ExplosionLocations.Add(location, 0);

                for (int a = 1; a < radius + 1; a++)
                {
                    m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y - a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X, location.Y - a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y - a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y + a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X, location.Y + a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y + a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y, location.Z), a);
                }

                foreach (KeyValuePair <Point3D, double> pair in m_ExplosionLocations)
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(pair.Value * .25), delegate
                    {
                        switch (eggType)
                        {
                        case EggType.Explosive:
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.5)), 0x36BD, 20, 10, 5044);
                            break;

                        case EggType.Entangle:
                            radius = 3;
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.5)), 0x3973, 10, 50, 5029);
                            break;

                        case EggType.Poison:
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.5)), 0x372A, 10, 20, 59, 0, 5029, 0);
                            break;

                        case EggType.Ice:
                            radius = 3;
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 20, 1153, 0, 5029, 0);
                            break;

                        case EggType.Banish:
                            radius = 3;
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), 0x3763, 10, 20, 2199, 0, 5029, 0);
                            break;

                        case EggType.Gust:
                            radius = 4;
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), 0x1FB2, 10, 20, 0, 0, 5029, 0);
                            break;

                        case EggType.Bloody:
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), Utility.RandomList(0x1645, 0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F), 10, 20, 0, 0, 5029, 0);
                            break;
                        }
                    });
                }

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

                IPooledEnumerable eable = map.GetMobilesInRange(location, radius);

                foreach (Mobile mobile in eable)
                {
                    if (mobile is EasterBunny)
                    {
                        continue;
                    }

                    if (!mobile.CanBeDamaged())
                    {
                        continue;
                    }

                    m_TargetsHit.Add(mobile);
                }

                eable.Free();

                int targets = m_TargetsHit.Count;

                for (int a = 0; a < targets; a++)
                {
                    double damage = 0;

                    Mobile mobile = m_TargetsHit[a];

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

                    switch (eggType)
                    {
                    case EggType.Explosive:
                        damage = (double)(Utility.RandomMinMax(20, 40));

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

                        AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0);
                        break;

                    case EggType.Entangle:
                        if (mobile != null)
                        {
                            SpecialAbilities.EntangleSpecialAbility(1.0, null, mobile, 1, 10, -1, true, "", "You are held in place!", "-1");
                        }
                        break;

                    case EggType.Poison:
                        Poison poison = Poison.GetPoison(Utility.RandomMinMax(2, 4));
                        mobile.ApplyPoison(mobile, poison);
                        break;

                    case EggType.Ice:
                        damage = (double)(Utility.RandomMinMax(10, 20));

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

                        SpecialAbilities.CrippleSpecialAbility(1.0, null, mobile, .5, 10, -1, true, "", "A blast of ice has slowed your actions!", "-1");

                        AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0);
                        break;

                    case EggType.Gust:
                        SpecialAbilities.KnockbackSpecialAbility(1.0, Location, null, mobile, 40, 8, -1, "", "A gust of wind knocks you off your feet!");
                        break;

                    case EggType.Banish:
                        SpecialAbilities.HinderSpecialAbility(1.0, null, mobile, 1.0, 5, false, -1, false, "", "You cannot move or speak!", "-1");

                        mobile.Squelched = true;
                        mobile.Hidden    = true;

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

                            mobile.Squelched = false;
                            mobile.Hidden    = false;
                        });
                        break;

                    case EggType.Bloody:
                        SpecialAbilities.BleedSpecialAbility(1.0, null, mobile, 40, 8.0, 0x44D, true, "", "You begin to bleed!", "-1");
                        break;
                    }
                }
            });
        }
Beispiel #26
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            SpecialAbilities.BleedSpecialAbility(0.2, this, defender, DamageMax, 8.0, Utility.RandomList(0x5D9, 0x5DB), true, "", "Their attack causes you to bleed!", "-1");
        }
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() <= .2)
            {
                if (defender == null)
                {
                    return;
                }
                if (defender.Deleted || !defender.Alive)
                {
                    return;
                }

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

                double belowDuration = 15;

                double damage = 45;

                PublicOverheadMessage(MessageType.Regular, 0, false, "*engulfs target*");
                m_EngulfedMobiles.Add(defender);

                PlaySound(0x573);

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

                    Point3D newPoint = new Point3D(defender.Location.X + Utility.RandomList(-1, 1), defender.Location.Y + Utility.RandomList(-1, 1), defender.Location.Z);
                    SpellHelper.AdjustField(ref newPoint, defender.Map, 12, false);

                    ichor.MoveToWorld(newPoint, defender.Map);
                }

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

                defender.Location = Location;

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, damage, 30, -1, true, "", "", "-1");
                SpecialAbilities.HinderSpecialAbility(1.0, null, defender, 1.0, belowDuration, false, -1, false, "", "You have been 'engulfed' and cannot move or speak!", "-1");

                defender.Squelched = true;
                defender.Hidden    = true;

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

                    defender.Squelched = false;
                    defender.Hidden    = false;

                    if (!UOACZSystem.IsUOACZValidMobile(defender))
                    {
                        return;
                    }

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

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

                        Point3D newPoint = new Point3D(defender.Location.X + Utility.RandomList(-1, 1), defender.Location.Y + Utility.RandomList(-1, 1), defender.Location.Z);
                        SpellHelper.AdjustField(ref newPoint, defender.Map, 12, false);

                        ichor.MoveToWorld(newPoint, defender.Map);
                    }

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

                    if (m_EngulfedMobiles.Contains(defender))
                    {
                        m_EngulfedMobiles.Remove(defender);
                    }
                });
            }
        }
Beispiel #28
0
        public static bool DoMeleeBleedAoE(BaseCreature creature)
        {
            if (creature == null)
            {
                return(false);
            }

            double swingCount    = 12;
            double swingInterval = .3;
            double preSwingDelay = .1;

            double hitChance = .25;

            double actionsCooldown = (swingCount * swingInterval) + (swingCount * preSwingDelay) + 1;

            if (creature.AIObject != null)
            {
                creature.AIObject.NextMove              = DateTime.UtcNow + TimeSpan.FromSeconds(actionsCooldown);
                creature.LastSwingTime                  = creature.LastSwingTime + TimeSpan.FromSeconds(actionsCooldown);
                creature.NextSpellTime                  = creature.NextSpellTime + TimeSpan.FromSeconds(actionsCooldown);
                creature.NextCombatHealActionAllowed    = creature.NextCombatHealActionAllowed + TimeSpan.FromSeconds(actionsCooldown);
                creature.NextCombatSpecialActionAllowed = creature.NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(actionsCooldown);
                creature.NextCombatEpicActionAllowed    = creature.NextCombatEpicActionAllowed + TimeSpan.FromSeconds(actionsCooldown);
            }

            for (int a = 0; a < swingCount; a++)
            {
                double delay = (a * swingInterval) + (a * preSwingDelay);

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

                    if (!creature.Alive || creature.Paralyzed || creature.Frozen)
                    {
                        return;
                    }

                    Effects.PlaySound(creature.Location, creature.Map, 0x51F);

                    int newDirectionValue = (int)creature.Direction;
                    newDirectionValue    += Utility.RandomList(-3, -4, -5, 3, 4, 5);

                    if (newDirectionValue > 7)
                    {
                        newDirectionValue = 0 + (newDirectionValue - 8);
                    }
                    else if (newDirectionValue < 0)
                    {
                        newDirectionValue = 8 + newDirectionValue;
                    }

                    creature.Direction = (Direction)(newDirectionValue);

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

                        if (!creature.Alive || creature.Paralyzed || creature.Frozen)
                        {
                            return;
                        }

                        BaseWeapon weapon = creature.Weapon as BaseWeapon;

                        if (weapon != null)
                        {
                            weapon.PlaySwingAnimation(creature);

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

                            foreach (object obj in eable)
                            {
                                if (obj is Mobile)
                                {
                                    Mobile mobile = obj as Mobile;

                                    if (creature == null || mobile == null)
                                    {
                                        continue;
                                    }

                                    if (!creature.Alive || !mobile.Alive)
                                    {
                                        continue;
                                    }

                                    if (creature == mobile)
                                    {
                                        continue;
                                    }

                                    if (creature.CanBeHarmful(mobile))
                                    {
                                        BaseCreature bc_CreatureTarget = mobile as BaseCreature;

                                        bool validCreatureTarget = false;

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

                                        //Valid Targets
                                        if (mobile == creature.Combatant || mobile is PlayerMobile || validCreatureTarget)
                                        {
                                            if (a == 0 || Utility.RandomDouble() < hitChance)
                                            {
                                                int damage = Utility.RandomMinMax(creature.DamageMin, creature.DamageMax);

                                                if (damage < 1)
                                                {
                                                    damage = 1;
                                                }

                                                creature.DoHarmful(mobile);

                                                BaseCreature bc_Mobile = mobile as BaseCreature;
                                                PlayerMobile pm_Mobile = mobile as PlayerMobile;

                                                double bleedValue = bc_Mobile.GetSpecialAbilityEntryValue(SpecialAbilityEffect.Bleed);

                                                if (bleedValue == 0)
                                                {
                                                    SpecialAbilities.BleedSpecialAbility(1.0, creature, mobile, creature.DamageMax, 8.0, -1, true, "", "Their attack causes you to bleed!", "-1");
                                                }

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

                            eable.Free();
                        }
                    });
                });
            }

            return(true);
        }
Beispiel #29
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            SpecialAbilities.BleedSpecialAbility(.2, this, defender, DamageMax, 8.0, -1, true, "", "The beast gores you with it's horns, causing you to bleed!", "-1");
        }