Jump to content

Home

Decrease maximum HP


Mindtwistah

Recommended Posts

Two questions, is this for K1 and what should I write in sometag?

 

If you want to reduce the max VP of the player character by 5 you can use GetFirstPC() instead of GetObjectByTag(), like:

 

void main() { 
   object oPC = GetFirstPC();
   SetMaxHitPoints(oPC, GetMaxHitPoints(oPC) - 5); 
}

Link to comment
Share on other sites

If you want to make it a temporary effect use the script:

void main()
{
    object oPC = GetFirstPC();
    int iHP = GetMaxHitPoints(oPC) - 5;
    int iDuration = "whateveryouwant";
    effect eTempHP = EffectTemporaryHitpoints(iHP);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTempHP, oPC, iDuration);
}

Link to comment
Share on other sites

If you want to make it a temporary effect use the script:

void main()
{
    object oPC = GetFirstPC();
    int iHP = GetMaxHitPoints(oPC) - 5;
    int iDuration = "whateveryouwant";
    effect eTempHP = EffectTemporaryHitpoints(iHP);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTempHP, oPC, iDuration);
}

 

This script would nearly double the hitpoints of the characters it is applied to though, not reduce it by 5, since you add a bonus of (MaxVP-5) to them for the duration of the effect.

 

(Also, duration needs to be a float value and not an integer.)

Link to comment
Share on other sites

Originally Posted by stoffe

This script would nearly double the hitpoints of the characters it is applied to though, not reduce it by 5, since you add a bonus of (MaxVP-5) to them for the duration of the effect.

 

(Also, duration needs to be a float value and not an integer.)

Umm okay. I thought that the EffectTemporaryHitpoints() would set the hitpoints to a specified value, not add a bonus. The effect can't be used to decrease hitpoints then because it won't accept negative integers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...