| You cannot keep the apprentices alive by using protective spells. And the chance to get the Staff of Power is very small indeed.
Your apprentices turned out hostile because of the Spirit Armor spell. When it wears off, it deals a little Magical damage unless the target saves vs spells. So, if this spell is cast on a neutral and he fails his save, this means that he'll turn hostile.
Note that this also affects NPCs which you dismissed temporarily or permanently and still have Spirit Armor cast on them. The only way to prevent them turning hostile is quickly rejoining them. Or hoping they'll save vs spell. |