Adding atrribute custom SPELL_ATTR0_CU_LIQUID_AURA

This commit is contained in:
Aokromes
2018-04-06 07:52:42 +02:00
parent 4da3cbf3aa
commit 395ad03cd4
3 changed files with 11 additions and 5 deletions

View File

@@ -992,6 +992,10 @@ bool Aura::CanBeSaved() const
return false;
}
// don't save liquid auras
if (GetSpellInfo()->HasAttribute(SPELL_ATTR0_CU_LIQUID_AURA))
return false;
// Can't be saved - aura handler relies on calculated amount and changes it
if (HasEffectType(SPELL_AURA_CONVERT_RUNE))
return false;
@@ -1040,11 +1044,6 @@ bool Aura::CanBeSaved() const
if (GetCastItemGUID() && IsPermanent())
return false;
// don't save liquid auras
for (LiquidTypeEntry const* liquid : sLiquidTypeStore)
if (liquid->SpellId && liquid->SpellId == GetId())
return false;
return true;
}

View File

@@ -192,6 +192,7 @@ enum SpellCustomAttributes
SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER = 0x00010000,
SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET = 0x00020000,
SPELL_ATTR0_CU_ALLOW_INFLIGHT_TARGET = 0x00040000,
SPELL_ATTR0_CU_LIQUID_AURA = 0x00400000,
SPELL_ATTR0_CU_NEGATIVE = SPELL_ATTR0_CU_NEGATIVE_EFF0 | SPELL_ATTR0_CU_NEGATIVE_EFF1 | SPELL_ATTR0_CU_NEGATIVE_EFF2
};

View File

@@ -2809,6 +2809,12 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
spellInfo->_InitializeExplicitTargetMask();
}
// add attribute custom to liquid auras
for (LiquidTypeEntry const* liquid : sLiquidTypeStore)
if (liquid->SpellId)
if (spellInfo = _GetSpellInfo(liquid->SpellId))
spellInfo->AttributesCu |= SPELL_ATTR0_CU_LIQUID_AURA;
TC_LOG_INFO("server.loading", ">> Loaded SpellInfo custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime));
}