mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11: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
18
zone/bot.cpp
18
zone/bot.cpp
@ -2746,11 +2746,26 @@ bool Bot::TryAutoDefend(Client* bot_owner, float leash_distance) {
|
|||||||
|
|
||||||
bool Bot::TryMeditate() {
|
bool Bot::TryMeditate() {
|
||||||
if (!IsMoving() && !spellend_timer.Enabled()) {
|
if (!IsMoving() && !spellend_timer.Enabled()) {
|
||||||
if (IsEngaged() && HasOrMayGetAggro(IsSitting())) {
|
if (IsEngaged()) {
|
||||||
|
if (HasOrMayGetAggro(IsSitting())) {
|
||||||
if (IsSitting()) {
|
if (IsSitting()) {
|
||||||
Stand();
|
Stand();
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
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());
|
BotMeditate(IsSitting());
|
||||||
@ -2758,6 +2773,7 @@ bool Bot::TryMeditate() {
|
|||||||
if (!(GetPlayerState() & static_cast<uint32>(PlayerState::Aggressive))) {
|
if (!(GetPlayerState() & static_cast<uint32>(PlayerState::Aggressive))) {
|
||||||
SendAddPlayerState(PlayerState::Aggressive);
|
SendAddPlayerState(PlayerState::Aggressive);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user