# Events

All events published by the Combat plugin through `SparkEventBus`.

## Core Combat Events

| Event                  | Properties                                                              | Description              |
| ---------------------- | ----------------------------------------------------------------------- | ------------------------ |
| `CombatStartedEvent`   | `CombatEntity`                                                          | An entity entered combat |
| `CombatEndedEvent`     | `CombatEntity`, `CombatDuration`                                        | An entity left combat    |
| `EntityDeathEvent`     | `Entity`, `CombatEntity`, `Killer`                                      | An entity died           |
| `TargetChangedEvent`   | `PreviousTarget`, `NewTarget`                                           | Active target switched   |
| `TargetLockedEvent`    | `LockerEntity`, `TargetEntity`, `TargetGameObject`                      | Target lock acquired     |
| `TargetUnlockedEvent`  | `LockerEntity`, `PreviousTargetEntity`, `PreviousTargetGameObject`      | Target lock released     |
| `ThreatChangedEvent`   | `NPCEntity`, `ThreatSource`, `ThreatAmount`, `NewTotalThreat`, `Reason` | NPC threat table updated |
| `StartAutoAttackEvent` | `Target`                                                                | Auto-attack initiated    |

## Ability Execution Events

| Event                          | Properties                                                         | Description               |
| ------------------------------ | ------------------------------------------------------------------ | ------------------------- |
| `AbilityExecutedEvent`         | `Ability`, `Targets`, `WasSuccessful`                              | Ability fully executed    |
| `AbilityHitEvent`              | `SourceEntity`, `TargetEntity`, `Ability`, `HitPosition`, `Damage` | Ability hit a target      |
| `AbilityValidationFailedEvent` | `Ability`, `FailureReason`, `Target`                               | Ability failed validation |
| `AbilityUnlockedEvent`         | `Ability`, `EntityId`, `BarIdentifier`, `SlotIndex`                | Ability became available  |

## Ability Phase Events

These events fire as an ability transitions through its execution phases.

| Event                      | Properties                                         | Description                     |
| -------------------------- | -------------------------------------------------- | ------------------------------- |
| `AbilityStateChangedEvent` | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability changed execution phase |
| `AbilityStartupEvent`      | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability entered startup phase   |
| `AbilityActiveEvent`       | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability entered active phase    |
| `AbilityRecoveryEvent`     | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability entered recovery phase  |
| `AbilityCompletedEvent`    | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability execution finished      |

## Channel & Incantation Events

| Event                                | Properties                          | Description                   |
| ------------------------------------ | ----------------------------------- | ----------------------------- |
| `AbilityChannelStartedEvent`         | `AbilityEntry`, `Caster`            | Channel cast began            |
| `AbilityChannelInterruptedEvent`     | `AbilityEntry`, `Caster`, `Context` | Channel was interrupted       |
| `AbilityChannelCompletedEvent`       | `AbilityEntry`, `Caster`            | Channel finished successfully |
| `AbilityIncantationStartedEvent`     | `Ability`, `Caster`                 | Incantation cast began        |
| `AbilityIncantationInterruptedEvent` | `Ability`, `Caster`                 | Incantation was interrupted   |

## Damage & Healing Events

| Event                        | Properties                                                                                                                         | Description              |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `DamageDealtEvent`           | `TargetEntity`, `DamageAmount`, `TargetStat`, `Ability`, `SourceEntity`, `MainDamageType`, `SecondaryDamageType`, `FormulaUsed`    | Damage applied to entity |
| `ObjectDamageDealtEvent`     | `TargetEntity`, `ObjectDamage`, `Ability`, `SourceEntity`, `MainDamageType`, `SecondaryDamageType`, `FormulaUsed`                  | Damage applied to object |
| `HealingAppliedEvent`        | `TargetEntity`, `HealingAmount`, `TargetStat`, `Ability`, `SourceEntity`, `MainHealingType`, `SecondaryHealingType`, `FormulaUsed` | Healing applied          |
| `NPCStaggerEvent`            | `TargetNPC`, `StaggerDuration`                                                                                                     | NPC was staggered        |
| `RevivePlayerRequestedEvent` | `EntityId`                                                                                                                         | Player revive requested  |

## Status Effect Events

| Event                  | Properties                                                       | Description                      |
| ---------------------- | ---------------------------------------------------------------- | -------------------------------- |
| `StatusAppliedEvent`   | `StatusInstance`, `TargetEntity`, `SourceEntity`, `WasStacked`   | Status effect applied            |
| `StatusRefreshedEvent` | `StatusInstance`, `NewStackCount`, `NewDuration`, `TargetEntity` | Status duration/stacks refreshed |
| `StatusRemovedEvent`   | `StatusInstance`, `Reason`, `TargetEntity`                       | Status effect removed            |
| `StatusTickEvent`      | `StatusInstance`, `TickNumber`, `TargetEntity`                   | Status periodic tick fired       |
| `StatusImmuneEvent`    | `BlockedStatus`, `TargetEntity`, `ImmunityTags`                  | Status blocked by immunity       |

## Stat & Override Events

| Event                          | Properties                                                     | Description                             |
| ------------------------------ | -------------------------------------------------------------- | --------------------------------------- |
| `StatModificationEvent`        | `Target`, `StatId`, `Value`, `ModificationType`                | Stat value modified                     |
| `BatchStatModificationEvent`   | `Target`, `Modifications`                                      | Multiple stats modified at once         |
| `AbilityTriggersOverrideEvent` | `Target`, `OverrideTriggers`, `IsClearingOverrides`, `Context` | Ability triggers temporarily overridden |
| `CombatTriggersOverrideEvent`  | `Target`, `OverrideTriggers`, `IsClearingOverrides`, `Context` | Combat triggers temporarily overridden  |

## NPC Events

| Event                | Properties                                  | Description                   |
| -------------------- | ------------------------------------------- | ----------------------------- |
| `NPCInteractedEvent` | `NPCEntry`, `Interactor`, `InteractableNPC` | Player interacted with an NPC |

See [Event System](/documentation/developer-guide/core-systems/event-system.md) for full details on subscribing, publishing, and handling events.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sparkframework.dev/documentation/developer-guide/plugins/combat/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
