void actual_main(){
lockMp();
}
void lockMp()
{//Lock mprate with defined conditions. Used for Counter, Super and Rage animations that never fill mp - THANKS KRATUS
void self = getlocalvar("self");
void target = getlocalvar("damagetaker");
void parent = getentityproperty(self,"parent");
void vType = getentityproperty(self,"type");
void sType = getentityproperty(self,"subtype");
//USED BY PLAYER/ENEMY
if(parent == NULL()){
void vAniID = getentityproperty(self,"animationID");
void type = getentityproperty(target,"type");
int disable = getentityproperty(self,"energycost", "disable", openborconstant(vAniID));
int blocked = getlocalvar("blocked");
int maxMp = getentityproperty(self,"maxmp");
int mp = getentityproperty(self,"mp");
int mpRate = getentityproperty(self,"mprate");
void tName = getentityproperty(target,"model");
if(disable == 6){
if(blocked == 0){
if(mp < maxMp){
if(type != openborconstant("TYPE_OBSTACLE")){
if(tName !="Box" || tName !="Glass" || tName !="Roll"){
changeentityproperty(self, "mp", mp-mpRate);
}
//settextobj(1, 240, 154, 2, 999999999, "disable", 100+openborvariant("elapsed_time"));
}
}
}
}
}
//USED BY NPC PARTNER
if(parent != NULL()){
if(vType == openborconstant("TYPE_NPC") && sType == openborconstant("SUBTYPE_FOLLOW")){
void vAniID = getentityproperty(self,"animationID");
void type = getentityproperty(target,"type");
int disable = getentityproperty(self,"energycost", "disable", openborconstant(vAniID));
int blocked = getlocalvar("blocked");
int maxMp = getentityproperty(self,"maxmp");
int mp = getentityproperty(self,"mp");
int mpRate = getentityproperty(self,"mprate");
if(disable == 6){
if(blocked == 0){
if(mp < maxMp){
if(type != openborconstant("TYPE_OBSTACLE")){
changeentityproperty(self, "mp", mp-mpRate);
}
}
}
}
}
else
{
//USED BY PROJECTILES
void type = getentityproperty(target,"type");
int disable = getentityvar(self,"disable");
int blocked = getlocalvar("blocked");
int maxMp = getentityproperty(parent,"maxmp");
int mp = getentityproperty(parent,"mp");
int mpRate = getentityproperty(parent,"mprate");
if(disable == 6){
if(blocked == 0){
if(mp < maxMp){
if(type != openborconstant("TYPE_OBSTACLE")){
changeentityproperty(parent, "mp", mp-mpRate);
}
}
}
}
}
}
}