Open Finaldeath opened 4 years ago
Update to this I tested Animal Empathy (I think the only "active" hostile skill) which also fires this event on a critical failure. Same thing occurs - no clearing of the flag.
Updated module, put a level 20 animal in. A level 1 druid can't do the check (it's a critical failure) which correctly fires it. To get knockdown, cheat level a character to have knockdown and use it first, then animal empathy it.
Taunt OnPhysicalAttacked Bug.zip
Not sure if any other "rogue" things fire the OnPhysicalAttacked event for creatures. Will post if we find any more.
NB: Also this occurs on stable. Not a preview specific bug. Likely occurs in 1.69 too.
Following on from this, the active feats: FEAT_SMITE_GOOD, FEAT_SMITE_EVIL, and FEAT_KI_DAMAGE are missing from the SPECIALATTACK* list but at least, for what it is worth, make the return value 0.
There may be others, to be honest I forget all the individual feats. Some "passive" attacks like Death Attack or Sneak Attack, obviously are not possible to get from this since they can be combined with other attack types.
To Reproduce
NOTE: I have also had issues with the event firing at all randomly, mmm. No idea why. Might happen to you too.
NOTE 2: GetLastAttackType() should be used on the creature being attacked (ie: GetLastAttackType(OBJECT_SELF)) - the toolset description (and currently Lexicon) is wrong. Lexicon will be updated.
Specifics
If needed, describe the bug
Taunt being done just after mod is loaded, shows no attack info, then some once PhyAtk fires, but an invalid special attack type (0):
Now start the module (so taunt isn't already applied) do a knockdown after the heartbeat has set attacks to 1, then fire a taunt. 2 physical attack events (good!) but both return a knockdown (uh-oh!).
Suggested fix
If possible having GetLastAttackType() return a new constant eg: SPECIAL_ATTACK_TAUNT - would nullify this bug since it will correctly clear the previous flag and set a new one. Normal attacks clear it as well (ie; a knockdown -> normal attack, then taunt, correctly has it set to 0).