當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。