Core/Auras: Convert most rules from Aura::CanBeSaved to a custom spell attribute

Port From (https://github.com/TrinityCore/TrinityCore/commit/b4aa698acb88e1a74bc22d97279148a567b88cad)
This commit is contained in:
hondacrx
2021-03-08 14:26:51 -05:00
parent c54c27f831
commit 5eea1fec98
4 changed files with 37 additions and 47 deletions
+1 -43
View File
@@ -957,49 +957,7 @@ namespace Game.Spells
if (GetSpellInfo().IsSingleTarget())
return false;
// No point in saving this, since the stable dialog can't be open on aura load anyway.
if (HasEffectType(AuraType.OpenStable))
return false;
// Can't save vehicle auras, it requires both caster & target to be in world
if (HasEffectType(AuraType.ControlVehicle))
return false;
// do not save bind sight auras
if (HasEffectType(AuraType.BindSight))
return false;
// no charming auras (taking direct control)
if (HasEffectType(AuraType.ModPossess) || HasEffectType(AuraType.ModPossessPet))
return false;
// no charming auras can be saved
if (HasEffectType(AuraType.ModCharm) || HasEffectType(AuraType.AoeCharm))
return false;
// no battleground player positions
if (HasEffectType(AuraType.BattleGroundPlayerPosition) || HasEffectType(AuraType.BattleGroundPlayerPositionFactional))
return false;
// Incanter's Absorbtion - considering the minimal duration and problems with aura stacking
// we skip saving this aura
// Also for some reason other auras put as MultiSlot crash core on keeping them after restart,
// so put here only these for which you are sure they get removed
switch (GetId())
{
case 44413: // Incanter's Absorption
case 40075: // Fel Flak Fire
case 55849: // Power Spark
return false;
}
// When a druid logins, he doesnt have either eclipse power, nor the marker auras, nor the eclipse buffs. Dont save them.
if (GetId() == 67483 || GetId() == 67484 || GetId() == 48517 || GetId() == 48518)
return false;
// Don't save druid forms, only the dummy. It will cast the appropriate form
// Swift Flight Flight Aquatic Stag
if (GetId() == 40120 || GetId() == 33943 || GetId() == 1066 || GetId() == 165961)
if (GetSpellInfo().HasAttribute(SpellCustomAttributes.AuraCannotBeSaved))
return false;
// don't save auras removed by proc system