What I am trying to do is trigger a skill (Provoke) when a party member is being attacked on screen. To do that I am trying to detect when a party member is being attacked and by what (Monster ID), but what I have tried has not worked so far. Here's my latest attempt:
Code: Select all
sub on_mainLoop {
foreach (@partyUsersID) {
my @aggressives = ai_getPlayerAggressives();
my $aggressives = @aggressives;
if ($aggressives > 0) {
message "Never gets this far.";
}
}
}
In place of @partyUsersID I've also tried swapping in $char->{party} and $char->{party}{users}{$id} but I just seem to have hit a dead end in trying to get what I am trying to achieve. Also, I am sure I don't need to do this on the mainLoop either. I tried hooking into checkPlayerCondition, but that just didn't trigger at all.
Any help appreciated,
Thanks,
cat.