本文整理汇总了C#中Server.Mobile.SendAsciiMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.SendAsciiMessage方法的具体用法?C# Mobile.SendAsciiMessage怎么用?C# Mobile.SendAsciiMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.SendAsciiMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoCure
public void DoCure( Mobile from )
{
bool cure = false;
CureLevelInfo[] info = LevelInfo;
for ( int i = 0; i < info.Length; ++i )
{
CureLevelInfo li = info[i];
if ( li.Poison == from.Poison && Scale( from, li.Chance ) > Utility.RandomDouble() )
{
cure = true;
break;
}
}
if ( cure && from.CurePoison( from ) )
{
from.SendAsciiMessage( "You feel cured of poison!" ); // You feel cured of poison!
from.FixedEffect( 0x373A, 10, 15 );
from.PlaySound( 0x1E0 );
}
else if ( !cure )
{
from.SendAsciiMessage( "That potion was not strong enough to cure your ailment!" ); // That potion was not strong enough to cure your ailment!
}
}
示例2: OnTarget
protected override void OnTarget( Mobile from, object o )
{
if ( o is Item )
{
if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
{
if ( o is BaseWeapon )
((BaseWeapon)o).Identified = true;
else if ( o is BaseArmor )
((BaseArmor)o).Identified = true;
else if ( o is BaseJewel )
((BaseJewel)o).Identified = true;
if ( !Core.AOS )
((Item)o).OnSingleClick( from );
}
else
{
from.SendAsciiMessage( "You are not certain..." );
}
}
else if ( o is Mobile )
{
((Mobile)o).OnSingleClick( from );
}
else
{
from.SendAsciiMessage( "You are not certain..." );
}
}
示例3: BeginSacrifice
public void BeginSacrifice( Mobile from )
{
if ( Deleted )
return;
if ( m_Skull != null && m_Skull.Deleted )
Skull = null;
if ( from.Map != this.Map || !from.InRange( GetWorldLocation(), 3 ) )
{
from.SendAsciiMessage( "That is too far away." );
}
else if ( !Harrower.CanSpawn )
{
from.SendAsciiMessage( "The harrower has already been spawned." );
}
else if ( m_Skull == null )
{
from.SendAsciiMessage( "What would you like to sacrifice?" );
from.Target = new SacrificeTarget( this );
}
else
{
SendAsciiMessageTo( from, "I already have my champions awakening skull!");
}
}
示例4: OnTarget
protected override void OnTarget(Mobile from, object target)
{
if (target is BlankMap)
{
Item item = (Item)target;
BaseTool tool = new MapmakersPen();
if (item.RootParent != from)
from.SendAsciiMessage("That must be in your pack for you to use it.");
else
from.SendMenu(new CartographyMenu(from, CartographyMenu.Main(from), "Main", tool));
if (tool != null)
tool.Delete();
}
else if (target is WorldMap || target is LocalMap || target is CityMap || target is SeaChart)
//from.Send(new AsciiMessage(((Item)target).Serial, ((Item)target).ItemID, MessageType.Regular, 0, 3, "", "You cannot overwrite this carefully hand-drawn map!"));
from.SendAsciiMessage("You cannot overwrite this carefully hand-drawn map!");
else
{
from.SendAsciiMessage("This is not a map.");
/*if (target is Item)
from.Send(new AsciiMessage(((Item)target).Serial, ((Item)target).ItemID, MessageType.Regular, 0, 3, "", "This is not a map."));*/
}
}
示例5: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !this.VerifyMove( from ) )
return;
if ( !from.InRange( this.GetWorldLocation(), 2 ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, true, "I can't reach that." ); // I can't reach that.
return;
}
Point3D fireLocation = GetFireLocation( from );
if ( fireLocation == Point3D.Zero )
{
from.SendAsciiMessage( "There is not a spot nearby to place your campfire." ); // There is not a spot nearby to place your campfire.
}
else if ( !from.CheckSkill( SkillName.Camping, 0.0, 100.0 ) )
{
from.SendAsciiMessage("You fail to ignite the campfire."); // You fail to ignite the campfire.
}
else
{
Consume();
if ( !this.Deleted && this.Parent == null )
from.PlaceInBackpack( this );
new Campfire(from).MoveToWorld( fireLocation, from.Map );
}
}
示例6: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (from.AccessLevel > AccessLevel.Player)
{
from.SendAsciiMessage("Drop items in here for players to receive.");
DisplayTo(from);
return;
}
if (!IsChildOf(from.Backpack))
{
from.SendAsciiMessage("The scroll must be in your backpack when used.");
return;
}
Internalize(); //So you don't get overweight
Item[] items = FindItemsByType(typeof (Item), true);
bool inBank = false;
foreach (Item item in items)
{
if (!from.AddToBackpack(item))
{
from.BankBox.DropItem(item);
inBank = true;
}
}
from.SendAsciiMessage("The scroll summons treasures into your pack as you unravel it!");
if (inBank)
from.SendAsciiMessage("You are overweight, the treasures were added to your bank");
Delete();
}
示例7: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
from.RevealingAction();
int number = -1;
if ( targeted is Mobile )
{
Mobile targ = (Mobile)targeted;
if ( targ.Player ) // We can't beg from players
{
from.SendAsciiMessage("Perhaps just asking would work better.");
number = 500398; // Perhaps just asking would work better.
}
else if ( !targ.Body.IsHuman ) // Make sure the NPC is human
{
from.SendAsciiMessage("There is little chance of getting money from that!");
number = 500399; // There is little chance of getting money from that!
}
else if ( !from.InRange( targ, 2 ) )
{
if (!targ.Female)
{
from.SendAsciiMessage("You are too far away to beg from him.");
number = 500401; // You are too far away to beg from him.
}
else
from.SendAsciiMessage("You are too far away to beg from her.");
//number = 500402; // You are too far away to beg from her.
}
else if ( from.Mounted ) // If we're on a mount, who would give us money?
{
from.SendAsciiMessage("They seem unwilling to give you any money.");
number = 500404; // They seem unwilling to give you any money.
}
else
{
// Face eachother
from.Direction = from.GetDirectionTo( targ );
targ.Direction = targ.GetDirectionTo( from );
from.Animate( 32, 5, 1, true, false, 0 ); // Bow
new InternalTimer( from, targ ).Start();
m_SetSkillTime = false;
}
}
else // Not a Mobile
{
from.SendAsciiMessage("There is little chance of getting money from that!");
//number = 500399; // There is little chance of getting money from that!
}
number = -1;
if ( number != -1 )
from.SendLocalizedMessage( number );
}
示例8: OnMoveOver
public override bool OnMoveOver( Mobile m )
{
if(m_Game != null)
m_Game.RemoveItemFromGameArea(this);
Container pack = m.Backpack;
Item[] placers = pack.FindItemsByType( typeof(BombermanBombPlacer) );
foreach (Item placer in placers)
{
if(placer is BombermanBombPlacer)
{
BombermanBombPlacer realPlacer = (BombermanBombPlacer)placer;
if (placer != null)
{
if (Type == BombermanUpgradeType.Strength)
{
realPlacer.Strength = realPlacer.Strength + 1;
m.SendAsciiMessage("Your bombs are now more powerful.");
}
else if (Type == BombermanUpgradeType.BombAmount)
{
realPlacer.MaxBombs = realPlacer.MaxBombs + 1;
m.SendAsciiMessage("You can now place more bombs at the same time.");
}
else if (Type == BombermanUpgradeType.SpreadSpeed)
{
realPlacer.SpreadSpeed -= 0.001f;
m.SendAsciiMessage("Your bombs will spread faster.");
}
else if (Type == BombermanUpgradeType.KickBombPlacer)
{
BombermanKickBombPlacer kplacer = (BombermanKickBombPlacer)pack.FindItemByType(typeof(BombermanKickBombPlacer));
if (kplacer == null)
{
BombermanKickBombPlacer kickplacer = new BombermanKickBombPlacer(m, m_Game);
kickplacer.EventItem = true;
kickplacer.LootType = LootType.Newbied;
kickplacer.Strength = realPlacer.Strength;
kickplacer.MaxBombs = realPlacer.MaxBombs;
kickplacer.SpreadSpeed = realPlacer.SpreadSpeed;
m.AddToBackpack(kickplacer);
m.SendAsciiMessage("You have received a kickbombplacer. You can now kick bombs over stones.");
}
else
{
kplacer.Range += 1;
m.SendAsciiMessage("The range of your kickbombplacer has increased.");
}
}
}
else
m.SendAsciiMessage("You do not have a Bomberman Bomb Placer in your backpack");
}
}
Delete();
return true;
}
示例9: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted is Mobile )
{
if ( targeted is PlayerMobile )
{
if ( targeted == m_Sender )
from.SendAsciiMessage( "You cannot duel yourself." );
else if ( DuelGump.Exists( (Mobile)targeted ) || ((Mobile)targeted).Region is DuelRegion || ((PlayerMobile)targeted).SentRequest || ((PlayerMobile)targeted).RecievedRequest )
{
from.SendAsciiMessage( "They look busy, maybe you should try again later." );
((PlayerMobile)from).SentRequest = false;
}
else if ( !((Mobile)targeted).Alive )
{
from.SendMessage( "A live opponent would be a better choice." );
((PlayerMobile)from).SentRequest = false;
}
else if ( !from.Alive )
{
from.SendMessage( "You cannot duel while dead." );
((PlayerMobile)from).SentRequest = false;
}
else if ( from.Hits != from.HitsMax )
{
from.SendMessage( "You need to heal before offering a duel." );
((PlayerMobile)from).SentRequest = false;
}
else if ( ((Mobile)targeted).Hits != ((Mobile)targeted).HitsMax )
{
from.SendMessage( "They are not at full health." );
((PlayerMobile)from).SentRequest = false;
}
else
{
m_Reciever = (PlayerMobile)targeted;
((PlayerMobile)m_Reciever).RecievedRequest = true;
m_Reciever.SendGump( new DuelAcceptGump( m_Sender, m_Reciever ) );
}
}
else if ( ((Mobile)targeted).Body.IsHuman )
{
from.SendAsciiMessage( ((Mobile)targeted).Name + " does not wish to duel you." );
((PlayerMobile)from).SentRequest = false;
}
else
{
from.SendAsciiMessage( "Maybe you should just attack it." );
((PlayerMobile)from).SentRequest = false;
}
}
else
{
from.SendAsciiMessage( "You seem to have died since making the offer." );
}
}
示例10: OnTarget
protected override void OnTarget( Mobile from, object target )
{
if ( target is Mobile )
{
if ( from.CheckTargetSkill( SkillName.Forensics, target, 40.0, 100.0 ) )
{
if ( target is PlayerMobile && ((PlayerMobile)target).NpcGuild == NpcGuild.ThievesGuild )
from.SendAsciiMessage( "That individual is a thief!" );
else
from.SendAsciiMessage( "You notice nothing unusual." );
}
else
{
from.SendAsciiMessage( "You cannot determain anything useful." );
}
}
else if ( target is Corpse )
{
if ( from.CheckTargetSkill( SkillName.Forensics, target, 0.0, 100.0 ) )
{
Corpse c = (Corpse)target;
if ( ((Body)c.Amount).IsHuman )
c.LabelTo( from, 1042751, ( c.Killer == null ? "no one" : c.Killer.Name ) );//This person was killed by ~1_KILLER_NAME~
if ( c.Looters.Count > 0 )
{
StringBuilder sb = new StringBuilder();
for (int i=0;i<c.Looters.Count;i++)
{
if ( i>0 )
sb.Append( ", " );
sb.Append( ((Mobile)c.Looters[i]).Name );
}
c.LabelTo( from, 1042752, sb.ToString() );//This body has been distrubed by ~1_PLAYER_NAMES~
}
else
{
c.LabelTo( from, "The corpse has not be desecrated." );
}
}
else
{
from.SendAsciiMessage( "You cannot determain anything useful." );
}
}
else if ( target is ILockpickable )
{
ILockpickable p = (ILockpickable)target;
if ( p.Picker != null )
from.SendAsciiMessage( "This lock was opened by " + p.Picker.Name );
else
from.SendAsciiMessage( "You notice nothing unusual." );
}
}
示例11: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack) || Parent == from)
{
from.SendAsciiMessage("Please select the cloth you would like to use.");
from.Target = new TailoringTarget(this);
}
else
from.SendAsciiMessage("That must be in your pack for you to use it.");
}
示例12: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
if ( !from.Alive )
{
from.SendAsciiMessage("The spirits of the dead are not the province of animal lore.");
//from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
}
else if ( targeted is BaseCreature )
{
BaseCreature c = (BaseCreature)targeted;
if ( !c.IsDeadPet )
{
if ( c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea )
{
if ( (!c.Controlled || !c.Tamable) && from.Skills[SkillName.AnimalLore].Base < 100.0 )
{
from.SendAsciiMessage("At your skill level, you can only lore tamed creatures.");
//from.SendLocalizedMessage( 1049674 ); // At your skill level, you can only lore tamed creatures.
}
else if ( !c.Tamable && from.Skills[SkillName.AnimalLore].Base < 110.0 )
{
from.SendAsciiMessage("At your skill level, you can only lore tamed or tameable creatures.");
//from.SendLocalizedMessage( 1049675 ); // At your skill level, you can only lore tamed or tameable creatures.
}
else if ( !from.CheckTargetSkill( SkillName.AnimalLore, c, 0.0, 100.0 ) )
{
from.SendAsciiMessage("You can't think of anything you know offhand.");
//from.SendLocalizedMessage( 500334 ); // You can't think of anything you know offhand.
}
else
{
from.CloseGump( typeof( AnimalLoreGump ) );
from.SendGump( new AnimalLoreGump( c ) );
}
}
else
{
from.SendAsciiMessage("That's not an animal!");
//from.SendLocalizedMessage( 500329 ); // That's not an animal!
}
}
else
{
from.SendAsciiMessage("The spirits of the dead are not the province of animal lore.");
//from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
}
}
else
{
from.SendAsciiMessage("That's not an animal!");
//from.SendLocalizedMessage( 500329 ); // That's not an animal!
}
}
示例13: OpenBrowser_Callback
private static void OpenBrowser_Callback( Mobile m, bool okay, object unused )
{
if ( okay )
{
m.SendAsciiMessage( Ad_OkMsg );
m.LaunchBrowser( Ad_Url );
}
else
{
m.SendAsciiMessage( Ad_CancelMsg );
}
}
示例14: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( OnTarget ) );
from.SendAsciiMessage( "Select the weapon or armor you wish to use the cloth on." );
}
else
{
from.SendAsciiMessage( "That must be in your pack for you to use it." );
}
}
示例15: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( from.InRange( GetWorldLocation(), Core.AOS ? 2 : 1 ) )
{
from.RevealingAction();
from.SendAsciiMessage( "Who will you use the bandages on?" );
from.Target = new InternalTarget( this );
}
else
{
from.SendAsciiMessage( "You are too far away to do that." );
}
}