コード例 #1
0
        public void DefensiveSpells()
        {
            if (this.Player.GetSpellRank("Renew") != 0 && !this.Player.GotBuff("Renew") && this.Player.ManaPercent >= 60 && this.Player.HealthPercent <= 90)
            {
                this.Player.CastWait("Renew", 1000);
            }
            #region party healing
            if (ZzukBot.API.BParty.IsInParty)
            {
                List <ZzukBot.Objects.WoWUnit> tmpPartyMemberList = BParty.GetMembers();

                foreach (ZzukBot.Objects.WoWUnit tmpMember in tmpPartyMemberList)
                {
                    //member not dead, out of range, or high health
                    if (tmpMember.HealthPercent <= 1 || tmpMember.DistanceToPlayer > 28 || tmpMember.HealthPercent >= 99)
                    {
                        continue;
                    }

                    if (this.Player.IsWandEquipped())
                    {
                        this.Player.StopWand();
                    }


                    //healing dot
                    if (!tmpMember.GotAura("Renew") && tmpMember.HealthPercent <= 90 && this.Player.GetSpellRank("Renew") != 0)
                    {
                        if (this.Player.TargetPartyMember(tmpMember))
                        {
                            this.Player.Cast("Renew");
                            ZzukBot.API.BMain.Me.ClearTarget();
                        }
                    }
                    //shield
                    if (this.Player.GetSpellRank("Power Word: Shield") != 0 && tmpMember.HealthPercent <= 30)
                    {
                        if (!tmpMember.GotAura("Power Word: Shield") && !tmpMember.GotDebuff("Weakened Soul") && this.Player.ManaPercent >= 10)
                        {
                            if (this.Player.TargetPartyMember(tmpMember))
                            {
                                this.Player.Cast("Power Word: Shield");
                                ZzukBot.API.BMain.Me.ClearTarget();
                            }
                        }
                    }
                    //healing
                    if (this.Player.GetSpellRank("Heal") != 0 && tmpMember.HealthPercent <= 60)
                    {
                        if (this.Player.TargetPartyMember(tmpMember))
                        {
                            this.Player.Cast("Heal");
                            ZzukBot.API.BMain.Me.ClearTarget();
                        }
                    }
                    if (this.Player.GetSpellRank("Lesser Heal") != 0 && tmpMember.HealthPercent <= 70 && this.Player.GetSpellRank("Heal") == 0)
                    {
                        if (this.Player.TargetPartyMember(tmpMember))
                        {
                            this.Player.Cast("Lesser Heal");
                            ZzukBot.API.BMain.Me.ClearTarget();
                        }
                    }
                }
            }
            #endregion
            if ((!this.Player.GotBuff("Power Word: Shield") && !this.Player.GotDebuff("Weakened Soul")) ||
                this.Player.HealthPercent <= 40 ||
                !this.Player.GotBuff("Inner Fire"))
            {
                if (debug == true)
                {
                    this.Player.DoString("DEFAULT_CHAT_FRAME:AddMessage('trying to reapply shield or heal')");
                }
                if (this.Player.GetSpellRank("Power Word: Shield") != 0)
                {
                    if (!this.Player.GotBuff("Power Word: Shield") && !this.Player.GotDebuff("Weakened Soul") && this.Player.ManaPercent >= 10)
                    {
                        this.Player.Cast("Power Word: Shield");
                    }
                }

                if (this.Player.HealthPercent <= 40)
                {
                    if (this.Player.GetSpellRank("Flash Heal") != 0 && this.Player.ManaPercent >= 60)
                    {
                        if (this.Player.GotBuff("Shadowform"))
                        {
                            this.Player.Cast("Shadowform");
                        }

                        this.Player.CastWait("Flash Heal", 1000);
                    }
                    else
                    {
                        if (this.Player.GetSpellRank("Heal") != 0)
                        {
                            this.Player.CastWait("Heal", 1000);
                        }
                        this.Player.CastWait("Lesser Heal", 1000);
                    }
                }

                if (this.Player.GetSpellRank("Inner Fire") != 0)
                {
                    if (!Player.GotBuff("Inner Fire"))
                    {
                        this.Player.Cast("Inner Fire");
                    }
                }
            }
        }
コード例 #2
0
        public override bool Buff()
        {
            try
            {
                if (this.Player.GetSpellRank("Touch of Weakness") != 0 && useTouchOfWeakness == true)
                {
                    if (!this.Player.GotBuff("Touch of Weakness"))
                    {
                        this.Player.Cast("Touch of Weakness");
                        return(false);
                    }
                }
                if (this.Player.GetSpellRank("Inner Fire") != 0)
                {
                    if (!this.Player.GotBuff("Inner Fire"))
                    {
                        this.Player.Cast("Inner Fire");
                        return(false);
                    }
                }
                if (this.Player.GetSpellRank("Power Word: Fortitude") != 0)
                {
                    if (!this.Player.GotBuff("Power Word: Fortitude"))
                    {
                        this.Player.Cast("Power Word: Fortitude");
                        return(false);
                    }
                }
                if (this.Player.GetSpellRank("Divine Spirit") != 0)
                {
                    if (!this.Player.GotBuff("Divine Spirit"))
                    {
                        this.Player.Cast("Divine Spirit");
                        return(false);
                    }
                }

                if (useShadowForm == true && !this.Player.GotBuff("Shadowform") && this.Player.CanUse("Shadowform"))
                {
                    this.Player.Cast("Shadowform");
                    return(false);
                }
                #region party buffing
                try
                {
                    if (ZzukBot.API.BParty.IsInParty)
                    {
                        List <ZzukBot.Objects.WoWUnit> tmpPartyMemberList = BParty.GetMembers();

                        foreach (ZzukBot.Objects.WoWUnit tmpMember in tmpPartyMemberList)
                        {
                            //member not dead, out of range
                            if (tmpMember.HealthPercent <= 1 || tmpMember.DistanceToPlayer > 28)
                            {
                                continue;
                            }

                            ZzukBot.API.Helper.WriteLogToConsole("checking " + tmpMember.PlayerName + " (" + tmpMember.Guid + ")");

                            if (this.Player.IsWandEquipped())
                            {
                                this.Player.StopWand();
                            }

                            if (!tmpMember.GotAura("Power Word: Fortitude") && this.Player.GetSpellRank("Power Word: Fortitude") != 0)
                            {
                                ZzukBot.API.Helper.WriteLogToConsole("need PWF! -> " + tmpMember.PlayerName + " (" + tmpMember.Guid + ")");
                                if (this.Player.TargetPartyMember(tmpMember))
                                {
                                    ZzukBot.API.Helper.WriteLogToConsole("set target to " + tmpMember.PlayerName + " (" + tmpMember.Guid + ")");
                                    this.Player.TryCast("Power Word: Fortitude");
                                    ZzukBot.API.BMain.Me.ClearTarget();
                                }
                            }
                        }
                    }
                }
                catch
                {
                    return(true);
                }
                #endregion



                //Talent point spending
                if (BMain.Me.TalentPointsAvailable() > 0)
                {
                    BMain.Me.TalentsLearnByString(Constants.TalentStrings);
                }
            }
            catch (Exception) { }
            //True means we are done buffing, or cannot buff
            return(true);
        }
コード例 #3
0
        //Buffs
        public override bool Buff()
        {
            if (this.Player.IsCasting != "")
            {
                return(false);
            }

            // Conjure Water
            if (this.Player.GetSpellRank("Conjure Water") != 0)
            {
                if (this.Player.ItemCount(WaterName[this.Player.GetSpellRank("Conjure Water")]) <= 5)
                {
                    this.Player.Cast("Conjure Water");
                    return(false);
                }
            }

            // Conjure Food
            if (this.Player.GetSpellRank("Conjure Food") != 0)
            {
                if (this.Player.ItemCount(FoodName[this.Player.GetSpellRank("Conjure Food")]) <= 5)
                {
                    this.Player.Cast("Conjure Food");
                    return(false);
                }
            }

            // Mage ARMOR Buffs ( Change "Mage" to whatever armor you want for the bot to cast it.)
            if (this.Player.GetSpellRank("Ice Armor") != 0)
            {
                if (!this.Player.GotBuff("Ice Armor"))
                {
                    this.Player.Cast("Ice Armor");
                    return(false);
                }
            }
            else
            {
                if (this.Player.GetSpellRank("Frost Armor") != 0)
                {
                    if (!this.Player.GotBuff("Frost Armor"))
                    {
                        this.Player.Cast("Frost Armor");
                        return(false);
                    }
                }
            }

            if (this.Player.GetSpellRank("Arcane Intellect") != 0)
            {
                if (!this.Player.GotBuff("Arcane Intellect"))
                {
                    this.Player.Cast("Arcane Intellect");
                    return(false);
                }
            }
            if (this.Player.GetSpellRank("Dampen Magic") != 0 && useDampenMagic)
            {
                if (!this.Player.GotBuff("Dampen Magic"))
                {
                    this.Player.Cast("Dampen Magic");
                    return(false);
                }
            }

            if (this.Player.ItemCount("Mana Agate") == 0)
            {
                if (this.Player.TryCast("Conjure Mana Agate") && this.Player.ItemCount("Mana Agate") == 0)
                {
                    this.Player.Cast("Conjure Mana Agate");
                    return(false);
                }
            }

            if (this.Player.GetSpellRank("Ice Barrier") != 0)
            {
                if (!this.Player.GotBuff("Ice Barrier"))
                {
                    if (this.Player.CanUse("Ice Barrier"))
                    {
                        this.Player.Cast("Ice Barrier");
                        return(false);
                    }
                    scrollBuff();
                }
            }
            #region party buffing
            try
            {
                if (ZzukBot.API.BParty.IsInParty)
                {
                    List <ZzukBot.Objects.WoWUnit> tmpPartyMemberList = BParty.GetMembers();

                    foreach (ZzukBot.Objects.WoWUnit tmpMember in tmpPartyMemberList)
                    {
                        if (tmpMember.HealthPercent <= 1 || tmpMember.DistanceToPlayer > 28)
                        {
                            continue;
                        }


                        if (!tmpMember.GotAura("Arcane Intellect") && this.Player.GetSpellRank("Arcane Intellect") != 0)
                        {
                            if (this.Player.TargetPartyMember(tmpMember))
                            {
                                this.Player.Cast("Arcane Intellect");
                                ZzukBot.API.BMain.Me.ClearTarget();
                            }
                        }
                    }
                }
            }
            catch
            {
                return(true);
            }
            #endregion


            //Talent point spending
            if (BMain.Me.TalentPointsAvailable() > 0)
            {
                BMain.Me.TalentsLearnByString(Constants.TalentStrings);
            }

            //True means we are done buffing, or cannot buff
            return(true);
        }