Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- run: lua${{ matrix.lua }} scripts/smoke.lua . retail
- run: lua${{ matrix.lua }} scripts/smoke.lua . forever
- run: lua${{ matrix.lua }} scripts/smoke.lua . era
- run: lua${{ matrix.lua }} scripts/smoke.lua . sod
- run: lua${{ matrix.lua }} scripts/smoke.lua . tbc
- run: lua${{ matrix.lua }} scripts/smoke.lua . mists
- run: lua${{ matrix.lua }} scripts/smoke.lua . titan
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## 1.2.0 — 2026-09-24

Enable real Forever weapon-poison monitoring using verified client spell/enchant data. Add Era/Hardcore/SoD, TBC, Mists and Titan adapters, hand-aware warnings, charge/expiry polling, Classic load metadata and six-client offline coverage. Preserve Retail aura/talent behavior and shared diagnostics. Live validation remains pending.
Enable real Forever weapon-poison monitoring using verified client spell/enchant data. Add Era/Hardcore/SoD, TBC, Mists and Titan adapters, hand-aware warnings, charge/expiry polling, SoD Deadly Brew awareness, Classic load metadata and six-client offline coverage. Preserve Retail aura/talent behavior and shared diagnostics. Live validation remains pending.

Validation: 140 tests pass in both orders on Lua 5.1 and 5.2, with six client profiles, Lua parsing and exact private-library vendor checks. NoPoizen client smoke checks and package verification also pass. Live validation of the new adapters remains pending.
Validation: 141 tests pass in both orders on Lua 5.1 and 5.2, with seven client/ruleset profiles, Lua parsing and exact private-library vendor checks. NoPoizen client smoke checks and package verification also pass. Live validation of the new adapters remains pending.

See [CLIENT_COMPATIBILITY.md](CLIENT_COMPATIBILITY.md) for source evidence, scope and validation limits.

Expand Down
5 changes: 3 additions & 2 deletions CLIENT_COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The Classic references are mirrored Blizzard UI/API source. Source inspection an

- Retail retains learned lethal/nonlethal aura checks and Dragon-Tempered Blades requirements.
- Forever uses **all** accessible rows (including sparse or zero-based tables) from `C_Item.GetWeaponEnchantInfo(Enum.WeaponSlot)`, requiring one verified poison on each equipped melee weapon. It recognizes both poison training spells (`2842`, `1298494`), reads time in milliseconds, and checks charges only for poisons whose client data defines charges. Other coatings do not satisfy poison requirements. A valid poison can coexist with another coating.
- Era/Hardcore/SoD and TBC use per-weapon temporary enchants. The exact client catalog controls rank and charge handling. SoD-specific Sebacious, Numbing, Atrophic and Occult poisons are in the Era catalog only. TBC has its additional ranks and Anesthetic Poison, with no charge requirement.
- Era/Hardcore/SoD and TBC use per-weapon temporary enchants. The exact client catalog controls rank and charge handling. SoD-specific Sebacious, Numbing, Atrophic and Occult poisons are in the Era catalog only. Equipped Deadly Brew counts as automatic poison coverage; learning its engraving recipe alone does not. The detector reads `C_Engraving.GetRuneForEquipmentSlot(5).itemEnchantmentID` after checking whether engraving is enabled, and fails quietly if the rune observation is unreadable. TBC has its additional ranks and Anesthetic Poison, with no charge requirement.
- Titan uses its Wrath-derived weapon poison catalog, including ranks VIII/IX. Vendor poisons become usable at level 20; eligibility does not require the retired crafting skill. `ItemSparse` item `6947` explicitly requires level 20, rogue class mask 8, and no required skill.
- Mists uses its own lethal/nonlethal aura catalog, including Leeching and Paralytic Poison, without Retail's Dragon-Tempered Blades rules.

Expand All @@ -32,13 +32,14 @@ The generated `PoisonData.lua` comes from the actual client DB2 records, mirrore
- [Forever SpellItemEnchantment](https://wago.tools/db2/SpellItemEnchantment?build=1.60.1.70009), [SpellEffect](https://wago.tools/db2/SpellEffect?build=1.60.1.70009), [SpellName](https://wago.tools/db2/SpellName?build=1.60.1.70009).
- Matching tables for Era `1.15.9.69722`, TBC `2.5.6.69795`, and Titan `3.80.2.69874` are pinned in `scripts/poison-data-sources.json`, including SHA-256 digests and selected spell/enchant pairs.
- Forever's actual application records use effect **360** (for example spell `8679` -> enchant `323`); Era/TBC/Titan use effect **54**. Only explicitly named rogue poison families with matching enchant records enter the catalog. Generic poison, NPC toxin, rune engraving, sharpening stone, oil and shaman imbue records are excluded. This also prevents dormant SoD spell records in Forever's data from being mistaken for active Forever coatings.
- Era `SpellEffect` spell `400080` applies chest rune enchant `6708`, which grants `399969`, `399965`, `433521`. Their `Spell` descriptions establish automatic Instant Poison on unpoisoned weapons. The equipped-rune API is documented in `Blizzard_APIDocumentationGenerated/EngravingInfoDocumentation.lua` in the pinned Era source.
- Enchantment `Charges` is positive for charged Forever/Era poisons, zero for Crippling and for TBC/Titan poisons. Presence, icon or enchant type alone never establishes poison identity.
- Forever `Spell`/`SpellEffect` records `2842` and `1298494` describe poison crafting and skill lines 40/2988. Mists `Spell`/`SpellEffect` records `2823`, `8679`, `3408`, `5761`, `108211`, `108215` explicitly describe lethal/nonlethal coatings implemented as player auras.

To reproduce the catalog, download `https://wago.tools/db2/<table>/csv?build=<build>` as `<build>-<table>.csv`, run `python3 scripts/build_poison_catalog.py /path/to/csv-cache`, then format `PoisonData.lua` with StyLua. Raw CSV files are research inputs, not runtime payloads. The generated Lua and provenance JSON are committed.

## Validation

Run `lua scripts/test.lua` and `lua scripts/test.lua . reverse`. Run `lua scripts/smoke.lua . <client>` for `retail`, `forever`, `era`, `tbc`, `mists`, `titan` under Lua 5.1 and 5.2. The smoke checks load the real TOC and exercise startup, warning/satisfied transitions, restriction recovery, polling, settings/editing, console isolation, loading, disable/re-enable and logout. Private in-game fixtures cover secrets, malformed results, wrong coatings, charge policy, hand swaps, rank catalogs and Mists talent differences.
Run `lua scripts/test.lua` and `lua scripts/test.lua . reverse`. Run `lua scripts/smoke.lua . <client>` for `retail`, `forever`, `era`, `sod`, `tbc`, `mists`, `titan` under Lua 5.1 and 5.2. The smoke checks load the real TOC and exercise startup, warning/satisfied transitions, restriction recovery, polling, settings/editing, console isolation, loading, disable/re-enable and logout. Private in-game fixtures cover secrets, malformed results, wrong coatings, charge policy, hand swaps, rank catalogs and Mists talent differences.

Follow up with actual poison application on each relevant client when characters are available. In particular, confirm Forever exposes trained poison abilities through the spell-knowledge API and returns the documented weapon rows. Any unexpected runtime shape fails quietly and appears in `/np diagnostics`; it must not be treated as a successful live observation.
7 changes: 7 additions & 0 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ NoPoizen.runtimeEvents = {
"UNIT_INVENTORY_CHANGED",
"WEAPON_ENCHANT_CHANGED",
"WEAPON_SLOT_CHANGED",
"RUNE_UPDATED",
"ADDON_RESTRICTION_STATE_CHANGED",
}

Expand Down Expand Up @@ -827,6 +828,12 @@ function NoPoizen:WEAPON_SLOT_CHANGED()
end
end

function NoPoizen:RUNE_UPDATED()
if self.isEnabled then
self:RefreshPoisonState("RUNE_UPDATED")
end
end

function NoPoizen:ADDON_RESTRICTION_STATE_CHANGED()
-- Restriction queries report false during event dispatch: defer the observation.
if not self.isEnabled then
Expand Down
1 change: 1 addition & 0 deletions Diagnostics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function NoPoizen:BuildDiagnosticReport()
Add("activeSpellIDs", SpellIDs(state.activeSpellIDs))
Add("activeEnchantIDs", SpellIDs(state.activeEnchantIDs))
Add("trainingSpellIDs", SpellIDs(state.trainingSpellIDs))
Add("deadlyBrew", state.deadlyBrew)
for _, category in ipairs({ "lethal", "nonLethal", "mainHand", "offHand" }) do
Add(category .. "Required", state.requiredCounts and state.requiredCounts[category])
Add(category .. "Active", state.activeCounts and state.activeCounts[category])
Expand Down
33 changes: 33 additions & 0 deletions WeaponPoisonTests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,36 @@ addon:RegisterTest("weapon poisons: Titan vendor poisons require level rather th
f.level = f.secret
Equal(f:Evaluate().status, "unknown")
end)

addon:RegisterTest("weapon poisons: equipped SoD Deadly Brew supplies automatic coverage", function()
local f = Fixture("era")
f.api.IsEngravingEnabled = function()
return true
end
f.api.GetRuneForEquipmentSlot = function(slot)
Equal(slot, 5)
return { itemEnchantmentID = 6708 }
end
f.known = false
Equal(f:Evaluate().status, "satisfied")
Equal(f:Evaluate().deadlyBrew, true)
Equal(f:Evaluate().activeCounts.mainHand, 1)
Equal(f:Evaluate().activeCounts.offHand, 1)
f.known = true
f.api.GetRuneForEquipmentSlot = function()
return { itemEnchantmentID = 1 }
end
Equal(f:Evaluate().status, "missing")
f.api.GetRuneForEquipmentSlot = function()
return f.inaccessible
end
Equal(f:Evaluate().status, "unknown")
f.api.GetRuneForEquipmentSlot = function()
return { itemEnchantmentID = f.secret }
end
Equal(f:Evaluate().status, "unknown")
f.api.IsEngravingEnabled = function()
return false
end
Equal(f:Evaluate().status, "missing")
end)
46 changes: 43 additions & 3 deletions WeaponPoisons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ addon.WeaponPoisonAPI = {
GetWeaponEnchants = C_Item and C_Item.GetWeaponEnchantInfo,
GetTemporaryEnchantmentInfo = C_PaperDollInfo and C_PaperDollInfo.GetTemporaryEnchantmentInfo,
GetLegacyWeaponEnchants = GetWeaponEnchantInfo,
IsEngravingEnabled = C_Engraving and C_Engraving.IsEngravingEnabled,
GetRuneForEquipmentSlot = C_Engraving and C_Engraving.GetRuneForEquipmentSlot,
GetWeaponSlot = function(hand)
if not addon:CanAccessTable(Enum) or not addon:CanAccessTable(Enum.WeaponSlot) then
return nil
Expand Down Expand Up @@ -120,6 +122,31 @@ local function CreateWeaponPoisonDetector(api, client, catalog, isKnown)
or equipLoc == "INVTYPE_2HWEAPON"
)
end
local function HasDeadlyBrew()
if client ~= "era" or type(api.IsEngravingEnabled) ~= "function" then
return false
end
local ok, enabled = Query(api.IsEngravingEnabled)
if not ok or not Read(enabled) or type(enabled) ~= "boolean" then
return nil
end
if not enabled then
return false
end
local runeOK, rune = Query(api.GetRuneForEquipmentSlot, 5) -- INVSLOT_CHEST
if not runeOK or not Read(rune) then
return nil
end
if rune == nil then
return false
end
if not Table(rune) or not Number(rune.itemEnchantmentID) then
return nil
end
-- Era SpellEffect 400080 -> enchant 6708 -> ability 399969/399965.
-- Check the equipped rune, not whether its engraving recipe was learned.
return rune.itemEnchantmentID == 6708

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reuse the gated rune-enchantment value

Number(rune.itemEnchantmentID) validates one field read, but this return expression indexes the foreign rune table again and compares that fresh value without an access check. If the second read is secret or becomes protected, the equality operation can error or taint execution; the outer event pcall only contains the error. Cache the field once, validate the cached value, and compare that same value.

AGENTS.md reference: AGENTS.md:L4-L4

Useful? React with 👍 / 👎.

end
local function Classify(hasEnchant, id, remaining, charges)
if not Read(hasEnchant) then
return nil
Expand Down Expand Up @@ -233,7 +260,13 @@ local function CreateWeaponPoisonDetector(api, client, catalog, isKnown)
state.reason = "weapon-observation-restricted"
return state
end
local trained, knowledgeUnknown = false, false
local deadlyBrew = HasDeadlyBrew()
if deadlyBrew == nil then
state.reason = "rune-observation-unavailable"
return state
end
state.deadlyBrew = deadlyBrew
local trained, knowledgeUnknown = deadlyBrew, false
-- Wrath-derived Titan poisons are purchased rather than crafted. The
-- first usable coating (Instant Poison) requires level 20 in its data.
if client == "titan" then
Expand Down Expand Up @@ -274,13 +307,20 @@ local function CreateWeaponPoisonDetector(api, client, catalog, isKnown)
if equipped then
weapons = weapons + 1
state.requiredCounts[hand] = 1
local active, id = ObserveHand(hand, slot)
local active, id
if deadlyBrew then
active = true
else
active, id = ObserveHand(hand, slot)
end
if active == nil then
unknown = true
end
if active then
state.activeCounts[hand] = 1
state.activeEnchantIDs[#state.activeEnchantIDs + 1] = id
if id then
state.activeEnchantIDs[#state.activeEnchantIDs + 1] = id
end
elseif active == false then
state.missingCounts[hand] = 1
state.missingCounts.total = state.missingCounts.total + 1
Expand Down
5 changes: 4 additions & 1 deletion scripts/build_poison_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
for profile, build in profiles.items():
tables = {}
hashes = {}
for table in ["SpellName", "SpellEffect", "SpellItemEnchantment"]:
for table in ["SpellName", "SpellEffect", "SpellItemEnchantment", "Spell"]:
path = cache / (build + "-" + table + ".csv")
data = path.read_bytes()
hashes[table] = hashlib.sha256(data).hexdigest()
Expand All @@ -43,6 +43,9 @@
lua.append("\t\t[%d] = { spellID = %d, usesCharges = %s }, -- %s" % (enchant, row["spellID"], str(row["usesCharges"]).lower(), row["name"]))
lua.append("\t},")
evidence[profile] = {"build": build, "sha256": hashes, "enchants": found}
if profile == "era":
evidence[profile]["automaticPoison"] = {"name": "Deadly Brew", "engravingSpellID": 400080,
"itemEnchantmentID": 6708, "abilitySpellIDs": [399969, 399965, 433521]}
lua.append("}")
(root / "PoisonData.lua").write_text("\n".join(lua) + "\n")
(root / "scripts/poison-data-sources.json").write_text(json.dumps(evidence, indent=2, sort_keys=True) + "\n")
14 changes: 14 additions & 0 deletions scripts/poison-data-sources.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"era": {
"automaticPoison": {
"abilitySpellIDs": [
399969,
399965,
433521
],
"engravingSpellID": 400080,
"itemEnchantmentID": 6708,
"name": "Deadly Brew"
},
"build": "1.15.9.69722",
"enchants": {
"7": {
Expand Down Expand Up @@ -129,6 +139,7 @@
}
},
"sha256": {
"Spell": "455f5cfb4ba633cdb4bb43d4b45e052f5402b4153083b487924384329ce2f9b4",
"SpellEffect": "846e1a43c1371ce33e1037a132d5cf6d15b2809d9205205488f263484a935e74",
"SpellItemEnchantment": "285c67db58fbe4838bc3ac329a480d0f8218917a22ddd5817f4ae2acd1acb8fe",
"SpellName": "5ac8f81bc9b8aae4838c40cceb2e97bf5ca461838d9133eb2dd602cc7b0ebdd8"
Expand Down Expand Up @@ -239,6 +250,7 @@
}
},
"sha256": {
"Spell": "291e588d209182febd2f5f8554d13373aa8dc0262b33f325ac4fbe78e2791f93",
"SpellEffect": "fdecddfd93a3c27b48d7bbbebc8cc733a502fa8d58de623646550f9a5cffeb00",
"SpellItemEnchantment": "3873a636bb85865a40db774aefe6ec69562efdd6935ed27a7156288d246210d6",
"SpellName": "b9a0d125fd47e02c13790504e2f10c4e67a3e5d5c4a91295bd96514ba36610a6"
Expand Down Expand Up @@ -374,6 +386,7 @@
}
},
"sha256": {
"Spell": "da79e44b9b73fedd636d15ed416eac0e1798b73519dee516d5508bfe046aa42f",
"SpellEffect": "ad2309425c31dd979e3a8682e794178ddd3540f6090c774a12e1bb8432a8e1d7",
"SpellItemEnchantment": "cf9b19ba7679e467f5193bdedfe0c8586fca068f9f7a231ea7c5d87331ee9b5a",
"SpellName": "c897c51b9811c0d457c8bc34813e976d8768f378347ffcac892159f1ce89447c"
Expand Down Expand Up @@ -529,6 +542,7 @@
}
},
"sha256": {
"Spell": "37d02abb9fc5523440d02ecbf9f1fc1d5814542fd796a864f3b40cd5ba145152",
"SpellEffect": "c61828f3442b9e80d87d727ab9762243eb7049b90270be57a861da5a16ad9797",
"SpellItemEnchantment": "cb1dc7a04e0d02b4386fd2616cec8a76e144bdb745a559ccf507223c7030ee3e",
"SpellName": "f60aca8ff1c4308c0ce18e689acd70f19aa0b116945565caf760a45da04e60e9"
Expand Down
34 changes: 30 additions & 4 deletions scripts/smoke.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
-- Offline integration only: never load this file into a live WoW client.
local root, client = arg[1] or ".", arg[2] or "retail"
local versions =
{ retail = "12.1.0", forever = "1.60.1", era = "1.15.9", tbc = "2.5.6", mists = "5.5.4", titan = "3.80.2" }
local versions = {
retail = "12.1.0",
forever = "1.60.1",
era = "1.15.9",
tbc = "2.5.6",
mists = "5.5.4",
titan = "3.80.2",
sod = "1.15.9",
}
assert(versions[client], "unknown smoke client")
local weaponClient = client == "forever" or client == "era" or client == "tbc" or client == "titan"
local weaponClient = client == "forever" or client == "era" or client == "tbc" or client == "titan" or client == "sod"
local deadlyBrew = false
local coatings = {
[0] = { { hasEnchant = true, enchantID = 323, charges = 60, timeLeft = 1800000 } },
[1] = { { hasEnchant = true, enchantID = 22, charges = 0, timeLeft = 1800000 } },
Expand Down Expand Up @@ -213,7 +221,7 @@ function GetBuildInfo()
return versions[client],
"test",
"date",
({ retail = 120100, forever = 16001, era = 11509, tbc = 20506, mists = 50504, titan = 38002 })[client]
({ retail = 120100, forever = 16001, era = 11509, tbc = 20506, mists = 50504, titan = 38002, sod = 11509 })[client]
end
function InCombatLockdown()
return restricted
Expand Down Expand Up @@ -275,6 +283,15 @@ C_UnitAuras = {
return auras[id] and {} or nil
end,
}
C_Engraving = {
IsEngravingEnabled = function()
return client == "sod"
end,
GetRuneForEquipmentSlot = function(slot)
assert(slot == 5)
return deadlyBrew and { itemEnchantmentID = 6708 } or nil
end,
}
C_AddOns = {
GetAddOnMetadata = function()
return "1.1.0-beta.3"
Expand Down Expand Up @@ -410,6 +427,15 @@ else
NoPoizen.eventFrame.scripts.OnUpdate(NoPoizen.eventFrame, 1)
assert(NoPoizen.currentPoisonState.status == "satisfied" and #sounds == 4)
end
if client == "sod" then
coatings[0], coatings[1] = {}, {}
deadlyBrew = true
NoPoizen:RUNE_UPDATED()
assert(NoPoizen.currentPoisonState.status == "satisfied" and NoPoizen.currentPoisonState.deadlyBrew)
deadlyBrew = false
NoPoizen:RUNE_UPDATED()
assert(NoPoizen.currentPoisonState.status == "missing" and not NoPoizen.currentPoisonState.deadlyBrew)
end
assert(NoPoizen:OpenHudEditMode())
NoPoizen:SetOption("widgetScale", 1.5)
NoPoizen:EndPoisonIndicatorEditMode(false)
Expand Down
Loading