Jump to content

Script Action for restoring/healing HPs? (BGII)


jastey

Recommended Posts

Is there a reversed action for ApplyDamage(), like RestoreHP() or something like that? If I want to script a healing process, how would I do that?

 

The reason why I am not using the given effect is because the healing will only happen until a variable reaches a certain value, and I am not sure I can add this trigger to an spell effect. To be more precise: First the creature will get damage if it is exposed to the damage source for a certain period of time. Then, if it is away, the damage will heal. I am counting the damage HPs by incrementing a variable, and would like to apply the healing likewise, i.e. only the damage from this source will be healed.

Link to comment

Hm, and how do I make such a spell? All I could imagine is using Regeneration with 1 HP/sec and make the duration 1s...

 

And another stupid problem: Of course the amount of gained damage should also be healed upon resting - but there is no way in the IE engine to read the value of a variable, is there? Does anyone know a way to

 

-detect the amount of damage (currently counted by a variable using IncrementGlobal)

-heal that amount of damage upon resting (without delaying the resting for an unappropriate amount of time)

Link to comment

I think opcode effect #17 (Current HP Modifier) is better suited to heal a certain amount of HP instantly.

 

In TP2 code it would look like this:

LPF ADD_SPELL_EFFECT
   INT_VAR
   opcode = 17	      // Current HP Modifier
   target = 2	      // Present target
   timing = 1	      // Permanent
   parameter1 = 1    // Heal 1 HP
   parameter2 = 0    // Cumulative Modifier, i.e. added on top of the current HP until max HP has been reached
END

 

The only way I know of to read character stats is by using the CheckStat[LT/GT]() action with one of the identifiers from the STATS.IDS. But I'm not sure if you can read the current HP value with it. The HP-related identifiers I could find were MAXHITPOINTS (referring to max HP obviously) and MINHITPOINTS (don't know what it does).

 

I don't think detecting the real amount of damage taken (i.e. after being modified by resistances, etc.) is possible, but maybe TobEx has a way to do it. To be fairly sure that the target is damaged by the right amount, you'd have to make your damage bypass any resistances, immunities or saving throws. Your way to count the damage is probably the best solution.

Link to comment

For the healing of that specific damage upon healing

I meant healing upon resting!

 

I would do that via scripts that checks for the value of the variable (lots of script blocks), unless someone else has a better idea? (The question was how to heal a certain amount of HPs upon resting, if he value of the HPs is counted by a variable.)

Link to comment

This is just a shot in the dark, but maybe you could cause the damage by using the opcode effect #12 (HP Damage) with a specific duration (maybe 8 hours, the standard resting time). That way the character should have regained the right amount of HP after the effect has worn off (theoretically).

Link to comment

Indeed! The idea is great. Only thing is that I wouldn't know how to handle if the rest is interrupted. Does the PartyRested() trigger check for a (full) rest or also trigger in case of enemy interruption?

Link to comment

Archived

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

×
×
  • Create New...