public override void OnDeath( Container c )
{
Mobile killer = this.LastKiller;
Map grave = killer.Map;
Region reg = Region.Find( this.Location, this.Map );
QuestTake.DropChest( this );
// RESET SPAWNERS TIME TO MAX FOR SPAWNS WITH ONLY ONE CREATURE AND A NEARBY RANGE /////////////////////////////////////////////////////////////////////////////
// THIS KEEPS TIMERS FROM COUNTING DOWN WHILE THE SPAWNER WAITS AND THUS KEEPS A /////////////////////////////////////////////////////////////////////////////
// TRUE TIME TO RESPAWN AGAIN ONCE THE MONSTER IS KILLED /////////////////////////////////////////////////////////////////////////////
if ( this.Controlled == false && this.ControlMaster == null && this.Home.X > 0 && this.Home.Y > 0 && grave != null )
{
IPooledEnumerable eable = grave.GetItemsInRange( this.Home, 0 );
foreach ( Item item in eable )
{
if ( item is PremiumSpawner )
{
PremiumSpawner spwn = (PremiumSpawner)item;
if ( spwn.SpawnID == 99999 || ( spwn.Count + spwn.CountA + spwn.CountB + spwn.CountC + spwn.CountD + spwn.CountD ) == 1 && spwn.HomeRange < 10 && spwn.WalkingRange < 10 )
{
int minSeconds = (int)(spwn.MinDelay).TotalSeconds;
int maxSeconds = (int)(spwn.MaxDelay).TotalSeconds;
TimeSpan sDelay = TimeSpan.FromSeconds( Utility.RandomMinMax( minSeconds, maxSeconds ) );
spwn.DoTimer( sDelay );
}
}
}
eable.Free();
}
// WIZARD ADDED THIS FOR KILLS TO SHOW UP IN JOURNAL ///////////////////////////////////////////////////////////////////////////////////////////////////////////
if (killer is BaseCreature)
{
BaseCreature bc_killer = (BaseCreature)killer;
if(bc_killer.Summoned)
{
if(bc_killer.SummonMaster != null)
killer = bc_killer.SummonMaster;
}
else if(bc_killer.Controlled)
{
if(bc_killer.ControlMaster != null)
killer=bc_killer.ControlMaster;
}
else if(bc_killer.BardProvoked)
{
if(bc_killer.BardMaster != null)
killer=bc_killer.BardMaster;
}
}
if ( ( killer is PlayerMobile ) && (killer.AccessLevel < AccessLevel.GameMaster) )
{
LoggingFunctions.LogBattles( killer, this );
}
if ( killer is PlayerMobile )
{
AssassinFunctions.CheckTarget( killer, this );
StandardQuestFunctions.CheckTarget( killer, this, null );
FishingQuestFunctions.CheckTarget( killer, this, null );
if ( killer.Backpack.FindItemByType( typeof ( MuseumBook ) ) != null && this.Fame >= 18000 )
{
MuseumBook.FoundItem( killer, 1 );
}
}
Server.Misc.DropRelic.DropSpecialItem( this, killer, c ); // SOME DROP RARE ITEMS
if ( IsBonded )
{
int sound = this.GetDeathSound();
if ( sound >= 0 )
Effects.PlaySound( this, this.Map, sound );
Warmode = false;
Poison = null;
Combatant = null;
Hits = 0;
Stam = 0;
Mana = 0;
IsDeadPet = true;
ControlTarget = ControlMaster;
ControlOrder = OrderType.Follow;
ProcessDeltaQueue();
SendIncomingPacket();
SendIncomingPacket();
List<AggressorInfo> aggressors = this.Aggressors;
for ( int i = 0; i < aggressors.Count; ++i )
{
AggressorInfo info = aggressors[i];
if ( info.Attacker.Combatant == this )
info.Attacker.Combatant = null;
}
List<AggressorInfo> aggressed = this.Aggressed;
for ( int i = 0; i < aggressed.Count; ++i )
{
AggressorInfo info = aggressed[i];
if ( info.Defender.Combatant == this )
info.Defender.Combatant = null;
}
Mobile owner = this.ControlMaster;
if ( owner == null || owner.Deleted || owner.Map != this.Map || !owner.InRange( this, 12 ) || !this.CanSee( owner ) || !this.InLOS( owner ) )
{
if ( this.OwnerAbandonTime == DateTime.MinValue )
this.OwnerAbandonTime = DateTime.Now;
}
else
{
this.OwnerAbandonTime = DateTime.MinValue;
}
CheckStatTimers();
}
else
{
if ( !Summoned && !m_NoKillAwards )
{
int totalFame = Fame / 100;
int totalKarma = -Karma / 100;
List<DamageStore> list = GetLootingRights( this.DamageEntries, this.HitsMax );
List<Mobile> titles = new List<Mobile>();
List<int> fame = new List<int>();
List<int> karma = new List<int>();
bool givenQuestKill = false;
bool givenFactionKill = false;
bool givenToTKill = false;
for ( int i = 0; i < list.Count; ++i )
{
DamageStore ds = list[i];
if ( !ds.m_HasRight )
continue;
Party party = Engines.PartySystem.Party.Get( ds.m_Mobile );
if ( party != null )
{
int divedFame = totalFame / party.Members.Count;
int divedKarma = totalKarma / party.Members.Count;
for ( int j = 0; j < party.Members.Count; ++j )
{
PartyMemberInfo info = party.Members[ j ] as PartyMemberInfo;
if ( info != null && info.Mobile != null )
{
int index = titles.IndexOf( info.Mobile );
if ( index == -1 )
{
titles.Add( info.Mobile );
fame.Add( divedFame );
karma.Add( divedKarma );
}
else
{
fame[ index ] += divedFame;
karma[ index ] += divedKarma;
}
}
}
}
else
{
titles.Add( ds.m_Mobile );
fame.Add( totalFame );
karma.Add( totalKarma );
}
OnKilledBy( ds.m_Mobile );
if ( !givenFactionKill )
{
givenFactionKill = true;
Faction.HandleDeath( this, ds.m_Mobile );
}
Region region = ds.m_Mobile.Region;
if ( givenQuestKill )
continue;
PlayerMobile pm = ds.m_Mobile as PlayerMobile;
if ( pm != null )
{
QuestSystem qs = pm.Quest;
if ( qs != null )
{
qs.OnKill( this, c );
givenQuestKill = true;
}
}
}
for ( int i = 0; i < titles.Count; ++i )
{
Titles.AwardFame( titles[ i ], fame[ i ], true );
Titles.AwardKarma( titles[ i ], karma[ i ], true );
}
}
base.OnDeath( c );
if ( DeleteCorpseOnDeath || ( ( this.Name == "a follower" || this.Name == "a sailor" || this.Name == "a pirate" ) && this.EmoteHue > 0 ) )
c.Delete();
}
}