This is from this thread.
http://forum.bioware...se-spells-only/
#include "hench_i0_ai"
void FinishAI(object oTarget = OBJECT_SELF)
{
SetLocalInt(oTarget, "X2_SPECIAL_COMBAT_AI_SCRIPT_OK",TRUE);
}
void main()
{
object oTarget = GetNearestSeenOrHeardEnemyNotDead();
int nSpellId = SPELL_MAGIC_MISSILE;
// If we have spells, cast them.
if(GetHasSpell(nSpellId))
{
ClearAllActions(TRUE);
ActionCastSpellAtObject(nSpellId, oTarget);
FinishAI(OBJECT_SELF);
return;
}
// Otherwise, do nothing.
FinishAI(OBJECT_SELF);
}
ColorsFade is not around any more, don't know why. But I am using his scripts and as far as I know, mentioning his name at the top, or leaving the comments as they are is all that he asks in order to use them. I could send them to you to take a look.
The above is just an example. His scripts go way further, using a big library filled with functions where you can even specify targets and AoE locations etc. Honestly, I don't need them all, and I don't think you will either. But you can find the spots that will make these mephits useful, or I point you there since the library contains some 1000 lines of code
.