mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Battlegrounds: Better log message for unhandled area triggers in battlegrounds
This commit is contained in:
@@ -1937,3 +1937,11 @@ void Battleground::RewardXPAtKill(Player* killer, Player* victim)
|
||||
if (sWorld->getBoolConfig(CONFIG_BG_XP_FOR_KILL) && killer && victim)
|
||||
killer->RewardPlayerAndGroupAtKill(victim, true);
|
||||
}
|
||||
|
||||
void Battleground::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger %u in Battleground %u. Player coords (x: %f, y: %f, z: %f)",
|
||||
trigger, player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
if (player->isGameMaster())
|
||||
player->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", trigger);
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@ class Battleground
|
||||
|
||||
// Triggers handle
|
||||
// must be implemented in BG subclass
|
||||
virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {}
|
||||
virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/);
|
||||
// must be implemented in BG subclass if need AND call base class generic code
|
||||
virtual void HandleKillPlayer(Player* player, Player* killer);
|
||||
virtual void HandleKillUnit(Creature* /*unit*/, Player* /*killer*/);
|
||||
|
||||
@@ -210,24 +210,24 @@ void BattlegroundAB::RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*
|
||||
|
||||
}
|
||||
|
||||
void BattlegroundAB::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
void BattlegroundAB::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
switch (Trigger)
|
||||
switch (trigger)
|
||||
{
|
||||
case 3948: // Arathi Basin Alliance Exit.
|
||||
if (Source->GetTeam() != ALLIANCE)
|
||||
Source->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
|
||||
if (player->GetTeam() != ALLIANCE)
|
||||
player->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
|
||||
else
|
||||
Source->LeaveBattleground();
|
||||
player->LeaveBattleground();
|
||||
break;
|
||||
case 3949: // Arathi Basin Horde Exit.
|
||||
if (Source->GetTeam() != HORDE)
|
||||
Source->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
|
||||
if (player->GetTeam() != HORDE)
|
||||
player->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
|
||||
else
|
||||
Source->LeaveBattleground();
|
||||
player->LeaveBattleground();
|
||||
break;
|
||||
case 3866: // Stables
|
||||
case 3869: // Gold Mine
|
||||
@@ -238,8 +238,7 @@ void BattlegroundAB::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
case 4021: // Unk2
|
||||
//break;
|
||||
default:
|
||||
//sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
//Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Battleground::HandleAreaTrigger(player, trigger);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,27 +489,25 @@ void BattlegroundAV::RemovePlayer(Player* player, uint64 /*guid*/, uint32 /*team
|
||||
player->RemoveAurasDueToSpell(AV_BUFF_H_CAPTAIN);
|
||||
}
|
||||
|
||||
void BattlegroundAV::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
void BattlegroundAV::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
uint32 SpellId = 0;
|
||||
switch (Trigger)
|
||||
switch (trigger)
|
||||
{
|
||||
case 95:
|
||||
case 2608:
|
||||
if (Source->GetTeam() != ALLIANCE)
|
||||
Source->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
|
||||
if (player->GetTeam() != ALLIANCE)
|
||||
player->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
|
||||
else
|
||||
Source->LeaveBattleground();
|
||||
player->LeaveBattleground();
|
||||
break;
|
||||
case 2606:
|
||||
if (Source->GetTeam() != HORDE)
|
||||
Source->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
|
||||
if (player->GetTeam() != HORDE)
|
||||
player->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
|
||||
else
|
||||
Source->LeaveBattleground();
|
||||
player->LeaveBattleground();
|
||||
break;
|
||||
case 3326:
|
||||
case 3327:
|
||||
@@ -520,13 +518,9 @@ void BattlegroundAV::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
//Source->Unmount();
|
||||
break;
|
||||
default:
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
// Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Battleground::HandleAreaTrigger(player, trigger);
|
||||
break;
|
||||
}
|
||||
|
||||
if (SpellId)
|
||||
Source->CastSpell(Source, SpellId, true);
|
||||
}
|
||||
|
||||
void BattlegroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
|
||||
@@ -105,30 +105,20 @@ bool BattlegroundBE::HandlePlayerUnderMap(Player* player)
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattlegroundBE::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
void BattlegroundBE::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
//uint32 SpellId = 0;
|
||||
//uint64 buff_guid = 0;
|
||||
switch (Trigger)
|
||||
switch (trigger)
|
||||
{
|
||||
case 4538: // buff trigger?
|
||||
//buff_guid = BgObjects[BG_BE_OBJECT_BUFF_1];
|
||||
break;
|
||||
case 4539: // buff trigger?
|
||||
//buff_guid = BgObjects[BG_BE_OBJECT_BUFF_2];
|
||||
break;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Battleground::HandleAreaTrigger(player, trigger);
|
||||
break;
|
||||
}
|
||||
|
||||
//if (buff_guid)
|
||||
// HandleTriggerBuff(buff_guid, Source);
|
||||
}
|
||||
|
||||
void BattlegroundBE::FillInitialWorldStates(WorldPacket &data)
|
||||
|
||||
@@ -181,18 +181,18 @@ void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer)
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
void BattlegroundDS::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
void BattlegroundDS::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
switch (Trigger)
|
||||
switch (trigger)
|
||||
{
|
||||
case 5347:
|
||||
case 5348:
|
||||
// Remove effects of Demonic Circle Summon
|
||||
if (Source->HasAura(48018))
|
||||
Source->RemoveAurasDueToSpell(48018);
|
||||
if (player->HasAura(48018))
|
||||
player->RemoveAurasDueToSpell(48018);
|
||||
|
||||
// Someone has get back into the pipes and the knockback has already been performed,
|
||||
// so we reset the knockback count for kicking the player again into the arena.
|
||||
@@ -200,8 +200,7 @@ void BattlegroundDS::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
setPipeKnockBackCount(0);
|
||||
break;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Battleground::HandleAreaTrigger(player, trigger);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,35 +368,35 @@ void BattlegroundEY::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundEY::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
void BattlegroundEY::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
if (!Source->isAlive()) //hack code, must be removed later
|
||||
if (!player->isAlive()) //hack code, must be removed later
|
||||
return;
|
||||
|
||||
switch (Trigger)
|
||||
switch (trigger)
|
||||
{
|
||||
case TR_BLOOD_ELF_POINT:
|
||||
if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_BLOOD_ELF);
|
||||
if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == player->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
|
||||
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_BLOOD_ELF);
|
||||
break;
|
||||
case TR_FEL_REAVER_POINT:
|
||||
if (m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REAVER] == Source->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_FEL_REAVER);
|
||||
if (m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REAVER] == player->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
|
||||
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_FEL_REAVER);
|
||||
break;
|
||||
case TR_MAGE_TOWER_POINT:
|
||||
if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_MAGE_TOWER);
|
||||
if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == player->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
|
||||
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_MAGE_TOWER);
|
||||
break;
|
||||
case TR_DRAENEI_RUINS_POINT:
|
||||
if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_DRAENEI_RUINS);
|
||||
if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == player->GetTeam())
|
||||
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
|
||||
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_DRAENEI_RUINS);
|
||||
break;
|
||||
case 4512:
|
||||
case 4515:
|
||||
@@ -411,8 +411,7 @@ void BattlegroundEY::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
case 5866:
|
||||
break;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Battleground::HandleAreaTrigger(player, trigger);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,26 +102,20 @@ bool BattlegroundNA::HandlePlayerUnderMap(Player* player)
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattlegroundNA::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
void BattlegroundNA::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
//uint32 SpellId = 0;
|
||||
//uint64 buff_guid = 0;
|
||||
switch (Trigger)
|
||||
switch (trigger)
|
||||
{
|
||||
case 4536: // buff trigger?
|
||||
case 4537: // buff trigger?
|
||||
break;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Battleground::HandleAreaTrigger(player, trigger);
|
||||
break;
|
||||
}
|
||||
|
||||
//if (buff_guid)
|
||||
// HandleTriggerBuff(buff_guid, Source);
|
||||
}
|
||||
|
||||
void BattlegroundNA::FillInitialWorldStates(WorldPacket &data)
|
||||
|
||||
@@ -102,27 +102,20 @@ bool BattlegroundRL::HandlePlayerUnderMap(Player* player)
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattlegroundRL::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
void BattlegroundRL::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
//uint32 SpellId = 0;
|
||||
//uint64 buff_guid = 0;
|
||||
switch (Trigger)
|
||||
switch (trigger)
|
||||
{
|
||||
case 4696: // buff trigger?
|
||||
case 4697: // buff trigger?
|
||||
break;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Battleground::HandleAreaTrigger(player, trigger);
|
||||
break;
|
||||
}
|
||||
|
||||
//if (buff_guid)
|
||||
// HandleTriggerBuff(buff_guid, Source);
|
||||
}
|
||||
|
||||
void BattlegroundRL::FillInitialWorldStates(WorldPacket &data)
|
||||
|
||||
@@ -148,12 +148,12 @@ bool BattlegroundRV::HandlePlayerUnderMap(Player* player)
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattlegroundRV::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
void BattlegroundRV::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
switch (Trigger)
|
||||
switch (trigger)
|
||||
{
|
||||
case 5224:
|
||||
case 5226:
|
||||
@@ -162,8 +162,7 @@ void BattlegroundRV::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
case 5474:
|
||||
break;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Battleground::HandleAreaTrigger(player, trigger);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -247,4 +246,4 @@ void BattlegroundRV::TogglePillarCollision()
|
||||
}
|
||||
|
||||
SetPillarCollision(!apply);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,15 +595,14 @@ void BattlegroundWS::UpdateTeamScore(uint32 team)
|
||||
UpdateWorldState(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(team));
|
||||
}
|
||||
|
||||
void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
void BattlegroundWS::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
//uint32 SpellId = 0;
|
||||
//uint64 buff_guid = 0;
|
||||
switch (Trigger)
|
||||
switch (trigger)
|
||||
{
|
||||
case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
|
||||
//buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_1];
|
||||
@@ -625,13 +624,13 @@ void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
break;
|
||||
case 3646: // Alliance Flag spawn
|
||||
if (_flagState[BG_TEAM_HORDE] && !_flagState[BG_TEAM_ALLIANCE])
|
||||
if (GetFlagPickerGUID(BG_TEAM_HORDE) == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source);
|
||||
if (GetFlagPickerGUID(BG_TEAM_HORDE) == player->GetGUID())
|
||||
EventPlayerCapturedFlag(player);
|
||||
break;
|
||||
case 3647: // Horde Flag spawn
|
||||
if (_flagState[BG_TEAM_ALLIANCE] && !_flagState[BG_TEAM_HORDE])
|
||||
if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == Source->GetGUID())
|
||||
EventPlayerCapturedFlag(Source);
|
||||
if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == player->GetGUID())
|
||||
EventPlayerCapturedFlag(player);
|
||||
break;
|
||||
case 3649: // unk1
|
||||
case 3688: // unk2
|
||||
@@ -639,8 +638,7 @@ void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
|
||||
case 4629: // unk4
|
||||
break;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Battleground::HandleAreaTrigger(player, trigger);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user