promotional bannermobile promotional banner

LibCombatPulse

LibCombatPulse-1.0 is a lightweight LibStub WoW library that broadcasts normalized combat/utility events. Addons emit events and register consumers with filtering (kind/direction/confidence) without tight coupling.
ZSBT_Icon.png

ZSBT_Icon.png

Description

# LibCombatPulse-1.0

LibCombatPulse-1.0 is a lightweight WoW Retail library (LibStub-style) that acts as a **shared combat event bus**.

It lets addons publish and consume **normalized combat/progress/utility events** without requiring direct dependencies between addons.

This copy is shipped as a standalone addon (`LibCombatPulse-1.0`), and may also be embedded inside other addons.

## Key Features

- **Multiple consumers**
  - Any addon can register one or more consumers via `NewConsumer()`.
- **Event filtering**
  - Filter by confidence and by categories/kinds/direction/eventType.
- **Consumer safety**
  - Events are shallow-copied per-consumer by default (`copyEvent=true`) to avoid cross-consumer mutation bugs.
- **Schema normalization**
  - `Emit()` fills/normalizes basic fields like `kind` and `timestamp`.

## Library Versioning

- **MAJOR:** `LibCombatPulse-1.0`
- **MINOR:** `2`

LibStub will keep the newest MINOR version loaded.

## Loading / Access

```lua
local LibStub = _G.LibStub
local LCP = LibStub and LibStub:GetLibrary("LibCombatPulse-1.0", true)
if not (LCP and LCP.NewConsumer) then
  return
end
```

## Registering a Consumer

```lua
local handle = LCP:NewConsumer("MyAddon", {
  OnEvent = function(ev)
    -- ev is a normalized event table
    -- IMPORTANT: treat ev as read-only
  end,
}, {
  -- Options (all optional)
  minConfidence = "LOW",  -- LOW | MED | HIGH

  enableCombat = true,
  enableProgress = true,
  enableInterrupts = true,
  enableCooldowns = true,

  -- Additional opt-in filters
  -- kinds = { damage=true, heal=true, miss=true },
  -- directions = { incoming=true, outgoing=true },
  -- eventTypes = { OUTGOING_DAMAGE_COMBAT=true },

  copyEvent = true, -- default true
})

-- Later
-- handle:Disable()
-- handle:Enable()
-- handle:Unregister()
```

## Event Contract (Practical)

LibCombatPulse does not enforce a strict schema, but the following fields are common.

### Required / Normalized

- `kind` *(string)*
  - Examples: `damage`, `heal`, `miss`, `aura_gain`, `aura_fade`, `interrupt`, `cast_stop`, `cooldown_ready`, `xp`, `honor`, `reputation`
- `timestamp` *(number)*
  - Seconds (from `GetTime()`), filled if missing.

### Common Optional Fields

- `eventType` *(string)*
  - Original producer event type (example: `OUTGOING_DAMAGE_COMBAT`, `INCOMING_DAMAGE`, `COMBAT_TEXT_MISS`, `COOLDOWN_READY`).
- `direction` *(string)*
  - Usually `incoming` or `outgoing`.
- `spellId` *(number)*
- `spellName` *(string)*
- `targetName` *(string)*
- `amount` *(number)*
- `amountText` *(string)*
- `confidence` *(string)*
  - `LOW`, `MED`, `HIGH`.

### Kind-Specific Fields

- For `kind == "miss"`:
  - `missType` *(string)* (ex: `DODGE`, `PARRY`, `BLOCK`, `MISS`)

- For `kind == "cooldown_ready"`:
  - `method` *(string)* (producer-specific; ex: `BASE_CD`, `ACTIONBAR`, etc.)

- For combat damage/heal:
  - `isCrit` *(boolean)*
  - `isPeriodic` *(boolean)*
  - `amountSource` *(string)* (producer-specific provenance)

## Producer Notes

LibCombatPulse itself is only a dispatcher. Producers (addons) decide what to emit and with what confidence.

If multiple addons emit events, consumers should rely on:
- `eventType`
- `direction`
- `confidence`
- producer-specific fields (like `amountSource`, `method`, etc.)

to select what they trust.

The LibCombatPulse Team

profile avatar
  • 1
    Followers
  • 4
    Projects
  • 44.9K
    Downloads

More from Zorellion

  • Zore's Scrolling Battle Text project image

    Zore's Scrolling Battle Text

    • 44.3K
    • Addons

    ZSBT is a modern scrolling combat text addon for WoW Retail that delivers customizable incoming/outgoing combat text and notification alerts with strong spam control and safe compatibility in dungeons/raids.

    • 44.3K
    • June 15, 2026
    • Addons
    • +2
  • ZSBT Classic project image

    ZSBT Classic

    • 570
    • Addons

    Zore's Scrolling Battle Text - Classic

    • 570
    • June 15, 2026
    • Addons
    • +1
  • Good Boy project image

    Good Boy

    • 22
    • Addons

    Can I pet that Daaawg!?

    • 22
    • February 5, 2026
    • Addons
    • +1
  • Zore's Scrolling Battle Text project image

    Zore's Scrolling Battle Text

    • 44.3K
    • Addons

    ZSBT is a modern scrolling combat text addon for WoW Retail that delivers customizable incoming/outgoing combat text and notification alerts with strong spam control and safe compatibility in dungeons/raids.

    • 44.3K
    • June 15, 2026
    • Addons
    • +2
  • ZSBT Classic project image

    ZSBT Classic

    • 570
    • Addons

    Zore's Scrolling Battle Text - Classic

    • 570
    • June 15, 2026
    • Addons
    • +1
  • Good Boy project image

    Good Boy

    • 22
    • Addons

    Can I pet that Daaawg!?

    • 22
    • February 5, 2026
    • Addons
    • +1