mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 14:39:43 -04:00
Core/Spells: Split TRIGGERED_IGNORE_POWER_AND_REAGENT_COST into separate POWER and REAGENT flags
(cherry picked from commit 151a50d2aa)
# Conflicts:
# src/server/game/Spells/Spell.cpp
# src/server/scripts/Spells/spell_druid.cpp
# src/server/scripts/Spells/spell_priest.cpp
# src/server/scripts/Spells/spell_warlock.cpp
This commit is contained in:
@@ -14075,9 +14075,9 @@ SpellInfo const* Unit::GetCastSpellInfo(SpellInfo const* spellInfo, TriggerCastF
|
||||
if (SpellInfo const* newInfo = sSpellMgr->GetSpellInfo(auraEffect->GetAmount(), GetMap()->GetDifficultyID()))
|
||||
{
|
||||
if (auraEffect->GetSpellInfo()->HasAttribute(SPELL_ATTR8_IGNORE_SPELLCAST_OVERRIDE_COST))
|
||||
triggerFlag |= TRIGGERED_IGNORE_POWER_AND_REAGENT_COST;
|
||||
triggerFlag |= TRIGGERED_IGNORE_POWER_COST;
|
||||
else
|
||||
triggerFlag &= ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST;
|
||||
triggerFlag &= ~TRIGGERED_IGNORE_POWER_COST;
|
||||
|
||||
if (auraEffect->GetSpellInfo()->HasAttribute(SPELL_ATTR11_IGNORE_SPELLCAST_OVERRIDE_SHAPESHIFT_REQUIREMENTS))
|
||||
triggerFlag |= TRIGGERED_IGNORE_SHAPESHIFT;
|
||||
|
||||
@@ -3865,12 +3865,12 @@ void Spell::_cast(bool skipCheck)
|
||||
if (Player* playerCaster = m_caster->ToPlayer())
|
||||
playerCaster->UpdateCraftSkill(m_spellInfo);
|
||||
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST))
|
||||
{
|
||||
// Powers have to be taken before SendSpellGo
|
||||
// Powers have to be taken before SendSpellGo
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_COST))
|
||||
TakePower();
|
||||
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_REAGENT_COST))
|
||||
TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot
|
||||
}
|
||||
else if (Item* targetItem = m_targets.GetItemTarget())
|
||||
{
|
||||
/// Not own traded item (in trader trade slot) req. reagents including triggered spell case
|
||||
@@ -4825,7 +4825,7 @@ void Spell::SendSpellGo()
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
&& (m_caster->ToPlayer()->GetClass() == CLASS_DEATH_KNIGHT)
|
||||
&& (HasPowerTypeCost(POWER_RUNE_BLOOD) || HasPowerTypeCost(POWER_RUNE_FROST) || HasPowerTypeCost(POWER_RUNE_UNHOLY))
|
||||
&& !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST))
|
||||
&& !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_COST))
|
||||
{
|
||||
castFlags |= CAST_FLAG_NO_GCD; // not needed, but Blizzard sends it
|
||||
castFlags |= CAST_FLAG_RUNE_LIST; // rune cooldowns list
|
||||
@@ -6092,7 +6092,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
|
||||
if (castResult != SPELL_CAST_OK)
|
||||
return castResult;
|
||||
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST))
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_COST))
|
||||
{
|
||||
castResult = CheckPower();
|
||||
if (castResult != SPELL_CAST_OK)
|
||||
@@ -7409,7 +7409,7 @@ SpellCastResult Spell::CheckItems(int32* param1 /*= nullptr*/, int32* param2 /*=
|
||||
// do not take reagents for these item casts
|
||||
if (!(m_CastItem && m_CastItem->GetTemplate()->HasFlag(ITEM_FLAG_NO_REAGENT_COST)))
|
||||
{
|
||||
bool checkReagents = !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST) && !player->CanNoReagentCast(m_spellInfo);
|
||||
bool checkReagents = !(_triggeredCastFlags & TRIGGERED_IGNORE_REAGENT_COST) && !player->CanNoReagentCast(m_spellInfo);
|
||||
// Not own traded item (in trader trade slot) requires reagents even if triggered spell
|
||||
if (!checkReagents)
|
||||
if (Item* targetItem = m_targets.GetItemTarget())
|
||||
|
||||
@@ -256,13 +256,13 @@ enum TriggerCastFlags : uint32
|
||||
TRIGGERED_NONE = 0x00000000, //!< Not triggered
|
||||
TRIGGERED_IGNORE_GCD = 0x00000001, //!< Will ignore GCD
|
||||
TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD = 0x00000002, //!< Will ignore Spell and Category cooldowns
|
||||
TRIGGERED_IGNORE_POWER_AND_REAGENT_COST = 0x00000004, //!< Will ignore power and reagent cost
|
||||
TRIGGERED_IGNORE_POWER_COST = 0x00000004, //!< Will ignore power and reagent cost
|
||||
TRIGGERED_IGNORE_CAST_ITEM = 0x00000008, //!< Will not take away cast item or update related achievement criteria
|
||||
TRIGGERED_IGNORE_AURA_SCALING = 0x00000010, //!< Will ignore aura scaling
|
||||
TRIGGERED_IGNORE_CAST_IN_PROGRESS = 0x00000020, //!< Will not check if a current cast is in progress
|
||||
TRIGGERED_IGNORE_CAST_TIME = 0x00000040, //!< Will always be instantly cast
|
||||
TRIGGERED_CAST_DIRECTLY = 0x00000080, //!< In Spell::prepare, will be cast directly without setting containers for executed spell
|
||||
// reuse = 0x00000100,
|
||||
TRIGGERED_IGNORE_REAGENT_COST = 0x00000100, //!< Will ignore reagent cost
|
||||
TRIGGERED_IGNORE_SET_FACING = 0x00000200, //!< Will not adjust facing to target (if any)
|
||||
TRIGGERED_IGNORE_SHAPESHIFT = 0x00000400, //!< Will ignore shapeshift checks
|
||||
// reuse = 0x00000800,
|
||||
|
||||
@@ -39,7 +39,7 @@ class spell_eastern_plaguelands_test_fetid_skull : public SpellScript
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->CastSpell(GetCaster(), roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST, TRIGGERED_IGNORE_POWER_AND_REAGENT_COST);
|
||||
GetCaster()->CastSpell(GetCaster(), roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST, TRIGGERED_IGNORE_REAGENT_COST);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -213,7 +213,7 @@ class spell_brewfest_relay_race_intro_force_player_to_throw : public SpellScript
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
// All this spells trigger a spell that requires reagents; if the
|
||||
// triggered spell is cast as "triggered", reagents are not consumed
|
||||
GetHitUnit()->CastSpell(nullptr, GetEffectInfo().TriggerSpell, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST);
|
||||
GetHitUnit()->CastSpell(nullptr, GetEffectInfo().TriggerSpell, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_REAGENT_COST);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -1459,7 +1459,7 @@ class spell_silithus_summon_cultist_periodic : public AuraScript
|
||||
|
||||
// All these spells trigger a spell that requires reagents; if the
|
||||
// triggered spell is cast as "triggered", reagents are not consumed
|
||||
GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, CastSpellExtraArgs(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST).SetTriggeringAura(aurEff));
|
||||
GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, CastSpellExtraArgs(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_REAGENT_COST).SetTriggeringAura(aurEff));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -2842,7 +2842,7 @@ class spell_hor_quel_delars_will : public SpellScript
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
// dummy spell consumes reagent, don't ignore it
|
||||
GetHitUnit()->CastSpell(GetCaster(), GetEffectInfo().TriggerSpell, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST);
|
||||
GetHitUnit()->CastSpell(GetCaster(), GetEffectInfo().TriggerSpell, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_REAGENT_COST);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -1841,7 +1841,7 @@ class spell_igb_periodic_trigger_with_power_cost : public AuraScript
|
||||
void HandlePeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), aurEff->GetSpellEffectInfo().TriggerSpell, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST);
|
||||
GetTarget()->CastSpell(GetTarget(), aurEff->GetSpellEffectInfo().TriggerSpell, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_COST);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -1395,7 +1395,7 @@ class spell_kaelthas_remove_weapons : public SpellScript
|
||||
{
|
||||
if (Player* player = GetHitPlayer())
|
||||
for (uint32 spells : RemoveWeaponsSpells)
|
||||
player->CastSpell(player, spells, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST);
|
||||
player->CastSpell(player, spells, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_REAGENT_COST);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
Reference in New Issue
Block a user