Jump to content

leetdemon

Members
  • Posts

    4
  • Joined

  • Last visited

Reputation Activity

  1. Like
    leetdemon got a reaction from saleh in Record button [Feature suggestion] POLL   
    Cool survey done...please everyone do this survey :D  Takes 30 secs
  2. Like
    leetdemon reacted to GTXMike in Healing at 20% health?   
    Add your healing skill into rotation on the top of the list as a high priority, set it as buff and add to conditions Health -> 20% -> True -> Less or Equal.
  3. Like
    leetdemon reacted to Pasterke in Party Buffing   
    Ok, here you go
    public static List<WoWUnit> getPartyPets()
            {
                Vector3 myPos = ObjectManager.Me.Position;
                var ret = new List<WoWUnit>();
                var pets = ObjectManager.GetObjectWoWUnit().Where(p => p != null
                    && p.IsPet).ToList();
                foreach (var m in pets)
                {
                    if (m.IsValid && m.IsAlive && m.InCombat && m.Target.IsNotZero() && m.Position.DistanceTo2D(myPos) <= 40 && !TraceLine.TraceLineGo(m.Position))
                    {
                        if (ret.All(u => u.Guid != m.Target))
                        {
                            var targetUnit = new WoWUnit(ObjectManager.GetObjectByGuid(m.Target).GetBaseAddress);
                            if (targetUnit.IsValid && targetUnit.IsAlive)
                            {
                                ret.Add(targetUnit);
                            }
                        }
                    }
                }
                return ret;
            }
            public static List<WoWUnit> GetPartyTargets()
            {
                Vector3 myPos = ObjectManager.Me.Position;
                var partyMembers = Party.GetPartyHomeAndInstance();
                
                var ret = new List<WoWUnit>();
                foreach (var m in partyMembers)
                {
                    if (m.IsValid && m.IsAlive && m.InCombat && m.Target.IsNotZero() && m.Position.DistanceTo2D(myPos) <= 40 && !TraceLine.TraceLineGo(m.Position))
                    {
                        if (ret.All(u => u.Guid != m.Target))
                        {
                            var targetUnit = new WoWUnit(ObjectManager.GetObjectByGuid(m.Target).GetBaseAddress);
                            if (targetUnit.IsValid && targetUnit.IsAlive)
                            {
                                ret.Add(targetUnit);
                            }
                        }
                    }
                }
                return ret;
            }
            public static int partyCount { get { return GetPartyTargets().Count(); } }
            public static bool buffExists(WoWUnit unit, string buff)
            {
                return unit.HaveBuff(buff);
            }
            public static bool petBuffExists(string buff)
            {
                return ObjectManager.Pet.HaveBuff(buff);
            }
            public HashSet<string> statsBuffs = new HashSet<string>()
            {
                "Mark of the Wild",
                "Blessing of Kings",
                "Gift of the Wild"
            };
            public bool checkBuff(WoWUnit unit)
            {
                var a = unit.GetAllBuff();
                foreach(var aura in a)
                {
                    if (statsBuffs.Contains(aura.ToString())) return false;
                }
                return true;
            }
            public bool needStatsBuff(string buff, bool reqs)
            {
                if (!reqs) return false;
                foreach(WoWUnit t in GetPartyTargets())
                {
                    if (!buffExists(t, buff) && !checkBuff(t))
                    {
                        try
                        {
                            SpellManager.CastSpellByNameOn(buff, t.Name);
                            Logging.WriteFight(buff + "on " + t.Name);
                            return true;
                        }
                        catch(Exception e) { Logging.WriteFight("Single StatsBuffs: " + e.Message); }
                    }
                }
                return false;
            }
           public bool petsNeedStats(string buff, bool reqs)
            {
                if (!reqs) return false;
                foreach (WoWUnit t in getPartyPets())
                {
                    if (!buffExists(t, buff) && !checkBuff(t))
                    {
                        try
                        {
                            SpellManager.CastSpellByNameOn(buff, t.Name);
                            Logging.WriteFight(buff + "on " + t.Name);
                            return true;
                        }
                        catch (Exception e) { Logging.WriteFight("Pet StatsBuffs: " + e.Message); }
                    }
                }
                return false;
            }
            private Spell motw = new Spell("Mark of the Wild");
            public void Routine()
            {
                if (partyCount > 0 && needStatsBuff("Mark of the Wild", motw.KnownSpell && motw.IsSpellUsable)) return;
                if (partyCount > 0 && petsNeedStats("Mark of the Wild", motw.KnownSpell && motw.IsSpellUsable)) return;
            }
    To check for other buffs make a new hashset and new bools, eg. needFortitude, petsNeedFortitude
  4. Like
    leetdemon reacted to Pasterke in Party Buffing   
    That's the c# programming language, not scripts.
    Install visual studio (the free version) and learn how to work with it. It's not that difficult :)
    You can load a .cs files in visual studio and see the code. With intellisense it helps you alot to add or change code.
  5. Like
    leetdemon reacted to dida1990 in A Hint if you are creating a DK Fight Class   
    Since the check for "Runes Ready" in the FightClassEditor is not working as intended, you can use "Is Spell Usable" and check for the spell you want to use.
    This just works if you want to use it, right as you got all the runes ready you are needing for the spell. 
    Just add your other conditions and finished.
     
     
    Tell me if this works for as good as for me :)
×
×
  • Create New...