public static void RepeatSoundCommand_OnCommand( CommandEventArgs args )
		{
			if( args.Length == 2 )
			{
				Timer timer = null;
				bool foundValue = false;
				int soundID = args.GetInt32( 0 );
				double interval = args.GetDouble( 1 );

				if( m_Table.ContainsKey( soundID ) )
					foundValue = m_Table.TryGetValue( soundID, out timer );

				if( foundValue || timer != null )
				{
					if( timer != null )
						timer.Stop();

					if( m_Table.Remove( soundID ) )
						args.Mobile.SendMessage( "RepeatSound process with sound index {0} halted.", soundID );
				}
				else
				{
					timer = new InternalTimer( args.Mobile, soundID, interval );
					timer.Start();

					m_Table.Add( soundID, timer );
				}
			}
			else
			{
				args.Mobile.SendMessage( "Usage: RepeatSound <int soundID> <double intervalDelay>" );
			}
		}
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}

			if ( m_Table.Contains( m ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x481, false, "That target already has this affect." );
			}

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

				Timer t = new InternalTimer( m, Caster );
				t.Start();
				m_Table[m] = t;
				m.PlaySound( 0x202 );
				m.FixedParticles( 0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist );
				m.FixedParticles( 0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist );
				m.SendMessage( "A magic aura surrounds you causing your wounds to heal faster." );
			}

			FinishSequence();
		}
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( Caster.CanBeHarmful( m ) && CheckSequence() )
			{
				Mobile attacker = Caster, defender = m;

				SpellHelper.Turn( Caster, m );

				// Added by Luthor to cause the targeting of the spell to be the agression, not the timeout
				bool isCriminal = attacker.IsHarmfulCriminal( defender );
				defender.AggressiveAction( attacker, isCriminal );
				attacker.Combatant = defender;

				SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );

				InternalTimer t = new InternalTimer( this, attacker, defender, m );
				t.Start();
			}

			FinishSequence();
		}
		public ChessTimer( ChessGame game )
		{
			m_Game = game;
			m_Timer = new InternalTimer( this );
			m_Timer.Start();

			m_GameStart = DateTime.Now;
		}
Exemple #5
0
        public NiporailemsTreasure()
            : base(0xEEF)
        {
            Weight = 25.0;

            m_Timer = new InternalTimer( this );
            m_Timer.Start();

            m_CanSpawn = true;
        }
 public override void OnCast()
 {
     if (CheckSequence())
     {
         //Tempo para remover
         Timer efeito = new InternalTimer(Caster);
         efeito.Start();
     }
     FinishSequence();
 }
Exemple #7
0
        public NavreysWeb( PlayerMobile target )
            : base(0xEE3 + Utility.Random( 4 ))
        {
            Weight = 1.0;

            m_Target = target;

            m_Timer = new InternalTimer( this, target );
            m_Timer.Start();

            m_WebVictims.Add( target );
        }
		public override void OnTarget( Mobile target )
		{
			if ( CheckHSequence( target ) )
			{
				Timer timer = new InternalTimer( Caster, target, GetDamage( Caster, target, DamageSkill, 1.2 ), this );
				timer.Start();

				BlueMageControl.CheckKnown( target, this, CanTeach( target ) );
			}

			FinishSequence();
		}
        public override void OnCast()
        {
            if (CheckSequence())
            {
                TimeSpan duracao = TimeSpan.FromSeconds(Caster.Skills[CastSkill].Value / 2);

                Timer t = new InternalTimer(this, Caster, duracao);
                t.Start();
            }

            FinishSequence();
        }
Exemple #10
0
        public static void BeginConfidence(Mobile m)
        {
            Timer t = (Timer)m_Table[m];

            if (t != null)
                t.Stop();

            t = new InternalTimer(m);

            m_Table[m] = t;

            t.Start();
        }
Exemple #11
0
        public HonorContext( PlayerMobile source, Mobile target )
        {
            m_Source = source;
            m_Target = target;

            m_FirstHit = FirstHit.NotDelivered;
            m_Poisoned = false;

            m_InitialLocation = source.Location;
            m_InitialMap = source.Map;

            source.SentHonorContext = this;
            ( (IHonorTarget) target ).ReceivedHonorContext = this;

            m_Timer = new InternalTimer( this );
            m_Timer.Start();
        }
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( CheckHSequence( m ) )
			{
				Mobile source = Caster;

				SpellHelper.Turn( Caster, m );

				SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );

				double damage;

				/*if ( Core.AOS )
					damage = Utility.Random( 19, 18 );
				else
				{*/
					damage = Utility.Random( 26, 9 );

					if ( CheckResisted( m ) )
					{
						damage *= 0.75;

						m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
					}

					// Scale damage based on evalint and resist
					damage *= GetDamageScalar( m );
				//}

				// Do the effects
				source.MovingParticles( m, 0x379F, 7, 0, false, true, 3043, 4043, 0x211 );
				source.PlaySound( 0x20A );

				InternalTimer t = new InternalTimer( this, damage, m );
				t.Start();
			}

			FinishSequence();
		}
Exemple #13
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( Caster.CanBeHarmful( m ) && CheckSequence() )
            {
                Mobile attacker = Caster, defender = m;

                SpellHelper.Turn( Caster, m );

                SpellHelper.CheckReflect( (int) this.Circle, Caster, ref m );

                InternalTimer t = new InternalTimer( this, attacker, defender, m );
                t.Start();
            }

            FinishSequence();
        }
Exemple #14
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if( targeted is Mobile )
				{
					Mobile to = targeted as Mobile;
					Timer t = null;

					t = new InternalTimer( from, to );
					t.Start();

					table.Add( from, t );

					from.SendMessage( "You are now following {0}.", to.RawName );
				}
				else
				{
					from.SendMessage( "This command only works on Mobiles." );
					from.Target = new InternalTarget( table );
				}
			}
Exemple #15
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( Caster.CanBeHarmful( m ) && CheckSequence() )
            {
                //Caster.NextSpellTime = DateTime.Now + this.GetCastRecovery();// Spell.NextSpellDelay;

                Mobile attacker = Caster, defender = m;

                SpellHelper.Turn( Caster, m );

                SpellHelper.CheckReflect( (int) this.Circle, Caster, ref m );

                InternalTimer t = new InternalTimer(this, attacker, defender, m, this.GetCastDelay() + TimeSpan.FromSeconds(0.25) + SpellHelper.OldDamageDelay);
                t.Start();
            }

            FinishSequence();
        }
Exemple #16
0
        public void Target(IDamageable m)
        {
            Mobile defender = m as Mobile;

            if (!this.Caster.CanSee(m))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.Caster.CanBeHarmful(m) && this.CheckSequence())
            {
                Mobile attacker = this.Caster;

                SpellHelper.Turn(this.Caster, m);

                if(defender != null)
                    SpellHelper.CheckReflect((int)this.Circle, this.Caster, ref defender);

                InternalTimer t = new InternalTimer(this, attacker, defender != null ? defender : m);
                t.Start();
            }

            this.FinishSequence();
        }
Exemple #17
0
        public void Target(Mobile m)
        {
            if (this.CheckHSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

                //SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );	//Irrelevent after AoS

                /* Temporarily chokes off the air suply of the target with poisonous fumes.
                * The target is inflicted with poison damage over time.
                * The amount of damage dealt each "hit" is based off of the caster's Spirit Speak skill and the Target's current Stamina.
                * The less Stamina the target has, the more damage is done by Strangle.
                * Duration of the effect is Spirit Speak skill level / 10 rounds, with a minimum number of 4 rounds.
                * The first round of damage is dealt after 5 seconds, and every next round after that comes 1 second sooner than the one before, until there is only 1 second between rounds.
                * The base damage of the effect lies between (Spirit Speak skill level / 10) - 2 and (Spirit Speak skill level / 10) + 1.
                * Base damage is multiplied by the following formula: (3 - (target's current Stamina / target's maximum Stamina) * 2).
                * Example:
                * For a target at full Stamina the damage multiplier is 1,
                * for a target at 50% Stamina the damage multiplier is 2 and
                * for a target at 20% Stamina the damage multiplier is 2.6
                */

                if (m.Spell != null)
                    m.Spell.OnCasterHurt();

                m.PlaySound(0x22F);
                m.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
                m.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255);

                if (!m_Table.Contains(m))
                {
                    Timer t = new InternalTimer(m, this.Caster);
                    t.Start();

                    m_Table[m] = t;
                }

                this.HarmfulSpell(m);
            }

            //Calculations for the buff bar
            double spiritlevel = this.Caster.Skills[SkillName.SpiritSpeak].Value / 10;
            if (spiritlevel < 4)
                spiritlevel = 4;
            int d_MinDamage = 4;
            int d_MaxDamage = ((int)spiritlevel + 1) * 3;
            string args = String.Format("{0}\t{1}", d_MinDamage, d_MaxDamage);

            int i_Count = (int)spiritlevel;
            int i_MaxCount = i_Count;
            int i_HitDelay = 5;
            int i_Length = i_HitDelay;

            while (i_Count > 1)
            {
                --i_Count;
                if (i_HitDelay > 1)
                {
                    if (i_MaxCount < 5)
                    {
                        --i_HitDelay;
                    }
                    else
                    {
                        int delay = (int)(Math.Ceiling((1.0 + (5 * i_Count)) / i_MaxCount));

                        if (delay <= 5)
                            i_HitDelay = delay;
                        else
                            i_HitDelay = 5;
                    }
                }
                i_Length += i_HitDelay;
            }
            TimeSpan t_Duration = TimeSpan.FromSeconds(i_Length);
            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Strangle, 1075794, 1075795, t_Duration, m, args.ToString()));

            this.FinishSequence();
        }
Exemple #18
0
            public FogoItem(TimeSpan duracao)
                : base(0x19AB)
            {
                Visible = true;
                Movable = false;
                Light = LightType.Circle150;

                //duracao
                final = DateTime.Now + duracao;
                InternalTimer t = new InternalTimer(this, duracao);
                t.Start();
            }
Exemple #19
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
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(IncognitoSpell)))
                {
                    DisguiseGump.StopTimer(Caster);

                    Caster.BodyMod = Utility.RandomList(400, 401);
                    Caster.HueMod  = Utility.RandomSkinHue();
                    Caster.NameMod = Caster.Body.IsFemale ? NameList.RandomName("female") : NameList.RandomName("male");

                    PlayerMobile pm = Caster as PlayerMobile;

                    if (pm != null)
                    {
                        if (pm.Body.IsFemale)
                        {
                            pm.SetHairMods(Utility.RandomList(m_HairIDs), 0);
                        }
                        else
                        {
                            pm.SetHairMods(Utility.RandomList(m_HairIDs), 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();
                        }
                    }

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

                    BaseArmor.ValidateMobile(Caster);

                    StopTimer(Caster);

                    Timer t = new InternalTimer(Caster);

                    m_Timers[Caster] = t;

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

            FinishSequence();
        }
Exemple #20
0
        public override void OnCast()
        {
            /*if ( Caster.Mounted )
             * {
             * Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
             * }
             * else */
            if (Factions.Sigil.ExistsOn(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1010521); // You cannot polymorph while you have a Town Sigil
            }
            else if (!this.Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                if (Core.ML)
                {
                    EndPolymorph(this.Caster);
                }
                else
                {
                    this.Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                }
            }
            else if (TransformationSpellHelper.UnderTransformation(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1061633); // You cannot polymorph while in that form.
            }
            else if (DisguiseTimers.IsDisguised(this.Caster))
            {
                this.Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
            }
            else if (this.Caster.BodyMod == 183 || this.Caster.BodyMod == 184)
            {
                this.Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
            }
            else if (!this.Caster.CanBeginAction(typeof(IncognitoSpell)) || this.Caster.IsBodyMod)
            {
                this.DoFizzle();
            }
            else if (this.CheckSequence())
            {
                if (this.Caster.BeginAction(typeof(PolymorphSpell)))
                {
                    if (this.m_NewBody != 0)
                    {
                        if (!((Body)this.m_NewBody).IsHuman)
                        {
                            Mobiles.IMount mt = this.Caster.Mount;

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

                        this.Caster.BodyMod = this.m_NewBody;

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

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

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

                            Timer t = new InternalTimer(this.Caster);

                            m_Timers[this.Caster] = t;

                            BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Polymorph, 1075824, 1075823, t.Delay, Caster, String.Format("{0}\t{1}", GetArticleCliloc(m_NewBody), GetFormCliloc(m_NewBody))));

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

            this.FinishSequence();
        }
Exemple #21
0
		public HonorContext( PlayerMobile source, Mobile target )
		{
			m_Source = source;
			m_Target = target;

			m_FirstHit = FirstHit.NotDelivered;
			m_Poisoned = false;

			m_InitialLocation = source.Location;
			m_InitialMap = source.Map;

			source.SentHonorContext = this;
			((IHonorTarget)target).ReceivedHonorContext = this;

			m_Timer = new InternalTimer( this );
			m_Timer.Start();
			source.m_hontime = (DateTime.UtcNow + TimeSpan.FromMinutes( 40 ));

			Timer.DelayCall( TimeSpan.FromMinutes( 40 ),
				delegate() {
					if (source.m_hontime < DateTime.UtcNow && source.SentHonorContext != null)
					{
						Cancel();
					}
				} );
		}
Exemple #22
0
        public virtual void StartCast()
        {
            if (Owner == null)
            {
                Console.WriteLine("WARNING: Aucun owner pour le SortNubia " + Nom);
                return;
            }
            NubiaPlayer from = Owner as NubiaPlayer;

            //Console.WriteLine("Debut de SortNubia: "+Nom);
            //	Console.WriteLine("State: "+sta

            if (!isFinish())
            {
                from.PrivateOverheadMessage(MessageType.System, 0, true, "Vous mettez fin au effet du sort", from.NetState);
                EndSortNubia();
                return;
            }
            if (from.isTransfo && (!(this is SortNubiaTao) && !(from.BodyValue == 400 || from.BodyValue == 401)))
            {
                if (!(condition == MagieCondition.SortNubia && SortNubiaPere == from.GetTransfo()))
                {
                    from.PrivateOverheadMessage(MessageType.System, 0, true, "Vous êtes transformé", from.NetState);
                    return;
                }
            }
            if (!timeStateOk() && !InCast() && !(from.AccessLevel >= AccessLevel.GameMaster))
            {
                from.PrivateOverheadMessage(MessageType.System, 0, true, "Vous ne pouvez pas encore utilser cette technique", from.NetState);
                //EndSortNubia();
                return;
            }
            if (!checkForOtherCast() && !(from.AccessLevel >= AccessLevel.GameMaster))
            {
                from.PrivateOverheadMessage(MessageType.System, 0, true, "Vous être en train d'executez un SortNubia", from.NetState);
                //EndSortNubia();
                return;
            }
            if (!canCast(Owner) && !(from.AccessLevel >= AccessLevel.GameMaster))
            {
                return;
            }

            //Private/public Regular/Spell
            //from.PublicOverheadMessage(  MessageType.Emote, 0,true, "*Forme une série de signes*");
            if (isGestuel)
            {
                from.Emote("*Forme une série de signes*");
                from.FixedParticles(0x376A, 1, (int)m_timeToCast * 13, 0x251D, from.ChakraColor, 0, EffectLayer.Waist);
            }
            else
            {
                from.SendMessage("Vous préparez une technique sans gestuel");
            }

            m_disturb = MagieDisturb.None;
            m_state   = MagieState.InCast;
            InternalTimer timer = new InternalTimer(true, this, (m_timeToCast / 2.0));

            timer.Start();
        }
        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 (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();
        }
Exemple #24
0
        public override void OnCast()
        {
            if (KinPaint.IsWearingKinPaint(Caster))
            {
                Caster.SendMessage("You cannot polymorph while wearing kin paint");
            }

            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                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.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);

                        StopTimer(Caster);

                        Timer t = new InternalTimer(Caster);

                        m_Timers[Caster] = t;

                        t.Start();
                    }
                }

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

            FinishSequence();
        }
Exemple #25
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();
        }
Exemple #26
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (!CheckLineOfSight(m))
            {
                this.DoFizzle();
                Caster.SendAsciiMessage("Target is not in line of sight");
            }
            else 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);

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

                    PlayerMobile pm = m 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(m);
                    BaseClothing.ValidateMobile(m);

                    StopTimer(m);


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

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

                    TimeSpan length = TimeSpan.FromSeconds(timeVal);


                    Timer t = new InternalTimer(m, length);

                    m_Timers[m] = t;

                    t.Start();

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

            FinishSequence();
        }
Exemple #27
0
        public void Target(Mobile m)
        {
            if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                //SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );	//Irrelevent after AoS

                /* Temporarily chokes off the air suply of the target with poisonous fumes.
                 * The target is inflicted with poison damage over time.
                 * The amount of damage dealt each "hit" is based off of the caster's Spirit Speak skill and the Target's current Stamina.
                 * The less Stamina the target has, the more damage is done by Strangle.
                 * Duration of the effect is Spirit Speak skill level / 10 rounds, with a minimum number of 4 rounds.
                 * The first round of damage is dealt after 5 seconds, and every next round after that comes 1 second sooner than the one before, until there is only 1 second between rounds.
                 * The base damage of the effect lies between (Spirit Speak skill level / 10) - 2 and (Spirit Speak skill level / 10) + 1.
                 * Base damage is multiplied by the following formula: (3 - (target's current Stamina / target's maximum Stamina) * 2).
                 * Example:
                 * For a target at full Stamina the damage multiplier is 1,
                 * for a target at 50% Stamina the damage multiplier is 2 and
                 * for a target at 20% Stamina the damage multiplier is 2.6
                 */

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.PlaySound(0x22F);
                m.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
                m.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255);

                if (!m_Table.Contains(m))
                {
                    Timer t = new InternalTimer(m, Caster);
                    t.Start();

                    m_Table[m] = t;
                }

                HarmfulSpell(m);
            }

            //Calculations for the buff bar
            double spiritlevel = Caster.Skills[SkillName.SpiritSpeak].Value / 10;

            if (spiritlevel < 4)
            {
                spiritlevel = 4;
            }
            int    d_MinDamage = 4;
            int    d_MaxDamage = ((int)spiritlevel + 1) * 3;
            string args        = String.Format("{0}\t{1}", d_MinDamage, d_MaxDamage);

            int i_Count    = (int)spiritlevel;
            int i_MaxCount = i_Count;
            int i_HitDelay = 5;
            int i_Length   = i_HitDelay;

            while (i_Count > 1)
            {
                --i_Count;
                if (i_HitDelay > 1)
                {
                    if (i_MaxCount < 5)
                    {
                        --i_HitDelay;
                    }
                    else
                    {
                        int delay = (int)(Math.Ceiling((1.0 + (5 * i_Count)) / i_MaxCount));

                        if (delay <= 5)
                        {
                            i_HitDelay = delay;
                        }
                        else
                        {
                            i_HitDelay = 5;
                        }
                    }
                }
                i_Length += i_HitDelay;
            }
            TimeSpan t_Duration = TimeSpan.FromSeconds(i_Length);

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Strangle, 1075794, 1075795, t_Duration, m, args.ToString()));

            FinishSequence();
        }
        public override void OnCast()
        {
            if (CheckSequence())
            {

                if (contemMagia.ContainsKey(Caster))
                {
                    Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                    return;
                }

                Caster.PlaySound(0x1E9);
                Caster.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                //valor da proteção
                int protecao = (int) (Caster.Skills[DamageSkill].Value / 5.0) + Utility.Random(2);

                ResistanceMod[] resistencias = new ResistanceMod[5];

                resistencias[0] = new ResistanceMod(ResistanceType.Physical, protecao);
                resistencias[1] = new ResistanceMod(ResistanceType.Fire, protecao);
                resistencias[2] = new ResistanceMod(ResistanceType.Cold, protecao);
                resistencias[3] = new ResistanceMod(ResistanceType.Energy, protecao);
                resistencias[4] = new ResistanceMod(ResistanceType.Poison, protecao);

                Caster.AddResistanceMod(resistencias[0]);
                Caster.AddResistanceMod(resistencias[1]);
                Caster.AddResistanceMod(resistencias[2]);
                Caster.AddResistanceMod(resistencias[3]);
                Caster.AddResistanceMod(resistencias[4]);

                //marca que ele contem a magia
                contemMagia.Add(Caster, Caster);

                string args = String.Format("{0}", protecao);

                //adiciona o buff de armadura arcana
                BuffInfo armaduraArcana = new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString());
                BuffInfo.AddBuff(Caster, armaduraArcana);

                //calculo da duracao
                int intDuracao = (int) (Caster.Skills[CastSkill].Value / 10) + Utility.Random(2);
                TimeSpan duracao = TimeSpan.FromMinutes(intDuracao);

                //Tempo para remover
                Timer remover = new InternalTimer(Caster, resistencias, armaduraArcana, duracao);
                remover.Start();
            }
            FinishSequence();
        }
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))                    //Mana check after check that there are targets
            {
                return;
            }

            ClearCurrentAbility(attacker);

            Map map = attacker.Map;

            if (map == null)
            {
                return;
            }

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon == null)
            {
                return;
            }

            ArrayList list = new ArrayList();

            foreach (Mobile m in attacker.GetMobilesInRange(1))
            {
                list.Add(m);
            }

            ArrayList targets = new ArrayList();

            for (int i = 0; i < list.Count; ++i)
            {
                Mobile m = (Mobile)list[i];

                if (m != defender && m != attacker && SpellHelper.ValidIndirectTarget(attacker, m))
                {
                    if (m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee(m) || !attacker.CanBeHarmful(m))
                    {
                        continue;
                    }

                    if (!attacker.InRange(m, weapon.MaxRange))
                    {
                        continue;
                    }

                    if (attacker.InLOS(m))
                    {
                        targets.Add(m);
                    }
                }
            }

            if (targets.Count > 0)
            {
                if (!CheckMana(attacker, true))
                {
                    return;
                }

                attacker.FixedEffect(0x3728, 10, 15);
                attacker.PlaySound(0x2A1);

                // 5-15 damage
                int amount = (int)(10.0 * ((Math.Max(attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value) - 50.0) / 70.0 + 5));

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = (Mobile)targets[i];
                    attacker.DoHarmful(m, true);

                    Timer t = Registry[m] as Timer;

                    if (t != null)
                    {
                        t.Stop();
                        Registry.Remove(m);
                    }

                    t = new InternalTimer(attacker, m, amount);
                    t.Start();
                    Registry.Add(m, t);
                }

                Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(RepeatEffect), attacker);
            }
        }
Exemple #30
0
            public override void Deserialize(GenericReader reader)
            {
                base.Deserialize(reader);
                int version = reader.ReadInt();
                duracao = reader.ReadTimeSpan();

                final = DateTime.Now + duracao;

                InternalTimer t = new InternalTimer(this, duracao);
                t.Start();
            }
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) ) {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            if ( sobreEfeito( m ) ){
                Caster.LocalOverheadMessage( MessageType.Regular, 0x481, false, "O alvo já esta sobre o efeito de magia Proteção Frio." );
            }
            else if ( CheckBSequence( m, false ) ) {
                SpellHelper.Turn( Caster, m );

                //proteção
                double valorSkill = Caster.Skills[DamageSkill].Value;

                int bonus = (int)(valorSkill / 10);
                int protecao = Utility.RandomMinMax(Math.Max(1, bonus - 3), bonus + Utility.Random(5));

                //duracao
                TimeSpan duracao = TimeSpan.FromMinutes(Caster.Skills[CastSkill].Value / 10 + Utility.Random(2));

                //adicona a resistencia
                ResistanceMod[] resistencias = new ResistanceMod[1];

                resistencias[0] = new ResistanceMod(ResistanceType.Cold, protecao);

                foreach (ResistanceMod resis in resistencias) {
                    Caster.AddResistanceMod(resis);
                }

                //efeito
                m.PlaySound( 0x202 );
                m.FixedParticles( 0x373A, 10, 15, 5012, 0x450, 3, EffectLayer.Waist );
                m.SendMessage( "Você esta sobre o efeito da magia Proteção Frio" );

                adicionarEfeito(m);

                Timer t = new InternalTimer(m, resistencias, duracao);
                t.Start();
            }

            FinishSequence();
        }
Exemple #32
0
            public GiftOfRenewalInfo( Mobile caster, Mobile mobile, int hitsPerRound )
            {
                m_Caster = caster;
                m_Mobile = mobile;
                m_HitsPerRound = hitsPerRound;

                m_Timer = new InternalTimer( this );
                m_Timer.Start();
            }
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckSequence())
            {
                if (this.Scroll != null)
                {
                    Scroll.Consume();
                }
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);

                    foreach (Mobile m in eable)
                    {
                        if (m != Caster && m.AccessLevel <= Caster.AccessLevel)
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                if (targets.Count > 0)
                {
                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

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

                        m.Hidden    = true;
                        m.Frozen    = true;
                        m.Squelched = true;

                        SleepingBody body = new SleepingBody(m, m.Blessed);
                        body.Map      = m.Map;
                        body.Location = m.Location;
                        m_Body        = body;
                        m.Z          -= 100;

                        m.SendMessage("You fall asleep");

                        RemoveTimer(m);

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

                        Timer t = new InternalTimer(m, duration, m_Body);

                        m_Table[m] = t;

                        t.Start();
                    }
                }
            }

            FinishSequence();
        }
Exemple #34
0
        public override void OnCast()
        {
            if (Caster.Mounted)
            {
                Caster.SendLocalizedMessage(1042561);                   //Please dismount first.
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)))
            {
                Caster.SendMessage("Vous ne pouvez faire ce sort en étant sous l'effet de l'incognito.");
            }

            /*else if (Caster is PlayerMobile && ((PlayerMobile)Caster).Disguised)
             * {
             *  Caster.SendMessage("Vous ne pouvez faire ce sort en étant déguisé.");
             * }*/
            else if (TransformationSpell.UnderTransformation(Caster))
            {
                Caster.SendMessage("Vous ne pouvez faire ce sort en étant transformé.");
            }

            /*else if (!Caster.CanBeginAction(typeof(ChauveSouris)))
             * {
             *  Caster.SendMessage("Vous ne pouvez vous transformer en étant sous la forme d'une chauve-souris.");
             * }*/
            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 );*/

                        StopTimer(Caster);

                        Timer t = new InternalTimer(Caster);

                        m_Timers[Caster] = t;

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

            FinishSequence();
        }
        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();
        }
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) ){
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( sobreEfeitoCura( m ) ){
                Caster.LocalOverheadMessage( MessageType.Regular, 0x481, false, "O alvo já esta sobre o efeito de magia de cura." );
            }
            else if ( CheckBSequence( m, false ) ) {
                SpellHelper.Turn( Caster, m );

                int duracao = (int)(Caster.Skills[DamageSkill].Value / 2);

                Timer t = new InternalTimer(m, Caster, duracao);
                t.Start();

                adicionarEfeito(m);

                m.PlaySound( 0x202 );
                m.FixedParticles( 0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist );
                m.SendMessage( "Os seus ferimentos estão sendo curados por um poder de regeneração." );
            }
            else {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x481, false, "Não foi possível conjurar a magia." );
            }

            FinishSequence();
        }
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckSequence())
            {
                if (this.Scroll != null)
                {
                    Scroll.Consume();
                }
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);

                    foreach (Mobile m in eable)
                    {
                        if (Caster.CanBeBeneficial(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }


                if (targets.Count > 0)
                {
                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        Caster.DoBeneficial(m);

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

                        m.Hidden = true;

                        RemoveTimer(m);

                        TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Spellweaving].Value * 1.2);

                        Timer t = new InternalTimer(m, duration);

                        m_Table[m] = t;

                        t.Start();
                    }
                }
            }

            FinishSequence();
        }
Exemple #38
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 (!Caster.CanBeginAction(typeof(PolymorphSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                Caster.NextSpellTime = DateTime.Now + this.GetCastRecovery();                // Spell.NextSpellDelay;

                if (Caster.BeginAction(typeof(IncognitoSpell)))
                {
                    DisguiseGump.StopTimer(Caster);

                    Caster.BodyMod = Utility.RandomList(400, 401);
                    Caster.HueMod  = Utility.RandomSkinHue();
                    Caster.NameMod = Caster.Body.IsFemale ? NameList.RandomName("female") : NameList.RandomName("male");

                    PlayerMobile pm = Caster as PlayerMobile;

                    if (pm != null)
                    {
                        if (pm.Body.IsFemale)
                        {
                            pm.SetHairMods(Utility.RandomList(m_HairIDs), 0);
                        }
                        else
                        {
                            pm.SetHairMods(Utility.RandomList(m_HairIDs), Utility.RandomList(m_BeardIDs));
                        }

                        pm.HairHue       = Utility.RandomHairHue();
                        pm.FacialHairHue = Utility.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(1005559);                       // This spell is already in effect.
                }
            }

            FinishSequence();
        }
Exemple #39
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();
		}