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 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>" );
			}
		}
示例#3
0
文件: Honor.cs 项目: FreeReign/forkuo
        public HonorContext(PlayerMobile source, Mobile target)
        {
            this.m_Source = source;
            this.m_Target = target;

            this.m_FirstHit = FirstHit.NotDelivered;
            this.m_Poisoned = false;

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

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

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

            Timer.DelayCall(TimeSpan.FromMinutes(40),
                delegate()
                {
                    if (source.m_hontime < DateTime.Now && source.SentHonorContext != null)
                    {
                        this.Cancel();
                    }
                });
        }
		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();
		}
示例#5
0
		public ChessTimer( ChessGame game )
		{
			m_Game = game;
			m_Timer = new InternalTimer( this );
			m_Timer.Start();

			m_GameStart = DateTime.Now;
		}
		public static void Stop()
		{
			if ( m_Timer != null )
			{
				m_Timer.Stop();
				m_Timer = null;
			}
		}
示例#7
0
		public void Stop()
		{
			if ( m_Timer != null && m_Timer.Running )
			{
				m_Timer.Stop();
				m_Timer = null;
			}
		}
示例#8
0
        public NiporailemsTreasure()
            : base(0xEEF)
        {
            Weight = 25.0;

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

            m_CanSpawn = true;
        }
示例#9
0
 public override void OnCast()
 {
     if (CheckSequence())
     {
         //Tempo para remover
         Timer efeito = new InternalTimer(Caster);
         efeito.Start();
     }
     FinishSequence();
 }
		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();
		}
示例#11
0
        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();
        }
示例#12
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 );
        }
示例#13
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();
        }
示例#14
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();
        }
示例#15
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.Paralyzed = false;

                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;
                }
            }

            FinishSequence();
        }
示例#16
0
        public void TalkTo(PlayerMobile pm)
        {
            if (pm == null || m_Timer?.Running == true)
            {
                return;
            }

            int completed = CompletedCount(pm);

            if (completed == Needed.Length)
            {
                m_Timer = new InternalTimer(this, pm, Complete, true);
            }
            else if (completed == 0)
            {
                m_Timer = new InternalTimer(this, pm, Offer, false);
            }
            else
            {
                List <TextDefinition> conversation = new List <TextDefinition>();
                conversation.AddRange(Incomplete);

                MLQuestContext context = MLQuestSystem.GetContext(pm);

                if (context != null)
                {
                    foreach (Type type in Needed)
                    {
                        MLQuest quest = MLQuestSystem.FindQuest(type);

                        if (quest == null || context.HasDoneQuest(quest))
                        {
                            continue;
                        }

                        conversation.Add(quest.Title);
                    }
                }

                m_Timer = new InternalTimer(this, pm, conversation, false);
            }

            m_Timer.Start();
        }
示例#17
0
        public void Target(Mobile m)
        {
            if (m == null)
            {
                return;
            }

            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (m is BaseVendor || m is PlayerVendor || m.AccessLevel > Caster.AccessLevel)
            {
                Caster.SendLocalizedMessage(501857); // This spell won't work on that!
            }
            else if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, 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;
                m.Combatant = null;
                m.Warmode   = false;

                RemoveTimer(m);

                TimeSpan duration = TimeSpan.FromSeconds(1.2 * Caster.Skills.Magery.Fixed / 10);

                Timer t = new InternalTimer(m, duration);

                BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Invisibility, 1075825, duration, m)); // Invisibility/Invisible

                m_Table[m] = t;

                t.Start();
            }

            FinishSequence();
        }
示例#18
0
文件: Evasion.cs 项目: pallop/Servuo
        public static void BeginEvasion(Mobile m)
        {
            Timer t = (Timer)m_Table[m];

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

            TimeSpan duration = GetEvadeDuration(m);

            t = new InternalTimer(m, duration);

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Evasion, 1060597, 1153810, duration, m));

            m_Table[m] = t;

            t.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();
		}
示例#20
0
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(ClericDivineFocusSpell)))
            {
                Caster.SendMessage("This spell is already in effect");
                return;
            }

            if (CheckSequence())
            {
                Caster.BeginAction(typeof(ClericDivineFocusSpell));

                Timer t = new InternalTimer(Caster);
                m_Table[Caster] = t;
                t.Start();

                Caster.FixedParticles(0x375A, 1, 15, 0x480, 1, 4, EffectLayer.Waist);
            }
        }
示例#21
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                int TotalLoss = Server.Spells.Jester.JesterSpell.Buff(Caster, "range") + 1;
                int TotalTime = (int)(Server.Spells.Jester.JesterSpell.Buff(Caster, "time") / 2) + 1;

                Timer t = new InternalTimer(m, TotalLoss, TotalTime);

                m_Table[m] = t;

                t.Start();

                Caster.Say(GetInsult());

                switch (Utility.Random(3))
                {
                case 0: Caster.PlaySound(Caster.Female ? 794 : 1066); break;

                case 1: Caster.PlaySound(Caster.Female ? 801 : 1073); break;

                case 2: Caster.PlaySound(792); break;
                }
                ;

                if (Utility.RandomBool())
                {
                    Effects.PlaySound(m.Location, m.Map, m.Female ? 0x31B : 0x42B); m.Say("*groans*");
                }
                else
                {
                    Effects.PlaySound(m.Location, m.Map, m.Female ? 0x338 : 0x44A); m.Say("*growls*");
                }

                m.SendMessage("You have been quite insulted!");
            }

            FinishSequence();
        }
示例#22
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else
            {
                SpellHelper.Turn(Caster, 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;
                m.Frozen    = true;
                m.Squelched = true;

                ArrayList sleepequip = new ArrayList();

                Item hat = m.FindItemOnLayer(Layer.Helm);
                if (hat != null)
                {
                    sleepequip.Add(hat);
                }
                SlumberBody body = new SlumberBody(m, false);
                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();
            }
        }
示例#23
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);
                }
            }
示例#24
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 source = Caster, target = m;

                SpellHelper.Turn(source, target);

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

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

            FinishSequence();
        }
示例#25
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;

            double bushido = m.Skills.Bushido.Value;
            string args    = String.Format("12\t5\t{0}", (int)(15 + (bushido * bushido / 576)) * 2.5);

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Confidence, 1060596, 1153809, TimeSpan.FromSeconds(15), m, args));

            t.Start();
        }
示例#26
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (Registry.Contains(defender) || !Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            attacker.SendLocalizedMessage(1063358);               // You deliver a talon strike!
            defender.SendLocalizedMessage(1063359);               // Your attacker delivers a talon strike!

            defender.FixedParticles(0x373A, 1, 17, 0x26BC, 0x662, 0, EffectLayer.Waist);

            Timer t = new InternalTimer(defender, (int)(10.0 * (attacker.Skills[SkillName.Ninjitsu].Value - 50.0) / 70.0 + 5), attacker);               //5 - 15 damage

            t.Start();

            Registry.Add(defender, t);
        }
示例#27
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target can not be seen.");                   // 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();
        }
示例#28
0
        public void Target(Mobile m)
        {
            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, defender = m;

                SpellHelper.Turn(this.Caster, m);

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

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

            this.FinishSequence();
        }
示例#29
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 );
				}
			}
示例#30
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();
        }
示例#31
0
        public static void ToogleInvisibility(Spell spell, Mobile Caster, Mobile 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;

            m.AllowedStealthSteps = 80;
            m.SendLocalizedMessage(502730); // You begin to move quietly.

            RemoveTimer(m);

            TimeSpan duration = TimeSpan.FromSeconds(0);

            Timer t = new InternalTimer(m, duration);

            m_Table[m] = t;

            t.Start();
        }
示例#32
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)CirclePower, Caster, ref m);

                InternalTimer t = new InternalTimer(this, attacker, defender, m);
                t.Start();
                Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false);
            }

            FinishSequence();
        }
示例#33
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                if (targeted is BowlFlour)
                {
                    m_Item.Delete();
                    ((BowlFlour)targeted).Delete();

                    from.AddToBackpack(new CakeMix());
                }
                else if (targeted is Campfire)
                {
                    from.PlaySound(0x225);
                    m_Item.Delete();
                    InternalTimer t = new InternalTimer(from, (Campfire)targeted);
                    t.Start();
                }
            }
            public InternalItem(Point3D target, Map map) : base(target, map)
            {
                Map = map;

                if (ShowFeluccaWarning && map == Map.Felucca)
                {
                    ItemID = 0xDDA;
                }

                Dispellable = true;

                if (Region.Find(target, map) is HouseRegion)
                {
                    this.Target    = Point3D.Zero;
                    this.TargetMap = null;
                    this.Hue       = 996;
                }

                InternalTimer t = new InternalTimer(this);

                t.Start();
            }
示例#35
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m.Blessed)
            {
                Caster.SendMessage("Vous ne pouvez pas cibler une créature invulnérable !");
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, m);

                if (m != Caster && m.BeginAction(typeof(ChampDeStaseSpell)) && m.AccessLevel <= Caster.AccessLevel)
                {
                    double dur = durationMax * Spell.GetSpellScaling(Caster, Info.skillForCasting);

                    TimeSpan duration = TimeSpan.FromSeconds(dur);

                    m.Freeze(duration);

                    m.Hidden  = true;
                    m.Blessed = true;

                    Timer t = new InternalTimer(m, duration);

                    m_Timers[m] = t;

                    t.Start();
                }
                else
                {
                    Caster.SendMessage("Vous ne pouvez pas vous cibler vous-même !");
                }
            }

            FinishSequence();
        }
示例#36
0
        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>");
            }
        }
示例#37
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                m_Item.Consume();

                if (targeted is BowlFlour flour)
                {
                    flour.Delete();

                    from.AddToBackpack(new CakeMix());
                }
                else if (targeted is Campfire campfire)
                {
                    from.PlaySound(0x225);
                    var t = new InternalTimer(from, campfire);
                    t.Start();
                }
            }
示例#38
0
文件: Pierce.cs 项目: Argalep/ServUO
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentMove(attacker);

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon != null && (_Table == null || !_Table.ContainsKey(attacker)))
            {
                int toDrain = (int)(attacker.Skills[MoveSkill].Value + attacker.Skills[SkillName.Tactics].Value + (MasteryInfo.GetMasteryLevel(attacker, SkillName.Fencing) * 40) / 3);
                toDrain /= 3;

                Server.Timer t;

                if (_Table == null)
                {
                    _Table = new Dictionary <Mobile, Timer>();
                }

                _Table[attacker] = t = new InternalTimer(this, attacker, defender, toDrain);
                t.Start();

                attacker.PrivateOverheadMessage(MessageType.Regular, 1150, 1155993, attacker.NetState); // You deliver a piercing blow!
                defender.FixedEffect(0x36BD, 20, 10, 2725, 5);

                int drain = (int)(defender.StamMax * (toDrain / 100.0));

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.Pierce, 1155994, 1155995, TimeSpan.FromSeconds(10), defender, (drain / 7).ToString()));
                //-~1_VAL~ Stamina Regeneration.
            }
            else
            {
                attacker.SendLocalizedMessage(1095215); // Your target is already under the effect of this attack.
            }
        }
示例#39
0
        public static void BeginShield(Mobile m, double duration)
        {
            if (Status.Enabled)
            {
                if (m_Table.ContainsKey(m.Serial))
                {
                    Timer timer = m_Table[m.Serial];
                    timer.Stop();
                    m_Table.Remove(m.Serial);
                }

                InternalTimer timertostart = new InternalTimer(m, duration);
                timertostart.Start();
                m_Table.Add(m.Serial, timertostart);

                m.SendMessage("You are now under a shield of magic.");
            }
            else
            {
                m.SendMessage("This spell is nonfunctional.");
            }
        }
示例#40
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

            else if (Caster.AccessLevel == AccessLevel.Player && m.AccessLevel > AccessLevel.Player)
            {
                Caster.SendMessage("You can not cast this spell on a staff member.");
            }

            else if (m is Server.Mobiles.PlayerVendor)
            {
                Caster.SendMessage("You can not cast this spell on a player vendor.");
            }

            else if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, 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(((6 * Caster.Skills.Magery.Fixed) / 50) + 1);

                Timer t = new InternalTimer(m, duration);

                m_Table[m] = t;

                t.Start();
            }

            FinishSequence();
        }
示例#41
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile attacker = Caster, source = Caster;

                SpellHelper.Turn(Caster, m);

                attacker.AggressiveAction(m, attacker.IsHarmfulCriminal(m));

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

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

            FinishSequence();
        }
示例#42
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();
        }
示例#43
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();
        }
示例#44
0
        public void Target(Gold weapon)
        {
            if (!Caster.CanSee(weapon))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }

            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(AncientFalseCoinSpell)))
                {
                    if (this.Scroll != null)
                    {
                        Scroll.Consume();
                    }
                    FakeGold fake = new FakeGold();
                    fake.m_Amount = weapon.Amount * 5;
                    fake.Name     = "" + (weapon.Amount * 5) + " Gold Coins";
                    m_Fake        = fake;
                    Caster.AddToBackpack(fake);
                    Caster.PlaySound(0x2E6);

                    IEntity from = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z + 50), Caster.Map);
                    IEntity to   = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z), Caster.Map);
                    Effects.SendMovingParticles(from, to, 0x1EC6, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
                    StopTimer(Caster);


                    Timer t = new InternalTimer(Caster, m_Fake);

                    m_Timers[Caster] = t;

                    t.Start();
                }
            }

            FinishSequence();
        }
示例#45
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();
        }
示例#46
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                Timer t = new InternalTimer(m);

                m_Table[m] = t;

                t.Start();

                m.FixedParticles(0x374A, 10, 15, 5032, EffectLayer.Head);
                m.PlaySound(0x1F8);
                m.SendMessage("You feel your spirit weakening.");
            }

            FinishSequence();
        }
示例#47
0
        public override void SpellEffect(Mobile m)
        {
            m.Paralyze(TimeSpan.FromSeconds(ScaleBySkill(Caster, DamageSkill)));

            NetState ns = m.NetState;

            if (ns != null)
            {
                if (m.Race == Race.Elf)
                {
                    ns.Send(new PersonalLightLevel(m, -66));
                }
                else
                {
                    ns.Send(new PersonalLightLevel(m, -56));
                }
            }

            Timer timer = new InternalTimer(m, (int)ScaleBySkill(Caster, DamageSkill));

            timer.Start();

            BlueMageControl.CheckKnown(m, this, CanTeach(m));
        }
示例#48
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.Alive && (m.AccessLevel == AccessLevel.Player || !m.Hidden))
            {
                if (m.Player)
                {
                    if (m.Female)
                    {
                        Effects.PlaySound(Location, Map, Utility.RandomMinMax(0x53B, 0x53D));
                    }
                    else
                    {
                        Effects.PlaySound(Location, Map, Utility.RandomMinMax(0x53E, 0x540));
                    }
                }

                if (m_Timer == null || !m_Timer.Running)
                {
                    (m_Timer = new InternalTimer(m)).Start();
                }
            }

            return(true);
        }
示例#49
0
        /// <summary>
        /// Prunes dead callbacks.
        /// </summary>
        private void OnPruneCallbacks()
        {
            var deadList = new LinkedList <LinkedListNode <InternalTimer> >();
            var node     = _timerCallbackList.First;

            while (node != null)
            {
                InternalTimer timer         = node.Value;
                TimerCallback timerCallback = timer.TimerCallback;

                if (timerCallback == null)
                {
                    deadList.AddLast(node);
                }

                node = node.Next;
            }

            // Prune dead nodes
            foreach (LinkedListNode <InternalTimer> pnode in deadList)
            {
                _timerCallbackList.Remove(pnode);
            }
        }
示例#50
0
        public void DoTimer()
        {
            if (this.m_Timer != null)
                this.m_Timer.Stop();

            this.m_Timer = new InternalTimer(this);
            this.m_Timer.Start();
        }
示例#51
0
            public GiftOfRenewalInfo(Mobile caster, Mobile mobile, int hitsPerRound)
            {
                this.m_Caster = caster;
                this.m_Mobile = mobile;
                this.m_HitsPerRound = hitsPerRound;

                this.m_Timer = new InternalTimer(this);
                this.m_Timer.Start();
            }
示例#52
0
        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 static void Initialize()
		{
			CommandSystem.Register("ChampionInfo", AccessLevel.GameMaster, new CommandEventHandler(ChampionInfo_OnCommand));

			if (!m_Enabled)
			{
				foreach (ChampionSpawn s in m_AllSpawns)
				{
					s.Delete();
				}
				m_Initialized = false;
				return;
			}

			m_Timer = new InternalTimer();

			if (m_Initialized)
				return;

			Utility.PushColor(ConsoleColor.White);
			Console.WriteLine("Generating Champion Spawns");
			Utility.PopColor();

			ChampionSpawn spawn;

			XmlDocument doc = new XmlDocument();
			doc.Load(m_ConfigPath);
			foreach (XmlNode node in doc.GetElementsByTagName("championSystem")[0].ChildNodes)
			{
				if (node.Name.Equals("spawn"))
				{
					spawn = new ChampionSpawn();
					spawn.SpawnName = GetAttr(node, "name", "Unamed Spawner");
					string value = GetAttr(node, "type", null);
					if(value == null)
						spawn.RandomizeType = true;
					else
						spawn.Type = (ChampionSpawnType)Enum.Parse(typeof(ChampionSpawnType), value);
					value = GetAttr(node, "spawnMod", "1.0");
					spawn.SpawnMod = double.Parse(value);
					value = GetAttr(node, "killsMod", "1.0");
					spawn.KillsMod = double.Parse(value);
					foreach(XmlNode child in node.ChildNodes)
					{
						if (child.Name.Equals("location"))
						{
							int x = int.Parse(GetAttr(child, "x", "0"));
							int y = int.Parse(GetAttr(child, "y", "0"));
							int z = int.Parse(GetAttr(child, "z", "0"));
							int r = int.Parse(GetAttr(child, "radius", "0"));
							string mapName = GetAttr(child, "map", "Felucca");
							Map map = Map.Parse(mapName);

							spawn.SpawnRadius = r;
							spawn.MoveToWorld(new Point3D(x, y, z), map);
						}
					}
					spawn.GroupName = GetAttr(node, "group", null);
					m_AllSpawns.Add(spawn);
				}
			}

			Rotate();

			m_Initialized = true;
		}
        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 static void Initialize()
		{
			m_Timer = new InternalTimer();
			ResetTimer();
		}
示例#56
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();
        }
示例#57
0
        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();
        }
        public DefaultSweepGenerator(IWorkContextAccessor workContextAccessor)
        {
            _workContextAccessor = workContextAccessor;

            Logger = NullLogger.Instance;

            _timer = new InternalTimer(Elapsed, TimeSpan.FromMinutes(1));
        }
示例#59
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();
            }
示例#60
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();
            }