Guide to ResultFlags and HitFlags

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

Post Reply
User avatar
Cypress
Moderator
Champion of the Light
Posts: 446
Joined: Fri Dec 01, 2017 2:08 am

Guide to ResultFlags and HitFlags

Post by Cypress » Fri Feb 04, 2022 5:57 pm

HitFlags and ResultFlags are special settings that work with some melee attacks (see: https://d2mods.info/forum/viewtopic.php?t=66934 under [ATTACKS] and [SEQUENCE]), radial damage (seen on skills like Fireball, Exploding Arrow, Holy Fire, Blade Shield; radial damage is damage which is immediately dealt within a radius) and a few instant spell hits (Telekinesis and DiabCold). These have not been described much in the past, but thanks to D2R the different settings are clarified (although not completely, hence my testing and weird results). These columns are bit fields, so for example 1+2+4+8=15 enables the first four settings.

I have been unable to get any missile to use HitFlags or ResultFlags. However, radial damage produced by missiles (like the explosive radial damage from fireball) will apply the missile's HitFlags and ResultFlags.

RESULTFLAGS:
1=hit (required for radial damage to hit and deal damage; seems to do nothing when activated on melee attacks)
2=death (instantly kills anything hit by radial damage; seems to do nothing when activated on melee attacks)
4=get hit {???}
8=knockback (puts target into the knockback animation, i.e. they are knocked back; unlike knockback from items, this knockback is always successful against valid targets; seen on missiles.txt knockback, which has a defined percent chance of success rather than a guaranteed success)
16=block (puts target into the block animation; this does not actually make them block, so it is highly effective against monsters with blocking animations)
32=no passive (makes it so your hits do not trigger most auraevents; your hits will not trigger on-striking or on-kill, and likewise the target of your hits will not have their on-struck or on-death triggered; on-attack does trigger)
128=dodge (target always dodges against the hit, even if they are moving; hit will never deal direct damage; amazons will animate if they have the dodge state)
256=avoid (target always avoids against the hit, even if they are moving, even if the damage is from a melee attack; amazons will animate if they have the avoid state)
512=evade (target always evades against the hit, even if they aren't moving)
4096=ignore friendly {???}
8192=double damage (makes the critical strike overlay appear, does not actually double physical damage, does not seem to interfere with item_deadlystrike; this seems to be cosmetic only, maybe there is some AI that reacts to double damage including this pretend double damage?)
16384=soft hit {???, not noticing any differences. maybe the same as the softhit column in missiles.txt, which i think is cosmetic?}
32768=two hand-to-hand block (makes assassins go into the weapon block animation; unlike the block hitflag, this DOES negate damage, even if you aren't an assassin, so in effect hits with this resultflag will always fail since they will always be blocked)

Some notes:
ResultFlag=32 would be useful for making SrcDam somewhat less effective, since it disables powerful stats like crushing blow and exponential growth in triggered striking missiles. However, I haven't been able to get it to work with missiles, so actually this won't help with self-proliferating missiles at all, although it is useful for preventing SrcDam Radial Damage from triggering massive amounts of ctc on striking.
This is just a guess, but I think Multiple Shot's non-triggered arrows have ResultFlag=32.
ResultFlag=2 seems very similar to the way Andariel and Izual kill their allies in a huge radius after they die.

HITFLAGS:
1=do not add physical damage (all sources of SrcDam physical damage are negated, the skill will not gain physical damage that comes from the user)
2=do not add any damage (negates all damage from Srcdam, including: physical, cold, fire, lightning, magic, poison, burning, life-steal, mana-steal and presumably stamina-steal damage; the skill will not gain any damage that comes from the user)
4=no life steal (negates all SrcDam given life-steal; life-steal from etype/emin/emax still works)
8=no mana steal (negates all SrcDam given mana-steal; life-steal from etype/emin/emax still works)
16=no stamina steal (didn't test since stamina-steal doesn't work with characters)
32=use source damage (enables auraevents, like from item_crushingblow and ctc bone spear on striking)
128=no triggered events {???; auraevents, like from item_crushingblow and ctc bone spear on striking, are still occurring; enemies will also trigger events when hit, like from ctc bone spear when struck; seems to be broken, might be deprecated with its functionality moved to resultflags}
256=bypass undead (ignore resistances and immunities of monsters with monstats.txt lundead=1 and/or hundead=1; equivalent to missiles.txt holy=1)
512=bypass demons (ignore resistances and immunities of monsters with monstats.txt demon=1; equivalent to missiles.txt holy=2)
1024=bypass beasts (ignore resistances and immunities of monsters with monstats.txt demon=0, lundead=0 and hundead=0; equivalent to missiles.txt holy=4)

Some notes:
HitFlag=2 is very disappointing, it is part of a bit field yet contains the entirety of HitFlags 1, 4, 8 and presumably 16 within itself.
For the bypassing resistances HitFlags, note that a monster can be simultaneously undead and demon, in which case both HitFlag=256 and HitFlag=512 will work.
The bypassing resistances HitFlags are almost the same as the stats which ignore beast/undead/demon resistances, although unlike those, these HitFlags ignore all resistances, rather than only physical.

User avatar
Nagahaku
Junior Member
Paladin
Posts: 119
Joined: Sat Nov 30, 2019 1:11 am

Re: Guide to ResultFlags and HitFlags

Post by Nagahaku » Tue May 02, 2023 3:00 pm

Hi, I've just found something amazing...
hitflags can be combined with plus method, which means if 256+512+1024=1792, the damage would ignore any monster's immunities :D

Post Reply

Return to “General Mod Making”