void limiter2(int Limit,  int iMPCost)
{
   
    void self = getlocalvar("self");
    int mp = getentityproperty(self,"mp"); //Get entity's HP.


   if (mp >= iMPCost )
                            { 
		    	  
			changeentityproperty(self, "mp", mp - iMPCost); //Subtract MP cost from caller's MP.
			                         	
	
		            }



   if(mp<=Limit) 
                            {
     changeentityproperty(self, "animation", openborconstant("ANI_idle")); //Don't play the animation.
                            }
}







