Pvp Prohibited Areas

This commit is contained in:
Yunfan Li
2023-10-28 19:22:58 +08:00
parent 917e55c92a
commit a28d096bef
6 changed files with 22 additions and 4 deletions

View File

@@ -158,7 +158,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range)
!attacker->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC) &&
!attacker->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) &&
bot->CanSeeOrDetect(attacker) &&
!(sPlayerbotAIConfig->IsInPvpProhibitedZone(attacker->GetZoneId()) && (attacker->GetGUID().IsPlayer() || attacker->GetGUID().IsPet())) &&
!(sPlayerbotAIConfig->IsPvpProhibited(attacker->GetZoneId(), attacker->GetAreaId()) && (attacker->GetGUID().IsPlayer() || attacker->GetGUID().IsPet())) &&
(!c || (!c->IsInEvadeMode() && ((!isMemberBotGroup && botAI->HasStrategy("attack tagged", BOT_STATE_NON_COMBAT)) ||
leaderHasThreat || (!c->hasLootRecipient() && (!c->GetVictim() || (c->GetVictim() && ((!c->GetVictim()->IsPlayer() || bot->IsInSameGroupWith(c->GetVictim()->ToPlayer())) ||
(botAI->GetMaster() && c->GetVictim() == botAI->GetMaster()))))) || c->isTappedBy(bot))));