Exemple #1
0
    public static bool TankHealSpell(Spell spell, int setting, int playercount = 0)
    {
        if (!spell.KnownSpell || !spell.IsSpellUsable || !spell.IsDistanceGood)
        {
            return(false);
        }
        var members = Partystuff.getTanks().Where(o => o.IsValid &&
                                                  o.IsAlive &&
                                                  o.HealthPercent <= setting &&
                                                  !TraceLine.TraceLineGo(o.Position)).OrderBy(o => o.HealthPercent);

        if (members.Count() > playercount)
        {
            var       u    = members.First();
            WoWPlayer tank = new WoWPlayer(u.GetBaseAddress);
            if (!TraceLine.TraceLineGo(tank.Position) && tank.IsAlive)
            {
                ObjectManager.Me.FocusGuid = tank.Guid;
                Extension.HealSpell(spell, false, false, true);
                Logging.Write("Cast" + spell + "on " + tank);
                return(true);
            }
        }

        return(false);
    }