# CombatWords v1.01

Display custom movable dark word boxes triggered by combat events in World of Warcraft: Midnight.

Features an ElvUI-inspired visual design with cyan accent highlights, consistent backdrop styling, smooth ease-out animations, and a polished dark theme throughout.

Perfect for OBS overlays - the dark background with custom coloured text creates clean, readable on-screen alerts that show through window capture.

---

## Compatibility

Built for WoW Midnight (build 120001). The addon uses Blizzard's unrestricted fallback events (UNIT_COMBAT, UNIT_SPELLCAST, UNIT_HEALTH, etc.) so everything works out of the box with no taint risk.

If the server ever enables full CLEU access, the addon auto-detects and switches to the richer combat log automatically. Type `/cw mode` in-game to check which mode is active.

---

## Installation

1. Download the zip and extract the CombatWords folder into:
   `World of Warcraft/_classic_/Interface/AddOns/`
2. Restart WoW or type `/reload`
3. You'll see `[CombatWords] Ready!` in chat

---

## Quick Start

```
/cw add death "LOST" ffffff 42 3
/cw add damage "OUCH!" ff0000 32 2
/cw add heal "HEAL" 00ff00 28 2
/cw add kill "KILL" ffa500 42 2.5
/cw add resurrect "UP" 00ff00 36 2
```

---

## Event Types

| Type | Description |
|------|-------------|
| `combat` | Any damage you deal or receive |
| `damage` | You take damage |
| `heal` | You receive a heal (optional min amount) |
| `spellcast` | You finish casting a spell |
| `spellstart` | You begin casting a spell |
| `kill` | An enemy near you dies (open world only) |
| `death` | You die |
| `alive` | You release spirit |
| `resurrect` | You resurrect at your body |

**Extended CLEU Sub-events (when available):**
If Blizzard enables the full combat log on Midnight, these become available automatically:
SPELL_DAMAGE, SPELL_HEAL, SPELL_CAST_SUCCESS, SPELL_CAST_START, SPELL_INTERRUPT, SPELL_AURA_APPLIED, SPELL_AURA_REMOVED, SWING_DAMAGE, UNIT_DIED, RANGE_DAMAGE, ENVIRONMENTAL_DAMAGE, and more.

---

## Slash Commands

| Command | Description |
|---------|-------------|
| `/cw add [mine] <type> <word> [color] [fontSize] [duration] [minAmount] [spellId] [destName]` | Add a trigger |
| `/cw list` | Show all triggers |
| `/cw remove <#>` | Delete trigger by number |
| `/cw move` | Toggle move mode (drag boxes) |
| `/cw lock` | Toggle drag lock |
| `/cw test <#>` | Preview a trigger box |
| `/cw reset` | Delete all triggers |
| `/cw mode` | Show current detection mode |
| `/cw verbose` | Toggle chat messages on/off |
| `/cw debug` | Show technical debug info |
| `/cw help` | Show help |

---

## Parameters

| Parameter | Description | Default |
|-----------|-------------|---------|
| `type` | Event type (see list above) | *[required]* |
| `word` | Display text (use quotes for spaces) | *[required]* |
| `color` | Hex colour without `#` | `ffffff` (white) |
| `fontSize` | 12-72 | `28` |
| `duration` | Seconds visible | `2` |
| `mine` | Put before type, only YOUR actions | `off` (CLEU only) |
| `minAmount` | For heal: only trigger above this | `none` |
| `spellId` | Only trigger for a specific spell | `none` (CLEU only) |
| `destName` | Only trigger for a specific target | `none` (CLEU only) |

---

## Examples

```
/cw add death "LOST" ffffff 42 3
/cw add damage "OUCH!" ff0000 32 2
/cw add heal "HEAL" 00ff00 28 2
/cw add heal "BIG HEAL" 00ff96 36 3 50000
/cw add mine spellcast "CAST!" 00ff00 28 2
/cw add kill "KILL" ffa500 42 2.5
/cw add mine SPELL_INTERRUPT "INTERRUPT!" ff0000 34 2
/cw add mine spellcast "FLASH HEAL" 00ff00 30 2 2061
```

---

## Moving Boxes

1. `/cw move` — all boxes appear on screen
2. Click and drag them wherever you want
3. `/cw move` again to hide them
4. Positions are saved automatically between sessions

---

## Minimap Button

An icon with a cyan-glow border ring sits on the minimap edge (default: bottom-left). You can:
- **Left-click** to open the menu
- **Drag** to reposition it around the minimap
- The position saves between sessions

---

## Notes

- Kill detection uses UNIT_HEALTH polling and is disabled in dungeons/raids to prevent taint
- Heal min-amount thresholds use a delayed health snapshot for accuracy
- The `mine`, `spellId`, and `destName` filters require full CLEU access (auto-detected)
- Blizzard may adjust API restrictions after patches — check `/cw mode` after updates

---

## OBS Overlay Setup

1. Add a **Window Capture** source in OBS pointing at WoW
2. Use a **Chroma Key** filter: key colour type = Green, similarity = 0, smoothness = 0
3. The dark boxes will show through the chroma key, creating clean overlay text
4. Alternatively, use a colour-based region capture and the dark boxes are naturally visible on dark backgrounds

---

## Changelog

### v1.01
- ElvUI-style visual redesign with dark theme and cyan accents
- Menu: black background, trigger list with delete buttons, font size & box scale controls
- Live preview: trigger boxes show automatically when menu is open
- Lock/unlock chat messages when toggling from menu or `/cw lock`
- Minimap button: click to open menu, drag to reposition
- Add trigger dialog with type dropdown and colour picker
- Built for WoW Midnight (build 120001)
- Uses fallback events (no CLEU dependency)

### v1.0.0
- Midnight-first release
- Initial release

---

## Credits

Created for the WoW addon community. Enjoy!
