本文整理汇总了C#中Server.Mobile.CheckAlive方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.CheckAlive方法的具体用法?C# Mobile.CheckAlive怎么用?C# Mobile.CheckAlive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.CheckAlive方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnVirtueUsed
public static void OnVirtueUsed( Mobile from )
{
if ( !from.CheckAlive() )
return;
PlayerMobile protector = from as PlayerMobile;
if ( protector == null )
return;
if ( !VirtueHelper.IsSeeker( protector, VirtueName.Justice ) )
{
protector.SendLocalizedMessage( 1049610 ); // You must reach the first path in this virtue to invoke it.
}
else if ( !protector.CanBeginAction( typeof( JusticeVirtue ) ) )
{
protector.SendLocalizedMessage( 1049370 ); // You must wait a while before offering your protection again.
}
else if ( protector.JusticeProtectors.Count > 0 )
{
protector.SendLocalizedMessage( 1049542 ); // You cannot protect someone while being protected.
}
else if ( protector.Map != Map.Felucca )
{
protector.SendLocalizedMessage( 1049372 ); // You cannot use this ability here.
}
else
{
protector.BeginTarget( 14, false, TargetFlags.None, new TargetCallback( OnVirtueTargeted ) );
protector.SendLocalizedMessage( 1049366 ); // Choose the player you wish to protect.
}
}
示例2: GetContextMenuEntries
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
{
base.GetContextMenuEntries( from, list );
if ( from.CheckAlive() && IsChildOf( from.Backpack ) )
list.Add( new NameBookEntry( from, this ) );
}
示例3: BeginStable
public void BeginStable( Mobile from )
{
if ( Deleted || !from.CheckAlive() )
return;
SayTo( from, true, "Which bunny wouldst thou like to stable here?");
from.Target = new StableTarget( this );
}
示例4: EndRelease
public virtual void EndRelease( Mobile from )
{
if ( from == null || (!Deleted && Controlled && from == ControlMaster && from.CheckAlive()) )
{
Effects.SendLocationParticles( EffectItem.Create( Location, Map, EffectItem.DefaultDuration ), 0x3728, 1, 13, 2100, 3, 5042, 0 );
PlaySound( 0x201 );
Delete();
}
}
示例5: BeginRepair
public void BeginRepair(Mobile from)
{
if (Deleted || !from.CheckAlive())
return;
SayTo(from, "What do you want me to repair?");
from.Target = new RepairTarget(this);
}
示例6: BeginPetSale
public void BeginPetSale( Mobile from )
{
if ( Deleted || !from.CheckAlive() )
return;
SayTo( from, "Which one of my reindeer have you found?" );
from.Target = new PetSaleTarget( this );
}
示例7: ThirstDecay
public static void ThirstDecay( Mobile m )
{
//kaltar
//if ( m != null && m.Thirst >= 1 )
// m.Thirst -= 1;
#region kaltar
if ( m != null && m.CheckAlive()) {
m.Hunger -= 1;
}
#endregion
}
示例8: ApplyInsuranceChanges
public static void ApplyInsuranceChanges( Mobile from, ItemInsuranceInfo[] arInfo )
{
if ( !from.CheckAlive() )
return;
foreach ( ItemInsuranceInfo info in arInfo )
{
if ( info.Toggled )
{
Item item = info.Item;
if ( !item.IsChildOf( from ) )
{
from.SendLocalizedMessage( 1060871, String.Empty, 0x23 ); // You can only insure items that you have equipped or that are in your backpack
}
else if ( item.Insured )
{
item.Insured = false;
from.SendLocalizedMessage( 1060874, String.Empty, 0x35 ); // You cancel the insurance on the item
}
else
{
if ( !item.PayedInsurance )
{
int cost = info.GetCost();
if ( Banker.Withdraw( from, cost ) )
{
from.SendLocalizedMessage( 1060398, cost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.
item.PayedInsurance = true;
}
else
{
from.SendLocalizedMessage( 1061079, String.Empty, 0x23 ); // You lack the funds to purchase the insurance
continue;
}
}
item.Insured = true;
from.SendLocalizedMessage( 1060873, String.Empty, 0x23 ); // You have insured the item
}
}
}
}
示例9: EndStable
public void EndStable( Mobile from, BaseCreature pet )
{
if ( Deleted || !from.CheckAlive() )
return;
if ( !pet.Controlled || pet.ControlMaster != from )
{
SayTo( from, 1042562 ); // You do not own that pet!
}
//Pix: 10/7/2004 - allow dead pets to be stabled.
//else if ( pet.IsDeadPet )
//{
// SayTo( from, 1049668 ); // Living pets only, please.
//}
else if ( pet.Summoned )
{
SayTo( from, 502673 ); // I can not stable summoned creatures.
}
else if ( pet.IOBFollower ) // Don't stable IOB Bretheren
{
SayTo( from, "You can't stable your bretheren!" );
}
else if ( pet.Body.IsHuman )
{
SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
}
else if ( (pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
{
SayTo( from, 1042563 ); // You need to unload your pet.
}
else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
{
SayTo( from, 1042564 ); // I'm sorry. Your pet seems to be busy.
}
else if ( from.Stabled.Count >= GetMaxStabled( from ) )
{
SayTo( from, 1042565 ); // You have too many pets in the stables!
}
else
{
Container bank = from.BankBox;
if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) )
{
pet.ControlTarget = null;
pet.ControlOrder = OrderType.Stay;
pet.Internalize();
pet.SetControlMaster( null );
pet.SummonMaster = null;
pet.IsStabled = true;
from.Stabled.Add( pet );
SayTo( from, 502679 ); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
}
else
{
SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
}
}
}
示例10: EndClaimList
public void EndClaimList( Mobile from, BaseCreature pet )
{
if ( pet == null || pet.Deleted || from.Map != this.Map || !from.InRange( this, 14 ) || !from.Stabled.Contains( pet ) || !from.CheckAlive() )
return;
if ( (from.Followers + pet.ControlSlots) <= from.FollowersMax )
{
pet.SetControlMaster( from );
if ( pet.Summoned )
pet.SummonMaster = from;
pet.ControlTarget = from;
pet.ControlOrder = OrderType.Follow;
pet.MoveToWorld( from.Location, from.Map );
pet.IsStabled = false;
from.Stabled.Remove( pet );
SayTo( from, 1042559 ); // Here you go... and good day to you!
}
else
{
SayTo( from, 1049612, pet.Name ); // ~1_NAME~ remained in the stables because you have too many followers.
}
}
示例11: BeginCustomize
public void BeginCustomize( Mobile m )
{
if ( !m.CheckAlive() )
return;
RelocateEntities();
foreach ( Item item in GetItems() )
{
item.Location = BanLocation;
}
foreach ( Mobile mobile in GetMobiles() )
{
if ( mobile != m )
mobile.Location = BanLocation;
}
DesignContext.Add( m, this );
m.Send( new BeginHouseCustomization( this ) );
if ( m.NetState != null )
SendInfoTo( m.NetState );
DesignState.SendDetailedInfoTo( m.NetState );
}
示例12: EndConfirmTransfer
public void EndConfirmTransfer( Mobile from, Mobile to )
{
if ( Deleted || !from.CheckAlive() || !IsOwner( from ) )
return;
if ( NewVendorSystem && HasPersonalVendors )
{
from.SendLocalizedMessage( 1062467 ); // You cannot trade this house while you still have personal vendors inside.
}
else if ( DecayLevel == DecayLevel.DemolitionPending )
{
from.SendLocalizedMessage( 1005321 ); // This house has been marked for demolition, and it cannot be transferred.
}
else if ( from == to )
{
from.SendLocalizedMessage( 1005330 ); // You cannot transfer a house to yourself, silly.
}
else if ( to.Player )
{
if ( BaseHouse.HasAccountHouse( to ) )
{
from.SendLocalizedMessage( 501388 ); // You cannot transfer ownership to another house owner or co-owner!
}
else if ( CheckTransferPosition( from, to ) )
{
NetState fromState = from.NetState, toState = to.NetState;
if ( fromState != null && toState != null )
{
if ( from.HasTrade )
{
from.SendLocalizedMessage( 1062071 ); // You cannot trade a house while you have other trades pending.
}
else if ( to.HasTrade )
{
to.SendLocalizedMessage( 1062071 ); // You cannot trade a house while you have other trades pending.
}
else if( !to.Alive )
{
// TODO: Check if the message is correct.
from.SendLocalizedMessage( 1062069 ); // You cannot transfer this house to that person.
}
else
{
Container c = fromState.AddTrade( toState );
c.DropItem( new TransferItem( this ) );
}
}
}
}
else
{
from.SendLocalizedMessage( 501384 ); // Only a player can own a house!
}
}
示例13: OnSecureTrade
public override void OnSecureTrade( Mobile from, Mobile to, Mobile newOwner, bool accepted )
{
if ( Deleted )
return;
Delete();
if ( m_House == null || m_House.Deleted || !m_House.IsOwner( from ) || !from.CheckAlive() || !to.CheckAlive() )
return;
if ( !accepted )
return;
from.SendLocalizedMessage( 501338 ); // You have transferred ownership of the house.
to.SendLocalizedMessage( 501339 ); /* You are now the owner of this house.
* The house's co-owner, friend, ban, and access lists have been cleared.
* You should double-check the security settings on any doors and teleporters in the house.
*/
m_House.RemoveKeys( from );
m_House.Owner = to;
m_House.Bans.Clear();
m_House.Friends.Clear();
m_House.CoOwners.Clear();
m_House.ChangeLocks( to );
m_House.LastTraded = DateTime.Now;
}
示例14: VendorSell
public override void VendorSell( Mobile from )
{
if ( !IsActiveBuyer )
return;
if ( !from.CheckAlive() )
return;
if ( !CheckVendorAccess( from ) )
{
Say( 501522 ); //I shall not treat with scum like thee!
return;
}
Container pack = from.Backpack;
if ( pack != null )
{
VendorEntry[] info = (VendorEntry[])m_CustomSellList.ToArray( typeof( VendorEntry ) );
Hashtable table = new Hashtable();
foreach ( VendorEntry entry in info )
{
Item[] items = pack.FindItemsByType( entry.Type );
foreach ( Item item in items )
{
if ( item is Container && ((Container)item).Items.Count != 0 )
continue;
if ( item.IsStandardLoot() && item.Movable )
table[item] = new SellItemState( item, entry.Price, item.Name );
}
}
if ( table.Count > 0 )
{
SendPacksTo( from );
from.Send( new VendorSellList( this, table ) );
}
else
{
Say( true, "You have nothing I would be interested in." );
}
}
}
示例15: OnSecureTrade
public override void OnSecureTrade( Mobile from, Mobile to, Mobile newOwner, bool accepted )
{
if( Deleted )
return;
Delete();
if( m_Creature == null || m_Creature.Deleted || m_Creature.ControlMaster != from || !from.CheckAlive() || !to.CheckAlive() )
return;
if( from.Map != m_Creature.Map || !from.InRange( m_Creature, 14 ) )
return;
if( accepted )
{
if( m_Creature.SetControlMaster( to ) )
{
if( m_Creature.Summoned )
m_Creature.SummonMaster = to;
m_Creature.ControlTarget = to;
m_Creature.ControlOrder = OrderType.Follow;
m_Creature.BondingBegin = DateTime.MinValue;
m_Creature.OwnerAbandonTime = DateTime.MinValue;
m_Creature.IsBonded = false;
m_Creature.PlaySound( m_Creature.GetIdleSound() );
string args = String.Format( "{0}\t{1}\t{2}", from.Name, m_Creature.Name, to.Name );
from.SendLocalizedMessage( 1043253, args ); // You have transferred your pet to ~3_GETTER~.
to.SendLocalizedMessage( 1043252, args ); // ~1_NAME~ has transferred the allegiance of ~2_PET_NAME~ to you.
}
}
}