Core/Creatures: Update creature scaling to use content tuning
Port From (https://github.com/TrinityCore/TrinityCore/commit/314a35f0cd912daed7c0663f4f13552b6747fd98)
This commit is contained in:
@@ -37,7 +37,7 @@ namespace Game.Entities
|
||||
public string IconName;
|
||||
public uint GossipMenuId;
|
||||
public short Minlevel;
|
||||
public Optional<CreatureLevelScaling> levelScaling;
|
||||
public Dictionary<Difficulty, CreatureLevelScaling> scalingStorage = new Dictionary<Difficulty, CreatureLevelScaling>();
|
||||
public short Maxlevel;
|
||||
public int HealthScalingExpansion;
|
||||
public uint RequiredExpansion;
|
||||
@@ -265,23 +265,24 @@ namespace Game.Entities
|
||||
|
||||
QueryData.Stats = stats;
|
||||
}
|
||||
|
||||
public CreatureLevelScaling GetLevelScaling(Difficulty difficulty)
|
||||
{
|
||||
var creatureLevelScaling = scalingStorage.LookupByKey(difficulty);
|
||||
if (creatureLevelScaling != null)
|
||||
return creatureLevelScaling;
|
||||
|
||||
return new CreatureLevelScaling();
|
||||
}
|
||||
}
|
||||
|
||||
public class CreatureBaseStats
|
||||
{
|
||||
public uint[] BaseHealth = new uint[(int)Expansion.Max];
|
||||
public uint BaseMana;
|
||||
public uint BaseArmor;
|
||||
public uint AttackPower;
|
||||
public uint RangedAttackPower;
|
||||
public float[] BaseDamage = new float[(int)Expansion.Max];
|
||||
|
||||
// Helpers
|
||||
public uint GenerateHealth(CreatureTemplate info)
|
||||
{
|
||||
return (uint)Math.Ceiling(BaseHealth[info.HealthScalingExpansion] * info.ModHealth * info.ModHealthExtra);
|
||||
}
|
||||
|
||||
public uint GenerateMana(CreatureTemplate info)
|
||||
{
|
||||
// Mana can be 0.
|
||||
@@ -290,16 +291,6 @@ namespace Game.Entities
|
||||
|
||||
return (uint)Math.Ceiling(BaseMana * info.ModMana * info.ModManaExtra);
|
||||
}
|
||||
|
||||
public float GenerateArmor(CreatureTemplate info)
|
||||
{
|
||||
return (float)Math.Ceiling(BaseArmor * info.ModArmor);
|
||||
}
|
||||
|
||||
public float GenerateBaseDamage(CreatureTemplate info)
|
||||
{
|
||||
return BaseDamage[info.HealthScalingExpansion];
|
||||
}
|
||||
}
|
||||
|
||||
public class CreatureLocale
|
||||
@@ -459,11 +450,12 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public struct CreatureLevelScaling
|
||||
public class CreatureLevelScaling
|
||||
{
|
||||
public ushort MinLevel;
|
||||
public ushort MaxLevel;
|
||||
public short DeltaLevelMin;
|
||||
public short DeltaLevelMax;
|
||||
public uint ContentTuningID;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user