Skip to content

Commit

Permalink
add attackAuto_notWhile for slaves (#3789)
Browse files Browse the repository at this point in the history
Co-authored-by: ya4ept <ya4ept@ya.ru>
  • Loading branch information
Henrybk and ya4ept authored Dec 16, 2024
1 parent 4c7e5cf commit 388d0e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions control/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ mercenary_attackAuto 2
mercenary_attackAuto_party 1
mercenary_attackAuto_notInTown 1
mercenary_attackAuto_inLockOnly 1
mercenary_attackAuto_notWhile_storageAuto 1
mercenary_attackAuto_notWhile_buyAuto 1
mercenary_attackAuto_notWhile_sellAuto 1
mercenary_attackAuto_considerDamagedAggressive 0
mercenary_attackBeyondMaxDistance_waitForAgressive 1
mercenary_attackAuto_onlyWhenSafe 0
Expand Down Expand Up @@ -442,6 +445,9 @@ homunculus_attackAuto 2
homunculus_attackAuto_party 1
homunculus_attackAuto_notInTown 1
homunculus_attackAuto_inLockOnly 1
homunculus_attackAuto_notWhile_storageAuto 1
homunculus_attackAuto_notWhile_buyAuto 1
homunculus_attackAuto_notWhile_sellAuto 1
homunculus_attackAuto_considerDamagedAggressive 0
homunculus_attackBeyondMaxDistance_waitForAgressive 1
homunculus_attackAuto_onlyWhenSafe 0
Expand Down
3 changes: 3 additions & 0 deletions src/AI/Slave.pm
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ sub processAutoAttack {
&& ((AI::action ne "move" && AI::action ne "route") || blockDistance($char->{pos_to}, $slave->{pos_to}) <= $config{$slave->{configPrefix}.'followDistanceMax'})
&& (!$config{$slave->{configPrefix}.'attackAuto_notInTown'} || !$field->isCity)
&& ($config{$slave->{configPrefix}.'attackAuto_inLockOnly'} <= 1 || $field->baseName eq $config{'lockMap'})
&& (!$config{$slave->{configPrefix}.'attackAuto_notWhile_storageAuto'} || !AI::inQueue("storageAuto"))
&& (!$config{$slave->{configPrefix}.'attackAuto_notWhile_buyAuto'} || !AI::inQueue("buyAuto"))
&& (!$config{$slave->{configPrefix}.'attackAuto_notWhile_sellAuto'} || !AI::inQueue("sellAuto"))
) {

# If we're in tanking mode, only attack something if the person we're tanking for is on screen.
Expand Down

0 comments on commit 388d0e0

Please sign in to comment.