Data/Effects/Apply Behavior

## Apply Behavior

### Description

A type of effect which applies a behavior to a unit. There is really nothing special to it, if you need to apply a behavior to a unit, use this.

### Hint

* Using the appropriate target value is very important.
* Combining this with a search effect for example can let you apply a behavior for each unit in the search's radius
* Even though an ability can be set to target a different unit, this effect can be used to buff/debuff the caster in the process

## Example Usage

### Zealot - Charge

The zealot has an Augment type ability which orders it to use the **Attack** ability on a target enemy unit and an "Apply Behavior" effect on the caster to apply the Zealot - Charging buff behaviour which multiplies the speed of the zealot for a few seconds while it moves towards the target.

## Fields Description

### Effect: AI Notify Flags

Notifications sent to the AI when the effect is executed, I believe this makes the AI react when this effect is used.

### Effect: Behavior Count

* Number of stacks of the behavior it will apply when executed.
* If the behavior is stackable and you want multiple stacks to be applied by a single effect, change this number.

### Effect: Behavior - Behavior

* Which behavior is applied by the effect.
* Default value is a behavior that has the same ID as the effect. If there is no such behavior, it will state "<ID> (Unknown)", as shown above, and when you want to change the behavior, the box for the drop down menu will be blank.

### Effect - Chance

* The chance the effect has to occur when executed.
* 1 = 100%

### Effect - Duration

* The duration the applied behavior should use, if the Use Duration flag is set.

### Effect - Flags

Flags used by this effect, of which there is only 1.

* **Use Duration:** causes the applied behavior to ignore its defined duration and use the duration specified in the duration field.
* **Set Attribute Points:** When this flag is checked, the effect will set attribute points for the attribute behavior.
* **Set Attribute Base Points:** When the flag is checked, it will modify base points instead of bonus points.
* **Set Attribute Points Delta:** (Unknown)

### Effect: Kill Hallucination

* Whether the effect kills hallucinations upon execution.\*

### Effect: Response Flags

* AI response flags, these tell the target's AI what to do. If no flags are set and the effect is executed on an idle unit, the unit will not react.

### Effect: Unit - Effect

* Unknown but needed for Neural Parasite to function and some Xel'Naga Ship Alarm ability

### Effect: Unit - Value

* The target of the effect. Not to be mistaken with the target of the ability/behavior/effect that leads to the execution of this effect.
* Target: The target of the ability or effect that caused this effect to be executed.
* Caster: The unit that started the chain of effects that included this effect.
* Source: Most likely the unit this effect originates from, for example if a behavior is applied to some unit, and that behavior then somehow applies this \*behavior, Source will most likely target the unit that has the first behavior, and not the caster.
* Outer: No idea. Please fill in.
* Unit Origin: Most likely something similar to "Caster" and "Source", please fill in.

### Effect: Validators

* Basically the "condition" that has to return true for the effect to execute.

### Effect: Target - Marker +

* Target markers. Never used them. Someone please fill in.
* Used by some effects and abilities to mark if the effect tree has already targeted that unit using the Unit Compare Marker Count validator eg. the mutalisk glaive attack not being able to hit the same unit twice per use