Storm33229
Knight
Storm33229's Kill Log 1.0
Storm33229's Kill Log 1.0
What does it do?
Here is an example of what the log looks like:
It writes the attackers name and the victims name, along with the exact date and time.
PlayerMobile.CS Edits
and DO NOT forget this:
Hopefully this will help eliminate and catch unwanted Player Killers(PKs) on shards who have rules against them.
Enjoy!
-Storm
Storm33229's Kill Log 1.0
What does it do?
Here is an example of what the log looks like:
Code:
Storm33229's Kill Log 1.0
######################################################
Attacker: Storm
Attacker's Account: storm332
Victim: test
Victim's Account: storm33229
Victim's Location of Death: (1492, 1629, 13)
Victim's Time of Death: 8/13/2006 10:13:39 AM
######################################################
Attacker: Storm
Attacker's Account: storm332
Victim: test
Victim's Account: storm33229
Victim's Location of Death: (1481, 1612, 20)
Victim's Time of Death: 8/13/2006 10:13:56 AM
It writes the attackers name and the victims name, along with the exact date and time.
PlayerMobile.CS Edits
Code:
[SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][SIZE=2] OnBeforeDeath()
{
m_InsuranceCost = 0;
m_InsuranceAward = [/SIZE][SIZE=2][COLOR=#0000ff]base[/COLOR][/SIZE][SIZE=2].FindMostRecentDamager( [/SIZE][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][SIZE=2] );
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( m_InsuranceAward [/SIZE][SIZE=2][COLOR=#0000ff]is[/COLOR][/SIZE][SIZE=2] BaseCreature )
{
Mobile master = ((BaseCreature)m_InsuranceAward).GetMaster();
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( master != [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2] )
m_InsuranceAward = master;
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( m_InsuranceAward != [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2] && (!m_InsuranceAward.Player || m_InsuranceAward == [/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2]) )
m_InsuranceAward = [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2];
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( m_InsuranceAward [/SIZE][SIZE=2][COLOR=#0000ff]is[/COLOR][/SIZE][SIZE=2] PlayerMobile )
((PlayerMobile)m_InsuranceAward).m_InsuranceBonus = 0;
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( m_ReceivedHonorContext != [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2] )
m_ReceivedHonorContext.OnTargetKilled();
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( m_SentHonorContext != [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2] )
m_SentHonorContext.OnSourceKilled();
[COLOR=red][SIZE=2][COLOR=red]PlayerMobile attacker = [/COLOR][/SIZE][COLOR=red][SIZE=2]this[/SIZE][SIZE=2].LastKiller [/SIZE][SIZE=2]as[/SIZE][/COLOR][SIZE=2][COLOR=red] PlayerMobile;[/COLOR]
[COLOR=red]PlayerMobile victim = [/COLOR][/SIZE][COLOR=red][SIZE=2]this[/SIZE][SIZE=2]as[/SIZE][/COLOR][SIZE=2][COLOR=red] PlayerMobile;[/COLOR]
[/SIZE][COLOR=red][SIZE=2]if[/SIZE][SIZE=2] (attacker [/SIZE][SIZE=2]is[/SIZE][SIZE=2] PlayerMobile && victim [/SIZE][SIZE=2]is[/SIZE][/COLOR][SIZE=2][COLOR=red] PlayerMobile)[/COLOR]
[COLOR=red]{[/COLOR]
[/SIZE][COLOR=red][SIZE=2]string[/SIZE][SIZE=2] path = [/SIZE][SIZE=2]"Storm33229's Kill Log 1.0.TXT"[/SIZE][/COLOR][SIZE=2][COLOR=red];[/COLOR]
[/SIZE][COLOR=red][SIZE=2]if[/SIZE][SIZE=2] (![/SIZE][SIZE=2]File[/SIZE][/COLOR][SIZE=2][COLOR=red].Exists(path))[/COLOR]
[COLOR=red]{[/COLOR]
[/SIZE][SIZE=2][COLOR=red]// Create a file to write to.[/COLOR]
[/SIZE][COLOR=red][SIZE=2]using[/SIZE][SIZE=2] ([/SIZE][SIZE=2]StreamWriter[/SIZE][SIZE=2] sw = [/SIZE][SIZE=2]File[/SIZE][/COLOR][SIZE=2][COLOR=red].CreateText(path))[/COLOR]
[COLOR=red]{[/COLOR]
[COLOR=red]sw.WriteLine([/COLOR][/SIZE][SIZE=2][COLOR=red]"Storm33229's Kill Log 1.0"[/COLOR][/SIZE][SIZE=2][COLOR=red]);[/COLOR]
[COLOR=red]sw.Close();[/COLOR]
[COLOR=red]}[/COLOR]
[COLOR=red]}[/COLOR]
[/SIZE][SIZE=2][COLOR=red]// This text is always added, making the file longer over time[/COLOR]
[/SIZE][SIZE=2][COLOR=red]// if it is not deleted.[/COLOR]
[/SIZE][COLOR=red][SIZE=2]using[/SIZE][SIZE=2] ([/SIZE][SIZE=2]StreamWriter[/SIZE][SIZE=2] sw = [/SIZE][SIZE=2]File[/SIZE][/COLOR][SIZE=2][COLOR=red].AppendText(path))[/COLOR]
[COLOR=red]{[/COLOR]
[COLOR=red]sw.WriteLine([/COLOR][/SIZE][SIZE=2][COLOR=red]"######################################################"[/COLOR][/SIZE][SIZE=2][COLOR=red]);[/COLOR]
[COLOR=red]sw.WriteLine([/COLOR][/SIZE][SIZE=2][COLOR=red]"Attacker: "[/COLOR][/SIZE][SIZE=2][COLOR=red] + attacker.Name);[/COLOR]
[COLOR=red]sw.WriteLine([/COLOR][/SIZE][SIZE=2][COLOR=red]"Attacker's Account: "[/COLOR][/SIZE][SIZE=2][COLOR=red] + attacker.Account);[/COLOR]
[COLOR=red]sw.WriteLine([/COLOR][/SIZE][SIZE=2][COLOR=red]"Victim: "[/COLOR][/SIZE][SIZE=2][COLOR=red] + victim.Name);[/COLOR]
[COLOR=red]sw.WriteLine([/COLOR][/SIZE][SIZE=2][COLOR=red]"Victim's Account: "[/COLOR][/SIZE][SIZE=2][COLOR=red] + victim.Account);[/COLOR]
[COLOR=red]sw.WriteLine([/COLOR][/SIZE][SIZE=2][COLOR=red]"Victim's Location of Death: "[/COLOR][/SIZE][SIZE=2][COLOR=red] + victim.Location);[/COLOR]
[COLOR=red]sw.WriteLine([/COLOR][/SIZE][COLOR=red][SIZE=2]"Victim's Time of Death: "[/SIZE][SIZE=2] + [/SIZE][SIZE=2]DateTime[/SIZE][/COLOR][SIZE=2][COLOR=red].Now);[/COLOR]
[COLOR=red]sw.Close();[/COLOR]
[COLOR=red]}[/COLOR]
[COLOR=red]}[/COLOR]
[/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]base[/COLOR][/SIZE][SIZE=2].OnBeforeDeath();
}
[/SIZE]
and DO NOT forget this:
Code:
[COLOR=red]using System.IO;[/COLOR]
Hopefully this will help eliminate and catch unwanted Player Killers(PKs) on shards who have rules against them.
Enjoy!
-Storm