jastey Posted May 19, 2013 Share Posted May 19, 2013 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
argent77 Posted May 19, 2013 Share Posted May 19, 2013 If you want to simulate a regeneration process, then you could use ApplySpellRES() with a spell that heals one HP each time you use it. Combined with your counter variable it should slowly heal the target. Link to comment
jastey Posted May 20, 2013 Author Share Posted May 20, 2013 That would have been my alternative. Thank you, I guess I have to do it that way. Link to comment
jastey Posted May 20, 2013 Author Share Posted May 20, 2013 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
argent77 Posted May 20, 2013 Share Posted May 20, 2013 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
jastey Posted May 20, 2013 Author Share Posted May 20, 2013 Thank you! I completely ignored this opcode. This should at least enable the healing for elapsed time. For the healing of that specific damage upon healing, I guess I'd have to use some work-around. Link to comment
jastey Posted May 22, 2013 Author Share Posted May 22, 2013 For the healing of that specific damage upon healingI 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
argent77 Posted May 22, 2013 Share Posted May 22, 2013 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
jastey Posted May 22, 2013 Author Share Posted May 22, 2013 Hm... Interesting idea, only thing I would have to think more about is how to decrease the variable value if this happens via resting. But thank you for the idea! Link to comment
argent77 Posted May 22, 2013 Share Posted May 22, 2013 Maybe the opcodes #265 (Modify Global Variable) or #309 (Modify Local Variable) with a delay of 8 hours could help you there. Link to comment
jastey Posted May 22, 2013 Author Share Posted May 22, 2013 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
argent77 Posted May 22, 2013 Share Posted May 22, 2013 I've never tested this, but the description in the IESDP suggests that it's only triggered after a successful rest. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.