BG BotFill : laisse tactique autour de l objectif + escorte du porteur
1. Laisse : un bot ne se laisse plus entrainer loin de son objectif par un fuyard. Au-dela de 50 m du point a tenir la cible est fortement deprioritisee, sauf le porteur de drapeau qu il faut poursuivre partout. Sans cette regle les defenseurs desertaient leur base des le premier ennemi croise, defaut classique des IA de champ de bataille. 2. Escorte a Chanteguerres : jusqu a trois allies deja proches (60 m) collent le porteur pour intercepter ses poursuivants. L Oeil du cyclone avait deja ce comportement, Chanteguerres laissait le porteur rentrer seul. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -851,6 +851,21 @@ Unit* BotBGAI::SearchEnemy(float range)
|
||||
if (!me->IsWithinLOSInMap(pVisionPlayer))
|
||||
score -= 250.0f;
|
||||
|
||||
// SylvaniaCore (module BG BotFill): laisse tactique. Un bot ne se laisse
|
||||
// pas entrainer loin de son objectif par un fuyard : au-dela de 50 m du
|
||||
// point a tenir, la cible est fortement depriorisee (sauf porteur de
|
||||
// drapeau, qu il faut poursuivre partout). Sans cette regle les defenseurs
|
||||
// desertaient leur base des le premier ennemi croise.
|
||||
if (AIWaypoint* objective = m_Movement->GetTargetWaypoint())
|
||||
{
|
||||
if (!TargetIsFlagCarrier(pVisionPlayer))
|
||||
{
|
||||
Position objPos = objective->GetPosition();
|
||||
if (pVisionPlayer->GetDistance(objPos.GetPositionX(), objPos.GetPositionY(), objPos.GetPositionZ()) > 50.0f)
|
||||
score -= 500.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (!minHealthPlayer || score > bestScore)
|
||||
{
|
||||
bestScore = score;
|
||||
|
||||
@@ -58,6 +58,8 @@ public:
|
||||
~BotBGAIMovement();
|
||||
|
||||
ObjectGuid GetTargetObjectID() { return targetGuid; }
|
||||
// SylvaniaCore (module BG BotFill): objectif de position en cours, pour la laisse
|
||||
AIWaypoint* GetTargetWaypoint() { return pTargetAIWP; }
|
||||
void ClearMovement();
|
||||
void AcceptCommand(AIWaypoint* targetAIWP, bool isFlag = false);
|
||||
void AcceptCommand(ObjectGuid guid, bool isFlag = false);
|
||||
|
||||
@@ -154,9 +154,49 @@ void CommandWS::RndStartCommand()
|
||||
}
|
||||
}
|
||||
|
||||
// SylvaniaCore (module BG BotFill): escorte du porteur. Doctrine PvP : le porteur court,
|
||||
// ses alliers proches le collent pour intercepter ses poursuivants ("peel"). L Oeil du
|
||||
// cyclone avait deja ce comportement, Chanteguerres non : le porteur rentrait seul.
|
||||
void CommandWS::ProcessEscortFlagCarrier()
|
||||
{
|
||||
if (!m_pBattleground)
|
||||
return;
|
||||
BattlegroundWS* pBGWS = dynamic_cast<BattlegroundWS*>(m_pBattleground);
|
||||
if (!pBGWS)
|
||||
return;
|
||||
// notre porteur = celui qui detient le drapeau de l equipe adverse
|
||||
ObjectGuid carrierGuid = pBGWS->GetFlagPickerGUID((m_TeamID == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE);
|
||||
if (carrierGuid.IsEmpty())
|
||||
return;
|
||||
Player* carrier = ObjectAccessor::FindPlayer(carrierGuid);
|
||||
if (!carrier || !carrier->IsAlive() || carrier->GetTeamId() != m_TeamID)
|
||||
return;
|
||||
|
||||
uint32 escortCount = 0;
|
||||
for (PlayerStatus::iterator itGuid = m_PlayerGUIDs.begin(); itGuid != m_PlayerGUIDs.end(); itGuid++)
|
||||
{
|
||||
if (escortCount >= 3) // trois escorteurs suffisent, le reste tient les objectifs
|
||||
break;
|
||||
if (itGuid->first == carrierGuid)
|
||||
continue;
|
||||
Player* escort = GetBGPlayer(itGuid->first);
|
||||
if (!escort || !escort->IsAlive())
|
||||
continue;
|
||||
// seuls les allies deja proches escortent : on ne rappelle pas la defense
|
||||
if (escort->GetDistance(carrier) > 60.0f)
|
||||
continue;
|
||||
if (BotBGAI* pBotAI = GetBotBGAI(itGuid->first))
|
||||
{
|
||||
pBotAI->GetAIMovement()->AcceptCommand(carrierGuid, true);
|
||||
++escortCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CommandWS::ProcessRegulation()
|
||||
{
|
||||
InsureAttackAndDefance(7);
|
||||
ProcessEscortFlagCarrier();
|
||||
ObjectGuid needGuaredTarget = EnemyBGFlagPicker();
|
||||
ObjectGuid needAttackTarget = SelfBGFlagPicker();
|
||||
bool pickedFlagTarget = (needAttackTarget.IsEmpty()) ? true : false;
|
||||
|
||||
@@ -57,6 +57,7 @@ private:
|
||||
void TryPickEnemyFlag(ObjectGuid guid);
|
||||
void TryPickSelfFlag(ObjectGuid guid);
|
||||
void TryCaptureFlag(ObjectGuid guid);
|
||||
void ProcessEscortFlagCarrier(); // SylvaniaCore (module BG BotFill)
|
||||
ObjectGuid SelfBGFlagPicker();
|
||||
ObjectGuid EnemyBGFlagPicker();
|
||||
ObjectGuid GetBGFlagFromSelf();
|
||||
|
||||
Reference in New Issue
Block a user