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) //bounty system edit // orig if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported ) if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported && !BountyBoard.Attackable(ai.Attacker, e.Mobile) && !m.IsInEvent) // end bounty system edit { 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 ) { /* Taran: Fame and Karma awards already exists in FameKillSystem.cs 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) */ // modification to support XmlQuest Killtasks of players Items.XmlQuest.RegisterKill(m, g); } if ( m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild ) return; if ( killers.Count > 0 ) new GumpTimer( m, killers ).Start(); }
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(); } } }
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 OnLogout(PlayerDeathEventArgs e) { PlayerMobile pm = e.Mobile as PlayerMobile; if (pm == null) { return; } if (pm.DuelStone != null) { if (pm.DuelStone.Combatant1 == e.Mobile) { pm.DuelStone.Combatant1 = null; pm.DuelStone = null; } else if (pm.DuelStone.Combatant2 == e.Mobile) { pm.DuelStone.Combatant2 = null; pm.DuelStone = null; } else if (pm.DuelStone.Combatant3 == e.Mobile) { pm.DuelStone.Combatant3 = null; pm.DuelStone = null; } else if (pm.DuelStone.Combatant4 == e.Mobile) { pm.DuelStone.Combatant4 = null; pm.DuelStone = null; } } }
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); } }
protected internal virtual void OnPlayerDeath(PlayerDeathEventArgs e) { if (PlayerDeath != null) { PlayerDeath(this, e); } if (!e.Handled) { switch (e.DeathType) { case DamageType.Combat: if (e.Killer is PlayerEntity) { var killer = e.Killer as PlayerEntity; SendChat(e.Player.Username + " was killed by " + killer.Username); } else { SendChat(e.Player.Username + " died."); } // TODO: Mobs break; default: SendChat(e.Player.Username + " died."); break; } } }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { if (e.Mobile is PlayerMobile player && !player.Deleted && m_Timer.Running && !m_DeathQueue.Contains(player) && m_DeathQueue.Count < m_DeathQueueLimit) { m_DeathQueue.Add(player); } }
private static void OnCombatantDeath(PlayerDeathEventArgs e) { try { PlayerMobile victim, killer; if (e.Mobile is PlayerMobile && e.Mobile.LastKiller is PlayerMobile) { victim = e.Mobile as PlayerMobile; killer = victim.LastKiller as PlayerMobile; CombatantProfile victor = ((IPlayerCombatant)killer).CombatProfile; CombatantProfile defeated = ((IPlayerCombatant)victim).CombatProfile; Handler.IncreaseDeaths(defeated); Handler.IncreaseKills(victor); QueryRankChange(victor); QueryRankChange(defeated); Handler.CalculateNewRating(victor, defeated.CombatRating, CombatResults.Victory); Handler.CalculateNewRating(defeated, victor.CombatRating, CombatResults.Loss); } } catch (Exception x) { eqUtility.HandleGenericException(x); } }
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); } } }
private static void OnLogout( PlayerDeathEventArgs e ) { PlayerMobile pm = e.Mobile as PlayerMobile; if( pm == null ) return; if( pm.DuelStone != null ) if( pm.DuelStone.Combatant1 == e.Mobile ) { pm.DuelStone.Combatant1 = null; pm.DuelStone = null; } else if( pm.DuelStone.Combatant2 == e.Mobile ) { pm.DuelStone.Combatant2 = null; pm.DuelStone = null; } else if( pm.DuelStone.Combatant3 == e.Mobile ) { pm.DuelStone.Combatant3 = null; pm.DuelStone = null; } else if( pm.DuelStone.Combatant4 == e.Mobile ) { pm.DuelStone.Combatant4 = null; pm.DuelStone = null; } }
public virtual void HandlePlayerDeath(PlayerDeathEventArgs e) { if (e.Mobile is PlayerMobile) { OnPlayerDeath((PlayerMobile)e.Mobile, e.Mobile.Corpse); } }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { if (DragonList.ContainsKey(e.Mobile)) { DragonList[e.Mobile].Expire(); } }
private static void OnPlayerDeath(PlayerDeathEventArgs e) { if (UnderEffect(e.Mobile)) { RemoveEffects(e.Mobile); } }
private void Player_PlayerDeathEvent(PlayerDeathEventArgs ev) { if (ev.Victim.RoleID != 0) { ev.Victim.RoleID = (int)RoleType.Scp173; } }
public static void PlayerDeath(PlayerDeathEventArgs args) { PlayerMobile pm = (PlayerMobile)args.Mobile; if (pm != null && pm.Backpack != null) { GemOfSalvation gem = pm.Backpack.FindItemByType <GemOfSalvation>(); if (gem != null) { Timer.DelayCall(TimeSpan.FromSeconds(2), () => { if (DateTime.UtcNow < pm.NextGemOfSalvationUse) { TimeSpan left = pm.NextGemOfSalvationUse - DateTime.UtcNow; if (left >= TimeSpan.FromMinutes(1.0)) { pm.SendLocalizedMessage(1095131, ((left.Hours * 60) + left.Minutes).ToString()); // Your spirit lacks cohesion. You must wait ~1_minutes~ minutes before invoking the power of a Gem of Salvation. } else { pm.SendLocalizedMessage(1095130, left.Seconds.ToString()); // Your spirit lacks cohesion. You must wait ~1_seconds~ seconds before invoking the power of a Gem of Salvation. } } else { pm.CloseGump(typeof(ResurrectGump)); pm.SendGump(new GemResurrectGump(pm, gem)); } }); } } }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { Mobile killed = e.Mobile; Mobile killer = e.Mobile.LastKiller; //Ignore non-players if (!(killed is PlayerMobile)) return; //Ignore players in events if ((killed).IsInEvent || ((killer != null) && killer.IsInEvent)) return; //Ignore players in a NoFameLoss region if (killed.Region is CustomRegion) { CustomRegion cR = (CustomRegion)killed.Region; if (cR.Controller.NoFameLoss) return; } //Remove 1/10th of the fame when a player dies killed.Fame -= (killed.Fame / 10); if (killer == null || killer.Combatant != killed ) return; if (!killer.InRange(killed.Location, 15)) return; int n = Notoriety.Compute(killer, killed); bool innocent = (n == Notoriety.Innocent); bool faction = (n == Notoriety.Enemy || n == Notoriety.Ally); bool criminal = (n == Notoriety.Criminal || n == Notoriety.Murderer); int fameAward = killed.Fame/10; int karmaAward = -killed.Karma/10; if (innocent && karmaAward > 0) karmaAward = -(karmaAward); else if (criminal && karmaAward < 0) karmaAward = -(karmaAward); //Reward the killer karma only if he attacked first and it's not a faction kill if (!faction && (NotorietyHandlers.CheckAggressor(killed.Aggressors, killer) || NotorietyHandlers.CheckAggressed(killed.Aggressors, killer))) Titles.AwardKarma(killer, karmaAward, true); Titles.AwardFame(killer, fameAward, true); if (innocent) { ++killer.Kills; if (killer.Kills == 5) killer.SendLocalizedMessage(502134); //You are now known as a murderer! } else if (Stealing.SuspendOnMurder && killer.Kills >= 1 && killer is PlayerMobile && ((PlayerMobile)killer).NpcGuild == NpcGuild.ThievesGuild) killer.SendLocalizedMessage(501562); // You have been suspended by the Thieves Guild. }
public override void OnDeath(PlayerDeathEventArgs e) { RemoveFromVehicle(); DisposeVehicle(); SendDeathMessageToAll(e.Killer, this, e.DeathReason); base.OnDeath(e); }
internal void InvokePlayerDeathEvent(Player victim, Player killer, PlayerStats.HitInfo info) { var ev = new PlayerDeathEventArgs { HitInfo = info, Killer = killer, Victim = victim }; PlayerDeathEvent?.Invoke(ev); }
void Awake() { //setting basic things, "Hide" disables the object (game not started yet) MAX_HEALTH = PreferenceData.GetMaxHealth(); rigidBody = GetComponent <Rigidbody>(); playerDeathEventArgs = new PlayerDeathEventArgs(); ALIVE = false; Hide(); }
private static void OnPlayerDeath(PlayerDeathEventArgs e) { CTFTeam team = FindTeamFor(e.Mobile); if (team != null) { new DeathTimer(e.Mobile, team).Start(); } }
private static void OnPlayerDeath(PlayerDeathEventArgs e) { var m = e.Mobile; if (UnderEffect(m)) { RemoveEffects(m); } }
private static void PlayerDeath_Record(PlayerDeathEventArgs e) { string Location_Data = e.Mobile.Map + "*" + e.Mobile.Location.X + "*" + e.Mobile.Location.Y; if (!PlayerDeath_Locations.Contains(Location_Data)) { PlayerDeath_Locations.Add(Location_Data); } }
/// <summary> /// Sends a toolbar to staff members upon death. /// </summary> // Talow and AlphaDragon fix 2/3 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(2.0), new TimerStateCallback(SendToolbar), arg); } }
private void Player_PlayerDeathEvent(PlayerDeathEventArgs ev) { if (!Config.ExplodingScps.Contains(ev.Victim.RoleID)) { return; } Map.Get.Explode(ev.Victim.Position, Synapse.Api.Enum.GrenadeType.Grenade, ev.Victim); }
public static void OnPlayerDeath(PlayerDeathEventArgs e) { PlayerMobile pm = e.Mobile as PlayerMobile; if (pm != null && Instance != null) { Instance.HandlePlayerDeath(pm); } }
public static void OnDeath(PlayerDeathEventArgs args) { PlayerMobile pm = (PlayerMobile)args.Mobile; if (pm != null) { HandleDeath(pm); } }
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.UtcNow - 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.UtcNow - 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); } if (m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild) return; if (killers.Count > 0) new GumpTimer(m, killers).Start(); }
private void EventSink_PlayerDeath(PlayerDeathEventArgs e) { if (((ScriptMobile)e.Mobile).PVPInfo.CurrentEvent == m_pvpevent) { if (!((ScriptMobile)e.Mobile).PVPInfo.m_IsDespawned) { Timer.DelayCall(DeathTime, new TimerStateCallback(Delayed_Ondeath), e); } } }
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); }
private void Player_PlayerDeathEvent(PlayerDeathEventArgs ev) { if (!WooshRagdolls.Config.NoRagdollSpawning) { return; } Timing.CallDelayed(0.01f, () => { var ragdoll = Map.Get.Ragdolls[Map.Get.Ragdolls.Count - 1]; ragdoll.Destroy(); }); }
private static void OnPlayerDeath(PlayerDeathEventArgs e) { PlayerMobile pm = e.Mobile as PlayerMobile; if (pm == null || pm.DuelStone == null) { return; } #region DuelstoneCode DuelStone ds = pm.DuelStone; //Reset combatants if (pm.LastKiller != null) { //Taran: Had to add this to reward fame, since combatant is nulled below int fameAward = pm.Fame / 10; Titles.AwardFame(pm.LastKiller, fameAward, true); pm.LastKiller.Combatant = null; pm.Combatant = null; } //Update duelstone if (ds.IsLadderStone) { DuelstoneLadderUpdate.StartUpdate(ds, pm); } if (ds.StoneType.ToString().Contains("Loot")) { if (pm.Corpse != null) { ((Corpse)pm.Corpse).Carve(pm, null); } } else { GiveOpponentMoney(ds, pm); } pm.SendAsciiMessage("You will be teleported out in " + ds.StoneMaxIdleTime + " seconds."); if (ds.MoveTimer == null) { ds.MoveTimer = Timer.DelayCall(TimeSpan.FromSeconds(ds.StoneMaxIdleTime + 1), new TimerStateCallback(TeleOut), ds); } if (ds.CountTimer == null) { ds.CountTimer = Timer.DelayCall(TimeSpan.Zero, TimeSpan.FromSeconds(1.0), ds.StoneMaxIdleTime + 1, new TimerStateCallback(CountToEnd), new object[] { ds, ds.StoneMaxIdleTime }); } #endregion }
public static void OnPlayerDeath(PlayerDeathEventArgs e) { if (!Enabled) { return; } if (e.Mobile is PlayerMobile pm && Instance != null) { Instance.HandlePlayerDeath(pm); } }
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); }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { if (e.Mobile != null && !e.Mobile.Deleted && e.Mobile is PlayerMobile) /* not sure .. better safe than sorry? */ { PlayerMobile player = e.Mobile as PlayerMobile; if (m_Timer.Running && !m_DeathQueue.Contains(player) && m_DeathQueue.Count < m_DeathQueueLimit) { m_DeathQueue.Add(player); } } }
public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) { if( e.Mobile != null && !e.Mobile.Deleted ) /* not sure .. better safe than sorry? */ { if( e.Mobile is PlayerMobile ) { PlayerMobile player = e.Mobile as PlayerMobile; if( m_Timer.Running && !m_DeathQueue.Contains( player ) && m_DeathQueue.Count < m_DeathQueueLimit ) { m_DeathQueue.Add( player ); } } } }
public static void OnDeath(PlayerDeathEventArgs args) { Mobile mob = args.Mobile.LastKiller; if ((mob != null) && (mob == args.Mobile)) { World.Broadcast(0x482, false, "{0} has killed themself!", args.Mobile.Name); } else if (mob != null) { World.Broadcast(0x482, false, "{0} has been killed by {1}!", args.Mobile.Name, mob.Name); } else { World.Broadcast(0x482, false, "{0} has been killed!", args.Mobile.Name); } }
public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) { Mobile from = e.Mobile; Party p = 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 ) ); } }
public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) { Mobile m = e.Mobile; Mobile lastKiller = m.LastKiller; if ( lastKiller is BaseCreature ) lastKiller = ((BaseCreature)lastKiller).GetMaster(); 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; } } } }
private static void OnPlayerDeath( PlayerDeathEventArgs e ) { PlayerMobile pm = e.Mobile as PlayerMobile; if( pm == null || pm.DuelStone == null ) return; #region DuelstoneCode DuelStone ds = pm.DuelStone; //Reset combatants if( pm.LastKiller != null ) { //Taran: Had to add this to reward fame, since combatant is nulled below int fameAward = pm.Fame / 10; Titles.AwardFame(pm.LastKiller, fameAward, true); pm.LastKiller.Combatant = null; pm.Combatant = null; } //Update duelstone if( ds.IsLadderStone ) DuelstoneLadderUpdate.StartUpdate( ds, pm ); if( ds.StoneType.ToString().Contains( "Loot" ) ) { if( pm.Corpse != null ) ((Corpse)pm.Corpse).Carve( pm, null ); } else GiveOpponentMoney( ds, pm ); pm.SendAsciiMessage( "You will be teleported out in " + ds.StoneMaxIdleTime + " seconds." ); if( ds.MoveTimer == null ) ds.MoveTimer = Timer.DelayCall( TimeSpan.FromSeconds( ds.StoneMaxIdleTime + 1 ), new TimerStateCallback( TeleOut ), ds ); if( ds.CountTimer == null ) ds.CountTimer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1.0 ), ds.StoneMaxIdleTime + 1, new TimerStateCallback( CountToEnd ), new object[] { ds, ds.StoneMaxIdleTime } ); #endregion }
private static void OnPlayerDeath(PlayerDeathEventArgs e) { if (e == null || e.Mobile == null || !(e.Mobile is PlayerMobile)) { return; } var player = (PlayerMobile)e.Mobile; if (IsCamera(player)) { return; } if (player.LastKiller != null && player != player.LastKiller) { CurrentDeathCount++; if (player.LastKiller is PlayerMobile) { PlayerKillerCheck(player.LastKiller as PlayerMobile); } else if (player.LastKiller is BaseCreature && ((BaseCreature)player.LastKiller).Controlled && ((BaseCreature)player.LastKiller).ControlMaster is PlayerMobile) { PlayerKillerCheck(((BaseCreature)player.LastKiller).ControlMaster as PlayerMobile); } else if (player.LastKiller is BaseCreature && !((BaseCreature)player.LastKiller).Controlled) { MonsterKillerCheck((BaseCreature)player.LastKiller); } } foreach (PlayerMobile cam in GetCams()) { cam.PlaySound(100); RefreshUI(cam); } }
protected virtual int GetProgress(ConquestState state, PlayerDeathEventArgs args) { if (state.User == null) return 0; if (args == null || args.Mobile is PlayerMobile && args.Mobile.Account != state.User.Account) { return 0; } if (IsDuel && args.Killer is PlayerMobile && ((PlayerMobile)args.Killer).DuelContext == null || IsDuel && !(args.Killer is PlayerMobile)) { return 0; } if (IsDungeon && !args.Killer.InRegion<DungeonRegion>()) { return 0; } return 1; }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { Mobile m = e.Mobile; if (m.LastKiller != null && (m.LastKiller == m || m.LastKiller is BaseGuard || m.LastKiller is BaseCreature && ((BaseCreature)m.LastKiller).GetMaster() == m)) { return; } var killers = new List<Mobile>(); var toGive = new List<Mobile>(); DateTime now = DateTime.UtcNow; foreach (AggressorInfo ai in m.Aggressors) { //Allow people of the same ethic to flag each other as murderers? Factioners can? if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported && (!m.EraSE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker))) { killers.Add(ai.Attacker); ai.Reported = true; ai.CanReportMurder = false; } if (ai.Attacker.Player && now - ai.LastCombatTime < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker)) { toGive.Add(ai.Attacker); } } foreach (AggressorInfo ai in m.Aggressed.Where( ai => ai.Defender.Player && 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; int 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) { return; } if (m is PlayerMobile && ((PlayerMobile)m).Young && MurderSystemController._MurderYoungFreezeSeconds > 0) { new ParaTimer(m, killers).Start(); } new GumpTimer(m, killers, m.Location, m.Map).Start(); foreach (Mobile killer in killers) { m.RemoveAggressor(killer); if (killer is PlayerMobile) { var playerKiller = (PlayerMobile)killer; foreach (Mobile pet in playerKiller.AllFollowers) { m.RemoveAggressor(pet); } } killer.RemoveAggressed(m); } }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { var m = e.Mobile; var killers = new List<Mobile>(); var toGive = new List<Mobile>(); foreach (var ai in m.Aggressors) { if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported) { // Note: The default reportmurderer script only allows reporting the same player once every 10 minutes in the Core.SE expansion. // This was also the case in the T2A era, so I'm not sure why it was set to a minimum expansion of Core.SE if (!((PlayerMobile) m).RecentlyReported.Contains(ai.Attacker)) { killers.Add(ai.Attacker); ai.Reported = true; ai.CanReportMurder = false; } } if (ai.Attacker.Player && DateTime.UtcNow - ai.LastCombatTime < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker)) toGive.Add(ai.Attacker); } toGive.AddRange( m.Aggressed.Where( x => x.Defender is PlayerMobile && DateTime.UtcNow - x.LastCombatTime < TimeSpan.FromSeconds(30.0) && !toGive.Contains(x.Defender)).Select(x => x.Defender)); foreach (var g in toGive) { var n = Notoriety.Compute(g, m); var ourKarma = g.Karma; var innocent = n == Notoriety.Innocent; var criminal = n == Notoriety.Criminal || n == Notoriety.Murderer; var fameAward = m.Fame/200; var 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 || killers.Count == 0) return; var gump = m.FindGump(typeof (ReportMurdererBountyGump)) as ReportMurdererBountyGump; if (gump != null) gump.TryAddKillers(killers); else new GumpTimer(m, killers).Start(); }
public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) { if ( DragonList.ContainsKey( e.Mobile ) ) DragonList[e.Mobile].Expire(); }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { if (!duellers.Contains(e.Mobile)) return; foreach(DuelObject duel in duels) { if (duel.Player1 == e.Mobile) { if (duel.Timer != null) { duel.Timer.Stop(); duel.Finished(2, DateTime.Now); return; } else { duel.Finished(-2, DateTime.Now); return; } } else if (duel.Player2 == e.Mobile) { if (duel.Timer != null) { duel.Timer.Stop(); duel.Finished(1, DateTime.Now); return; } else { duel.Finished(-2, DateTime.Now); return; } } } }
private static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { Mobile m = e.Mobile; if (m == null) return; Duel duel; if (m_DuelTable.TryGetValue(m.Serial, out duel)) { if (duel.Started) duel.HandleDeath(m); } }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { Killed(e.Mobile); }
private static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) { Mobile m = e.Mobile; if( m == null ) return; if( IsInDeathmatch( m ) ) { DMStone stone = GetPlayerStone( m ); if( stone != null ) stone.HandleDeath( m ); } }
public void InvokePlayerDeath( PlayerDeathEventArgs e ) { if ( PlayerDeath != null ) PlayerDeath( e ); }