本文整理汇总了C#中Server.Mobile.EndAction方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.EndAction方法的具体用法?C# Mobile.EndAction怎么用?C# Mobile.EndAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.EndAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Craft
public static void Craft( Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem )
{
if ( from.Backpack == null )
{
from.EndAction( typeof( CraftSystem ) );
return;
}
Timer.DelayCall( TimeSpan.FromSeconds( craftSystem.Delay ), new TimerCallback(
delegate
{
if ( from.Backpack.GetAmount( typeof( Bottle ) ) < 1 || from.Backpack.GetAmount( typeof( PlantClippings ) ) < 1 )
{
from.EndAction( typeof( CraftSystem ) );
// You don't have the components needed to make that.
from.SendGump( new CraftGump( from, craftSystem, tool, 1044253 ) );
}
else if ( ShouldChooseHue( from ) )
{
from.SendLocalizedMessage( 1074794 ); // Target the material to use:
from.Target = new ClippingsTarget( craftSystem, typeRes, tool, craftItem );
}
else
{
from.EndAction( typeof( CraftSystem ) );
DoCraft( from, craftSystem, typeRes, tool, craftItem, from.Backpack.FindItemByType<PlantClippings>() );
}
}
) );
}
示例2: Use
public override bool Use( Mobile from ) {
if ( from.BeginAction( typeof( ClarityPotion ) ) ) {
int amount = Utility.Dice( 3, 3, 3 );
int time = Utility.RandomMinMax( 5, 30 );
from.PlaySound( 0x2D6 );
if ( from.Body.IsHuman ) {
from.Animate( 34, 5, 1, true, false, 0 );
}
from.FixedParticles( 0x375A, 10, 15, 5011, EffectLayer.Head );
from.PlaySound( 0x1EB );
StatMod mod = from.GetStatMod( "Concussion" );
if ( mod != null ) {
from.RemoveStatMod( "Concussion" );
from.Mana -= mod.Offset;
}
from.PlaySound( 0x1EE );
from.AddStatMod( new StatMod( StatType.Int, "clarity-potion", amount, TimeSpan.FromMinutes( time ) ) );
Timer.DelayCall( TimeSpan.FromMinutes( time ), delegate() {
from.EndAction( typeof( ClarityPotion ) );
} );
return true;
}
return false;
}
示例3: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
Item toImbue = targeted as Item;
if ( Imbuing.Check( from, toImbue ) )
from.SendGump( new SelectPropGump( toImbue ) );
else
from.EndAction( typeof( Imbuing ) );
}
示例4: Remove
public static void Remove(Mobile m)
{
if (m_Table.ContainsKey(m))
{
m.RemoveSkillMod(m_Table[m]);
m_Table.Remove(m);
}
m.EndAction(typeof(RogueShadowSpell));
}
示例5: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
Item item = targeted as Item;
IImbuable toUnravel = targeted as IImbuable;
from.EndAction( typeof( Imbuing ) );
if ( !Soulforge.CheckProximity( from, 2 ) )
from.SendLocalizedMessage( 1080433 ); // You must be near a soulforge to magically unravel an item.
else if ( !Soulforge.CheckQueen( from ) )
from.SendLocalizedMessage( 1113736 ); // You must rise to the rank of noble in the eyes of the Gargoyle Queen before her majesty will allow you to use this soulforge.
else if ( item == null || !item.IsChildOf( from.Backpack ) )
from.SendLocalizedMessage( 1080424 ); // The item must be in your backpack to magically unravel it.
else
Unraveling.TryUnravel( from, item, true );
}
示例6: Drink
public override void Drink( Mobile from )
{
if ( from.BeginAction( typeof( LightCycle ) ) )
{
// ** EDIT ** Time System
//new LightCycle.NightSightTimer( from ).Start();
//from.LightLevel = LightCycle.DungeonLevel / 2;
from.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
from.PlaySound( 0x1E3 );
BasePotion.PlayDrinkEffect( from );
this.Consume();
int oldLevel = LightCycle.DungeonLevel / 2;
int level = TimeSystem.EffectsEngine.GetNightSightLevel(from, oldLevel);
if (level > -1)
{
from.LightLevel = level;
TimeSystem.EffectsEngine.SetNightSightOn(from, oldLevel);
}
else
{
from.EndAction(typeof(LightCycle));
from.SendMessage("The potion seems to have no effect.");
}
// ** END *** Time System
}
else
{
from.SendMessage( "You already have nightsight." );
}
}
示例7: Craft
public static void Craft( Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem )
{
if ( !( from is PlayerMobile ) || !( (PlayerMobile) from ).BasketWeaving )
{
from.EndAction( typeof( CraftSystem ) );
// You haven't learned basket weaving. Perhaps studying a book would help!
from.SendGump( new CraftGump( from, craftSystem, tool, 1112253 ) );
}
else
{
Timer.DelayCall( TimeSpan.FromSeconds( craftSystem.Delay ), new TimerCallback(
delegate
{
from.SendLocalizedMessage( 1074794 ); // Target the material to use:
from.Target = new ReedsTarget( craftSystem, typeRes, tool, craftItem );
}
) );
}
}
示例8: RemoveEffect
public static void RemoveEffect(Mobile m)
{
if (m_Table.ContainsKey(m))
{
object[] mods = m_Table[m];
if (mods != null)
{
m.RemoveStatMod(((StatMod)mods[0]).Name);
m.RemoveSkillMod((SkillMod)mods[1]);
m.RemoveSkillMod((SkillMod)mods[2]);
}
m_Table.Remove(m);
m.BodyMod = 0;
m.EndAction(typeof(RogueSlyFoxSpell));
}
}
示例9: RemoveEffect
public static void RemoveEffect(Mobile m)
{
if (m_Table.ContainsKey(m))
{
object[] mods = (object[])m_Table[m];
if (mods != null)
{
m.RemoveStatMod(((StatMod)mods[0]).Name);
m.RemoveStatMod(((StatMod)mods[1]).Name);
m.RemoveSkillMod((SkillMod)mods[2]);
m.RemoveSkillMod((SkillMod)mods[3]);
m.RemoveSkillMod((SkillMod)mods[4]);
m.RemoveSkillMod((SkillMod)mods[5]);
m.RemoveSkillMod((SkillMod)mods[6]);
}
m_Table.Remove(m);
m.EndAction(typeof(RogueIntimidationSpell));
}
}
示例10: DismountAttack
public static void DismountAttack( Mobile from, Mobile target )
{
target.Damage( 1, from );
IMount mt = target.Mount;
if ( mt != null )
{
mt.Rider = null;
}
if ( target.IsPlayer )
{
target.BeginAction( typeof( BaseMount ) );
target.SendLocalizedMessage( 1040023 ); // You have been knocked off of your mount!
target.EndAction( typeof( BaseMount ) );
}
from.DoHarmful( target );
}
示例11: ApplyEffect
public override void ApplyEffect(Mobile to, Mobile source, int intensity, Item itemSource)
{
if (to.BeginAction(typeof(LightCycle)))
{
int oldLevel = to.LightLevel;
int level = TimeSystem.EffectsEngine.GetNightSightLevel(to, oldLevel);
if (level > -1)
{
to.LightLevel = level;
TimeSystem.EffectsEngine.SetNightSightOn(to, oldLevel);
}
else
{
to.EndAction(typeof(LightCycle));
to.SendMessage("The potion seems to have no effect.");
}
}
}
示例12: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
Container cont = targeted as Container;
from.EndAction( typeof( Imbuing ) );
if ( !Soulforge.CheckProximity( from, 2 ) )
from.SendLocalizedMessage( 1080433 ); // You must be near a soulforge to magically unravel an item.
else if ( !Soulforge.CheckQueen( from ) )
from.SendLocalizedMessage( 1113736 ); // You must rise to the rank of noble in the eyes of the Gargoyle Queen before her majesty will allow you to use this soulforge.
else if ( cont == null )
from.SendLocalizedMessage( 1111814, "0\t0" ); // Unraveled: ~1_COUNT~/~2_NUM~ items
else if ( !cont.IsChildOf( from.Backpack ) )
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
else if ( HasSpecialMaterialItem( cont ) )
{
from.BeginAction( typeof( Imbuing ) );
from.SendGump( new ConfirmUnravelContainerGump( cont ) );
}
else
{
Unraveling.UnravelContainer( from, cont );
}
}
示例13: OnDoubleClick
public override void OnDoubleClick(Mobile m)
{
if (m == null || m.Deleted)
{
return;
}
if (FuseLit)
{
m.SendMessage("The fuse is already burning.");
return;
}
if (!this.CheckDoubleClick(m, true, false, 10))
{
return;
}
if (!m.BeginAction(UseLock))
{
m.SendMessage("You must wait before you can light another {0}.", this.ResolveName(m));
return;
}
MoveToWorld(m.Location, m.Map);
Timer.DelayCall(UseDelay, () => m.EndAction(UseLock));
IgniteFuse(m);
InvalidateProperties();
}
示例14: EndLock
private void EndLock( Mobile m )
{
m.EndAction( this );
}
示例15: EndPolymorph
private static void EndPolymorph( Mobile m )
{
if( !m.CanBeginAction( typeof( PolymorphSpell ) ) )
{
m.BodyMod = 0;
m.HueMod = -1;
m.EndAction( typeof( PolymorphSpell ) );
BaseArmor.ValidateMobile( m );
BaseClothing.ValidateMobile( m );
}
}