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:
@@ -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
|
||||
|
||||
@@ -2438,6 +2438,23 @@ namespace Game.Entities
|
||||
break;
|
||||
}
|
||||
|
||||
switch (effect.ApplyAuraName)
|
||||
{
|
||||
case AuraType.OpenStable: // No point in saving this, since the stable dialog can't be open on aura load anyway.
|
||||
// Auras that require both caster & target to be in world cannot be saved
|
||||
case AuraType.ControlVehicle:
|
||||
case AuraType.BindSight:
|
||||
case AuraType.ModPossess:
|
||||
case AuraType.ModPossessPet:
|
||||
case AuraType.ModCharm:
|
||||
case AuraType.AoeCharm:
|
||||
// Controlled by Battleground
|
||||
case AuraType.BattleGroundPlayerPosition:
|
||||
case AuraType.BattleGroundPlayerPositionFactional:
|
||||
spellInfo.AttributesCu |= SpellCustomAttributes.AuraCannotBeSaved;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (effect.Effect)
|
||||
{
|
||||
case SpellEffectName.SchoolDamage:
|
||||
|
||||
Reference in New Issue
Block a user