示例#1
0
        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;
            }
        }