Beispiel #1
0
        public override void Fight(Character user, Character monster, Recast recast)
        {
            base.Fight(user, monster, recast);

            if (_valid == false)
                return;

            UIWindow ui = new UIWindow();
            ui.RefreshPointers();

            if (ui.GetActiveWindowName() == "chatlog")
                return;

            recast.Refresh();

            _scriptingObject.Cooldowns = recast;
            _scriptingObject.CurrentMonster = monster;
            _scriptingObject.CurrentUser = user;

            //Debug.Print("Fighting");
            try
            {

                var res = _host.Execute("Fight();");

                if (res != null)
                    Console.WriteLine(" = " + res.ToString());
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);

            }
        }
Beispiel #2
0
 public virtual void Fight(Character user, Character monster, Recast recast)
 {
     if (HasCure)
         if (user.Health_Percent < 50)
         {
             Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D0);
         }
 }
Beispiel #3
0
        public override void Fight(Character user, Character monster, Recast recast)
        {
            base.Fight(user, monster, recast);

            monster.Target();
            recast.Refresh();

            if (recast.WeaponSpecials.Count == 0)
            {
                Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D1);
            }
        }
Beispiel #4
0
        public override void Fight(Character user, Character monster, Recast recast)
        {
            base.Fight(user, monster, recast);

            //byte distance = monster.Distance;
            monster.Target();
            recast.Refresh(2.0);
            user.Refresh();

            ePosition position = monster.Position(user);

            Hotkeys hotkeys = new Hotkeys();
            Hotkeys.Hotkey highlightedAbility = null;

            hotkeys.RefreshAbilities();

            if (hotkeys.Abilities[92].InRange == 0)
                return;

            foreach (KeyValuePair<short, Hotkeys.Hotkey> hk in hotkeys.Abilities)
            {
                if (hk.Value.Highlighted && hk.Value.ID != 89)
                {
                    highlightedAbility = hk.Value;
                }
            }

            if (recast.Abilities.Contains(2) == false && user.TP_Current < 450)
            {
                hotkeys.Abilities[80].UseAbility(); // Invigorate
            } else if (recast.WeaponSpecials.Count == 0 && hotkeys.Abilities[75].InRange == 1)
            {

                //if (distance > 7)
                //{
                //    hotkeys.Abilities[90].UseAbility(); // Piercing Talon
                //} else
                if (highlightedAbility != null)
                {
                    if (highlightedAbility.ID == 84 && recast.Abilities.Contains(4) == false)
                    {
                        hotkeys.Abilities[83].UseAbility(); // Life Surge for Full Thrust
                    }
                    else
                    {
                        highlightedAbility.UseAbility();
                    }

                }
                else if (user.ContainsStatusEffect(115, 0, false) == false && position == ePosition.Side)
                    //Heavy Thrust Dmg Buff From Side
                {
                    hotkeys.Abilities[79].UseAbility();
                }
                else if (monster.ContainsStatusEffect(119, user.ID, true) == false) //Phlebotomize DOT
                {
                    hotkeys.Abilities[91].UseAbility();
                }
                else if (position == ePosition.Back && monster.ContainsStatusEffect(121, user.ID, true) == false)
                {
                    hotkeys.Abilities[81].UseAbility(); // Start Impulse Drive Combo
                }
                else
                {
                    hotkeys.Abilities[75].UseAbility(); // Start True Thrust Combo
                }

            }
            else
            {

                if ((recast.Abilities.Contains(5) == false || recast.SubAbilities.Contains(59) == false) && hotkeys.Abilities[75].InRange == 1)
                    // Blood for Blood or Internal Release
                {
                    Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D0);
                }

                if (monster.Name.Contains("Titan") == false)
                {
                    if (recast.Abilities.Contains(7) == false && recast.Abilities.Contains(10) == false)
                    {
                        hotkeys.Abilities[93].UseAbility(); // Power Surge
                    }
                    else if (recast.Abilities.Contains(10) == false)
                    {
                        hotkeys.Abilities[96].UseAbility(); // Dragonfire Dive
                    }
                    else if (recast.Abilities.Contains(6) == false)
                    {
                        hotkeys.Abilities[92].UseAbility(); // Jump
                    }
                    else if (recast.Abilities.Contains(9) == false)
                    {
                        hotkeys.Abilities[95].UseAbility(); // Spineshatter drive
                    }
                }
            }
        }
Beispiel #5
0
        public override void Fight(Character user, Character monster, Recast recast)
        {
            base.Fight(user, monster, recast);
            bool dotNeeded = !monster.ContainsStatusEffect(246, user.ID, true);
            bool dragonkickNeeded = !monster.ContainsStatusEffect(98, 0, false);
            bool lockIcon;
            monster.Target();
            recast.Refresh(2.0);

            try
            {

                ePosition position = monster.Position(user);

                Hotkeys hotkeys = new Hotkeys();
                Hotkeys.Hotkey highlightedAbility = null;

                hotkeys.RefreshAbilities();

                _mnkHelper.txt_Title.Content = "Position: " + position.ToString();

                if (user.ContainsStatusEffect(103, 0, false) == false && hotkeys[63].PercentReady == 100)
                {
                    hotkeys[63].UseAbility();
                }

                int colorOffset = (int)((hotkeys.Abilities[53].PercentReady - 25) * 3.4);
                if (colorOffset > 255)
                    colorOffset = 255;

                if (hotkeys.Abilities[53].PercentReady < 75)
                {
                    _mnkHelper.txt_Current.Foreground =
                        new SolidColorBrush(Color.FromRgb(255, 0, 255));
                    lockIcon = true;
                }
                else
                {
                    lockIcon = false;
                    _mnkHelper.txt_Current.Foreground = new SolidColorBrush(Color.FromRgb((byte)(255 - colorOffset), (byte)colorOffset, 0));
                }

                if (user.ContainsStatusEffect(110, 0, false))
                {
                    if (position == ePosition.Side)
                        highlightedAbility = hotkeys.Abilities[56]; // Snap Punch
                    else if (position == ePosition.Back)
                        highlightedAbility = hotkeys.Abilities[54]; // True Strike
                    else
                        highlightedAbility = hotkeys.Abilities[56]; // Snap Punch

                    if (hotkeys.Abilities[53].PercentReady > 50 && lockIcon == false)
                    {
                        SetCurrentAbilityImage(highlightedAbility.ID, recast, true, dotNeeded, dragonkickNeeded);
                    }

                }
                else
                {
                    foreach (KeyValuePair<short, Hotkeys.Hotkey> hk in hotkeys.Abilities)
                    {
                        if (hk.Value.Highlighted)
                        {
                            if (user.ContainsStatusEffect(101, 0, false) == false && hk.Value.ID == 61 && user.TP_Current >= 60) // Twin Snakes if damage buff is down
                            {
                                highlightedAbility = hk.Value;
                                break;
                            }
                            else if (hk.Value.ID == 58 && user.TP_Current >= 40) // Haymaker
                            {
                                highlightedAbility = hk.Value;
                                break;
                            }
                            else if (position == ePosition.Side)
                            {
                                if (hk.Value.ID == 61 && user.TP_Current >= 60) // Twin Snakes
                                {
                                    highlightedAbility = hk.Value;
                                }
                                else if (hk.Value.ID == 56 && user.TP_Current >= 50) // Snap Punch
                                {
                                    highlightedAbility = hk.Value;
                                }

                            }
                            else if (position == ePosition.Back)
                            {
                                if (hk.Value.ID == 54 && user.TP_Current >= 50) // True Strike
                                {
                                    highlightedAbility = hk.Value;
                                }
                                else if (hk.Value.ID == 66 && monster.ContainsStatusEffect(246, user.ID, true) == false && user.TP_Current >= 50) // Demolish DOT
                                {
                                    highlightedAbility = hk.Value;
                                }
                                else if (hk.Value.ID == 56 && user.TP_Current >= 50) // Snap Punch
                                {
                                    if (highlightedAbility != null)
                                        if (highlightedAbility.ID == 66)
                                            continue;

                                    highlightedAbility = hk.Value;
                                }
                            }
                            else
                            {
                                if (hk.Value.ID != 72 && hk.Value.ID != 36 && user.TP_Current >= 60)
                                {
                                    highlightedAbility = hk.Value;
                                }

                            }
                        }
                    }

                    // Check for highlighted abilities if there is no position combos available.
                    if (highlightedAbility == null)
                    {
                        foreach (KeyValuePair<short, Hotkeys.Hotkey> hk in hotkeys.Abilities)
                        {
                            if (hk.Value.Highlighted)
                            {
                                if (user.ContainsStatusEffect(101, 0, false) == false && hk.Value.ID == 61 && user.TP_Current >= 60)
                                    // Twin Snakes if damage buff is down
                                {
                                    highlightedAbility = hk.Value;
                                    break;
                                }

                                if (hk.Value.ID == 66 && monster.ContainsStatusEffect(246, user.ID, true) == false && user.TP_Current >= 50)
                                    // Demolish DOT
                                {
                                    highlightedAbility = hk.Value;
                                    break;
                                }

                                if (hk.Value.ID != 72 && hk.Value.ID != 36 && user.TP_Current >= 60)
                                    highlightedAbility = hk.Value;
                            }
                        }

                    }

                    if (highlightedAbility == null)
                    {
                        if (lockIcon == false)
                        {
                            if (monster.ContainsStatusEffect(106, user.ID, true) == false)
                            {
                                SetCurrentAbilityImage(68, recast, false, dotNeeded, dragonkickNeeded);
                                    // Touch of Death

                            }
                            else if (position == ePosition.Back)
                            {
                                SetCurrentAbilityImage(53, recast, false, dotNeeded, dragonkickNeeded);
                            }
                            else if (position == ePosition.Side)
                            {
                                SetCurrentAbilityImage(74, recast, false, dotNeeded, dragonkickNeeded);
                            }
                            else
                            {
                                SetCurrentAbilityImage(53, recast, false, dotNeeded, dragonkickNeeded);
                            }
                        }
                    }
                    else
                    {
                        if (hotkeys.Abilities[53].PercentReady > 75 && lockIcon == false)
                        {
                            SetCurrentAbilityImage(highlightedAbility.ID, recast, false, dotNeeded, dragonkickNeeded);
                        }
                    }
                }

                if (recast.SubAbilities.Contains(80) == false && user.TP_Current < 450)
                {
                    hotkeys.Abilities[80].UseAbility(); // Invigorate
                }
                else if (hotkeys.Abilities[53].PercentReady > 80 && hotkeys.Abilities[53].InRange == 1)
                {
                    if (highlightedAbility != null) // Use Combo
                    {
                        highlightedAbility.UseAbility();
                    }
                    else if (monster.ContainsStatusEffect(106, user.ID, true) == false && user.TP_Current >= 80) // Touch of Death
                    {
                        hotkeys.Abilities[68].UseAbility();
                    }
                    else if (position == ePosition.Back && user.TP_Current >= 60)
                    {
                        hotkeys.Abilities[53].UseAbility(); // Start Bootshine Combo
                    }
                    else if (position == ePosition.Side && user.TP_Current >= 60)
                    {
                        hotkeys.Abilities[74].UseAbility(); // Start Dragonkick
                    }
                    else if(user.TP_Current >= 60)
                    {
                        hotkeys.Abilities[53].UseAbility();
                    }
                }
                else if (hotkeys.Abilities[53].InRange == 1)
                {
                    if (recast.Abilities.Contains(3) == false || recast.SubAbilities.Contains(85) == false)
                    {
                        Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.Dash);
                    }
                    else if (recast.Abilities.Contains(8) == false && user.ContainsStatusEffect(112, 0, false) == false && user.ContainsStatusEffect(113, 0, false) == false && user.Level >= 50)
                    {
                        hotkeys.Abilities[69].UseAbility(); // Perfect Balance
                    }
                    else if (recast.Abilities.Contains(5) == false)
                    {
                        hotkeys.Abilities[64].UseAbility(); // Steel Peak
                    }
                    else if (recast.Abilities.Contains(7) == false)
                    {
                        hotkeys.Abilities[67].UseAbility(); // Howling Fist
                    }
                    else if (hotkeys[36].PercentReady >= 99 && hotkeys[36].IsInHotbar && hotkeys[36].Activated) // Mercy Stroke
                    {
                        hotkeys[36].UseAbility();
                    }

                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.StackTrace.ToString());
            }
        }
Beispiel #6
0
        private void SetCurrentAbilityImage(short id, Recast recast, bool perfectBalance, bool dotNeeded, bool dragonkickNeeded)
        {
            if (perfectBalance)
            {
                _mnkHelper.txt_Recommendation.Content = "Perfect Balance Active";
            } else if (dotNeeded)
            {
                _mnkHelper.txt_Recommendation.Content = "Demolish Needed (BACK)";
            }
            else if (dragonkickNeeded)
            {
                _mnkHelper.txt_Recommendation.Content = "Dragon Kick Needed (SIDE)";
            }
            else
            {
                _mnkHelper.txt_Recommendation.Content = "";
            }

            switch (id)
            {
                case 53:
                     _mnkHelper.img_Current.Source = new BitmapImage(new Uri("pack://application:,,/Resources/bootshine.png"));
                    _mnkHelper.txt_Current.Content = "Bootshine";
                    break;
                case 54:
                    _mnkHelper.img_Current.Source = new BitmapImage(new Uri("pack://application:,,/Resources/true strike.png"));
                    _mnkHelper.txt_Current.Content = "True Strike";
                    break;
                case 74:
                    _mnkHelper.img_Current.Source = new BitmapImage(new Uri("pack://application:,,/Resources/dragon kick.png"));
                    _mnkHelper.txt_Current.Content = "Dragon Kick";
                    break;
                case 61:
                    _mnkHelper.img_Current.Source = new BitmapImage(new Uri("pack://application:,,/Resources/twinsnakes.png"));
                    _mnkHelper.txt_Current.Content = "Twin Snakes (BUFF)";
                    break;
                case 56:
                    _mnkHelper.img_Current.Source = new BitmapImage(new Uri("pack://application:,,/Resources/snap punch.png"));
                    _mnkHelper.txt_Current.Content = "Snap Punch";
                    break;
                case 66:
                    _mnkHelper.img_Current.Source = new BitmapImage(new Uri("pack://application:,,/Resources/demolish.png"));
                    _mnkHelper.txt_Current.Content = "Demolish (DOT)";
                    break;
                case 70:
                    _mnkHelper.img_Current.Source = new BitmapImage(new Uri("pack://application:,,/Resources/rockbreaker.png"));
                    _mnkHelper.txt_Current.Content = "Rock Breaker";
                    break;
                case 68:
                    _mnkHelper.img_Current.Source = new BitmapImage(new Uri("pack://application:,,/Resources/touch of death.png"));
                    _mnkHelper.txt_Current.Content = "Touch of Death (DOT)";
                    break;
                case 58:
                    //_mnkHelper.img_Current.Source = new BitmapImage(new Uri("pack://application:,,/Resources/haymaker.png"));
                    //_mnkHelper.txt_Current.Content = "Haymaker";
                    break;
                default:
                    _mnkHelper.img_Current.Source = null;
                    _mnkHelper.txt_Current.Content = "";
                    break;
            }
        }
Beispiel #7
0
        public override void Reset()
        {
            base.Reset();

            Recast recast = new Recast();
            recast.Refresh();
            SetCurrentAbilityImage(0, recast, false, false, false);
        }
Beispiel #8
0
 public ScriptingObject(Character user, Character monster, Recast recast)
 {
     CurrentMonster = monster;
     CurrentUser = user;
     Cooldowns = recast;
     AttackStep = 0;
 }
Beispiel #9
0
        private void WhmCureMode()
        {
            Recast recast = new Recast();
            int curePotency = int.Parse(txt_CurePotency.Text);
            int cure2Potency = int.Parse(txt_Cure2Potency.Text);
            int hurtPlayers = 0;

            Character tank = null, tank2 = null;
            List<Character> monsters = new List<Character>();
            List<Character> fate = new List<Character>();
            List<Character> players = new List<Character>();
            List<Character> npcs = new List<Character>();
            List<Character> damagedTargets = new List<Character>();
            List<Character> deadTargets = new List<Character>();

            Character statusAilment = null;

            MemoryFunctions.GetCharacters(monsters, fate, players, ref _user);
            MemoryFunctions.GetNPCs(npcs);

            _hotkeys.QuickRefreshAbilities();

            if (_user.ContainsStatusEffect(292, 0, false))
                return;

            players.AddRange(npcs);

            List<Character> targets = (from player in players from target in _targets where player.Name.ToLower() == target.ToLower() select player).ToList();

            targets = targets.Distinct().ToList();

            if (_user.Health_Current == 0)
                return;

            recast.Refresh();

            if (_hotkeys[SHROUD].PercentReady == 100 && _user.Mana_Percent <= 70 && chk_WHMMode.IsChecked == true) // Shroud
            {
                _hotkeys[SHROUD].UseAbility();
            }

            if (_hotkeys[SHROUD].PercentReady == 100)
            {
                AggroHelper ah = new AggroHelper();
                List<Tuple<int, byte>> aggro = ah.GetAggroListWithEmnity();
                foreach(Tuple<int, byte> a in aggro)
                {
                    // Check if hate level is above 95%
                    if(a.Item2 >= 95)
                    {
                        // Check if the monster has less than 95% life.
                        Character aggroMob = MemoryFunctions.GetCharacterFromID(a.Item1);
                        if(aggroMob == null)
                        {
                            continue;
                        }
                        if (aggroMob.Health_Percent <= 90 && aggroMob.Health_Percent >= 1 && aggroMob.Name.ToLower().Contains("plume") == false)
                        {
                            Debug.Print("Hate Detected: " + a.Item2.ToString() + "   " + aggroMob.Name + "\n");
                            _hotkeys[SHROUD].UseAbility();
                        }
                    }
                }
            }

            foreach (Character target in targets)
            {
                target.Refresh();

                if (target.Name == txt_Tank.Text && target.ContainsStatusEffect(432, 0, false) == false)
                    tank = target;

                if (target.Name == txt_Tank2.Text && target.ContainsStatusEffect(432, 0, false) == false)
                    tank2 = target;

                if(target.Valid == false)
                    continue;

                if (target.ContainsStatusEffect(292, 0, false))
                    continue;

                if (target.ContainsStatusEffect(432, 0, false)) // Leviathan debuff
                    continue;

                if (target.DistanceFrom(_user) >= 30)
                    continue;

                if (target.Health_Current == 0)
                {
                    deadTargets.Add(target);
                    continue;
                }

                int healthMissing = target.Health_Max - target.Health_Current;

                if (healthMissing >= curePotency || target.Health_Percent < 70)
                {
                    damagedTargets.Add(target);
                    hurtPlayers++;
                }

                foreach (var item in lst_StatusEffects.Items)
                {
                    if (target.ContainsStatusEffect(Int32.Parse(item.ToString()), 0, false) && target.ContainsStatusEffect(292, 0, false) == false)
                       statusAilment = target;
                }
            }

            if (chk_SwiftcastRaiseAll.IsChecked == true)
            {
                deadTargets.Clear();
                deadTargets.AddRange(from player in players where player.Valid where !player.ContainsStatusEffect(292, 0, false) where !(player.DistanceFrom(_user) >= 30) where player.Health_Current == 0 select player);
            }

            damagedTargets = damagedTargets.Distinct().ToList();

            // Raise Tanks and Healers first
            deadTargets.Sort((a, b) => a.JobPriority.CompareTo(b.JobPriority));

            // Check if tank needs healing first
            if(chk_TankPriority.IsChecked == true)
            {

                // Check who is main tank atm.
                if (tank != null && tank2 != null)
                {
                    Character tank1Target = MemoryFunctions.GetCharacterFromID(tank.TargetID);
                    Character tank2Target = MemoryFunctions.GetCharacterFromID(tank2.TargetID);
                    Character highestHp = null;

                    if (tank2Target != null)
                    {
                        highestHp = tank2Target;
                    }

                    if (tank1Target != null)
                    {
                        highestHp = tank1Target;
                    }

                    if (tank2Target != null && highestHp != null)
                    {
                        if (tank2Target.Health_Max > highestHp.Health_Max)
                            highestHp = tank2Target;
                    }

                    if (highestHp != null)
                    {
                        Character monstersTarget = MemoryFunctions.GetCharacterFromID(highestHp.TargetID);

                        if (monstersTarget != null)
                            if (monstersTarget.Name == tank2.Name)
                            {
                                Character ph = tank;
                                tank = tank2;
                                tank2 = ph;
                            }
                    }
                }

                if (tank != null)
                    this.Title = "Main Tank: " + tank.Name;

                if (CheckTankHealth(tank, deadTargets, recast, damagedTargets)) return;
                if (CheckTankHealth(tank2, deadTargets, recast, damagedTargets)) return;
            }

            if (_user.IsMoving || MemoryFunctions.GetGroundCursor() > 0)
            {
                if (_spellCastTimer != null)
                {
                    _spellCastTimer.Stop();
                    _spellCastTimer = null;
                }
                _spellCast = false;

                if (tank != null)
                {
                    if (tank.ContainsStatusEffect(158, _user.ID, true, (float) 2.5) == false &&
                        _hotkeys[REGEN].PercentReady == 100 && tank.Health_Percent != 100)
                    {
                        tank.Target();
                        _hotkeys[REGEN].UseAbility();

                        return;
                    }
                }

                if (damagedTargets.Count > 0)
                {
                    damagedTargets.Sort((a, b) => a.Health_Percent.CompareTo(b.Health_Percent));
                    damagedTargets.First().Target();
                }

                return;
            }

            double avgMissingHealth = 0;

            if(damagedTargets.Count > 0)
                avgMissingHealth = damagedTargets.Average(a => (a.Health_Max - a.Health_Current));

            if ((chk_SwiftcastRaise.IsChecked == true || chk_SwiftcastRaiseAll.IsChecked == true) && deadTargets.Count > 0 && _hotkeys[SWIFTCAST].PercentReady == 100 && recast.WeaponSpecials.Count == 0 && _user.Mana_Current >= 798)
            {

                deadTargets.First().Target();
                Thread.Sleep(150);

                if (ForceSwiftcast()) return;

                Thread.Sleep(150);

                _hotkeys[RAISE].UseAbility();
                _hotkeys[RAISE].UseAbility();
                _hotkeys[RAISE].UseAbility();
                Thread.Sleep(50);
                _hotkeys[RAISE].UseAbility();

                Thread.Sleep(150);
            } else if (damagedTargets.Count > 0)
            {

                damagedTargets.Sort((a,b) => a.Health_Percent.CompareTo(b.Health_Percent));
                damagedTargets.First().Target();
                Thread.Sleep(100);

                recast.Refresh();

                // Benediction Check
                if(chk_TankPriority.IsChecked == false)
                {
                    if (damagedTargets.First().Health_Percent <= 30 && _hotkeys[BENEDICTION].PercentReady == 100)
                    {

                        _hotkeys[BENEDICTION].UseAbility();

                        _spellCastTimer = new Stopwatch();
                        _spellCastTimer.Reset();
                        _spellCastTimer.Start();
                        _spellCast = true;
                        return;
                    }
                }

                if (recast.WeaponSpecials.Count == 0)
                {
                    if (_spellCast)
                    {
                        _spellCastTimer = new Stopwatch();
                        _spellCastTimer.Reset();
                        _spellCastTimer.Start();
                        _spellCast = false;
                    }

                    // Make sure we are not spamming spells too quickly.
                    if (_spellCastTimer != null)
                    {
                        if (_spellCastTimer.ElapsedMilliseconds <= _castWaitTime)
                        {
                            return;
                        }
                        _spellCastTimer.Stop();
                        _spellCastTimer = null;
                    }

                    recast.Refresh();
                    Stopwatch timeout = new Stopwatch();
                    timeout.Reset();
                    timeout.Start();
                    //Debug.Print("Casting...");

                    bool useAoe = _hotkeys[MEDICA].TimeSinceLastUse.TotalSeconds > 6  &&
                                  _hotkeys[MEDICA2].TimeSinceLastUse.TotalSeconds > 6 &&
                                  _hotkeys[CURE3].TimeSinceLastUse.TotalSeconds > 6;

                    while (recast.WeaponSpecials.Count == 0)
                    {

                        UIWindow ui = new UIWindow();
                        ui.RefreshPointers();

                        if (ui.GetActiveWindowName() == "chatlog")
                            return;

                        if(timeout.ElapsedMilliseconds > 1000)
                        {
                            _spellCast = false;
                            break;
                        }

                        Whm_AI(hurtPlayers, damagedTargets, cure2Potency, useAoe);
                        recast.Refresh();
                        _hotkeys.QuickRefreshAbilities();
                        _spellCast = true;
                    }

                } else {
                    if (damagedTargets.Count > 2 && avgMissingHealth > curePotency)
                    {
                        if (_hotkeys[PRESENCEOFMIND].PercentReady == 100 && _user.ContainsStatusEffect(159, 0, false) == false)
                        {
                            _hotkeys[PRESENCEOFMIND].UseAbility();
                        }
                        else if (_hotkeys[DIVINESEAL].PercentReady == 100 && _user.ContainsStatusEffect(157, 0, false) == false)
                        {
                            _hotkeys[DIVINESEAL].UseAbility();
                        }
                    }
                }

            }  else if (statusAilment != null)
            {
                statusAilment.Target();
                _hotkeys[ESUNA].UseAbility();
            }
        }
Beispiel #10
0
        private void ScholarCureMode()
        {
            Recast recast = new Recast();
            int curePotency = int.Parse(txt_CurePotency.Text);
            int cure2Potency = int.Parse(txt_Cure2Potency.Text);
            //int maxMissing = 0;
            int hurtPlayers = 0;

            Character tank = null, tank2 = null;
            List<Character> monsters = new List<Character>();
            List<Character> fate = new List<Character>();
            List<Character> players = new List<Character>();
            List<Character> npcs = new List<Character>();
            List<Character> damagedTargets = new List<Character>();
            List<Character> deadTargets = new List<Character>();

            Character statusAilment = null;

            MemoryFunctions.GetCharacters(monsters, fate, players, ref _user);
            MemoryFunctions.GetNPCs(npcs);

            _hotkeys.QuickRefreshAbilities();

            if (_user.ContainsStatusEffect(292, 0, false))
                return;

            players.AddRange(npcs);

            List<Character> targets = (from player in players from target in _targets where player.Name.ToLower() == target.ToLower() select player).ToList();
            targets = targets.Distinct().ToList();
            if (_user.Health_Current == 0)
                return;

            if (_user.ContainsStatusEffect(451, 0, false, (float)3.0))
            {

                SoundModule.PlayAsyncSound("cursedVoice.wav");

                while (_user.ContainsStatusEffect(451, 0, false))
                {
                    Thread.Sleep(100);
                }

                Thread.Sleep(200);
            }

            recast.Refresh();

            if (recast.Abilities.Contains((int)Recast.eAbilities.Aetherflow) == false && _user.ContainsStatusEffect(304, 0, false, 1) == false) // Aetherflow
            {
                Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D5);
            }

            foreach (Character target in targets)
            {
                target.Refresh();

                if (target.Name == txt_Tank.Text)
                    tank = target;

                if (target.Name == txt_Tank2.Text)
                    tank2 = target;

                if (target.Valid == false)
                    continue;

                if (target.ContainsStatusEffect(292, 0, false))
                    continue;

                if (target.DistanceFrom(_user) >= 30)
                    continue;

                if (target.Health_Current == 0)
                {
                    deadTargets.Add(target);
                    continue;
                }

                int healthMissing = target.Health_Max - target.Health_Current;

                if (healthMissing >= curePotency || target.Health_Percent < 70)
                {
                    damagedTargets.Add(target);
                    hurtPlayers++;
                }

                foreach (var item in lst_StatusEffects.Items)
                {
                    if (target.ContainsStatusEffect(Int32.Parse(item.ToString()), 0, false) && target.ContainsStatusEffect(292, 0, false) == false)
                        statusAilment = target;
                }
            }

            if (chk_SwiftcastRaiseAll.IsChecked == true)
            {
                deadTargets.Clear();
                deadTargets.AddRange(from player in players where player.Valid where !player.ContainsStatusEffect(292, 0, false) where !(player.DistanceFrom(_user) >= 30) where player.Health_Current == 0 select player);
            }

            // Raise Tanks and Healers first
            deadTargets.Sort((a, b) => a.JobPriority.CompareTo(b.JobPriority));

            // Summon Eos only if the dead people do not include a tank or healer
            if (recast.SubAbilities.Contains((int)Recast.eSubAbilities.SwiftCast) == false && recast.WeaponSpecials.Count == 0)
            {
                List<Character> userPets = (from pet in monsters where pet.Owner == _user.ID select pet).ToList();
                if (userPets.Count == 0)
                {
                    if (deadTargets.Count > 0)
                    {
                        if (deadTargets.First().JobPriority > 2)
                        {
                            Thread.Sleep(150);

                            if (ForceSwiftcast()) return;

                            Thread.Sleep(350);

                            Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);
                            Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);
                            Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);
                            Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);
                            Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);
                            Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);

                            Thread.Sleep(750);
                            return;

                        }
                    }
                    else
                    {
                        Thread.Sleep(150);

                        if (ForceSwiftcast()) return;

                        Thread.Sleep(200);

                        Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);
                        Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);
                        Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);
                        Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D6);

                        Thread.Sleep(750);
                        return;
                    }

                }
            }

            // Check if tank needs healing first
            if (chk_TankPriority.IsChecked == true)
            {

                // Check who is main tank atm.
                if (tank != null && tank2 != null)
                {
                    Character tank1Target = MemoryFunctions.GetCharacterFromID(tank.TargetID);
                    Character tank2Target = MemoryFunctions.GetCharacterFromID(tank2.TargetID);
                    Character highestHp = null;

                    if (tank2Target != null)
                    {
                        highestHp = tank2Target;
                    }

                    if (tank1Target != null)
                    {
                        highestHp = tank1Target;
                    }

                    if (tank2Target != null && highestHp != null)
                    {
                        if (tank2Target.Health_Max > highestHp.Health_Max)
                            highestHp = tank2Target;
                    }

                    if (highestHp != null)
                    {
                        Character monstersTarget = MemoryFunctions.GetCharacterFromID(highestHp.TargetID);

                        if (monstersTarget != null)
                            if (monstersTarget.Name == tank2.Name)
                            {
                                Character ph = tank;
                                tank = tank2;
                                tank2 = ph;
                            }
                    }
                }

                if (tank != null)
                    this.Title = "Main Tank: " + tank.Name;

                if (CheckTankHealth(tank, deadTargets, recast, damagedTargets)) return;
                if (CheckTankHealth(tank2, deadTargets, recast, damagedTargets)) return;
            }

            if (_user.IsMoving || MemoryFunctions.GetGroundCursor() > 0)
            {
                if (_spellCastTimer != null)
                {
                    _spellCastTimer.Stop();
                    _spellCastTimer = null;
                }
                _spellCast = false;

                if (damagedTargets.Count > 0)
                {
                    damagedTargets.Sort((a, b) => a.Health_Percent.CompareTo(b.Health_Percent));
                    damagedTargets.First().Target();
                }

                return;
            }

            if ((chk_SwiftcastRaise.IsChecked == true || chk_SwiftcastRaiseAll.IsChecked == true) && deadTargets.Count > 0 && recast.SubAbilities.Contains((int)Recast.eSubAbilities.SwiftCast) == false && recast.WeaponSpecials.Count == 0 && _user.Mana_Current >= 798)
            {

                deadTargets.First().Target();
                Thread.Sleep(150);

                if (ForceSwiftcast()) return;

                Thread.Sleep(150);

                Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.Dash);
                Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.Dash);
                Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.Dash);

                Thread.Sleep(150);
            } else if (damagedTargets.Count > 0)
            {

                damagedTargets.Sort((a, b) => a.Health_Percent.CompareTo(b.Health_Percent));
                damagedTargets.First().Target();
                Thread.Sleep(100);

                recast.Refresh();

                if (recast.WeaponSpecials.Count == 0)
                {
                    if (_spellCast)
                    {
                        _spellCastTimer = new Stopwatch();
                        _spellCastTimer.Reset();
                        _spellCastTimer.Start();
                        _spellCast = false;
                    }

                    // Make sure we are not spamming spells too quickly.
                    if (_spellCastTimer != null)
                    {
                        if (_spellCastTimer.ElapsedMilliseconds <= _castWaitTime)
                        {
                            return;
                        }
                        _spellCastTimer.Stop();
                        _spellCastTimer = null;
                    }

                    recast.Refresh();
                    Stopwatch timeout = new Stopwatch();
                    timeout.Reset();
                    timeout.Start();

                    while (recast.WeaponSpecials.Count == 0)
                    {
                        if (timeout.ElapsedMilliseconds > 1000)
                        {
                            _spellCast = false;
                            break;
                        }

                        Utilities.Keyboard.KeyBoardHelper.KeyPress(hurtPlayers >= 3 ? Keys.Dash : Keys.D0);
                        recast.Refresh();
                        _spellCast = true;

                        _hotkeys.QuickRefreshAbilities();
                    }

                }
            }
            else if (statusAilment != null)
            {
                statusAilment.Target();
                Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.D0);
            }
        }
Beispiel #11
0
        private void RefreshAllPlayers()
        {
            Recast recast = new Recast();
            List<Character> monsters = new List<Character>();
            List<Character> fate = new List<Character>();
            List<Character> players = new List<Character>();

            MemoryFunctions.GetCharacters(monsters, fate, players, ref _user);

            int curePotency = int.Parse(txt_CurePotency.Text);
            Character maxMissingTarget = null;
            int maxMissing = 0;

            if (_user.Health_Current == 0 || _user.IsMoving)
                return;

            foreach (Character target in players)
            {
                if(target.DistanceFrom(_user) >= 30)
                    continue;

                if(target.Health_Current == 0)
                    continue;

                int healthMissing = target.Health_Max - target.Health_Current;

                if (healthMissing >= curePotency)
                {
                    if (healthMissing > maxMissing)
                    {
                        maxMissing = healthMissing;
                        maxMissingTarget = target;
                    }
                }
            }

            int userhealthMissing = _user.Health_Max - _user.Health_Current;

            if (userhealthMissing >= curePotency || _user.Health_Percent < 70)
            {
                maxMissingTarget = _user;
            }

            if (maxMissingTarget != null)
            {

                recast.Refresh();
                maxMissingTarget.Target();

                if (recast.WeaponSpecials.Count == 0)
                {
                    Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D0);
                }
            }
        }
Beispiel #12
0
        private bool CheckTankHealth(Character tank, List<Character> deadTargets, Recast recast, List<Character> damagedTargets)
        {
            if (tank != null)
            {

                // Benediction Check
                if (chk_WHMMode.IsChecked == true)
                {

                    if (tank.Health_Percent <= 25 && _hotkeys[BENEDICTION].PercentReady == 100 && tank.Health_Current > 0)
                    {
                        tank.Target();
                        Thread.Sleep(100);

                        _hotkeys[BENEDICTION].UseAbility();

                        _spellCastTimer = new Stopwatch();
                        _spellCastTimer.Reset();
                        _spellCastTimer.Start();
                        _spellCast = true;
                        return true;
                    }

                    // Swiftcast Heal
                    if (tank.Health_Percent <= 35 && _hotkeys[SWIFTCAST].PercentReady == 100 && deadTargets.Count == 0)
                    {
                        _hotkeys[SWIFTCAST].UseAbility();
                    }
                }

                if (damagedTargets.Contains(tank) && tank.Health_Percent < 80)
                {
                    damagedTargets.Clear();
                    damagedTargets.Add(tank);

                    if (_user.Health_Percent < 30 && damagedTargets.Count < 3)
                    {
                        damagedTargets.Add(_user);
                    }
                }
            }

            return false;
        }
Beispiel #13
0
        public MainWindow()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
            Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("en-US");

            InitializeComponent();

            MemoryLocations.GetMemlocs();

            MemoryFunctions.GetCharacters(_monsters, _fate, _players, ref _user);
            MemoryFunctions.GetNPCs(_npcs);
            MemoryFunctions.GetGathering(_gathering);

            RefreshCharacterList();

            string debugMsg="";
            Recast test = new Recast();
            test.Refresh();
            foreach(int a in test.Abilities)
                debugMsg += "\n" + ("Ability: " + a.ToString());

            foreach (int a in test.WeaponSpecials)
                debugMsg += "\n" + ("WS: " + a.ToString());

            foreach (int a in test.SubAbilities)
                debugMsg += "\n" + ("Sub Ability: " + a.ToString());

            System.Diagnostics.Debug.Print(debugMsg);
            _refresh.Interval = new TimeSpan(0, 0, 0, 0, 500);
            _refresh.Tick += RefreshUser_Tick;

            _refresh.IsEnabled = true;
            _refresh.Start();
        }
Beispiel #14
0
        public override void Fight(Character user, Character monster, Recast recast)
        {
            base.Fight(user, monster, recast);
            bool ignoreDOT = false;
            Hotkeys hotkeys = new Hotkeys();
            hotkeys.RefreshAbilities();

            if (hotkeys[STRAIGHTSHOT].InRange == 0)
                return;

            UIWindow ui = new UIWindow();
            ui.RefreshPointers();

            //  if (ui.GetActiveWindowName() == "chatlog")
            //      return;

            monster.Target();
            recast.Refresh(2.1);
            user.Refresh();

            if (user.ContainsStatusEffect2(451, (float) 3.5))
            {
                Debug.Print("Cursed Voice");
                SoundModule.PlayAsyncSound("cursedVoice.wav");

                while (user.ContainsStatusEffect(451, 0, false))
                {
                    Thread.Sleep(100);
                }

                Thread.Sleep(200);
                user.Refresh();
            }

            if (monster.Name.ToLower().Contains("renaud"))
                return;

            // Stop for turn 6 ability
            if (monster.UsingAbilityID == 1949)
            {
                //Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.D6);
                return;
            }

            List<Character> nearMobs = monster.MonstersNear(100.0);

            // Blight Turn 6
            if (nearMobs.Any(mob => mob.UsingAbilityID == 1949))
            {
                //Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.D6);
                return;
            }

            // Turn 7 Petrification
            if (nearMobs.Any(mob => mob.UsingAbilityID == 1979))
            {
                SoundModule.PlayAsyncSound("petrification.wav");
                //Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.D6);
                return;
            }
            if (nearMobs.Any(mob => mob.UsingAbilityID == 1969))
            {
                SoundModule.PlayAsyncSound("petrification.wav");
                //Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.D6);
                return;
            }

            if (user.ContainsStatusEffect(452, 0, false))
            {
                SoundModule.PlayAsyncSound("Shriek.wav");
            }

            //if (nearMobs.Any(mob => mob.UsingAbilityID == 1967))
            //{
            //    if (user.ContainsStatusEffect(452, 0, false))
            //    {
            //        SoundModule.PlayAsyncSound("Shriek.wav");
            //    }
            //    else
            //    {
            //        SoundModule.PlayAsyncSound("Shriek2.wav");
            //    }
            //}

            if (MemoryFunctions.GetGroundCursor() > 0)
                return;

            foreach (string mobToIgnore in _ignoreDOTMobs)
            {
                if (monster.Name.ToLower().Contains(mobToIgnore.ToLower()) &&
                    monster.Name.ToLower().Contains("gaoler") == false)
                {
                    ignoreDOT = true;
                }
            }

            if (MemoryFunctions.GetMapID() == 364 && monster.Name.Contains("Good King") == false)
                ignoreDOT = true;

            if (hotkeys[INTERNALRELEASE].PercentReady >= 99 &&
                user.Level >= 26 && Global.DisableBuffs == false && user.TP_Current >= 40 && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(INTERNALRELEASE, 21, MemoryFunctions.ActionType.Ability);
                hotkeys[INTERNALRELEASE].UseAbility();
            }
            else if (recast.WeaponSpecials.Count == 0)
            {
                if ((user.ContainsStatusEffect(130, 0, false, (float) 3.0) == false ||
                     user.ContainsStatusEffect(122, 0, false)) && user.Level >= 2 && user.TP_Current >= 70)
                {
                    //MemoryFunctions.ForceAction(STRAIGHTSHOT, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[STRAIGHTSHOT].UseAbility();
                }
                else if (monster.ContainsStatusEffect(124, user.ID, true, (float) 2.5) == false &&
                         user.Level >= 6 && user.TP_Current >= 100 && ignoreDOT == false && monster.StatusEffects().Count < 29)
                {
                    //MemoryFunctions.ForceAction(VENOMOUSBITE, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[VENOMOUSBITE].UseAbility();
                }
                else if (monster.ContainsStatusEffect(129, user.ID, true, (float) 2.5) == false &&
                         user.Level >= 30 && user.TP_Current >= 100 && monster.StatusEffects().Count < 29 &&
                         (ignoreDOT == false || monster.Name.ToLower().Contains("infernal nail")))
                {
                    //MemoryFunctions.ForceAction(WINDBITE, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[WINDBITE].UseAbility();
                }
                else if (hotkeys[HAYMAKER].Highlighted && user.Level >= 10 && user.TP_Current >= 40)
                {
                    //MemoryFunctions.ForceAction(HAYMAKER, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[HAYMAKER].UseAbility();
                }
                else if (user.TP_Current >= 60)
                {
                    //MemoryFunctions.ForceAction(HEAVYSHOT, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[HEAVYSHOT].UseAbility();
                }
            }
            else if (hotkeys[INVIGORATE].PercentReady >= 100 && user.Level >= 4 &&
                     user.TP_Current <= 550 && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(INVIGORATE, 20, MemoryFunctions.ActionType.Ability);
                hotkeys[INVIGORATE].UseAbility();

            }
            else if (hotkeys[RAGINGSTRIKES].PercentReady >= 100 && user.Level >= 4 && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(RAGINGSTRIKES, 19, MemoryFunctions.ActionType.Ability);
                hotkeys[RAGINGSTRIKES].UseAbility();
            }
            else if (hotkeys[BLOODFORBLOOD].PercentReady >= 100 && user.Level >= 38 &&
                     monster.Name.Contains("Twintania") == false &&
                     monster.Name.Contains("Conflagration") == false && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
                // && user.ContainsStatusEffect(125, 0, false) == false
            {
                //MemoryFunctions.ForceAction(BLOODFORBLOOD, 20, MemoryFunctions.ActionType.Ability);
                hotkeys[BLOODFORBLOOD].UseAbility();
            }
            else if (
                hotkeys[BLOODFORBLOOD].PercentReady >= 100 && user.Level >= 38 && monster.Name.Contains("Twintania") &&
                monster.Health_Percent <= 55 && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
                // && user.ContainsStatusEffect(125, 0, false) == false
            {
                //MemoryFunctions.ForceAction(BLOODFORBLOOD, 20, MemoryFunctions.ActionType.Ability);
                hotkeys[BLOODFORBLOOD].UseAbility();
            }
            else if (hotkeys[HAWKSEYE].PercentReady >= 100 && user.Level >= 26 && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(HAWKSEYE, 15, MemoryFunctions.ActionType.Ability);
                hotkeys[HAWKSEYE].UseAbility();
            }
            else if (hotkeys[BARRAGE].PercentReady >= 100 &&
                     user.Level >= 38 && monster.Name.Contains("Twintania") == false &&
                     monster.Name.Contains("Conflagration") == false && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(BARRAGE, 12, MemoryFunctions.ActionType.Ability);
                hotkeys[BARRAGE].UseAbility();
            }
            else if (hotkeys[BARRAGE].PercentReady >= 100 &&
                     user.Level >= 38 && monster.Name.Contains("Twintania") &&
                     monster.Health_Percent <= 55 && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(BARRAGE, 12, MemoryFunctions.ActionType.Ability);
                hotkeys[BARRAGE].UseAbility();
            }

            else if (hotkeys[BLOODLETTER].PercentReady >= 99 && user.Level >= 12 && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(BLOODLETTER, 16, MemoryFunctions.ActionType.Ability);
                hotkeys[BLOODLETTER].UseAbility();
            }
            else if (monster.Health_Percent <= 20 &&
                     hotkeys[MISERYSEND].PercentReady >= 99 && user.Level >= 8 && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(MISERYSEND, 16, MemoryFunctions.ActionType.Ability);
                hotkeys[MISERYSEND].UseAbility();
            }
            else if (
                hotkeys[BLUNTARROW].PercentReady >= 99 && user.Level >= 42 && Global.StunBotOpen == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(BLUNTARROW, 16, MemoryFunctions.ActionType.Ability);
                hotkeys[BLUNTARROW].UseAbility();
            }
        }