private bool IsTankParty(int partyID)
        {
            if (WoW.HealthPercent != 0)
            {
                if (partyID == 0)
                {
                    return(false);
                }
                var c = WoW.GetBlockColor(partyID + 1, 21);
                if (c.B <= 80 && c.B != 0)
                {
                    if (tankTankingID == -1)
                    {
                        tankTankingID = partyID;
                    }
                }

                try
                {
                    return(c.B <= 80);
                }
                catch (Exception ex)
                {
                    Log.Write($"[Health] Blue = {c.B}");
                    Log.Write(ex.Message, Color.Red);
                    return(false);
                }
            }
            return(false);
        }
        private int GroupSize()
        {
            var c = WoW.GetBlockColor(1, 21);

            try
            {
                if (c.R == 0)
                {
                    return(0);
                }
                isInRaid = c.G != 255;
                int size = Convert.ToInt32((double)c.R * 100 / 255);
                if (size == 100)
                {
                    return(0);
                }
                return(size);
            }
            catch (Exception ex)
            {
                Log.Write($"[Health] Red = {c.R}");
                Log.Write(ex.Message, Color.Red);
                return(100);
            }
        }
Пример #3
0
        private void AoEStuff()
        {
            Color pixelColor = Color.FromArgb(0);

            pixelColor = WoW.GetBlockColor(11, 20);
            npcCount   = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.G) * 100 / 255));
            if (Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.B) / 255)) == 1)
            {
                Nameplates = true;
            }
            else
            {
                Nameplates = false;
            }
        }
        private bool isInJudgmentRange()
        {
            var c = WoW.GetBlockColor(1, 21);

            try
            {
                return(c.B == 0);
            }
            catch (Exception ex)
            {
                Log.Write($"[Health] Red = {c.B}");
                Log.Write(ex.Message, Color.Red);
                return(false);
            }
        }
        private static bool IsInHealRangeParty(int partyID)
        {
            if (partyID == 0)
            {
                return(true);
            }
            var c = WoW.GetBlockColor(partyID + 1, 21);

            try
            {
                return(c.G != 255);
            }
            catch (Exception ex)
            {
                Log.Write($"[Health] Green = {c.G}");
                Log.Write(ex.Message, Color.Red);
                return(false);
            }
        }
        private static int GetPartyBuffTimeRemaining(string buffName, int partyID)
        {
            if (partyID == 0)
            {
                return(WoW.PlayerBuffTimeRemaining(buffName));
            }
            Aura aura = null;

            for (var i = 0; i < SpellBook.Auras.Count; i++)
            {
                if (SpellBook.Auras[i].AuraName == buffName)
                {
                    aura = SpellBook.Auras[i];
                }
            }
            if (aura == null)
            {
                Log.Write($"[HasDebuff] Fant ikke debuff '{buffName}' in Spell Book");
                return(0);
            }
            var c = WoW.GetBlockColor(aura.InternalAuraNo, 12 + partyID);

            try
            {
                // ReSharper disable once PossibleNullReferenceException
                if (c.R == 0)
                {
                    return(0);
                }
                return(Convert.ToInt32((double)c.R * 100 / 255));
            }
            catch (Exception ex)
            {
                Log.Write("Failed to find debuff stacks for color G = " + c.B, Color.Red);
                Log.Write("Error: " + ex.Message, Color.Red);
            }

            return(0);
        }
        private static bool PartyHasDeBuff(string debuffName, int partyID)
        {
            if (partyID == 0)
            {
                return(WoW.PlayerHasDebuff(debuffName));
            }
            Aura aura = null;

            for (var i = 0; i < SpellBook.Auras.Count; i++)
            {
                if (SpellBook.Auras[i].AuraName == debuffName)
                {
                    aura = SpellBook.Auras[i];
                }
            }
            if (aura == null)
            {
                Log.Write($"[HasDebuff] Fant ikke debuff '{debuffName}' in Spell Book");
                return(false);
            }
            var c = WoW.GetBlockColor(aura.InternalAuraNo, 16 + partyID);

            return((c.R != 255) && (c.G != 255) && (c.B != 255));
        }
        private static int HealthPercentParty(int partyID)
        {
            if (partyID == 0)
            {
                return(WoW.HealthPercent);
            }
            var c = WoW.GetBlockColor(partyID + 1, 21);

            try
            {
                if (c.R == 0)
                {
                    return(100);
                }
                int health = Convert.ToInt32((double)c.R * 100 / 255);
                return(health);
            }
            catch (Exception ex)
            {
                Log.Write($"[Health] Red = {c.R}");
                Log.Write(ex.Message, Color.Red);
                return(100);
            }
        }
Пример #9
0
        private void PlayerStats()
        {
            // Playerstats start at row 1,  column 21
            // t1 t2 t3
            // t4 t5 t7
            // t7 +-haste hastePCT
            // Spec, Mana, Race
            int postive = 0;

            if ((Convert.ToDouble(pixelColor.R) == 255))
            {
                hastePct = 0f;
            }
            else
            {
                hastePct = (Convert.ToSingle(pixelColor.R) * 100f / 255f);
            }
            int spec, race;

            pixelColor    = WoW.GetBlockColor(1, 21);
            CharInfo.T1   = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.R) * 100 / 255));
            CharInfo.T2   = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.G) * 100 / 255));
            CharInfo.T3   = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.B) * 100 / 255));
            pixelColor    = WoW.GetBlockColor(2, 21);
            CharInfo.T4   = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.R) * 100 / 255));
            CharInfo.T5   = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.G) * 100 / 255));
            CharInfo.T6   = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.B) * 100 / 255));
            pixelColor    = WoW.GetBlockColor(3, 21);
            CharInfo.T7   = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.R) * 100 / 255));
            spec          = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.G) * 100 / 255));
            race          = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.B) * 100 / 255));
            pixelColor    = WoW.GetBlockColor(4, 21);
            CharInfo.Mana = (Convert.ToSingle(pixelColor.B) * 100 / 255);
            postive       = Convert.ToInt32(Math.Round(Convert.ToSingle(pixelColor.G) / 255));
            if ((Convert.ToDouble(pixelColor.B) == 255))
            {
                hastePct = 0f;
            }
            else
            if (postive == 1)
            {
                hastePct = (Convert.ToSingle(pixelColor.R) * 100f / 255f) * (-1);
            }
            else
            {
                hastePct = (Convert.ToSingle(pixelColor.G) * 100f / 255f);
            }
            if (race > 13)
            {
                race = 0;
            }
            if (spec > 34)
            {
                spec = 0;
            }
            //Log.Write ("Char Race :" + race + " Spec : " + spec);
            CharInfo.Race = Race[race];
            CharInfo.Spec = Spec[spec];
            Log.Write(" T1 " + CharInfo.T1 + " T2 " + CharInfo.T2 + " T3 " + CharInfo.T3 + " T4 " + CharInfo.T4 + " T5 " + CharInfo.T5 + " T6 " + CharInfo.T6 + " T7 " + CharInfo.T7);
            //Log.Write("Char Haste " + hastePct + " Mana :" + CharInfo.Mana + " Race : " +CharInfo.Race + " Spec : "  +CharInfo.Spec ) ;
        }