本文整理汇总了C#中Server.Mobiles.PlayerMobile.BeginAction方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile.BeginAction方法的具体用法?C# PlayerMobile.BeginAction怎么用?C# PlayerMobile.BeginAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.PlayerMobile
的用法示例。
在下文中一共展示了PlayerMobile.BeginAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyNightSight
public bool ApplyNightSight(PlayerMobile Wearer)
{
Spell spell = new NightSightSpell(Wearer,null);
if( Wearer == null )
return false;
if (Wearer.Region.OnBeginSpellCast( Wearer, spell ) == false)
{
Wearer.SendMessage("The magic normally within this object seems absent.");
return false;
}
//Pix: this was borrowed from the NightSight spell...
else if( Wearer.BeginAction( typeof( LightCycle ) ) )
{
new LightCycle.NightSightTimer( Wearer ).Start();
int level = 25;
Wearer.LightLevel = level;
Wearer.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
Wearer.PlaySound( 0x1E3 );
return true;
}
return false;
}
示例2: OnVirtueRejected
public static void OnVirtueRejected( PlayerMobile protector, PlayerMobile protectee )
{
string args = String.Format( "{0}\t{1}", protector.Name, protectee.Name );
protectee.SendLocalizedMessage( 1049453, args ); // You have declined protection from ~1_NAME~.
protector.SendLocalizedMessage( 1049454, args ); // ~2_NAME~ has declined your protection.
if ( protector.BeginAction( typeof( JusticeVirtue ) ) )
Timer.DelayCall( TimeSpan.FromMinutes( 15.0 ), new TimerStateCallback( RejectDelay_Callback ), protector );
}
示例3: ApplyMagicReflectEffect
public bool ApplyMagicReflectEffect(PlayerMobile Wearer)
{
if (Wearer == null)
return false;
Spell spell = new MagicReflectSpell(Wearer,null);
if ( Wearer.MagicDamageAbsorb > 0 )
{
Wearer.SendMessage("The magic of this item is already protecting you.");
return false;
}
else if (Wearer.Region.OnBeginSpellCast( Wearer, spell ) == false)
{
Wearer.SendMessage("The magic normally within this object seems absent.");
return false;
}
else if ( !Wearer.CanBeginAction( typeof( DefensiveSpell ) ) )
{
Wearer.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
return false;
}
else
{
if ( Wearer.BeginAction( typeof( DefensiveSpell ) ) )
{
int value = (int)((Utility.Random(51) + 50) + (Utility.Random(51) + 50)); // Random value of up to 100 for magery and up to 100 for scribing - lowest though is 50 magery/50 scribing equivalent strength
value = (int)(8 + (value/200)*7.0);//absorb from 8 to 15 "circles"
Wearer.MagicDamageAbsorb = value;
Wearer.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist );
Wearer.PlaySound( 0x1E9 );
Wearer.SendMessage("You feel the magic of the item envelope you.");
return true;
}
else
{
Wearer.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
return false;
}
}
}