Example #1
0
        public void IncogMode(PlayerMobile pm)
        {
            string originalName = pm.Name;

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

            LoggingCustom.LogDisguise(DateTime.Now + "\t" + originalName + "\t" + pm.NameMod);

            if (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();
            }

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

            BaseArmor.ValidateMobile(pm);
            BaseClothing.ValidateMobile(pm);

            //BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.Incognito, 1075819, length, Caster ) );
        }
Example #2
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 );
                    string originalName = Caster.Name;
					Caster.HueMod = Caster.Race.RandomSkinHue();
					Caster.NameMod = Caster.Female ? NameList.RandomName( "female" ) : NameList.RandomName( "male" );
                    
                    LoggingCustom.LogDisguise(DateTime.Now + "\t" + originalName + "\t" + Caster.NameMod);

					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();
		}
Example #3
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                if (m_Used)
                {
                    m_From.SendLocalizedMessage(501706);                       // Disguises wear off after 2 hours.
                }
                else
                {
                    m_From.SendLocalizedMessage(501707);                       // You're looking good.
                }
                return;
            }

            int[] switches = info.Switches;

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

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

            bool hair = (type == 0);

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

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

                if (entry == null)
                {
                    return;
                }

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

                if (!hair && (m_From.Female || m_From.Body.IsFemale))
                {
                    return;
                }
                string originalName = m_From.Name;
                m_From.NameMod = NameList.RandomName(m_From.Female ? "female" : "male");
                LoggingCustom.LogDisguise(DateTime.Now + "\t" + originalName + "\t" + m_From.NameMod);
                if (m_From is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m_From;

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

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

                DisguiseTimers.RemoveTimer(m_From);

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