if (attacker.getAnimationVariableint("IsCastingRight")) || (attacker.getAnimationVariableint("IsCastingleft")) || (attacker.getAnimationVariableint("IsCastingDual"))returnelseif(!(akSource As Weapon)) ; this still returns the weapon used EVEN if it is the enchantment damage!returnelseif (!(akAggressor as Actor)) ; this still returns an actor EVEN if it is the enchantment damage!returnelseif (akSource as spell) ; this only RARELY works for some reason.returnelseif (AkSource as Potion) ; this only RARELY works for some reason.return;elseif (akProjectile) != none ;-- but this will not work no matter how I check it. akProjectile is BROKEN!;returnelseif Attacker.GetEquippedItemType(1) != 7 && abBashAttack == falsereturnendifBut NONE of the above will filter out poison and enchantment damage from a weapon such as FIRE damage. The script ON HIT triggers several times as the fire burns. What I did (see below) works somewhat but not perfectly well:
if attacker == lastattacker && delay > Utility.GetCurrentRealTime() ;--- this is to stop the enchantmet damage from the same weapon/actor from triggering this script right after the hit.delay = Utility.GetCurrentRealTime() + 0.3Lastattacker = attackerreturnelseLastattacker = attackerdelay = 0.0endif
Is this really the BEST that can be done? Have I really found the only way to filter out poison and enchantment damage from the On Hit event?
I cannot use any method that checks only vanilla weapons and keywords because there will soon be hordes of custom made weapons from other mods.
