I don't really understand what it is you're trying to accomplish with this 'capture', and the 2da edits. You can implement persistent wounds of ANY damage amount using pseduoheartbeats, without the need for 2da changes. As you say, wounding doesn't bypass resistance or reduction, so I can see no need for such measures, when you can acheive the same with just a pseduo.
Here's some relevant code:
void ApplyPersistentWound (object oWounded) {
if (GetIsDead(oWounded) ||
GetLocalInt(oWounded, "PersistentWound") <= 0 ||
GetHasSpellEffect(HGEFFECT_PERSISTENT_WOUND, oWounded))
return;
effect eLink = EffectSpellImmunity(HGSPELL_UNUSED);
eLink = EffectLinkEffects(eLink, EffectIcon(EFFECT_ICON_WOUNDING));
eLink = SupernaturalEffect(eLink);
SetEffectSpellId(eLink, HGEFFECT_PERSISTENT_WOUND);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oWounded);
}
void DoPersistentWound (object oWounded, int nAdd=0, string sMessage="", float fInterval=6.0) {
if (GetPlotFlag(oWounded)) {
if (nAdd == 0)
DelayCommand(fInterval, DoPersistentWound(oWounded, 0, "", fInterval));
return;
}
if (GetIsDead(oWounded)) {
DeleteLocalInt(oWounded, "PersistentWound");
DeleteLocalInt(oWounded, "PersistentWoundRests");
return;
}
int nRests = GetLocalInt(oWounded, "PersistentWoundRests");
if (nRests > 0 && GetLocalInt(oWounded, "Rests") >= nRests) {
DeleteLocalInt(oWounded, "PersistentWound");
DeleteLocalInt(oWounded, "PersistentWoundRests");
RemoveEffectsFromSpell(HGEFFECT_PERSISTENT_WOUND, oWounded);
return;
}
if (nAdd > 0) {
string sRes = GetResRef(GetItemInSlot(INVENTORY_SLOT_BELT, oWounded));
if (sRes == "abosetbelt001" || sRes == "hivsetbelt001")
return;
if (sMessage != "")
FloatingTextStringOnCreature(sMessage, oWounded, FALSE);
int nAmount = GetLocalInt(oWounded, "PersistentWound");
SetLocalInt(oWounded, "PersistentWound", nAmount + nAdd);
if (nAmount > 0)
return;
} else {
int nAmount = GetLocalInt(oWounded, "PersistentWound");
SetLocalInt(oWounded, "PersistentWound", nAmount -1);//persistent wounds grow less virulent over time
}
object oArea = GetArea(oWounded);
if (!GetIsObjectValid(oArea)) {
DelayCommand(fInterval, DoPersistentWound(oWounded, 0, "", fInterval));
return;
}
int nAmount = GetLocalInt(oWounded, "PersistentWound") + nAdd;
if (nAmount <= 0) {
DeleteLocalInt(oWounded, "PersistentWound");
DeleteLocalInt(oWounded, "PersistentWoundRests");
RemoveEffectsFromSpell(HGEFFECT_PERSISTENT_WOUND, oWounded);
return;
}
if (!GetHasSpellEffect(HGEFFECT_PERSISTENT_WOUND, oWounded))
AssignCommand(GenCreator(), ApplyPersistentWound(oWounded));
ApplyDirectDamage(oWounded, nAmount, DAMAGE_TYPE_INTERNAL, DAMAGE_POWER_NORMAL,
"Persistent Wound", "Your festering wound kills you!");
if (!GetLocalInt(oWounded, "DirectDamageDeath")) {
FloatingTextStringOnCreature("Your wound festers!", oWounded, FALSE);
ApplyVisualToObject(PRCVFX_IMP_REDUCE_ABILITY_SCORE_RED, oWounded);
} else {
DeleteLocalInt(oWounded, "PersistentWound");
DeleteLocalInt(oWounded, "PersistentWoundRests");
}
AssignCommand(oArea, DelayCommand(fInterval, DoPersistentWound(oWounded, 0, "", fInterval)));
}
The pseudos fire up again on client enter, if warranted, based on the variables.
Funky