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

Targets target = tank

Venus112

New Member
Joined
Jun 17, 2010
Messages
1,509
Reaction score
13
Hey there
I'm doing some rewriting on a CC and i'm looking into the possibility of adding a check so that you do not automatically taunt a boss/mob off another tank when the time is not right.

This is some of the basic taunt logic, Fiftypence used, but i was thinking if it was possible to add a check to see if Targets target is a tank, before taunting
Code:
{
            if (TauntTarget.Distance2D <= 30
[LEFT]            && SpellManager.CanCast("Hand of Reckoning"))
       {[/LEFT]
            SpellManager.Cast("Hand of Reckoning", TauntTarget);
            Logging.Write(Color.Red, "Hand of Reckoning on " + TauntTarget.Name);
            return;
       }
}

Anyone who has any ideas?
 
I hope I understood you correctly. You want to know if your target is targeting a tank?

These first two are in my healing CC and were taken from HazzDruid to get the tank.

Code:
private string DeUnicodify(string s)
        {

            StringBuilder sb = new StringBuilder();
            byte[] bytes = Encoding.UTF8.GetBytes(s);
            foreach (byte b in bytes)
            {
                if (b != 0)
                    sb.Append("\\" + b);
            }
            return sb.ToString();
        }

private bool IsTank(WoWPlayer p)
        {
            return Lua.GetReturnValues("return UnitGroupRolesAssigned('" + DeUnicodify(p.Name) + "')").First() == "TANK";
        }

This I did not proof read or test, but was just my initial thought. I dont know if putting "(WoWPlayer)" in front of a WoWUnit will effectively cast the WoWUnit as a WoWPlayer. If not, try have IsTank() take a WoWUnit.

Code:
private bool TargetTankCheck()
        {
            if (Me.CurrentTarget != null)
            {
                if ((Me.CurrentTarget.IsTargetingMyPartyMember 
                    || Me.CurrentTarget.IsTargetingMyRaidMember)
                    && Me.CurrentTarget.CurrentTarget.IsAlive
                    && IsTank((WoWPlayer)Me.CurrentTarget.CurrentTarget))
                {
                    return true;
                }
                return false;
            }
            return false;
        }
 
Yearh, it's to fix any issues that might arise with the CC trying to taunt off another tank when not needed or when you're not supposed to tank

Thank you, i will take a look at this.

Edit:
Error: Typen eller navneomr?denavnet 'StringBuilder' blev ikke fundet (mangler der et 'using'-direktiv eller en assemblyreference?)
Error: Navnet 'Encoding' findes ikke i den aktuelle sammenh?ng

Translates into something like
Error: The type or name error "StringBuilder" was not found (Is there missing a "using"-directive or a assemblyreference?)
Error: The name "Encoding" is not found in the actual context

Not really used to Stringbuilder or Encoding, so i can't rly tell what it does
 
Last edited:
try adding

using System.Text;
 
try adding

using System.Text;

Thank you, that worked.
Getting no errors in the CC anymore.
Where'd you read up on CC making? All i've done so far is completely from what i could understand in a CC as i dont get much of the code (can't find a indepth place to read about all the commands)
 
The first parts are from HazzDruid. I wouldnt have been able to come up with it. I can only do pretty basic stuff too. Other than the tutorial, study other CCs and let tons of people die in LFR when you test your stuff :p
 
Last edited:
I'm testing something out, but i think that the added code is messing with LazyRaider in dungeons/Raids

Cause it'll spam
[15:40:04:130] [LazyRaider] Tank set to -ME-, max health 214133
[15:40:04:220] [LazyRaider] Tank set to -ME-, max health 214133
[15:40:04:289] [LazyRaider] Tank set to -ME-, max health 214133

So i'm thinking if adding a check like that will not work very good with LazyRaider

Any of the hardcore coders out there has a clue?
-------
Edit: Problem solved, apparently i needed to close hb and wow and it would stop
 
Last edited:
Back
Top