You are correct, one of my statements above was incorrect. OnPhysicalAttacked is processed after the attack happens but before the OnDamaged event fires and damage is applied. Since Damage Reduction is about preventing the damage and not the attack, I will admit that considering what can be done during the OnPhysicalAttacked event is very reasonable.
Regardless, the technique you suggested above won't actually work. Applying a momentary DR is a
terrible idea. If the creature has one opponent with a silver weapon and several other opponents with normal weapons, the temporary DR would apply to
all opponents. Completely wrong.
Even if your technique did what it was supposed to here, I'm certainly not going to implement a solution which involves applying momentary effects based on guesswork regarding the exact timing of game engine events firing. That's just plain sloppy coding.
Based on the questionable quailty of your suggestion above, it is likely that you have a lot to learn before you will have the expertise necessary to tackle anything
as complicated as rewriting the entire NWN spell engine. One needs to walk before one can run.
Modifié par invisig0th, 25 août 2010 - 11:21 .