mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Bots] Prevent medding in combat if any mob has bot targeted (#4707)
- Previously this only checked the bots target to med. It will now check the hatelist of the bot to ensure no mobs have the bot targeted before medding.
This commit is contained in:
parent
878a5377ae
commit
21b7b6e7ab
24
zone/bot.cpp
24
zone/bot.cpp
@ -2746,11 +2746,26 @@ bool Bot::TryAutoDefend(Client* bot_owner, float leash_distance) {
|
||||
|
||||
bool Bot::TryMeditate() {
|
||||
if (!IsMoving() && !spellend_timer.Enabled()) {
|
||||
if (IsEngaged() && HasOrMayGetAggro(IsSitting())) {
|
||||
if (IsSitting()) {
|
||||
Stand();
|
||||
if (IsEngaged()) {
|
||||
if (HasOrMayGetAggro(IsSitting())) {
|
||||
if (IsSitting()) {
|
||||
Stand();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto mob : hate_list.GetHateList()) {
|
||||
auto tar = mob->entity_on_hatelist;
|
||||
|
||||
if (tar) {
|
||||
Mob* tar_target = tar->GetTarget();
|
||||
|
||||
if (tar_target && tar_target == this) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BotMeditate(IsSitting());
|
||||
@ -2758,6 +2773,7 @@ bool Bot::TryMeditate() {
|
||||
if (!(GetPlayerState() & static_cast<uint32>(PlayerState::Aggressive))) {
|
||||
SendAddPlayerState(PlayerState::Aggressive);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -13193,4 +13209,4 @@ bool Bot::IsValidBotStance(uint8 stance) {
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user