void main() { object oObject; int nCounter=0; effect eEffect; object oPC=GetEnteringObject(); if (GetIsObjectValid(oPC)) { oObject =GetObjectByTag("jw_skel_priest",nCounter); while (GetIsObjectValid(oObject)) { eEffect=GetFirstEffect(oObject); while (GetIsEffectValid(eEffect)) { if (GetEffectCreator(eEffect)==oObject) { RemoveEffect(oObject,eEffect); } eEffect=GetNextEffect(oObject); } nCounter++; oObject =GetObjectByTag("jw_skel_priest",nCounter); } } oObject=GetNearestObjectByTag("jw_skel_priest"); AssignCommand(oObject,ActionMoveToObject(GetWaypointByTag("jw_skel_priest_wp"))); }