What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Question] How to Blacklist Perma-Evade Mobs in a CC.

goodmorning

New Member
Joined
Sep 16, 2010
Messages
259
Reaction score
1
What kind of code needs to be implemented in a Custom Class to get it to recognize evade-bugged mobs and move on? Curious if it's an easy fix, something I can add to all the CCs I use.
 
I would like to see this also, I've countless times been attacking a mob for hours on end with people whispering me like "are you retard" and "WTF"
 
Code:
public override void Initialize()
{
    Lua.Events.AttachEvent("COMBAT_LOG_EVENT", CombatLogEventHander);
}

private static void CombatLogEventHander(object sender, LuaEventArgs args)
{
    foreach (object arg in args.Args)
    {
        if (arg is String)
        {
            var s = (string)arg;
            if (s.ToUpper() == "EVADE")
            {
                if (StyxWoW.Me.GotTarget)
                {
                    Logging.Write("My target is Evade bugged.");
                    Logging.Write("Blacklisting for 3 hours");
                    StyxWoW.Me.ClearTarget();
                    Blacklist.Add(StyxWoW.Me.CurrentTargetGuid, TimeSpan.FromHours(3));
                }
            }
        }
    }
}

Pretty ugly but it works, more or less :)
 
Code:
        private static Dictionary<WoWSpellSchool, HashSet<ulong>> ImmunityMap = new Dictionary<WoWSpellSchool, HashSet<ulong>>();

        private void HandleCombatLogEvent(object sender, LuaEventArgs args)
        {
            switch (args.Args[1].ToString())
            {
                case "SPELL_MISSED":
                    
                    if (args.Args[11].ToString() == "IMMUNE")
                    {
                        try
                        {
                            var spellSchool = (WoWSpellSchool)(int)(double)args.Args[10];

                            ulong aguid = ulong.Parse(args.Args[2].ToString().Replace("0x", ""), NumberStyles.HexNumber);

                            if (Me.Guid != aguid) return;

                            ulong guid = ulong.Parse(args.Args[5].ToString().Replace("0x", ""), NumberStyles.HexNumber);

                            var obj = ObjectManager.GetObjectsOfType<WoWUnit>(true, true).FirstOrDefault(o => o.Guid == guid || o.DescriptorGuid == guid);
                            
                            if (obj == null)
                            {
                                Log("Can't find the object in the object manager...");
                                return;
                            }
                            
                            if (!ImmunityMap.ContainsKey(spellSchool))
                                ImmunityMap[spellSchool] = new HashSet<ulong>();

                            if (!ImmunityMap[spellSchool].Contains(obj.Guid))
                            {
                                Log("Adding " + obj.Name + " [" + obj.Guid + "] to the " + spellSchool + " immunity list.");
                                ImmunityMap[spellSchool].Add(obj.Guid);
                            }
                        }
                        catch (Exception e)
                        {
                            dLog(e.ToString());
                        }
                    }
                    
                    if (args.Args[11].ToString() == "EVADE")
                    {
                        try
                        {
                            ulong guid = ulong.Parse(args.Args[5].ToString().Replace("0x", ""), NumberStyles.HexNumber);

                            var obj = ObjectManager.GetObjectsOfType<WoWUnit>(true, true).FirstOrDefault(o => o.Guid == guid || o.DescriptorGuid == guid);
                            
                            if (obj == null)
                            {
                                Log("Can't find the object in the object manager...");
                                return;
                            }

                            Styx.Logic.Blacklist.Add(obj, TimeSpan.FromMinutes(10));
                            Log("Evading mob detected: {0} Blacklisting", obj.Name);
                            
                            if (obj == Me.CurrentTarget)
                                Me.ClearTarget();
                        }
                        catch (Exception e)
                        {
                            Log(e.ToString());
                        }
                    }
                    break;
            }
        }
 
Sweet. Just what I was looking for. Thanks to both of you.
 
Last edited:
Hey just wondering (after stumbling upon this post) where in the CC would i put the code in? (Behavior, Class, Etc.)

Thank you!!
 
Hey just wondering (after stumbling upon this post) where in the CC would i put the code in? (Behavior, Class, Etc.)

Thank you!!
there lots of different ways to do it. the best thing to do if its a default CC, like the Default Mage for instance, make a post about it, since i made the default mage i can tell you its coming soon, other cc's its best just to bug the developer, and link this post.
 
other cc's its best just to bug the developer!! <<< LOL CNG
 
Back
Top