• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ExpireTimer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ExpireTimer的典型用法代码示例。如果您正苦于以下问题:C# ExpireTimer类的具体用法?C# ExpireTimer怎么用?C# ExpireTimer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExpireTimer类属于命名空间,在下文中一共展示了ExpireTimer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Target

		public void Target( Mobile m )
		{
			if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
				 * making them more vulnerable to Fire and Poison damage,
				 * but increasing their resistance to Physical and Cold damage.
				 * 
				 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
				 * 
				 * NOTE: Algorithm above is fixed point, should be:
				 * ((ss-mr)/2.5) + 40
				 * 
				 * NOTE: Resistance is not checked if targeting yourself
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[m];

				if ( timer != null )
					timer.DoExpire();
				else
					m.SendLocalizedMessage( 1061689 ); // Your skin turns dry and corpselike.

				 if ( m.Spell != null )
					m.Spell.OnCasterHurt();
				
				m.FixedParticles( 0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head );
				m.PlaySound( 0x1BB );

				double ss = GetDamageSkill( Caster );
				double mr = ( Caster == m ? 0.0 : GetResistSkill( m ) );
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

				TimeSpan duration = TimeSpan.FromSeconds( ((ss - mr) / 2.5) + 40.0 );

				ResistanceMod[] mods = new ResistanceMod[4]
					{
						new ResistanceMod( ResistanceType.Fire, -15 ),
						new ResistanceMod( ResistanceType.Poison, -15 ),
						new ResistanceMod( ResistanceType.Cold, +10 ),
						new ResistanceMod( ResistanceType.Physical, +10 )
					};

				timer = new ExpireTimer( m, mods, duration );
				timer.Start();

				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.CorpseSkin, 1075663, duration, m ) );

				m_Table[m] = timer;

				for ( int i = 0; i < mods.Length; ++i )
					m.AddResistanceMod( mods[i] );

				HarmfulSpell( m );
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:60,代码来源:CorpseSkin.cs


示例2: OnGaveMeleeAttack

		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if ( 0.1 > Utility.RandomDouble() && !IsStunned( defender ) )
			{
				/* Lightning Fist
				 * Cliloc: 1070839
				 * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(884 715, 10)" ToLocation: "(884 715, 10)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
				 * Damage: 35-65, 100% energy, resistable
				 * Freezes for 4 seconds
				 * Effect cannot stack
				 */

				defender.FixedEffect( 0x37B9, 10, 5 );
				defender.SendLocalizedMessage( 1070839 ); // The creature attacks with stunning force!
 
				// This should be done in place of the normal attack damage.
				//AOS.Damage( defender, this, Utility.RandomMinMax( 35, 65 ), 0, 0, 0, 0, 100 );

				defender.Frozen = true; 

				ExpireTimer timer = new ExpireTimer( defender, TimeSpan.FromSeconds( 4.0 ) );
				timer.Start();
				m_Table[defender] = timer;
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:27,代码来源:RaiJu.cs


示例3: Target

        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( source, m );

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

                m.FixedParticles( 0x374A, 10, 30, 5013, 0x238, 2, EffectLayer.Waist );

                int amount = (int)( Caster.Skills[SkillName.Musicianship].Base * 0.17 );
                TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Musicianship].Base * 0.15 );

                m.SendMessage( "Your poison resistance has decreased." );
                ResistanceMod mod1 = new ResistanceMod( ResistanceType.Cold, - amount );

                m.AddResistanceMod( mod1 );

                ExpireTimer timer1 = new ExpireTimer( m, mod1, duration );
                timer1.Start();
            }

            FinishSequence();
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:29,代码来源:PoisonThrenodySpell.cs


示例4: OnGaveMeleeAttack

		// TODO: Put this attack shared with Hiryu and Lesser Hiryu in one place
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if( 0.1 > Utility.RandomDouble() )
			{
				ExpireTimer timer = (ExpireTimer)m_Table[defender];

				if( timer != null )
				{
					timer.DoExpire();
					defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.
				}
				else
					defender.SendLocalizedMessage( 1070836 ); // The blow from the creature's claws has made you more susceptible to physical attacks.

				int effect = -(defender.PhysicalResistance * 15 / 100);

				ResistanceMod mod = new ResistanceMod( ResistanceType.Physical, effect );

				defender.FixedEffect( 0x37B9, 10, 5 );
				defender.AddResistanceMod( mod );

				timer = new ExpireTimer( defender, mod, TimeSpan.FromSeconds( 5.0 ) );
				timer.Start();
				m_Table[defender] = timer;
			}
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:29,代码来源:Swoop.cs


示例5: OnCast

		public override void OnCast()
		{
			if( CheckSequence() )
			{
				Caster.PlaySound( 0x5C3 );
				Caster.FixedParticles( 0x3728, 1, 13, 0x26B8, 0x455, 7, EffectLayer.Waist );
				Caster.FixedParticles( 0x3779, 1, 15, 0x251E, 0x3F, 7, EffectLayer.Waist );

				double skill = Caster.Skills[SkillName.Spellweaving].Value;

				int damageAbsorb = (int)(18 + ((skill-10)/10)*3 + (FocusLevel * 6));
				Caster.MeleeDamageAbsorb = damageAbsorb;

				TimeSpan duration = TimeSpan.FromSeconds( 60 + (FocusLevel * 12) );

				ExpireTimer t = new ExpireTimer( Caster, duration );
				t.Start();

				m_Table[Caster] = t;

				Caster.BeginAction( typeof( AttuneWeaponSpell ) );

				BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.AttuneWeapon, 1075798, duration, Caster, damageAbsorb.ToString() ) );
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:27,代码来源:AttuneWeapon.cs


示例6: Target

		public void Target( Mobile m )
		{
			if ( Caster == m || !(m is PlayerMobile || m is BaseCreature) ) // only PlayerMobile and BaseCreature implement blood oath checking
			{
				Caster.SendLocalizedMessage( 1060508 ); // You can't curse that.
			}
			else if ( m_OathTable.Contains( Caster ) )
			{
				Caster.SendLocalizedMessage( 1061607 ); // You are already bonded in a Blood Oath.
			}
			else if ( m_OathTable.Contains( m ) )
			{
				if ( m.Player )
					Caster.SendLocalizedMessage( 1061608 ); // That player is already bonded in a Blood Oath.
				else
					Caster.SendLocalizedMessage( 1061609 ); // That creature is already bonded in a Blood Oath.
			}
			else if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Temporarily creates a dark pact between the caster and the target.
				 * Any damage dealt by the target to the caster is increased, but the target receives the same amount of damage.
				 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 80 ) + 8 seconds.
				 * 
				 * NOTE: The above algorithm must be fixed point, it should be:
				 * ((ss-rm)/8)+8
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[m];
				if ( timer != null )
				timer.DoExpire();

				m_OathTable[Caster] = Caster;
				m_OathTable[m] = Caster;

				Caster.PlaySound( 0x175 );

				Caster.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
				Caster.FixedParticles( 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255 );

				m.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
				m.FixedParticles( 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255 );

				TimeSpan duration = TimeSpan.FromSeconds( ((GetDamageSkill( Caster ) - GetResistSkill( m )) / 8) + 8 );
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

				timer = new ExpireTimer ( Caster, m, duration );
				timer.Start ();

				BuffInfo.AddBuff ( Caster, new BuffInfo ( BuffIcon.BloodOathCaster, 1075659, duration, Caster, m.Name.ToString () ) );
				BuffInfo.AddBuff ( m, new BuffInfo ( BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name.ToString () ) );

				m_Table[m] = timer;

			}

			FinishSequence();
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:59,代码来源:BloodOathSpell.cs


示例7: EssenceOfWindInfo

			public EssenceOfWindInfo( Mobile defender, int fcMalus, int ssiMalus, TimeSpan duration )
			{
				m_Defender = defender;
				m_FCMalus = fcMalus;
				m_SSIMalus = ssiMalus;

				m_Timer = new ExpireTimer( m_Defender, duration );
				m_Timer.Start();
			}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:9,代码来源:EssenceOfWind.cs


示例8: OnCast

		public override void OnCast()
		{
			BaseWeapon weapon = Caster.Weapon as BaseWeapon;

			if ( weapon == null || weapon is Fists )
			{
				Caster.SendLocalizedMessage( 501078 ); // You must be holding a weapon.
			}
			else if ( CheckSequence() )
			{
				/* Temporarily enchants the weapon the caster is currently wielding.
				 * The type of damage the weapon inflicts when hitting a target will
				 * be converted to the target's worst Resistance type.
				 * Duration of the effect is affected by the caster's Karma and lasts for 3 to 11 seconds.
				 */

				int itemID, soundID;

				switch ( weapon.Skill )
				{
					case SkillName.Macing: itemID = 0xFB4; soundID = 0x232; break;
					case SkillName.Archery: itemID = 0x13B1; soundID = 0x145; break;
					default: itemID = 0xF5F; soundID = 0x56; break;
				}

				Caster.PlaySound( 0x20C );
				Caster.PlaySound( soundID );
				Caster.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );

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

				double seconds = ComputePowerValue( 20 );

				// TODO: Should caps be applied?
				if ( seconds < 3.0 )
					seconds = 3.0;
				else if ( seconds > 11.0 )
					seconds = 11.0;

				TimeSpan duration = TimeSpan.FromSeconds( seconds );

				Timer t = (Timer)m_Table[weapon];

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

				weapon.Consecrated = true;

				m_Table[weapon] = t = new ExpireTimer( weapon, duration );

				t.Start();
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:57,代码来源:ConsecrateWeapon.cs


示例9: Target

		public void Target( Mobile m )
		{
			BaseCreature bc = m as BaseCreature;

			if( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if( m.IsDeadBondedPet || !m.Alive )
			{
				// As per Osi: Nothing happens.
			}
			else if( m != Caster && (bc == null || !bc.IsBonded || bc.ControlMaster != Caster) )
			{
				Caster.SendLocalizedMessage( 1072077 ); // You may only cast this spell on yourself or a bonded pet.
			}
			else if( m_Table.ContainsKey( m ) )
			{
				Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
			}
			else if( CheckBSequence( m ) )
			{
				if( Caster == m )
				{
					Caster.SendLocalizedMessage( 1074774 ); // You weave powerful magic, protecting yourself from death.
				}
				else
				{
					Caster.SendLocalizedMessage( 1074775 ); // You weave powerful magic, protecting your pet from death.
					SpellHelper.Turn( Caster, m );
				}


				m.PlaySound( 0x244 );
				m.FixedParticles( 0x3709, 1, 30, 0x26ED, 5, 2, EffectLayer.Waist );
				m.FixedParticles( 0x376A, 1, 30, 0x251E, 5, 3, EffectLayer.Waist );

				double skill = Caster.Skills[SkillName.Spellweaving].Value;

				TimeSpan duration = TimeSpan.FromMinutes( ((int)(skill / 24))* 2 + FocusLevel );

				ExpireTimer t = new ExpireTimer( m, duration, this );
				t.Start();

				m_Table[m] = t;

				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.GiftOfLife, 1031615, 1075807, duration, m, null, true ) );
			}

			FinishSequence();
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:51,代码来源:GiftOfLife.cs


示例10: OnCast

		public override void OnCast()
		{
			BaseWeapon weapon = Caster.Weapon as BaseWeapon;

			if ( weapon == null || weapon is Fists )
			{
				Caster.SendLocalizedMessage( 501078 ); // You must be holding a weapon.
			}
			else if ( CheckSequence() )
			{
				/* Temporarily imbues a weapon with a life draining effect.
				 * Half the damage that the weapon inflicts is added to the necromancer's health.
				 * The effects lasts for (Spirit Speak skill level / 34) + 1 seconds.
				 * 
				 * NOTE: Above algorithm is fixed point, should be :
				 * (Spirit Speak skill level / 3.4) + 1
				 * 
				 * TODO: What happens if you curse a weapon then give it to someone else? Should they get the drain effect?
				 */

				Caster.PlaySound( 0x387 );
				Caster.FixedParticles( 0x3779, 1, 15, 9905, 32, 2, EffectLayer.Head );
				Caster.FixedParticles( 0x37B9, 1, 14, 9502, 32, 5, (EffectLayer)255 );
				new SoundEffectTimer( Caster ).Start();

				TimeSpan duration = TimeSpan.FromSeconds( (Caster.Skills[SkillName.SpiritSpeak].Value / 3.4) + 1.0 );


				Timer t = (Timer)m_Table[weapon];

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

				weapon.Cursed = true;

				m_Table[weapon] = t = new ExpireTimer( weapon, duration );

				t.Start();
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:42,代码来源:CurseWeapon.cs


示例11: OnGaveMeleeAttack

		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if ( Utility.RandomDouble() < 0.1 )
			{
				ExpireTimer timer;

				if ( m_Table.TryGetValue( defender, out timer ) )
					timer.DoExpire();

				defender.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
				defender.PlaySound( 0x208 );
				defender.SendLocalizedMessage( 1070833 ); // The creature fans you with fire, reducing your resistance to fire attacks.

				ResistanceMod mod = new ResistanceMod( ResistanceType.Fire, -10 );
				defender.AddResistanceMod( mod );

				m_Table[defender] = timer = new ExpireTimer( defender, mod );
				timer.Start();
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:22,代码来源:LadyJennifyr.cs


示例12: Target

        public void Target(Mobile m)
        {
            if (CheckBSequence(m))
            {
                Timer t = m_Table[m] as Timer;
                if (t != null && t.Running)
                {
                    Caster.SendAsciiMessage("This target already has reactive armor.");
                }
                else
                {
                    m.MeleeDamageAbsorb = (int)(10 + Caster.Skills[SkillName.Magery].Value / 4);
                    m.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
                    m.PlaySound(0x1F2);

                    t = new ExpireTimer(m, TimeSpan.FromSeconds(25 + (Caster.Skills[SkillName.Magery].Value / 2.0)));
                    t.Start();

                    m_Table[m] = t;
                }
            }

            FinishSequence();
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:24,代码来源:ReactiveArmor.cs


示例13: OnCast

        public override void OnCast()
        {
            BaseWeapon weapon = Caster.Weapon as BaseWeapon;

            if ( weapon == null || weapon is Fists )
            {
                Caster.SendLocalizedMessage( 501078 ); // You must be holding a weapon.
            }
            else if ( CheckSequence() )
            {
                /* Temporarily enchants the weapon the caster is currently wielding.
                 * The type of damage the weapon inflicts when hitting a target will
                 * be converted to the target's worst Resistance type.
                 * Duration of the effect is affected by the caster's Karma and lasts for 3 to 11 seconds.
                 */

                int itemID, soundID;

                switch ( weapon.Skill )
                {
                    case SkillName.Macing:
                        itemID = 0xFB4;
                        soundID = 0x232;
                        break;
                    case SkillName.Archery:
                        itemID = 0x13B1;
                        soundID = 0x145;
                        break;
                    default:
                        itemID = 0xF5F;
                        soundID = 0x56;
                        break;
                }

                Caster.PlaySound( 0x20C );
                Caster.PlaySound( soundID );
                Caster.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );

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

                double seconds = ComputePowerValue( 20 );

                // TODO: Should caps be applied?
                Utility.FixMinMax( ref seconds, 3.0, 11.0 );

                TimeSpan duration = TimeSpan.FromSeconds( seconds );

                if ( m_Table.ContainsKey( Caster ) )
                {
                    Timer t = m_Table[Caster].Timer;

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

                double chivalry = Caster.Skills.Chivalry.Value;

                Timer expireTimer = new ExpireTimer( Caster, duration );
                int procChance = (int) ( ( chivalry - 20.0 ) / 0.6 );
                int bonusDamage = (int) ( ( chivalry - 90.0 ) / 2.0 );

                Utility.FixMinMax( ref procChance, 0, 100 );
                Utility.FixMinMax( ref bonusDamage, 0, 15 );

                BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.ConsecrateWeapon, 1151385, 1151386, duration, Caster, String.Format( "{0}\t{1}", procChance, bonusDamage ) ) );

                ConsecrateContext context = new ConsecrateContext( expireTimer, procChance, bonusDamage );

                m_Table[Caster] = context;

                expireTimer.Start();
            }

            FinishSequence();
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:77,代码来源:ConsecrateWeapon.cs


示例14: OnGaveMeleeAttack

        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.05 > Utility.RandomDouble())
            {
                /* Rune Corruption
                * Start cliloc: 1070846 "The creature magically corrupts your armor!"
                * Effect: All resistances -70 (lowest 0) for 5 seconds
                * End ASCII: "The corruption of your armor has worn off"
                */
                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070845); // The creature continues to corrupt your armor!
                }
                else
                    defender.SendLocalizedMessage(1070846); // The creature magically corrupts your armor!

                List<ResistanceMod> mods = new List<ResistanceMod>();

                if (Core.ML)
                {
                    if (defender.PhysicalResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Physical, -(defender.PhysicalResistance / 2)));

                    if (defender.FireResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Fire, -(defender.FireResistance / 2)));

                    if (defender.ColdResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Cold, -(defender.ColdResistance / 2)));

                    if (defender.PoisonResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Poison, -(defender.PoisonResistance / 2)));

                    if (defender.EnergyResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Energy, -(defender.EnergyResistance / 2)));
                }
                else
                {
                    if (defender.PhysicalResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Physical, (defender.PhysicalResistance > 70) ? -70 : -defender.PhysicalResistance));

                    if (defender.FireResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Fire, (defender.FireResistance > 70) ? -70 : -defender.FireResistance));

                    if (defender.ColdResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Cold, (defender.ColdResistance > 70) ? -70 : -defender.ColdResistance));

                    if (defender.PoisonResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Poison, (defender.PoisonResistance > 70) ? -70 : -defender.PoisonResistance));

                    if (defender.EnergyResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Energy, (defender.EnergyResistance > 70) ? -70 : -defender.EnergyResistance));
                }

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

                defender.FixedEffect(0x37B9, 10, 5);

                timer = new ExpireTimer(defender, mods, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:68,代码来源:RuneBeetle.cs


示例15: OnGaveMeleeAttack

        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                /* Grasping Claw
                * Start cliloc: 1070836
                * Effect: Physical resistance -15% for 5 seconds
                * End cliloc: 1070838
                * Effect: Type: "3" - From: "0x57D4F5B" (player) - To: "0x0" - ItemId: "0x37B9" - ItemIdName: "glow" - FromLocation: "(1149 808, 32)" - ToLocation: "(1149 808, 32)" - Speed: "10" - Duration: "5" - FixedDirection: "True" - Explode: "False"
                */
                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070837); // The creature lands another blow in your weakened state.
                }
                else
                    defender.SendLocalizedMessage(1070836); // The blow from the creature's claws has made you more susceptible to physical attacks.

                int effect = -(defender.PhysicalResistance * 15 / 100);

                ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, effect);

                defender.FixedEffect(0x37B9, 10, 5);
                defender.AddResistanceMod(mod);

                timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:34,代码来源:Hiryu.cs


示例16: OnGaveMeleeAttack

        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                /* Flurry of Twigs
                * Start cliloc: 1070850
                * Effect: Physical resistance -15% for 5 seconds
                * End cliloc: 1070852
                * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                */
                ExpireTimer timer = (ExpireTimer)m_FlurryOfTwigsTable[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070851); // The creature lands another blow in your weakened state.
                }
                else
                    defender.SendLocalizedMessage(1070850); // The creature's flurry of twigs has made you more susceptible to physical attacks!

                int effect = -(defender.PhysicalResistance * 15 / 100);

                ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, effect);

                defender.FixedEffect(0x37B9, 10, 5);
                defender.AddResistanceMod(mod);

                timer = new ExpireTimer(defender, mod, m_FlurryOfTwigsTable, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_FlurryOfTwigsTable[defender] = timer;
            }
            else if (0.05 > Utility.RandomDouble())
            {
                /* Chlorophyl Blast
                * Start cliloc: 1070827
                * Effect: Energy resistance -50% for 10 seconds
                * End cliloc: 1070829
                * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                */
                ExpireTimer timer = (ExpireTimer)m_ChlorophylBlastTable[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070828); // The creature continues to hinder your energy resistance!
                }
                else
                    defender.SendLocalizedMessage(1070827); // The creature's attack has made you more susceptible to energy attacks!

                int effect = -(defender.EnergyResistance / 2);

                ResistanceMod mod = new ResistanceMod(ResistanceType.Energy, effect);

                defender.FixedEffect(0x37B9, 10, 5);
                defender.AddResistanceMod(mod);

                timer = new ExpireTimer(defender, mod, m_ChlorophylBlastTable, TimeSpan.FromSeconds(10.0));
                timer.Start();
                m_ChlorophylBlastTable[defender] = timer;
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:63,代码来源:KazeKemono.cs


示例17: EmpowermentInfo

            public EmpowermentInfo( Mobile caster, int sdiBonus, double healBonus, int hitsBonus, int dispelBonus, TimeSpan duration )
            {
                m_Caster = caster;
                m_SDIBonus = sdiBonus;
                m_HealBonus = healBonus;
                m_HitsBonus = hitsBonus;
                m_DispelBonus = dispelBonus;

                m_Timer = new ExpireTimer( m_Caster, duration );
                m_Timer.Start();
            }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:11,代码来源:ArcaneEmpowerment.cs


示例18: OnResponse

        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile m = state.Mobile;
           
            BaseWeapon weapon = m.Weapon as BaseWeapon;
            TimeSpan duration = TimeSpan.FromSeconds((m.Skills[SkillName.Mysticism].Value / 1.2) + 1.0);//needs work, just a base formula.

            switch (info.ButtonID)
            {
                case 0:
                    {
                        m.CloseGump(typeof(EnchantGump));
                        break;
                    }
                case 1:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Dispel to your weapon");
                        weapon.WeaponAttributes.HitDispel += 30;
                        m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                        m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
                        if (weapon.Name == null)
                            this.m_Name = weapon.GetType().Name;
                        else
                            this.m_Name = weapon.Name;
                        weapon.Name = this.m_Name + " [Enchanted]";
                        m_Table[weapon] = t = new ExpireTimer(weapon, AosWeaponAttribute.HitDispel, m, duration);
                        t.Start();
                        m.CloseGump(typeof(EnchantGump));
                        EnchantSpell.AddEffects(m, weapon);
                        break;
                    }
                case 2:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Fireball to your weapon");
                        weapon.WeaponAttributes.HitFireball += 30;
                        m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                        m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
                        if (weapon.Name == null)
                            this.m_Name = weapon.GetType().Name;
                        else
                            this.m_Name = weapon.Name;
                        weapon.Name = this.m_Name + " [Enchanted]";
                        m_Table[weapon] = t = new ExpireTimer(weapon, AosWeaponAttribute.HitFireball, m, duration);
                        t.Start();
                        m.CloseGump(typeof(EnchantGump));
                        EnchantSpell.AddEffects(m, weapon);
                        break;
                    }
                case 3:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Harm to your weapon");
                        weapon.WeaponAttributes.HitHarm += 30;
                        m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                        m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
                        if (weapon.Name == null)
                            this.m_Name = weapon.GetType().Name;
                        else
                            this.m_Name = weapon.Name;
                        weapon.Name = this.m_Name + " [Enchanted]";
                        m_Table[weapon] = t = new ExpireTimer(weapon, AosWeaponAttribute.HitHarm, m, duration);
                        t.Start();
                        m.CloseGump(typeof(EnchantGump));
                        EnchantSpell.AddEffects(m, weapon);
                        break;
                    }
                case 4:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Lightning to your weapon");
                        weapon.WeaponAttributes.HitLightning += 30;
                        m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                        m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
                        if (weapon.Name == null)
                            this.m_Name = weapon.GetType().Name;
                        else
                            this.m_Name = weapon.Name;
                        weapon.Name = this.m_Name + " [Enchanted]";
                        m_Table[weapon] = t = new ExpireTimer(weapon, AosWeaponAttribute.HitLightning, m, duration);
                        t.Start();
                        m.CloseGump(typeof(EnchantGump));
                        EnchantSpell.AddEffects(m, weapon);
                        break;
                    }
                case 5:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Magic Arrow to your weapon");
//.........这里部分代码省略.........
开发者ID:g4idrijs,项目名称:ServUO,代码行数:101,代码来源:EnchantGump.cs


示例19: OnGaveMeleeAttack

        // TODO: Snowball
        public override void OnGaveMeleeAttack( Mobile defender )
        {
            base.OnGaveMeleeAttack( defender );

            if( 0.1 > Utility.RandomDouble() )
            {
                /* Cold Wind
                 * Graphics: Message - Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(928 164, 34)" ToLocation: "(928 164, 34)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                 * Start cliloc: 1070832
                 * Damage: 1hp per second for 5 seconds
                 * End cliloc: 1070830
                 * Reset cliloc: 1070831
                 */

                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if( timer != null )
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage( 1070831 ); // The freezing wind continues to blow!
                }
                else
                    defender.SendLocalizedMessage( 1070832 ); // An icy wind surrounds you, freezing your lungs as you breathe!

                timer = new ExpireTimer( defender, this );
                timer.Start();
                m_Table[defender] = timer;
            }
        }
开发者ID:nathanvy,项目名称:runuo,代码行数:30,代码来源:LadyOfTheSnow.cs


示例20: PlayerVendorPlaceholder

        public PlayerVendorPlaceholder(PlayerVendor vendor)
            : base(0x1F28)
        {
            Hue = 0x672;
            Movable = false;

            m_Vendor = vendor;

            m_Timer = new ExpireTimer(this);
            m_Timer.Start();
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:11,代码来源:PlayerVendor.cs



注:本文中的ExpireTimer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Export类代码示例发布时间:2022-05-24
下一篇:
C# ExpectingLine类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap