예제 #1
0
        public void GenBag()
        {
            if (cont == null)
            {
                Bag b = new Bag();
                cont = b;
            }

            cont.Map = this.Map;
            cont.MoveToWorld(new Point3D(this.Location.X, this.Location.Y, this.Location.Z - 50));

            //cont.Visible = false;
        }
예제 #2
0
        protected override void OnAfterDeath( Container c )
        {
            Corpse corpse = c as Corpse;

            corpse.InsuredItems = m_EquipInsuredItems;
            m_EquipInsuredItems = null;

            base.OnAfterDeath( c );

            HueMod = -1;
            NameMod = null;
            SavagePaintExpiration = TimeSpan.Zero;

            SetHairMods( -1, -1 );

            if ( this.AccessLevel == AccessLevel.Player )
                Hidden = false;

            PolymorphSpell.StopTimer( this );
            IncognitoSpell.StopTimer( this );
            DisguiseGump.StopTimer( this );

            EndAction( typeof( PolymorphSpell ) );
            EndAction( typeof( IncognitoSpell ) );

            MeerMage.StopEffect( this, false );

            ArcaneEmpowermentSpell.StopBuffing( this, false );

            SkillHandlers.StolenItem.ReturnOnDeath( this, c );

            if ( m_PermaFlags.Count > 0 )
            {
                m_PermaFlags.Clear();

                if ( c is Corpse )
                    ( (Corpse) c ).Criminal = true;

                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
        }