#W# Added: Added a [mystats command to view the stuff i'm tracking.
This commit is contained in:
parent
d7f998cf6b
commit
7ca5cd3a4e
3 changed files with 87 additions and 2 deletions
76
Projects/UOContent/Gumps/MyStats.cs
Normal file
76
Projects/UOContent/Gumps/MyStats.cs
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
using System;
|
||||||
|
using Server;
|
||||||
|
using Server.Gumps;
|
||||||
|
using Server.Mobiles;
|
||||||
|
using Server.Commands;
|
||||||
|
using Server.Network;
|
||||||
|
|
||||||
|
namespace Server.Custom.UI
|
||||||
|
{
|
||||||
|
public class PlayerStats
|
||||||
|
{
|
||||||
|
public static void Initialize()
|
||||||
|
{
|
||||||
|
CommandSystem.Register("MyStats", AccessLevel.Player, new CommandEventHandler(OnCommand));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Usage("MyStats")]
|
||||||
|
[Description("Opens the player statistics gump.")]
|
||||||
|
public static void OnCommand(CommandEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Mobile is PlayerMobile pm)
|
||||||
|
{
|
||||||
|
pm.CloseGump<PlayerStatsGump>();
|
||||||
|
pm.SendGump(new PlayerStatsGump(pm));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PlayerStatsGump : Gump
|
||||||
|
{
|
||||||
|
public PlayerStatsGump(PlayerMobile pm) : base(50, 50)
|
||||||
|
{
|
||||||
|
Closable = true;
|
||||||
|
Disposable = true;
|
||||||
|
Draggable = true;
|
||||||
|
Resizable = false;
|
||||||
|
|
||||||
|
AddPage(0);
|
||||||
|
|
||||||
|
AddBackground(0, 0, 300, 260, 9270);
|
||||||
|
AddAlphaRegion(10, 10, 280, 240);
|
||||||
|
|
||||||
|
AddLabel(85, 15, 1152, "PLAYER STATISTICS");
|
||||||
|
|
||||||
|
int y = 55;
|
||||||
|
|
||||||
|
AddLabel(25, y, 1152, "Total Player Deaths:");
|
||||||
|
AddLabel(180, y, 1152, pm.TotalPlayerDeaths.ToString("N0"));
|
||||||
|
y += 30;
|
||||||
|
|
||||||
|
AddLabel(25, y, 1152, "Total Monsters Killed:");
|
||||||
|
AddLabel(180, y, 1152, pm.TotalMonstersKilled.ToString("N0"));
|
||||||
|
y += 30;
|
||||||
|
|
||||||
|
AddLabel(25, y, 1152, "Total Gold Looted:");
|
||||||
|
AddLabel(180, y, 1152, pm.TotalGoldLooted.ToString("N0"));
|
||||||
|
y += 30;
|
||||||
|
|
||||||
|
AddLabel(25, y, 1152, "Spendable Kill Points:");
|
||||||
|
AddLabel(180, y, 1152, pm.MonsterKillPoints.ToString("N0"));
|
||||||
|
y += 30;
|
||||||
|
|
||||||
|
AddLabel(25, y, 1152, "Lifetime Kill Points:");
|
||||||
|
AddLabel(180, y, 1152, pm.LifetimeKillPoints.ToString("N0"));
|
||||||
|
y += 45;
|
||||||
|
|
||||||
|
AddButton(25, y, 4017, 4019, 0, GumpButtonType.Reply, 0);
|
||||||
|
AddLabel(60, y, 1152, "Close Menu");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||||
|
{
|
||||||
|
// ButtonID 0 handles the close button automatically, so no additional logic is needed here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3646,7 +3646,6 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
if (c != null)
|
if (c != null)
|
||||||
{
|
{
|
||||||
// Identify the killer (this naturally routes credit from tamed pets to their owner)
|
|
||||||
Mobile killer = this.LastKiller;
|
Mobile killer = this.LastKiller;
|
||||||
if (killer is BaseCreature pet && pet.ControlMaster != null)
|
if (killer is BaseCreature pet && pet.ControlMaster != null)
|
||||||
{
|
{
|
||||||
|
|
@ -3655,7 +3654,6 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
if (killer is PlayerMobile pm)
|
if (killer is PlayerMobile pm)
|
||||||
{
|
{
|
||||||
// Scan the newly generated corpse for the exact amount of gold created
|
|
||||||
int goldFound = c.GetAmount(typeof(Gold));
|
int goldFound = c.GetAmount(typeof(Gold));
|
||||||
|
|
||||||
if (goldFound > 0)
|
if (goldFound > 0)
|
||||||
|
|
@ -3666,6 +3664,7 @@ namespace Server.Mobiles
|
||||||
if (points > 0)
|
if (points > 0)
|
||||||
{
|
{
|
||||||
pm.MonsterKillPoints += points;
|
pm.MonsterKillPoints += points;
|
||||||
|
pm.LifetimeKillPoints += points;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -754,6 +754,14 @@ namespace Server.Mobiles
|
||||||
set => m_TotalMonstersKilled = value;
|
set => m_TotalMonstersKilled = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int m_LifetimeKillPoints;
|
||||||
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
|
public int LifetimeKillPoints
|
||||||
|
{
|
||||||
|
get => m_LifetimeKillPoints;
|
||||||
|
set => m_LifetimeKillPoints = value;
|
||||||
|
}
|
||||||
|
|
||||||
private int m_TotalPlayerDeaths;
|
private int m_TotalPlayerDeaths;
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int TotalPlayerDeaths
|
public int TotalPlayerDeaths
|
||||||
|
|
@ -2808,6 +2816,7 @@ namespace Server.Mobiles
|
||||||
{
|
{
|
||||||
case 35:
|
case 35:
|
||||||
{
|
{
|
||||||
|
m_LifetimeKillPoints = reader.ReadInt();
|
||||||
m_TotalPlayerDeaths = reader.ReadInt();
|
m_TotalPlayerDeaths = reader.ReadInt();
|
||||||
m_TotalMonstersKilled = reader.ReadInt();
|
m_TotalMonstersKilled = reader.ReadInt();
|
||||||
m_TotalGoldLooted = reader.ReadInt();
|
m_TotalGoldLooted = reader.ReadInt();
|
||||||
|
|
@ -3163,6 +3172,7 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
writer.Write(35); // version
|
writer.Write(35); // version
|
||||||
|
|
||||||
|
writer.Write(m_LifetimeKillPoints);
|
||||||
writer.Write(m_TotalPlayerDeaths);
|
writer.Write(m_TotalPlayerDeaths);
|
||||||
writer.Write(m_TotalMonstersKilled);
|
writer.Write(m_TotalMonstersKilled);
|
||||||
writer.Write(m_TotalGoldLooted);
|
writer.Write(m_TotalGoldLooted);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue