K so.. what is actually going on here?
You want him untargetable for how long? until the adds are done spawning.. until players are done killing all the adds?
Also I'm not sure if SetTargetable is even a thing.. and TempName needs to have an uppercase N. Bodytype 11 is untargetable.
Code:
$npc->SetBodyType(11);
$npc->TempName("");