- in-game poisons act immediately
- custom poisons do damage every second
- only certain poisons are detrimental to health (burden is a poison, but it doesn't have any effect on an enemy's health)
- custom poison effects are cumulative (add up the damage from multi-effect poisons every second)
- getAV health is not accurate, but the only measure available
The game engine does not update your kill stats when an NPC or creature dies from poisoning. SirFrederik has attempted to do this via script, but the script has several problems.
The script correctly determines that a poison has been applied to a weapon and knows the target of the poisoning. I need to fix the rest
Steps:
- get the active effects on the weapon
- loop through the active effects and if the effect is one that affects health, get the magnitude of the damage
- add the damage from each effect together
- compare the sum of the damage to the target's health each second
- if the damage exceeds the target's health, bump up the kill statistic for NPC's or creatures, as appropriate
Now I need opinions. Do you think this covers it? I know the getAV health command isn't the best, but I think that's all I have to work with. I can also check if the NPC or creature is dead even though the health isn't 0 if necessary, although I think assuming that if damage exceeds health, the creature or NPC is going to be dead might be good enough.
I am not having a problem determining the current active effects on a weapon or comparing those effects to certain types of damage (I've seen Jroush's recommendations in the OBSE thread ) I also have the scriptEffectStart and scriptEffectUpdate loops set up. I just want to make sure I have everything covered and would like to know if there is a better way of doing this.
Thanks for your input!