i need help fixxing this script, doomlord kazzak casts twisted relfection on the tank witch makes the fight nearly impossible and i was just wondering if anyone knew the function to cast a random debuff in players in range but not target with highest aggro?
if (Twisted_Reflection_Timer < diff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
DoCastSpellIfCan(pTarget, SPELL_TWISTEDREFLECTION);
Twisted_Reflection_Timer = 15000;
}else Twisted_Reflection_Timer -= diff;
if anybody could help that would be awesome