Core/Creatures: Update creature scaling to use content tuning

Port From (https://github.com/TrinityCore/TrinityCore/commit/314a35f0cd912daed7c0663f4f13552b6747fd98)
This commit is contained in:
hondacrx
2020-05-20 15:27:22 -04:00
parent 2acce62671
commit c1dbec58bd
10 changed files with 85 additions and 147 deletions
+12 -9
View File
@@ -1198,15 +1198,16 @@ namespace Game.Network.Packets
bool GenerateDataCreatureToPlayer(Creature attacker, Player target)
{
CreatureTemplate creatureTemplate = attacker.GetCreatureTemplate();
CreatureLevelScaling creatureScaling = creatureTemplate.GetLevelScaling(attacker.GetMap().GetDifficultyID());
TuningType = ContentTuningType.CreatureToPlayerDamage;
PlayerLevelDelta = (short)target.m_activePlayerData.ScalingPlayerLevelDelta;
PlayerItemLevel = (ushort)target.GetAverageItemLevel();
ScalingHealthItemLevelCurveID = (ushort)target.m_unitData.ScalingHealthItemLevelCurveID;
TargetLevel = (byte)target.GetLevel();
Expansion = (byte)creatureTemplate.RequiredExpansion;
TargetMinScalingLevel = (byte)creatureTemplate.levelScaling.Value.MinLevel;
TargetMaxScalingLevel = (byte)creatureTemplate.levelScaling.Value.MaxLevel;
Expansion = (byte)creatureTemplate.HealthScalingExpansion;
TargetMinScalingLevel = (byte)creatureScaling.MinLevel;
TargetMaxScalingLevel = (byte)creatureScaling.MaxLevel;
TargetScalingLevelDelta = (sbyte)attacker.m_unitData.ScalingLevelDelta;
return true;
}
@@ -1214,15 +1215,16 @@ namespace Game.Network.Packets
bool GenerateDataPlayerToCreature(Player attacker, Creature target)
{
CreatureTemplate creatureTemplate = target.GetCreatureTemplate();
CreatureLevelScaling creatureScaling = creatureTemplate.GetLevelScaling(target.GetMap().GetDifficultyID());
TuningType = ContentTuningType.PlayerToCreatureDamage;
PlayerLevelDelta = (short)attacker.m_activePlayerData.ScalingPlayerLevelDelta;
PlayerItemLevel = (ushort)attacker.GetAverageItemLevel();
ScalingHealthItemLevelCurveID = (ushort)target.m_unitData.ScalingHealthItemLevelCurveID;
TargetLevel = (byte)target.GetLevel();
Expansion = (byte)creatureTemplate.RequiredExpansion;
TargetMinScalingLevel = (byte)creatureTemplate.levelScaling.Value.MinLevel;
TargetMaxScalingLevel = (byte)creatureTemplate.levelScaling.Value.MaxLevel;
Expansion = (byte)creatureTemplate.HealthScalingExpansion;
TargetMinScalingLevel = (byte)creatureScaling.MinLevel;
TargetMaxScalingLevel = (byte)creatureScaling.MaxLevel;
TargetScalingLevelDelta = (sbyte)target.m_unitData.ScalingLevelDelta;
return true;
}
@@ -1231,14 +1233,15 @@ namespace Game.Network.Packets
{
Creature accessor = target.HasScalableLevels() ? target : attacker;
CreatureTemplate creatureTemplate = accessor.GetCreatureTemplate();
CreatureLevelScaling creatureScaling = creatureTemplate.GetLevelScaling(accessor.GetMap().GetDifficultyID());
TuningType = ContentTuningType.CreatureToCreatureDamage;
PlayerLevelDelta = 0;
PlayerItemLevel = 0;
TargetLevel = (byte)target.GetLevel();
Expansion = (byte)creatureTemplate.RequiredExpansion;
TargetMinScalingLevel = (byte)creatureTemplate.levelScaling.Value.MinLevel;
TargetMaxScalingLevel = (byte)creatureTemplate.levelScaling.Value.MaxLevel;
Expansion = (byte)creatureTemplate.HealthScalingExpansion;
TargetMinScalingLevel = (byte)creatureScaling.MinLevel;
TargetMaxScalingLevel = (byte)creatureScaling.MaxLevel;
TargetScalingLevelDelta = (sbyte)accessor.m_unitData.ScalingLevelDelta;
return true;
}