mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-26 11:27:17 +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:
+19
-3
@@ -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 (IsSitting()) {
|
if (HasOrMayGetAggro(IsSitting())) {
|
||||||
Stand();
|
if (IsSitting()) {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user