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

(cherry picked from commit be11f42a16)
This commit is contained in:
Jeremy
2024-03-28 19:29:22 +01:00
committed by funjoker
parent aefa15ece7
commit d0d5d309bb
78 changed files with 6821 additions and 7805 deletions

View File

@@ -1592,18 +1592,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;
@@ -2968,11 +2957,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);