Core/Spells: Split TRIGGERED_IGNORE_POWER_AND_REAGENT_COST into separate POWER and REAGENT flags
This commit is contained in:
@@ -14088,9 +14088,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;
|
||||
|
||||
@@ -3862,12 +3862,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
|
||||
@@ -4908,7 +4908,7 @@ void Spell::SendSpellGo()
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
&& (m_caster->ToPlayer()->GetClass() == CLASS_DEATH_KNIGHT)
|
||||
&& HasPowerTypeCost(POWER_RUNES)
|
||||
&& !(_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
|
||||
@@ -6190,7 +6190,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)
|
||||
@@ -7617,7 +7617,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())
|
||||
|
||||
@@ -257,13 +257,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
|
||||
|
||||
@@ -1314,7 +1314,7 @@ class spell_dru_luxuriant_soil : public AuraScript
|
||||
if (targetList.empty())
|
||||
return;
|
||||
|
||||
rejuvCaster->CastSpell(Trinity::Containers::SelectRandomContainerElement(targetList), SPELL_DRUID_REJUVENATION, TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_POWER_AND_REAGENT_COST | TRIGGERED_IGNORE_CAST_IN_PROGRESS);
|
||||
rejuvCaster->CastSpell(Trinity::Containers::SelectRandomContainerElement(targetList), SPELL_DRUID_REJUVENATION, TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_POWER_COST | TRIGGERED_IGNORE_CAST_IN_PROGRESS);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -2807,7 +2807,7 @@ class spell_pri_rapture : public SpellScript
|
||||
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*caster, _raptureTarget))
|
||||
caster->CastSpell(target, SPELL_PRIEST_POWER_WORD_SHIELD,
|
||||
CastSpellExtraArgs(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_POWER_AND_REAGENT_COST | TRIGGERED_IGNORE_CAST_IN_PROGRESS)
|
||||
CastSpellExtraArgs(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_POWER_COST | TRIGGERED_IGNORE_CAST_IN_PROGRESS)
|
||||
.SetTriggeringSpell(GetSpell()));
|
||||
}
|
||||
|
||||
@@ -3559,7 +3559,7 @@ class spell_pri_whispering_shadows_effect : public SpellScript
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_PRIEST_VAMPIRIC_TOUCH, CastSpellExtraArgs()
|
||||
.SetTriggeringSpell(GetSpell())
|
||||
.SetTriggerFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD | TRIGGERED_IGNORE_POWER_AND_REAGENT_COST | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_IGNORE_CAST_TIME | TRIGGERED_DONT_REPORT_CAST_ERROR));
|
||||
.SetTriggerFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD | TRIGGERED_IGNORE_POWER_COST | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_IGNORE_CAST_TIME | TRIGGERED_DONT_REPORT_CAST_ERROR));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -1442,7 +1442,7 @@ class spell_warl_vile_taint : public SpellScript
|
||||
CastSpellTargetArg target = GetHitUnit();
|
||||
|
||||
CastSpellExtraArgs args;
|
||||
args.SetTriggerFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_POWER_AND_REAGENT_COST
|
||||
args.SetTriggerFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_POWER_COST
|
||||
| TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
|
||||
args.SetTriggeringSpell(GetSpell());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user