Skip to content

Commit

Permalink
Add timeout for using attacks after skills
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrybk committed Dec 28, 2024
1 parent 09a853f commit fa54506
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions control/timeouts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ai_attack 1
ai_homunculus_attack 1
ai_mercenary_attack 1

ai_attack_after_skill 0.5

ai_homunculus_dance_attack_melee 0.2

ai_mercenary_dance_attack_melee 0.2
Expand Down
5 changes: 4 additions & 1 deletion src/AI/Attack.pm
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ sub main {
}

# Attack with weapon logic
if ($args->{attackMethod}{type} eq "weapon" && timeOut($timeout{ai_attack})) {
if ($args->{attackMethod}{type} eq "weapon" && timeOut($timeout{ai_attack}) && timeOut($timeout{ai_attack_after_skill})) {
if (Actor::Item::scanConfigAndCheck("attackEquip")) {
#check if item needs to be equipped
Actor::Item::scanConfigAndEquip("attackEquip");
Expand Down Expand Up @@ -748,6 +748,9 @@ sub main {
my $skill_lvl = $config{"attackSkillSlot_${slot}_lvl"} || $char->getSkillLevel($skill);
debug "[attackSkillSlot] Auto-skill on monster ".getActorName($ID).": ".qq~$config{"attackSkillSlot_$slot"} (lvl $skill_lvl)\n~, "ai_attack";
# TODO: We sould probably add a runFromTarget_inAdvance logic here also, we could want to kite using skills, but only instant cast ones like double strafe I believe

$timeout{ai_attack_after_skill}{time} = time;
delete $args->{attackMethod};
$found_action = 1;

# Attack with combo logic
Expand Down

0 comments on commit fa54506

Please sign in to comment.