ace/Source/ACE.DatLoader/Entity/SkillBase.cs
Mag-nus 3e836a6cbb
Profiling based improvements (#1115)
* Use PortalDat skill table instead of reflection properties

* Update showstats comments

* remove attributes from Skill enum (Values now come from dat)

* Remove attributes from PropertyAttribute2nd (Values come from dat now)

* Landblock, worldObjects to private and adjacents->Adjacents

* Landblock remove PhysicsObj != null check. No need. 6% CPU savings

* showstats shows [Unusable] for untrained skills which are unusable

* Improve performance of GetWorldObjectsForPhysicsHandling

* Improve Skill IsUsable

* Updating showstats

* Fixing null pointer exception in IsUsable
2018-12-03 17:53:32 -06:00

49 lines
1.9 KiB
C#

using System;
using System.IO;
namespace ACE.DatLoader.Entity
{
public class SkillBase : IUnpackable
{
public string Description { get; private set; }
public string Name { get; private set; }
public uint IconId { get; private set; }
public int TrainedCost { get; private set; }
/// <summary>
/// This is the total cost to specialize a skill, which INCLUDES the trained cost.
/// </summary>
public int SpecializedCost { get; private set; }
public uint Category { get; private set; } // 1 = combat, 2 = other, 3 = magic
public uint ChargenUse { get; private set; } // always 1?
/// <summary>
/// This is the minimum SAC required for usability.
/// 1 = Usable when untrained
/// 2 = Trained or greater required for usability
/// </summary>
public uint MinLevel { get; private set; } // 1-2?
public SkillFormula Formula { get; private set; } = new SkillFormula();
public double UpperBound { get; private set; }
public double LowerBound { get; private set; }
public double LearnMod { get; private set; }
public int UpgradeCostFromTrainedToSpecialized => SpecializedCost - TrainedCost;
public void Unpack(BinaryReader reader)
{
Description = reader.ReadPString(); reader.AlignBoundary();
Name = reader.ReadPString(); reader.AlignBoundary();
IconId = reader.ReadUInt32();
TrainedCost = reader.ReadInt32();
SpecializedCost = reader.ReadInt32();
Category = reader.ReadUInt32();
ChargenUse = reader.ReadUInt32();
MinLevel = reader.ReadUInt32();
Formula.Unpack(reader);
UpperBound = reader.ReadDouble();
LowerBound = reader.ReadDouble();
LearnMod = reader.ReadDouble();
}
}
}