openkore
openkore copied to clipboard
Rework attack.pm Back Stab function near wall ?
Hello,
I found a missing feature in Openkore, i would like to get help to implement a alternative to use Back Stab when the char is near to some wall or object because its impossible to use this skill.
I found in forum a user that made a rework on attack.pm that use the fuction "fromBehind" and the charecter tries to get position to the mob.
the forum topic link https://forums.openkore.com/viewtopic.php?f=58&p=200846
How can i implement this to my openkore?
Thank you
looks good:

my $monsterLooking=$target->{look}{body};
if ($config{'attackSkillSlot_'.$slot.'_fromBehind'} && $monsterLooking ) {
my %behind;
if ($monsterLooking eq 0 || $monsterLooking eq 8) {
$behind{x}=$target->{pos_to}{x};
$behind{y}=$target->{pos_to}{y} - 1;
} elsif ($monsterLooking eq 1) {
$behind{x}=$target->{pos_to}{x} + 1;
$behind{y}=$target->{pos_to}{y} - 1;
} elsif ($monsterLooking eq 2) {
$behind{x}=$target->{pos_to}{x} + 1;
$behind{y}=$target->{pos_to}{y};
} elsif ($monsterLooking eq 3) {
$behind{x}=$target->{pos_to}{x} + 1;
$behind{y}=$target->{pos_to}{y} + 1;
} elsif ($monsterLooking eq 4) {
$behind{x}=$target->{pos_to}{x};
$behind{y}=$target->{pos_to}{y} + 1;
} elsif ($monsterLooking eq 5) {
$behind{x}=$target->{pos_to}{x} - 1;
$behind{y}=$target->{pos_to}{y} + 1;
} elsif ($monsterLooking eq 6) {
$behind{x}=$target->{pos_to}{x} - 1;
$behind{y}=$target->{pos_to}{y};
} elsif ($monsterLooking eq 7) {
$behind{x}=$target->{pos_to}{x} - 1;
$behind{y}=$target->{pos_to}{y} - 1;
}
message "Trying to move behind target ($target->{pos_to}{x},$target->{pos_to}{y} looking $directions_lut{$monsterLooking}) - ($behind{x},$behind{y})\n";
$messageSender->sendMove($behind{x}, $behind{y});
}