Skill[] skills = actorHp < 50 ? selectUsableSkills(actor, 0, _healSkills) : selectUsableSkills(actor, 0, _buffSkills);
if ((skills == null) || (skills.length == 0))
{
return false;
}
Skill skill = skills[Rnd.get(skills.length)];
addTaskBuff(actor, skill);
return true;
}
if (Rnd.chance(rateFriends))
{
for (NpcInstance npc : activeFactionTargets())
{
double targetHp = npc.getCurrentHpPercents();
Skill[] skills = targetHp < 50 ? selectUsableSkills(actor, 0, _healSkills) : selectUsableSkills(actor, 0, _buffSkills);
if ((skills == null) || (skills.length == 0))
{
continue;
}
Skill skill = skills[Rnd.get(skills.length)];
addTaskBuff(actor, skill);
return true;
}
}
return false;