Hey,
I've got my npcs scripted in C++ and now when we have npcs that cast damaging spells, we need healer npcs. I've tried to figure it out from the other scripts, I've tried to find out from the internet but I just cannot find any information about targetting a friendly unit
Because if I use this:
Code:
if (Renew_Timer <= diff)
{
if (Unit *pHealTarget = SelectTarget(SELECT_TARGET_RANDOM,0))
DoCast(pHealTarget, SPELL_RENEW);
Renew_Timer = 8000;
} else Renew_Timer -= diff;
It will probably heal ANY unit (even enemies). When ever I tried different things, it responded with some errors like "...not defined", "... cannot be used with..." etc.
And if I would use
Code:
if (Renew_Timer <= diff)
{
DoCast(me, SPELL_RENEW);
Renew_Timer = 8000;
} else Renew_Timer -= diff;
It will only cast it on self.
So if anybody knows a way to do it I would really appreciate it.
Thanks.