mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-17 02:40:28 +00:00
[Spell] Healer spell enhancement
This commit is contained in:
@@ -47,4 +47,35 @@ bool CastRebirthAction::isUseful()
|
||||
{
|
||||
return CastSpellAction::isUseful() &&
|
||||
AI_VALUE2(float, "distance", GetTargetName()) <= sPlayerbotAIConfig->spellDistance;
|
||||
}
|
||||
|
||||
Unit* CastRejuvenationOnNotFullAction::GetTarget()
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
MinValueCalculator calc(100);
|
||||
for (GroupReference* gref = group->GetFirstMember(); gref; gref = gref->next())
|
||||
{
|
||||
Player* player = gref->GetSource();
|
||||
if (!player)
|
||||
continue;
|
||||
if (player->isDead() || player->IsFullHealth())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (player->GetDistance2d(bot) > sPlayerbotAIConfig->spellDistance)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (botAI->HasAura("rejuvenation", player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
calc.probe(player->GetHealthPct(), player);
|
||||
}
|
||||
return (Unit*)calc.param;
|
||||
}
|
||||
|
||||
bool CastRejuvenationOnNotFullAction::isUseful()
|
||||
{
|
||||
return GetTarget();
|
||||
}
|
||||
Reference in New Issue
Block a user