Is there a script to decrease the maximum HP of the PC with 5?
If it is, can someone write it down here?
Just what you'd expect:void main() {
object oUnluckyChap=GetObjectByTag("sometag");
SetMaxHitPoints(oUnluckyChap, 5);
}
Two questions, is this for K1 and what should I write in sometag?
Two questions, is this for K1 and what should I write in sometag?
Yes the script will work for K1, most scripts do, only a few new functions introduced with K2 don't mwork in K2, and you replace "dometag" with the tag of the NPC ;)
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);
}
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);
}
Thank you all for the scripts.
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.)
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.