Core/AI: Added new method for search friendly targets with certain entry and hp pct below a value
This commit is contained in:
@@ -1392,6 +1392,33 @@ namespace Game.Maps
|
||||
ulong i_hp;
|
||||
}
|
||||
|
||||
public class FriendlyBelowHpPctEntryInRange : ICheck<Unit>
|
||||
{
|
||||
public FriendlyBelowHpPctEntryInRange(Unit obj, uint entry, float range, byte pct, bool excludeSelf)
|
||||
{
|
||||
i_obj = obj;
|
||||
i_entry = entry;
|
||||
i_range = range;
|
||||
i_pct = pct;
|
||||
i_excludeSelf = excludeSelf;
|
||||
}
|
||||
|
||||
public bool Invoke(Unit u)
|
||||
{
|
||||
if (i_excludeSelf && i_obj.GetGUID() == u.GetGUID())
|
||||
return false;
|
||||
if (u.GetEntry() == i_entry && u.IsAlive() && u.IsInCombat() && !i_obj.IsHostileTo(u) && i_obj.IsWithinDistInMap(u, i_range) && u.HealthBelowPct(i_pct))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
Unit i_obj;
|
||||
uint i_entry;
|
||||
float i_range;
|
||||
byte i_pct;
|
||||
bool i_excludeSelf;
|
||||
}
|
||||
|
||||
public class FriendlyCCedInRange : ICheck<Creature>
|
||||
{
|
||||
public FriendlyCCedInRange(Unit obj, float range)
|
||||
|
||||
Reference in New Issue
Block a user