Beispiel #1
0
        private void comboboxTargetingSpellRune_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listboxTargetingTargets.SelectedIndex < 0)
            {
                return;
            }
            Modules.Cavebot.Target         t = (Modules.Cavebot.Target)listboxTargetingTargets.SelectedItem;
            Modules.Cavebot.Target.Setting s = t.GetSettingByIndex(this.currentSettingIndex);
            int index = comboboxTargetingSpellRune.SelectedIndex;

            if (index == 0)
            {
                s.Rune  = Modules.Cavebot.Target.Setting.Runes.None;
                s.Spell = string.Empty;
            }
            else if (index > 0 && index < 5)
            {
                s.Rune  = (Modules.Cavebot.Target.Setting.Runes)comboboxTargetingSpellRune.SelectedItem;
                s.Spell = string.Empty;
            }
            else
            {
                s.Rune  = Modules.Cavebot.Target.Setting.Runes.None;
                s.Spell = comboboxTargetingSpellRune.Text;
            }
        }
Beispiel #2
0
        private void comboboxTargetingStance_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listboxTargetingTargets.SelectedIndex < 0)
            {
                return;
            }
            Modules.Cavebot.Target         t = (Modules.Cavebot.Target)listboxTargetingTargets.SelectedItem;
            Modules.Cavebot.Target.Setting s = t.GetSettingByIndex(this.currentSettingIndex);
            switch (comboboxTargetingStance.SelectedIndex)
            {
            case 0:
                s.FightStance = Enums.FightStance.Follow;
                break;

            case 1:
                s.FightStance = Enums.FightStance.FollowDiagonalOnly;
                break;

            case 2:
                s.FightStance = Enums.FightStance.FollowStrike;
                break;

            case 3:
                s.FightStance = Enums.FightStance.Stand;
                break;

            case 4:
                s.FightStance = Enums.FightStance.DistanceFollow;
                break;

            case 5:
                s.FightStance = Enums.FightStance.DistanceWait;
                break;
            }
        }
Beispiel #3
0
 private void checkboxTargetingUseThisSetting_CheckedChanged(object sender, EventArgs e)
 {
     if (listboxTargetingTargets.SelectedIndex < 0)
     {
         return;
     }
     Modules.Cavebot.Target         t = (Modules.Cavebot.Target)listboxTargetingTargets.SelectedItem;
     Modules.Cavebot.Target.Setting s = t.GetSettingByIndex(this.currentSettingIndex);
     s.UseThisSetting = checkboxTargetingUseThisSetting.Checked;
 }
Beispiel #4
0
 private void numericTargetingRangeDistance_ValueChanged(object sender, EventArgs e)
 {
     if (listboxTargetingTargets.SelectedIndex < 0)
     {
         return;
     }
     Modules.Cavebot.Target         t = (Modules.Cavebot.Target)listboxTargetingTargets.SelectedItem;
     Modules.Cavebot.Target.Setting s = t.GetSettingByIndex(this.currentSettingIndex);
     s.DistanceRange = (byte)numericTargetingRangeDistance.Value;
 }
Beispiel #5
0
 private void comboboxTargetingMinCount_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listboxTargetingTargets.SelectedIndex < 0)
     {
         return;
     }
     Modules.Cavebot.Target         t = (Modules.Cavebot.Target)listboxTargetingTargets.SelectedItem;
     Modules.Cavebot.Target.Setting s = t.GetSettingByIndex(this.currentSettingIndex);
     s.Count = (byte)comboboxTargetingMinCount.SelectedIndex;
 }
Beispiel #6
0
        private void comboboxTargetingFightMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listboxTargetingTargets.SelectedIndex < 0)
            {
                return;
            }
            Modules.Cavebot.Target         t = (Modules.Cavebot.Target)listboxTargetingTargets.SelectedItem;
            Modules.Cavebot.Target.Setting s = t.GetSettingByIndex(this.currentSettingIndex);
            switch (comboboxTargetingFightMode.SelectedIndex)
            {
            case 0:
                s.FightMode = Enums.FightMode.Offensive;
                break;

            case 1:
                s.FightMode = Enums.FightMode.Balanced;
                break;

            case 2:
                s.FightMode = Enums.FightMode.Defensive;
                break;
            }
        }
Beispiel #7
0
        private void SetTargetingValues(int settingIndex)
        {
            if (listboxTargetingTargets.SelectedIndex < 0)
            {
                return;
            }
            this.currentSettingIndex = settingIndex;
            Modules.Cavebot.Target         t = (Modules.Cavebot.Target)listboxTargetingTargets.SelectedItem;
            Modules.Cavebot.Target.Setting s = t.GetSettingByIndex(this.currentSettingIndex);
            comboboxTargetingMinCount.SelectedIndex = s.Count;
            switch (s.FightStance)
            {
            case Enums.FightStance.Follow:
            default:
                comboboxTargetingStance.SelectedIndex = 0;
                break;

            case Enums.FightStance.FollowDiagonalOnly:
                comboboxTargetingStance.SelectedIndex = 1;
                break;

            case Enums.FightStance.FollowStrike:
                comboboxTargetingStance.SelectedIndex = 2;
                break;

            case Enums.FightStance.Stand:
                comboboxTargetingStance.SelectedIndex = 3;
                break;

            case Enums.FightStance.DistanceFollow:
                comboboxTargetingStance.SelectedIndex = 4;
                break;

            case Enums.FightStance.DistanceWait:
                comboboxTargetingStance.SelectedIndex = 5;
                break;
            }
            switch (s.FightMode)
            {
            case Enums.FightMode.Offensive:
                comboboxTargetingFightMode.SelectedIndex = 0;
                break;

            case Enums.FightMode.Balanced:
                comboboxTargetingFightMode.SelectedIndex = 1;
                break;

            case Enums.FightMode.Defensive:
                comboboxTargetingFightMode.SelectedIndex = 2;
                break;
            }
            if (s.Spell == string.Empty && s.Rune == Modules.Cavebot.Target.Setting.Runes.None)
            {
                comboboxTargetingSpellRune.SelectedIndex = 0;
            }
            else
            {
                for (int i = 0; i < comboboxTargetingSpellRune.Items.Count; i++)
                {
                    string val = comboboxTargetingSpellRune.Items[i].ToString();
                    if (val == s.Rune.ToString() || val == s.Spell)
                    {
                        comboboxTargetingSpellRune.SelectedIndex = i;
                        break;
                    }
                }
            }
            numericTargetingDanger.Value            = s.DangerLevel;
            numericTargetingRange.Value             = s.Range;
            numericTargetingRangeDistance.Value     = s.DistanceRange;
            checkboxTargetingReachable.Checked      = s.MustBeReachable;
            checkboxTargetingShootable.Checked      = s.MustBeShootable;
            checkboxTargetingLoot.Checked           = t.DoLoot;
            checkboxTargetingUseThisSetting.Checked = s.UseThisSetting;
        }