本文整理汇总了C#中Server.Items.InternalTimer类的典型用法代码示例。如果您正苦于以下问题:C# InternalTimer类的具体用法?C# InternalTimer怎么用?C# InternalTimer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InternalTimer类属于Server.Items命名空间,在下文中一共展示了InternalTimer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckBSequence( m ) )
{
//Stop the old reflect timer, if we have any.
StopTimer(m);
m.MagicDamageAbsorb = 15; //to make sure it will reflect any spell.
Timer protectionTimer = new InternalTimer(m);
protectionTimer.Start();
//Register it with the list
m_Timers.Add(m, protectionTimer);
m.FixedParticles(0x373A, 10, 15, 5016, EffectLayer.Waist);
m.PlaySound( Sound );
}
FinishSequence();
}
示例2: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( m is Mobiles.BaseVendor || m is Mobiles.PlayerVendor || m is Mobiles.PlayerBarkeeper || 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;
BuffInfo.RemoveBuff( m, BuffIcon.HidingAndOrStealth );
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Invisibility, 1075825 ) ); //Invisibility/Invisible
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();
}
示例3: ApplyProtectionEffect
public static void ApplyProtectionEffect(Mobile target, Mobile caster)
{
if (caster != null && !caster.CanBeBeneficial(target, false))
return;
//Stop the old protection timer, if we have any.
StopTimer(target);
// Temporary "easy way out" fix for stacking protection on server restarts.
// I'll get to fixing this properly soon. I know the problems it causes
// but this can't be abused as much in the meantime - Malik
//if (target is PlayerMobile)
// StopTimer(target);
target.VirtualArmor += ArmorModValue;
Timer protectionTimer = new InternalTimer(target);
protectionTimer.Start();
//Register it with the list
m_Timers.Add(target, protectionTimer);
target.FixedParticles(0x373A, 10, 15, 5016, EffectLayer.Waist);
target.PlaySound(493);
}
示例4: Drink
public override void Drink( Mobile m )
{
TimeSpan duration = TimeSpan.FromMinutes( 1 );
if (m.Hidden == false)
{
m.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
m.PlaySound( 0x3C4 );
BuffInfo.RemoveBuff( m, BuffIcon.HidingAndOrStealth );
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Invisibility, 1075825 ) ); //Invisibility/Invisible
BasePotion.PlayDrinkEffect( m );
this.Consume();
m.Hidden = true;
RemoveTimer( m );
Timer t = new InternalTimer( m, duration );
m_Table[m] = t;
t.Start();
}
else
{
m.SendMessage( "An invisibility potion is already taking effect on your person." ); //An invisibility potion is already taking effect on your person.
}
}
示例5: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
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( Caster.Skills[SkillName.Magery].Value * 1.2 ); // 120% of magery
Timer t = new InternalTimer( m, duration );
m_Table[m] = t;
t.Start();
}
FinishSequence();
}
示例6: DoSleep
public static void DoSleep( Mobile from, Mobile m )
{
double alchemy = from.Skills.Alchemy.Value;
double resist = m.Skills.MagicResist.Value;
double enhancePotions = GetEnhancePotions( from );
int seconds = (int) ( alchemy + ( enhancePotions / 2 ) - ( resist + 40 ) ) / 10;
if ( seconds > 0 )
{
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Paralyze, 1095150, 1095151, TimeSpan.FromSeconds( seconds ), m, seconds.ToString() ) );
Timer t = new InternalTimer( m, DateTime.Now + TimeSpan.FromSeconds( seconds ) );
t.Start();
m_SleptTable[m] = t;
m.ForcedWalk = true;
}
else
{
from.SendLocalizedMessage( 1095149 ); // Your target resists the exploding tar potion.
m.SendLocalizedMessage( 1095148 ); // You resist the exploding tar potion.
}
}
示例7: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendAsciiMessage( "Target can not be seen." );
}
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( 0x203 );
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();
}
示例8: ChickenEggLayer
public ChickenEggLayer() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "egg laying chicken";
Body = 0xD0;
BaseSoundID = 0x6E;
SetStr( 5 );
SetDex( 15 );
SetInt( 5 );
SetHits( 3 );
SetMana( 0 );
SetDamage( 1 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 1, 5 );
SetSkill( SkillName.MagicResist, 4.0 );
SetSkill( SkillName.Tactics, 5.0 );
SetSkill( SkillName.Wrestling, 5.0 );
Fame = 150;
Karma = 0;
VirtualArmor = 2;
Tamable = true;
ControlSlots = 1;
MinTameSkill = -0.9;
Timer PondTimer = new InternalTimer(this);
PondTimer.Start();
}
示例9: SGEFieldEast
public SGEFieldEast(Point3D from, Map map)
: base(from, map)
{
Map = map;
InternalTimer t = new InternalTimer(this);
t.Start();
}
示例10: WildHorse
public WildHorse( string name ) : base( name, 0xE2, 0x3EA0, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
int random = Utility.Random( 4 );
Body = m_IDs[random * 2];
ItemID = m_IDs[random * 2 + 1];
BaseSoundID = 0xA8;
SetStr( 22, 98 );
SetDex( 56, 75 );
SetInt( 6, 10 );
SetHits( 28, 45 );
SetMana( 0 );
SetDamage( 3, 4 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 15, 20 );
SetSkill( SkillName.MagicResist, 25.1, 30.0 );
SetSkill( SkillName.Tactics, 29.3, 44.0 );
SetSkill( SkillName.Wrestling, 29.3, 44.0 );
Fame = 300;
Karma = 300;
Tamable = true;
ControlSlots = 1;
MinTameSkill = 29.1;
Timer PondTimer = new InternalTimer(this);
PondTimer.Start();
}
示例11: BeginGuardOff
public static void BeginGuardOff( Mobile m, Mobile caster )
{
if ( m_Table.ContainsKey( m.Serial ) )
{
Timer timer = m_Table[m.Serial];
timer.Stop();
m_Table.Remove( m.Serial );
}
List<ResistanceMod> mods = new List<ResistanceMod>();
mods.Add( new ResistanceMod( ResistanceType.Physical, -(m.PhysicalResistance / 2) ) );
mods.Add( new ResistanceMod( ResistanceType.Fire, -(m.FireResistance / 2) ) );
mods.Add( new ResistanceMod( ResistanceType.Cold, -(m.ColdResistance / 2) ) );
mods.Add( new ResistanceMod( ResistanceType.Poison, -(m.PoisonResistance / 2) ) );
mods.Add( new ResistanceMod( ResistanceType.Energy, -(m.EnergyResistance / 2) ) );
Double duration = ( BlueSpell.ScaleBySkill( caster, SkillName.Forensics ) * 3.0 );
InternalTimer timertostart = new InternalTimer( m, mods, duration );
timertostart.Start();
m_Table.Add( m.Serial, timertostart );
for ( int i = 0; i < mods.Count; ++i )
m.AddResistanceMod( mods[i] );
m.SendMessage( "Your guard has been lowered" );
}
示例12: AddTimer
public static void AddTimer( Mobile m, TimeSpan duration )
{
Timer t = new InternalTimer( m, duration );
m_Table[m] = t;
t.Start();
}
示例13: GuardianTreasureChest
public GuardianTreasureChest( int itemID )
: base(itemID)
{
for ( int i = 0; i < 5; i++ )
Fill();
m_Timer = new InternalTimer( this );
m_Timer.Start();
}
示例14: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
m_Timer = new InternalTimer( this, TimeSpan.Zero );
m_Timer.Start();
}
示例15: StartTimer
public static void StartTimer( Mobile from, Mobile to )
{
if ( !m_Table.Contains( to ) )
{
Timer t = new InternalTimer( to, from );
t.Start();
m_Table[to] = t;
}
}