Core/Object: Implement FindNearestCreatureWithAura
Port From (https://github.com/TrinityCore/TrinityCore/commit/9a3e29d416162a84dd6a11c5e248f5f65e98a604)
This commit is contained in:
@@ -1619,6 +1619,14 @@ namespace Game.Entities
|
||||
return searcher.GetTarget();
|
||||
}
|
||||
|
||||
public Creature FindNearestCreatureWithAura(uint entry, uint spellId, float range, bool alive = true)
|
||||
{
|
||||
var checker = new NearestCreatureEntryWithLiveStateAndAuraInObjectRangeCheck(this, entry, spellId, alive, range);
|
||||
var searcher = new CreatureLastSearcher(this, checker);
|
||||
Cell.VisitAllObjects(this, searcher, range);
|
||||
return searcher.GetTarget();
|
||||
}
|
||||
|
||||
public GameObject FindNearestGameObject(uint entry, float range, bool spawnedOnly = true)
|
||||
{
|
||||
var checker = new NearestGameObjectEntryInObjectRangeCheck(this, entry, range, spawnedOnly);
|
||||
|
||||
Reference in New Issue
Block a user