mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-18 11:48:21 +00:00
[Bots] Change how bots handle blind (#5104)
This commit is contained in:
@@ -3432,6 +3432,10 @@ bool Bot::CheckIfIncapacitated() {
|
||||
}
|
||||
|
||||
if (currently_fleeing) {
|
||||
if (!FindType(SpellEffect::Fear)) { // Blinded
|
||||
return BotProcessBlind();
|
||||
}
|
||||
|
||||
if (RuleB(Combat, EnableFearPathing) && AI_movement_timer->Check()) {
|
||||
// Check if we have reached the last fear point
|
||||
if (DistanceNoZ(glm::vec3(GetX(), GetY(), GetZ()), m_FearWalkTarget) <= 5.0f) {
|
||||
@@ -3453,6 +3457,23 @@ bool Bot::CheckIfIncapacitated() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Bot::BotProcessBlind() {
|
||||
if (m_combat_jitter_timer.Check() && zone->random.Int(1, 100) <= RuleI(Bots, BlindMoveChance)) {
|
||||
Mob* tar = GetTarget() ? GetTarget() : GetBotOwner();
|
||||
|
||||
if (tar) {
|
||||
glm::vec3 Goal = tar->GetPosition();
|
||||
|
||||
RunTo(Goal.x, Goal.y, Goal.z);
|
||||
SetCombatJitter();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Bot::SetBerserkState() {// Berserk updates should occur if primary AI criteria are met
|
||||
if (GetClass() == Class::Warrior || GetClass() == Class::Berserker) {
|
||||
if (!berserk && GetHPRatio() < RuleI(Combat, BerserkerFrenzyStart)) {
|
||||
|
||||
Reference in New Issue
Block a user