diff options
| author | Jeremy <Golrag@users.noreply.github.com> | 2024-03-28 19:29:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-28 19:29:22 +0100 |
| commit | be11f42a16d1fa0482e9572bf54e99e4dedd3c78 (patch) | |
| tree | 3d33413d7ed5cada34d7ced7f430380731160d5b /src/server/game/Spells | |
| parent | 78635f640ee3b632a487a50dcf492ae62c2a0933 (diff) | |
Core/Battlegrounds: Move to scripts (#29799)
* Introduce new BattlegroundScript class for map/bg specific scripts
* Remove all sub, zone specific, battleground classes except Arena
* Move all bg zone scripts to new BattlegroundScripts class in script folder
* Remove ZoneScript from Battleground class
* Remove some unused hooks from Battleground
Diffstat (limited to 'src/server/game/Spells')
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 7 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 18 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 6 |
3 files changed, 2 insertions, 29 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 084513041c5..9dc69616fe6 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3317,12 +3317,7 @@ void AuraEffect::HandleAuraModEffectImmunity(AuraApplication const* aurApp, uint Player* player = target->ToPlayer(); if (!apply && player && GetSpellInfo()->HasAuraInterruptFlag(SpellAuraInterruptFlags::StealthOrInvis)) { - if (player->InBattleground()) - { - if (Battleground* bg = player->GetBattleground()) - bg->EventPlayerDroppedFlag(player); - } - else + if (!player->InBattleground()) sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id); } } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8c694c29f89..0988d80df64 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1580,18 +1580,7 @@ void Spell::EffectOpenLock() if (goInfo->GetNoDamageImmune() && player->HasUnitFlag(UNIT_FLAG_IMMUNE)) return; - if (goInfo->type == GAMEOBJECT_TYPE_FLAGSTAND) - { - //CanUseBattlegroundObject() already called in CheckCast() - // in battleground check - if (Battleground* bg = player->GetBattleground()) - { - if (bg->GetTypeID() == BATTLEGROUND_EY) - bg->EventPlayerClickedOnFlag(player, gameObjTarget); - return; - } - } - else if (m_spellInfo->Id == 1842 && gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_TRAP && gameObjTarget->GetOwner()) + if (m_spellInfo->Id == 1842 && gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_TRAP && gameObjTarget->GetOwner()) { gameObjTarget->SetLootState(GO_JUST_DEACTIVATED); return; @@ -2956,11 +2945,6 @@ void Spell::EffectSummonObjectWild() // Wild object not have owner and check clickable by players map->AddToMap(go); - if (go->GetGoType() == GAMEOBJECT_TYPE_FLAGDROP) - if (Player* player = m_caster->ToPlayer()) - if (Battleground* bg = player->GetBattleground()) - bg->SetDroppedFlagGUID(go->GetGUID(), bg->GetPlayerTeam(player->GetGUID()) == ALLIANCE ? TEAM_HORDE: TEAM_ALLIANCE); - if (GameObject* linkedTrap = go->GetLinkedTrap()) { PhasingHandler::InheritPhaseShift(linkedTrap , m_caster); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index e7673939f7c..f90b1a2ff5d 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -743,12 +743,6 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 if (!player || (auraSpell > 0 && !player->HasAura(auraSpell)) || (auraSpell < 0 && player->HasAura(-auraSpell))) return false; - if (player) - { - if (Battleground* bg = player->GetBattleground()) - return bg->IsSpellAllowed(spellId, player); - } - // Extra conditions switch (spellId) { |
