private void Skill_Select()
        {
            Button _this = _clickedSkill;

            SkillData _selected = SkillCastConditions.Custom.CustomDefinitions.FirstOrDefault(x => x.Name == _this.Text && x.Power.PowerSNO == int.Parse(_this.Name));

            _SelectedSkill = _selected;
            _SelectedCondition = null;

            BTN_ConditionEdit.Visible = false;
            BTN_ContitionRemove.Visible = false;

            Update_View();
        }
        private void BTN_ContitionRemove_Click(object sender, EventArgs e)
        {
            _SelectedSkill.CastConditions.Remove(_SelectedCondition);
            _SelectedCondition = null;

            Update_PanelSelectedSkillDetails();
            Mark_SelectedCondition();
        }
        private void Condition_Select()
        {
            
            
                Button _this = _clickedCondition;

                if (_this != null)
                {
                    ConditionType Type =
                        (ConditionType) Enum.Parse(typeof (ConditionType), _this.Text);
                
                    List<double> Values = new List<double>();
                    string[] Splits = _this.Name.Split('|');

                    int group = int.Parse(Splits[0]);

                    for (int i = 1; i < Splits.Length; i++)
                    {
                        Values.Add(double.Parse(Splits[i]));
                    }

                    if (Values.Count == 1)
                    {
                        _SelectedCondition =
                            _SelectedSkill.CastConditions.FirstOrDefault(x => x.Type == Type && x.ConditionGroup == group && x.Values[0] == Values[0]);
                    }
                    else if (Values.Count == 2)
                    {
                        _SelectedCondition =
                            _SelectedSkill.CastConditions.FirstOrDefault(
                                x => x.Type == Type && x.ConditionGroup == group && x.Values[0] == Values[0] && x.Values[1] == Values[1]);
                    }
                    else if (Values.Count == 3)
                    {
                        _SelectedCondition =
                            _SelectedSkill.CastConditions.FirstOrDefault(
                                x =>
                                    x.Type == Type && x.ConditionGroup == group && x.Values[0] == Values[0] && x.Values[1] == Values[1] &&
                                    x.Values[2] == Values[2]);
                    }
                else if (Values.Count == 5)
                {
                    _SelectedCondition =
                        _SelectedSkill.CastConditions.FirstOrDefault(
                            x =>
                                x.Type == Type && x.ConditionGroup == group && x.Values[0] == Values[0] && x.Values[1] == Values[1] &&
                                x.Values[2] == Values[2] && x.Values[3] == Values[3] && x.Values[4] == Values[4]);
                }


                var SelectionItem =
                        CB_ConditionSelection.Items.OfType<ComboboxItem>()
                            .ToList()
                            .FirstOrDefault(x => x.Text == Type.ToString());
                    CB_ConditionSelection.SelectedItem = SelectionItem;

                    Update_PanelSelectedSkillDetails(true);
                    Load_ConditionValues();
                    Mark_SelectedCondition();
                
            }
            
        }
        private static bool evaluate_Condition(CastCondition Condition, List<CastCondition> ConditionGroup , SkillPower _SkillPower, int EquippedRune, out bool IsTimedCast, out bool ShouldChannel, out int ChannelTicks)
        {
            IsTimedCast = false;
            ShouldChannel = false;
            ChannelTicks = 0;

            try
            {
                //
                SkillPower SkillPower = new SkillPower(_SkillPower.PowerSNO, _SkillPower.Name, _SkillPower.Runes, _SkillPower.ResourceCost, _SkillPower.IsPrimaryResource, _SkillPower.IsCooldownSpell);

                SkillPower.PowerSNO = getRealPowerSNO(SkillPower.PowerSNO);
                //

                List<ActorCommonData> SelectedMonster_MonstersInRange;
                lock (A_Collection.Environment.Actors.SelectedMonster_MonstersInRange)
                    SelectedMonster_MonstersInRange = A_Collection.Environment.Actors.SelectedMonster_MonstersInRange.ToList();

                List<ActorCommonData> MonstersInRange;
                lock (A_Collection.Environment.Actors.MonstersInRange)
                    MonstersInRange = A_Collection.Environment.Actors.MonstersInRange.ToList();

                bool isFireReduce = false;

                List<SkillPower> AllSkillPowers;
                lock (A_Collection.Presets.SkillPowers.AllSkillPowers)
                    AllSkillPowers = A_Collection.Presets.SkillPowers.AllSkillPowers.ToList();

                if (
                    AllSkillPowers.FirstOrDefault(
                        x =>
                            x.PowerSNO == SkillPower.PowerSNO &&
                            x.Runes.FirstOrDefault(y => y.RuneIndex == EquippedRune)._DamageType == DamageType.Fire) !=
                    null && A_Tools.T_LocalPlayer.isBuff((int)318790))
                    isFireReduce = true;

                List<double> Values = Condition.Values.ToList();


                switch (Condition.Type)
                {
                    case ConditionType.MonstersInRange_IsBuffActive:
                        switch ((int) Values[2])
                        {
                            case 0:
                                return
                                    MonstersInRange.Count(monster => T_ACD.isBuff((int) Values[0], monster)) <=
                                    Values[1];

                            case 1:
                                return MonstersInRange.Count(monster => T_ACD.isBuff((int) Values[0], monster)) >=
                                       Values[1];

                            default:
                                return false;
                        }

                    case ConditionType.MonstersInRange_IsBuffNotActive:
                        switch ((int) Values[2])
                        {
                            case 0:
                                return
                                    MonstersInRange.Count(monster => !T_ACD.isBuff((int) Values[0], monster)) <=
                                    Values[1];

                            case 1:
                                return MonstersInRange.Count(monster => !T_ACD.isBuff((int) Values[0], monster)) >=
                                       Values[1];

                            default:
                                return false;
                        }

                    case ConditionType.Player_BuffTicksLeft:
                        int ticks = A_Tools.T_LocalPlayer.get_BuffTicksLeft((int) Values[0], (int) Values[1]);
                        return ticks <= Values[2];

                    case ConditionType.Player_IsBuffActive:
                        return A_Tools.T_LocalPlayer.isBuff((int) Values[0], (int) Values[1]);

                    case ConditionType.Player_IsBuffNotActive:
                        return !A_Tools.T_LocalPlayer.isBuff((int) Values[0], (int) Values[1]);

                    case ConditionType.Player_IsMonsterSelected:
                        if (Values[0] == 1)
                            return Me.HeroDetails.SelectedMonsterACD != null;
                        return Me.HeroDetails.SelectedMonsterACD == null;

                    case ConditionType.Player_MinPrimaryResource:
                        if (isFireReduce)
                            return Me.HeroDetails.ResourcePrimary*1.3 >= Values[0];
                        return Me.HeroDetails.ResourcePrimary >= Values[0];

                    case ConditionType.Player_MinSecondaryResource:
                        if (isFireReduce)
                            return Me.HeroDetails.ResourceSecondary*1.3 >= Values[0];
                        return Me.HeroDetails.ResourceSecondary >= Values[0];

                    case ConditionType.Player_Skill_IsNotOnCooldown:
                        switch ((int) Values[0])
                        {
                            case 1:
                                return !A_Tools.Skills.Skills.S_Global.isOnCooldown(SkillPower.PowerSNO);

                            case 0:
                                return A_Tools.Skills.Skills.S_Global.isOnCooldown(SkillPower.PowerSNO);

                            default:
                                return false;
                        }


                    case ConditionType.SelectedMonster_IsBuffActive:
                        if (Me.HeroDetails.SelectedMonsterACD != null)
                        {
                            if (A_Tools.T_ACD.isBuff((int) Values[0], Me.HeroDetails.SelectedMonsterACD))
                                return true;
                        }
                        return false;

                    case ConditionType.SelectedMonster_IsBuffNotActive:
                        if (Me.HeroDetails.SelectedMonsterACD != null)
                        {
                            if (!A_Tools.T_ACD.isBuff((int) Values[0], Me.HeroDetails.SelectedMonsterACD))
                                return true;
                        }
                        return false;

                    case ConditionType.World_BossInRange:
                        int _bosses = A_Tools.T_ACD.get_MonstersInRange((int) Values[0], false, true,
                            out A_Collection.Environment.Actors.MonstersInRange);
                        switch ((int) Values[2])
                        {
                            case 0:
                                return _bosses <= Values[1];

                            case 1:
                                return _bosses >= Values[1];

                            default:
                                return false;
                        }

                    case ConditionType.World_EliteInRange:
                        int elites = A_Tools.T_ACD.get_MonstersInRange((int) Values[0], true, false,
                            out A_Collection.Environment.Actors.MonstersInRange);
                        switch ((int) Values[2])
                        {
                            case 0:
                                return elites <= Values[1];

                            case 1:
                                return elites >= Values[1];

                            default:
                                return false;
                        }


                    case ConditionType.World_MonstersInRange:
                        int all = A_Tools.T_ACD.get_MonstersInRange((int) Values[0], false, false,
                            out A_Collection.Environment.Actors.MonstersInRange);
                        switch ((int) Values[2])
                        {
                            case 0:
                                return all <= Values[1];

                            case 1:
                                return all >= Values[1];

                            default:
                                return false;
                        }


                    case ConditionType.Player_MinPrimaryResourcePercentage:
                        if (isFireReduce)
                            return Me.HeroDetails.ResourcePrimary_Percentage*1.3 >= Values[0];
                        return Me.HeroDetails.ResourcePrimary_Percentage >= Values[0];

                    case ConditionType.Player_MinSecondaryResourcePercentage:
                        if (isFireReduce)
                            return Me.HeroDetails.ResourceSecondary_Percentage*1.3 >= Values[0];
                        return Me.HeroDetails.ResourceSecondary_Percentage >= Values[0];

                    case ConditionType.Player_MaxHitpointsPercentage:
                        return Me.HeroDetails.Hitpoints_Percentage <= Values[0];

                    case ConditionType.SelectedMonster_MonstersInRange:
                        if (Me.HeroDetails.SelectedMonsterACD != null)
                        {
                            switch ((int) Values[2])
                            {
                                case 0:
                                    return
                                        A_Tools.T_ACD.get_MonstersInRangeOfSelectedMonster(
                                            Me.HeroDetails.SelectedMonsterACD,
                                            Values[0],
                                            out A_Collection.Environment.Actors.SelectedMonster_MonstersInRange) <=
                                        Values[1];

                                case 1:
                                    return
                                        A_Tools.T_ACD.get_MonstersInRangeOfSelectedMonster(
                                            Me.HeroDetails.SelectedMonsterACD,
                                            Values[0],
                                            out A_Collection.Environment.Actors.SelectedMonster_MonstersInRange) >=
                                        Values[1];

                                default:
                                    return false;
                            }

                        }
                        return false;

                    case ConditionType.Player_IsBuffCount:
                        return A_Tools.T_LocalPlayer.getBuffCount((int) Values[0], (int) Values[1]) >= Values[2];

                    case ConditionType.Player_IsNotBuffCount:
                        return A_Tools.T_LocalPlayer.getBuffCount((int) Values[0], (int) Values[1]) < Values[2];

                    case ConditionType.PartyMember_InRangeIsBuff:
                        int Count_PartyMembersInRange = 0;
                        int actives = A_Tools.Buffs.Buffs.B_Global.get_PartyMembers_WithBuff((int)Values[0],
                                    (int)Values[1],Values[2], out Count_PartyMembersInRange);

                        if (Values[3] == -1)
                        {
                            return actives >= Count_PartyMembersInRange;
                        }
                        else if (Values[3] != -1)
                        {
                            switch ((int) Values[4])
                            {
                                case 0:
                                    return actives <= Values[3];

                                case 1:
                                    return actives >= Values[3];
                            }
                        }
                        return false;

                    case ConditionType.PartyMember_InRangeIsNotBuff:
                        int _Count_PartyMembersInRange = 0;
                        int inactives = A_Tools.Buffs.Buffs.B_Global.get_PartyMembers_WithoutBuff((int)Values[0],
                                    (int)Values[1], Values[2], out _Count_PartyMembersInRange);

                        if (Values[3] == -1)
                        {
                            return inactives >= _Count_PartyMembersInRange;
                        }
                        else if (Values[3] != -1)
                        {
                            switch ((int)Values[4])
                            {
                                case 0:
                                    return inactives <= Values[3];

                                case 1:
                                    return inactives >= Values[3];
                            }
                        }
                        return false;

                    case ConditionType.Party_AllInRange:
                        return A_Tools.T_LocalPlayer.get_PartyMemberInRange(Values[0]) >= Me.Party.PlayersInGame - 1;

                    case ConditionType.Party_NotAllInRange:
                        return A_Tools.T_LocalPlayer.get_PartyMemberInRange(Values[0]) < Me.Party.PlayersInGame - 1;

                    case ConditionType.World_IsRift:
                        switch ((int) Values[0])
                        {
                            case 1:
                                return A_Tools.T_LevelArea.IsRift();

                            case 0:
                                return !A_Tools.T_LevelArea.IsRift();

                            default:
                                return false;
                        }


                    case ConditionType.World_IsGRift:
                        switch ((int) Values[0])
                        {
                            case 1:
                                return A_Tools.T_LevelArea.IsGRift();

                            case 0:
                                return !A_Tools.T_LevelArea.IsGRift();

                            default:
                                return false;
                        }


                    case ConditionType.PartyMember_InRangeMinHitpoints:
                        return A_Tools.T_LocalPlayer.IsPartyMemberInRange_MinHitpoints(Values[0], (int) Values[1]);

                    case ConditionType.Player_Skill_MinCharges:
                        return A_Tools.Skills.Skills.S_Global.get_Charges(SkillPower.PowerSNO) >= Values[0];

                    case ConditionType.Player_Skill_MinResource:
                        switch ((int) Values[0])
                        {
                            case 1:
                                switch (SkillPower.IsPrimaryResource)
                                {
                                    case true:
                                        if (isFireReduce)
                                            return A_Collection.Me.HeroDetails.ResourcePrimary*1.3 >=
                                                   SkillPower.ResourceCost;
                                        return A_Collection.Me.HeroDetails.ResourcePrimary >= SkillPower.ResourceCost;

                                    case false:
                                        if (isFireReduce)
                                            return A_Collection.Me.HeroDetails.ResourceSecondary*1.3 >=
                                                   SkillPower.ResourceCost*-1;
                                        return A_Collection.Me.HeroDetails.ResourceSecondary >=
                                               SkillPower.ResourceCost*-1;

                                    default:
                                        return false;
                                }

                            case 0:
                                switch (SkillPower.IsPrimaryResource)
                                {
                                    case true:
                                        if (isFireReduce)
                                            return A_Collection.Me.HeroDetails.ResourcePrimary*1.3 <
                                                   SkillPower.ResourceCost;
                                        return A_Collection.Me.HeroDetails.ResourcePrimary < SkillPower.ResourceCost;

                                    case false:
                                        if (isFireReduce)
                                            return A_Collection.Me.HeroDetails.ResourceSecondary*1.3 <
                                                   SkillPower.ResourceCost*-1;
                                        return A_Collection.Me.HeroDetails.ResourceSecondary <
                                               SkillPower.ResourceCost*-1;

                                    default:
                                        return false;
                                }

                            default:
                                return false;
                        }

                    case ConditionType.SelectedMonster_MinDistance:
                        if (Me.HeroDetails.SelectedMonsterACD != null)
                        {
                            return A_Collection.Me.HeroDetails.Distance_SelectedMonsterACD >= Values[0];
                        }
                        return false;

                    case ConditionType.SelectedMonster_MaxDistance:
                        if (Me.HeroDetails.SelectedMonsterACD != null)
                        {
                            return A_Collection.Me.HeroDetails.Distance_SelectedMonsterACD <= Values[0];
                        }
                        return false;

                    case ConditionType.Player_MaxPrimaryResource:
                        if (isFireReduce)
                            return Me.HeroDetails.ResourcePrimary*1.3 <= Values[0];
                        return Me.HeroDetails.ResourcePrimary <= Values[0];

                    case ConditionType.Player_MaxSecondaryResource:
                        if (isFireReduce)
                            return Me.HeroDetails.ResourceSecondary*1.3 <= Values[0];
                        return Me.HeroDetails.ResourceSecondary <= Values[0];

                    case ConditionType.Player_MaxPrimaryResourcePercentage:
                        if (isFireReduce)
                            return Me.HeroDetails.ResourcePrimary_Percentage*1.3 <= Values[0];
                        return Me.HeroDetails.ResourcePrimary_Percentage <= Values[0];

                    case ConditionType.Player_MaxSecondaryResourcePercentage:
                        if (isFireReduce)
                            return Me.HeroDetails.ResourceSecondary_Percentage*1.3 <= Values[0];
                        return Me.HeroDetails.ResourceSecondary_Percentage <= Values[0];

                    case ConditionType.Player_IsMoving:
                        switch ((int) Values[0])
                        {
                            case 1:
                                return A_Collection.Me.HeroStates.isMoving;

                            case 0:
                                return !A_Collection.Me.HeroStates.isMoving;

                            default:
                                return false;
                        }

                    case ConditionType.Player_Pet_MinFetishesCount:
                        return A_Tools.Buffs.Buffs.B_WitchDoctor.get_FetishCount() >= Values[0];

                    case ConditionType.Player_Pet_MinZombieDogsCount:
                        return A_Tools.Buffs.Buffs.B_WitchDoctor.get_ZombieDogCount() >= Values[0];

                    case ConditionType.Player_Pet_MinGargantuanCount:
                        return A_Tools.Buffs.Buffs.B_WitchDoctor.get_GargantuanCount() >= Values[0];

                    case ConditionType.Player_Pet_MaxFetishesCount:
                        return A_Tools.Buffs.Buffs.B_WitchDoctor.get_FetishCount() <= Values[0];

                    case ConditionType.Player_Pet_MaxZombieDogsCount:
                        return A_Tools.Buffs.Buffs.B_WitchDoctor.get_ZombieDogCount() <= Values[0];

                    case ConditionType.Player_Pet_MaxGargantuanCount:
                        return A_Tools.Buffs.Buffs.B_WitchDoctor.get_GargantuanCount() <= Values[0];

                    case ConditionType.SelectedMonster_IsElite:
                        if (A_Collection.Me.HeroDetails.SelectedMonsterACD != null)
                        {
                            switch ((int) Values[0])
                            {
                                case 0:
                                    return !A_Tools.T_ACD.isElite(A_Collection.Me.HeroDetails.SelectedMonsterACD);

                                case 1:
                                    return A_Tools.T_ACD.isElite(A_Collection.Me.HeroDetails.SelectedMonsterACD);
                            }
                        }
                        return false;

                    case ConditionType.SelectedMonster_IsBoss:
                        if (A_Collection.Me.HeroDetails.SelectedMonsterACD != null)
                        {
                            switch ((int) Values[0])
                            {
                                case 0:
                                    return !A_Tools.T_ACD.isBoss(A_Collection.Me.HeroDetails.SelectedMonsterACD);

                                case 1:
                                    return A_Tools.T_ACD.isBoss(A_Collection.Me.HeroDetails.SelectedMonsterACD);
                            }
                        }
                        return false;

                    case ConditionType.Player_Power_IsNotOnCooldown:
                        return !A_Tools.Skills.Skills.S_Global.isOnCooldown((int) Values[0]);

                    case ConditionType.Player_Power_IsOnCooldown:
                        return A_Tools.Skills.Skills.S_Global.isOnCooldown((int) Values[0]);

                    case ConditionType.Player_HasSkillEquipped:
                        return A_Collection.Me.HeroDetails.ActiveSkills.ContainsKey((int) Values[0]);

                    case ConditionType.Player_HasSkillNotEquipped:
                        return !A_Collection.Me.HeroDetails.ActiveSkills.ContainsKey((int) Values[0]);

                    case ConditionType.MonstersInRange_HaveArcaneEnchanted:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_ArcaneEnchanted);
                        return !MonstersInRange.Any(T_ACD.hasAffix_ArcaneEnchanted);

                    case ConditionType.MonstersInRange_HaveAvenger:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Avenger);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Avenger);

                    case ConditionType.MonstersInRange_HaveDesecrator:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Desecrator);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Desecrator);

                    case ConditionType.MonstersInRange_HaveElectrified:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Electrified);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Electrified);

                    case ConditionType.MonstersInRange_HaveExtraHealth:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_ExtraHealth);
                        return !MonstersInRange.Any(T_ACD.hasAffix_ExtraHealth);

                    case ConditionType.MonstersInRange_HaveFast:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Fast);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Fast);

                    case ConditionType.MonstersInRange_HaveFrozen:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Frozen);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Frozen);

                    case ConditionType.MonstersInRange_HaveHealthlink:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Healthlink);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Healthlink);

                    case ConditionType.MonstersInRange_HaveIllusionist:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Illusionist);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Illusionist);

                    case ConditionType.MonstersInRange_HaveJailer:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Jailer);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Jailer);

                    case ConditionType.MonstersInRange_HaveKnockback:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Knockback);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Knockback);

                    case ConditionType.MonstersInRange_HaveFirechains:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Firechains);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Firechains);

                    case ConditionType.MonstersInRange_HaveMolten:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Molten);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Molten);

                    case ConditionType.MonstersInRange_HaveMortar:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Mortar);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Mortar);

                    case ConditionType.MonstersInRange_HaveNightmarish:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Nightmarish);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Nightmarish);

                    case ConditionType.MonstersInRange_HavePlagued:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Plagued);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Plagued);

                    case ConditionType.MonstersInRange_HaveReflectsDamage:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_ReflectsDamage);
                        return !MonstersInRange.Any(T_ACD.hasAffix_ReflectsDamage
                            );
                    case ConditionType.MonstersInRange_HaveShielding:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Shielding);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Shielding);

                    case ConditionType.MonstersInRange_HaveTeleporter:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Teleporter);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Teleporter);

                    case ConditionType.MonstersInRange_HaveThunderstorm:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Thunderstorm);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Thunderstorm);

                    case ConditionType.MonstersInRange_HaveVortex:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Vortex);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Vortex);

                    case ConditionType.MonstersInRange_HaveWaller:
                        if (Values[0] == 1)
                            return MonstersInRange.Any(T_ACD.hasAffix_Waller);
                        return !MonstersInRange.Any(T_ACD.hasAffix_Waller);

                    case ConditionType.SelectedMonster_IsBuffCount:
                        if (A_Collection.Me.HeroDetails.SelectedMonsterACD != null)
                            return
                                A_Tools.T_ACD.getBuffCount((int) Values[0], (int) Values[1],
                                    A_Collection.Me.HeroDetails.SelectedMonsterACD) >= Values[2];
                        return false;

                    case ConditionType.SelectedMonster_IsNotBuffCount:
                        if (A_Collection.Me.HeroDetails.SelectedMonsterACD != null)
                            return
                                A_Tools.T_ACD.getBuffCount((int) Values[0], (int) Values[1],
                                    A_Collection.Me.HeroDetails.SelectedMonsterACD) < Values[2];
                        return false;

                    case ConditionType.MonstersInRange_IsBuffCount:
                        return
                            MonstersInRange.Any(
                                x => T_ACD.getBuffCount((int) Values[0], (int) Values[1], x) >= Values[2]);

                    case ConditionType.MonstersInRange_IsNotBuffCount:
                        return
                            MonstersInRange.Any(x => T_ACD.getBuffCount((int) Values[0], (int) Values[1], x) < Values[2]);

                    case ConditionType.Player_IsDestructableSelected:
                        if (Values[0] == 1)
                            return Me.HeroDetails.SelectedDestructibleACD != null;
                        return Me.HeroDetails.SelectedDestructibleACD == null;

                    case ConditionType.Key_ForceStandStill:
                        if (Values[0] == 1)
                            return Hotkeys.IngameKeys.IsForceStandStill;
                        return !Hotkeys.IngameKeys.IsForceStandStill;

                    case ConditionType.Add_Property_TimedUse:
                        IsTimedCast = true;
                        if (A_Handler.SkillHandler.SkillHandler._CastTimes.ContainsKey(SkillPower.PowerSNO))
                        {
                            if (A_Handler.SkillHandler.SkillHandler._CastTimes[SkillPower.PowerSNO].AddSeconds(
                                (double) Values[0]/60) >
                                DateTime.Now)
                                return false;
                            else
                                return true;

                        }
                        else
                        {
                            return true;
                        }

                    case ConditionType.SelectedMonster_MonstersInRange_IsBuffActive:
                        switch ((int) Values[2])
                        {
                            case 0:
                                return
                                    SelectedMonster_MonstersInRange.Count(
                                        monster => T_ACD.isBuff((int) Values[0], monster)) <= Values[1];

                            case 1:
                                return
                                    SelectedMonster_MonstersInRange.Count(
                                        monster => T_ACD.isBuff((int) Values[0], monster)) >= Values[1];

                            default:
                                return false;
                        }


                    case ConditionType.SelectedMonster_MonstersInRange_IsBuffNotActive:
                        switch ((int) Values[2])
                        {
                            case 0:
                                return
                                    SelectedMonster_MonstersInRange.Count(
                                        monster => !T_ACD.isBuff((int) Values[0], monster)) <= Values[1];

                            case 1:
                                return
                                    SelectedMonster_MonstersInRange.Count(
                                        monster => !T_ACD.isBuff((int) Values[0], monster)) >= Values[1];

                            default:
                                return false;
                        }


                    case ConditionType.Player_MinAPS:
                        return A_Collection.Me.HeroDetails.AttacksPerSecondTotal >= Values[0];

                    case ConditionType.Add_Property_Channeling:
                        ShouldChannel = true;
                        ChannelTicks = (int) Values[1];
                        return true;

                    case ConditionType.Add_Property_APSSnapShot:
                        if (ConditionGroup.FirstOrDefault(x => x.Type == ConditionType.Player_MinAPS) != null)
                        {
                            double APS_ToSnap =
                                ConditionGroup.FirstOrDefault(x => x.Type == ConditionType.Player_MinAPS).Values[0];

                            if (A_Collection.Me.HeroDetails.SnapShotted_APS < APS_ToSnap)
                                return true;
                        }
                        return false;

                    case ConditionType.MonstersInRange_MinHitpointsPercentage:
                        switch ((int) Values[2])
                        {
                            case 0:
                                return MonstersInRange.Count(x => T_ACD.get_HitpointsPercentage(x) >= Values[0]) <=
                                       Values[1];

                            case 1:
                                return MonstersInRange.Count(x => T_ACD.get_HitpointsPercentage(x) >= Values[0]) >=
                                       Values[1];
                        }
                        return false;

                    case ConditionType.MonstersInRange_MaxHitpointsPercentage:
                        switch ((int) Values[2])
                        {
                            case 0:
                                return MonstersInRange.Count(x => T_ACD.get_HitpointsPercentage(x) <= Values[0]) <=
                                       Values[1];

                            case 1:
                                return MonstersInRange.Count(x => T_ACD.get_HitpointsPercentage(x) <= Values[0]) >=
                                       Values[1];
                        }
                        return false;

                    case ConditionType.SelectedMonster_MonstersInRange_MinHitpointsPercentage:
                        switch ((int) Values[2])
                        {
                            case 0:
                                return
                                    SelectedMonster_MonstersInRange.Count(
                                        x => T_ACD.get_HitpointsPercentage(x) >= Values[0]) <= Values[1];

                            case 1:
                                return
                                    SelectedMonster_MonstersInRange.Count(
                                        x => T_ACD.get_HitpointsPercentage(x) >= Values[0]) >= Values[1];
                        }
                        return false;

                    case ConditionType.SelectedMonster_MonstersInRange_MaxHitpointsPercentage:
                        switch ((int) Values[2])
                        {
                            case 0:
                                return
                                    SelectedMonster_MonstersInRange.Count(
                                        x => T_ACD.get_HitpointsPercentage(x) <= Values[0]) <= Values[1];

                            case 1:
                                return
                                    SelectedMonster_MonstersInRange.Count(
                                        x => T_ACD.get_HitpointsPercentage(x) <= Values[0]) >= Values[1];
                        }
                        return false;

                    case ConditionType.SelectedMonster_MinHitpointsPercentage:
                        if (A_Collection.Me.HeroDetails.SelectedMonsterACD != null)
                            return
                                A_Tools.T_ACD.get_HitpointsPercentage(A_Collection.Me.HeroDetails.SelectedMonsterACD) >
                                Values[0];
                        return false;

                    case ConditionType.SelectedMonster_MaxHitpointsPercentage:
                        if (A_Collection.Me.HeroDetails.SelectedMonsterACD != null)
                            return
                                A_Tools.T_ACD.get_HitpointsPercentage(A_Collection.Me.HeroDetails.SelectedMonsterACD) <
                                Values[0];
                        return false;

                    case ConditionType.Player_StandStillTime:
                        switch ((int) Values[1])
                        {
                            case 0:
                                return !A_Collection.Me.HeroStates.isMoving &&
                                       new TimeSpan(DateTime.Now.Ticks -
                                                    A_Collection.Me.HeroDetails.StandStill_Start.Ticks).TotalSeconds*60 <=
                                       Values[0];

                            case 1:
                                return !A_Collection.Me.HeroStates.isMoving &&
                                       new TimeSpan(DateTime.Now.Ticks -
                                                    A_Collection.Me.HeroDetails.StandStill_Start.Ticks).TotalSeconds*60 >=
                                       Values[0];
                        }
                        return false;

                        case ConditionType.MonstersInRange_RiftProgress:
                        switch ((int) Values[1])
                        {
                            case 0:
                                return A_Tools.T_ACD.convert_ProgressPointsToPercentage(A_Tools.T_ACD.get_RiftProgress(MonstersInRange)) <= Values[0];

                            case 1:
                                return A_Tools.T_ACD.convert_ProgressPointsToPercentage(A_Tools.T_ACD.get_RiftProgress(MonstersInRange)) >= Values[0];

                        }
                        return false;

                    case ConditionType.SelectedMonster_MonstersInRange_RiftProgress:
                        switch ((int)Values[1])
                        {
                            case 0:
                                return A_Tools.T_ACD.convert_ProgressPointsToPercentage(A_Tools.T_ACD.get_RiftProgress(SelectedMonster_MonstersInRange)) <= Values[0];

                            case 1:
                                return A_Tools.T_ACD.convert_ProgressPointsToPercentage(A_Tools.T_ACD.get_RiftProgress(SelectedMonster_MonstersInRange)) >= Values[0];

                        }
                        return false;

                    case ConditionType.SelectedMonster_RiftProgress:
                        if (A_Collection.Me.HeroDetails.SelectedMonsterACD != null)
                        {
                            switch ((int) Values[1])
                            {
                                case 0:
                                    return
                                        A_Tools.T_ACD.convert_ProgressPointsToPercentage(A_Tools.T_ACD.get_RiftProgress(A_Collection.Me.HeroDetails.SelectedMonsterACD)) <=
                                        Values[0];

                                case 1:
                                    return
                                        A_Tools.T_ACD.convert_ProgressPointsToPercentage(A_Tools.T_ACD.get_RiftProgress(A_Collection.Me.HeroDetails.SelectedMonsterACD)) >=
                                        Values[0];

                            }
                        }
                        return false;

                }

                return false;
            }
            catch { return false; }
        }