Guide to Hardcoded States

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
Junior Member
Paladin
Posts: 234
Joined: Fri Dec 01, 2017 2:08 am

Guide to Hardcoded States

Post by Cypress » Tue Oct 12, 2021 4:38 pm

There are many states which have special hardcoded functionality. This guide describes some of them. If you know of any other hardcoded states that have not been described or listed, then please let me know!

THANKS:
Amazonbasin (Open Wounds state description, Poison state description, various formulae and many stat descriptions that are relevant for their respective states)
Question (for figuring out how to make the cold state apply to radial damaging auras: https://d2mods.info/forum/viewtopic.php?f=4&t=67255)
Nefarius for describing justhit (https://d2mods.info/forum/viewtopic.php?t=48963)
Nagahaku for describing dodge/avoid (https://d2mods.info/forum/viewtopic.php?f=4&t=59405)

---


[freeze] ID=1
∙When applied by any source, it stops the animations and AI of any monsters, including boss monsters (although I think this can only be applied to bosses via skill aurastates/passivestates).
∙Does nothing to players.

[cold] ID=11
∙When applied by the stats coldmindam/coldmaxdam and coldlength, it will reduce velocitypercent and attackrate by 50.
∙For an aura to successfully apply this state, it must: have no aurastats, deal cold damage and have ELen.
∙The slowing cannot be applied with cold given by an aurastate directly or the stat state.

[stunned] ID=21
∙When applied by any source, it stops the AI of any monsters, including boss monsters.
∙When applied to players, it causes hit recovery (animmode=GH) to activate when hit.

[poison] ID=2
∙Poison enables kill properties on a monster, which includes anything that causes the Kill event (like Chance to Cast on Kill, Life on Kill), experience gain, magic find, gold find.
∙Poison deals poison damage every frame, which is overridden by higher poison damage rate applications.

[openwounds] ID=62
∙Similar to poison in that it enables kill properties.
∙If itemeventfunc=15 applies this state, it will deal damage.
∙The damage scales with the level of the user.
∙Damage is dealt with hitshift=0 (1/256 times damage) every frame, gaining 31+9*max(min(ulvl,15),0)+18*max(min(ulvl-15,15),0)+27*max(min(ulvl-30,15),0)+36*max(min(ulvl-45,15),0)+45*max(ulvl-60,0) damage per frame.
∙Lasts for 200 frames when applied by itemeventfunc=15.
∙Damage is halved with striking-only hits (missiles that deal SrcDam).
∙Damage is 1/2 against non-normal monsters and 1/4 against players.

[concentration] ID=42
∙If this state gives damagepercent, then it will be applied to the magic damage of skills with srvdofunc=73 (Blessed Hammer), where the percent of damagepercent being applied is modified by the srvdofunc=73 skill's param1, in 8ths (so a value of 4 means half of the damagepercent is used to increase the skill's damage).

[attract] ID=57
∙State timer is not updated by re-application.
∙This means that, if applied via an aura, then it will constantly switch between on/off.

[invis] ID=146
∙Monsters have their overlays, shadows and the various pieces that make up their graphics turned invisible.
∙If a graphical state is applied while invisible, then that state will continue to be invisible until the invis state runs out of duration.
∙The hardcoded part only removes shadows from players, although in vanilla this state uses some softcoded state funcs to make players fully invisible as well.

[nomanaregen] ID=85
∙Seems to give -100% mana recovery, although it does not apply the stat manarecoverybonus nor manarecovery.
∙Using a source of manarecovery or manarecoverybonus will allow for mana regeneration.
∙Presumably, it modifies intrinsic mana regeneration (which isn't given by a stat).

[just_portaled] ID=102
∙Town portals cannot be entered if this state is activated by any source onto the player.
∙This state is automatically applied to the player upon entering a town portal, lasting for ~88 frames.

[preventheal] ID=52
∙This state is applied by the stat item_preventheal (ID=117) when a player with the stat attacks or strikes a target.
∙Lasts for 120,000 frames.

[skilldelay] ID=121
∙This state is applied when a player uses or activates a skill with a delay>0 in skills.txt.
∙This state works even if applied via unusual sources, such as auras.
∙While players have this state, they are unable to cast skills with delay>0.
∙{test if monsters can be affected by this state's function}

[blood_mana] ID=114
∙While active from any source, players use life instead of mana when casting skills.

[dimvision] ID=23
∙This state is activated by eventfunc=9.
∙When the state is applied by eventfunc=9 or most aurastate appliers (notably, while auras can apply dimvision, they do not seem to be able to impart the blinding function) onto a monster, the monster loses its long-distance target detection.

[shatter] ID=107
∙Randomly applied when the stat coldlength applies the state cold, lasting just as long as coldlength.
∙Every application re-rolls shatter, so it usually disables itself.
∙Seems to occur on an average of 1/5 applications of cold.
∙Holywindcold (Holy Freeze) can also apply it, although the application is a bit bugged in that it can keep the shatter state going even after the holywindcold state runs out.
∙Freeze does not apply the shatter state.

[revive] ID=96
∙Applied to monsters produced by srvdofunc=58 (Revive) and eventfunc=31 (reanimated monsters).

[inferno] ID=12
∙Applied by skills with srvstfunc=11 (Inferno and Arctic Blast) while channeling the skill.

[alignment] ID=105
∙Appears to be always active on all players and monsters.

[sourceunit] ID=98
∙Appears on Shadow Warrior and Shadow Master (srvdofunc=49), Dopplezon aka Decoy (srvdofunc=15) and Valkyrie (srvdofunc=16).
∙{unknown what it does, but probably has something to do with these monsters transforming into characters}

[uninterruptable] ID=54
∙Applied by Leap, Leap Attack and Whirlwind.
∙Causes the game to crash when applied to monsters.
∙Interrupts all actions when applied to players.
∙Also has remfunc=7 by default, although it doesn't seem to make a difference. ∙{maybe present on other skills?}

[skill_move] ID=18
∙Appears when using Leap, Leap Attack, Whirlwind and Charge.
∙{no idea what it does. maybe shows up on other skills}

[corpse_noselect] ID=118
∙Applies to corpses that have been consumed by Find Potion, Find Item or Poison Explosion.
∙Basically, skills that use corpses but do not remove the corpse.
∙Has plrstaydeath=1, monstaydeath=1, bosstaydeath=1 and udead=1: if these settings are removed, then Find Potion and Find Item can be used again but will not release more items; Poison Explosion can also be used again and will produce more missiles.
∙Carrion Vine and Solar Creeper will also apply this state briefly, but it will disappear after the corpse explodes, which suggests that corpses still exist even after they are removed, but the overlay is hidden (also, vines will keep trying to eat corpses, with no success, if the non-selection settings are removed for this state).
∙FenrisRage also seems to work on corpse_noselect corpses as long as they can still be selected.

[playerbody] ID=7
∙Applied to the corpses of dead players.
∙{unknown purpose}

[justhit] ID=86
∙Applied to a target when hit by a missile with nexthit=1 for as long as nextdelay= in frames.
∙Targets with this state cannot be hit by nexthit missiles until the state runs out.
∙Only applied by direct hits by missile, radial damage from missiles do not seem capable of applying this state.

[slowed] ID=24
∙Applied by auraeventfunc=19 and auraeventfunc=27

[pregnant] ID=110
∙Applied when a skill with srvdofunc=133 is used on a target.
∙If applied by srvdofunc=133, it will also produce a defined summon with a defined summode, with the summon changing based on area level.

[burning] ID=115
∙Applied by the stat firelength, lasting for the amount of firelength in frames-1 (i.e. 100 firelength will last for 99 frames).
∙If applied by firelength, will also deal the stats burningmin to burningmax damage over its length every frame, with a hitshift=0 (meaning 256 burning damage will deal 25 damage per second).
∙Also applied by skills using the elemtype burn.
∙Damage cannot be resisted.
∙Kills with burning do not count as the user's kill (i.e. experience, gold find, magic find, on-kill will not apply).

[dodge] ID=65
∙If given to an amazon, and the amazon triggers passive_dodge, then she will enter into the dodge animation.
∙Meaning an amazon without this state will not play the dodge animation even if she dodges.

[avoid] ID=66
∙If given to an amazon, and the amazon triggers passive_avoid, then she will enter into the avoid animation.
∙Meaning an amazon without this state will not play the avoid animation even if she avoids.

UNKNOWN PURPOSE/SOURCE OF STATE:
none
resistmagic
lightningbolt
death_delay
corpse_nodraw
sync_warped
conversion_save
dragonflight
changeclass
recycled
debugcontrol
runeword
uberminion
corpseexp
none
sync_warped
runeword
changeclass

TO BE TESTED:
{blaze}
{spiderlay}
{fetishaura}
{prayer}
{thunderstorm}
{conversion}
{dopplezon}
{evade}
{redeemed}
{healthpot}
{holyshield}
{manapot}
{conversion_save}
{rabies}
{corpse_noselect}
{attached}
{hurricane}
{armageddon}
{recycled}
{debugcontrol}
{restinpeace}: Supposedly linked to the redemption missile, but modifying this state does not change Redemption nor its redemption missile.
{corpseexp}: Supposedly linked to the corpseexp missile, but modifying this state does not change Corpse Explosion nor its corpseexp missile.
{uberminion}

Post Reply

Return to “General Mod Making”