From 5bfeabde813d26cf2317e39cffe598a9d1d738ab Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 2 Dec 2023 10:03:15 +0100 Subject: [PATCH] chore(Core/Misc): rename spellInfo pointers (#17914) * Rename all --- .../game/Achievements/AchievementMgr.cpp | 6 +-- src/server/game/DataStores/DBCStores.cpp | 8 ++-- src/server/game/Entities/Pet/Pet.cpp | 10 ++--- .../game/Entities/Player/PlayerUpdates.cpp | 4 +- src/server/game/Entities/Unit/Unit.cpp | 14 +++---- src/server/game/Globals/ObjectMgr.cpp | 10 ++--- src/server/game/Handlers/TradeHandler.cpp | 12 +++--- .../Scripting/ScriptDefines/PetScript.cpp | 4 +- src/server/game/Scripting/ScriptMgr.h | 4 +- src/server/game/Skills/SkillDiscovery.cpp | 6 +-- src/server/game/Spells/SpellMgr.cpp | 8 ++-- src/server/game/Spells/SpellScript.cpp | 40 +++++++++---------- src/server/game/Spells/SpellScript.h | 16 ++++---- .../boss_anubarak_trial.cpp | 2 +- .../UtgardeKeep/UtgardeKeep/utgarde_keep.cpp | 2 +- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/server/scripts/Spells/spell_mage.cpp | 8 ++-- src/server/scripts/Spells/spell_quest.cpp | 20 +++++----- 18 files changed, 88 insertions(+), 88 deletions(-) diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index f445136f0d5f01..13072d3c2712ac 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -140,8 +140,8 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA: case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA: { - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(aura.spell_id); - if (!spellEntry) + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(aura.spell_id); + if (!spellInfo) { LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: {} Type: {}) for data type {} ({}) has wrong spell id in value1 ({}), ignored.", criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA ? "ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA" : "ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id); @@ -153,7 +153,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA ? "ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA" : "ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx); return false; } - if (!spellEntry->Effects[aura.effect_idx].ApplyAuraName) + if (!spellInfo->Effects[aura.effect_idx].ApplyAuraName) { LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: {} Type: {}) for data type {} ({}) has non-aura spell effect (ID: {} Effect: {}), ignores.", criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA ? "ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA" : "ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx); diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index b557ea9ce5ae39..9f669911806c72 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -429,8 +429,8 @@ void LoadDBCStores(const std::string& dataPath) for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore) { - SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->Spell); - if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) + SpellEntry const* spellEntry = sSpellStore.LookupEntry(skillLine->Spell); + if (spellEntry && spellEntry->Attributes & SPELL_ATTR0_PASSIVE) { for (CreatureFamilyEntry const* cFamily : sCreatureFamilyStore) { @@ -439,7 +439,7 @@ void LoadDBCStores(const std::string& dataPath) continue; } - if (spellInfo->SpellLevel) + if (spellEntry->SpellLevel) { continue; } @@ -449,7 +449,7 @@ void LoadDBCStores(const std::string& dataPath) continue; } - sPetFamilySpellsStore[cFamily->ID].insert(spellInfo->Id); + sPetFamilySpellsStore[cFamily->ID].insert(spellEntry->Id); } } } diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 96afdf50f8f76d..5bd634c0df1a8b 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1941,16 +1941,16 @@ void Pet::InitLevelupSpellsForLevel() { for (uint32 spellId : defSpells->spellid) { - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spellId); - if (!spellEntry) + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) continue; // will called first if level down - if (spellEntry->SpellLevel > level && sScriptMgr->CanUnlearnSpellDefault(this, spellEntry)) - unlearnSpell(spellEntry->Id, true); + if (spellInfo->SpellLevel > level && sScriptMgr->CanUnlearnSpellDefault(this, spellInfo)) + unlearnSpell(spellInfo->Id, true); // will called if level up else - learnSpell(spellEntry->Id); + learnSpell(spellInfo->Id); } } } diff --git a/src/server/game/Entities/Player/PlayerUpdates.cpp b/src/server/game/Entities/Player/PlayerUpdates.cpp index 716a46030d385c..1f137edb4db52f 100644 --- a/src/server/game/Entities/Player/PlayerUpdates.cpp +++ b/src/server/game/Entities/Player/PlayerUpdates.cpp @@ -795,8 +795,8 @@ bool Player::UpdateCraftSkill(uint32 spellid) GetPureSkillValue(_spell_idx->second->SkillLine); // Alchemy Discoveries here - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spellid); - if (spellEntry && spellEntry->Mechanic == MECHANIC_DISCOVERY) + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid); + if (spellInfo && spellInfo->Mechanic == MECHANIC_DISCOVERY) { if (uint32 discoveredSpell = GetSkillDiscoverySpell( _spell_idx->second->SkillLine, spellid, this)) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 91f6c275ba48af..230c424bd54d16 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -19835,10 +19835,10 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) Unit* target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_CLICKER) ? clicker : this; ObjectGuid origCasterGUID = (itr->second.castFlags & NPC_CLICK_CAST_ORIG_CASTER_OWNER) ? GetOwnerGUID() : clicker->GetGUID(); - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(itr->second.spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->second.spellId); // xinef: dont allow players to enter vehicles on arena - if (spellEntry->HasAura(SPELL_AURA_CONTROL_VEHICLE) && caster->GetTypeId() == TYPEID_PLAYER && caster->FindMap() && caster->FindMap()->IsBattleArena()) + if (spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE) && caster->GetTypeId() == TYPEID_PLAYER && caster->FindMap() && caster->FindMap()->IsBattleArena()) continue; if (seatId > -1) @@ -19847,7 +19847,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) bool valid = false; while (i < MAX_SPELL_EFFECTS) { - if (spellEntry->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE) + if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE) { valid = true; break; @@ -19867,18 +19867,18 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) { int32 bp0[MAX_SPELL_EFFECTS]; for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j) - bp0[j] = spellEntry->Effects[j].BasePoints; + bp0[j] = spellInfo->Effects[j].BasePoints; bp0[i] = seatId; - Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, bp0, nullptr, origCasterGUID); + Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, this, clicker, bp0, nullptr, origCasterGUID); } } else { if (IsInMap(caster)) - caster->CastSpell(target, spellEntry, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, nullptr, nullptr, origCasterGUID); + caster->CastSpell(target, spellInfo, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, nullptr, nullptr, origCasterGUID); else - Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, nullptr, nullptr, origCasterGUID); + Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, this, clicker, nullptr, nullptr, origCasterGUID); } result = true; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 5f65eb4a218fff..f18597becf5457 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5671,7 +5671,7 @@ void ObjectMgr::ValidateSpellScripts() for (SpellScriptsContainer::iterator itr = _spellScriptsStore.begin(); itr != _spellScriptsStore.end();) { - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(itr->first); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); std::vector > SpellScriptLoaders; sScriptMgr->CreateSpellScriptLoaders(itr->first, SpellScriptLoaders); itr = _spellScriptsStore.upper_bound(itr->first); @@ -5688,17 +5688,17 @@ void ObjectMgr::ValidateSpellScripts() } if (spellScript) { - spellScript->_Init(&sitr->first->GetName(), spellEntry->Id); + spellScript->_Init(&sitr->first->GetName(), spellInfo->Id); spellScript->_Register(); - if (!spellScript->_Validate(spellEntry)) + if (!spellScript->_Validate(spellInfo)) valid = false; delete spellScript; } if (auraScript) { - auraScript->_Init(&sitr->first->GetName(), spellEntry->Id); + auraScript->_Init(&sitr->first->GetName(), spellInfo->Id); auraScript->_Register(); - if (!auraScript->_Validate(spellEntry)) + if (!auraScript->_Validate(spellInfo)) valid = false; delete auraScript; } diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index a4e64b9e70f46a..1608b1ae0e8b8d 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -339,10 +339,10 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) // not accept if spell can't be casted now (cheating) if (uint32 my_spell_id = my_trade->GetSpell()) { - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(my_spell_id); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(my_spell_id); Item* castItem = my_trade->GetSpellCastItem(); - if (!spellEntry || !his_trade->GetItem(TRADE_SLOT_NONTRADED) || + if (!spellInfo || !his_trade->GetItem(TRADE_SLOT_NONTRADED) || (my_trade->HasSpellCastItem() && !castItem)) { clearAcceptTradeMode(my_trade, his_trade); @@ -352,7 +352,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) return; } - my_spell = new Spell(_player, spellEntry, TRIGGERED_FULL_MASK); + my_spell = new Spell(_player, spellInfo, TRIGGERED_FULL_MASK); my_spell->m_CastItem = castItem; my_targets.SetTradeItemTarget(_player); my_spell->m_targets = my_targets; @@ -374,10 +374,10 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) // not accept if spell can't be casted now (cheating) if (uint32 his_spell_id = his_trade->GetSpell()) { - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(his_spell_id); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(his_spell_id); Item* castItem = his_trade->GetSpellCastItem(); - if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || (his_trade->HasSpellCastItem() && !castItem)) + if (!spellInfo || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || (his_trade->HasSpellCastItem() && !castItem)) { delete my_spell; his_trade->SetSpell(0); @@ -387,7 +387,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) return; } - his_spell = new Spell(trader, spellEntry, TRIGGERED_FULL_MASK); + his_spell = new Spell(trader, spellInfo, TRIGGERED_FULL_MASK); his_spell->m_CastItem = castItem; his_targets.SetTradeItemTarget(trader); his_spell->m_targets = his_targets; diff --git a/src/server/game/Scripting/ScriptDefines/PetScript.cpp b/src/server/game/Scripting/ScriptDefines/PetScript.cpp index 1d3b45b5e94947..e26c4bc04c63a8 100644 --- a/src/server/game/Scripting/ScriptDefines/PetScript.cpp +++ b/src/server/game/Scripting/ScriptDefines/PetScript.cpp @@ -49,11 +49,11 @@ bool ScriptMgr::CanUnlearnSpellSet(Pet* pet, uint32 level, uint32 spell) return true; } -bool ScriptMgr::CanUnlearnSpellDefault(Pet* pet, SpellInfo const* spellEntry) +bool ScriptMgr::CanUnlearnSpellDefault(Pet* pet, SpellInfo const* spellInfo) { auto ret = IsValidBoolScript([&](PetScript* script) { - return !script->CanUnlearnSpellDefault(pet, spellEntry); + return !script->CanUnlearnSpellDefault(pet, spellInfo); }); if (ret && *ret) diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index ef504df1f9d37d..681fddc6ed5f53 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -1914,7 +1914,7 @@ class PetScript : public ScriptObject [[nodiscard]] virtual bool CanUnlearnSpellSet(Pet* /*pet*/, uint32 /*level*/, uint32 /*spell*/) { return true; } - [[nodiscard]] virtual bool CanUnlearnSpellDefault(Pet* /*pet*/, SpellInfo const* /*spellEntry*/) { return true; } + [[nodiscard]] virtual bool CanUnlearnSpellDefault(Pet* /*pet*/, SpellInfo const* /*spellInfo*/) { return true; } [[nodiscard]] virtual bool CanResetTalents(Pet* /*pet*/) { return true; } @@ -2650,7 +2650,7 @@ class ScriptMgr void OnInitStatsForLevel(Guardian* guardian, uint8 petlevel); void OnCalculateMaxTalentPointsForLevel(Pet* pet, uint8 level, uint8& points); bool CanUnlearnSpellSet(Pet* pet, uint32 level, uint32 spell); - bool CanUnlearnSpellDefault(Pet* pet, SpellInfo const* spellEntry); + bool CanUnlearnSpellDefault(Pet* pet, SpellInfo const* spellInfo); bool CanResetTalents(Pet* pet); public: /* ArenaScript */ diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index f597ef06c0cd86..b84cca8842fa03 100644 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -139,12 +139,12 @@ void LoadSkillDiscoveryTable() // report about empty data for explicit discovery spells for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id) { - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spell_id); - if (!spellEntry) + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id); + if (!spellInfo) continue; // skip not explicit discovery spells - if (!spellEntry->IsExplicitDiscovery()) + if (!spellInfo->IsExplicitDiscovery()) continue; if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end()) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 84b3e50f25e3bd..0e29e95d84c73c 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2449,15 +2449,15 @@ void SpellMgr::LoadPetDefaultSpells() // different summon spells for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { - SpellInfo const* spellEntry = GetSpellInfo(i); - if (!spellEntry) + SpellInfo const* spellInfo = GetSpellInfo(i); + if (!spellInfo) continue; for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k) { - if (spellEntry->Effects[k].Effect == SPELL_EFFECT_SUMMON || spellEntry->Effects[k].Effect == SPELL_EFFECT_SUMMON_PET) + if (spellInfo->Effects[k].Effect == SPELL_EFFECT_SUMMON || spellInfo->Effects[k].Effect == SPELL_EFFECT_SUMMON_PET) { - uint32 creature_id = spellEntry->Effects[k].MiscValue; + uint32 creature_id = spellInfo->Effects[k].MiscValue; CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature_id); if (!cInfo) continue; diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 347cacf51640a6..7f072edbec78b6 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -75,7 +75,7 @@ _SpellScript::EffectHook::EffectHook(uint8 _effIndex) effIndex = _effIndex; } -uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellInfo const* spellEntry) +uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellInfo const* spellInfo) { uint8 mask = 0; if ((effIndex == EFFECT_ALL) || (effIndex == EFFECT_FIRST_FOUND)) @@ -84,21 +84,21 @@ uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellInfo const* spellEnt { if ((effIndex == EFFECT_FIRST_FOUND) && mask) return mask; - if (CheckEffect(spellEntry, i)) + if (CheckEffect(spellInfo, i)) mask |= (uint8)1 << i; } } else { - if (CheckEffect(spellEntry, effIndex)) + if (CheckEffect(spellInfo, effIndex)) mask |= (uint8)1 << effIndex; } return mask; } -bool _SpellScript::EffectHook::IsEffectAffected(SpellInfo const* spellEntry, uint8 effIndex) +bool _SpellScript::EffectHook::IsEffectAffected(SpellInfo const* spellInfo, uint8 effIndex) { - return GetAffectedEffectsMask(spellEntry) & 1 << effIndex; + return GetAffectedEffectsMask(spellInfo) & 1 << effIndex; } std::string _SpellScript::EffectHook::EffIndexToString() @@ -119,13 +119,13 @@ std::string _SpellScript::EffectHook::EffIndexToString() return "Invalid Value"; } -bool _SpellScript::EffectNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex) +bool _SpellScript::EffectNameCheck::Check(SpellInfo const* spellInfo, uint8 effIndex) { - if (!spellEntry->Effects[effIndex].Effect && !effName) + if (!spellInfo->Effects[effIndex].Effect && !effName) return true; - if (!spellEntry->Effects[effIndex].Effect) + if (!spellInfo->Effects[effIndex].Effect) return false; - return (effName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].Effect == effName); + return (effName == SPELL_EFFECT_ANY) || (spellInfo->Effects[effIndex].Effect == effName); } std::string _SpellScript::EffectNameCheck::ToString() @@ -141,13 +141,13 @@ std::string _SpellScript::EffectNameCheck::ToString() } } -bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex) +bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellInfo, uint8 effIndex) { - if (!spellEntry->Effects[effIndex].ApplyAuraName && !effAurName) + if (!spellInfo->Effects[effIndex].ApplyAuraName && !effAurName) return true; - if (!spellEntry->Effects[effIndex].ApplyAuraName) + if (!spellInfo->Effects[effIndex].ApplyAuraName) return false; - return (effAurName == SPELL_AURA_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName); + return (effAurName == SPELL_AURA_ANY) || (spellInfo->Effects[effIndex].ApplyAuraName == effAurName); } std::string _SpellScript::EffectAuraNameCheck::ToString() @@ -194,9 +194,9 @@ std::string SpellScript::EffectHandler::ToString() return "Index: " + EffIndexToString() + " Name: " + _SpellScript::EffectNameCheck::ToString(); } -bool SpellScript::EffectHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) +bool SpellScript::EffectHandler::CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) { - return _SpellScript::EffectNameCheck::Check(spellEntry, effIndex); + return _SpellScript::EffectNameCheck::Check(spellInfo, effIndex); } void SpellScript::EffectHandler::Call(SpellScript* spellScript, SpellEffIndex effIndex) @@ -234,13 +234,13 @@ std::string SpellScript::TargetHook::ToString() return oss.str(); } -bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) +bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) { if (!targetType) return false; - if (spellEntry->Effects[effIndex].TargetA.GetTarget() != targetType && - spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType) + if (spellInfo->Effects[effIndex].TargetA.GetTarget() != targetType && + spellInfo->Effects[effIndex].TargetB.GetTarget() != targetType) return false; SpellImplicitTargetInfo targetInfo(targetType); @@ -785,9 +785,9 @@ AuraScript::EffectBase::EffectBase(uint8 _effIndex, uint16 _effName) { } -bool AuraScript::EffectBase::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) +bool AuraScript::EffectBase::CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) { - return _SpellScript::EffectAuraNameCheck::Check(spellEntry, effIndex); + return _SpellScript::EffectAuraNameCheck::Check(spellInfo, effIndex); } std::string AuraScript::EffectBase::ToString() diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index fe78c51fea94f4..5ada4e0f41f0fe 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -74,9 +74,9 @@ class _SpellScript EffectHook(uint8 _effIndex); virtual ~EffectHook() { } - uint8 GetAffectedEffectsMask(SpellInfo const* spellEntry); - bool IsEffectAffected(SpellInfo const* spellEntry, uint8 effIndex); - virtual bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) = 0; + uint8 GetAffectedEffectsMask(SpellInfo const* spellInfo); + bool IsEffectAffected(SpellInfo const* spellInfo, uint8 effIndex); + virtual bool CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) = 0; std::string EffIndexToString(); protected: uint8 effIndex; @@ -86,7 +86,7 @@ class _SpellScript { public: EffectNameCheck(uint16 _effName) { effName = _effName; } - bool Check(SpellInfo const* spellEntry, uint8 effIndex); + bool Check(SpellInfo const* spellInfo, uint8 effIndex); std::string ToString(); private: uint16 effName; @@ -96,7 +96,7 @@ class _SpellScript { public: EffectAuraNameCheck(uint16 _effAurName) { effAurName = _effAurName; } - bool Check(SpellInfo const* spellEntry, uint8 effIndex); + bool Check(SpellInfo const* spellInfo, uint8 effIndex); std::string ToString(); private: uint16 effAurName; @@ -114,7 +114,7 @@ class _SpellScript virtual void Register() = 0; // Function called on server startup, if returns false script won't be used in core // use for: dbc/template data presence/correctness checks - virtual bool Validate(SpellInfo const* /*spellEntry*/) { return true; } + virtual bool Validate(SpellInfo const* /*spellInfo*/) { return true; } // Function called when script is created, if returns false script will be unloaded afterwards // use for: initializing local script variables (DO NOT USE CONSTRUCTOR FOR THIS PURPOSE!) virtual bool Load() { return true; } @@ -218,7 +218,7 @@ class SpellScript : public _SpellScript public: EffectHandler(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName); std::string ToString(); - bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) override; + bool CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) override; void Call(SpellScript* spellScript, SpellEffIndex effIndex); private: SpellEffectFnType pEffectHandlerScript; @@ -557,7 +557,7 @@ class AuraScript : public _SpellScript public: EffectBase(uint8 _effIndex, uint16 _effName); std::string ToString(); - bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) override; + bool CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) override; }; class EffectPeriodicHandler : public EffectBase { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 6e209bc9401dfd..5028e6945ec90a 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -880,7 +880,7 @@ class spell_gen_leeching_swarm : public SpellScriptLoader { PrepareAuraScript(spell_gen_leeching_swarm_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_LEECHING_SWARM_DMG, SPELL_LEECHING_SWARM_HEAL }); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index b9bacea6b1be82..82211cf33efd60 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -216,7 +216,7 @@ class spell_ticking_time_bomb : public SpellScriptLoader { PrepareAuraScript(spell_ticking_time_bomb_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_TICKING_TIME_BOMB_EXPLODE }); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 2eb72152b035a6..b3e9210a3bb047 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1952,7 +1952,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScript return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER, diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 88c57a6233384f..f28d691d3a4044 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -908,7 +908,7 @@ const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual: class spell_mage_summon_water_elemental : public SpellScript { PrepareSpellScript(spell_mage_summon_water_elemental) - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo( { @@ -936,9 +936,9 @@ class spell_mage_summon_water_elemental : public SpellScript if (pet->GetCharmInfo() && caster->ToPlayer()) { pet->m_CreatureSpellCooldowns.clear(); - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(31707); - pet->GetCharmInfo()->ToggleCreatureAutocast(spellEntry, true); - pet->GetCharmInfo()->SetSpellAutocast(spellEntry, true); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(31707); + pet->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, true); + pet->GetCharmInfo()->SetSpellAutocast(spellInfo, true); caster->ToPlayer()->CharmSpellInitialize(); } } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index eeb50a4b1b591b..9561f8f41ee06f 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -661,7 +661,7 @@ class spell_q12274_a_fall_from_grace_costume : public SpellScript { PrepareSpellScript(spell_q12274_a_fall_from_grace_costume) - bool Validate(SpellInfo const* /*SpellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_SCARLET_RAVEN_PRIEST_IMAGE_MALE, SPELL_SCARLET_RAVEN_PRIEST_IMAGE_FEMALE }); } @@ -912,7 +912,7 @@ class spell_q5206_test_fetid_skull : public SpellScript return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_CREATE_RESONATING_SKULL, SPELL_CREATE_BONE_DUST }); } @@ -1026,7 +1026,7 @@ class spell_q11396_11399_scourging_crystal_controller : public SpellScript { PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller); - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3, SPELL_SCOURGING_CRYSTAL_CONTROLLER }); } @@ -1051,7 +1051,7 @@ class spell_q11396_11399_scourging_crystal_controller_dummy : public SpellScript { PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy); - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3 }); } @@ -1101,7 +1101,7 @@ class spell_q11587_arcane_prisoner_rescue : public SpellScript { PrepareSpellScript(spell_q11587_arcane_prisoner_rescue); - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo( { @@ -1156,7 +1156,7 @@ class spell_q11730_ultrasonic_screwdriver : public SpellScript return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem(); } - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo( { @@ -1268,7 +1268,7 @@ class spell_q12634_despawn_fruit_tosser : public SpellScript { PrepareSpellScript(spell_q12634_despawn_fruit_tosser); - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo( { @@ -1394,7 +1394,7 @@ class spell_q12937_relief_for_the_fallen : public SpellScript return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_TRIGGER_AID_OF_THE_EARTHEN }); } @@ -1427,7 +1427,7 @@ class spell_q10041_q10040_who_are_they : public SpellScript { PrepareSpellScript(spell_q10041_q10040_who_are_they); - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo( { @@ -1621,7 +1621,7 @@ class spell_q14112_14145_chum_the_water : public SpellScript { PrepareSpellScript(spell_q14112_14145_chum_the_water); - bool Validate(SpellInfo const* /*spellEntry*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo( {