Core/Spells: Don't ignore power costs and reagents for spells triggered by SPELL_EFFECT_TRIGGER_SPELL, SPELL_EFFECT_TRIGGER_MISSILE, SPELL_EFFECT_FORCE_CAST, SPELL_AURA_PERIODIC_TRIGGER_SPELL, SPELL_AURA_PROC_TRIGGER_SPELL and fixed implementation of SPELL_ATTR6_DO_NOT_CONSUME_RESOURCES
This commit is contained in:
1 parent
a2079b5835
commit
16aa620ca0
5 files changed
+72
-43
No files matched your search
@@ -5263,7 +5263,7 @@ void Spell::TakePower()
|
||||
if (!unitCaster)
|
||||
return;
|
||||
|
||||
if (m_CastItem || m_triggeredByAuraSpell)
|
||||
if (m_CastItem || m_spellInfo->HasAttribute(SPELL_ATTR6_DO_NOT_CONSUME_RESOURCES))
|
||||
return;
|
||||
|
||||
//Don't take power if the spell is cast while .cheat power is enabled.
|
||||
@@ -5483,7 +5483,7 @@ void Spell::TakeReagents()
|
||||
ItemTemplate const* castItemTemplate = m_CastItem ? m_CastItem->GetTemplate() : nullptr;
|
||||
|
||||
// do not take reagents for these item casts
|
||||
if (castItemTemplate && castItemTemplate->GetFlags() & ITEM_FLAG_NO_REAGENT_COST)
|
||||
if ((castItemTemplate && castItemTemplate->GetFlags() & ITEM_FLAG_NO_REAGENT_COST) || m_spellInfo->HasAttribute(SPELL_ATTR6_DO_NOT_CONSUME_RESOURCES))
|
||||
return;
|
||||
|
||||
Player* p_caster = m_caster->ToPlayer();
|
||||
@@ -8947,3 +8947,10 @@ bool WorldObjectSpellTrajTargetCheck::operator()(WorldObject* target)
|
||||
}
|
||||
|
||||
} //namespace Trinity
|
||||
|
||||
CastSpellExtraArgs::CastSpellExtraArgs() = default;
|
||||
CastSpellExtraArgs::CastSpellExtraArgs(CastSpellExtraArgs const& other) = default;
|
||||
CastSpellExtraArgs::CastSpellExtraArgs(CastSpellExtraArgs&& other) noexcept = default;
|
||||
CastSpellExtraArgs& CastSpellExtraArgs::operator=(CastSpellExtraArgs const& other) = default;
|
||||
CastSpellExtraArgs& CastSpellExtraArgs::operator=(CastSpellExtraArgs&& other) noexcept = default;
|
||||
CastSpellExtraArgs::~CastSpellExtraArgs() = default;
|
||||
Reference in new issue
Block a user