aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGooyeth <Gooyeth@users.noreply.github.com>2018-04-01 20:56:08 -0600
committerAriel Silva <ariel-@users.noreply.github.com>2018-04-03 00:36:02 -0300
commit8001c5ead1aa27671aea20336c7eb2194b89d8ac (patch)
tree0ff2cbc20dffe94d0d31a9fd767ebbe0a95187f3 /src
parent1ea75f413ce21f586654c80ba77ecf8b927d7a3b (diff)
Adding atrribute custom SPELL_ATTR0_CU_LIQUID_AURA
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp9
-rw-r--r--src/server/game/Spells/SpellInfo.h1
-rw-r--r--src/server/game/Spells/SpellMgr.cpp6
3 files changed, 11 insertions, 5 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index a9b69584732..142e6f8b4e3 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1116,6 +1116,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;
@@ -1160,11 +1164,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;
}
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 7aa07194958..5870d948f5c 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -197,6 +197,7 @@ enum SpellCustomAttributes
SPELL_ATTR0_CU_NEEDS_AMMO_DATA = 0x00080000,
SPELL_ATTR0_CU_BINARY_SPELL = 0x00100000,
SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC = 0x00200000,
+ 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
};
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 9361194120a..01567385bd3 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2946,6 +2946,12 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
}
}
+ // 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));
}