跳到正文
Hiveworkshop· Wing-Span·· 2 小时前AI 评分10

AuraEngine v26.09.2026 JASS 与 Lua

AuraEngine v26.09.2026 JASS and Lua

AI 导读

AuraEngine v26.09.2026 包含 vanilla JASS 与 Lua 版,为 Warcraft III Reforged 1.31+ 提供事件驱动光环系统。该系统借助原生事件追踪单位范围,仅在状态变化时运行脚本,JASS 版需单位索引器,Lua 版无额外依赖。

正文

This bundle is marked as pending. It has not been reviewed by a staff member yet.

ABuff Aura Engine
Event-Driven Custom Aura System
Reforged 1.31+ | Two versions included: vanilla JASS & Lua

Overview
Custom auras in Warcraft III usually come down to two options:

  • The Object Editor, which only supports built-in stat modifications (armor, movement speed, damage, etc.).
  • Triggered auras driven by fast periodic timers that repeatedly enumerate units in range. This works, but the cost grows quickly with the number of sources and targets on the map.

ABuff takes a different approach: it delegates spatial tracking to the game engine itself and only runs script logic when something actually changes. The result is a system where you keep full scripting freedom in the callbacks, while the periodic cost per affected unit stays minimal.

How It Works
The engine avoids per-tick distance math entirely and splits detection into three phases:

  1. ENTER — native event. Each source gets a TriggerRegisterUnitInRange registration. When a candidate walks into the radius, the engine fires the event natively; while nothing happens, no script code runs.
  2. LEAVE — dummy buff check. The source carries a zero-stat Object Editor aura (e.g. Devotion Aura with 0 bonuses) that applies a dummy buff. The game already tracks proximity and removes that buff on its own, so instead of computing distances the engine only asks GetUnitAbilityLevel(target, dummyBuffId) on a slow poll (1.0 s by default, configurable).
  3. RARE — localized enumerations. Group enums run only on actual events: a source dies, levels up, is removed, or two sources of different levels meet. Even then, only the local neighborhood is scanned — never the whole map.

Features

  • Full lifecycle callbacks: OnCreate, OnRef (level change), OnClean (removal for any reason), OnDestroy, OnDeath, OnKill.
  • Per-instance storage: every buff instance has a free data slot for saving original stats (scale, defense type, applied damage) to restore them on exit.
  • Inter-aura communication: ABuff_CustomEvent lets auras signal each other — e.g. a protective aura can tell damage auras on the same unit to refund their damage.
  • Target filtering: built-in flags (TARGET_ALLY, TARGET_ENEMY, TARGET_HEROES, TARGET_NON_HEROES, combinable) or fully custom filter functions.
  • Level stacking rules: when multiple sources overlap, the highest level wins; when a stronger source leaves and a weaker one remains, the level falls back cleanly instead of dropping the buff.
  • Unit-type binding: AuraCreep_Register attaches an aura to a unit type ID in one line — it covers preplaced units and everything spawned later.
  • Death & revive handling: hero sources survive death and rescan on revive; targets are handed over to neighboring sources when their caster is gone.

JASS and Lua Versions
Both versions share the same architecture and public API. The Lua version is not a mechanical port — it was reworked around the language:

  • Multiplayer-safe by design: no pairs()/next() anywhere; all containers are arrays or intrusive linked lists with deterministic iteration order on every client.
  • Protected callbacks: user callbacks receive their arguments directly (no P_* globals) and run inside pcall — an error in your code is printed but never stops the engine mid-walk.
  • Simpler API surface: target filters are plain functions passed directly as the targets argument; the buff's data slot accepts any value (number, table, effect handle).
  • Integration hooks: ABuff_UnitDied and ABuff_UnitRevived are public, so custom death systems and Ankh/Reincarnation-style revives (which fire no native revive event) can be wired in manually.
  • Auto-initialization: the engine starts itself on the first Aura_Set / AuraCreep_Start call.

Demo Map Examples
The test map ships with three self-contained examples:

  • Damage Aura (3 creep types / 3 levels): deals damage on entry, heals it back on exit; units killed by the aura are revived after a delay.
  • Holy Aura: switches nearby units' armor type to Divine and broadcasts a custom event that makes active Damage Auras refund their damage while the shield holds.
  • Greed Aura (learnable hero skill): scales and tints allies by skill level; kills made by buffed allies grant the hero's owner bonus gold with floating text.

Quick Start

JASS:

// JASS
set MyAura_bID = ABuffType_Create('B000')                          // 'B000' = dummy buff from the Object Editor
call ABuffType_OnCreate(MyAura_bID, function MyAura_OnEnter)
call ABuffType_OnClean (MyAura_bID, function MyAura_OnLeave)
call AuraCreep_Register('n001', MyAura_bID, 1, TARGET_ENEMY, 600.0)  // bind to a creep type
call Aura_Set(heroUnit, MyAura_bID, 1, TARGET_ALLY, 600.0)           // or attach to a single unit

Lua:

-- Lua
MyAura = ABuffType_Create(FourCC('B000'))
ABuffType_OnCreate(MyAura, function(a) --[[ a.target, a.level, a.caster, a.data ]] end)
ABuffType_OnClean (MyAura, function(a) --[[ undo the effect ]] end)
AuraCreep_Register(FourCC('n001'), MyAura, 1, TARGET_ENEMY, 600.0)
Aura_Set(heroUnit, MyAura, 1, TARGET_ALLY, 600.0)

Requirements & Installation

  • Patch: Warcraft III Reforged 1.31+ (uses Blz* natives). A 1.26 port is possible on request — very little would need to change.
  • JASS version: 100% vanilla JASS — no vJASS, no Wurst. Requires any unit indexer.
  • Lua version: no requirements at all — a single standalone script.
  • Installation: copy the engine script into your map, set up a zero-stat dummy aura in the Object Editor, and start defining aura types.

Looking forward to trying this out after it gets reviewed

It looks very promising and this is exactly what I need for an altered melee map with hundred of units fighting at the same time. I'll save it for later to give it a try.

I accidentally forgot to uncomment // call au_clearAffected(abau), which caused the system to wait for the dummy buff to expire when a unit with an aura died. Now the aura is removed instantly. The system load has barely increased.

Looks very promising, hope it gets reviewed soon.

Okay, I've added a Lua version. It should be far more efficient. It takes a different approach, with no requirements like an indexer.

What's the diffrience with Antare's buff bot?

Last edited: Friday at 9:05 PM

What's the diffrience with Antare's buff bot?

At the very least, because this system was built largely thanks to AI, where a single query costs 5 dollars. So you can't even compare them in terms of efficiency.

Tasyen

Tasyen

kokon

kokon

TriggerHappy

Ravager16829

Bloodheaven_

HerlySQR

IronBladeClan

Luashine

来源:Hiveworkshop · hiveworkshop.com