mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Spells: Removed useless calls of Spell::GetEffect and SpellInfo::GetEffect
This commit is contained in:
@@ -5432,7 +5432,7 @@ void Spell::EffectUnlockGuildVaultTab(SpellEffIndex /*effIndex*/)
|
||||
// Safety checks done in Spell::CheckCast
|
||||
Player* caster = m_caster->ToPlayer();
|
||||
if (Guild* guild = caster->GetGuild())
|
||||
guild->HandleBuyBankTab(caster->GetSession(), effectInfo->BasePoints - 1); // Bank tabs start at zero internally
|
||||
guild->HandleBuyBankTab(caster->GetSession(), damage - 1); // Bank tabs start at zero internally
|
||||
}
|
||||
|
||||
void Spell::EffectResurrectWithAura(SpellEffIndex effIndex)
|
||||
@@ -5497,7 +5497,7 @@ void Spell::EffectRemoveTalent(SpellEffIndex /*effIndex*/)
|
||||
player->SendTalentsInfoData();
|
||||
}
|
||||
|
||||
void Spell::EffectDestroyItem(SpellEffIndex effIndex)
|
||||
void Spell::EffectDestroyItem(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
@@ -5506,13 +5506,11 @@ void Spell::EffectDestroyItem(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
Player* player = unitTarget->ToPlayer();
|
||||
SpellEffectInfo const* effect = GetEffect(effIndex);
|
||||
uint32 itemId = effect->ItemType;
|
||||
if (Item* item = player->GetItemByEntry(itemId))
|
||||
if (Item* item = player->GetItemByEntry(effectInfo->ItemType))
|
||||
player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
|
||||
}
|
||||
|
||||
void Spell::EffectLearnGarrisonBuilding(SpellEffIndex effIndex)
|
||||
void Spell::EffectLearnGarrisonBuilding(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
@@ -5521,10 +5519,10 @@ void Spell::EffectLearnGarrisonBuilding(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
if (Garrison* garrison = unitTarget->ToPlayer()->GetGarrison())
|
||||
garrison->LearnBlueprint(GetEffect(effIndex)->MiscValue);
|
||||
garrison->LearnBlueprint(effectInfo->MiscValue);
|
||||
}
|
||||
|
||||
void Spell::EffectCreateGarrison(SpellEffIndex effIndex)
|
||||
void Spell::EffectCreateGarrison(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
@@ -5532,7 +5530,7 @@ void Spell::EffectCreateGarrison(SpellEffIndex effIndex)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
unitTarget->ToPlayer()->CreateGarrison(GetEffect(effIndex)->MiscValue);
|
||||
unitTarget->ToPlayer()->CreateGarrison(effectInfo->MiscValue);
|
||||
}
|
||||
|
||||
void Spell::EffectCreateConversation(SpellEffIndex /*effIndex*/)
|
||||
@@ -5546,7 +5544,7 @@ void Spell::EffectCreateConversation(SpellEffIndex /*effIndex*/)
|
||||
Conversation::CreateConversation(effectInfo->MiscValue, GetCaster(), destTarget->GetPosition(), { GetCaster()->GetGUID() }, GetSpellInfo());
|
||||
}
|
||||
|
||||
void Spell::EffectAddGarrisonFollower(SpellEffIndex effIndex)
|
||||
void Spell::EffectAddGarrisonFollower(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
@@ -5555,7 +5553,7 @@ void Spell::EffectAddGarrisonFollower(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
if (Garrison* garrison = unitTarget->ToPlayer()->GetGarrison())
|
||||
garrison->AddFollower(GetEffect(effIndex)->MiscValue);
|
||||
garrison->AddFollower(effectInfo->MiscValue);
|
||||
}
|
||||
|
||||
void Spell::EffectCreateHeirloomItem(SpellEffIndex effIndex)
|
||||
@@ -5578,7 +5576,7 @@ void Spell::EffectCreateHeirloomItem(SpellEffIndex effIndex)
|
||||
ExecuteLogEffectCreateItem(effIndex, m_misc.Raw.Data[0]);
|
||||
}
|
||||
|
||||
void Spell::EffectActivateGarrisonBuilding(SpellEffIndex effIndex)
|
||||
void Spell::EffectActivateGarrisonBuilding(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
@@ -5587,10 +5585,10 @@ void Spell::EffectActivateGarrisonBuilding(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
if (Garrison* garrison = unitTarget->ToPlayer()->GetGarrison())
|
||||
garrison->ActivateBuilding(GetEffect(effIndex)->MiscValue);
|
||||
garrison->ActivateBuilding(effectInfo->MiscValue);
|
||||
}
|
||||
|
||||
void Spell::EffectHealBattlePetPct(SpellEffIndex effIndex)
|
||||
void Spell::EffectHealBattlePetPct(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
@@ -5599,7 +5597,7 @@ void Spell::EffectHealBattlePetPct(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
if (BattlePetMgr* battlePetMgr = unitTarget->ToPlayer()->GetSession()->GetBattlePetMgr())
|
||||
battlePetMgr->HealBattlePetsPct(GetEffect(effIndex)->BasePoints);
|
||||
battlePetMgr->HealBattlePetsPct(damage);
|
||||
}
|
||||
|
||||
void Spell::EffectEnableBattlePets(SpellEffIndex /*effIndex*/)
|
||||
|
||||
@@ -1291,9 +1291,9 @@ class spell_gen_despawn_self : public SpellScriptLoader
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetSpellInfo()->GetEffect(effIndex)->Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->GetEffect(effIndex)->Effect == SPELL_EFFECT_SCRIPT_EFFECT)
|
||||
if (GetEffectInfo()->IsEffect(SPELL_EFFECT_DUMMY) || GetEffectInfo()->IsEffect(SPELL_EFFECT_SCRIPT_EFFECT))
|
||||
GetCaster()->ToCreature()->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
@@ -2457,8 +2457,8 @@ class spell_gen_oracle_wolvar_reputation : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
Player* player = GetCaster()->ToPlayer();
|
||||
uint32 factionId = GetSpellInfo()->GetEffect(effIndex)->CalcValue();
|
||||
int32 repChange = GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue();
|
||||
uint32 factionId = GetEffectInfo(effIndex)->CalcValue();
|
||||
int32 repChange = GetEffectInfo(EFFECT_1)->CalcValue();
|
||||
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
|
||||
if (!factionEntry)
|
||||
|
||||
@@ -1315,7 +1315,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((Unit*)NULL, GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
|
||||
GetHitUnit()->CastSpell(nullptr, GetEffectInfo()->TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
Reference in New Issue
Block a user