Пример #1
0
        public override bool CheckCast()
        {
            if (!Caster.CanBeginAction(typeof(ShapeshiftSpell)))
            {
                Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (m_NewBody == null)
            {
                Caster.SendGump(new ShapeshiftGump(Caster, Scroll, m_Entries));
                return(false);
            }

            return(true);
        }
Пример #2
0
        public static bool CheckCast(Mobile caster, Spell spell)
        {
            if (Factions.Sigil.ExistsOn(caster))
            {
                caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                return(false);
            }
            else if (!caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(caster))
            {
                caster.SendLocalizedMessage(1061631); // You can't do that while disguised.
                return(false);
            }
            else if (AnimalForm.UnderTransformation(caster))
            {
                caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
                return(false);
            }

            return(true);
        }
Пример #3
0
        public override bool CheckCast()
        {
            if (Caster.Flying)
            {
                Caster.SendLocalizedMessage(1113415); // You cannot use this ability while flying.
                return(false);
            }
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1061628);                 // You can't do that while polymorphed.
                return(false);
            }
            if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1063219);         // You cannot mimic an animal while in that form.
                return(false);
            }
            if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(1061631);         // You can't do that while disguised.
                return(false);
            }

            return(base.CheckCast());
        }
Пример #4
0
        public override bool CheckCast()
        {
            if (Caster.Mounted)
            {
                Caster.SendLocalizedMessage(1042561);                   //Please dismount first.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167);                   // You cannot polymorph while disguised.
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512);                   // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
                return(false);
            }
            else if (m_NewBody == 0)
            {
                Gump gump = new PolymorphGump(Caster, Scroll);

                Caster.SendGump(gump);
                return(false);
            }

            return(true);
        }
Пример #5
0
        public override bool CheckCast()
        {
            if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1061633); // You cannot polymorph while in that form.
                return(false);
            }
            if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
                return(false);
            }
            if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
                return(false);
            }/*
              * if ( Caster.NameMod != null || Caster.HueMod != -1 )
              * {
              * Caster.SendAsciiMessage("You cannot polymorph while incognito");
              * return false;
              * }*/
            if (m_NewBody == 0)
            {
                Caster.SendGump(new PolymorphGump(Caster, Scroll));
                return(false);
            }

            return(true);
        }
Пример #6
0
        public override void OnCast()
        {
            if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); //f**k off, etc.
                goto Return;
            }

            if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512); //no
                goto Return;
            }

            if (!Caster.CanBeginAction(typeof(LicheFormSpell)))
            {
                Caster.SendLocalizedMessage(1005559); //no
                goto Return;
            }

            if (!CheckSequence())
            {
                goto Return;
            }

            double dexmod = Caster.RawDex / 2;
            double strmod = Caster.RawStr / 2;
            double intmod = Caster.RawInt * 2;

            if (Spec.GetSpec(Caster).SpecName == SpecName.Mage)
            {
                var bonus = Spec.GetSpec(Caster).Bonus;
                dexmod /= bonus;
                strmod /= bonus;
                intmod *= bonus;
            }

            var newBody = 0x18;

            //hocus pocus... SpellHelper sets its own timers, we only need to clean up after the hue and body mods --sith
            Caster.BodyMod = newBody;
            Caster.HueMod  = 0;
            SpellHelper.AddStatBonus(Caster, Caster, StatType.Int, (int)intmod,
                                     TimeSpan.FromSeconds(Caster.Skills[DamageSkill].Value * 5));
            SpellHelper.AddStatCurse(Caster, Caster, StatType.Dex, (int)dexmod,
                                     TimeSpan.FromSeconds(Caster.Skills[DamageSkill].Value * 5));
            SpellHelper.AddStatCurse(Caster, Caster, StatType.Str, (int)strmod,
                                     TimeSpan.FromSeconds(Caster.Skills[DamageSkill].Value * 5));

            Caster.PlaySound(0x202);

            //polymorph calls these... do we need to? --sith
            BaseArmor.ValidateMobile(Caster);
            BaseClothing.ValidateMobile(Caster);

            new InternalTimer(Caster).Start();

Return:
            FinishSequence();
        }
Пример #7
0
        public override bool CheckCast()
        {
            if (KinPaint.IsWearingKinPaint(Caster))
            {
                Caster.SendMessage("You cannot polymorph while wearing kin paint.");
                return(false);
            }

            if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1061633);                   // You cannot polymorph while in that form.
                return(false);
            }

            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167);                   // You cannot polymorph while disguised.
                return(false);
            }

            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
                return(false);
            }

            else if (m_NewBody == 0)
            {
                Caster.SendGump(new PolymorphGump(Caster, Scroll));
                return(false);
            }

            return(true);
        }
Пример #8
0
        public override void OnCast()
        {
            if (!CheckSequence())
            {
                return;
            }
            else if (!Caster.CanBeginAction(typeof(SeanceSpell)))
            {
                Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendMessage("You cannot enter the realm of the dead while in that form.");
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendMessage("You cannot enter the realm of the dead while disguised.");
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendMessage("You cannot enter the realm of the dead without removing your paint.");
            }
            else if (!Caster.CanBeginAction(typeof(Server.Spells.Fifth.IncognitoSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(SeanceSpell)))
                {
                    if (m_NewBody != 0)
                    {
                        if (this.Scroll != null)
                        {
                            Scroll.Consume();
                        }

                        Caster.PlaySound(0x379);
                        Caster.BodyValue = m_NewBody;
                        Caster.Hue       = m_NewHue;
                        Caster.SendMessage("You enter the realm of the dead.");
                        Caster.Blessed = true;

                        StopTimer(Caster);

                        Timer t = new InternalTimer(Caster, m_OldBody, m_OldHue);

                        m_Timers[Caster] = t;

                        t.Start();
                    }
                }
                else
                {
                    Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                }
            }

            FinishSequence();
        }
Пример #9
0
        public override bool CheckCast()
        {
            if (Caster.Flying)
            {
                Caster.SendLocalizedMessage(1113415); // You cannot use this ability while flying.
                return(false);
            }
            else
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1010521); // You cannot polymorph while you have a Town Sigil
                return(false);
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1061633); // You cannot polymorph while in that form.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                if (Core.ML)
                {
                    EndPolymorph(Caster);
                }
                else
                {
                    Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                }

                return(false);
            }
            else if (m_NewBody == 0)
            {
                Gump gump;
                if (Core.SE)
                {
                    gump = new NewPolymorphGump(Caster, Scroll);
                }
                else
                {
                    gump = new PolymorphGump(Caster, Scroll);
                }

                Caster.SendGump(gump);
                return(false);
            }

            return(true);
        }
Пример #10
0
        public override bool CheckCast()
        {
            /*if ( Caster.Mounted )
             * {
             * Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
             * return false;
             * }
             * else */
            if (Factions.Sigil.ExistsOn(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1010521); // You cannot polymorph while you have a Town Sigil
                return(false);
            }
            else if (TransformationSpellHelper.UnderTransformation(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1061633); // You cannot polymorph while in that form.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(this.Caster))
            {
                this.Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
                return(false);
            }
            else if (this.Caster.BodyMod == 183 || this.Caster.BodyMod == 184)
            {
                this.Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (!this.Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                if (Core.ML)
                {
                    EndPolymorph(this.Caster);
                }
                else
                {
                    this.Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                }
                return(false);
            }
            else if (this.m_NewBody == 0)
            {
                Gump gump;
                if (Core.SE)
                {
                    gump = new NewPolymorphGump(this.Caster, this.Scroll);
                }
                else
                {
                    gump = new PolymorphGump(this.Caster, this.Scroll);
                }

                this.Caster.SendGump(gump);
                return(false);
            }

            return(true);
        }
Пример #11
0
        public override void OnCast()
        {
            if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
                return;
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
                return;
            }

            if (!CheckSequence())
            {
                goto Return;
            }

            if (!Caster.BeginAction(typeof(WraithFormSpell)))
            {
                Caster.SendLocalizedMessage(1005559); //this spell already in effect
                goto Return;
            }

            if (Caster is PlayerMobile)
            {
                Caster.HueMod  = 0x482;
                Caster.BodyMod = 0x1a;
            }

            Caster.PlaySound(0x210);

            var interval     = 0;
            var intermediate = 150.0 / Caster.Skills[CastSkill].Value;

            if (intermediate < 2)
            {
                interval = 4;
            }
            else
            {
                // should proc damage no faster than every 4 seconds
                interval = (int)intermediate;
            }

            //e.g. 130 seconds or whatever
            var duration = (int)Caster.Skills[DamageSkill].Value;

            double dmg = Utility.Dice(2, (uint)(Caster.Skills[DamageSkill].Value / 20.0), 0);

            Timer t = new WraithFormTimer(Caster, TimeSpan.FromSeconds(interval), duration, (int)dmg, this);

            m_Timers[Caster] = t;
            t.Start();

Return:
            FinishSequence();
        }
Пример #12
0
        public override bool CheckCast()
        {
            /*if ( Caster.Mounted )
             * {
             *      Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
             *      return false;
             * }
             * else */
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1010521);                   // You cannot polymorph while you have a Town Sigil
                return(false);
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendAsciiMessage("You cannot polymorph while in that form.");                   // You cannot polymorph while in that form.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendAsciiMessage("You cannot polymorph while disguised.");                   // You cannot polymorph while disguised.
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512);                   // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                if (Core.ML)
                {
                    EndPolymorph(Caster);
                }
                else
                {
                    Caster.SendAsciiMessage("This spell is already in effect.");                       // This spell is already in effect.
                }
                return(false);
            }
            else if (m_NewBody == 0)
            {
                //Gump gump;
                //if ( Core.SE )
                //	gump = new NewPolymorphGump( Caster, Scroll );
                //else
                //	gump = new PolymorphGump( Caster, Scroll );

                //Caster.SendGump( gump );
                Caster.SendMenu(new PolymorphMenu(Caster, Scroll, PolymorphMenu.Main()));
                return(false);
            }

            return(true);
        }
Пример #13
0
        public override void OnCast()
        {
            /*
             *          if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) )
             *          {
             *                  Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
             *          }
             *          else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
             *          {
             *                  Caster.SendLocalizedMessage( 1042402 ); // You cannot use incognito while wearing body paint
             *          }*/
            if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(1061631); // You can't do that while disguised.
            }/*
              *         else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ))// || Caster.IsBodyMod )
              *         {
              *                 DoFizzle();
              *         }*/
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(IncognitoSpell)))
                {
                    DisguiseTimers.StopTimer(Caster);

                    //Caster.BodyMod = Utility.RandomList( 400, 401 );
                    //Caster.HueMod = Utility.RandomSkinHue();

                    Caster.NameMod = GetNameMod(Caster.BodyValue);                 // Caster.Body.IsFemale ? "Woman"/*NameList.RandomName( "female" )*/ : "Man";/*NameList.RandomName("male");*/

                    //Caster.FixedParticles( 0x373A, 10, 15, 5036, EffectLayer.Head );
                    Caster.PlaySound(0x3BD);

                    //BaseArmor.ValidateMobile( Caster );

                    StopTimer(Caster);

                    Timer t = new InternalTimer(Caster);

                    m_Timers.Add(Caster, t);

                    t.Start();
                }
                else
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
            }

            FinishSequence();
        }
Пример #14
0
        public void Target(Mobile toHide)
        {
            if (CheckSequence())
            {
                //Only humans can be man and woman?
                //if (!toHide.Body.IsHuman)
                //    return;

                StopTimer(toHide);
                DisguiseTimers.StopTimer(toHide);

                //toHide.BodyMod = Utility.RandomList(400, 401);
                //toHide.HueMod = Utility.RandomSkinHue();
                toHide.NameMod = GetNameMod(toHide.BodyValue);// toHide.Body.IsFemale ? "Woman" : "Man";/*NameList.RandomName("male");*/

                PlayerMobile pm = toHide as PlayerMobile;

                if (pm != null && pm.HairItemID != 5147 && pm.HairItemID != 7947) //Don't change hair on daemons and goblins
                {
                    pm.SetHairMods(Utility.RandomList(m_HairIDs), pm.Body.IsFemale ? 0 : Utility.RandomList(m_BeardIDs));

                    Item hair = pm.FindItemOnLayer(Layer.Hair);

                    if (hair != null)
                    {
                        hair.Hue = Utility.RandomHairHue();
                    }

                    hair = pm.FindItemOnLayer(Layer.FacialHair);

                    if (hair != null)
                    {
                        hair.Hue = Utility.RandomHairHue();
                    }
                }

                //BaseArmor.ValidateMobile(toHide);

                Timer t = new InternalTimer(toHide);
                t.Start();

                m_Timers.Add(toHide, t);

                Caster.PlaySound(Sound);
                toHide.PlaySound(Sound);
            }

            FinishSequence();
        }
Пример #15
0
        private static bool CanChange(PlayerMobile from, Race targetRace)
        {
            if (from.Deleted)
            {
                return(false);
            }

            if (from.Race == targetRace)
            {
                from.SendLocalizedMessage(1111918); // You are already that race.
            }
            else if (!MondainsLegacy.CheckML(from, false))
            {
                from.SendLocalizedMessage(1073651); // You must have Mondain's Legacy before proceeding...
            }
            else if (!from.Alive)
            {
                from.SendLocalizedMessage(1073646); // Only the living may proceed...
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1073647); // You may not continue while mounted...
            }
            else if (!from.CanBeginAction <PolymorphSpell>() || DisguiseTimers.IsDisguised(from) ||
                     AnimalForm.UnderTransformation(from) || !from.CanBeginAction <IncognitoSpell>() ||
                     from.IsBodyMod)                // TODO: Does this cover everything?
            {
                from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
            }
            else if (from.Spell?.IsCasting == true)
            {
                from.SendLocalizedMessage(1073649); // One may not proceed while embracing magic...
            }
            else if (from.Poisoned)
            {
                from.SendLocalizedMessage(1073652); // You must be healthy to proceed...
            }
            else if (IsWearingEquipment(from))
            {
                from.SendLocalizedMessage(1073650); // To proceed you must be unburdened by equipment...
            }
            else
            {
                return(true);
            }

            return(false);
        }
Пример #16
0
        public async Task CastAsync()
        {
            if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042402); // You cannot use incognito while wearing body paint
                return;
            }
            if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(1061631); // You can't do that while disguised.
                return;
            }
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
                return;
            }

            if (!Caster.CanBuff(Caster, false, BuffIcon.Incognito))
            {
                Caster.SendLocalizedMessage(1079022); // You're already incognitoed!
                return;
            }

            if (!(Caster is PlayerMobile player))
            {
                return;
            }

            DisguiseTimers.StopTimer(Caster);

            var duration = TimeSpan.FromSeconds((Caster.Skills[SkillName.Magery].Value / 10) * 60);
            var name     = Caster.Female ? NameList.RandomName("female") : NameList.RandomName("male");

            Caster.TryAddBuff(new Incognito
            {
                Description = $"Disguised as \"{name}\"",
                Duration    = duration,
                Values      = (
                    0,
                    player.Race.RandomSkinHue(),
                    player.Race.RandomHair(player.Female),
                    player.Race.RandomHairHue(),
                    player.Race.RandomFacialHair(player.Female),
                    player.Race.RandomHairHue(),
                    name
                    )
            });
Пример #17
0
        public static bool DoDispell(Mobile from, Mobile m)
        {
            // only remove beneficial if target is other.
            var res = SpellHelper.RemoveStatMod(from, m, StatType.All, m != from);

            if (!res)
            {
                res = SpellHelper.RemoveStatMod(from, m, StatType.Str, m != from);
            }
            if (!res)
            {
                res = SpellHelper.RemoveStatMod(from, m, StatType.Int, m != from);
            }
            if (!res)
            {
                res = SpellHelper.RemoveStatMod(from, m, StatType.Dex, m != from);
            }
            if (!res && m != from) // only dispel if not targeting self
            {
                res = Second.ProtectionSpell.EndProtection(m);
            }
            if (!res && m != from) // only dispel if not targeting self
            {
                res = First.ReactiveArmorSpell.EndArmor(m);
            }
            if (!res)
            {
                res = DisguiseTimers.RemoveTimer(m);
                m.EndAction(typeof(IncognitoSpell));
            }

            if (!res)
            {
                if (!m.CanBeginAction(typeof(PolymorphSpell)))
                {
                    PolymorphSpell.StopTimer(m);
                    res = true;
                }
            }
            return(res);
        }
Пример #18
0
        public override bool CanCast()
        {
            if (!base.CanCast())
            {
                return(false);
            }

            if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
                return(false);
            }

            if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
                return(false);
            }

            return(true);
        }
Пример #19
0
 public override bool CheckCast()
 {
     if (Caster.Mounted)
     {
         Caster.SendLocalizedMessage(1042561); //Please dismount first.
         return(false);
     }
     else if (TransformationSpellHelper.UnderTransformation(Caster))
     {
         Caster.SendMessage("You cannot enter the realm of the dead while in that form.");
         return(false);
     }
     else if (DisguiseTimers.IsDisguised(Caster))
     {
         Caster.SendMessage("You cannot enter the realm of the dead while disguised.");
         return(false);
     }
     else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
     {
         Caster.SendMessage("You cannot enter the realm of the dead without removing your paint.");
         return(false);
     }
     else if (!Caster.CanBeginAction(typeof(AncientSeanceSpell)))
     {
         Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
         return(false);
     }
     else if (Caster.Female)
     {
         m_NewBody = 403;
     }
     else
     {
         m_NewBody = 402;
     }
     m_OldBody = Caster.Body;
     return(true);
 }
Пример #20
0
        public override bool CheckCast()
        {
            if (Caster.Flying)
            {
                Caster.SendLocalizedMessage(1113415); // You cannot use this ability while flying.
                return(false);
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1061633); // You cannot polymorph while in that form.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                EndPolymorph(Caster);
                return(false);
            }
            else if (m_NewBody == 0)
            {
                Gump gump = new NewPolymorphGump(Caster, Scroll);

                Caster.SendGump(gump);
                return(false);
            }

            return(true);
        }
Пример #21
0
 public override bool CheckCast()
 {
     if (Caster.Mounted)
     {
         Caster.SendLocalizedMessage(1042561); //Please dismount first.
         return(false);
     }
     else if (TransformationSpellHelper.UnderTransformation(Caster))
     {
         Caster.SendMessage("You cannot enter the astral plane while in that form.");
         return(false);
     }
     else if (DisguiseTimers.IsDisguised(Caster))
     {
         Caster.SendMessage("You cannot enter the astral plane while disguised.");
         return(false);
     }
     else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
     {
         Caster.SendMessage("You cannot enter the astral plane without removing your paint.");
         return(false);
     }
     else if (!Caster.CanBeginAction(typeof(AstralProjection)))
     {
         Caster.SendMessage("You are already in the astral plane.");
         return(false);
     }
     else
     {
         m_NewBody = 970;
         m_NewHue  = 0x4001;
     }
     m_OldBody = Caster.Body;
     m_OldHue  = Caster.Hue;
     return(true);
 }
Пример #22
0
        public override void OnCast()
        {
            /*if ( Caster.Mounted )
             * {
             *      Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
             * }
             * else */
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1010521);                   // You cannot polymorph while you have a Town Sigil
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                if (Core.ML)
                {
                    EndPolymorph(Caster);
                }
                else
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1061633);                   // You cannot polymorph while in that form.
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167);                   // You cannot polymorph while disguised.
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512);                   // You cannot polymorph while wearing body paint
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(PolymorphSpell)))
                {
                    if (m_NewBody != 0)
                    {
                        if (!((Body)m_NewBody).IsHuman)
                        {
                            Mobiles.IMount mt = Caster.Mount;

                            if (mt != null)
                            {
                                mt.Rider = null;
                            }
                        }

                        Caster.BodyMod = m_NewBody;

                        if (m_NewBody == 400 || m_NewBody == 401)
                        {
                            Caster.HueMod = Utility.RandomSkinHue();
                        }
                        else
                        {
                            Caster.HueMod = 0;
                        }

                        BaseArmor.ValidateMobile(Caster);
                        BaseClothing.ValidateMobile(Caster);

                        if (!Core.ML)
                        {
                            StopTimer(Caster);

                            Timer t = new InternalTimer(Caster);

                            m_Timers[Caster] = t;

                            t.Start();
                        }
                    }
                }
                else
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
            }

            FinishSequence();
        }
Пример #23
0
        public static bool OnCast(Mobile caster, Spell spell)
        {
            ITransformationSpell transformSpell = spell as ITransformationSpell;

            if (transformSpell == null)
            {
                return(false);
            }

            if (Factions.Sigil.ExistsOn(caster))
            {
                caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
            }
            else if (!caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                caster.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
            }
            else if (DisguiseTimers.IsDisguised(caster))
            {
                caster.SendLocalizedMessage(1061631);                   // You can't do that while disguised.
                return(false);
            }
            else if (AnimalForm.UnderTransformation(caster))
            {
                caster.SendLocalizedMessage(1061091);                   // You cannot cast that spell in this form.
            }
            else if (!caster.CanBeginAction(typeof(IncognitoSpell)) || (caster.IsBodyMod && GetContext(caster) == null))
            {
                spell.DoFizzle();
            }
            else if (spell.CheckSequence())
            {
                TransformContext context = GetContext(caster);
                Type             ourType = spell.GetType();

                bool wasTransformed = (context != null);
                bool ourTransform   = (wasTransformed && context.Type == ourType);

                if (wasTransformed)
                {
                    RemoveContext(caster, context, ourTransform);

                    if (ourTransform)
                    {
                        caster.PlaySound(0xFA);
                        caster.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist);
                    }
                }

                if (!ourTransform)
                {
                    List <ResistanceMod> mods = new List <ResistanceMod>();

                    if (transformSpell.PhysResistOffset != 0)
                    {
                        mods.Add(new ResistanceMod(ResistanceType.Physical, transformSpell.PhysResistOffset));
                    }

                    if (transformSpell.FireResistOffset != 0)
                    {
                        mods.Add(new ResistanceMod(ResistanceType.Fire, transformSpell.FireResistOffset));
                    }

                    if (transformSpell.ColdResistOffset != 0)
                    {
                        mods.Add(new ResistanceMod(ResistanceType.Cold, transformSpell.ColdResistOffset));
                    }

                    if (transformSpell.PoisResistOffset != 0)
                    {
                        mods.Add(new ResistanceMod(ResistanceType.Poison, transformSpell.PoisResistOffset));
                    }

                    if (transformSpell.NrgyResistOffset != 0)
                    {
                        mods.Add(new ResistanceMod(ResistanceType.Energy, transformSpell.NrgyResistOffset));
                    }

                    if (!((Body)transformSpell.Body).IsHuman)
                    {
                        Mobiles.IMount mt = caster.Mount;

                        if (mt != null)
                        {
                            mt.Rider = null;
                        }
                    }

                    caster.BodyMod = transformSpell.Body;
                    caster.HueMod  = transformSpell.Hue;

                    for (int i = 0; i < mods.Count; ++i)
                    {
                        caster.AddResistanceMod(mods[i]);
                    }

                    transformSpell.DoEffect(caster);

                    Timer timer = new TransformTimer(caster, transformSpell);
                    timer.Start();

                    AddContext(caster, new TransformContext(timer, mods, ourType, transformSpell));
                    return(true);
                }
            }

            return(false);
        }
Пример #24
0
        public override void OnCast()
        {
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1010445);                   // You cannot incognito if you have a sigil
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042402);                   // You cannot use incognito while wearing body paint
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(1061631);                   // You can't do that while disguised.
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(IncognitoSpell)))
                {
                    DisguiseTimers.StopTimer(Caster);

                    Caster.HueMod  = Caster.Race.RandomSkinHue();
                    Caster.NameMod = Caster.Female ? NameList.RandomName("female") : NameList.RandomName("male");

                    PlayerMobile pm = Caster 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();
                    }

                    Caster.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head);
                    Caster.PlaySound(0x3BD);

                    BaseArmor.ValidateMobile(Caster);
                    BaseClothing.ValidateMobile(Caster);

                    StopTimer(Caster);


                    int timeVal = ((6 * Caster.Skills.Magery.Fixed) / 50) + 1;

                    if (timeVal > 144)
                    {
                        timeVal = 144;
                    }

                    TimeSpan length = TimeSpan.FromSeconds(timeVal);


                    Timer t = new InternalTimer(Caster, length);

                    m_Timers[Caster] = t;

                    t.Start();

                    BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Incognito, 1075819, length, Caster));
                }
                else
                {
                    Caster.SendLocalizedMessage(1079022);                       // You're already incognitoed!
                }
            }

            FinishSequence();
        }
Пример #25
0
            private Item TryStealItem(Item toSteal, ref bool caught)
            {
                Item stolen = null;

                object root = toSteal.RootParent;

                StealableArtifactsSpawner.StealableInstance si = null;
                if (toSteal.Parent == null || !toSteal.Movable)
                {
                    si = StealableArtifactsSpawner.GetStealableInstance(toSteal);
                }

                if (!IsEmptyHanded(m_Thief))
                {
                    m_Thief.SendLocalizedMessage(1005584);                       // Both hands must be free to steal.
                }
                else if (root is Mobile && ((Mobile)root).Player && IsInnocentTo(m_Thief, (Mobile)root) && !IsInGuild(m_Thief))
                {
                    m_Thief.SendLocalizedMessage(1005596);                       // You must be in the thieves guild to steal from other players.
                }
                else if (SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild(m_Thief) && m_Thief.Kills > 0)
                {
                    m_Thief.SendLocalizedMessage(502706);                       // You are currently suspended from the thieves guild.
                }
                else if (root is BaseVendor && ((BaseVendor)root).IsInvulnerable)
                {
                    m_Thief.SendLocalizedMessage(1005598);                       // You can't steal from shopkeepers.
                }
                else if (root is PlayerVendor)
                {
                    m_Thief.SendLocalizedMessage(502709);                       // You can't steal from vendors.
                }
                else if (!m_Thief.CanSee(toSteal))
                {
                    m_Thief.SendLocalizedMessage(500237);                       // Target can not be seen.
                }
                else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true))
                {
                    m_Thief.SendLocalizedMessage(1048147);                       // Your backpack can't hold anything else.
                }
                #region Sigils
                else if (toSteal is Sigil)
                {
                    PlayerState pl      = PlayerState.Find(m_Thief);
                    Faction     faction = (pl == null ? null : pl.Faction);

                    Sigil sig = (Sigil)toSteal;

                    if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
                    {
                        m_Thief.SendLocalizedMessage(502703);    // You must be standing next to an item to steal it.
                    }
                    else if (root != null)                       // not on the ground
                    {
                        m_Thief.SendLocalizedMessage(502710);    // You can't steal that!
                    }
                    else if (faction != null)
                    {
                        if (!m_Thief.CanBeginAction(typeof(IncognitoSpell)))
                        {
                            m_Thief.SendLocalizedMessage(1010581);                               //	You cannot steal the sigil when you are incognito
                        }
                        else if (DisguiseTimers.IsDisguised(m_Thief))
                        {
                            m_Thief.SendLocalizedMessage(1010583);                               //	You cannot steal the sigil while disguised
                        }
                        else if (!m_Thief.CanBeginAction(typeof(PolymorphSpell)))
                        {
                            m_Thief.SendLocalizedMessage(1010582);                               //	You cannot steal the sigil while polymorphed
                        }
                        else if (TransformationSpellHelper.UnderTransformation(m_Thief))
                        {
                            m_Thief.SendLocalizedMessage(1061622);                               // You cannot steal the sigil while in that form.
                        }
                        else if (AnimalForm.UnderTransformation(m_Thief))
                        {
                            m_Thief.SendLocalizedMessage(1063222);                               // You cannot steal the sigil while mimicking an animal.
                        }
                        else if (pl.IsLeaving)
                        {
                            m_Thief.SendLocalizedMessage(1005589);                               // You are currently quitting a faction and cannot steal the town sigil
                        }
                        else if (sig.IsBeingCorrupted && sig.LastMonolith.Faction == faction)
                        {
                            m_Thief.SendLocalizedMessage(1005590);                               //	You cannot steal your own sigil
                        }
                        else if (sig.IsPurifying)
                        {
                            m_Thief.SendLocalizedMessage(1005592);                               // You cannot steal this sigil until it has been purified
                        }
                        // jakob, added this to check control points
                        else if (sig.LastMonolith is TownMonolith && !((TownMonolith)sig.LastMonolith).HasAllControlPoints(pl.Faction))
                        {
                            m_Thief.SendMessage("You cannot steal this sigil unless your faction is controlling all control points.");
                        }
                        // end
                        else if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, 80.0, 80.0))
                        {
                            if (Sigil.ExistsOn(m_Thief))
                            {
                                m_Thief.SendLocalizedMessage(1010258);                                   //	The sigil has gone back to its home location because you already have a sigil.
                            }
                            else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, sig, false, true))
                            {
                                m_Thief.SendLocalizedMessage(1010259);                                   //	The sigil has gone home because your backpack is full
                            }
                            else
                            {
                                if (sig.IsBeingCorrupted)
                                {
                                    sig.GraceStart = DateTime.Now;                                     // begin grace period
                                }
                                m_Thief.SendLocalizedMessage(1010586);                                 // YOU STOLE THE SIGIL!!!   (woah, calm down now)

                                if (sig.LastMonolith != null && sig.LastMonolith.Sigil != null)
                                {
                                    sig.LastMonolith.Sigil = null;
                                    sig.LastStolen         = DateTime.Now;
                                }

                                return(sig);
                            }
                        }
                        else
                        {
                            m_Thief.SendLocalizedMessage(1005594);                               //	You do not have enough skill to steal the sigil
                        }
                    }
                    else
                    {
                        m_Thief.SendLocalizedMessage(1005588);                           //	You must join a faction to do that
                    }
                }
                #endregion
                else if (si == null && (toSteal.Parent == null || !toSteal.Movable))
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else if ((toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root)) && !(toSteal.RootParent is FillableContainer))
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else if (Core.AOS && si == null && toSteal is Container)
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
                {
                    m_Thief.SendLocalizedMessage(502703);                       // You must be standing next to an item to steal it.
                }
                else if (si != null && m_Thief.Skills[SkillName.Stealing].Value < 100.0)
                {
                    m_Thief.SendLocalizedMessage(1060025, "", 0x66D);                       // You're not skilled enough to attempt the theft of this item.
                }
                else if (toSteal.Parent is Mobile)
                {
                    m_Thief.SendLocalizedMessage(1005585);                       // You cannot steal items which are equiped.
                }
                else if (root == m_Thief || (root is BaseCreature && ((BaseCreature)root).ControlMaster == m_Thief))
                {
                    m_Thief.SendLocalizedMessage(502704);                       // You catch yourself red-handed.
                }
                else if (root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player)
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else if (root is Mobile && !m_Thief.CanBeHarmful((Mobile)root))
                {
                }
                else if (root is Corpse)
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else
                {
                    double w = toSteal.Weight + toSteal.TotalWeight;

                    if (w > 10)
                    {
                        m_Thief.SendMessage("That is too heavy to steal.");
                    }
                    else
                    {
                        if (toSteal.Stackable && toSteal.Amount > 1)
                        {
                            int maxAmount = (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight);

                            if (maxAmount < 1)
                            {
                                maxAmount = 1;
                            }
                            else if (maxAmount > toSteal.Amount)
                            {
                                maxAmount = toSteal.Amount;
                            }

                            int amount = Utility.RandomMinMax(1, maxAmount);

                            if (amount >= toSteal.Amount)
                            {
                                int pileWeight = (int)Math.Ceiling(toSteal.Weight * toSteal.Amount);
                                pileWeight *= 10;

                                if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5))
                                {
                                    stolen = toSteal;
                                }
                            }
                            else
                            {
                                int pileWeight = (int)Math.Ceiling(toSteal.Weight * amount);
                                pileWeight *= 10;

                                if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5))
                                {
                                    stolen = Mobile.LiftItemDupe(toSteal, toSteal.Amount - amount);

                                    if (stolen == null)
                                    {
                                        stolen = toSteal;
                                    }
                                }
                            }
                        }
                        else
                        {
                            int iw = (int)Math.Ceiling(w);
                            iw *= 10;

                            if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, iw - 22.5, iw + 27.5))
                            {
                                stolen = toSteal;
                            }
                        }

                        if (stolen != null)
                        {
                            m_Thief.SendLocalizedMessage(502724);                               // You succesfully steal the item.

                            if (si != null)
                            {
                                toSteal.Movable = true;
                                si.Item         = null;
                            }
                        }
                        else
                        {
                            m_Thief.SendLocalizedMessage(502723);                               // You fail to steal the item.
                        }
                        caught = (m_Thief.Skills[SkillName.Stealing].Value < Utility.Random(150));
                    }
                }

                return(stolen);
            }
Пример #26
0
            private Item TryStealItem(Item toSteal, ref bool caught)
            {
                Item stolen = null;

                object root = toSteal.RootParent;

                StealableArtifactsSpawner.StealableInstance si = null;
                if (toSteal.Parent == null || !toSteal.Movable)
                {
                    si = toSteal is AddonComponent?StealableArtifactsSpawner.GetStealableInstance(((AddonComponent)toSteal).Addon) : StealableArtifactsSpawner.GetStealableInstance(toSteal);
                }

                if (!IsEmptyHanded(m_Thief))
                {
                    m_Thief.SendLocalizedMessage(1005584);                     // Both hands must be free to steal.
                }
                else if (root is Mobile && ((Mobile)root).Player && !IsInGuild(m_Thief))
                {
                    m_Thief.SendLocalizedMessage(1005596);                     // You must be in the thieves guild to steal from other players.
                }
                else if (SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild(m_Thief) && m_Thief.Kills > 0)
                {
                    m_Thief.SendLocalizedMessage(502706);                     // You are currently suspended from the thieves guild.
                }
                else if (root is BaseVendor && ((BaseVendor)root).IsInvulnerable)
                {
                    m_Thief.SendLocalizedMessage(1005598);                     // You can't steal from shopkeepers.
                }
                else if (root is PlayerVendor)
                {
                    m_Thief.SendLocalizedMessage(502709);                     // You can't steal from vendors.
                }
                else if (!m_Thief.CanSee(toSteal))
                {
                    m_Thief.SendLocalizedMessage(500237);                     // Target can not be seen.
                }
                else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true))
                {
                    m_Thief.SendLocalizedMessage(1048147);                     // Your backpack can't hold anything else.
                }
                #region Sigils
                else if (toSteal is Sigil)
                {
                    PlayerState pl      = PlayerState.Find(m_Thief);
                    Faction     faction = (pl == null ? null : pl.Faction);

                    Sigil sig = (Sigil)toSteal;

                    if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
                    {
                        m_Thief.SendLocalizedMessage(502703);  // You must be standing next to an item to steal it.
                    }
                    else if (root != null)                     // not on the ground
                    {
                        m_Thief.SendLocalizedMessage(502710);  // You can't steal that!
                    }
                    else if (faction != null)
                    {
                        if (!m_Thief.CanBeginAction(typeof(IncognitoSpell)))
                        {
                            m_Thief.SendLocalizedMessage(1010581);                             //	You cannot steal the sigil when you are incognito
                        }
                        else if (DisguiseTimers.IsDisguised(m_Thief))
                        {
                            m_Thief.SendLocalizedMessage(1010583);                             //	You cannot steal the sigil while disguised
                        }
                        else if (!m_Thief.CanBeginAction(typeof(PolymorphSpell)))
                        {
                            m_Thief.SendLocalizedMessage(1010582);                             //	You cannot steal the sigil while polymorphed
                        }
                        else if (TransformationSpellHelper.UnderTransformation(m_Thief))
                        {
                            m_Thief.SendLocalizedMessage(1061622);                             // You cannot steal the sigil while in that form.
                        }
                        else if (AnimalForm.UnderTransformation(m_Thief))
                        {
                            m_Thief.SendLocalizedMessage(1063222);                             // You cannot steal the sigil while mimicking an animal.
                        }
                        else if (pl.IsLeaving)
                        {
                            m_Thief.SendLocalizedMessage(1005589);                             // You are currently quitting a faction and cannot steal the town sigil
                        }
                        else if (sig.IsBeingCorrupted && sig.LastMonolith.Faction == faction)
                        {
                            m_Thief.SendLocalizedMessage(1005590);                             //	You cannot steal your own sigil
                        }
                        else if (sig.IsPurifying)
                        {
                            m_Thief.SendLocalizedMessage(1005592);                             // You cannot steal this sigil until it has been purified
                        }
                        else if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, 80.0, 80.0))
                        {
                            if (Sigil.ExistsOn(m_Thief))
                            {
                                m_Thief.SendLocalizedMessage(1010258);
                                //	The sigil has gone back to its home location because you already have a sigil.
                            }
                            else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, sig, false, true))
                            {
                                m_Thief.SendLocalizedMessage(1010259);                                 //	The sigil has gone home because your backpack is full
                            }
                            else
                            {
                                if (sig.IsBeingCorrupted)
                                {
                                    sig.GraceStart = DateTime.UtcNow;                                     // begin grace period
                                }

                                m_Thief.SendLocalizedMessage(1010586);                                 // YOU STOLE THE SIGIL!!!   (woah, calm down now)

                                if (sig.LastMonolith != null && sig.LastMonolith.Sigil != null)
                                {
                                    sig.LastMonolith.Sigil = null;
                                    sig.LastStolen         = DateTime.UtcNow;
                                }

                                return(sig);
                            }
                        }
                        else
                        {
                            m_Thief.SendLocalizedMessage(1005594);                             //	You do not have enough skill to steal the sigil
                        }
                    }
                    else
                    {
                        m_Thief.SendLocalizedMessage(1005588);                         //	You must join a faction to do that
                    }
                }
                #endregion
                #region VvV Sigils
                else if (toSteal is VvVSigil && ViceVsVirtueSystem.Instance != null)
                {
                    VvVPlayerEntry entry = ViceVsVirtueSystem.Instance.GetPlayerEntry <VvVPlayerEntry>(m_Thief);

                    VvVSigil sig = (VvVSigil)toSteal;

                    if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
                    {
                        m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it.
                    }
                    else if (root != null)                    // not on the ground
                    {
                        m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                    }
                    else if (entry != null)
                    {
                        if (!m_Thief.CanBeginAction(typeof(IncognitoSpell)))
                        {
                            m_Thief.SendLocalizedMessage(1010581); //	You cannot steal the sigil when you are incognito
                        }
                        else if (DisguiseTimers.IsDisguised(m_Thief))
                        {
                            m_Thief.SendLocalizedMessage(1010583); //	You cannot steal the sigil while disguised
                        }
                        else if (!m_Thief.CanBeginAction(typeof(PolymorphSpell)))
                        {
                            m_Thief.SendLocalizedMessage(1010582); //	You cannot steal the sigil while polymorphed
                        }
                        else if (TransformationSpellHelper.UnderTransformation(m_Thief))
                        {
                            m_Thief.SendLocalizedMessage(1061622); // You cannot steal the sigil while in that form.
                        }
                        else if (AnimalForm.UnderTransformation(m_Thief))
                        {
                            m_Thief.SendLocalizedMessage(1063222); // You cannot steal the sigil while mimicking an animal.
                        }
                        else if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, 100.0, 120.0))
                        {
                            if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, sig, false, true))
                            {
                                m_Thief.SendLocalizedMessage(1010259); //	The sigil has gone home because your backpack is full
                            }
                            else
                            {
                                m_Thief.SendLocalizedMessage(1010586); // YOU STOLE THE SIGIL!!!   (woah, calm down now)

                                sig.OnStolen(entry);

                                return(sig);
                            }
                        }
                        else
                        {
                            m_Thief.SendLocalizedMessage(1005594); //	You do not have enough skill to steal the sigil
                        }
                    }
                    else
                    {
                        m_Thief.SendLocalizedMessage(1155415); //	Only participants in Vice vs Virtue may use this item.
                    }
                }
                #endregion

                else if (si == null && (toSteal.Parent == null || !toSteal.Movable) && !ItemFlags.GetStealable(toSteal))
                {
                    m_Thief.SendLocalizedMessage(502710);                     // You can't steal that!
                }
                else if ((toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root)) && !ItemFlags.GetStealable(toSteal))
                {
                    m_Thief.SendLocalizedMessage(502710);                     // You can't steal that!
                }
                else if (Core.AOS && si == null && toSteal is Container && !ItemFlags.GetStealable(toSteal))
                {
                    m_Thief.SendLocalizedMessage(502710);                     // You can't steal that!
                }
                else if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
                {
                    m_Thief.SendLocalizedMessage(502703);                     // You must be standing next to an item to steal it.
                }
                else if (si != null && m_Thief.Skills[SkillName.Stealing].Value < 100.0)
                {
                    m_Thief.SendLocalizedMessage(1060025, "", 0x66D);                     // You're not skilled enough to attempt the theft of this item.
                }
                else if (toSteal.Parent is Mobile)
                {
                    m_Thief.SendLocalizedMessage(1005585);                     // You cannot steal items which are equiped.
                }
                else if (root == m_Thief)
                {
                    m_Thief.SendLocalizedMessage(502704);                     // You catch yourself red-handed.
                }
                else if (root is Mobile && ((Mobile)root).IsStaff())
                {
                    m_Thief.SendLocalizedMessage(502710);                     // You can't steal that!
                }
                else if (root is Mobile && !m_Thief.CanBeHarmful((Mobile)root))
                {
                }
                else if (root is Corpse)
                {
                    m_Thief.SendLocalizedMessage(502710);                     // You can't steal that!
                }
                else
                {
                    double w = toSteal.Weight + toSteal.TotalWeight;

                    if (w > 10)
                    {
                        m_Thief.SendMessage("That is too heavy to steal.");
                    }
                    else
                    {
                        if (toSteal.Stackable && toSteal.Amount > 1)
                        {
                            int maxAmount = (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight);

                            if (maxAmount < 1)
                            {
                                maxAmount = 1;
                            }
                            else if (maxAmount > toSteal.Amount)
                            {
                                maxAmount = toSteal.Amount;
                            }

                            int amount = Utility.RandomMinMax(1, maxAmount);

                            if (amount >= toSteal.Amount)
                            {
                                int pileWeight = (int)Math.Ceiling(toSteal.Weight * toSteal.Amount);
                                pileWeight *= 10;

                                if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5))
                                {
                                    stolen = toSteal;
                                }
                            }
                            else
                            {
                                int pileWeight = (int)Math.Ceiling(toSteal.Weight * amount);
                                pileWeight *= 10;

                                if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5))
                                {
                                    stolen = Mobile.LiftItemDupe(toSteal, toSteal.Amount - amount);

                                    if (stolen == null)
                                    {
                                        stolen = toSteal;
                                    }
                                }
                            }
                        }
                        else
                        {
                            int iw = (int)Math.Ceiling(w);
                            iw *= 10;

                            if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, iw - 22.5, iw + 27.5))
                            {
                                stolen = toSteal;
                            }
                        }

                        // Non-movable stealable (not in fillable container) items cannot result in the stealer getting caught
                        if (stolen != null && (root is FillableContainer || stolen.Movable))
                        {
                            double skillValue = m_Thief.Skills[SkillName.Stealing].Value;

                            if (root is FillableContainer)
                            {
                                caught = (Utility.Random((int)(skillValue / 2.5)) == 0); // 1 of 48 chance at 120
                            }
                            else
                            {
                                caught = (skillValue < Utility.Random(150));
                            }
                        }
                        else
                        {
                            caught = false;
                        }

                        if (stolen != null)
                        {
                            m_Thief.SendLocalizedMessage(502724);                             // You succesfully steal the item.

                            ItemFlags.SetTaken(stolen, true);
                            ItemFlags.SetStealable(stolen, false);
                            stolen.Movable = true;

                            InvokeItemStoken(new ItemStolenEventArgs(stolen, m_Thief));

                            if (si != null)
                            {
                                toSteal.Movable = true;
                                si.Item         = null;
                            }
                        }
                        else
                        {
                            m_Thief.SendLocalizedMessage(502723);                             // You fail to steal the item.
                        }
                    }
                }

                return(stolen);
            }
Пример #27
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;
            }

            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 pm)
                {
                    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);
            }
        }
Пример #28
0
        public static bool GetMyEnemies(Mobile m, Mobile me, bool checkDisguise)
        {
            bool enemy = true;

            Region reg = Region.Find(me.Location, me.Map);

            if (m is PlayerMobile)
            {
                if (((PlayerMobile)m).Profession == 1)
                {
                    m.Criminal = true;
                    if (m.Kills < 1)
                    {
                        m.Kills = 1;
                    }
                }
            }

            if (reg.IsPartOf(typeof(NecromancerRegion)) && GetPlayerInfo.EvilPlayer(m))
            {
                return(false);
            }

            if (!(me.CanSee(m)) || !(me.InLOS(m)))
            {
                return(false);
            }

            if (m.AccessLevel > AccessLevel.Player)
            {
                return(false);
            }

            if (m is BasePerson || m is BaseVendor || m is PlayerVendor || m is Citizen)
            {
                enemy = false;
            }

            if (m.Region.IsPartOf(typeof(PublicRegion)))
            {
                enemy = false;
            }

            if (m.Region.IsPartOf(typeof(StartRegion)))
            {
                enemy = false;
            }

            if (m is PlayerMobile && !m.Criminal && m.Kills < 1)
            {
                enemy = false;
            }

            if (DisguiseTimers.IsDisguised(m) && checkDisguise)
            {
                enemy = false;
            }

            if (m is PlayerMobile && m.Karma <= -5000 && m.Skills[SkillName.Chivalry].Base >= 50 && !m.Region.IsPartOf(typeof(UmbraRegion)))
            {
                enemy = true;                 // DEATH KNIGHTS ARE NOT WELCOME AFTER THIS POINT...EXCEPT IN UMBRA OR RAVENDARK
            }
            if (m is BaseCreature)
            {
                BaseCreature c = (BaseCreature)m;
                if (c.Controlled || c.FightMode == FightMode.Aggressor || c.FightMode == FightMode.None)
                {
                    enemy = false;
                }
            }

            return(enemy);
        }
Пример #29
0
        public override void OnCast()
        {
            if (!CheckSequence())
            {
                return;
            }
            else if (Caster.Mounted)
            {
                Caster.SendLocalizedMessage(1042561); //Please dismount first.
            }
            else if (!Caster.CanBeginAction(typeof(AncientPeerSpell)))
            {
                Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
            }
            else if (Server.Spells.TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendMessage("Your eyes stay firmly inside your body.");
            }
            else if (DisguiseTimers.IsDisguised(Caster)) //
            {
                Caster.SendMessage("Your eyes stay firmly inside your body.");
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendMessage("Your eyes stay firmly inside your body.");
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(AncientPeerSpell)))
                {
                    if (this.Scroll != null)
                    {
                        Scroll.Consume();
                    }
                    Caster.PlaySound(0x2DF);

                    Caster.SendMessage("Your sight leaves your body.");

                    Souless dg = new Souless(this);

                    dg.Body = Caster.Body;

                    dg.Hue         = Caster.Hue;
                    dg.Name        = Caster.Name;
                    dg.SpeechHue   = Caster.SpeechHue;
                    dg.Fame        = Caster.Fame;
                    dg.Karma       = Caster.Karma;
                    dg.EmoteHue    = Caster.EmoteHue;
                    dg.Title       = Caster.Title;
                    dg.Criminal    = (Caster.Criminal);
                    dg.AccessLevel = Caster.AccessLevel;
                    dg.Str         = Caster.Str;
                    dg.Int         = Caster.Int;
                    dg.Hits        = Caster.Hits;
                    dg.Dex         = Caster.Dex;
                    dg.Mana        = Caster.Mana;
                    dg.Stam        = Caster.Stam;

                    dg.VirtualArmor = (Caster.VirtualArmor);
                    dg.SetSkill(SkillName.Wrestling, Caster.Skills[SkillName.Wrestling].Value);
                    dg.SetSkill(SkillName.Tactics, Caster.Skills[SkillName.Tactics].Value);
                    dg.SetSkill(SkillName.Anatomy, Caster.Skills[SkillName.Anatomy].Value);

                    dg.SetSkill(SkillName.Magery, Caster.Skills[SkillName.Magery].Value);
                    dg.SetSkill(SkillName.MagicResist, Caster.Skills[SkillName.MagicResist].Value);
                    dg.SetSkill(SkillName.Meditation, Caster.Skills[SkillName.Meditation].Value);
                    dg.SetSkill(SkillName.EvalInt, Caster.Skills[SkillName.EvalInt].Value);

                    dg.SetSkill(SkillName.Archery, Caster.Skills[SkillName.Archery].Value);
                    dg.SetSkill(SkillName.Macing, Caster.Skills[SkillName.Macing].Value);
                    dg.SetSkill(SkillName.Swords, Caster.Skills[SkillName.Swords].Value);
                    dg.SetSkill(SkillName.Fencing, Caster.Skills[SkillName.Fencing].Value);
                    dg.SetSkill(SkillName.Lumberjacking, Caster.Skills[SkillName.Lumberjacking].Value);
                    dg.SetSkill(SkillName.Alchemy, Caster.Skills[SkillName.Alchemy].Value);
                    dg.SetSkill(SkillName.Parry, Caster.Skills[SkillName.Parry].Value);
                    dg.SetSkill(SkillName.Focus, Caster.Skills[SkillName.Focus].Value);
                    dg.SetSkill(SkillName.Necromancy, Caster.Skills[SkillName.Necromancy].Value);
                    dg.SetSkill(SkillName.Chivalry, Caster.Skills[SkillName.Chivalry].Value);
                    dg.SetSkill(SkillName.ArmsLore, Caster.Skills[SkillName.ArmsLore].Value);
                    dg.SetSkill(SkillName.Poisoning, Caster.Skills[SkillName.Poisoning].Value);
                    dg.SetSkill(SkillName.SpiritSpeak, Caster.Skills[SkillName.SpiritSpeak].Value);
                    dg.SetSkill(SkillName.Stealing, Caster.Skills[SkillName.Stealing].Value);
                    dg.SetSkill(SkillName.Inscribe, Caster.Skills[SkillName.Inscribe].Value);
                    dg.Kills = (Caster.Kills);

                    m_PeerMod = new ArrayList();
                    double   loss = (0 - Caster.Skills[SkillName.AnimalTaming].Base);
                    SkillMod sk   = new DefaultSkillMod(SkillName.AnimalTaming, true, loss);
                    Caster.AddSkillMod(sk);
                    m_PeerMod.Add(sk);
                    double   loss1 = (0 - Caster.Skills[SkillName.AnimalLore].Base);
                    SkillMod sk1   = new DefaultSkillMod(SkillName.AnimalLore, true, loss1);// Druidry
                    Caster.AddSkillMod(sk1);
                    m_PeerMod.Add(sk1);

                    double   loss3 = (0 - Caster.Skills[SkillName.Necromancy].Base);
                    SkillMod sk3   = new DefaultSkillMod(SkillName.Necromancy, true, loss3);
                    Caster.AddSkillMod(sk3);
                    m_PeerMod.Add(sk3);
                    double   loss4 = (0 - Caster.Skills[SkillName.TasteID].Base);
                    SkillMod sk4   = new DefaultSkillMod(SkillName.TasteID, true, loss4);
                    Caster.AddSkillMod(sk4);
                    m_PeerMod.Add(sk4);
                    // Clear Items
                    RemoveFromAllLayers(dg);

                    // Then copy
                    CopyFromLayer(Caster, dg, Layer.FirstValid);
                    CopyFromLayer(Caster, dg, Layer.OneHanded);
                    CopyFromLayer(Caster, dg, Layer.TwoHanded);
                    CopyFromLayer(Caster, dg, Layer.Shoes);
                    CopyFromLayer(Caster, dg, Layer.Pants);
                    CopyFromLayer(Caster, dg, Layer.Shirt);
                    CopyFromLayer(Caster, dg, Layer.Helm);
                    CopyFromLayer(Caster, dg, Layer.Gloves);
                    CopyFromLayer(Caster, dg, Layer.Ring);
                    CopyFromLayer(Caster, dg, Layer.Talisman);
                    CopyFromLayer(Caster, dg, Layer.Neck);
                    CopyFromLayer(Caster, dg, Layer.Hair);
                    CopyFromLayer(Caster, dg, Layer.Waist);
                    CopyFromLayer(Caster, dg, Layer.InnerTorso);
                    CopyFromLayer(Caster, dg, Layer.Bracelet);
                    //CopyFromLayer(Caster, dg, Layer.Unused_xF);
                    CopyFromLayer(Caster, dg, Layer.FacialHair);
                    CopyFromLayer(Caster, dg, Layer.MiddleTorso);
                    CopyFromLayer(Caster, dg, Layer.Earrings);
                    CopyFromLayer(Caster, dg, Layer.Arms);
                    CopyFromLayer(Caster, dg, Layer.Cloak);
                    CopyFromLayer(Caster, dg, Layer.Backpack);
                    CopyFromLayer(Caster, dg, Layer.OuterTorso);
                    CopyFromLayer(Caster, dg, Layer.OuterLegs);
                    CopyFromLayer(Caster, dg, Layer.InnerLegs);
                    CopyFromLayer(Caster, dg, Layer.LastUserValid);
                    CopyFromLayer(Caster, dg, Layer.Mount);

                    dg.Owner    = Caster;
                    dg.OldBody  = m_OldBody;
                    m_Fake      = dg;
                    dg.Map      = Caster.Map;
                    dg.Location = Caster.Location;
                    BaseArmor.ValidateMobile(Caster);
                    m_OldBody        = Caster.Body;
                    Caster.BodyValue = 903;
                    Caster.Blessed   = true;
                    StopTimer(Caster);

                    Timer t = new InternalTimer(Caster, m_OldBody, m_Fake, this);

                    m_Timers[Caster] = t;

                    t.Start();
                }
                else
                {
                    Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                }
            }

            FinishSequence();
        }
Пример #30
0
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(IncognitoSpell)))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
            }
            else if (KinPaint.IsWearingKinPaint(Caster))
            {
                Caster.SendMessage("You cannot can incognito while wearing kin paint");
            }

            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(1061631);                   // You can't do that while disguised.
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
            }

            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(IncognitoSpell)))
                {
                    DisguiseTimers.StopTimer(Caster);

                    bool shadowSkin = false;

                    //Player Enhancement Customization: Shadowskin
                    if (PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Shadowskin))
                    {
                        Caster.HueMod = 18999;
                        shadowSkin    = true;
                    }

                    else
                    {
                        Caster.HueMod = Caster.Race.RandomSkinHue();
                    }

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

                    PlayerMobile pm = Caster 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();
                    }

                    Caster.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head);
                    Caster.PlaySound(0x3BD);

                    BaseArmor.ValidateMobile(Caster);

                    StopTimer(Caster);

                    int val = (int)(Caster.Skills[SkillName.Magery].Value * 1.2);

                    if (val > 144)
                    {
                        val = 144;
                    }

                    else if (val < 15)
                    {
                        val = 15;
                    }

                    if (shadowSkin && val > 30)
                    {
                        val = 30;
                    }

                    TimeSpan length = TimeSpan.FromSeconds(val);

                    Timer t = new InternalTimer(Caster, length);

                    m_Timers[Caster] = t;

                    t.Start();
                }

                else
                {
                    Caster.SendMessage("You are already under the effect of the Incognito spell.");
                }
            }

            FinishSequence();
        }