void cancelgrab(int Ani)
{// Check grabbed opponent's name
// If it's forbidden to grab him/her, revert to IDLE
void self = getlocalvar("self");
void target = getlocalvar("Target" + self);
if(target==NULL())
{
target = getentityproperty(self, "opponent");
setlocalvar("Target" + self, target);
}
if(target!=NULL())
{
char iType = getentityproperty(target, "type");
int tGrab = getentityproperty(target, "antigrab");
if (tGrab==9999)
{
changeentityproperty(self, "animation", Ani);
}
if(iType == openborconstant("TYPE_OBSTACLE") || iType ==openborconstant("TYPE_ITEM") || iType ==openborconstant("TYPE_NPC"))
{
//clearlocalvar();
changeentityproperty(self, "animation", Ani);
}
}
}