Core/Creature: don't set guardian stats in Creature::UpdateEntry(), because stat calculation from guardians is already done in Guardian::InitStatsForLevel.
Port From (https://github.com/TrinityCore/TrinityCore/commit/537b425377c065e5a99486387247349bde0a37ea)
This commit is contained in:
@@ -369,7 +369,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (updateLevel)
|
if (updateLevel)
|
||||||
SelectLevel();
|
SelectLevel();
|
||||||
else
|
else if (!IsGuardian())
|
||||||
{
|
{
|
||||||
ulong previousHealth = GetHealth();
|
ulong previousHealth = GetHealth();
|
||||||
UpdateLevelDependantStats(); // We still re-initialize level dependant stats on entry update
|
UpdateLevelDependantStats(); // We still re-initialize level dependant stats on entry update
|
||||||
@@ -377,6 +377,9 @@ namespace Game.Entities
|
|||||||
SetHealth(previousHealth);
|
SetHealth(previousHealth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not update guardian stats here - they are handled in Guardian::InitStatsForLevel()
|
||||||
|
if (!IsGuardian())
|
||||||
|
{
|
||||||
SetMeleeDamageSchool((SpellSchools)cInfo.DmgSchool);
|
SetMeleeDamageSchool((SpellSchools)cInfo.DmgSchool);
|
||||||
SetStatFlatModifier(UnitMods.ResistanceHoly, UnitModifierFlatType.Base, cInfo.Resistance[(int)SpellSchools.Holy]);
|
SetStatFlatModifier(UnitMods.ResistanceHoly, UnitModifierFlatType.Base, cInfo.Resistance[(int)SpellSchools.Holy]);
|
||||||
SetStatFlatModifier(UnitMods.ResistanceFire, UnitModifierFlatType.Base, cInfo.Resistance[(int)SpellSchools.Fire]);
|
SetStatFlatModifier(UnitMods.ResistanceFire, UnitModifierFlatType.Base, cInfo.Resistance[(int)SpellSchools.Fire]);
|
||||||
@@ -387,6 +390,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
SetCanModifyStats(true);
|
SetCanModifyStats(true);
|
||||||
UpdateAllStats();
|
UpdateAllStats();
|
||||||
|
}
|
||||||
|
|
||||||
// checked and error show at loading templates
|
// checked and error show at loading templates
|
||||||
var factionTemplate = CliDB.FactionTemplateStorage.LookupByKey(cInfo.Faction);
|
var factionTemplate = CliDB.FactionTemplateStorage.LookupByKey(cInfo.Faction);
|
||||||
|
|||||||
Reference in New Issue
Block a user