Code: Select all
if (
!($accountID eq $targetID ? $attackTarget->{dmgToYou} : $attackTarget->{dmgToPlayer}{$targetID})
&& !($accountID eq $targetID ? $attackTarget->{dmgToYou} : $attackTarget->{dmgFromPlayer}{$targetID})
&& distance($monster->{pos_to}, calcPosition($player)) <= $attackSeq->{attackMethod}{distance}
) {
my situation is like this , i want to attack Gullinbursti, it has 5 savage slave.
but if savage attack my bot first, it will change target to savage. no, i don't want it to change target, because Gullinbursti only few steps left.( i have set Gullinbursti in priority.txt )
so i do not want attackChangeTarget work if my main target distance is less than 5.
how to check distance to main target?