hpcost - make your animation consume health

O Ilusionista

Captain 100K
While I was developing my mod, I needed a way to make the char to spend some HP on a move without using freespecial.

Reading Bloodbane's simple scripts, I found the solution and I want to share.

void hpcost( int HCost)
{// Spend some life
    void self = getlocalvar("self");
    void Life = getentityproperty(self,"health"); //get health
if (Life > HCost){ //Does the entity have enough health?
      changeentityproperty(self, "health", Life-HCost);//consume health
      }
}

Usage:
hpcost #

# is how much hp you want to spend.

Really thanks to Bloodbane initial scripts and DC's wiki :)
 
Back
Top Bottom