本文整理汇总了C#中Server.Mobiles.PlayerMobile类的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile类的具体用法?C# PlayerMobile怎么用?C# PlayerMobile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerMobile类属于Server.Mobiles命名空间,在下文中一共展示了PlayerMobile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StatBallGump
public StatBallGump( PlayerMobile from, StatBall ball ): base( 50, 50 )
{
m_From = from;
m_Ball = ball;
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
this.AddPage(0);
this.AddBackground(50, 50, 437, 215, 2620);
this.AddLabel(200, 67, 1160, "Stat Ball Selection");
this.AddLabel(114, 96, 1160, "Choose your Strength, Dexterity, and Intelligence");
this.AddLabel(84, 156, 1152, "STR");
this.AddLabel(228, 156, 1152, "DEX");
this.AddLabel(368, 156, 1152, "INT");
this.AddTextEntry(134, 156, 50, 20, 1359, 0, "50");
this.AddTextEntry(278, 156, 50, 20, 1359, 1, "50");
this.AddTextEntry(411, 156, 50, 20, 1359, 2, "50");
this.AddButton(405, 221, 238, 240, 4, GumpButtonType.Reply, 0);
// Swap these comment lines if using custom Cap variable. Then set the number in the gump display here
// Remember to comment out ALL 3 lines, and uncomment the 1 line.
// this.AddLabel(114, 200, 1152, "* Stat totals should equal ");
// this.AddLabel(282, 200, 1152, m_From.StatCap.ToString() );
// this.AddLabel(313, 200, 1152, "*");
this.AddLabel(114, 200, 1152, "* Stat totals should equal 200 *");
this.AddLabel(110, 215, 1152, "* Minium 10 points in each stat *");
}
示例2: MLQuestInstance
public MLQuestInstance( MLQuest quest, IQuestGiver quester, PlayerMobile player )
{
m_Quest = quest;
m_Quester = quester;
m_QuesterType = ( quester == null ) ? null : quester.GetType();
m_Player = player;
m_Accepted = DateTime.UtcNow;
m_Flags = MLQuestInstanceFlags.None;
m_ObjectiveInstances = new BaseObjectiveInstance[quest.Objectives.Count];
BaseObjectiveInstance obj;
bool timed = false;
for ( int i = 0; i < quest.Objectives.Count; ++i )
{
m_ObjectiveInstances[i] = obj = quest.Objectives[i].CreateInstance( this );
if ( obj.IsTimed )
timed = true;
}
Register();
if ( timed )
m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), Slice );
}
示例3: Enqueue
public virtual void Enqueue(PlayerMobile pm, PvPTeam team = null, bool party = true)
{
if (pm == null || pm.Deleted)
{
return;
}
if (!CanQueue(pm))
{
OnQueueReject(pm);
return;
}
if (team != null && team.Deleted)
{
team = null;
}
if (!IsQueued(pm))
{
Queue.Add(pm, team);
OnQueueJoin(pm, team);
}
else
{
Queue[pm] = team;
OnQueueUpdate(pm, team);
}
if (party)
{
EnqueueParty(pm, Party.Get(pm), team);
}
}
示例4: BStartGump
//private string m_PieceName = "None";
//private int m_PiecePage = 1;
//private BaseIngot m_Ingot;
public BStartGump(PlayerMobile crafter, BlackSmithingCraftState craftstate, BaseTool tool, BStartContext context)
: base(0, 0)
{
m_CraftState = craftstate;
m_Crafter = crafter;
m_Tool = tool;
if (context == null)
m_Context = new BStartContext();
else
m_Context = context;
this.Closable = true;
this.Disposable = false;
this.Dragable = true;
this.Resizable = false;
this.AddPage(0);
InitialSetUp();
if (m_Context.Ingot != null)
AddResourceImage(m_Context.Ingot);
switch (m_Context.Page)
{
case 1: InitialPiecePage(); break;
case 2: ArmorPiecePage(); break;
case 3: WeaponPiecePage(); break;
case 4: AttackPiecePage(); break;
case 5: HiltsPage(); break;
//case 6: EmbellishmentsPage(); break;
}
}
示例5: Resurrect
public static void Resurrect( PlayerMobile m, AnkhOfSacrificeAddon ankh )
{
if ( m == null )
{
}
else if ( !m.InRange( ankh.GetWorldLocation(), 2 ) )
{
m.SendLocalizedMessage( 500446 ); // That is too far away.
}
else if ( m.Alive )
{
m.SendLocalizedMessage( 1060197 ); // You are not dead, and thus cannot be resurrected!
}
else if ( m.AnkhNextUse > DateTime.UtcNow )
{
TimeSpan delay = m.AnkhNextUse - DateTime.UtcNow;
if ( delay.TotalMinutes > 0 )
m.SendLocalizedMessage( 1079265, Math.Round( delay.TotalMinutes ).ToString() ); // You must wait ~1_minutes~ minutes before you can use this item.
else
m.SendLocalizedMessage( 1079263, Math.Round( delay.TotalSeconds ).ToString() ); // You must wait ~1_seconds~ seconds before you can use this item.
}
else
{
m.CloseGump( typeof( AnkhResurrectGump ) );
m.SendGump( new AnkhResurrectGump( m, ResurrectMessage.VirtueShrine ) );
}
}
示例6: RegsGump
public RegsGump ( Mobile from ) : base ( 40, 40 )
{
m_From = from as PlayerMobile;
m_From.CloseGump( typeof( RegsGump ) );
Container backpack = m_From.Backpack;
AddPage( 0 );
AddBackground( 0, 0, 440, 270, 5054 );
AddBlackAlpha( 10, 10, 420, 25 );
AddBlackAlpha( 10, 45, 200, 215 );
AddBlackAlpha( 220, 45, 200, 215 );
AddLabel( 155, 14, 0x384, "Réactifs" );
AddLabel( 100, 50, 0x284, "Mages" );
AddLabel( 295, 50, 0x284, "Necros" );
for( int i = 0; i < m_Types_Mage.Length; i++ )
{
nb = backpack.GetAmount( m_Types_Mage[i] );
AddItem( 15, 70 + (i * 20), m_Img_Mage[i] );
AddLabelCropped( 55, 70 + (i * 20) , 150, 21, 0x384, m_Txt_Mage[i] + " :" );
AddLabelCropped( 183, 70 + (i * 20) , 46, 21, 0x284, nb.ToString() );
}
for( int i = 0; i < m_Types_Necro.Length; i++ )
{
nb = backpack.GetAmount( m_Types_Necro[i] );
AddItem( 225, 70 + (i * 22), m_Img_Necro[i] );
AddLabelCropped( 265, 70 + (i * 20) , 150, 21, 0x384, m_Txt_Necro[i] + " :" );
AddLabelCropped( 395, 70 + (i * 20) , 46, 21, 0x284, nb.ToString() );
}
}
示例7: NotifyGump
public NotifyGump(PlayerMobile user, string html)
: base(user, null, 0, 120)
{
AnimDuration = DefaultAnimDuration;
PauseDuration = DefaultPauseDuration;
Html = html ?? String.Empty;
HtmlColor = Color.White;
HtmlIndent = 10;
BorderSize = 4;
BorderID = 9204;
BorderAlpha = false;
BackgroundID = 2624;
BackgroundAlpha = true;
AutoClose = true;
Frame = 0;
State = AnimState.Pause;
CanMove = false;
CanResize = false;
ForceRecompile = true;
AutoRefreshRate = TimeSpan.FromMilliseconds(100.0);
AutoRefresh = true;
var sMin = GetSizeMin();
var sMax = GetSizeMax();
WidthMax = Math.Max(sMin.Width, Math.Min(sMax.Width, 250));
HeightMax = Math.Max(sMin.Height, Math.Min(sMax.Height, 30));
}
示例8: Resurrect
public static void Resurrect( PlayerMobile m, AnkhOfSacrificeAddon ankh )
{
BaseHouse ankhhouse = BaseHouse.FindHouseAt( ankh );
if ( m != null && ankhhouse != null && ankhhouse.IsFriend( m ) )
{
if ( !m.InRange( ankh.GetWorldLocation(), 2 ) )
m.SendLocalizedMessage( 500446 ); // That is too far away.
else if ( m.Alive )
m.SendLocalizedMessage( 1060197 ); // You are not dead, and thus cannot be resurrected!
else if ( m.AnkhNextUse > DateTime.UtcNow )
{
TimeSpan delay = m.AnkhNextUse - DateTime.UtcNow;
if ( delay.TotalMinutes > 0 )
m.SendLocalizedMessage( 1079265, Math.Round( delay.TotalMinutes ).ToString() ); // You must wait ~1_minutes~ minutes before you can use this item.
else
m.SendLocalizedMessage( 1079263, Math.Round( delay.TotalSeconds ).ToString() ); // You must wait ~1_seconds~ seconds before you can use this item.
}
else
{
m.CloseGump( typeof( AnkhResurrectGump ) );
/*PlayerMobile pres = m as PlayerMobile;
if (pres.MurderBounty > 0)
m.SendGump( new ResurrectGump( m, m, pres.MurderBounty ) );
else*/
m.SendGump( new AnkhResurrectGump( m, ResurrectMessage.VirtueShrine ) );
}
}
}
示例9: AttemptShoot
public static void AttemptShoot(PlayerMobile from, INinjaWeapon weapon)
{
if (CanUseWeapon(from, weapon))
{
from.BeginTarget(weapon.WeaponMaxRange, false, TargetFlags.Harmful, new TargetStateCallback<INinjaWeapon>(OnTarget), weapon);
}
}
示例10: PetSummonGump
public PetSummonGump( PlayerMobile user, PetSummonBall ball ) : base( 20, 30 )
{
m_Mobile = user;
m_PetSummonBall = ball;
Dragable = true;
AddPage( 0 );
AddBackground( 0, 0, 200, 315, 2520 );
ArrayList pets = GetPetList( m_Mobile );
AddHtml( 30, 20, 180, 30, "", false, false );
AddHtml( 30, 35, 180, 30, "IMPORTANT!", false, false );
AddHtml( 30, 50, 180, 30, "Cost: 75,000 gold.", false, false );
AddHtml( 30, 65, 180, 30, "Pets lose 10% skills.", false, false );
AddHtml( 30, 75, 180, 30, "", false, false );
for ( int i = 0; i < pets.Count; i++ )
{
AddButton( 30, 95 + 30 * i, 4005, 4007, i + 1, GumpButtonType.Reply, 0 );
AddHtml( 65, 95 + 30 * i, 145, 30, ((Mobile)pets[i]).Name, false, false );
}
AddButton( 30, 245, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtml( 63, 245, 145, 30, "Exit", false, false ); // EXIT
}
示例11: HorseBreederGump
public HorseBreederGump( PlayerMobile from, Faction faction )
: base(20, 30)
{
m_From = from;
m_Faction = faction;
AddPage( 0 );
AddBackground( 0, 0, 320, 280, 5054 );
AddBackground( 10, 10, 300, 260, 3000 );
AddHtmlText( 20, 30, 300, 25, faction.Definition.Header, false, false );
AddHtmlLocalized( 20, 60, 300, 25, 1018306, false, false ); // Purchase a Faction War Horse
AddItem( 70, 120, 0x3FFE );
AddItem( 150, 120, 0xEF2 );
AddLabel( 190, 122, 0x3E3, FactionWarHorse.SilverPrice.ToString( "N0" ) ); // NOTE: Added 'N0'
AddItem( 150, 150, 0xEEF );
AddLabel( 190, 152, 0x3E3, FactionWarHorse.GoldPrice.ToString( "N0" ) ); // NOTE: Added 'N0'
AddHtmlLocalized( 55, 210, 200, 25, 1011011, false, false ); // CONTINUE
AddButton( 20, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 55, 240, 200, 25, 1011012, false, false ); // CANCEL
AddButton( 20, 240, 4005, 4007, 0, GumpButtonType.Reply, 0 );
}
示例12: InvokeUserBanned
private static void InvokeUserBanned(WorldChatChannel channel, PlayerMobile user)
{
if (OnUserBanned != null)
{
OnUserBanned(channel, user);
}
}
示例13: addToMasterLootersList
private static void addToMasterLootersList(PlayerMobile player, MasterLooterBackpack bag)
{
if (bag == null)
return;
if (!Daat99MasterLootersUtils.PlayersMasterLooterList.ContainsKey(player.Serial))
Daat99MasterLootersUtils.PlayersMasterLooterList.Add(player.Serial, bag);
}
示例14: ChosenDeityGump
public ChosenDeityGump( PlayerMobile from )
: base(0, 0)
{
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
from.CloseGump( typeof(ChosenDeityGump) );
AddPage( 0 );
AddBackground( 42, 23, 202, 331, 9270 );
AddBackground( 58, 39, 169, 298, 3500 );
AddLabel( 101, 51, 2010, @"Patron Deity" );
AddButton( 72, 81, (from.ChosenDeity == ChosenDeity.Arianthynt ? 9723 : 9720), 9722, (int)Buttons.Arianthynt, GumpButtonType.Reply, 0 );
AddButton( 72, 116, (from.ChosenDeity == ChosenDeity.Xipotec ? 9723 : 9720), 9722, (int)Buttons.Xipotec, GumpButtonType.Reply, 0 );
AddButton( 72, 151, (from.ChosenDeity == ChosenDeity.Mahtet ? 9723 : 9720), 9722, (int)Buttons.Mahtet, GumpButtonType.Reply, 0 );
AddButton( 72, 186, (from.ChosenDeity == ChosenDeity.Xorgoth ? 9723 : 9720), 9722, (int)Buttons.Xorgoth, GumpButtonType.Reply, 0 );
AddButton( 72, 221, (from.ChosenDeity == ChosenDeity.Ohlm ? 9723 : 9720), 9722, (int)Buttons.Ohlm, GumpButtonType.Reply, 0 );
AddButton( 72, 256, (from.ChosenDeity == ChosenDeity.Elysia ? 9723 : 9720), 9722, (int)Buttons.Elysia, GumpButtonType.Reply, 0 );
AddButton( 72, 291, (from.ChosenDeity == ChosenDeity.None ? 9723 : 9720), 9722, (int)Buttons.None, GumpButtonType.Reply, 0 );
AddLabel( 107, 86, 0, @"Arianthynt" );
AddLabel( 107, 121, 0, @"Xipotec" );
AddLabel( 107, 156, 0, @"Mah'tet" );
AddLabel( 107, 191, 0, @"Xorgoth" );
AddLabel( 107, 226, 0, @"Ohlm" );
AddLabel( 107, 261, 0, @"Elysia" );
AddLabel( 107, 296, 0, @"None for now" );
}
示例15: Shoot
private static void Shoot(PlayerMobile from, Mobile target, INinjaWeapon weapon)
{
if (from != target && CanUseWeapon(from, weapon) && from.CanBeHarmful(target))
{
if (weapon.WeaponMinRange == 0 || !from.InRange(target, weapon.WeaponMinRange))
{
from.NinjaWepCooldown = true;
from.Direction = from.GetDirectionTo(target);
from.RevealingAction();
weapon.AttackAnimation(from, target);
ConsumeUse(weapon);
if (CombatCheck(from, target))
{
Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback<object[]>(OnHit), new object[] { from, target, weapon });
}
Timer.DelayCall(TimeSpan.FromSeconds(2.5), new TimerStateCallback<PlayerMobile>(ResetUsing), from);
}
else
{
from.SendLocalizedMessage(1063303); // Your target is too close!
}
}
}