Aggresive water elemental

This commit is contained in:
Yunfan Li
2024-08-14 18:28:14 +08:00
parent 2ddaae9ef0
commit 2a5b7dcb61
4 changed files with 33 additions and 3 deletions

View File

@@ -5742,3 +5742,28 @@ uint32 PlayerbotAI::GetReactDelay()
return base * multiplier;
}
void PlayerbotAI::PetFollow()
{
Pet* pet = bot->GetPet();
if (!pet)
return;
pet->AttackStop();
pet->InterruptNonMeleeSpells(false);
pet->ClearInPetCombat();
pet->GetMotionMaster()->MoveFollow(bot, PET_FOLLOW_DIST, pet->GetFollowAngle());
if (pet->ToPet())
pet->ToPet()->ClearCastWhenWillAvailable();
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
return;
charmInfo->SetCommandState(COMMAND_FOLLOW);
charmInfo->SetIsCommandAttack(false);
charmInfo->SetIsAtStay(false);
charmInfo->SetIsReturning(true);
charmInfo->SetIsCommandFollow(true);
charmInfo->SetIsFollowing(false);
charmInfo->RemoveStayPosition();
charmInfo->SetForcedSpell(0);
charmInfo->SetForcedTargetGUID();
}

View File

@@ -560,6 +560,8 @@ public:
std::vector<const Quest*> GetCurrentIncompleteQuests();
std::set<uint32> GetAllCurrentQuestIds();
std::set<uint32> GetCurrentIncompleteQuestIds();
void PetFollow();
private:
static void _fillGearScoreData(Player* player, Item* item, std::vector<uint32>* gearScore, uint32& twoHandScore, bool mixed = false);
bool IsTellAllowed(PlayerbotSecurityLevel securityLevel = PLAYERBOT_SECURITY_ALLOW_ALL);

View File

@@ -62,6 +62,11 @@ bool FollowChatShortcutAction::Execute(Event event)
true, priority);
}
if (Pet* pet = bot->GetPet())
{
botAI->PetFollow();
}
if (moved)
{
botAI->TellMaster("Following");

View File

@@ -79,9 +79,7 @@ bool SummonAction::Execute(Event event)
if (Pet* pet = bot->GetPet())
{
pet->SetReactState(REACT_PASSIVE);
pet->GetCharmInfo()->SetIsCommandFollow(true);
pet->GetCharmInfo()->IsReturning();
botAI->PetFollow();
}
if (master->GetSession()->GetSecurity() >= SEC_PLAYER)