本文整理汇总了C#中Mobile.BeginTarget方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.BeginTarget方法的具体用法?C# Mobile.BeginTarget怎么用?C# Mobile.BeginTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.BeginTarget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTarget
public void OnTarget( Mobile from, object targeted, object state )
{
object[] states = (object[])state;
BaseCommand command = (BaseCommand)states[0];
string[] args = (string[])states[1];
if ( !BaseCommand.IsAccessible( from, targeted ) )
{
from.SendMessage( "That is not accessible." );
from.BeginTarget( -1, command.ObjectTypes == ObjectTypes.All, TargetFlags.None, new TargetStateCallback( OnTarget ), new object[]{ command, args } );
return;
}
switch ( command.ObjectTypes )
{
case ObjectTypes.Both:
{
if ( !(targeted is Item) && !(targeted is Mobile) )
{
from.SendMessage( "This command does not work on that." );
return;
}
break;
}
case ObjectTypes.Items:
{
if ( !(targeted is Item) )
{
from.SendMessage( "This command only works on items." );
return;
}
break;
}
case ObjectTypes.Mobiles:
{
if ( !(targeted is Mobile) )
{
from.SendMessage( "This command only works on mobiles." );
return;
}
break;
}
}
RunCommand( from, targeted, command, args );
from.BeginTarget( -1, command.ObjectTypes == ObjectTypes.All, TargetFlags.None, new TargetStateCallback( OnTarget ), new object[]{ command, args } );
}
示例2: Link_OnFirstTarget
private static void Link_OnFirstTarget( Mobile from, object targeted )
{
BaseDoor door = targeted as BaseDoor;
if ( door == null )
{
from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( Link_OnFirstTarget ) );
from.SendMessage( "That is not a door. Try again." );
}
else
{
from.BeginTarget( -1, false, TargetFlags.None, new TargetStateCallback( Link_OnSecondTarget ), door );
from.SendMessage( "Target the second door to link." );
}
}
示例3: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
return;
}
if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
{
//to prevent exploiting for pvp
from.SendLocalizedMessage( 1075857 ); // You can not use that while paralyzed.
return;
}
if ( m_Timer == null )
{
m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1 ), TimeSpan.FromSeconds( 1 ), new TimerCallback( OnFirebombTimerTick ) );
m_LitBy = from;
from.SendLocalizedMessage( 1060581 ); //You light the firebomb! Throw it now!
}
else
from.SendLocalizedMessage( 1060582 ); //You've already lit it! Better throw it now!
from.BeginTarget( 12, true, TargetFlags.None, new TargetCallback( OnFirebombTarget ) );
}
示例4: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("You must have the Retouching Tool in your backpack!");
}
from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
}
示例5: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack))
{
from.SendMessage("What would you like to scour?");
from.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, new TargetCallback(OnTarget));
}
}
示例6: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if (from.Mounted && !TrapHelper.CanWorkMounted)
{
from.SendMessage( "You cannot deploy a Lobster Trap while mounted." );
return;
}
from.BeginTarget(-1, true, TargetFlags.None, new TargetCallback(OnTarget));
}
示例7: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (from == null || from.Backpack == null)
return;
if (!IsChildOf(from.Backpack))
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
else
from.BeginTarget(1, false, TargetFlags.None, new TargetCallback(CellKey_OnTarget));
}
示例8: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (from.EquipItem(this) || IsChildOf(from))
{
from.PlaySound(0x166);
from.PublicOverheadMessage(MessageType.Emote, 33, true, "*The Daemon claws demand a soul*");
from.BeginTarget(-1, true, TargetFlags.None, OnTarget);
}
else
from.SendAsciiMessage("You must equip the claws to use them");
}
示例9: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
{
from.SendLocalizedMessage(501816);
return;
}
from.SendMessage("Dans quoi souhaitez-vous l'enfoncer?");
from.BeginTarget(1, false, TargetFlags.Harmful, new TargetCallback(OnTarget));
}
示例10: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (from.Karma > -2500)
{
base.OnDoubleClick(from);
return;
}
from.SendMessage("Vous seriez assez méchant pour en faire une décoration!");
from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
}
示例11: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (m_Harvested)
{
from.SendMessage("Vous ne décelez rien sous ces écailles");
return;
}
from.SendMessage("Vous dénotez certains gravats sur les écailles");
from.SendMessage("Peut-être qu'un liquide ennemi pourrait les faire partir?");
from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
}
示例12: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack))
{
from.BeginTarget(2, false, TargetFlags.Beneficial, new TargetCallback(OnTarget));
from.SendMessage("Who would you like to resurrect?");
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
示例13: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
from.BeginTarget( 6, false, TargetFlags.None, new TargetCallback( OnTarget ) );
from.SendLocalizedMessage( 1053024 ); // Select the swamp dragon you wish to place the barding on.
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
示例14: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
from.BeginTarget( 3, false, TargetFlags.None, new TargetCallback( OnTarget ) );
from.SendMessage( "Select a Dawn's music box to add this gears to." );
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
示例15: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else
{
from.BeginTarget( 2, false, TargetFlags.None, new TargetCallback( OnTarget ) );
from.SendMessage( "What do you wish to use the gem on?" );
}
}