本文整理汇总了C#中Server.Mobile.CanBeginAction方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.CanBeginAction方法的具体用法?C# Mobile.CanBeginAction怎么用?C# Mobile.CanBeginAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.CanBeginAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) )
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
from.SendLocalizedMessage( 501605 ); // You are already disguised.
else
{
/* TODO: Desde el Publish 37 OSI no modifica el body del personaje al
* usar la TribalPaint, para que los elfos se sigan viendo con body
* de elfo. No obstante, no podemos eliminar esto ya que RunUO basa
* todo el código del efecto en si el personaje tiene este body o no.
*/
from.BodyMod = ( from.Female ? 184 : 183 );
from.HueMod = 0;
if ( from is PlayerMobile )
( (PlayerMobile) from ).SavagePaintExpiration = TimeSpan.FromDays( 7.0 );
from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
Consume();
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
示例2: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
{
from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
}
else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
{
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
}
else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
{
from.SendLocalizedMessage( 501605 ); // You are already disguised.
}
else
{
from.BodyMod = ( from.Female ? 184 : 183 );
from.HueMod = 0;
if ( from is PlayerMobile )
((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays( 7.0 );
from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
Consume();
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
示例3: Polymorph
public void Polymorph( Mobile m )
{
if ( !m.CanBeginAction( typeof( PolymorphSpell ) ) || !m.CanBeginAction( typeof( IncognitoSpell ) ) || m.IsBodyMod )
return;
IMount mount = m.Mount;
if ( mount != null )
mount.Rider = null;
if ( m.Mounted )
return;
if ( m.BeginAction( typeof( PolymorphSpell ) ) )
{
Item disarm = m.FindItemOnLayer( Layer.OneHanded );
if ( disarm != null && disarm.Movable )
m.AddToBackpack( disarm );
disarm = m.FindItemOnLayer( Layer.TwoHanded );
if ( disarm != null && disarm.Movable )
m.AddToBackpack( disarm );
m.BodyMod = 42;
m.HueMod = 0;
new ExpirePolymorphTimer( m ).Start();
}
}
示例4: ValidateUse
public bool ValidateUse( Mobile from )
{
PlayerMobile pm = from as PlayerMobile;
if ( !IsChildOf( from.Backpack ) )
{
// That must be in your pack for you to use it.
from.SendLocalizedMessage( 1042001 );
}
else if ( pm == null || pm.NpcGuild != NpcGuild.ThievesGuild )
{
// Only Members of the thieves guild are trained to use this item.
from.SendLocalizedMessage( 501702 );
}
else if ( Stealing.SuspendOnMurder && pm.Kills > 0 )
{
// You are currently suspended from the thieves guild. They would frown upon your actions.
from.SendLocalizedMessage( 501703 );
}
else if ( !from.CanBeginAction( typeof( IncognitoSpell ) ) )
{
// You cannot disguise yourself while incognitoed.
from.SendLocalizedMessage( 501704 );
}
else if ( Factions.Sigil.ExistsOn( from ) )
{
from.SendLocalizedMessage( 1010465 ); // You cannot disguise yourself while holding a sigil
}
else if ( TransformationSpellHelper.UnderTransformation( from ) )
{
// You cannot disguise yourself while in that form.
from.SendLocalizedMessage( 1061634 );
}
else if ( from.BodyMod == 183 || from.BodyMod == 184 )
{
// You cannot disguise yourself while wearing body paint
from.SendLocalizedMessage( 1040002 );
}
else if ( !from.CanBeginAction( typeof( PolymorphSpell ) ) || from.IsBodyMod )
{
// You cannot disguise yourself while polymorphed.
from.SendLocalizedMessage( 501705 );
}
else
{
return true;
}
return false;
}
示例5: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it.
}
else if ( !from.CanBeginAction( typeof( Bola ) ) )
{
from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola!
}
else if ( from.Target is BolaTarget )
{
from.SendLocalizedMessage( 1049631 ); // This bola is already being used.
}
else if ( !HasFreeHands( from ) )
{
from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this
}
else if ( from.Mounted )
{
from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount
}
else if ( Server.Spells.Ninjitsu.AnimalForm.UnderTransformation( from ) )
{
from.SendLocalizedMessage( 1070902 ); // You can't use this while in an animal form!
}
else
{
EtherealMount.StopMounting( from );
from.Target = new BolaTarget( this );
from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola...
}
}
示例6: OnMovement
public override void OnMovement( Mobile m, Point3D oldLocation )
{
base.OnMovement( m, oldLocation );
Tournament tourny = null;
if ( m_Tournament != null )
tourny = m_Tournament.Tournament;
if ( InRange( m, 4 ) && !InRange( oldLocation, 4 ) && tourny != null && tourny.Stage == TournamentStage.Signup && m.CanBeginAction( this ) )
{
Ladder ladder = Ladder.Instance;
if ( ladder != null )
{
LadderEntry entry = ladder.Find( m );
if ( entry != null && Ladder.GetLevel( entry.Experience ) < tourny.LevelRequirement )
return;
}
if ( tourny.HasParticipant( m ) )
return;
PrivateOverheadMessage( MessageType.Regular, 0x35, false, String.Format( "Hello m'{0}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.Female ? "Lady" : "Lord" ), m.NetState );
m.BeginAction( this );
Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerStateCallback( ReleaseLock_Callback ), m );
}
}
示例7: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it.
}
else if ( !from.CanBeginAction( typeof( Bola ) ) )
{
from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola!
}
else if ( from.Target is BolaTarget )
{
from.SendLocalizedMessage( 1049631 ); // This bola is already being used.
}
else if ( !BasePotion.HasFreeHand( from ) )
{
from.SendMessage( "You need a free hand to throw this." );
}
else if ( from.Mounted )
{
from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount
}
else
{
EtherealMount.StopMounting( from );
from.Target = new BolaTarget( this );
from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola...
}
}
示例8: CheckUse
private bool CheckUse( Mobile from )
{
if ( !this.IsAccessibleTo( from ) )
return false;
if ( from.Map != this.Map || !from.InRange( GetWorldLocation(), 2 ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return false;
}
if ( !from.CanBeginAction( typeof( FireHorn ) ) )
{
from.SendLocalizedMessage( 1049615 ); // You must take a moment to catch your breath.
return false;
}
int sulfAsh = Core.AOS ? 4 : 15;
if ( from.Backpack == null || from.Backpack.GetAmount( typeof( SulfurousAsh ) ) < sulfAsh )
{
from.SendLocalizedMessage( 1049617 ); // You do not have enough sulfurous ash.
return false;
}
return true;
}
示例9: Nullify
public static void Nullify(Mobile from)
{
if (!from.CanBeginAction(typeof(DefensiveSpell)))
{
new InternalTimer(from).Start();
}
}
示例10: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it.
}
else if ( !from.CanBeginAction( typeof( Bola ) ) )
{
from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola!
}
else if ( from.Target is BolaTarget )
{
from.SendLocalizedMessage( 1049631 ); // This bola is already being used.
}
else if ( from.FindItemOnLayer( Layer.OneHanded ) != null || from.FindItemOnLayer( Layer.TwoHanded ) != null )
{
from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this
}
else if ( from.Mounted )
{
from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount
}
else
{
from.Target = new BolaTarget( this );
from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola...
}
}
示例11: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
if ( Factions.Sigil.ExistsOn( from ) )
{
from.SendLocalizedMessage( 1010465 ); // You cannot disguise yourself while holding a sigil.
}
else if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
{
from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
}
else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
{
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
}
else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) )
{
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
}
else if ( Spells.Ninjitsu.AnimalForm.UnderTransformation( from ) )
{
from.SendLocalizedMessage( 1061634 ); // You cannot disguise yourself while in that form.
}
else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
{
from.SendLocalizedMessage( 501605 ); // You are already disguised.
}
else
{
from.BodyMod = ( from.Female ? 184 : 183 );
from.HueMod = this.Hue;
if ( from is PlayerMobile )
((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays( 7.0 );
from.SendMessage( "You now paint your body. Your body paint will last about a week or you can remove it with an oil cloth.");
Consume();
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
示例12: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
{
//from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
from.SendMessage( "You decide against eating it while incognitoed " );
}
else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
{
//from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
from.SendMessage( "You can not be polymorphed at this time" );
}
else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) )
{
//from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
from.SendMessage( "You decide against eating it while polymorphed" );
}
else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask || from.FindItemOnLayer( Layer.Helm ) is OrcishKinRPMask )
{
//from.SendLocalizedMessage( 501605 ); // You are already disguised.
from.SendMessage( "You decide against eating it while as your disguised" );
}
else
{
from.BodyMod = ( from.Female ? 186 : 185 );
from.HueMod = 0;
if ( from is PlayerMobile )
((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays( 7.0 );
//from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
from.SendMessage( "You now bear the markings of the undead pirates. This will last about a week" );
from.PlaySound( Utility.Random( 0x3A, 3 ) );
if ( from.Body.IsHuman && !from.Mounted )
from.Animate( 34, 5, 1, true, false, 0 );
from.ApplyPoison( from, Poison.Lethal );
Consume();
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
示例13: GetScalar
public static double GetScalar( Mobile m )
{
double val = 1.0;
if ( m.CanBeginAction( typeof( RangerHuntersAimSpell ) ) )
val = 1.5;
return val;
}
示例14: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack))
{
if (Factions.Sigil.ExistsOn(from))
{
from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil.
}
else if (!from.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
{
from.SendLocalizedMessage(501698); // You cannot disguise yourself while incognitoed.
}
else if (!from.CanBeginAction(typeof(Spells.Seventh.PolymorphSpell)))
{
from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
}
else if (TransformationSpellHelper.UnderTransformation(from))
{
from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
}
else if (from.IsBodyMod || from.FindItemOnLayer(Layer.Helm) is OrcishKinMask)
{
from.SendLocalizedMessage(501605); // You are already disguised.
}
else
{
from.BodyMod = (from.Female ? 184 : 183);
from.HueMod = 400;
if (from is PlayerMobile)
((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays(2.0);
from.SendMessage("You now bear the markings of a Blackthorn Coven member. This will wear off in 2 days.");
Consume();
}
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
示例15: OnUse
public static TimeSpan OnUse( Mobile m )
{
if ( !m.Hidden )
{
m.SendLocalizedMessage( 502725 ); // You must hide first
}
else if ( m.Skills[SkillName.Hiding].Base < 30.0 )
{
m.SendLocalizedMessage( 502726 ); // You are not hidden well enough. Become better at hiding.
m.RevealingAction();
}
else if ( !m.CanBeginAction( typeof( Stealth ) ) )
{
m.SendLocalizedMessage( 1063086 ); // You cannot use this skill right now.
m.RevealingAction();
}
else if ( m.Flying )
{
m.SendLocalizedMessage( 1113415 ); // You cannot use this ability while flying.
m.RevealingAction();
}
else
{
int armorRating = GetArmorRating( m );
if ( armorRating >= 42 ) // I have a hunch '42' was chosen cause someone's a fan of DNA
{
m.SendLocalizedMessage( 502727 ); // You could not hope to move quietly wearing this much armor.
m.RevealingAction();
}
else if ( m.CheckSkill( SkillName.Stealth, -20.0 + ( armorRating * 2 ), 60.0 + ( armorRating * 2 ) ) )
{
int steps = (int) ( m.Skills[SkillName.Stealth].Value / 5.0 );
if ( steps < 1 )
steps = 1;
m.AllowedStealthSteps = steps;
m.IsStealthing = true;
m.SendLocalizedMessage( 502730 ); // You begin to move quietly.
return TimeSpan.FromSeconds( 10.0 );
}
else
{
m.SendLocalizedMessage( 502731 ); // You fail in your attempt to move unnoticed.
m.RevealingAction();
}
}
return TimeSpan.FromSeconds( 10.0 );
}