示例#1
0
        private void cmdRefresh_Click(object sender, EventArgs e)
        {
            WoW.KeyPressRelease(WoW.Keys.D0);
            Thread.Sleep(400);

            Log.Clear();
            // Row 1 Pixel Testing
            Log.Write("Player Health: " + WoW.HealthPercent);
            Log.Write("Player Level: " + WoW.Level);
            Log.Write("Player Power: " + WoW.Power);
            Log.Write("Target Health: " + WoW.TargetHealthPercent);
            Log.Write("Unit In Combat: " + WoW.IsInCombat);
            Log.Write("Unit Power: " + WoW.UnitPower);
            Log.Write("Target Is Friend: " + WoW.TargetIsFriend);
            Log.Write("Has Target: " + WoW.HasTarget);
            Log.Write("Player Is Casting: " + WoW.PlayerIsCasting);
            Log.Write("Target Is Casting: " + WoW.TargetIsCasting);
            Log.Write("Player Haste Percent: " + WoW.HastePercent);
            Log.Write("Target Visible: " + WoW.TargetIsVisible);
            Log.Write("Pet Out: " + WoW.HasPet);
            Log.Write("Pet Health: " + WoW.PetHealthPercent);
            Log.Write("Wild Imps Count: " + WoW.WildImpsCount);
            Log.Write("Dreadstalkers Count: " + WoW.DreadstalkersCount);
            // Row 2 Pixel Testing

            Log.Write("Is Moving: " + WoW.IsMoving);
            Log.Write("Auto Attacking: " + WoW.AutoAtacking);
            Log.Write("Target Is Player: " + WoW.TargetIsPlayer);
            Log.Write("Flag: " + WoW.Flag);
            Log.Write("Last Casted Id: " + WoW.LastSpellCastedID);
            Log.Write("Target Casting Id: " + WoW.TargetCastingSpellID);
            for (int i = 1; i < 8; i++)
            {
                Log.Write($"Talent {i} : " + WoW.Talent(i));
            }
            Log.Write($"Race : " + WoW.PlayerRace + " Spec : " + WoW.PlayerSpec);
            for (int i = 19; i < 21; i++)
            {
                Log.Write($"SetBonus T{i}: " + WoW.SetBonus(i));
            }
            for (int i = 1; i < 3; i++)
            {
                Log.Write($"Legendary {i}: " + WoW.Legendary(i));
            }

            while (WoW.TargetCastingSpellID != 0)
            {
                Log.Write("Target % Cast: " + WoW.TargetPercentCast);
                Thread.Sleep(100);
            }
        }
        public override void Pulse()
        {
            if (WoW.IsInCombat && Control.IsKeyLocked(Keys.Scroll) && !WoW.TargetIsPlayer && !WoW.IsMounted)
            {
                SelectRotation(4, 100, 1);
            }

            if (DetectKeyPress.GetKeyState(0x6A) < 0)
            {
                UseCooldowns = !UseCooldowns;
                Thread.Sleep(150);
            }
            if (WoW.IsInCombat && !WoW.HasTarget)
            {
                WoW.KeyPressRelease(WoW.Keys.Tab);
                return;
            }
            if (WoW.HasTarget && WoW.TargetIsEnemy && WoW.IsInCombat)
            {
                Log.Write("focus * cdremain KC >300 : " + ((FocusRegen * WoW.SpellCooldownTimeRemaining("Kill Command")) > 300));
                if (WoW.CanCast("FeignDeath") && WoW.HealthPercent <= ConfigFile.ReadValue <int>("Hunter", "FeignDeath Percent") && FeignDeath && !WoW.IsSpellOnCooldown("FeignDeath") && WoW.HealthPercent != 0)
                {
                    WoW.CastSpell("FeignDeath");
                    return;
                }
                if (WoW.CanCast("Exhilaration") && WoW.HealthPercent <= ConfigFile.ReadValue <int>("Hunter", "Exhilaration Percent") && Exhilaration && !WoW.IsSpellOnCooldown("Exhilaration") && WoW.HealthPercent != 0)
                {
                    WoW.CastSpell("Exhilaration");
                    return;
                }
                if (WoW.CanCast("AspectoftheTurtle") && WoW.HealthPercent <= ConfigFile.ReadValue <int>("Hunter", "AspectoftheTurtle Percent") && AspectoftheTurtle && !WoW.IsSpellOnCooldown("AspectoftheTurtle") && WoW.HealthPercent != 0)
                {
                    WoW.CastSpell("AspectoftheTurtle");
                    return;
                }
                if (WoW.CanCast("Ancient Healing Potion") && WoW.HealthPercent < 20 && !WoW.IsSpellOnCooldown("Ancient Healing Potion") && WoW.HealthPercent != 0)
                {
                    WoW.CastSpell("Ancient Healing Potion");
                    return;
                }
                if (WoW.CanCast("Silkweave Bandage") && WoW.HealthPercent < 40 && WoW.PlayerHasBuff("Turtle") && !WoW.IsMoving && !WoW.PlayerHasDebuff("Bandaged"))
                {
                    WoW.CastSpell("Silkweave Bandage");
                    return;
                }

                if (!WoW.HasPet && WoW.CanCast("Wolf"))
                {
                    WoW.CastSpell("Wolf");
                    return;
                }
                if (WoW.PetHealthPercent <= 0 && WoW.CanCast("Phoenix"))
                {
                    WoW.CastSpell("Phoenix");
                    return;
                }

                if (WoW.PetHealthPercent <= 90 &&
                    !WoW.PetHasBuff("Heal Pet") &&
                    HealPet &&
                    WoW.CanCast("Revive Pet") &&
                    !WoW.IsMoving)
                {
                    WoW.CastSpell("Heal Pet");
                    return;
                }
                if (WoW.PetHealthPercent <= 0 &&
                    WoW.IsSpellOnCooldown("Phoenix") &&
                    WoW.CanCast("Revive Pet") &&
                    !WoW.IsMoving)
                {
                    WoW.CastSpell("Revive Pet");
                    return;
                }
                if (WoW.TargetIsCasting)
                {
                    if (WoW.CanCast("Counter Shot") &&
                        WoW.TargetIsCastingAndSpellIsInterruptible &&
                        WoW.TargetPercentCast >= 60 &&
                        !WoW.IsSpellOnCooldown("Counter Shot") &&
                        !WoW.PlayerIsChanneling &&
                        !WoW.WasLastCasted("Counter Shot"))
                    {
                        WoW.CastSpell("Counter Shot");
                        return;
                    }
                }
            }
            if (combatRoutine.Type == RotationType.SingleTarget || combatRoutine.Type == RotationType.SingleTargetCleave)
            {
                if (WoW.HasTarget && WoW.TargetIsEnemy && WoW.IsInCombat)
                {
                    if (WoW.CanCast("A Murder of Crows") &&
                        WoW.Talent(6) == 1 &&
                        WoW.Focus >= 25 &&
                        WoW.IsSpellInRange("Cobra Shot") &&
                        !WoW.IsSpellOnCooldown("A Murder of Crows"))
                    {
                        WoW.CastSpell("A Murder of Crows");
                        return;
                    }

                    if (WoW.CanCast("Volley") &&
                        !WoW.PlayerHasBuff("Volley") &&
                        WoW.Talent(6) == 3)
                    {
                        WoW.CastSpell("Volley");
                        return;
                    }
                    if (WoW.CanCast("Arcane Torrent")

                        && !WoW.IsSpellOnCooldown("Arcane Torrent") &&
                        WoW.PlayerRace == "BloodElf" &&
                        WoW.Focus <= 85)
                    {
                        WoW.CastSpell("Arcane Torrent");
                        return;
                    }
                    if (WoW.CanCast("Berserking")

                        && !WoW.IsSpellOnCooldown("Berserking") &&
                        WoW.PlayerRace == "Troll")
                    {
                        WoW.CastSpell("Berserking");
                        return;
                    }
                    if (WoW.CanCast("Blood Fury")

                        && !WoW.IsSpellOnCooldown("Blood Fury") &&
                        WoW.PlayerRace == "Orc")
                    {
                        WoW.CastSpell("Blood Fury");
                        return;
                    }
                    if (WoW.CanCast("Chimaera Shot") &&
                        WoW.Focus < 90 &&
                        WoW.IsSpellOnCooldown("Dire Frenzy") &&
                        WoW.IsSpellOnCooldown("Kill Command") &&
                        WoW.CanCast("Chimaera Shot") &&
                        WoW.Talent(2) == 3)
                    {
                        WoW.CastSpell("Chimaera Shot");
                        return;
                    }
                    if (WoW.CanCast("Kil'jaeden's Burning Wish") && KilJaeden && !WoW.ItemOnCooldown("Kil'jaeden's Burning Wish") && !WoW.IsSpellOnCooldown("Kil'jaeden's Burning Wish"))
                    {
                        WoW.CastSpell("Kil'jaeden's Burning Wish");
                        return;
                    }
//	stampede,if=buff.bloodlust.up|buff.bestial_wrath.up|cooldown.bestial_wrath.remains<=2|target.time_to_die<=14
                    if (WoW.CanCast("Stampede") && WoW.Talent(7) == 1 && WoW.IsSpellInRange("Cobra Shot") && ((WoW.PlayerHasBuff("Bestial Wrath")) || (WoW.SpellCooldownTimeRemaining("Bestial Wrath") <= 2)) &&
                        !WoW.PlayerHasBuff("AspectoftheTurtle") &&
                        !WoW.IsSpellOnCooldown("Stampede"))
                    {
                        WoW.CastSpell("Stampede");

                        return;
                    }
//dire_beast,if=cooldown.bestial_wrath.remains>3
                    if (WoW.CanCast("Dire Beast") && WoW.Talent(2) != 2 && !WoW.IsSpellOnCooldown("Dire Beast") && WoW.SpellCooldownTimeRemaining("Bestial Wrath") > 300 && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Dire Beast");
                        return;
                    }
//dire_frenzy,if=(cooldown.bestial_wrath.remains>6&(!equipped.the_mantle_of_command|pet.cat.buff.dire_frenzy.remains<=gcd.max*1.2))
                    if (WoW.CanCast("Dire Frenzy") && (WoW.SpellCooldownTimeRemaining("Bestial Wrath") > 600 && (WoW.Legendary(1) != 3 || WoW.PetBuffTimeRemaining("Dire Frenzy") <= 70)) && WoW.Talent(2) == 2 && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Dire Frenzy");
                        return;
                    }
//|(charges>=2&focus.deficit>=25+talent.dire_stable.enabled*12)|target.time_to_die<9
                    if (WoW.CanCast("Dire Frenzy") && WoW.PlayerSpellCharges("Dire Frenzy") >= 2 && WoW.Focus <= 95 && WoW.Talent(2) == 2 && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Dire Frenzy");
                        return;
                    }
                    if (WoW.CanCast("Dire Frenzy") && WoW.PlayerSpellCharges("Dire Frenzy") >= 2 && WoW.Focus <= 83 && WoW.Talent(2) == 2 && WoW.Talent(1) == 3 && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Dire Frenzy");
                        return;
                    }
//aspect_of_the_wild,if=buff.bestial_wrath.up|target.time_to_die<12
                    if (WoW.CanCast("Aspect of the Wild") && UseCooldowns && WoW.PlayerHasBuff("Bestial Wrath") && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Aspect of the Wild");
                        return;
                    }
//titans_thunder,if=talent.dire_frenzy.enabled|cooldown.dire_beast.remains>=3|(buff.bestial_wrath.up&pet.dire_beast.active)
                    if (WoW.CanCast("Titan's Thunder") && (WoW.Talent(2) == 2 || (WoW.Talent(2) != 2 && WoW.SpellCooldownTimeRemaining("Dire Beast") > 300) || (WoW.Talent(2) != 2 && WoW.PlayerHasBuff("Bestial Wrath") && WoW.PlayerHasBuff("Dire Beast"))) && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Titan's Thunder");
                        return;
                    }
//bestial_wrath
                    if (WoW.CanCast("Bestial Wrath") && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Bestial Wrath");
                        return;
                    }
//kill_command
                    if (WoW.CanCast("Kill Command") && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Kill Command");
                        return;
                    }
//cobra_shot,if=(cooldown.kill_command.remains>focus.time_to_max&cooldown.bestial_wrath.remains>focus.time_to_max)|(buff.bestial_wrath.up&focus.regen*cooldown.kill_command.remains>30)|target.time_to_die<cooldown.kill_command.remains
                    if (WoW.CanCast("Cobra Shot") && WoW.Focus > 32 && (WoW.SpellCooldownTimeRemaining("Kill Command") > FocusTimetoMax && WoW.SpellCooldownTimeRemaining("Bestial Wrath") > FocusTimetoMax)

                        && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Cobra Shot");
                        return;
                    }
                    if (WoW.CanCast("Cobra Shot") && WoW.Focus > 32 && WoW.PlayerHasBuff("Bestial Wrath") && ((FocusRegen * WoW.SpellCooldownTimeRemaining("Kill Command")) > 300) && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Cobra Shot");
                        return;
                    }
                }
            }

            if (combatRoutine.Type == RotationType.AOE)
            {
                if (WoW.HasTarget && WoW.TargetIsEnemy && WoW.IsInCombat)
                {
                    if (WoW.CanCast("Kil'jaeden's Burning Wish") && KilJaeden && !WoW.ItemOnCooldown("Kil'jaeden's Burning Wish") && !WoW.IsSpellOnCooldown("Kil'jaeden's Burning Wish"))
                    {
                        WoW.CastSpell("Kil'jaeden's Burning Wish");
                        return;
                    }
                    if (WoW.CanCast("Volley") &&
                        !WoW.PlayerHasBuff("Volley") &&
                        WoW.Talent(6) == 3)
                    {
                        WoW.CastSpell("Volley");
                        return;
                    }
                    if (WoW.CanCast("Berserking")

                        && !WoW.IsSpellOnCooldown("Berserking") &&
                        WoW.PlayerRace == "Troll")
                    {
                        WoW.CastSpell("Berserking");
                        return;
                    }
                    if (WoW.CanCast("Arcane Torrent") &&
                        WoW.PlayerRace == "BloodElf" &&
                        WoW.Focus <= 85)
                    {
                        WoW.CastSpell("Arcane Torrent");
                        return;
                    }
                    if (WoW.CanCast("Blood Fury")

                        && !WoW.IsSpellOnCooldown("Blood Fury") &&
                        WoW.PlayerRace == "Orc")
                    {
                        WoW.CastSpell("Blood Fury");
                        return;
                    }
                    if (WoW.CanCast("Barrage") &&
                        WoW.Talent(6) == 2 &&
                        !WoW.IsSpellOnCooldown("Barrage") &&
                        WoW.IsSpellInRange("Cobra Shot") &&
                        WoW.Focus >= 60)
                    {
                        WoW.CastSpell("Barrage");
                        return;
                    }
                    if (WoW.CanCast("Chimaera Shot") &&
                        WoW.Focus < 90 &&
                        WoW.IsSpellOnCooldown("Dire Frenzy") &&
                        WoW.IsSpellOnCooldown("Kill Command") &&
                        WoW.CanCast("Chimaera Shot") &&
                        WoW.Talent(2) == 3)
                    {
                        WoW.CastSpell("Chimaera Shot");
                        return;
                    }
                    if (WoW.CanCast("A Murder of Crows") &&
                        WoW.Talent(6) == 1 &&
                        WoW.Focus >= 46 - FocusRegen &&
                        WoW.PetBuffTimeRemaining("Beast Cleave") > GCD &&
                        WoW.IsSpellInRange("Cobra Shot") &&
                        !WoW.IsSpellOnCooldown("A Murder of Crows"))
                    {
                        WoW.CastSpell("A Murder of Crows");
                        return;
                    }
                    if (WoW.CanCast("Multi-Shot") &&
                        WoW.Focus >= 40 &&
                        !WoW.PetHasBuff("Beast Cleave") &&
                        WoW.IsSpellInRange("Multi-Shot"))
                    {
                        WoW.CastSpell("Multi-Shot");
                        return;
                    }
                    if (WoW.CanCast("Multi-Shot") &&
                        WoW.Focus >= 40 &&
                        WoW.PetHasBuff("Beast Cleave") &&
                        WoW.PetBuffTimeRemaining("Beast Cleave") <= 70 &&
                        WoW.IsSpellInRange("Multi-Shot"))
                    {
                        WoW.CastSpell("Multi-Shot");
                        return;
                    }
//	stampede,if=buff.bloodlust.up|buff.bestial_wrath.up|cooldown.bestial_wrath.remains<=2|target.time_to_die<=14
                    if (WoW.CanCast("Stampede") && WoW.Talent(7) == 1 && WoW.IsSpellInRange("Cobra Shot") && ((WoW.PlayerHasBuff("Bestial Wrath")) || (WoW.SpellCooldownTimeRemaining("Bestial Wrath") <= 2)) &&
                        !WoW.PlayerHasBuff("AspectoftheTurtle") &&
                        !WoW.IsSpellOnCooldown("Stampede"))
                    {
                        WoW.CastSpell("Stampede");

                        return;
                    }
//dire_beast,if=cooldown.bestial_wrath.remains>3
                    if (WoW.CanCast("Dire Beast") && WoW.Talent(2) != 2 && !WoW.IsSpellOnCooldown("Dire Beast") && WoW.SpellCooldownTimeRemaining("Bestial Wrath") > 300 && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Dire Beast");
                        return;
                    }
//dire_frenzy,if=(cooldown.bestial_wrath.remains>6&(!equipped.the_mantle_of_command|pet.cat.buff.dire_frenzy.remains<=gcd.max*1.2))
                    if (WoW.CanCast("Dire Frenzy") && (WoW.SpellCooldownTimeRemaining("Bestial Wrath") > 600 && (WoW.Legendary(1) != 3 || WoW.PetBuffTimeRemaining("Dire Frenzy") <= 70)) && WoW.Talent(2) == 2 && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Dire Frenzy");
                        return;
                    }
//|(charges>=2&focus.deficit>=25+talent.dire_stable.enabled*12)|target.time_to_die<9
                    if (WoW.CanCast("Dire Frenzy") && WoW.PlayerSpellCharges("Dire Frenzy") >= 2 && WoW.Focus <= 95 && WoW.Talent(2) == 2 && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Dire Frenzy");
                        return;
                    }
                    if (WoW.CanCast("Dire Frenzy") && WoW.PlayerSpellCharges("Dire Frenzy") >= 2 && WoW.Focus <= 83 && WoW.Talent(2) == 2 && WoW.Talent(1) == 3 && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Dire Frenzy");
                        return;
                    }
//aspect_of_the_wild,if=buff.bestial_wrath.up|target.time_to_die<12
                    if (WoW.CanCast("Aspect of the Wild") && UseCooldowns && WoW.PetHasBuff("Beast Cleave") && WoW.PetBuffTimeRemaining("Beast Cleave") > GCD && WoW.PlayerHasBuff("Bestial Wrath") && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Aspect of the Wild");
                        return;
                    }
//titans_thunder,if=talent.dire_frenzy.enabled|cooldown.dire_beast.remains>=3|(buff.bestial_wrath.up&pet.dire_beast.active)
                    if (WoW.CanCast("Titan's Thunder") && WoW.PetHasBuff("Beast Cleave") && WoW.PetBuffTimeRemaining("Beast Cleave") > GCD && (WoW.Talent(2) == 2 || (WoW.Talent(2) != 2 && WoW.SpellCooldownTimeRemaining("Dire Beast") > 300) || (WoW.Talent(2) != 2 && WoW.PlayerHasBuff("Bestial Wrath") && WoW.PlayerHasBuff("Dire Beast"))) && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Titan's Thunder");
                        return;
                    }
//bestial_wrath
                    if (WoW.CanCast("Bestial Wrath") && WoW.PetHasBuff("Beast Cleave") && WoW.PetBuffTimeRemaining("Beast Cleave") > GCD && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Bestial Wrath");
                        return;
                    }
//kill_command
                    if (WoW.CanCast("Kill Command") && WoW.Focus >= 70 - FocusRegen && WoW.PetHasBuff("Beast Cleave") && WoW.PetBuffTimeRemaining("Beast Cleave") > GCD && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Kill Command");
                        return;
                    }
//cobra_shot,if=(cooldown.kill_command.remains>focus.time_to_max&cooldown.bestial_wrath.remains>focus.time_to_max)|(buff.bestial_wrath.up&focus.regen*cooldown.kill_command.remains>30)|target.time_to_die<cooldown.kill_command.remains
                    if (WoW.CanCast("Cobra Shot") && WoW.PetHasBuff("Beast Cleave") && WoW.PetBuffTimeRemaining("Beast Cleave") > GCD && WoW.Focus > 72 - FocusRegen && (WoW.SpellCooldownTimeRemaining("Kill Command") > FocusTimetoMax && WoW.SpellCooldownTimeRemaining("Bestial Wrath") > FocusTimetoMax)

                        && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Cobra Shot");
                        return;
                    }
                    if (WoW.CanCast("Cobra Shot") && WoW.PetHasBuff("Beast Cleave") && WoW.PetBuffTimeRemaining("Beast Cleave") > GCD && WoW.Focus > 72 - FocusRegen && WoW.PlayerHasBuff("Bestial Wrath") && ((FocusRegen * WoW.SpellCooldownTimeRemaining("Kill Command")) > 300) && WoW.IsSpellInRange("Cobra Shot"))
                    {
                        WoW.CastSpell("Cobra Shot");
                        return;
                    }
                }
            }
        }