Inheritance: System.EventArgs
        public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
        {
            Mobile m = e.Mobile;

            List<Mobile> killers = new List<Mobile>();
            List<Mobile> toGive  = new List<Mobile>();

            foreach ( AggressorInfo ai in m.Aggressors )
            {
                if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported )
                {
                    killers.Add( ai.Attacker );
                    ai.Reported = true;
                }
                if ( ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) )
                    toGive.Add( ai.Attacker );
            }

            foreach ( AggressorInfo ai in m.Aggressed )
            {
                if ( ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Defender ) )
                    toGive.Add( ai.Defender );
            }

            foreach ( Mobile g in toGive )
            {
                int n = Notoriety.Compute( g, m );

                int theirKarma = m.Karma, ourKarma = g.Karma;
                bool innocent = ( n == Notoriety.Innocent );
                bool criminal = ( n == Notoriety.Criminal || n == Notoriety.Murderer );

                int fameAward = m.Fame / 200;
                int karmaAward = 0;

                if ( innocent )
                    karmaAward = ( ourKarma > -2500 ? -850 : -110 - (m.Karma / 100) );
                else if ( criminal )
                    karmaAward = 50;

                Titles.AwardFame( g, fameAward, false );
                Titles.AwardKarma( g, karmaAward, true );
            }

            if ( m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild )
                return;

            if ( killers.Count > 0 )
                new GumpTimer( m, killers ).Start();

            /*
            TODO:  	Check entire combatant system and see if the
                cobatant lists should be handled a different
                way, and  change it accordingly.  This is a
                small-scope patch to prevent an exploit.
            */

            for ( int i = m.Aggressors.Count - 1; i >= 0; --i )
                m.Aggressors.RemoveAt ( i );
        }
Example #2
0
		public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
		{
			if ( e.Mobile == null )
				return;

			if ( e.Mobile.Region != null )
			{
				if ( e.Mobile.Region.Name == "Spectre Dungeon" || e.Mobile.Region.Name == "Doom" )
				{
					if ( Utility.Random( 100 ) > 75 )
					{
						new BlueWight( ScaleByMobile( e.Mobile ) ).MoveToWorld( e.Mobile.Location, e.Mobile.Map );
						return;
					}
				}
				else if ( e.Mobile.Region is DungeonRegion ) 
				{
					bool spawn = false;

					for ( int i = 0; i < e.Mobile.Skills.Length; ++i )
					{
						if ( ( spawn = (e.Mobile.Skills[i].Value == 0) ) )
							continue;
						else
							break;
					}

					if ( spawn )
						new BlueWight( ScaleByMobile( e.Mobile ) ).MoveToWorld( e.Mobile.Location, e.Mobile.Map );
				}
			}
		}
Example #3
0
        public static void OnDeath(PlayerDeathEventArgs args)
        {
            Mobile m    = args.Mobile;
            Mobile from = args.Mobile;
            Mobile c    = from.LastKiller;

            if (args.Mobile.AccessLevel < AccessLevel.GameMaster)
            {
                switch (Utility.Random(4))
                {
                case 0:
                    args.Mobile.PlaySound(256);
                    World.Broadcast(0x40, true, "Death to {0} May God have mercy on your soul.", args.Mobile.Name);
                    break;

                case 1:
                    args.Mobile.PlaySound(256);
                    World.Broadcast(0x40, true, "{0} Has Lost their Life In Battle.", args.Mobile.Name);
                    break;

                case 2:
                    args.Mobile.PlaySound(256);
                    World.Broadcast(0x31, true, "Death Comes for Us all, But on this Day, For {0}.", args.Mobile.Name);
                    break;

                case 3:
                    args.Mobile.PlaySound(256);
                    World.Broadcast(0x40, true, "{0} Has Succumbed To Their Wounds And Has Perished!", args.Mobile.Name);
                    break;
                }
            }
        }
Example #4
0
        private static void OnPlayerDeath(PlayerDeathEventArgs e)
        {
            PlayerMobile dead = e.Mobile as PlayerMobile;

            if (dead == null || dead.Deleted || dead.Alive)
            {
                return;
            }

            if (!DeathRegister.Contains(dead))
            {
                DeathRegister.Add(dead);
            }

            dead.Frozen = false;

            if (dead.LastKiller == null || dead.LastKiller is BaseCreature)
            {
                dead.SendMessage("Has sido noqueado");
                Timer.DelayCall(TimeSpan.FromSeconds(60), DeleteCorpseAndResurrect, dead);
            }
            else
            {
                dead.SendMessage("Has sido noqueado");
                Timer.DelayCall(TimeSpan.FromSeconds(60), DeleteCorpseAndResurrect, dead);
                // you use DeletePlayer instead DeleteCorpseAndResurrect for instant PVP Kill
            }
        }
Example #5
0
 public static void InvokePlayerDeath(PlayerDeathEventArgs e)
 {
     if (EventSink.PlayerDeath != null)
     {
         EventSink.PlayerDeath.Invoke(e);
     }
 }
/*
 *              public static void InvokeInscribeMenuRequest( InscribeMenuRequestEventArgs e )
 *              {
 *                      if ( InscribeMenuRequest != null )
 *                              InscribeMenuRequest( e );
 *              }
 */
        public static void InvokePlayerDeath(PlayerDeathEventArgs e)
        {
            if (PlayerDeath != null)
            {
                PlayerDeath(e);
            }
        }
Example #7
0
        public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
        {
            Mobile m = e.Mobile;

            List<Mobile> killers = new List<Mobile>();
            List<Mobile> toGive  = new List<Mobile>();

            foreach ( AggressorInfo ai in m.Aggressors )
            {
                if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported )
                {
                    killers.Add( ai.Attacker );
                    ai.Reported = true;
                }

                if ( ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) )
                    toGive.Add( ai.Attacker );
            }

            foreach ( AggressorInfo ai in m.Aggressed )
            {
                if ( ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Defender ) )
                    toGive.Add( ai.Defender );
            }

            foreach ( Mobile g in toGive )
            {
                int n = Notoriety.Compute( g, m );

                int theirKarma = m.Karma, ourKarma = g.Karma;
                bool innocent = ( n == Notoriety.Innocent );
                bool criminal = ( n == Notoriety.Criminal || n == Notoriety.Murderer );

                int fameAward = m.Fame / 200;
                int karmaAward = 0;

                if (innocent)
                {
                    //Are they a virtue guard?
                    if (g.FindItemOnLayer(Layer.TwoHanded) is ChaosShield || g.FindItemOnLayer(Layer.TwoHanded) is OrderShield)
                    {
                        g.Kill();
                        g.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                        g.PlaySound(0x307);
                    }
                    karmaAward = 0;
                }
                else if (criminal)
                    karmaAward = 1;

                Titles.AwardKarma( g, karmaAward, true );
            }

            if ( m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild )
                return;

            if ( killers.Count > 0 )
                new GumpTimer( m, killers ).Start();
        }
		public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
		{
			Mobile m = e.Mobile;

			// Adam: not during Server Wars
			if (m.Player && m.AccessLevel == AccessLevel.Player && m.ShortTermMurders >= 5 && !Server.Misc.TestCenter.ServerWars())
				if ( !((PlayerMobile)m).Inmate )
					new GumpTimer( m ).Start();				
		}
Example #9
0
        private static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
        {
            Mobile m = e.Mobile;

            if ((m != null) && (!m.Alive))
            {
                Timer.DelayCall(TimeSpan.FromSeconds(5.0), ResurrectNow, m);
            }
        }
Example #10
0
 public static void OnPlayerDeath(PlayerDeathEventArgs e)
 {
     if (e.Mobile.AccessLevel >= AccessLevel.VIP)
     {
         e.Mobile.CloseGump(typeof(Gumps.ToolbarGump));
         object[] arg = new object[] { e.Mobile };
         Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(SendToolbar), arg);
     }
 }
Example #11
0
        public static void OnDeath(PlayerDeathEventArgs args)
        {
            Mobile m = args.Mobile;

            if (args.Mobile.AccessLevel < AccessLevel.GameMaster)//Edit AccessLevel to show its set for GameMaster
            {
                args.Mobile.PlaySound(256);
                World.Broadcast(0x35, true, "{0} Has been sent to the netherworld!!!", args.Mobile.Name);//Edit Message
            }
        }
        public static void OnDeath(PlayerDeathEventArgs args)
        {
            Mobile m = args.Mobile;

            if (args.Mobile.AccessLevel < AccessLevel.GameMaster)
            {
                args.Mobile.PlaySound(256);
                World.Broadcast(0x35, true, "{0} Has been sent to the netherworld!!!", args.Mobile.Name);
            }
        }
		public static void OnPlayerDeath(PlayerDeathEventArgs e)
		{
			if (e.Mobile.AccessLevel < AccessLevel.Counselor)
			{
				return;
			}

			e.Mobile.CloseGump(typeof(ToolbarGump));

			Timer.DelayCall(TimeSpan.FromSeconds(2.0), SendToolbar, e.Mobile);
		}
		public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
		{
			Mobile m = e.Mobile;

			List<Mobile> killers = new List<Mobile>();
			List<Mobile> toGive  = new List<Mobile>();

			foreach ( AggressorInfo ai in m.Aggressors )
			{
				if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported )
				{
					if (!Core.SE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker))
					{
					killers.Add( ai.Attacker );
					ai.Reported = true;
						ai.CanReportMurder = false;
					}
				}
				if ( ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) )
					toGive.Add( ai.Attacker );
			}

			foreach ( AggressorInfo ai in m.Aggressed )
			{
				if ( ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Defender ) )
					toGive.Add( ai.Defender );
			}

			foreach ( Mobile g in toGive )
			{
				int n = Notoriety.Compute( g, m );

				int theirKarma = m.Karma, ourKarma = g.Karma;
				bool innocent = ( n == Notoriety.Innocent );
				bool criminal = ( n == Notoriety.Criminal || n == Notoriety.Murderer );

				int fameAward = m.Fame / 200;
				int karmaAward = 0;

				if ( innocent )
					karmaAward = ( ourKarma > -2500 ? -850 : -110 - (m.Karma / 100) );
				else if ( criminal )
					karmaAward = 50;

				Titles.AwardFame( g, fameAward, false );
				Titles.AwardKarma( g, karmaAward, true );
			}

			if ( m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild )
				return;

			if ( killers.Count > 0 )
				new GumpTimer( m, killers ).Start();
		}
Example #15
0
 /// <summary>
 /// Sends a toolbar to staff members upon death.
 /// </summary>
 public static void OnPlayerDeath(PlayerDeathEventArgs e)
 {
     if (e.Mobile.AccessLevel >= AccessLevel.Counselor)
     {
         e.Mobile.CloseGump(typeof(Toolbar));
         object[] arg = new object[] {e.Mobile};
         Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( SendToolbar ), arg);
         e.Mobile.Resurrect();
         e.Mobile.Hits = 10000;
         e.Mobile.Mana = 10000;
         e.Mobile.Stam = 10000;
     }
 }
Example #16
0
 public static void OnDeath(PlayerDeathEventArgs e)
 {
     if (m_AFK.Contains(e.Mobile.Serial.Value))
     {
         AFK afk = (AFK)m_AFK[e.Mobile.Serial.Value];
         if (afk == null)
         {
             e.Mobile.SendMessage("L'objet AFK est manquant!");
             return;
         }
         e.Mobile.PlaySound(e.Mobile.Female ? 814 : 1088);
         afk.wakeUp();
     }
 }
Example #17
0
		public static void EventSink_PlayerDeath( PlayerDeathEventArgs args )
		{
			Mobile m = args.Mobile;

			if( m == null )
				return;

			if( m.LastKiller != null && m.LastKiller is PlayerMobile )
			{
				if( m.LastKiller.Serial == m.Serial )
					WriteLine( m, "{0}: {1}", LogManager.Format( m ), "may have been killed by poison" );
				else
					WriteLine( m, "{0}: {1} {2}", LogManager.Format( m ), "was killed by", LogManager.Format( m.LastKiller ) );
			}
		}
		public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
		{
			Mobile m = e.Mobile;
			Mobile lastKiller = m.LastKiller;

			if ( IsInsideKhaldun( m ) && IsInsideKhaldun( lastKiller ) && lastKiller.Player && !m_Table.Contains( lastKiller ) )
			{
				foreach ( AggressorInfo ai in m.Aggressors )
				{
					if ( ai.Attacker == lastKiller && ai.CanReportMurder )
					{
						SummonRevenant( m, lastKiller );
						break;
					}
				}
			}
		}
Example #19
0
		public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
		{
			Mobile from = e.Mobile;
			Party p = Party.Get( from );

			if ( p != null )
			{
				Mobile m = from.LastKiller;

				if ( m == from )
					p.SendPublicMessage( from, "I killed myself !!" );
				else if ( m == null )
					p.SendPublicMessage( from, "I was killed !!" );
				else
					p.SendPublicMessage( from, String.Format( "I was killed by {0} !!", m.Name ) );
			}
		}
        static void OnDeath(PlayerDeathEventArgs e)
        {
            var killed = e.Mobile;
            var killer = e.Mobile.LastKiller;

            if (killer == killed)
            {
                World.Broadcast(0x482, false, "{0} has committed suicide!", killed.Name);
            }
            else if (killer != null)
            {
                World.Broadcast(0x482, false, "{0} has been killed by {1}!", killed.Name, killer.Name);
            }
            else
            {
                World.Broadcast(0x482, false, "{0} has been killed!", killed.Name);
            }
        }
Example #21
0
        public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
        {
            PlayerMobile killed = e.Mobile as PlayerMobile;
            if (killed == null || !(killed is PlayerMobile) || killed.Map != Map.Malas) return;
            PlayerMobile killer = killed.LastKiller as PlayerMobile;
            if (killer == null || killer.Map != Map.Malas || killer.AccessLevel > AccessLevel.Player) return;

            // don't mind about neutral alignment
            if (killed.Alignment != Alignment.Neutral)
            {
                // If killed is not in the same alignment, increase counter
                // otherwise, decrease it
                if (killed.Alignment != killer.Alignment)
                    Alignments.Instance.incKills(killer.Alignment, killed.Player);
                else if (killed.Alignment == killer.Alignment)
                    Alignments.Instance.decKills(killer.Alignment, killed.Player);
            }
        }
  private static void EventSink_Death(PlayerDeathEventArgs e)
  {
  PlayerMobile owner = e.Mobile as PlayerMobile;
 
  if (owner != null && !owner.Deleted)
  {
  if (owner.Alive)
  return;
 
  if (owner.Backpack == null || owner.Backpack.Deleted)
  return;
 
  AutoResStone stone = owner.Backpack.FindItemByType(typeof(AutoResStone)) as AutoResStone;
 
  if (stone != null && !stone.Deleted)
  {
  owner.SendMessage("Your stone of rebirth has saved you from the farplane.");
  owner.Resurrect();
  }
  }
  }
        private static void EventSink_Death(PlayerDeathEventArgs e)
        {
            PlayerMobile owner = e.Mobile as PlayerMobile;


            if (owner != null && !owner.Deleted)
            {
                if (owner.Alive)
                    return;

                if (owner.Backpack == null || owner.Backpack.Deleted)
                    return;

                AnkeOfResurrection stone = owner.Backpack.FindItemByType(typeof(AnkeOfResurrection)) as AnkeOfResurrection;

                if (stone != null && !stone.Deleted)
                {
                    owner.SendMessage("Your Anke of Resurrection will bring you back in 3 seconds!");
                    stone.CountDown(owner);
                }
            }
        }
Example #24
0
        public static void OnDeath(PlayerDeathEventArgs args)
        {
            Mobile from   = args.Mobile;
            Mobile c      = from.LastKiller;
            string victim = from.Name;
            string killer = "";

            if (c != null)
            {
                killer = c.Name + " " + c.Title;
                BaseCreature bc = c as BaseCreature;
                if (bc != null && bc.ControlMaster != null)
                {
                    killer = bc.ControlMaster.Name;
                    if (from == bc.ControlMaster)
                    {
                        killer = "their own pet";
                    }
                }
            }

            if (c == null)
            {
                World.Broadcast(0x18, true, "{0} died at the hands of a {1}", victim, killer);
            }
            else if (c == from)
            {
                World.Broadcast(0x18, true, "{0} has committed suicide!", victim);
            }
            else if (c is PlayerMobile)
            {
                World.Broadcast(0x18, true, "{0} has been murdered by {1}!", victim, killer);
            }
            else
            {
                World.Broadcast(0x18, true, "{0} has been killed by {1}!", victim, killer);
            }
        }
 public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
 {
     Killed(e.Mobile);
 }
Example #26
0
 public static void InvokePlayerDeath( PlayerDeathEventArgs e )
 {
     if ( PlayerDeath != null )
         PlayerDeath( e );
 }
Example #27
0
		public static void OnDeath( PlayerDeathEventArgs e )
		{
			WakeUp( e.Mobile );
		}
Example #28
0
        private static void EventSink_PlayerDeath(PlayerDeathEventArgs args)
        {
            Jogador jogador = (Jogador)args.Mobile;
            MorteModule mm = jogador.getSistemaMorte().getMorteModule();

            //mensagem
            jogador.PublicOverheadMessage(MessageType.Regular, 1, true, jogador.Name + " acaba de desmaiar.", true);

            if (mm != null)
            {
                //marca início de desmaio
                mm.Desmaiado = true;
                mm.InicioDesmaio = DateTime.Now;

                //manda o jogador para a sala da morte
                jogador.getSistemaMorte().teleportarSalaDaMorte();

                //inicia o timer de morte
                int tempoDesmaiado = (mm.Desmaio * TempoDesmaio) + 1; // para cada ponto de desmaio, fica mais tempo desmaiado
                mm.TimerMorte = new TimerMorte(jogador, tempoDesmaiado);
                mm.TimerMorte.Start();

                jogador.SendMessage("voce acaba de desmaiar. Deve recobrar a conciencia em {0} minutos", tempoDesmaiado);
            }
            else
            {
                Console.WriteLine("{0} não possui o modulo de morte.", jogador.Name);
            }
        }
Example #29
0
		private static void OnPlayerDeath( PlayerDeathEventArgs e )
		{
			CTFTeam team = FindTeamFor( e.Mobile );
			if ( team != null )
				new DeathTimer( e.Mobile, team ).Start();

		}
Example #30
0
        public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
        {
            BaseBoat boat = GetPiloting(e.Mobile);

            if (boat != null)
                boat.RemovePilot(e.Mobile);
        }
Example #31
0
        public static void OnDeath(PlayerDeathEventArgs args)
        {
            Mobile m = args.Mobile;

            GhostHelper.OnGhostWalking(m);
        }
Example #32
0
		private static void OnPlayerDeath( PlayerDeathEventArgs e )
		{
			new DeathTimer( e.Mobile ).Start();
		}
Example #33
0
        public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
        {
            Mobile m = e.Mobile;

            bool _newb = false;

            CustomRegion cr = null;
            if ( m.Region is CustomRegion )
            {
                cr = ((CustomRegion)m.Region);

                // No counts in Battlegrounds!
                if ( cr != null && cr.BattleGrounds )
                    return;
            }

            if ( m is PlayerMobile ) { // Sanity
                PlayerMobile killed = (PlayerMobile)m;
                _newb = ( killed.SkillsTotal < _SkillThreshold || killed.GameTime < _GameTimeThreshold );
            }

            List<Mobile> killers = new List<Mobile>();
            List<Mobile> toGive  = new List<Mobile>();

            foreach ( AggressorInfo ai in m.Aggressors )
            {
                if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported )
                {
                    killers.Add( ai.Attacker );
                    ai.Reported = true;

                    if ( _newb && ai.Attacker is PlayerMobile ) {
                        PlayerMobile killer = (PlayerMobile)ai.Attacker;

                        if ( killer.SkillsTotal >= _SkillThreshold && killer.GameTime >= _GameTimeThreshold ) {
                            killer.NewbKills++;
                        }
                    }
                }

                if ( ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) )
                    toGive.Add( ai.Attacker );
            }

            foreach ( AggressorInfo ai in m.Aggressed )
            {
                if ( ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Defender ) )
                    toGive.Add( ai.Defender );
            }

            foreach ( Mobile g in toGive )
            {
                int n = Notoriety.Compute( g, m );

                int theirKarma = m.Karma, ourKarma = g.Karma;
                bool innocent = ( n == Notoriety.Innocent );
                bool criminal = ( n == Notoriety.Criminal || n == Notoriety.Murderer );

                int fameAward = m.Fame / 200;
                int karmaAward = 0;

                if ( innocent )
                    karmaAward = ( ourKarma > -2500 ? -850 : -110 - (m.Karma / 100) );
                else if ( criminal )
                    karmaAward = 50;

                Titles.AwardFame( g, fameAward, false );
                Titles.AwardKarma(g, karmaAward, true);

                Server.Items.XmlQuest.RegisterKill(m, g);// modification to support XmlQuest Killtasks of players
            }

            if ( m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild )
                return;

            if ( killers.Count > 0 )
                new GumpTimer( m, killers ).Start();

            //m.LastKiller = null;
            try
            {
                m.Aggressors.Clear();
            }
            catch { }

            try
            {
                m.Aggressed.Clear();
            }
            catch { }
        }
Example #34
0
		public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
		{
			Mobile m = e.Mobile;

			//Check to make sure inmates don't give counts.
			if( m is PlayerMobile )
			{
				if( ((PlayerMobile)m).Inmate )
				{
					return;
				}
			}

            //Check to make sure we don't give counts during Server Wars.
            if (Server.Misc.AutoRestart.ServerWars == true)
                return;

			ArrayList killers = new ArrayList();
			ArrayList toGive = new ArrayList();

			//if ( DateTime.Now < ((PlayerMobile)m).NextMurderCountTime )
			//	return;

			bool bTimeRestricted = false; //false means they're out of time restriction

			foreach ( AggressorInfo ai in m.Aggressors )
			{
				bTimeRestricted = false;

				//Pix: 3/20/07 - fix a premature change that was made for townships
				//if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported && !ai.InitialAggressionNotCountable )
				if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported && !ai.InitialAggressionInNoCountZone)
				{
					try //just for safety's sake
					{
						if( m is PlayerMobile )
						{
							PlayerMobile pm = (PlayerMobile)m;
							if( pm.KillerTimes == null )
							{
								pm.KillerTimes = new ArrayList();
							}

							bool bFound = false;
							KillerTime kt = null;
							foreach( KillerTime k in pm.KillerTimes )
							{
								if( k.Killer == ai.Attacker )
								{
									bFound = true;
									kt = k;
								}
							}

							if( bFound )
							{
								if( kt != null )
								{
									if( DateTime.Now - kt.Time < TimeSpan.FromMinutes(2.0) )
									{
										bTimeRestricted = true;
									}
									kt.Time = DateTime.Now;
								}
							}
							else
							{
								kt = new KillerTime( ai.Attacker, DateTime.Now );
								pm.KillerTimes.Add(kt);
							}
						}
					}
					catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }

					if( !bTimeRestricted )
					{
						killers.Add( ai.Attacker );
					}
					ai.Reported = true;
				}

				if ( ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) )
					toGive.Add( ai.Attacker );
			}

			foreach ( AggressorInfo ai in m.Aggressed )
			{
				if ( ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Defender ) )
					toGive.Add( ai.Defender );
			}

			foreach ( Mobile g in toGive )
			{
				int n = Notoriety.Compute( g, m );

				int theirKarma = m.Karma, ourKarma = g.Karma;
				bool innocent = ( n == Notoriety.Innocent );
				bool criminal = ( n == Notoriety.Criminal || n == Notoriety.Murderer );

				int fameAward = m.Fame / 200;
				int karmaAward = 0;

				if ( innocent )
					karmaAward = ( ourKarma > -2500 ? -850 : -110 - (m.Karma / 100) );
				else if ( criminal )
					karmaAward = 50;

				Titles.AwardFame( g, fameAward, false );
				Titles.AwardKarma( g, karmaAward, true );
			}

			if ( m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild )
				return;

			if ( killers.Count > 0 )
				new GumpTimer( m, killers ).Start();

			//((PlayerMobile)m).NextMurderCountTime = DateTime.Now + TimeSpan.FromMinutes(2.0);
		}
Example #35
0
 public static void InvokePlayerDeath(PlayerDeathEventArgs e)
 {
     PlayerDeath?.Invoke(e);
 }
        public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
		{
			Mobile from = e.Mobile;

			if ( !IsStranded( from ) )
				return;

			Map map = from.Map;

			Point2D[] list;

			if( map == Map.Felucca )
				list = m_Felucca;
			else if( map == Map.Trammel )
				list = m_Trammel;
			else if( map == Map.Ilshenar )
				list = m_Ilshenar;
			else if( map == Map.Tokuno )
				list = m_Tokuno;
			else
				return;

			Point2D p = Point2D.Zero;
			double pdist = double.MaxValue;

			for ( int i = 0; i < list.Length; ++i )
			{
				double dist = from.GetDistanceToSqrt( list[i] );

				if ( dist < pdist )
				{
					p = list[i];
					pdist = dist;
				}
			}

			int x = p.X, y = p.Y;
			int z;
			bool canFit = false;

			z = map.GetAverageZ( x, y );
			canFit = map.CanSpawnMobile( x, y, z );

			for ( int i = 1; !canFit && i <= 40; i += 2 )
			{
				for ( int xo = -1; !canFit && xo <= 1; ++xo )
				{
					for ( int yo = -1; !canFit && yo <= 1; ++yo )
					{
						if ( xo == 0 && yo == 0 )
							continue;

						x = p.X + (xo * i);
						y = p.Y + (yo * i);
						z = map.GetAverageZ( x, y );
						canFit = map.CanSpawnMobile( x, y, z );
					}
				}
			}

            if (canFit)
            {
                Point3D dest = new Point3D(x, y, z);
                Mobiles.BaseCreature.TeleportPets(from, dest, map);
                from.Location = dest;
            }

            Item corpse = from.Corpse;

            if (corpse != null)
                corpse.MoveToWorld(from.Location, from.Map);

            from.SendMessage("You have perished at sea and your lifeless body has washed up on a nearby shore.");
		}
 private static void EventSink_Death(PlayerDeathEventArgs e)
 {
     CheckRelease(e.Mobile);
 }
Example #38
0
        private void EventSink_PlayerDeath(PlayerDeathEventArgs e)
        {
            if (!this.Enabled || !Server.Core.AOS)
                return;

            FoodEffectModule module = e.Mobile.GetModule(typeof(FoodEffectModule)) as FoodEffectModule;

            if (module != null)
                module.EffectExpired(true);
        }
        private static void EventSink_CorpseCheck(PlayerDeathEventArgs e)
        {
            PlayerMobile owner = e.Mobile as PlayerMobile;

            if (owner == null)
                return;

            //Corpse Retrieval System Mod
            CorpseSystem.CorpseMod.CorpseCheck(owner);
        }