示例#1
0
        public override void Drink(Mobile from)
        {
            if (this != null && ParentEntity != from.Backpack)
            {
                from.SendMessage("The potion must be in your pack to drink it.");
            }

            else
            {
                if (!from.CanBeginAction(typeof(IncognitoSpell)))
                {
                    from.SendMessage("You are already under the influence of an incognito effect.");
                    return;
                }

                if (DisguiseTimers.IsDisguised(from))
                {
                    from.SendMessage("You cannot can drink that while being disguised.");
                }

                if (KinPaint.IsWearingKinPaint(from))
                {
                    from.SendMessage("You cannot can drink that while wearing kin paint.");
                    return;
                }

                if (!from.CanBeginAction(typeof(PolymorphSpell)) || from.IsBodyMod)
                {
                    from.SendMessage("You cannot can drink that while under the effect of a modification spell, ability, or item.");
                    return;
                }

                from.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head);
                from.PlaySound(0x3BD);
                from.Animate(34, 5, 1, true, false, 0);

                BasePotion.PlayDrinkEffect(from);

                from.HueMod = from.Race.RandomSkinHue();

                from.NameMod = from.Female ? NameList.RandomName("female") : NameList.RandomName("male");

                PlayerMobile pm = from as PlayerMobile;

                if (pm != null && pm.Race != null)
                {
                    pm.SetHairMods(pm.Race.RandomHair(pm.Female), pm.Race.RandomFacialHair(pm.Female));
                    pm.HairHue       = pm.Race.RandomHairHue();
                    pm.FacialHairHue = pm.Race.RandomHairHue();
                }

                BaseArmor.ValidateMobile(from);

                from.BeginAction(typeof(IncognitoSpell));

                Timer.DelayCall(TimeSpan.FromSeconds(300), delegate { ChangeBack(from); });

                Consume();
            }
        }
示例#2
0
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile player = from as PlayerMobile;

            if (player == null)
            {
                return;
            }

            if (IsChildOf(from.Backpack))
            {
                if (!from.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
                {
                    from.SendLocalizedMessage(501698); // You cannot disguise yourself while incognitoed.
                }
                else if (!from.CanBeginAction(typeof(Spells.Seventh.PolymorphSpell)))
                {
                    from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
                }
                else if (TransformationSpellHelper.UnderTransformation(from))
                {
                    from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
                }
                else if (KinPaint.IsWearingKinPaint(from))
                {
                    from.SendMessage("You already have a kin paint applied.");
                }

                else
                {
                    player.KinPaintHue        = PaintHue;
                    player.KinPaintExpiration = DateTime.UtcNow + TimeSpan.FromDays(14);

                    player.HueMod = PaintHue;

                    from.PlaySound(0x5AC);
                    from.SendMessage("You apply the kin paint to yourself. The paint will last for two weeks or may be removed at any time with an oil cloth.");

                    Consume();
                }
            }

            else
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
        }
示例#3
0
        public override void Drink(Mobile from)
        {
            PlayerMobile player = from as PlayerMobile;

            if (player == null)
            {
                return;
            }

            if (this != null && ParentEntity != from.Backpack)
            {
                from.SendMessage("The potion must be in your pack to drink it.");
            }

            else
            {
                if (!from.CanBeginAction(typeof(PolymorphSpell)))
                {
                    from.SendMessage("You are already under the influence of an polymorph effect.");
                    return;
                }

                if (player.RecentlyInPlayerCombat)
                {
                    from.SendMessage("You have been in combat with another player too recently to drink this.");
                    return;
                }

                if (DisguiseTimers.IsDisguised(from))
                {
                    from.SendMessage("You cannot can drink that while being disguised.");
                }

                if (KinPaint.IsWearingKinPaint(from))
                {
                    from.SendMessage("You cannot can drink that while wearing kin paint.");
                    return;
                }

                if (!from.CanBeginAction(typeof(IncognitoSpell)) || from.IsBodyMod)
                {
                    from.SendMessage("You cannot can drink that while under the effect of a modification spell, ability, or item.");
                    return;
                }

                from.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head);
                from.PlaySound(0x3BD);
                from.Animate(34, 5, 1, true, false, 0);

                BasePotion.PlayDrinkEffect(from);

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

                m_PossibleBodyValues.Add(1);   //Ogre
                m_PossibleBodyValues.Add(2);   //Ettin
                m_PossibleBodyValues.Add(3);   //Zombie
                m_PossibleBodyValues.Add(4);   //Gargoyle
                m_PossibleBodyValues.Add(5);   //Orc Captain
                m_PossibleBodyValues.Add(6);   //Corpser
                m_PossibleBodyValues.Add(9);   //Daemon
                m_PossibleBodyValues.Add(17);  //Orc
                m_PossibleBodyValues.Add(22);  //Gazer
                m_PossibleBodyValues.Add(26);  //Ghost
                m_PossibleBodyValues.Add(30);  //Harpy
                m_PossibleBodyValues.Add(31);  //Headless
                m_PossibleBodyValues.Add(35);  //Lizardman
                m_PossibleBodyValues.Add(39);  //Mongbat
                m_PossibleBodyValues.Add(45);  //Ratman
                m_PossibleBodyValues.Add(57);  //Skeleton
                m_PossibleBodyValues.Add(53);  //Troll
                m_PossibleBodyValues.Add(70);  //Terathan Warrior
                m_PossibleBodyValues.Add(71);  //Terathan Drone
                m_PossibleBodyValues.Add(72);  //Terathan Queen
                m_PossibleBodyValues.Add(75);  //Cyclops
                m_PossibleBodyValues.Add(82);  //Lich
                m_PossibleBodyValues.Add(85);  //Ophidian Mage
                m_PossibleBodyValues.Add(86);  //Ophidian Warrior
                m_PossibleBodyValues.Add(87);  //Ophidian Queen
                m_PossibleBodyValues.Add(154); //Mummy
                m_PossibleBodyValues.Add(285); //Treestalk
                m_PossibleBodyValues.Add(301); //Ent
                m_PossibleBodyValues.Add(303); //Devourer
                m_PossibleBodyValues.Add(304); //Flesh Golem
                m_PossibleBodyValues.Add(305); //Ore Golem
                m_PossibleBodyValues.Add(306); //Hook Horror
                m_PossibleBodyValues.Add(309); //Patchwork Skeleton
                m_PossibleBodyValues.Add(312); //Myconid

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

                BaseArmor.ValidateMobile(from);

                int duration = 300;

                from.BeginAction(typeof(PolymorphPotion));
                Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate
                {
                    from.EndAction(typeof(PolymorphPotion));
                });

                from.BeginAction(typeof(PolymorphSpell));
                Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate { ChangeBack(from); });

                Consume();
            }
        }