diff --git a/control/config.txt b/control/config.txt index 01df9be939..5f15696eb7 100644 --- a/control/config.txt +++ b/control/config.txt @@ -434,8 +434,8 @@ mercenary_followDistanceMax 12 mercenary_followDistanceMin 3 mercenary_moveNearWhenIdle 1 -mercenary_moveNearWhenIdle_minDistance 2 -mercenary_moveNearWhenIdle_maxDistance 12 +mercenary_moveNearWhenIdle_minDistance 3 +mercenary_moveNearWhenIdle_maxDistance 8 mercenary_idleWalkType 1 @@ -503,8 +503,8 @@ homunculus_followDistanceMax 12 homunculus_followDistanceMin 3 homunculus_moveNearWhenIdle 1 -homunculus_moveNearWhenIdle_minDistance 2 -homunculus_moveNearWhenIdle_maxDistance 12 +homunculus_moveNearWhenIdle_minDistance 3 +homunculus_moveNearWhenIdle_maxDistance 8 homunculus_idleWalkType 1 diff --git a/src/AI/Attack.pm b/src/AI/Attack.pm index 1278fd68fc..f2c1f0e38c 100644 --- a/src/AI/Attack.pm +++ b/src/AI/Attack.pm @@ -146,7 +146,7 @@ sub process { $args->{monsterLastMovePosTo}{y} = $target->{pos_to}{y}; } else { # Monster has moved; stop moving and let the attack AI readjust route - warning "Target $target has moved since we started routing to it - Adjusting route\n", "ai_attack"; + debug "Target $target has moved since we started routing to it - Adjusting route\n", "ai_attack"; AI::dequeue while (AI::is("move", "route")); $ataqArgs->{ai_attack_giveup}{time} = time; @@ -540,7 +540,7 @@ sub main { debug TF("[Out of Range - Still Approaching - Waiting] %s (%d %d), target %s (%d %d), distance %d, maxDistance %d, dmgFromYou %d.\n", $char, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}, $target->{dmgFromYou}), 'ai_attack'; return; } else { - warning TF("[Out of Range - Ended Approaching] %s (%d %d), target %s (%d %d), distance %d, maxDistance %d, dmgFromYou %d.\n", $char, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}, $target->{dmgFromYou}), 'ai_attack'; + debug TF("[Out of Range - Ended Approaching] %s (%d %d), target %s (%d %d), distance %d, maxDistance %d, dmgFromYou %d.\n", $char, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}, $target->{dmgFromYou}), 'ai_attack'; $args->{sentApproach} = 0; } } @@ -588,21 +588,21 @@ sub main { $args->{ai_attack_failed_give_up}{time} = time if !$args->{ai_attack_failed_give_up}{time}; if (timeOut($args->{ai_attack_failed_give_up})) { delete $args->{ai_attack_failed_give_up}{time}; - warning T("Unable to determine a attackMethod (check attackUseWeapon and Skills blocks)\n"), "ai_attack"; + warning T("Unable to determine a attackMethod (check attackUseWeapon and Skills blocks), dropping target.\n"), "ai_attack"; $found_action = 1; giveUp($args, $ID, 0); } } if ($canAttack == 0 && $youHitTarget) { - warning TF("[$canAttack_fail_string - $range_type_string] We were able to hit target even though it is out of range or LOS, accepting and continuing. (you %s (%d %d), target %s (%d %d) [(%d %d) -> (%d %d)], distance %d, maxDistance %d, dmgFromYou %d)\n", $char, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $target->{pos}{x}, $target->{pos}{y}, $target->{pos_to}{x}, $target->{pos_to}{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}, $target->{dmgFromYou}), 'ai_attack'; + debug TF("[$canAttack_fail_string - $range_type_string] We were able to hit target even though it is out of range or LOS, accepting and continuing. (you %s (%d %d), target %s (%d %d) [(%d %d) -> (%d %d)], distance %d, maxDistance %d, dmgFromYou %d)\n", $char, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $target->{pos}{x}, $target->{pos}{y}, $target->{pos_to}{x}, $target->{pos_to}{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}, $target->{dmgFromYou}), 'ai_attack'; if ($clientDist > $args->{attackMethod}{maxDistance} && $clientDist <= ($args->{attackMethod}{maxDistance} + 1) && $args->{temporary_extra_range} == 0) { - warning TF("[$canAttack_fail_string] Probably extra range provided by the server due to chasing, increasing range by 1.\n"), 'ai_attack'; + debug TF("[$canAttack_fail_string] Probably extra range provided by the server due to chasing, increasing range by 1.\n"), 'ai_attack'; $args->{temporary_extra_range} = 1; $args->{attackMethod}{maxDistance} += $args->{temporary_extra_range}; $canAttack = canAttack($field, $realMyPos, $realMonsterPos, $config{attackCanSnipe}, $args->{attackMethod}{maxDistance}, $config{clientSight}); } else { - warning TF("[$canAttack_fail_string] Reason unknown, allowing once.\n"), 'ai_attack'; + debug TF("[$canAttack_fail_string] Reason unknown, allowing once.\n"), 'ai_attack'; $hitTarget_when_not_possible = 1; } if ( @@ -633,7 +633,7 @@ sub main { giveUp($args, $ID, 0); } else { $messageSender->sendAction($ID, ($config{'tankMode'}) ? 0 : 7) if ($config{"attackBeyondMaxDistance_sendAttackWhileWaiting"}); - warning TF("[$canAttack_fail_string - $range_type_string - Waiting] %s (%d %d), target %s (%d %d) [(%d %d) -> (%d %d)], distance %d, maxDistance %d, dmgFromYou %d.\n", $char, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $target->{pos}{x}, $target->{pos}{y}, $target->{pos_to}{x}, $target->{pos_to}{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}, $target->{dmgFromYou}), 'ai_attack'; + debug TF("[$canAttack_fail_string - $range_type_string - Waiting] %s (%d %d), target %s (%d %d) [(%d %d) -> (%d %d)], distance %d, maxDistance %d, dmgFromYou %d.\n", $char, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $target->{pos}{x}, $target->{pos}{y}, $target->{pos_to}{x}, $target->{pos_to}{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}, $target->{dmgFromYou}), 'ai_attack'; } $found_action = 1; } diff --git a/src/AI/SlaveAttack.pm b/src/AI/SlaveAttack.pm index 2685c89708..f55172b397 100644 --- a/src/AI/SlaveAttack.pm +++ b/src/AI/SlaveAttack.pm @@ -124,7 +124,7 @@ sub process { $slave->args->{monsterLastMovePosTo}{x} = $target->{pos_to}{x}; $slave->args->{monsterLastMovePosTo}{y} = $target->{pos_to}{y}; } else { - warning "$slave target $target has moved since we started routing to it - Adjusting route\n", 'slave_attack'; + debug "$slave target $target has moved since we started routing to it - Adjusting route\n", 'slave_attack'; $reset = 1; } @@ -140,7 +140,7 @@ sub process { $slave->args->{masterLastMovePosTo}{x} = $char->{pos_to}{x}; $slave->args->{masterLastMovePosTo}{y} = $char->{pos_to}{y}; } else { - warning "$slave master $char has moved since we started routing to target $target - Adjusting route\n", 'slave_attack'; + debug "$slave master $char has moved since we started routing to target $target - Adjusting route\n", 'slave_attack'; $reset = 1; } } @@ -479,7 +479,7 @@ sub main { debug TF("[Slave] [Out of Range - Still Approaching - Waiting] %s (%d %d), target %s (%d %d), distance %d, maxDistance %d.\n", $slave, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}), 'ai_attack'; return; } else { - warning TF("[Slave] [Out of Range - Ended Approaching] %s (%d %d), target %s (%d %d), distance %d, maxDistance %d.\n", $slave, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}), 'ai_attack'; + debug TF("[Slave] [Out of Range - Ended Approaching] %s (%d %d), target %s (%d %d), distance %d, maxDistance %d.\n", $slave, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}), 'ai_attack'; $args->{sentApproach} = 0; } } @@ -527,21 +527,21 @@ sub main { $args->{ai_attack_failed_give_up}{time} = time if !$args->{ai_attack_failed_give_up}{time}; if (timeOut($args->{ai_attack_failed_give_up})) { delete $args->{ai_attack_failed_give_up}{time}; - warning T("[Slave $slave] Unable to determine a attackMethod\n"), "ai_attack"; + warning T("[$slave] Unable to determine a attackMethod (check attackUseWeapon and Skills blocks), dropping target.\n"), "ai_attack"; $found_action = 1; giveUp($args, $ID, 0); } } if ($canAttack == 0 && $youHitTarget) { - warning TF("[Slave $slave] [$canAttack_fail_string - $range_type_string] We were able to hit target even though it is out of range or LOS, accepting and continuing. (you %s (%d %d), target %s (%d %d) [(%d %d) -> (%d %d)], distance %d, maxDistance %d)\n", $slave, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $target->{pos}{x}, $target->{pos}{y}, $target->{pos_to}{x}, $target->{pos_to}{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}), 'ai_attack'; + debug TF("[Slave $slave] [$canAttack_fail_string - $range_type_string] We were able to hit target even though it is out of range or LOS, accepting and continuing. (you %s (%d %d), target %s (%d %d) [(%d %d) -> (%d %d)], distance %d, maxDistance %d)\n", $slave, $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $target->{pos}{x}, $target->{pos}{y}, $target->{pos_to}{x}, $target->{pos_to}{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}), 'ai_attack'; if ($clientDist > $args->{attackMethod}{maxDistance} && $clientDist <= ($args->{attackMethod}{maxDistance} + 1) && $args->{temporary_extra_range} == 0) { - warning TF("[$canAttack_fail_string] Probably extra range provided by the server due to chasing, increasing range by 1.\n"), 'ai_attack'; + debug TF("[$canAttack_fail_string] Probably extra range provided by the server due to chasing, increasing range by 1.\n"), 'ai_attack'; $args->{temporary_extra_range} = 1; $args->{attackMethod}{maxDistance} += $args->{temporary_extra_range}; $canAttack = canAttack($field, $realMyPos, $realMonsterPos, $config{$slave->{configPrefix}."attackCanSnipe"}, $args->{attackMethod}{maxDistance}, $config{clientSight}); } else { - warning TF("[Slave $slave] [$canAttack_fail_string] Reason unknown, allowing once.\n"), 'ai_attack'; + debug TF("[Slave $slave] [$canAttack_fail_string] Reason unknown, allowing once.\n"), 'ai_attack'; $hitTarget_when_not_possible = 1; } if ( @@ -572,7 +572,7 @@ sub main { giveUp($slave, $args, $ID, 0); } else { $slave->sendAttack($ID) if ($config{$slave->{configPrefix}."attackBeyondMaxDistance_sendAttackWhileWaiting"}); - warning TF("[Slave $slave] [$canAttack_fail_string - $range_type_string - Waiting] (%d %d), target %s (%d %d) [(%d %d) -> (%d %d)], distance %d, maxDistance %d.\n", $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $target->{pos}{x}, $target->{pos}{y}, $target->{pos_to}{x}, $target->{pos_to}{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}), 'ai_attack'; + debug TF("[Slave $slave] [$canAttack_fail_string - $range_type_string - Waiting] (%d %d), target %s (%d %d) [(%d %d) -> (%d %d)], distance %d, maxDistance %d.\n", $realMyPos->{x}, $realMyPos->{y}, $target, $realMonsterPos->{x}, $realMonsterPos->{y}, $target->{pos}{x}, $target->{pos}{y}, $target->{pos_to}{x}, $target->{pos_to}{y}, $realMonsterDist, $args->{attackMethod}{maxDistance}), 'ai_attack'; } $found_action = 1; } diff --git a/src/Network/Receive.pm b/src/Network/Receive.pm index 3b7e9da252..2372837536 100644 --- a/src/Network/Receive.pm +++ b/src/Network/Receive.pm @@ -11125,7 +11125,7 @@ sub monster_ranged_attack { } $char->{movetoattack_pos} = {%coords2}; $char->{movetoattack_time} = time; - warning "Received Failed to attack target - you: $coords2{x},$coords2{y} - monster: $coords1{x},$coords1{y} - range $range\n", "parseMsg_move"; + debug "Received Failed to attack target - you: $coords2{x},$coords2{y} - monster: $coords1{x},$coords1{y} - range $range\n", "parseMsg_move"; Plugins::callHook('monster_ranged_attack', {ID => $ID}); }