Skip to content

Commit

Permalink
Change warning to debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrybk committed Dec 27, 2024
1 parent 6c87d50 commit 1efc74c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions control/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions src/AI/Attack.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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;
}
Expand Down
16 changes: 8 additions & 8 deletions src/AI/SlaveAttack.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Network/Receive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}
Expand Down

0 comments on commit 1efc74c

Please sign in to comment.