aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2021_03_06_00_world_nonsavable_auras.sql14
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp44
-rw-r--r--src/server/game/Spells/SpellInfo.h1
-rw-r--r--src/server/game/Spells/SpellMgr.cpp17
4 files changed, 33 insertions, 43 deletions
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 00000000000..bce2f53a71a
--- /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)
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index a5b9d3edebc..b8f6ddb9be2 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1019,49 +1019,7 @@ bool Aura::CanBeSaved() const
if (GetSpellInfo()->IsSingleTarget())
return false;
- // No point in saving this, since the stable dialog can't be open on aura load anyway.
- if (HasEffectType(SPELL_AURA_OPEN_STABLE))
- return false;
-
- // Can't save vehicle auras, it requires both caster & target to be in world
- if (HasEffectType(SPELL_AURA_CONTROL_VEHICLE))
- return false;
-
- // do not save bind sight auras
- if (HasEffectType(SPELL_AURA_BIND_SIGHT))
- return false;
-
- // no charming auras (taking direct control)
- if (HasEffectType(SPELL_AURA_MOD_POSSESS) || HasEffectType(SPELL_AURA_MOD_POSSESS_PET))
- return false;
-
- // no charming auras can be saved
- if (HasEffectType(SPELL_AURA_MOD_CHARM) || HasEffectType(SPELL_AURA_AOE_CHARM))
- return false;
-
- // no battleground player positions
- if (HasEffectType(SPELL_AURA_BATTLEGROUND_PLAYER_POSITION) || HasEffectType(SPELL_AURA_BATTLEGROUND_PLAYER_POSITION_FACTIONAL))
- 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(SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED))
return false;
// don't save auras removed by proc system
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 8d9e9695752..85ff0682e26 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -205,6 +205,7 @@ enum SpellCustomAttributes
SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC = 0x00200000,
SPELL_ATTR0_CU_LIQUID_AURA = 0x00400000,
SPELL_ATTR0_CU_IS_TALENT = 0x00800000,
+ SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED = 0x01000000,
};
enum SpellInterruptFlags : uint32
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 60dcee3608f..295c4331fc2 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2676,6 +2676,23 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
break;
}
+ switch (effect->ApplyAuraName)
+ {
+ case SPELL_AURA_OPEN_STABLE: // 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 SPELL_AURA_CONTROL_VEHICLE:
+ case SPELL_AURA_BIND_SIGHT:
+ case SPELL_AURA_MOD_POSSESS:
+ case SPELL_AURA_MOD_POSSESS_PET:
+ case SPELL_AURA_MOD_CHARM:
+ case SPELL_AURA_AOE_CHARM:
+ // Controlled by Battleground
+ case SPELL_AURA_BATTLEGROUND_PLAYER_POSITION:
+ case SPELL_AURA_BATTLEGROUND_PLAYER_POSITION_FACTIONAL:
+ spellInfoMutable->AttributesCu |= SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED;
+ break;
+ }
+
switch (effect->Effect)
{
case SPELL_EFFECT_SCHOOL_DAMAGE: