Mindtwistah Posted June 15, 2007 Share Posted June 15, 2007 Is there a script to decrease the maximum HP of the PC with 5? If it is, can someone write it down here? Link to comment Share on other sites More sharing options...
tk102 Posted June 15, 2007 Share Posted June 15, 2007 Just what you'd expect: void main() { object oUnluckyChap=GetObjectByTag("sometag"); SetMaxHitPoints(oUnluckyChap, 5); } Link to comment Share on other sites More sharing options...
Mindtwistah Posted June 15, 2007 Author Share Posted June 15, 2007 Two questions, is this for K1 and what should I write in sometag? Link to comment Share on other sites More sharing options...
Master Zionosis Posted June 15, 2007 Share Posted June 15, 2007 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 Link to comment Share on other sites More sharing options...
stoffe Posted June 15, 2007 Share Posted June 15, 2007 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 More sharing options...
swfan28 Posted June 15, 2007 Share Posted June 15, 2007 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 More sharing options...
Mindtwistah Posted June 15, 2007 Author Share Posted June 15, 2007 Thank you all for the scripts. Link to comment Share on other sites More sharing options...
stoffe Posted June 15, 2007 Share Posted June 15, 2007 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 More sharing options...
swfan28 Posted June 15, 2007 Share Posted June 15, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.