Data/Behaviors/Attack Modifier

## Attack Modifier

### Description

When applied, modifiers will take effect when a weapon starts. It will register itself to the entire attack effect tree.

### Hint

Using a buff behavior with a Damage Response on attacker (with an effect directed at Target) can work the same as an effects-on hit. However this behavior offers more options and requires one little condition above all: the weapon triggering this behavior must have its damage effect use the flag "Impact" in order for this behavior to identify triggering effect. Fortunatly, upgrades can modify this flag, if the behavior is meant to be added as an upgrade (or based on a requirement). Naturaly, the flag can be changed directly from the modder.

* Most important thing that we mostly forget: Set the **Chance** field on the behavior. It is at 0 by default. If the modder thinks always using this field at 100% chance, think of modifying the core parent behavior for easier use.

* If the weapon does not use any damage effect, the modder may want to rework the child effects of the weapon to add a dummy damage effect just for the flag. Once again, if all of this is too heavy in term of data, the buff behavior method remains really simpler.
* Also, since this behavior a recent feature, Blizzard did not take the time to have the child effect tree to show on the bottom left box of the editor. This makes the tracking of effects a little more complicated to understand.
* If this behavior is linked from an Attack Modifier ability, it will only trigger upon the ability's control. It is not necessary to make the damage effect "Impact" if only using this behavior's improved stats, however it is if using the Pre Impact / Inherit Impact Effect fields.
* As it seems, putting another damage effect behaves like the Damage Inherit effect field from damage effects, which means putting any other damage in there is bonded to use the primary impact damage effect as a minumum damage. In other words, if the triggering impact damage effect does 40 damage, putting another damage effect with an amount of 0 damage as an Impact Inherit effect will also deal 40 damage (mimicking the parent damage effect). To counter this, use the fraction field on the newest damage effect. Using amount damage in negative will not work. Also, the damages are not cumulatives, so putting a 20 effect damage as Impact Inherit effect will not be 40+20, but rather 40 (because 20 is smaller than 40, the parent damage effect mimimum takes the lead). Putting 41 damage will do 41 damage, because the amount surpasses the primary damage effect.

#### Patch Note:

When applied to an attack, the Modifier can populate the WeaponModifier actor term on the WeaponStart event, so that the actor system can play different attack animations based on the current working attack modifers.

## Field Categories

### Alignement

Changes the color of the icon. It is also a way of categorizing this behavior if it must be removed by any Remove behavior effect that check the alignement.

### Attack Modifier Flags

* **Critical:** mark the attack as ‘Critical’, which would trigger Critical actor message, and would populate the SetText and SetTextlocalized message with the amount of the damage, so that modders can do Critical Strike floating texts.
* **Hallucination Visual Only:** allows modders to determine whether the attack modifier will apply the Orb effect if the caster is a Hallucination unit. If the caster is a Hallucination, you probably wouldn’t want them to deal AOE damage and raise dead as Skeletons. Still, some modders might want that option. With this flag, the attack modifier will still be applied to the attack tree, so the caster unit would still be able to fake a Critical Attack animation and throw a modified projectile missile. However, the attack won’t apply a real Orb effect when it impacts.
* **Never Miss:** Means that weapon will always trigger the orb system. See Weapons Legacy option field for more precisions.
* **Only Apply Damage Bonus to Valid Targets:** (Unknown)

### Chance

Chance for the buff to modify the attack. 1 = 100% (is set at 0 by default)

Can be influenced by Accumulators.

### Cost

Works like most behaviors, see the buff behavior for more details.

### Damage Dealt Fraction

Fraction of the current damage effect's damage that is modified per "kind" category.

* Accumulators can be used on each category to modify the amount further.

### Damage Dealt Scaled

Flat amount of damage added, added on top of the current damage per "kind" category.

* Accumulators can be used on each category to modify the amount further.

### Damage Dealt Unscaled

Flat amount of damage added, added on the base damage value, ignoring upgrades, per "kind" category.

* Accumulators can be used on each category to modify the amount further.

### Damage Total Multiplier

Fraction of the total damage effect's damage that is modified per "kind" category.

* Accumulators can be used on each category to modify the amount further.

### Icon

Icon that appears on the unit that has this behavior active on it.

### Impact Damage Inherit Effect

Fires an effect after the impact occurs, inheriting the impact damage to the following effect tree. These effects allow users to create a Chain Lighting effect or deal AoE damage based on the impact damage.

* Can determine whether the attack can miss. See the Miss/Deflect/Block System section in the buff behaviors.

### Max Stack Count

Determines the number of times the damage bonuses can be stacked.

### Multishot Search Pattern

Allow users to launch a multishot effect to every target in the search pattern given **Chance** returns true and all validators are met. If the MultishotEffect field is not set, the effect will fallback to the original weapon effect of the attack.

Can also decide if Multishot targets can also receive the impact effects.

### Pre Impact Effect

Fire an effect before the impact occurs.

* This can be handy when it is wanted to add a behavior on a unit before the damage kills it. For example, you want to add a Death Response buff behavior, the pre-impact will ensure to apply it, which the **Damage Inherit** field will not. Attack Modifiers are the only instances that allow it, aside from Damage Inherit effect on damage effects.

### Requirement

Requirement that must be true in order to have this ability enabled. Goes disable if the requirement changes to failure.

### Target Filters

Probably filters which targets can trigger the attack modifier's modification.

### Tech Alias

Array of tech for this behavior. Can be used as an alias by Requirements to group up many behaviors.

### Unique Set Id

Multiple modifiers added to a unit. This field allows users to determine whether they can all work at the same time. In War3, only one Orb effect can take place even if a hero has equipped multiple Orbs. However, modders will probably still want to have the option for multiple Orbs work at the same time.

### Validator

Validates the triggering of this behavior by checking the target /or caster at the moment it is requested

### Weapon Index Disabled

Disabled weapon by index, so that melee Heroes with the Orb item can use their hidden weapon to attack Air.

### Weapon Index Enabled

Enables weapon by index, so that melee Heroes with the Orb item can use their hidden weapon to attack Air.

## Related

Weapons Legacy

Accumulators