本文整理汇总了C#中Server.Mobile类的典型用法代码示例。如果您正苦于以下问题:C# Mobile类的具体用法?C# Mobile怎么用?C# Mobile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Mobile类属于Server命名空间,在下文中一共展示了Mobile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LegalGrappling
public static bool LegalGrappling( Mobile mob )
{
if( mob == null || mob.Deleted || !mob.Alive || mob.Blessed )
return false;
return true;
}
示例2: InternalTimer
public InternalTimer(Mobile m)
: base(TimeSpan.FromMinutes(1.0))
{
this.m_Mobile = m;
this.Priority = TimerPriority.OneSecond;
}
示例3: MarrowQuestGump
public MarrowQuestGump( Mobile owner )
: base(50,50)
{
//----------------------------------------------------------------------------------------------------
AddPage( 0 );AddImageTiled( 54, 33, 369, 400, 2624 );AddAlphaRegion( 54, 33, 369, 400 );AddImageTiled( 416, 39, 44, 389, 203 );
//--------------------------------------Window size bar--------------------------------------------
AddImage( 97, 49, 9005 );AddImageTiled( 58, 39, 29, 390, 10460 );AddImageTiled( 412, 37, 31, 389, 10460 );
AddBackground(85, 30, 329, 408, 3500);
AddLabel( 140, 60, 0x34, "Marrow's Task" );
//----------------------/----------------------------------------------/
AddHtml( 107, 140, 300, 230, " < BODY > " +
"<BASEFONT COLOR=YELLOW>Hello there, might you be interested in<BR>" +
"<BASEFONT COLOR=YELLOW>helping me with a little task?<BR>" +
"<BASEFONT COLOR=YELLOW><BR>" +
"<BASEFONT COLOR=YELLOW>I am researching a new type of potion<BR>" +
"<BASEFONT COLOR=YELLOW>and I need some reptile bones to finish<BR>" +
"<BASEFONT COLOR=YELLOW>my tests. As you can see though, I am <BR>" +
"<BASEFONT COLOR=YELLOW>no fighter and cannot get them myself.<BR>" +
"<BASEFONT COLOR=YELLOW><BR>" +
"<BASEFONT COLOR=YELLOW>Although my research has made my coin <BR>" +
"<BASEFONT COLOR=YELLOW>purse rather light these days I will be<BR>" +
"<BASEFONT COLOR=YELLOW>sure to reward you with something. I<BR>" +
"<BASEFONT COLOR=YELLOW>just need 20 bones, that should be <BR>" +
"<BASEFONT COLOR=YELLOW>plenty. You should be able to find<BR>" +
"<BASEFONT COLOR=YELLOW>some right outside of town. Thanks!<BR>" +
"</BODY>", false, true);
//----------------------/----------------------------------------------/
AddImage( 430, 9, 10441);AddImageTiled( 40, 38, 17, 391, 9263 );AddImage( 6, 25, 10421 );AddImage( 34, 12, 10420 );AddImageTiled( 94, 25, 342, 15, 10304 );AddImageTiled( 40, 427, 415, 16, 10304 );AddImage( -10, 314, 10402 );AddImage( 56, 150, 10411 );AddImage( 155, 120, 2103 );AddImage( 136, 84, 96 );AddButton( 225, 390, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0 );
}
示例4: RewardConfirmGump
public RewardConfirmGump( Mobile from, RewardEntry entry )
: base(0, 0)
{
m_From = from;
m_Entry = entry;
from.CloseGump( typeof( RewardConfirmGump ) );
AddPage( 0 );
AddBackground( 10, 10, 500, 300, 2600 );
AddHtmlLocalized( 30, 55, 300, 35, 1006000, false, false ); // You have selected:
if ( entry.NameString != null )
AddHtml( 335, 55, 150, 35, entry.NameString, false, false );
else
AddHtmlLocalized( 335, 55, 150, 35, entry.Name, false, false );
AddHtmlLocalized( 30, 95, 300, 35, 1006001, false, false ); // This will be assigned to this character:
AddLabel( 335, 95, 0, from.Name );
AddHtmlLocalized( 35, 160, 450, 90, 1006002, true, true ); // Are you sure you wish to select this reward for this character? You will not be able to transfer this reward to another character on another shard. Click 'ok' below to confirm your selection or 'cancel' to go back to the selection screen.
AddButton( 60, 265, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 95, 266, 150, 35, 1006044, false, false ); // Ok
AddButton( 295, 265, 4017, 4019, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 330, 266, 150, 35, 1006045, false, false ); // Cancel
}
示例5: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
try
{
if ( m_Type == typeof( Type ) )
targeted = targeted.GetType();
else if ( (m_Type == typeof( BaseAddon ) || m_Type.IsAssignableFrom( typeof( BaseAddon ) )) && targeted is AddonComponent )
targeted = ((AddonComponent)targeted).Addon;
if ( m_Type.IsAssignableFrom( targeted.GetType() ) )
{
Server.Scripts.Commands.CommandLogging.LogChangeProperty( m_Mobile, m_Object, m_Property.Name, targeted.ToString() );
m_Property.SetValue( m_Object, targeted, null );
PropertiesGump.OnValueChanged( m_Object, m_Property, m_Stack );
}
else
{
m_Mobile.SendMessage( "That cannot be assigned to a property of type : {0}", m_Type.Name );
}
}
catch
{
m_Mobile.SendMessage( "An exception was caught. The property may not have changed." );
}
}
示例6: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !from.InRange( this.GetWorldLocation(), 2 ) || !from.InLOS( this ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
}
else if ( Visible && ( ItemID == 4656 || ItemID == 4702 ) && DateTime.Now >= m_NextUse )
{
Point3D p = this.GetWorldLocation();
if ( 1 > Utility.Random( Math.Max( Math.Abs( from.X - p.X ), Math.Abs( from.Y - p.Y ) ) ) )
{
Effects.PlaySound( from.Location, from.Map, from.GetHurtSound() );
from.PublicOverheadMessage( MessageType.Regular, from.SpeechHue, true, "Ouch!" );
Spells.SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, Utility.Dice( 2, 10, 5 ) );
}
Effects.PlaySound( this.GetWorldLocation(), this.Map, 0x387 );
Timer.DelayCall( TimeSpan.FromSeconds( 0.25 ), new TimerCallback( Down1 ) );
Timer.DelayCall( TimeSpan.FromSeconds( 0.50 ), new TimerCallback( Down2 ) );
Timer.DelayCall( TimeSpan.FromSeconds( 5.00 ), new TimerCallback( BackUp ) );
m_NextUse = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
}
}
示例7: OnCancel
public override void OnCancel( Mobile from )
{
if ( GuildMenu.BadLeader( m_Mobile, m_Guild ) )
return;
m_Mobile.SendMenu( new GuildmasterMenu( m_Mobile, m_Guild ) );
}
示例8: Data
public Data(Mobile m)
{
c_Mobile = m;
c_Friends = new ArrayList();
c_Ignores = new ArrayList();
c_Messages = new ArrayList();
c_GIgnores = new ArrayList();
c_GListens = new ArrayList();
c_IrcIgnores = new ArrayList();
c_Sounds = new Hashtable();
c_PerPage = 10;
c_SystemC = 0x161;
c_GlobalMC = 0x26;
c_GlobalCC = 0x47E;
c_GlobalGC = 0x44;
c_GlobalFC = 0x17;
c_GlobalWC = 0x3;
c_StaffC = 0x3B4;
c_MsgC = 0x480;
c_AwayMsg = "";
c_Signature = "";
c_BannedUntil = DateTime.Now;
if (m.AccessLevel >= AccessLevel.Administrator)
c_GlobalAccess = true;
s_Datas[m] = this;
foreach (Channel c in Channel.Channels)
if (c.NewChars)
c.Join(m);
}
示例9: AllowHarmful
public override bool AllowHarmful( Mobile from, Mobile target )
{
if (Contains(from.Location) && Contains(target.Location)) // only when both are inside the region
return true;
else
return false;
}
示例10: GetAccountDuration
private static string GetAccountDuration( Mobile m )
{
Account a = m.Account as Account;
if ( a == null )
return "";
TimeSpan ts = DateTime.Now - a.Created;
string v;
if ( Format( ts.TotalDays, "This account is {0} day{1} old.", out v ) )
return v;
if ( Format( ts.TotalHours, "This account is {0} hour{1} old.", out v ) )
return v;
if ( Format( ts.TotalMinutes, "This account is {0} minute{1} old.", out v ) )
return v;
if ( Format( ts.TotalSeconds, "This account is {0} second{1} old.", out v ) )
return v;
return "";
}
示例11: OnMoveOver
public override bool OnMoveOver( Mobile m )
{
if( !m_AllowCreatures && !m.Player )
return true;
if( m.Alive)
{
m.SendMessage( "You must be dead to use this portal." );
m.Say("Duh... I am not dead... Hello? Use a Rune book..");
m.PlaySound( 0x440 );
return true;
}
if( m_TelePets)
{
Server.Mobiles.BaseCreature.TeleportPets( m, m_DestLoc, m_DestMap );
}
m.Say("Have mercy on my soul.");
World.Broadcast( 32, true, "A Darkening chime is heard throughout the land as Dracula has consumed another victim. May {0} rest in peace.", m.Name );
m.PlaySound(0x1F7);
m.MoveToWorld( m_DestLoc, m_DestMap );
return false;
}
示例12: GetMaxWeight
public const int OverloadAllowance = 4; // We can be four stones overweight without getting fatigued
public static int GetMaxWeight( Mobile m )
{
//return ((( Core.ML && m.Race == Race.Human) ? 100 : 40 ) + (int)(3.5 * m.Str));
//Moved to core virtual method for use there
return m.MaxWeight;
}
示例13: StealingTarget
public StealingTarget( Mobile thief )
: base(1, false, TargetFlags.None)
{
m_Thief = thief;
AllowNonlocal = true;
}
示例14: OnMoveOver
public override bool OnMoveOver( Mobile m )
{
if ( m == null || m.Deleted || m.Backpack == null || m.Backpack.Deleted )
return true;
if ( Active && m_itemType != null )
{
if ( !Creatures && !m.Player )
return true;
m_item = m.Backpack.FindItemByType(m_itemType, true);
if ( m_item != null )
{
StartTeleport(m);
return false;
}
else
{
if ( m_Message != null && m != null)
m.SendMessage(m_Message);
}
}
return true;
}
示例15: OnGotMeleeAttack
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
if ( 0.40 >= Utility.RandomDouble() ) // 40% chance to clone itself.
AddClonedOoze( attacker, 0.25 );
}