本文整理汇总了C#中Server.Mobiles.PlayerMobile.BoltEffect方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile.BoltEffect方法的具体用法?C# PlayerMobile.BoltEffect怎么用?C# PlayerMobile.BoltEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.PlayerMobile
的用法示例。
在下文中一共展示了PlayerMobile.BoltEffect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: JailThem
public static void JailThem( PlayerMobile player, JailOption option )
{
if ( null == player || player.AccessLevel >= JailConfig.JailImmuneLevel )
return;
if ( JailOption.Squelch == option )
player.Squelched = true;
foreach ( Item item in player.Items )
{
if ( item is JailHammer ) // Jailed while jailed gets them another load of rock to mine
{
if ( 0 > ( ((JailHammer)item).UsesRemaining += JailConfig.UsesRemaining ) ) // handle integer overflow
((JailHammer)item).UsesRemaining *= -1;
Banker.Withdraw( player, JailConfig.FineAmount );
player.SendMessage( "Your remaining sentence has been increased!" );
player.SendMessage( "You have been fined {0} gold and are being kicked!", JailConfig.FineAmount );
// This gives a nice little delay for the message to be read
s_KickProcessingQueue.Enqueue( player );
player.Squelched = true;
Server.Timer.DelayCall( TimeSpan.FromSeconds( kSecondsTillKick ), new Server.TimerCallback( KickPlayerInQueue ) );
return;
}
}
// If mounted, dismount them and stable mount
if ( player.Mounted )
{
if ( player.Mount is EtherealMount )
{
EtherealMount pet = player.Mount as EtherealMount;
pet.Internalize();
pet.Rider = null;
}
else if ( player.Mount is BaseMount )
{
BaseMount pet = player.Mount as BaseMount;
pet.Rider = null;
Jail.StablePet( player, pet );
}
}
// Stable all other pets
foreach ( Mobile mobile in World.Mobiles.Values )
{
if ( mobile is BaseCreature )
{
BaseCreature bc = mobile as BaseCreature;
if ( null != bc && (bc.Controlled && bc.ControlMaster == player) || (bc.Summoned && bc.SummonMaster == player) )
Jail.StablePet( player, bc );
}
}
// Move all items to a bag and move that to the bank
Container backpack = player.Backpack;
Backpack bag = new Backpack(); bag.Hue = JailConfig.RobeHue;
ArrayList equipedItems = new ArrayList( player.Items );
foreach ( Item item in equipedItems )
{
if ( item.Layer == Layer.Bank || item.Layer == Layer.Backpack || item.Layer == Layer.Hair || item.Layer == Layer.FacialHair || item is DeathShroud )
continue;
bag.DropItem( item );
}
ArrayList backpackItems = new ArrayList( backpack.Items );
foreach ( Item item in backpackItems )
{
if ( item is JailRock )
item.Delete();
else if ( item.Movable ) // Non movable pack items must remain (i.e. skill balls)
bag.DropItem( item );
}
// Remember their access level and make them a player
JailHammer hammer = new JailHammer();
hammer.PlayerAccessLevel = player.AccessLevel;
player.AccessLevel = AccessLevel.Player;
// Bank the bag of belongings, give them a hammer and welcome them
player.BankBox.DropItem( bag );
player.AddItem( hammer );
// Explosively move player to jail
player.BoltEffect( 0 );
player.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Waist );
player.PlaySound( 0x307 );
player.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
player.PlaySound( 0x225 );
// This gives a nice little delay for the effect to complete
s_JailProcessingQueue.Enqueue( player );
Server.Timer.DelayCall( TimeSpan.FromSeconds( kSecondsTillJail ), new Server.TimerCallback( JailPlayerInQueue ) );
}