Code: Select all
if ($config{attackAuto_party} && $attackOnRoute && !AI::is("take", "items_take")
&& !$ai_v{sitAuto_forcedBySitCommand}
&& ((($monster->{dmgFromParty} || $monster->{castOnByParty}) && $config{attackAuto_party} != 2) ||
$monster->{dmgToParty} || $monster->{missedToParty})
&& timeOut($monster->{attack_failed}, $timeout{ai_attack_unfail}{timeout})) {
push @partyMonsters, $_;
next;
}
Code: Select all
if ($following && $config{'attackAuto_followTarget'} && $attackOnRoute && !AI::is("take", "items_take")
&& ($monster->{dmgToPlayer}{$followID} || $monster->{dmgFromPlayer}{$followID} || $monster->{missedToPlayer}{$followID} || $monster->{castOnByPlayer}{$followID})
&& timeOut($monster->{attack_failed}, $timeout{ai_attack_unfail}{timeout})) {
push @partyMonsters, $_;
next;
}
misc.pm line 1347, added check for monsters that have been cast on by party members
Code: Select all
if ($monster->{dmgFromParty} > 0 || $monster->{missedFromParty} > 0 || $monster->{dmgToParty} > 0 || $monster->{missedToParty} > 0 || $monster->{castOnByParty} > 0) {
return 1;
}
Code: Select all
if (defined(my $followIndex = AI::findAction("follow"))) {
my $following = AI::args($followIndex)->{following};
my $followID = AI::args($followIndex)->{ID};
if ($following) {
# And master attacked monster, or the monster attacked/missed master
if ($monster->{dmgToPlayer}{$followID} > 0
|| $monster->{missedToPlayer}{$followID} > 0
|| $monster->{dmgFromPlayer}{$followID} > 0
|| $monster->{castOnByPlayer}{$followID} > 0) {
return 1;
}
}
}
misc.pm line 2510, added logic to increment a new hash, $actor->{castOnByParty}
Code: Select all
sub countCastOn {
my ($sourceID, $targetID, $skillID, $x, $y) = @_;
return unless defined $targetID;
my $source = Actor::get($sourceID);
my $target = Actor::get($targetID);
assert(UNIVERSAL::isa($source, 'Actor')) if DEBUG;
assert(UNIVERSAL::isa($target, 'Actor')) if DEBUG;
if ($targetID eq $accountID) {
$source->{castOnToYou}++;
} elsif ($target->isa('Actor::Player')) {
$source->{castOnToPlayer}{$targetID}++;
if (existsInList($config{tankersList}, $target->{name}) ||
($char->{slaves} && %{$char->{slaves}} && $char->{slaves}{$targetID} && %{$char->{slaves}{$targetID}}) ||
($char->{party} && %{$char->{party}} && $char->{party}{users}{$targetID} && %{$char->{party}{users}{$targetID}})) {
$source->{castOnToParty}++;
}
} elsif ($target->isa('Actor::Monster')) {
$source->{castOnToMonster}{$targetID}++;
}
if ($sourceID eq $accountID) {
$target->{castOnByYou}++;
} elsif ($source->isa('Actor::Player')) {
$target->{castOnByPlayer}{$sourceID}++;
if (existsInList($config{tankersList}, $source->{name}) || ($char->{slaves} && $char->{slaves}{$sourceID}) ||
($char->{party} && %{$char->{party}} && $char->{party}{users}{$sourceID} && %{$char->{party}{users}{$sourceID}})) {
#cast on by party
$target->{castOnByParty}++;
}
} elsif ($source->isa('Actor::Monster')) {
$target->{castOnByMonster}{$sourceID}++;
}
}
Code: Select all
if ($monster->{dmgFromParty} > 0 || $monster->{missedFromParty} > 0 || $monster->{dmgToParty} > 0 || $monster->{missedToParty} > 0 || $monster->{castOnByParty} > 0) {
return 1;
}
WARNING! This revision can drastically alter how kore operates! Using attackautoparty 1 as opposed to attackautoparty 2 can result in a kore in tankee mode (archer, mage) going aggro against any mob that the followtarget or party member casts ANY skill on!
In order to avoid unwanted effects of this revision, examine carefully how your attackauto, attackautoparty, attackautoonlywhensafe, and attackautofollowtarget are set!
Regardless of the inconvenience of that, I think this is an important and needed change. It drastically improves the functionality of kore because it enables the detection of non damaging skills, such as lex aetera or provoke, to will trigger aggression. This is extremely useful for using kore in a tank - tankee combination.