mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-16 02:10:28 +00:00
Run clang-format
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "ReleaseSpiritAction.h"
|
||||
|
||||
#include "Event.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "ObjectDefines.h"
|
||||
@@ -39,7 +41,8 @@ bool ReleaseSpiritAction::Execute(Event event)
|
||||
context->GetValue<uint32>("death count")->Set(dCount + 1);
|
||||
}
|
||||
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}> released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}> released", bot->GetGUID().ToString().c_str(),
|
||||
bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
WorldPacket packet(CMSG_REPOP_REQUEST);
|
||||
packet << uint8(0);
|
||||
@@ -72,13 +75,13 @@ bool ReleaseSpiritAction::Execute(Event event)
|
||||
// bot->GetSession()->HandleGossipHelloOpcode(packet);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AutoReleaseSpiritAction::Execute(Event event)
|
||||
{
|
||||
//Death Count to prevent skeleton piles
|
||||
// Death Count to prevent skeleton piles
|
||||
Player* master = GetMaster();
|
||||
if (!master || (master && GET_PLAYERBOT_AI(master)))
|
||||
{
|
||||
@@ -86,13 +89,15 @@ bool AutoReleaseSpiritAction::Execute(Event event)
|
||||
context->GetValue<uint32>("death count")->Set(dCount + 1);
|
||||
}
|
||||
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> auto released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> auto released", bot->GetGUID().ToString().c_str(),
|
||||
bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
WorldPacket packet(CMSG_REPOP_REQUEST);
|
||||
packet << uint8(0);
|
||||
bot->GetSession()->HandleRepopRequestOpcode(packet);
|
||||
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> releases spirit", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> releases spirit", bot->GetGUID().ToString().c_str(),
|
||||
bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
if (bot->InBattleground() && (time(NULL) - bg_gossip_time >= 15 || !bot->HasAura(SPELL_WAITING_FOR_RESURRECT)))
|
||||
{
|
||||
@@ -108,12 +113,16 @@ bool AutoReleaseSpiritAction::Execute(Event event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!guid) {
|
||||
if (!guid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (bot->GetDistance(unit) >= INTERACTION_DISTANCE) {
|
||||
if (bot->GetDistance(unit) >= INTERACTION_DISTANCE)
|
||||
{
|
||||
bot->GetMotionMaster()->MoveChase(unit);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
bg_gossip_time = time(NULL);
|
||||
WorldPacket packet(CMSG_GOSSIP_HELLO);
|
||||
packet << guid;
|
||||
@@ -150,13 +159,15 @@ bool AutoReleaseSpiritAction::isUseful()
|
||||
if (!botAI->HasActivePlayerMaster())
|
||||
return true;
|
||||
|
||||
if (botAI->HasActivePlayerMaster() && botAI->GetGroupMaster()->GetMapId() == bot->GetMapId() && bot->GetMap() && (bot->GetMap()->IsRaid() || bot->GetMap()->IsDungeon()))
|
||||
if (botAI->HasActivePlayerMaster() && botAI->GetGroupMaster()->GetMapId() == bot->GetMapId() && bot->GetMap() &&
|
||||
(bot->GetMap()->IsRaid() || bot->GetMap()->IsDungeon()))
|
||||
return false;
|
||||
|
||||
if (botAI->GetGroupMaster()->isDead())
|
||||
return true;
|
||||
|
||||
if (sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "master target"), sPlayerbotAIConfig->sightDistance))
|
||||
if (sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "master target"),
|
||||
sPlayerbotAIConfig->sightDistance))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -164,7 +175,8 @@ bool AutoReleaseSpiritAction::isUseful()
|
||||
|
||||
bool RepopAction::Execute(Event event)
|
||||
{
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> repops at graveyard", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> repops at graveyard", bot->GetGUID().ToString().c_str(),
|
||||
bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
int64 deadTime;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user