class Max : Command
{
public Max()
: base("max", 1)
{
}
protected override bool Process(Player player, RealmTime time, string args)
{
try
{
player.Stats[0] = player.ObjectDesc.MaxHitPoints;
player.Stats[1] = player.ObjectDesc.MaxMagicPoints;
player.Stats[2] = player.ObjectDesc.MaxAttack;
player.Stats[3] = player.ObjectDesc.MaxDefense;
player.Stats[4] = player.ObjectDesc.MaxSpeed;
player.Stats[5] = player.ObjectDesc.MaxHpRegen;
player.Stats[6] = player.ObjectDesc.MaxMpRegen;
player.Stats[7] = player.ObjectDesc.MaxDexterity;
player.SaveToCharacter();
player.Client.Save();
player.UpdateCount++;
player.SendInfo("Success");
}
catch
{
player.SendError("Unable to max!");
return false;
}
return true;
}
}
public ushort ObjectType { get; private set; }
public int MaxHitPoints { get; private set; }
public int MaxMagicPoints { get; private set; }
public int MaxAttack { get; private set; }
public int MaxDefense { get; private set; }
public int MaxSpeed { get; private set; }
public int MaxDexterity { get; private set; }
public int MaxHpRegen { get; private set; }
public int MaxMpRegen { get; private set; }
if ((n = elem.Element("Terrain")) != null)
Terrain = n.Value;
if ((n = elem.Element("MaxHitPoints")) != null)
MaxHP = Utils.FromString(n.Value);
if ((n = elem.Element("Defense")) != null)
Defense = Utils.FromString(n.Value);
StasisImmune = elem.Element("StasisImmune") != null;
Oryx = elem.Element("Oryx") != null;
Hero = elem.Element("Hero") != null;
if ((n = elem.Element("MaxHitPoints")) != null)
{
MaxHitPoints = n.Attribute("max") != null ? Utils.FromString(n.Attribute("max").Value) : -1;
MaxHP = Utils.FromString(n.Value);
}
if ((n = elem.Element("MaxMagicPoints")) != null)
MaxMagicPoints = n.Attribute("max") != null ? Utils.FromString(n.Attribute("max").Value) : -1;
if ((n = elem.Element("Attack")) != null)
MaxAttack = n.Attribute("max") != null ? Utils.FromString(n.Attribute("max").Value) : -1;
if ((n = elem.Element("Dexterity")) != null)
MaxDexterity = n.Attribute("max") != null ? Utils.FromString(n.Attribute("max").Value) : -1;
if ((n = elem.Element("Speed")) != null)
MaxSpeed = n.Attribute("max") != null ? Utils.FromString(n.Attribute("max").Value) : -1;
if ((n = elem.Element("HpRegen")) != null)
MaxHpRegen = n.Attribute("max") != null ? Utils.FromString(n.Attribute("max").Value) : -1;
if ((n = elem.Element("MpRegen")) != null)
MaxMpRegen = n.Attribute("max") != null ? Utils.FromString(n.Attribute("max").Value) : -1;
if ((n = elem.Element("Defense")) != null)
{
Defense = Utils.FromString(n.Value);
MaxDefense = n.Attribute("max") != null ? Utils.FromString(n.Attribute("max").Value) : -1;
}





