Core/Spells: implement SPELL_EFFECT_APPLY_AURA_2 and TARGET_DEST_CASTER_FLOOR
This commit is contained in:
1 parent
b0e1c7100e
commit
fc12e97cfe
5 files changed
+18
-13
No files matched your search
@@ -1070,7 +1070,7 @@ enum SpellEffects
|
||||
SPELL_EFFECT_171 = 171, // Summons gamebject
|
||||
SPELL_EFFECT_RESURRECT_WITH_AURA = 172,
|
||||
SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB = 173, // Guild tab unlocked (guild perk)
|
||||
SPELL_EFFECT_APPLY_AURA_ON_PET = 174, // NYI
|
||||
SPELL_EFFECT_APPLY_AURA_2 = 174,
|
||||
SPELL_EFFECT_175 = 175, // Unused (4.3.4)
|
||||
SPELL_EFFECT_SANCTUARY_2 = 176, // Some kind of sanctuary effect (Vanish)
|
||||
SPELL_EFFECT_177 = 177,
|
||||
@@ -1744,7 +1744,7 @@ enum Targets
|
||||
TARGET_UNK_122 = 122,
|
||||
TARGET_UNK_123 = 123,
|
||||
TARGET_UNK_124 = 124,
|
||||
TARGET_UNK_125 = 125,
|
||||
TARGET_DEST_CASTER_FLOOR = 125, // 1 spell in 4.3.4
|
||||
TARGET_UNK_126 = 126,
|
||||
TARGET_UNK_127 = 127,
|
||||
TOTAL_SPELL_TARGETS
|
||||
|
||||
@@ -2308,7 +2308,7 @@ void UnitAura::FillTargetMap(std::unordered_map<Unit*, uint8>& targets, Unit* ca
|
||||
// non-area aura
|
||||
ConditionContainer* condList = m_spellInfo->Effects[effIndex].ImplicitTargetConditions;
|
||||
// non-area aura
|
||||
if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AURA)
|
||||
if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AURA || GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AURA_2)
|
||||
{
|
||||
if (!condList || sConditionMgr->IsObjectMeetToConditions(GetUnitOwner(), ref, *condList))
|
||||
units.push_back(GetUnitOwner());
|
||||
|
||||
@@ -1381,6 +1381,9 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TARGET_DEST_CASTER_FLOOR:
|
||||
dest._position.m_positionZ = m_caster->GetFloorZ();
|
||||
break;
|
||||
default:
|
||||
{
|
||||
float dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
|
||||
@@ -2788,7 +2791,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
m_spellAura->Remove();
|
||||
bool found = false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (effectMask & (1 << i) && m_spellInfo->Effects[i].Effect != SPELL_EFFECT_APPLY_AURA)
|
||||
if (effectMask & (1 << i) && (m_spellInfo->Effects[i].Effect != SPELL_EFFECT_APPLY_AURA || m_spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA_2))
|
||||
found = true;
|
||||
if (!found)
|
||||
return SPELL_MISS_IMMUNE;
|
||||
@@ -2977,7 +2980,7 @@ bool Spell::UpdateChanneledTargetList()
|
||||
uint8 channelTargetEffectMask = m_channelTargetEffectMask;
|
||||
uint8 channelAuraMask = 0;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA)
|
||||
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA || m_spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA_2)
|
||||
channelAuraMask |= 1<<i;
|
||||
|
||||
channelAuraMask &= channelTargetEffectMask;
|
||||
@@ -3048,7 +3051,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA)
|
||||
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA || m_spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA_2)
|
||||
{
|
||||
// Change aura with ranks only if basepoints are taken from spellInfo and aura is positive
|
||||
if (m_spellInfo->IsPositiveEffect(i))
|
||||
|
||||
@@ -241,7 +241,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
||||
&Spell::EffectNULL, //171 SPELL_EFFECT_171
|
||||
&Spell::EffectResurrectWithAura, //172 SPELL_EFFECT_RESURRECT_WITH_AURA
|
||||
&Spell::EffectUnlockGuildVaultTab, //173 SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB
|
||||
&Spell::EffectNULL, //174 SPELL_EFFECT_APPLY_AURA_ON_PET
|
||||
&Spell::EffectApplyAura, //174 SPELL_EFFECT_APPLY_AURA_2
|
||||
&Spell::EffectUnused, //175 SPELL_EFFECT_175 unused
|
||||
&Spell::EffectNULL, //176 SPELL_EFFECT_SANCTUARY_2
|
||||
&Spell::EffectNULL, //177 SPELL_EFFECT_177
|
||||
|
||||
@@ -341,7 +341,7 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_
|
||||
{TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 122
|
||||
{TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 123
|
||||
{TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 124
|
||||
{TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 125
|
||||
{TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 125 TARGET_DEST_CASTER_FLOOR
|
||||
{TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 126
|
||||
{TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 127
|
||||
};
|
||||
@@ -431,7 +431,7 @@ bool SpellEffectInfo::IsFarDestTargetEffect() const
|
||||
|
||||
bool SpellEffectInfo::IsUnitOwnedAuraEffect() const
|
||||
{
|
||||
return IsAreaAuraEffect() || Effect == SPELL_EFFECT_APPLY_AURA;
|
||||
return IsAreaAuraEffect() || Effect == SPELL_EFFECT_APPLY_AURA || Effect == SPELL_EFFECT_APPLY_AURA_2;
|
||||
}
|
||||
|
||||
int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const* target) const
|
||||
@@ -446,7 +446,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
|
||||
if (caster)
|
||||
{
|
||||
int32 level = caster->getLevel();
|
||||
if (target && _spellInfo->IsPositiveEffect(_effIndex) && (Effect == SPELL_EFFECT_APPLY_AURA))
|
||||
if (target && _spellInfo->IsPositiveEffect(_effIndex) && (Effect == SPELL_EFFECT_APPLY_AURA || Effect == SPELL_EFFECT_APPLY_AURA_2))
|
||||
level = target->getLevel();
|
||||
|
||||
if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((_spellInfo->ScalingClass != -1 ? _spellInfo->ScalingClass - 1 : MAX_CLASSES - 1) * 100 + level - 1))
|
||||
@@ -841,7 +841,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] =
|
||||
{EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_DEST}, // 171 SPELL_EFFECT_171
|
||||
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 172 SPELL_EFFECT_172
|
||||
{EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_NONE}, // 173 SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB
|
||||
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 174 SPELL_EFFECT_174
|
||||
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 174 SPELL_EFFECT_APPLY_AURA_2
|
||||
{EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_NONE}, // 175 SPELL_EFFECT_175
|
||||
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 176 SPELL_EFFECT_176
|
||||
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 177 SPELL_EFFECT_177
|
||||
@@ -3156,7 +3156,7 @@ bool SpellInfo::SpellCancelsAuraEffect(SpellInfo const* auraSpellInfo, uint8 aur
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (Effects[i].Effect != SPELL_EFFECT_APPLY_AURA)
|
||||
if (Effects[i].Effect != SPELL_EFFECT_APPLY_AURA && Effects[i].Effect != SPELL_EFFECT_APPLY_AURA_2)
|
||||
continue;
|
||||
|
||||
uint32 const miscValue = static_cast<uint32>(Effects[i].MiscValue);
|
||||
@@ -3275,7 +3275,7 @@ uint32 SpellInfo::GetMaxTicks() const
|
||||
|
||||
for (uint8 x = 0; x < MAX_SPELL_EFFECTS; x++)
|
||||
{
|
||||
if (Effects[x].Effect == SPELL_EFFECT_APPLY_AURA)
|
||||
if (Effects[x].Effect == SPELL_EFFECT_APPLY_AURA || Effects[x].Effect == SPELL_EFFECT_APPLY_AURA_2)
|
||||
switch (Effects[x].ApplyAuraName)
|
||||
{
|
||||
case SPELL_AURA_PERIODIC_DAMAGE:
|
||||
@@ -3523,6 +3523,7 @@ SpellInfo const* SpellInfo::GetAuraRankForLevel(uint8 level) const
|
||||
{
|
||||
if (IsPositiveEffect(i) &&
|
||||
(Effects[i].Effect == SPELL_EFFECT_APPLY_AURA ||
|
||||
Effects[i].Effect == SPELL_EFFECT_APPLY_AURA_2 ||
|
||||
Effects[i].Effect == SPELL_EFFECT_APPLY_AREA_AURA_PARTY ||
|
||||
Effects[i].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID) &&
|
||||
!Effects[i].ScalingMultiplier)
|
||||
@@ -3714,6 +3715,7 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
|
||||
|
||||
// non-positive aura use
|
||||
case SPELL_EFFECT_APPLY_AURA:
|
||||
case SPELL_EFFECT_APPLY_AURA_2:
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND:
|
||||
{
|
||||
switch (Effects[effIndex].ApplyAuraName)
|
||||
|
||||
Reference in new issue
Block a user