Ejemplo n.º 1
0
        public void Target(Mobile mobile)
        {
            if (!Caster.CanSee(mobile) || mobile.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

            //It was on IPY but seems right...U cant hide vendor and others with higher access level.
            else if (mobile is Mobiles.BaseVendor || mobile is Mobiles.PlayerVendor || mobile is Mobiles.PlayerBarkeeper || mobile.AccessLevel > Caster.AccessLevel)
            {
                Caster.SendLocalizedMessage(501857);                   // This spell won't work on that!
            }

            else if (CheckBSequence(mobile))
            {
                SpellHelper.Turn(Caster, mobile);

                int spellHue = 0;

                //Player Enhancement Customization: Vanish
                bool vanish = false; //PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Vanish);

                if (vanish)
                {
                    CustomizationAbilities.Vanish(mobile);
                }

                else
                {
                    Effects.SendLocationParticles(EffectItem.Create(new Point3D(mobile.X, mobile.Y, mobile.Z + 16), Caster.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, spellHue, 0, 5045, 0);
                    mobile.PlaySound(0x3C4);
                }

                mobile.Hidden = true;

                if (mobile is BaseCreature)
                {
                    var bc = mobile as BaseCreature;
                    if (!bc.Controlled && !bc.Summoned && (!bc.InitialInnocent || bc.AlwaysAttackable || bc.IsMurderer()))
                    {
                        Caster.CriminalAction(false);
                    }
                }

                RemoveTimer(mobile);

                //Changed to the duration of IPY
                TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2);                   // 120% of magery

                Timer t = new InternalTimer(mobile, duration);

                m_Table[mobile] = t;

                t.Start();
            }

            FinishSequence();
        }
Ejemplo n.º 2
0
        public static void SphinxMystery(Mobile from)
        {
            AncientMystery.MysteryTypeDetail mysteryTypeDetail = AncientMystery.GetMysteryDetails(AncientMystery.MysteryType.Sphinx);

            if (mysteryTypeDetail == null || from == null)
            {
                return;
            }

            Point3D         mysteryPoint    = mysteryTypeDetail.m_MysteryLocation;
            MysteryLocation mysteryLocation = new MysteryLocation(AncientMystery.MysteryType.Sphinx, from);

            mysteryLocation.MoveToWorld(mysteryPoint, from.Map);

            List <Point3D> m_MobileLocations = new List <Point3D>();

            m_MobileLocations.Add(new Point3D(1854, 957, -1));
            m_MobileLocations.Add(new Point3D(1858, 956, -1));
            m_MobileLocations.Add(new Point3D(1861, 958, -1));
            m_MobileLocations.Add(new Point3D(1864, 961, -1));
            m_MobileLocations.Add(new Point3D(1861, 966, -1));
            m_MobileLocations.Add(new Point3D(1857, 968, -1));
            m_MobileLocations.Add(new Point3D(1854, 966, -1));
            m_MobileLocations.Add(new Point3D(1852, 962, -1));

            List <MysterySphinx> m_MysterySphinx = new List <MysterySphinx>();

            for (int a = 0; a < m_MobileLocations.Count; a++)
            {
                MysterySphinx mysterySphinx = new MysterySphinx();
                mysterySphinx.MoveToWorld(m_MobileLocations[a], from.Map);
                mysteryLocation.m_Mobiles.Add(mysterySphinx);

                m_MysterySphinx.Add(mysterySphinx);

                CustomizationAbilities.Vanish(mysterySphinx);
            }

            for (int a = 0; a < m_MysterySphinx.Count; a++)
            {
                MysterySphinx mysterySphinx = m_MysterySphinx[a];

                foreach (MysterySphinx duplicate in m_MysterySphinx)
                {
                    mysterySphinx.m_Duplicates.Add(duplicate);
                }
            }

            MysterySphinx masterSphinx = m_MysterySphinx[Utility.RandomMinMax(0, m_MysterySphinx.Count - 1)];

            masterSphinx.m_MasterSphinx = true;
        }
Ejemplo n.º 3
0
        public void TransformAndRestore()
        {
            if (m_Duplicates.Count == 0)
            {
                return;
            }

            List <Point3D> m_Locations = new List <Point3D>();

            for (int a = 0; a < m_Duplicates.Count; a++)
            {
                MysterySphinx mysterySphinx = m_Duplicates[a];

                mysterySphinx.Restore();
                m_Locations.Add(mysterySphinx.Location);
            }

            int locationCount = m_Locations.Count;

            if (m_Locations.Count > 0)
            {
                for (int a = 0; a < m_Duplicates.Count; a++)
                {
                    int index = Utility.RandomMinMax(0, m_Locations.Count - 1);

                    m_Duplicates[a].Location = m_Locations[index];
                    m_Locations.RemoveAt(index);
                }
            }

            for (int a = 0; a < m_Duplicates.Count; a++)
            {
                CustomizationAbilities.Vanish(m_Duplicates[a]);

                m_Duplicates[a].m_MasterSphinx = false;
                m_Duplicates[a].Say("Sorry, try again.");
                m_Duplicates[a].m_NextSpeechAllowed = DateTime.UtcNow + NextSpeechDelay;
            }

            MysterySphinx newMasterSphinx = m_Duplicates[Utility.RandomMinMax(0, m_Duplicates.Count - 1)];

            newMasterSphinx.m_MasterSphinx = true;
        }