diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 7119a183b..5fa2ed281 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1996,10 +1996,11 @@ namespace Framework.Constants ReqCasterBehindTarget = 0x20000, AllowInflightTarget = 0x40000, NeedsAmmoData = 0x80000, - BinarySpell = 0x00100000, - SchoolmaskNormalWithMagic = 0x00200000, - LiquidAura = 0x00400000, - IsTalent = 0x00800000 + BinarySpell = 0x100000, + SchoolmaskNormalWithMagic = 0x200000, + LiquidAura = 0x400000, + IsTalent = 0x800000, + AuraCannotBeSaved = 0x1000000 } #endregion diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index 98823da79..c49ea64ad 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -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 diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 4da6dad83..f20325cd0 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -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: diff --git a/sql/updates/world/master/2021_03_06_00_world_nonsavable_auras.sql b/sql/updates/world/master/2021_03_06_00_world_nonsavable_auras.sql new file mode 100644 index 000000000..bce2f53a7 --- /dev/null +++ b/sql/updates/world/master/2021_03_06_00_world_nonsavable_auras.sql @@ -0,0 +1,14 @@ +ALTER TABLE `spell_custom_attr` + MODIFY `entry` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'spell id', + MODIFY `attributes` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'SpellCustomAttributes'; + +DELETE FROM `spell_custom_attr` WHERE `entry` IN (40075,55849,48517,48518,40120,33943,1066,165961); +INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES +(40075, 0x01000000), -- Fel Flak Fire +(55849, 0x01000000), -- Power Spark +(48517, 0x01000000), -- Eclipse (Solar) +(48518, 0x01000000), -- Eclipse (Lunar) +(40120, 0x01000000), -- Travel Form (Swift Flight) +(33943, 0x01000000), -- Travel Form (Flight) +(1066, 0x01000000), -- Travel Form (Aquatic) +(165961, 0x01000000); -- Travel Form (Stag)