当前位置: 首页>>代码示例>>C#>>正文


C# Container.MoveToWorld方法代码示例

本文整理汇总了C#中Server.Items.Container.MoveToWorld方法的典型用法代码示例。如果您正苦于以下问题:C# Container.MoveToWorld方法的具体用法?C# Container.MoveToWorld怎么用?C# Container.MoveToWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Items.Container的用法示例。


在下文中一共展示了Container.MoveToWorld方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnAfterDeath


//.........这里部分代码省略.........
                if ( SkillHandlers.Stealing.ClassicMode )
                    Criminal = true;
            }

            if ( this.LastKiller != null )
            {
                PlayerMobile k = this.LastKiller as PlayerMobile;

                Guild k_Guild = null;
                Guild m_Guild = null;

                if ( k != null && this != null )
                {
                    k_Guild = (Guild) k.Guild;
                    m_Guild = (Guild) this.Guild;
                }

                if ( k_Guild != null && m_Guild != null && k_Guild.IsWar( m_Guild ) && k_Guild.GetMaxKills( m_Guild ) != 0 )
                    k_Guild.AddKills( m_Guild, 1 );
            }

            if ( this.Kills >= 5 && DateTime.Now >= m_NextJustAward )
            {
                Mobile m = FindMostRecentDamager( false );

                if ( m is BaseCreature )
                    m = ( (BaseCreature) m ).GetMaster();

                if ( m != null && m.IsPlayer && m != this )
                {
                    bool gainedPath = false;

                    int pointsToGain = 0;

                    pointsToGain += (int) Math.Sqrt( this.GameTime.TotalSeconds * 4 );
                    pointsToGain *= 5;
                    pointsToGain += (int) Math.Pow( this.Skills.Total / 250, 2 );

                    if ( VirtueHelper.Award( m, VirtueName.Justice, pointsToGain, ref gainedPath ) )
                    {
                        if ( gainedPath )
                            m.SendLocalizedMessage( 1049367 ); // You have gained a path in Justice!
                        else
                            m.SendLocalizedMessage( 1049363 ); // You have gained in Justice.

                        m.FixedParticles( 0x375A, 9, 20, 5027, EffectLayer.Waist );
                        m.PlaySound( 0x1F7 );

                        m_NextJustAward = DateTime.Now + TimeSpan.FromMinutes( pointsToGain / 3 );
                    }
                }
            }

            if ( m_InsuranceCost > 0 )
                SendLocalizedMessage( 1060398, m_InsuranceCost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.

            if ( m_InsuranceAward != null )
            {
                PlayerMobile pm = m_InsuranceAward;

                if ( pm.m_InsuranceBonus > 0 )
                    pm.SendLocalizedMessage( 1060397, pm.m_InsuranceBonus.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box.
            }

            Mobile killer = this.FindMostRecentDamager( true );

            if ( killer is BaseCreature )
            {
                BaseCreature bc = (BaseCreature) killer;

                Mobile master = bc.GetMaster();
                if ( master != null )
                    killer = master;
            }

            if ( this.Young && m_KRStartingQuestStep == 0 )
            {
                Point3D dest = GetYoungDeathDestination();

                if ( dest != Point3D.Zero )
                {
                    this.Location = dest;
                    Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), new TimerCallback( SendYoungDeathNotice ) );
                }
            }

            Faction.HandleDeath( this, killer );

            if ( Region.IsPartOf( typeof( UnderworldDeathRegion ) ) )
            {
                Point3D dest = new Point3D( 1060, 1066, -42 );

                MoveToWorld( dest, Map.TerMur );
                c.MoveToWorld( dest, Map.TerMur );

                SendLocalizedMessage( 1113566 ); // You will find your remains at the entrance of the maze.
            }

            Send( new DisplayWaypoint( c, WaypointType.Corpse, 1028198 ) ); // corpse
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:101,代码来源:PlayerMobile.cs


注:本文中的Server.Items.Container.MoveToWorld方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。