BG BotFill : vague de sortie de cimetiere apres resurrection
Doctrine PvP : repartir seul de son cimetiere revient a nourrir l adversaire un par un. Les bots ressuscites repartaient isolement et se faisaient cueillir en chemin. Un bot patiente desormais au cimetiere jusqu a ce que trois allies soient a portee, au maximum huit secondes. Il repart immediatement s il est attaque, si un ennemi pousse jusqu au cimetiere, ou s il porte un drapeau. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -351,8 +351,66 @@ bool BotBGAI::InBattleground()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SylvaniaCore (module BG BotFill): apres une resurrection, le bot patiente au cimetiere
|
||||||
|
// le temps qu une vague se forme (doctrine PvP : repartir en goutte-a-goutte revient a
|
||||||
|
// nourrir l adversaire). Il repart des que trois allies sont a portee, ou au bout de
|
||||||
|
// huit secondes, et immediatement si un ennemi vient jusqu au cimetiere.
|
||||||
|
bool BotBGAI::WaitRegroupAfterRevive()
|
||||||
|
{
|
||||||
|
if (!m_DeathTick)
|
||||||
|
return false;
|
||||||
|
if (me->InArena())
|
||||||
|
{
|
||||||
|
m_DeathTick = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// porteur de drapeau ou bot en peril : aucune attente
|
||||||
|
if (me->IsInCombat() || (me->IsPlayer() && TargetIsFlagCarrier(me->ToPlayer())))
|
||||||
|
{
|
||||||
|
m_DeathTick = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!m_ReviveTick)
|
||||||
|
m_ReviveTick = getMSTime();
|
||||||
|
if (GetMSTimeDiffToNow(m_ReviveTick) >= 8000)
|
||||||
|
{
|
||||||
|
m_DeathTick = 0;
|
||||||
|
m_ReviveTick = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
uint32 nearAllies = 0;
|
||||||
|
NearPlayerList playersNearby;
|
||||||
|
QueryNearPlayerList(30.0f, playersNearby);
|
||||||
|
for (Player* pVisionPlayer : playersNearby)
|
||||||
|
{
|
||||||
|
if (!pVisionPlayer || pVisionPlayer == me || !pVisionPlayer->IsAlive())
|
||||||
|
continue;
|
||||||
|
if (pVisionPlayer->GetTeamId() == me->GetTeamId())
|
||||||
|
++nearAllies;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// un ennemi pousse jusqu au cimetiere : on ne reste pas passif
|
||||||
|
m_DeathTick = 0;
|
||||||
|
m_ReviveTick = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nearAllies >= 3)
|
||||||
|
{
|
||||||
|
m_DeathTick = 0;
|
||||||
|
m_ReviveTick = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
m_Movement->ClearMovement();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void BotBGAI::BattlegroundRevive()
|
void BotBGAI::BattlegroundRevive()
|
||||||
{
|
{
|
||||||
|
// SylvaniaCore (module BG BotFill): on note l instant de la mort pour imposer un
|
||||||
|
// temps de regroupement au cimetiere (cf. WaitRegroupAfterRevive).
|
||||||
|
if (!m_DeathTick)
|
||||||
|
m_DeathTick = getMSTime();
|
||||||
if (me->InArena())
|
if (me->InArena())
|
||||||
return;
|
return;
|
||||||
if (!me->IsPlayerBot() || !me->InBattleground())
|
if (!me->IsPlayerBot() || !me->InBattleground())
|
||||||
@@ -499,6 +557,8 @@ void BotBGAI::UpdateAI(uint32 diff)
|
|||||||
packet.SpellID = BattlegroundSpells::SPELL_WAITING_FOR_RESURRECT;
|
packet.SpellID = BattlegroundSpells::SPELL_WAITING_FOR_RESURRECT;
|
||||||
me->GetSession()->HandleCancelAuraOpcode(packet);
|
me->GetSession()->HandleCancelAuraOpcode(packet);
|
||||||
}
|
}
|
||||||
|
if (WaitRegroupAfterRevive())
|
||||||
|
return;
|
||||||
if (m_Teleporting.CanMovement())
|
if (m_Teleporting.CanMovement())
|
||||||
UpdateBotAI(BOTAI_UPDATE_TICK);
|
UpdateBotAI(BOTAI_UPDATE_TICK);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -117,6 +117,10 @@ protected:
|
|||||||
uint32 FindPetMaxRankSpellByExist(uint32 spellID);
|
uint32 FindPetMaxRankSpellByExist(uint32 spellID);
|
||||||
bool InBattleground();
|
bool InBattleground();
|
||||||
void BattlegroundRevive();
|
void BattlegroundRevive();
|
||||||
|
// SylvaniaCore (module BG BotFill): vague de sortie de cimetiere
|
||||||
|
bool WaitRegroupAfterRevive();
|
||||||
|
uint32 m_DeathTick = 0;
|
||||||
|
uint32 m_ReviveTick = 0;
|
||||||
void ProcessHealth();
|
void ProcessHealth();
|
||||||
void ProcessCombat(Unit* pTarget);
|
void ProcessCombat(Unit* pTarget);
|
||||||
void ChaseTarget(Unit* pTarget, bool isMelee, float range = 5.0f);
|
void ChaseTarget(Unit* pTarget, bool isMelee, float range = 5.0f);
|
||||||
|
|||||||
Reference in New Issue
Block a user