SE+ can not report murder on same player 2x in less than 10 min.

This commit is contained in:
xavier 2010-12-15 01:08:35 +00:00
parent ba5373c1cf
commit 1a79ffbbc7
2 changed files with 131 additions and 81 deletions

View file

@ -1,9 +1,6 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Server;
using Server.Misc; using Server.Misc;
using Server.Gumps;
using Server.Network; using Server.Network;
using Server.Mobiles; using Server.Mobiles;
@ -31,9 +28,12 @@ namespace Server.Gumps
{ {
if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported ) if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported )
{ {
killers.Add( ai.Attacker ); if (!Core.SE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker))
ai.Reported = true; {
ai.CanReportMurder = false; 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 ) ) if ( ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) )
toGive.Add( ai.Attacker ); toGive.Add( ai.Attacker );
@ -70,7 +70,6 @@ namespace Server.Gumps
if ( killers.Count > 0 ) if ( killers.Count > 0 )
new GumpTimer( m, killers ).Start(); new GumpTimer( m, killers ).Start();
} }
private class GumpTimer : Timer private class GumpTimer : Timer
@ -131,6 +130,19 @@ namespace Server.Gumps
AddHtmlLocalized( 400, 300, 300, 50, 1046363, false, false ); // No AddHtmlLocalized( 400, 300, 300, 50, 1046363, false, false ); // No
} }
public static void ReportedListExpiry_Callback( object state )
{
object[] states = (object[])state;
PlayerMobile from = (PlayerMobile)states[0];
Mobile killer = (Mobile)states[1];
if (from.RecentlyReported.Contains(killer))
{
from.RecentlyReported.Remove(killer);
}
}
public override void OnResponse( NetState state, RelayInfo info ) public override void OnResponse( NetState state, RelayInfo info )
{ {
Mobile from = state.Mobile; Mobile from = state.Mobile;
@ -145,15 +157,27 @@ namespace Server.Gumps
killer.Kills++; killer.Kills++;
killer.ShortTermMurders++; killer.ShortTermMurders++;
if ( killer is PlayerMobile ) if (Core.SE)
((PlayerMobile)killer).ResetKillTime(); {
((PlayerMobile)from).RecentlyReported.Add(killer);
Timer.DelayCall(TimeSpan.FromMinutes(10), new TimerStateCallback(ReportedListExpiry_Callback), new object[] { from, killer });
}
killer.SendLocalizedMessage( 1049067 );//You have been reported for murder! if (killer is PlayerMobile)
{
PlayerMobile pk = (PlayerMobile)killer;
pk.ResetKillTime();
pk.SendLocalizedMessage(1049067);//You have been reported for murder!
if ( killer.Kills == 5 ) if (pk.Kills == 5)
killer.SendLocalizedMessage( 502134 );//You are now known as a murderer! {
else if ( SkillHandlers.Stealing.SuspendOnMurder && killer.Kills == 1 && killer is PlayerMobile && ((PlayerMobile)killer).NpcGuild == NpcGuild.ThievesGuild ) pk.SendLocalizedMessage(502134);//You are now known as a murderer!
killer.SendLocalizedMessage( 501562 ); // You have been suspended by the Thieves Guild. }
else if (SkillHandlers.Stealing.SuspendOnMurder && pk.Kills == 1 && pk.NpcGuild == NpcGuild.ThievesGuild)
{
pk.SendLocalizedMessage(501562); // You have been suspended by the Thieves Guild.
}
}
} }
break; break;
} }

View file

@ -1,7 +1,6 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Server;
using Server.Misc; using Server.Misc;
using Server.Items; using Server.Items;
using Server.Gumps; using Server.Gumps;
@ -11,7 +10,6 @@ using Server.ContextMenus;
using Server.Network; using Server.Network;
using Server.Spells; using Server.Spells;
using Server.Spells.Fifth; using Server.Spells.Fifth;
using Server.Spells.Sixth;
using Server.Spells.Seventh; using Server.Spells.Seventh;
using Server.Spells.Necromancy; using Server.Spells.Necromancy;
using Server.Spells.Ninjitsu; using Server.Spells.Ninjitsu;
@ -119,8 +117,22 @@ namespace Server.Mobiles
private List<Mobile> m_AutoStabled; private List<Mobile> m_AutoStabled;
private List<Mobile> m_AllFollowers; private List<Mobile> m_AllFollowers;
private List<Mobile> m_RecentlyReported;
#region Getters & Setters #region Getters & Setters
public List<Mobile> RecentlyReported
{
get
{
return m_RecentlyReported;
}
set
{
m_RecentlyReported = value;
}
}
public List<Mobile> AutoStabled { get { return m_AutoStabled; } } public List<Mobile> AutoStabled { get { return m_AutoStabled; } }
public bool NinjaWepCooldown public bool NinjaWepCooldown
@ -140,7 +152,7 @@ namespace Server.Mobiles
get get
{ {
if( m_AllFollowers == null ) if( m_AllFollowers == null )
m_AllFollowers = new List<Mobile>();; m_AllFollowers = new List<Mobile>();
return m_AllFollowers; return m_AllFollowers;
} }
} }
@ -415,6 +427,7 @@ namespace Server.Mobiles
m_RecoverableAmmo.Clear(); m_RecoverableAmmo.Clear();
} }
} }
#endregion #endregion
private DateTime m_AnkhNextUse; private DateTime m_AnkhNextUse;
@ -1695,6 +1708,7 @@ namespace Server.Mobiles
} }
} }
} }
#endregion #endregion
private void GetVendor() private void GetVendor()
@ -1747,6 +1761,7 @@ namespace Server.Mobiles
base.DisruptiveAction(); base.DisruptiveAction();
} }
public override void OnDoubleClick( Mobile from ) public override void OnDoubleClick( Mobile from )
{ {
if ( this == from && !Warmode ) if ( this == from && !Warmode )
@ -1980,7 +1995,6 @@ namespace Server.Mobiles
return base.CheckShove( shoved ); return base.CheckShove( shoved );
} }
protected override void OnMapChange( Map oldMap ) protected override void OnMapChange( Map oldMap )
{ {
if ( (Map != Faction.Facet && oldMap == Faction.Facet) || (Map == Faction.Facet && oldMap != Faction.Facet) ) if ( (Map != Faction.Facet && oldMap == Faction.Facet) || (Map == Faction.Facet && oldMap != Faction.Facet) )
@ -2425,6 +2439,7 @@ namespace Server.Mobiles
m_VisList = new List<Mobile>(); m_VisList = new List<Mobile>();
m_PermaFlags = new List<Mobile>(); m_PermaFlags = new List<Mobile>();
m_AntiMacroTable = new Hashtable(); m_AntiMacroTable = new Hashtable();
m_RecentlyReported = new List<Mobile>();
m_BOBFilter = new Engines.BulkOrders.BOBFilter(); m_BOBFilter = new Engines.BulkOrders.BOBFilter();
@ -2559,6 +2574,7 @@ namespace Server.Mobiles
} }
#region Poison #region Poison
public override ApplyPoisonResult ApplyPoison( Mobile from, Poison poison ) public override ApplyPoisonResult ApplyPoison( Mobile from, Poison poison )
{ {
if ( !Alive ) if ( !Alive )
@ -2590,6 +2606,7 @@ namespace Server.Mobiles
else else
base.OnPoisonImmunity( from, poison ); base.OnPoisonImmunity( from, poison );
} }
#endregion #endregion
public PlayerMobile( Serial s ) : base( s ) public PlayerMobile( Serial s ) : base( s )
@ -2908,6 +2925,9 @@ namespace Server.Mobiles
} }
} }
if (m_RecentlyReported == null)
m_RecentlyReported = new List<Mobile>();
// Professions weren't verified on 1.0 RC0 // Professions weren't verified on 1.0 RC0
if ( !CharacterCreation.VerifyProfession( m_Profession ) ) if ( !CharacterCreation.VerifyProfession( m_Profession ) )
m_Profession = 0; m_Profession = 0;
@ -3440,6 +3460,7 @@ namespace Server.Mobiles
InvalidateMyRunUO(); InvalidateMyRunUO();
} }
#endregion #endregion
#region Fastwalk Prevention #region Fastwalk Prevention
@ -3497,6 +3518,7 @@ namespace Server.Mobiles
return ( ts < FastwalkThreshold ); return ( ts < FastwalkThreshold );
} }
#endregion #endregion
#region Enemy of One #region Enemy of One
@ -3545,6 +3567,7 @@ namespace Server.Mobiles
} }
} }
} }
#endregion #endregion
#region Hair and beard mods #region Hair and beard mods
@ -3605,6 +3628,7 @@ namespace Server.Mobiles
} }
CreateHair( hair, id, 0 ); CreateHair( hair, id, 0 );
} }
#endregion #endregion
#region Virtues #region Virtues
@ -3848,6 +3872,7 @@ namespace Server.Mobiles
{ {
this.SendGump( new YoungDeathNotice() ); this.SendGump( new YoungDeathNotice() );
} }
#endregion #endregion
#region Speech log #region Speech log
@ -3865,6 +3890,7 @@ namespace Server.Mobiles
m_SpeechLog.Add( e.Mobile, e.Speech ); m_SpeechLog.Add( e.Mobile, e.Speech );
} }
} }
#endregion #endregion
#region Champion Titles #region Champion Titles
@ -3933,13 +3959,12 @@ namespace Server.Mobiles
writer.WriteEncodedInt( info.m_Value ); writer.WriteEncodedInt( info.m_Value );
writer.Write( info.m_LastDecay ); writer.Write( info.m_LastDecay );
} }
} }
private TitleInfo[] m_Values; private TitleInfo[] m_Values;
private int m_Harrower; //Harrower titles do NOT decay private int m_Harrower; //Harrower titles do NOT decay
public int GetValue( ChampionSpawnType type ) public int GetValue( ChampionSpawnType type )
{ {
return GetValue( (int)type ); return GetValue( (int)type );
@ -4152,6 +4177,7 @@ namespace Server.Mobiles
t.m_Harrower = Math.Max( count, t.m_Harrower ); //Harrower titles never decay. t.m_Harrower = Math.Max( count, t.m_Harrower ); //Harrower titles never decay.
} }
} }
#endregion #endregion
#region Recipes #region Recipes
@ -4205,7 +4231,6 @@ namespace Server.Mobiles
} }
} }
#endregion #endregion
#region Buff Icons #region Buff Icons
@ -4278,6 +4303,7 @@ namespace Server.Mobiles
if( m_BuffTable.Count <= 0 ) if( m_BuffTable.Count <= 0 )
m_BuffTable = null; m_BuffTable = null;
} }
#endregion #endregion
public void AutoStablePets() public void AutoStablePets()