Core/SAI: refactored SMART_EVENT_FRIENDLY_HEALTH_PCT to reflect the behavior of SMART_EVENT_FRIENDLY_HEALTH

* added radius event parameter to limit the search range of the executing creature
* moved the pct check to a macro and corrected the selection logic to support all target types
This commit is contained in:
Ovahlord committed 2021-02-25 15:40:05 +01:00
1 parent b0101ecb67
commit b875d77dc8
8 files changed
+59 -54

No files matched your search

@@ -1331,8 +1331,8 @@ class npc_captain_arnath : public CreatureScript
Creature* FindFriendlyCreature() const
{
Creature* target = nullptr;
Trinity::MostHPMissingInRange u_check(me, 60.0f, 0);
Trinity::CreatureLastSearcher<Trinity::MostHPMissingInRange> searcher(me, target, u_check);
Trinity::FriendlyMostHPMissingInRange u_check(me, 60.0f, 0);
Trinity::CreatureLastSearcher<Trinity::FriendlyMostHPMissingInRange> searcher(me, target, u_check);
Cell::VisitGridObjects(me, searcher, 60.0f);
return target;
}