Damage Reduction Testing

For the knowledge of the community: Per a previous discussion, I have tested the ability to grab damage reduction values via script, and this is what I found.

I made a Warlock as they get DR through a feat that is the weird innate DR that exists on creatures that is neither an effect nor an IP, and they can get DR through an invocation that is an effect (Dark Foresight).

I used this script to test:

void main()
	object oPC = GetFirstPC(FALSE);
	effect eLoop = GetFirstEffect(oPC);

    while (GetIsEffectValid(eLoop))
		// Do the stuff
		if (GetEffectType(eLoop) == EFFECT_TYPE_DAMAGE_REDUCTION)
			// First find the type of reduction
			int nDRType = GetEffectInteger(eLoop, 3);
			int nDRSubtype = GetEffectInteger(eLoop, 1);
			int nDRAmount = GetEffectInteger(eLoop, 0);
			string sDR = "DR type: " + IntToString(nDRType) + ", " +
			             "DR subtype: " + IntToString(nDRSubtype) + ", " +
						 "DR amount: " + IntToString(nDRAmount);
			SendMessageToPC(oPC, sDR);
		eLoop = GetNextEffect(oPC);
	SendMessageToPC(oPC, "Found You!");

It can grab the DR from Dark Foresight correctly and displays all the correct values (i.e. type: material (4), subtype: alchemical silver (6), amount: 10), but it cannot grab the DR that exist from the feat.

If anyone has any suggestions about how to grab the other, non-effect DR, I would love to hear ideas!

1 Like