Overview

This file defines the different states used by the game and controls how they function. States are basically passive behaviors applied to units that can apply various effects.

This file is used by the following data files: cubemain.txt, MonProp.txt, Overlay.txt, Runes.txt, Sets.txt, SetItems.txt, skills.txt, UniqueItems.txt

Any column field name starting with “*” is considered a comment field and is not used by the game

Data Fields

state – Defines the unique name ID for the state

group – Assigns the state to a group ID value. This means that only 1 state with that group ID can be active at any time on a unit. If this value is empty, then ignore this.

remhit – Boolean field. If equals 1, then this state will be removed when the unit is hit. If equals 0, then ignore this.

nosend – Boolean field. If equals 1, then this state change will not be sent to the client. If equals 0, then ignore this.

transform – Boolean field. If equals 1, then this state will be flagged to change the unit’s appearance and reset its animations when it is applied. If equals 0, then ignore this.

aura – Boolean field. If equals 1, then this state will be treated as an aura. If equals 0, then ignore this.

curable – Boolean field. If equals 1, then this state can be cured (This can be checked by NPC healing or the Paladin Cleansing skill). If equals 0, then ignore this.

curse – Boolean field. If equals 1, then this state will be flagged as a curse. If equals 0, then ignore this.

active – Boolean field. If equals 1, then the state will be classified as an active state which enables the “cltactivefunc” and “srvactivefunc” fields. If equals 0, then ignore this.

restrict – Boolean field. If equals 1, then this state will restrict the usage of certain skills (This connects with the “restrict” field from the skills.txt file). If equals 0, then ignore this.

disguise – Boolean field. If equals 1, then this state will be flagged as a disguise, meaning that the unit’s appearance is changed, which can affect how the animations are treated when being used. If equals 0, then ignored this.

attblue – Boolean field. If equals 1, then the state will make the related Attack Rating value in the character screen be colored blue. If equals 0, then ignore this.

damblue – Boolean field. If equals 1, then the state will make related Damage value in the character screen be colored blue. If equals 0, then ignore this.

armblue – Boolean field. If equals 1, then the state will make Defense value (Armor) in the character screen be colored blue. If equals 0, then ignore this.

rfblue – Boolean field. If equals 1, then the state will make Fire Resistance value in the character screen be colored blue. If equals 0, then ignore this.

rlblue – Boolean field. If equals 1, then the state will make Lightning Resistance value in the character screen be colored blue. If equals 0, then ignore this.

rcblue – Boolean field. If equals 1, then the state will make Cold Resistance value in the character screen be colored blue. If equals 0, then ignore this.

stambarblue – Boolean field. If equals 1, then the state will make the Stamina Bar UI in the HUD be colored blue. If equals 0, then ignore this.

rpblue – Boolean field. If equals 1, then the state will make Poison Resistance value in the character screen be colored blue. If equals 0, then ignore this.

attred – Boolean field. If equals 1, then the state will make the related Attack Rating value in the character screen be colored red. If equals 0, then ignore this.

damred – Boolean field. If equals 1, then the state will make related Damage value in the character screen be colored red. If equals 0, then ignore this.

armred – Boolean field. If equals 1, then the state will make Defense value (Armor) in the character screen be colored red. If equals 0, then ignore this.

rfred – Boolean field. If equals 1, then the state will make Fire Resistance value in the character screen be colored red. If equals 0, then ignore this.

rlred – Boolean field. If equals 1, then the state will make Lightning Resistance value in the character screen be colored red. If equals 0, then ignore this.

rcred – Boolean field. If equals 1, then the state will make Cold Resistance value in the character screen be colored red. If equals 0, then ignore this.

rpred – Boolean field. If equals 1, then the state will make Poison Resistance value in the character screen be colored red. If equals 0, then ignore this.

exp – Boolean field. If equals 1, then a unit with this state will give exp when killed or will gain exp when killing another unit. If equals 0, then ignore this.

plrstaydeath – Boolean field. If equals 1, then the state will persist on the player after that player is killed. If equals 0, then ignore this. state stays after death

monstaydeath – Boolean field. If equals 1, then the state will persist on the monster (non-boss) after that monster is killed. If equals 0, then ignore this.

bossstaydeath – Boolean field. If equals 1, then the state will persist on the boss after that boss is killed. If equals 0, then ignore this.

hide – Boolean field. If equals 1, then the state will hide the unit when dead (corpse and death animations will not be drawn). If equals 0, then ignore this.

hidedead – Boolean field. If equals 1, then the state will be used to destroy units with invisible corpses. If equals 0, then ignore this.

shatter – Boolean field. If equals 1, then the state causes ice shatter missiles to create when the unit dies. If equals 0, then ignore this.

udead – Boolean field. If equals 1, then the state flags the unit as a used dead corpse and the unit cannot be targeted for corpse skills. If equals 0, then ignore this.

life – Boolean field. If equals 1, then this state will cancel out the monster’s normal life regeneration. If equals 0, then ignore this.

green – Boolean field. If equals 1, then the state overrides the color changes the unit and the unit will be colored green. If equals 0, then ignore this.

pgsv – Boolean field. If equals 1, then the state is flagged as part of a progressive skill which relates to charge-up skill functionalities. If equals 0, then ignore this.

nooverlays – Boolean field. If equals 1, then the standard way for states to add overlays will be disabled. If equals 0, then ignore this.

noclear – Boolean field. If equals 1, then when this state is applied on the unit, it will not clear stats that have this state from the state’s previous application. If equals 0, then ignore this.

bossinv – Boolean field. If equals 1, then the unit with this state will use the state’s source unit’s (in this case, the unit’s boss) inventory for generating the unit’s equipped item graphics. If equals 0, then ignore this.

meleeonly – Boolean field. If equals 1, then the state will make the all the unit’s attack become melee attacks. If equals 0, then ignore this.

notondead – Boolean field. If equals 1, then the state will not play its On function (function that happens when the state is applied) if the unit is dead. If equals 0, then ignore this.

overlay1 (to overlay4) – Controls which overlay to use for normally displaying the state (Uses the “overlay” field from the Overlay.txt file). The usage depends on the specific state defined and/or the function using the state. Typically, states use “overlay1” for the Front overlay and “overlay2” for the Back overlay. Other cases can have states use each overlay field as the Front Start, Front End, Back Start, and Back End, respectively.

pgsvoverlay – Controls which overlay to use when the state has progressive charges on the unit, such as for the charge-up stat when using Assassin Martial Arts charge-up skills (Uses the “overlay” field from the Overlay.txt file)

castoverlay – Controls which overlay to use when the state is initially applied on the unit (Uses the “overlay” field from the Overlay.txt file)

removerlay – Controls which overlay to use when the state is removed from the unit (Uses the “overlay” field from the Overlay.txt file)

stat – Controls the stat associated with the stat. This is also used when determining how to add the progressive overlay (Uses the “Stat” field from ItemStatCost.txt)

setfunc – Controls the client side set functions for when the state is initially applied on the unit

CodeParametersDescription
0 Do nothing
1statCreates the overlay used for a progressive state. Can only be used if the “pgsv” flag is enabled and the “pgsvoverlay” field has a value.
2 Changes the area level’s room lighting based on a skill’s “auralencalc” field from the skills.txt file. Gets the skill by looking at the “modifierlist_skill” stat defined in the ItemStatsCost.txt file
3 Updates a skill’s level. Gets the skill by looking at the “modifierlist_skill” stat defined in the ItemStatsCost.txt file.
4 Sets the source unit for the state. Gets the “source_unit_type” and “source_unit_id” stats defined in the ItemStatsCost.txt file.
5 Changes the monster’s class type to another monster’s class type. Gets the “shortparam1” stat defined in the ItemStatsCost.txt file and uses stat’s parameter to get the class type that the unit should change to. Only works for monster units. Has a special case where if the class the monster changed from was the “baalthrone” monster (defined in monstats.txt), then also set the path of the monster to move a direction.
6 Gets the skill by looking at the “modifierlist_skill” stat defined in the ItemStatsCost.txt file and then creates the overlays defined in the “castoverlay” and “overlay#” fields
7 Plays a sound from the “prgsound” field of a skill from the skills.txt file. Gets the skill by looking at the “modifierlist_skill” stat defined in the ItemStatsCost.txt file.
8 Gets the skill by looking at the “modifierlist_skill” stat defined in the ItemStatsCost.txt file and then creates the overlays defined in the “overlay1”, “overlay2” and “overlay3” fields
9 Calls the updates passive skills function which updates the values of any skill with a “passivestate” field defined in the skills.txt file
10skillCreates the missile defined in the “skill” parameter’s “cltmissile” field and hides the targeted unit
11 Hides the unit, by disabling the drawing of its visuals
12 Hides the unit, by disabling the drawing of its visuals and shadows
13 Initializes the particle for attaching to the unit by getting the offset of the source unit’s Special component
14 Tells the unit to use the “SKILL1” command and resets its direction
15 Sets the monster mode to neutral and sets its flag to a pet
16 Sets up the overlays for a charge up skill. Gets the skill by looking at the “modifierlist_skill” stat defined in the ItemStatsCost.txt file. Applies all the overlays defined the “overlay#” fields, based on the number of skill charges on the unit.
17missileCreates the missile defined in the “missile” parameter
18missileCreates blood on the targeted unit and creates the missile defined in the “missile” parameter
19 Sets the global skill cooldown to 0

remfunc – Controls the client side remove functions for when the state is removed from the unit

CodeDescription
0Do nothing
1Removes the “pgsvoverlay” overlay. This function relies on the “pgsv” being enabled.
2Removes the state’s source unit
3Removes the overlays defined in the “castoverlay” and all of the “overlay#” fields
4Removes the “cltprgsound” from the related skill. To get the skill, this looks at the “modifierlist_skill” stat defined in the ItemStatsCost.txt file.
5Removes the overlays defined in the “castoverlay”, “overlay1”, “overlay2”, and “overlay3” fields
6Calls the updates passive skills function which updates the values of any skill with a “passivestate” field defined in the skills.txt file
7Checks that the related unit is a monster and that the skill used is the “Nest” skill defined in the skills.txt file. If true, then it removes the related unit’s collision pattern.
8Hides the unit, by disabling the drawing of its visuals and shadows
9Removes particles attached to the unit or the position of the unit
10Gets the related unit’s position and creates a “monstercorpseexplode” and “pain worm appear” missile defined from the Missiles.txt file
11Removes the overlays defined in all of the “overlay#” fields
12Sets the global skill cooldown to 0

missile – Used as a possible parameter for the “setfunc” field (Uses the “Missile” field from Missiles.txt)

skill – Used as a possible parameter for the “setfunc” field(Uses the “skill” field from skills.txt)

itemtype – Defines a potential Item Type (see ItemTypes.txt) that can be affected by the state’s color change

itemtrans – Controls the color change of the item when the unit has this state (Uses Color Codes from the reference file colors.txt)

CodeColor
 No color change
whitWhite
lgryLight Grey
dgryDark Grey
blacBlack
lbluLight Blue
dbluDark Blue
cbluCrystal Blue
lredLight Red
dredDark Red
credCrystal Red
lgrnLight Green
dgrnDark Green
cgrnCrystal Green
lyelLight Yellow
dyelDark Yellow
lgldLight Gold
dgldDark Gold
lpurLight Purple
dpurDark Purple
oranOrange
bwhtBright White

colorpri – Defines the priority of the state’s color change, when compared to other current sates on the unit. The current state that has the highest color priority on the unit will be used and other state colors will be ignored. If multiple current states share the same color priority value, then the game will choose the state with the lower ID value (based on where in the list of states in the data file that the state is defined)

colorshift – Controls which index of the color shift palette to use.

IDDescription
0(or empty)Do nothing
1First Hue Rotation
25First Hue Rotation and Darken
49First Hue Rotation and Lighten
73Color to Grey
74Color to Black
75First No Red Rotation
100Color to Red
101Color to Orange
102Color to Yellow
103Color to Grass
104Color to Green(There is a special case to not turn the player unit green)
105Color to Teal
106Color to Aqua
107Color to Light Blue
108Color to Blue
109Color to Purple
110Color to Magenta
111Color to Some Funky Red
112Color to RGB Red
113Color to RGB Green
114Color to RGB Blue

light-r – Controls the state’s change of the red color value of the Light radius (Uses a value from 0 to 255)

light-g – Controls the state’s change of the green color value of the Light radius (Uses a value from 0 to 255)

light-b – Controls the state’s change of the blue color value of the Light radius (Uses a value from 0 to 255)

onsound – Plays a sound when the state is initially applied to the unit. Links to a “Sound” from the sounds.txt file.

offsound – Plays a sound when the state is removed from the unit. Links to a “Sound” from the sounds.txt file.

gfxtype – Controls the how to handle the unit graphics transformation based on the unit type (This relies on the “disguise” field being enabled). If equals 1, then use this on a monster type unit. If equals 2, then use this on a player type unit. Otherwise, ignore this.

gfxclass – Control’s the unit class used for handling the unit graphics transformation. This field relies on what unit type was used in the “gfxtype” field. If “gfxtype” equals 1 for monster type units, then this field will rely on the “hcIdx” field from the monstats.txt data file. If “gfxtype” equals 2, then this field will use the character class numeric ID.

IDDescription
0Amazon
1Sorceress
2Necromancer
3Paladin
4Barbarian
5Druid
6Assassin

cltevent – Controls the event to check on the client side to determine when to use the function defined in the “clteventfunc” field (Uses an event defined in the Events.txt file)

clteventfunc – Controls the client Unit event function that is called when the event is determined in the “cltevent” field. These functions are equal to the funuctions used

IDDescription
0Do nothing
1Sorceress Apply Chilling Armor·         
Requires on the “hitbymissile” event defined in the “cltevent” field·         
Uses the related skill with this state and it’s related missile fields to fire a missile at a target

cltactivefunc – Controls the Client Do function that is called every frame while the state is active (see the “cltdofunc” field in skills.txt). This relies on the “active” field being enabled.

srvactivefunc – Controls the Server Do function that is called every frame while the state is active (see the “srvdofunc” field in skills.txt). This relies on the “active” field being enabled.

canstack – Boolean Field. If equals 1, then this state can stack with duplicate forms of itself (This is only usable with the “poison” state). If equals 0, then ignore this.

sunderfull – Boolean Field. If equals 1, then this state will reapply any negative resistance stats at full potential when calculating pierce immunity if the immunity was broken. If equals 0, then reapply at the normal reduced efficiency (currently 1/5).

sunder-res-reduce – Boolean Field.  If equals 1, then this state will apply pierce resistance at reduced effectiveness (currently 1/5) when calculating pierce resistance if an immunity was broken.  If equals 0, then apply pierce resistance at normal effectiveness.