void main()
{//Custom followanim using script
void self = getlocalvar("self");
void target = getlocalvar("damagetaker");
void anim = getentityproperty(self,"animationID");
void eType = getentityproperty(target,"type");
void sType = getentityproperty(target,"subtype");
int height = getentityproperty(self,"y");
int base = getentityproperty(self,"base");
int frame = getentityproperty(self,"animpos");
int firstFrame = 80;
int lastFrame = 110;
//CHECK IF THE CURRENT ANIMATION IS THE FREESPECIAL AND WITH THE CORRECT FRAME RANGE, WHICH WILL TRIGGER THE SCRIPT
if(anim == openborconstant("ANI_FREESPECIAL") && frame >= firstFrame && frame <= lastFrame){
//CHECK THE TARGET TYPE AND SUBTYPE TO NOT ACTIVATE AGAINST WRONG OPPONENTS, LIKE OBSTACLES
if(eType != openborconstant("TYPE_OBSTACLE") && sType != openborconstant("SUBTYPE_NOTGRAB")){
//CHECK IF THE ENTITY IS ON THE GROUND, COMPARING HEIGHT WITH BASE
if(height == base){
performattack(self, openborconstant("ANI_FOLLOW1"), 1);
}
}
}
}