diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-12-31 20:14:01 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2025-01-01 21:00:25 +0100 |
commit | eaf412c1bb17a445a75f3b2e754586104fbecb1c (patch) | |
tree | 793a43969390538ae88bcf9375a9095055f4d2fb /src | |
parent | 435864761e1de4be4bc8a344dec8e787ddbe636b (diff) |
Core/Spells: Split TRIGGERED_IGNORE_POWER_AND_REAGENT_COST into separate POWER and REAGENT flags
(cherry picked from commit 151a50d2aa6e10efe7fc14e0bd22aaef9effa859)
# 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
Diffstat (limited to 'src')
9 files changed, 17 insertions, 17 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f58156d97c9..e6b6f882709 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 8387e24a9d9..6126d7fc635 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -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()) diff --git a/src/server/game/Spells/SpellDefines.h b/src/server/game/Spells/SpellDefines.h index 987e0255e9e..c1aa3708087 100644 --- a/src/server/game/Spells/SpellDefines.h +++ b/src/server/game/Spells/SpellDefines.h @@ -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, diff --git a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp index 60c69ab9851..55ac51fb7c7 100644 --- a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp @@ -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 diff --git a/src/server/scripts/Events/brewfest.cpp b/src/server/scripts/Events/brewfest.cpp index 1c00e87ea93..1a4a1bf39c7 100644 --- a/src/server/scripts/Events/brewfest.cpp +++ b/src/server/scripts/Events/brewfest.cpp @@ -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 diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index 9981e5267f5..e04e32428e6 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -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 diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index add5869f084..8b668b5664d 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -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 diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index 511548b276b..6790b95f7e4 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -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 diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 01ad39ac4e3..3c6ca02ccba 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -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 |