本文整理汇总了C#中ExpireTimer.Start方法的典型用法代码示例。如果您正苦于以下问题:C# ExpireTimer.Start方法的具体用法?C# ExpireTimer.Start怎么用?C# ExpireTimer.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExpireTimer
的用法示例。
在下文中一共展示了ExpireTimer.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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;
}
}
示例3: 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;
}
}
示例4: 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();
}
示例5: 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();
}
示例6: 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();
}
示例7: 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();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
}
示例11: 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();
}
示例12: 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;
}
}
示例13: OnCast
public override void OnCast()
{
BaseWeapon weapon = this.Caster.Weapon as BaseWeapon;
if (weapon == null || weapon is Fists)
{
this.Caster.SendLocalizedMessage(501078); // You must be holding a weapon.
}
else if (this.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;
}
this.Caster.PlaySound(0x20C);
this.Caster.PlaySound(soundID);
this.Caster.FixedParticles(0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist);
IEntity from = new Entity(Serial.Zero, new Point3D(this.Caster.X, this.Caster.Y, this.Caster.Z), this.Caster.Map);
IEntity to = new Entity(Serial.Zero, new Point3D(this.Caster.X, this.Caster.Y, this.Caster.Z + 50), this.Caster.Map);
Effects.SendMovingParticles(from, to, itemID, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
double seconds = this.ComputePowerValue(20);
// TODO: Should caps be applied?
int pkarma = this.Caster.Karma;
if (pkarma > 5000)
seconds = 11.0;
else if (pkarma >= 4999)
seconds = 10.0;
else if (pkarma >= 3999)
seconds = 9.00;
else if (pkarma >= 2999)
seconds = 8.0;
else if (pkarma >= 1999)
seconds = 7.0;
else if (pkarma >= 999)
seconds = 6.0;
else
seconds = 5.0;
TimeSpan duration = TimeSpan.FromSeconds(seconds);
Timer t = (Timer)m_Table[weapon];
if (t != null)
{
BuffInfo.RemoveBuff(Caster, BuffIcon.ConsecrateWeapon);
t.Stop();
}
weapon.ConsecrateDamageBonus = 0;
weapon.ConsecrateProcChance = 0;
if (Caster.Skills.Chivalry.Value >= 90)
{
double calc = Caster.Skills.Chivalry.Value - 90;
weapon.ConsecrateDamageBonus = ((int)Math.Truncate(calc / 2));
}
if (Caster.Skills.Chivalry.Value >= 80)
weapon.ConsecrateProcChance = 100;
else
weapon.ConsecrateProcChance = Caster.Skills.Chivalry.Value;
weapon.Consecrated = true;
m_Table[weapon] = t = new ExpireTimer(weapon, duration);
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ConsecrateWeapon, 1151385, 1151386, duration, Caster, String.Format("{0}\t{1}", weapon.ConsecrateProcChance, weapon.ConsecrateDamageBonus)));
t.Start();
}
//.........这里部分代码省略.........
示例14: 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;
}
}
示例15: 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();
}