コード例 #1
0
        public override bool OnEquip(Mobile from)
        {
            if (!from.CanBeginAction(typeof(Server.Spells.Seventh.PolymorphSpell)))
            {
                from.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
                return(false);
            }
            else if (TransformationSpellHelper.UnderTransformation(from))
            {
                from.SendMessage("You cannot equip that in your current form.");
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(from))
            {
                from.SendLocalizedMessage(1061631);                   // You can't do that while disguised.
                return(false);
            }

            from.SendMessage("You feel the power of burning life taking over your body!");
            from.SolidHueOverride = 33;

            if (!from.Mounted)                  // Only transform if not mounted..
            {
                from.BodyMod = 15;
                from.FixedParticles(0x375A, 10, 15, 5010, EffectLayer.Waist);
                from.FixedParticles(0x376A, 1, 14, 0x13B5, EffectLayer.Waist);
                from.PlaySound(from.Body.IsFemale ? 0x338 : 0x44A);
            }

            else
            {
                from.SendMessage(1154, "The transformation was incomplete! This form is too hot to ride mounts!!");
            }
            return(true);
        }
コード例 #2
0
        private static void OnLoad()
        {
            Persistence.Deserialize(
                FilePath,
                reader =>
            {
                var version = reader.ReadInt();

                switch (version)
                {
                case 0:
                    {
                        var count = reader.ReadInt();

                        for (var i = 0; i < count; ++i)
                        {
                            var m = reader.ReadMobile();
                            DisguiseTimers.CreateTimer(m, reader.ReadTimeSpan());
                            m.NameMod = reader.ReadString();
                        }
                    }
                    break;
                }
            });
        }
コード例 #3
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();
            }
        }
コード例 #4
0
        public override bool OnEquip(Mobile from)
        {
            if (!from.CanBeginAction(typeof(Server.Spells.Seventh.PolymorphSpell)))
            {
                from.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
                return(false);
            }
            else if (TransformationSpellHelper.UnderTransformation(from))
            {
                from.SendMessage("You cannot equip that in your current form.");
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(from))
            {
                from.SendLocalizedMessage(1061631);                   // You can't do that while disguised.
                return(false);
            }

            from.SolidHueOverride = 0x5555;

            if (!from.Mounted)
            {
                from.BodyMod = 0;
                from.FixedParticles(0x375A, 10, 15, 5010, EffectLayer.Waist);
                from.FixedParticles(0x376A, 1, 14, 0x13B5, EffectLayer.Waist);
                from.PlaySound(from.Body.IsFemale ? 0x338 : 0x44A);
            }

            else
            {
            }
            return(true);
        }
コード例 #5
0
            protected override void OnTick()
            {
                m_Player.NameMod = null;

                if (m_Player is PlayerMobile)
                {
                    ((PlayerMobile)m_Player).SetHairMods(-1, -1);
                }
                DisguiseTimers.RemoveTimer(m_Player);
            }
コード例 #6
0
        public static void RemoveDisguise(Mobile from)
        {
            from.HueMod  = -1;
            from.NameMod = null;
            ((PlayerMobile)from).SavagePaintExpiration = TimeSpan.Zero;

            ((PlayerMobile)from).SetHairMods(-1, -1);

            PolymorphSpell.StopTimer(from);
            IncognitoSpell.StopTimer(from);
            DisguiseTimers.RemoveTimer(from);

            from.EndAction(typeof(PolymorphSpell));
            from.EndAction(typeof(IncognitoSpell));
        }
コード例 #7
0
        private static void OnSave(WorldSaveEventArgs e)
        {
            Persistence.Serialize(
                FilePath,
                writer =>
            {
                writer.Write(0);                         // version

                writer.Write(DisguiseTimers.Timers.Count);

                foreach (var m in DisguiseTimers.Timers.Keys.OfType <Mobile>())
                {
                    writer.Write(m);
                    writer.Write(DisguiseTimers.TimeRemaining(m));
                    writer.Write(m.NameMod);
                }
            });
        }
コード例 #8
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1042561);                   // Please dismount first.
            }
            else if (Factions.Sigil.ExistsOn(from))
            {
                from.SendLocalizedMessage(1010521);                 // You cannot polymorph while you have a Town Sigil
            }
            else if (TransformationSpellHelper.UnderTransformation(from))
            {
                from.SendLocalizedMessage(1061633);                 // You cannot polymorph while in that form.
            }
            else if (DisguiseTimers.IsDisguised(from))
            {
                from.SendLocalizedMessage(502167);                 // You cannot polymorph while disguised.
            }
            else if (from.BodyMod == 183 || from.BodyMod == 184)
            {
                from.SendLocalizedMessage(1042512);                 // You cannot polymorph while wearing body paint
            }
            else
            {
                if (from.BodyMod != 0)
                {
                    from.BodyMod = 0;
                }
                else
                {
                    from.BodyMod = m_BodyMod;
                }

                from.PlaySound(m_TransformSound);
                from.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
            }
        }
コード例 #9
0
ファイル: DisguisePersistance.cs プロジェクト: LordEnigma/UO
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                int count = reader.ReadInt();

                for (int i = 0; i < count; ++i)
                {
                    Mobile m = reader.ReadMobile();
                    DisguiseTimers.CreateTimer(m, reader.ReadTimeSpan());
                    m.NameMod = reader.ReadString();
                }

                break;
            }
            }
        }
コード例 #10
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                // Disguises wear off after 2 hours. : You're looking good.
                m_From.SendLocalizedMessage(m_Used ? 501706 : 501707);
                return;
            }

            var switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            var switched = switches[0];
            var type     = switched % 2;
            var index    = switched / 2;

            var hair = (type == 0);

            var entries = (hair ? m_HairEntries : m_BeardEntries);

            if (index >= 0 && index < entries.Length)
            {
                var entry = entries[index];

                if (entry == null)
                {
                    return;
                }

                if (!m_Kit.ValidateUse(m_From))
                {
                    return;
                }

                if (!hair && (m_From.Female || m_From.Body.IsFemale))
                {
                    return;
                }

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

                if (m_From is PlayerMobile)
                {
                    var pm = (PlayerMobile)m_From;

                    if (hair)
                    {
                        pm.SetHairMods(entry.m_ItemID, -2);
                    }
                    else
                    {
                        pm.SetHairMods(-2, entry.m_ItemID);
                    }
                }

                m_From.SendGump(new DisguiseGump(m_From, m_Kit, hair, true));

                DisguiseTimers.RemoveTimer(m_From);

                DisguiseTimers.CreateTimer(m_From, TimeSpan.FromHours(2.0));
                DisguiseTimers.StartTimer(m_From);

                BuffInfo.AddBuff(m_From, new BuffInfo(BuffIcon.Disguised, 1075821, 1075820, TimeSpan.FromHours(2.0), m_From));
            }
        }
コード例 #11
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();
            }
        }
コード例 #12
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                if (m_Used)
                {
                    m_From.SendLocalizedMessage(501706);                       // Disguises wear off after 2 hours.
                }
                else
                {
                    m_From.SendLocalizedMessage(501707);                       // You're looking good.
                }
                return;
            }

            int[] switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            int switched = switches[0];
            int type     = switched % 2;
            int index    = switched / 2;

            bool hair = type == 0;

            DisguiseEntry[] entries = hair ? m_HairEntries : m_BeardEntries;

            if (index >= 0 && index < entries.Length)
            {
                DisguiseEntry entry = entries[index];

                if (entry == null)
                {
                    return;
                }

                if (!m_Kit.ValidateUse(m_From))
                {
                    return;
                }

                if (!hair && (m_From.Female || m_From.Body.IsFemale))
                {
                    return;
                }

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

                if (m_From is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m_From;

                    if (hair)
                    {
                        pm.SetHairMods(entry.m_ItemID, -2);
                    }
                    else
                    {
                        pm.SetHairMods(-2, entry.m_ItemID);
                    }
                }

                m_From.SendGump(new DisguiseGump(m_From, m_Kit, hair, true));

                DisguiseTimers.RemoveTimer(m_From);

                DisguiseTimers.CreateTimer(m_From, TimeSpan.FromHours(2.0));
                DisguiseTimers.StartTimer(m_From);
            }
        }
コード例 #13
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                if (m_Used)
                {
                    m_From.SendLocalizedMessage(501706);                       // Disguises wear off after 2 hours.
                }
                else
                {
                    m_From.SendLocalizedMessage(501707);                       // You're looking good.
                }
                return;
            }

            string name = info.GetTextEntry(0).Text.Trim();

            name = ValidateName(name);

            int[] switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            int switched = switches[0];
            int type     = switched % 2;
            int index    = switched / 2;

            bool hair = (type == 0);

            DisguiseEntry[] entries = (hair ? m_HairEntries : m_BeardEntries);

            if (index >= 0 && index < entries.Length)
            {
                DisguiseEntry entry = entries[index];

                if (entry == null)
                {
                    return;
                }

                if (!m_Kit.ValidateUse(m_From))
                {
                    return;
                }

                if (!hair && (m_From.Female || m_From.Body.IsFemale))
                {
                    return;
                }

                m_From.NameMod = name;

                if (m_From is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m_From;

                    if (hair)
                    {
                        pm.SetHairMods(entry.m_ItemID, -2);
                    }
                    else
                    {
                        pm.SetHairMods(-2, entry.m_ItemID);
                    }
                }

                DisguiseTimers.RemoveTimer(m_From);

                DisguiseTimers.CreateTimer(m_From, TimeSpan.FromHours(2.0));
                DisguiseTimers.StartTimer(m_From);

                m_Kit.Delete();

                m_From.SendMessage("You put on the disguise and discard the container.");
            }
        }
コード例 #14
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Book.Deleted)
            {
                return;
            }

            if (m_Book.IsChildOf(m_From.Backpack))
            {
                if (info.ButtonID == 1)
                {
                    //m_From.SendMessage( "You are turning to the previous page!" );
                    m_Book.Page--;

                    m_From.SendGump(new DaemonSpellGump((PlayerMobile)m_From, m_Book));
                }
                else if (info.ButtonID == 2)
                {
                    //m_From.SendMessage( "You are turning to the next page!" );
                    m_Book.Page++;

                    m_From.SendGump(new DaemonSpellGump((PlayerMobile)m_From, m_Book));
                }
                else if (info.ButtonID == 3)
                {
                    m_From.SendMessage("You are casting Unholy Gate!");

                    //new UnholyGateSpell(m_From);
                }
                else if (info.ButtonID == 4)                 //DEAMON FORM
                {
                    if ((m_From.BodyMod == 183 || m_From.BodyMod == 184) ||
                        (!m_From.CanBeginAction(typeof(IncognitoSpell)) || m_From.IsBodyMod) ||
                        (DisguiseTimers.IsDisguised(m_From)) ||
                        (!m_From.CanBeginAction(typeof(PolymorphSpell))) ||
                        (Factions.Sigil.ExistsOn(m_From))
                        )
                    {
                        m_From.SendMessage("You cannot obtain demonic power in that form.");
                    }
                    else
                    {
                        m_From.SendMessage("You are casting Daemon Form!");
                        new DaemonFormSpell(m_From);
                    }
                }
                else if (info.ButtonID == 5)
                {
                    m_From.SendMessage("You are casting Psi Explode!");
                }
                else if (info.ButtonID == 6)
                {
                    m_From.SendMessage("You are casting Soul Bleed!");
                }
                else if (info.ButtonID == 7)
                {
                    m_From.SendMessage("You are casting Possession!");
                }
                else if (info.ButtonID == 8)
                {
                    m_From.SendMessage("You are casting Mana Sheild!");
                }
                else if (info.ButtonID == 9)                 //SHADOW WALK
                {
                    if ((m_From.BodyMod == 183 || m_From.BodyMod == 184) ||
                        (!m_From.CanBeginAction(typeof(IncognitoSpell)) || m_From.IsBodyMod) ||
                        (DisguiseTimers.IsDisguised(m_From)) ||
                        (!m_From.CanBeginAction(typeof(PolymorphSpell))) ||
                        (Factions.Sigil.ExistsOn(m_From))
                        )
                    {
                        m_From.SendMessage("You cannot cast this spell in your current form!");
                    }
                    else
                    {
                        m_From.SendMessage("You are casting Shadow Walk!");

                        new ShadowWalkSpell(m_From);
                    }
                }
                else if (info.ButtonID == 10)                 //LAY AMBUSH
                {
                    m_From.SendMessage("You are casting Lay Ambush!");

                    m_From.Target = new LayAmbushTarget(m_From, m_Book);
                }
                else if (info.ButtonID == 11)                 //BONE WALL
                {
                    m_From.SendMessage("You are casting Bone Wall!");

                    m_From.Target = new BoneWallTarget(m_From, m_Book);
                }
                else if (info.ButtonID == 12)                 //IMPERSONATE
                {
                    if ((m_From.BodyMod == 183 || m_From.BodyMod == 184) ||
                        (!m_From.CanBeginAction(typeof(IncognitoSpell)) || m_From.IsBodyMod) ||
                        (DisguiseTimers.IsDisguised(m_From)) ||
                        (!m_From.CanBeginAction(typeof(PolymorphSpell))) ||
                        (Factions.Sigil.ExistsOn(m_From))
                        )
                    {
                        m_From.SendMessage("You cannot impersonate in that form.");
                    }
                    else
                    {
                        m_From.SendMessage("You are casting Impersonate!");
                        m_From.Target = new ImpersonateTarget(m_From, m_Book);
                    }
                }
            }
            else
            {
                m_From.SendMessage("The Spellbook must be in your backpack.");
            }
        }