Thanks Knightmare and Xardex, I did however find another script in the mod, so I will try this first:
void main()
{
object oPC = GetPCSpeaker();
object oTarget;
oTarget = GetObjectByTag("loc_headmaster");
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
oTarget = GetObjectByTag("loc_headmaster");
DestroyObject(oTarget, 3.0);
object oSpawn;
oTarget = oPC;
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "laz_headmaster", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "loc_headguard", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "loc_headguard", GetLocation(oTarget));
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oTarget = oSpawn;
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
}
Although I don't believe the original non-hostile npc actually gets destroyed on this one. If this doesnt work however I will try your approach.
There is still the issue of destroying the object however.
Modifié par Lazarus Magni, 19 novembre 2011 - 02:01 .