Lena80
Member
Hello im trying to make corpse show the killers just like forensic eval, since im really dont know how to do it i check forensic eval skill and tried to add a junky timer into corpse.cs. Im getting errors;
+ Items/Misc/Corpses/Corpse.cs:
CS0038: Line 1466: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1468: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1471: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1471: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1471: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1471: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
I think it has something to do with m_Corpse, not sure, thanks! hope someone help me i spent 2 hours trying to get this fixed hahaha
+ Items/Misc/Corpses/Corpse.cs:
CS0038: Line 1466: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1467: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1468: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1469: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1471: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1471: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1471: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
CS0038: Line 1471: Cannot access a non-static member of outer type 'Server.I
tem' via nested type 'Server.Items.Corpse.InternalTimera'
I think it has something to do with m_Corpse, not sure, thanks! hope someone help me i spent 2 hours trying to get this fixed hahaha
Code:
public override void OnSingleClick(Mobile from)
{
new InternalTimera(from, (Corpse)this).Start();
}
public void AbortAction(Mobile from)
{
}
public class InternalTimera : Timer, IAction
{
private readonly Mobile m_From;
private readonly Corpse m_Corpse;
public InternalTimera(Mobile from, Corpse corpse)
: base(TimeSpan.FromSeconds(1.0))
{
m_From = from;
m_Corpse = corpse;
if (from is PlayerMobile)
((PlayerMobile)from).ResetPlayerAction(this);
}
protected override void OnTick()
{
int hue = 2041;
if (!string.IsNullOrEmpty(Name) && (m_Corpse.Killer == null))
m_From.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, hue, 3, "", string.Format("You see a dead human. You recognize {0}( Vol:{1} item{2}) no one killed him", Name, TotalItems, TotalItems != 1 ? "s" : "")));
if (!string.IsNullOrEmpty(Name) && (m_Corpse.Killer != null))
m_From.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, hue, 3, "", string.Format("You see a dead human. You recognize {0}( Vol:{1} item{2}) he was killed by {3}", Name, TotalItems, TotalItems != 1 ? "s" : "",m_Corpse.Killer.Name)));
else
m_From.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, hue, 3, "", string.Format("You see an unknown dead human. (Vol: {0} item{1})", TotalItems, TotalItems != 1 ? "s" : "")));
if (m_From is PlayerMobile)
((PlayerMobile)m_From).EndPlayerAction();
}
#region IAction Members
#endregion
public void AbortAction(Mobile from)
{
// from.SendLocalizedMessage(501001);
if (from == null)
return;
if (from is PlayerMobile)
((PlayerMobile)from).EndPlayerAction();
Stop();
}
}