mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2db3ebd42 | ||
|
|
66d5f0c618 | ||
|
|
7cf2ad95c3 | ||
|
|
c5bc69560e | ||
|
|
ce10c9f456 | ||
|
|
08dd3ba4dd | ||
|
|
b1fb2af861 | ||
|
|
7382e8a55f | ||
|
|
37434911e4 | ||
|
|
da8ea22998 | ||
|
|
d82eeabf22 | ||
|
|
dd61767eb9 | ||
|
|
2e8ed33a6a | ||
|
|
403567b381 | ||
|
|
7ecb66a8dc | ||
|
|
494aced5bd | ||
|
|
4f76255f73 | ||
|
|
fd8050aee1 | ||
|
|
0e07eafbf9 | ||
|
|
6aaa8a409b | ||
|
|
2cf4886b01 | ||
|
|
77f985a927 | ||
|
|
7c71f8fc26 | ||
|
|
efc98bcd6a | ||
|
|
41d9283117 | ||
|
|
9bebbbb836 | ||
|
|
586c51b53a | ||
|
|
2ce4d11698 | ||
|
|
e594fda295 | ||
|
|
22633aa16c | ||
|
|
6718a01d79 | ||
|
|
1770f7b6e1 | ||
|
|
d060b04908 | ||
|
|
6ac69501f5 | ||
|
|
782c685fba | ||
|
|
97e898f14c | ||
|
|
b84835a567 | ||
|
|
40cf2c8010 | ||
|
|
a5a0b9c00a | ||
|
|
6e57ff01dc | ||
|
|
9cd79d682d | ||
|
|
f54eda5ae3 | ||
|
|
653f8db3d7 | ||
|
|
86fb0254e6 | ||
|
|
fc640abb07 | ||
|
|
3384765faa | ||
|
|
ceaf7c2c43 | ||
|
|
963ad21297 | ||
|
|
ae09b23afd | ||
|
|
a8bf7fbc0f | ||
|
|
f0f57330c5 | ||
|
|
f21f90d0f1 | ||
|
|
d435d90871 |
@@ -20,6 +20,4 @@ jobs:
|
|||||||
- name: Package and release to GitHub
|
- name: Package and release to GitHub
|
||||||
uses: BigWigsMods/packager@v2
|
uses: BigWigsMods/packager@v2
|
||||||
env:
|
env:
|
||||||
# Only GITHUB_OAUTH is set, so the packager attaches the zip to a
|
|
||||||
# GitHub Release and uploads nothing to CurseForge/WoWInterface/Wago.
|
|
||||||
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
+252
-8
@@ -52,13 +52,13 @@ end
|
|||||||
-- C_UnitAuras
|
-- C_UnitAuras
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Scan a unit's auras (indexFn = C_UnitAuras.GetBuffDataByIndex or
|
-- Scan one aura range of `unit` (filter = "HELPFUL" or "HARMFUL") for an aura
|
||||||
-- GetDebuffDataByIndex) for one matching the dispel type. Vanilla descriptors
|
-- matching the dispel type. The filtered index self-terminates at the end of the
|
||||||
-- hold 32 helpful / 16 harmful slots; cap as a backstop.
|
-- range (nil); 48 is a backstop over vanilla's 32 helpful / 16 harmful slots.
|
||||||
local function scanDispel(indexFn, unit, dispelType, wantAny)
|
local function scanDispel(unit, filter, dispelType, wantAny)
|
||||||
local i = 1
|
local i = 1
|
||||||
while i <= 48 do
|
while i <= 48 do
|
||||||
local data = indexFn(unit, i)
|
local data = C_UnitAuras.GetAuraDataByIndex(unit, i, filter)
|
||||||
if not data then return false end
|
if not data then return false end
|
||||||
local dn = data.dispelName
|
local dn = data.dispelName
|
||||||
if dn and dn ~= "" and (wantAny or dn == dispelType) then
|
if dn and dn ~= "" and (wantAny or dn == dispelType) then
|
||||||
@@ -76,10 +76,29 @@ end
|
|||||||
-- false -> scan debuffs (defensive cleanse, default)
|
-- false -> scan debuffs (defensive cleanse, default)
|
||||||
function API.UnitHasDispelType(unit, dispelType, helpful)
|
function API.UnitHasDispelType(unit, dispelType, helpful)
|
||||||
if not unit or not UnitExists(unit) then return false end
|
if not unit or not UnitExists(unit) then return false end
|
||||||
local indexFn = helpful and C_UnitAuras.GetBuffDataByIndex
|
local filter = helpful and "HELPFUL" or "HARMFUL"
|
||||||
or C_UnitAuras.GetDebuffDataByIndex
|
|
||||||
local wantAny = (dispelType == nil or dispelType == "any")
|
local wantAny = (dispelType == nil or dispelType == "any")
|
||||||
return scanDispel(indexFn, unit, dispelType, wantAny)
|
return scanDispel(unit, filter, dispelType, wantAny)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- First matching aura on `unit` by spellID, or nil. With no filter it walks the
|
||||||
|
-- whole aura array (helpful then harmful), so it finds a debuff even when it has
|
||||||
|
-- overflowed into an NPC's buff slots -- no 16+32 slot scan, no UnitIsPlayer
|
||||||
|
-- gate. filter ("HELPFUL"/"HARMFUL") restricts the search. Returns the modern
|
||||||
|
-- AuraData (spellId, name, applications, duration, expirationTime, dispelName, ...).
|
||||||
|
function API.GetUnitAuraBySpellID(unit, spellID, filter)
|
||||||
|
if not unit or not spellID then return nil end
|
||||||
|
return C_UnitAuras.GetUnitAuraBySpellID(unit, spellID, filter)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- First matching aura on `unit` by spell NAME, or nil. Same whole-array search as
|
||||||
|
-- GetUnitAuraBySpellID; the name is case-sensitive and locale-resolved, so pass it
|
||||||
|
-- in the client's locale (what C_Spell.GetSpellName returns). filter
|
||||||
|
-- ("HELPFUL"/"HARMFUL") restricts the search. Prefer the by-ID variant for
|
||||||
|
-- portability where a spellID is known.
|
||||||
|
function API.GetAuraDataBySpellName(unit, spellName, filter)
|
||||||
|
if not unit or not spellName or spellName == "" then return nil end
|
||||||
|
return C_UnitAuras.GetAuraDataBySpellName(unit, spellName, filter)
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@@ -119,6 +138,186 @@ function API.GetActionInfo(slot)
|
|||||||
return GetActionInfo(slot)
|
return GetActionInfo(slot)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Container
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Base itemID in (bagID, slot), or nil for an empty/invalid slot. Same value
|
||||||
|
-- the "item:(%d+)" parse of GetContainerItemLink yields, but resolved straight
|
||||||
|
-- from the CGItem -- no link string built, no Lua pattern match.
|
||||||
|
function API.GetContainerItemID(bagID, slot)
|
||||||
|
return C_Container.GetContainerItemID(bagID, slot)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Base itemID equipped in `unit`'s 1-based inventory `slot` (1-19), or nil for
|
||||||
|
-- an empty slot / NPC unit. Same arg shape as GetInventoryItemLink and the same
|
||||||
|
-- value its "item:(%d+)" parse yields, resolved straight from the item instance.
|
||||||
|
function API.GetInventoryItemID(unit, slot)
|
||||||
|
return GetInventoryItemID(unit, slot)
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Item Set
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- ItemSet.dbc ID that `itemID` belongs to, or nil if it isn't part of a set
|
||||||
|
-- (or isn't cached yet). Reads the item's m_itemSet field directly -- no
|
||||||
|
-- Reliquary, no per-set ItemID[] scan.
|
||||||
|
function API.GetItemSetIDByID(itemID)
|
||||||
|
return C_Item.GetItemSetIDByID(itemID)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Table describing an ItemSet.dbc row, or nil if `setID` doesn't resolve:
|
||||||
|
-- { setID, name (localized), requiredSkill, requiredSkillRank,
|
||||||
|
-- items = { itemID, ... }, bonuses = { { spellID, threshold }, ... } }
|
||||||
|
function API.GetItemSetInfo(setID)
|
||||||
|
return C_Item.GetItemSetInfo(setID)
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Equipment Set
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- True if the saved equipment set named `name` is currently equipped -- every
|
||||||
|
-- resolvable item in its target slot (a missing bank-stored piece doesn't
|
||||||
|
-- disqualify, matching C_EquipmentSet.GetEquipmentSetInfo's isEquipped). Name is
|
||||||
|
-- an exact, case-sensitive match per GetEquipmentSetID. Returns false for an
|
||||||
|
-- unknown name or a client without the EquipmentSet API. Powers [equipset]/
|
||||||
|
-- [noequipset]; the swap side is the reclaimed /equipset command.
|
||||||
|
function API.IsEquipmentSetEquipped(name)
|
||||||
|
if not name or name == "" then return false end
|
||||||
|
local setID = C_EquipmentSet.GetEquipmentSetID(name)
|
||||||
|
if not setID then return false end
|
||||||
|
local _, _, _, isEquipped = C_EquipmentSet.GetEquipmentSetInfo(setID)
|
||||||
|
return isEquipped and true or false
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Weapon Enchant
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Temporary weapon-enchant state for a slot: "mh" (main), "oh" (off), or
|
||||||
|
-- "ranged". Returns hasEnchant, expirationMs, charges, enchantID. The enchantID
|
||||||
|
-- comes from ClassicAPI's modern C_Item.GetWeaponEnchantInfo 12-tuple (the
|
||||||
|
-- vanilla global omits it), so [mhenchant] can tell WHICH imbue is applied, not
|
||||||
|
-- just that one exists. Falls back to the vanilla 6-tuple global (enchantID nil,
|
||||||
|
-- no ranged slot) when the C_Item version is unavailable.
|
||||||
|
function API.GetWeaponEnchant(slot)
|
||||||
|
local hasM, mExp, mChg, mID, hasO, oExp, oChg, oID, hasR, rExp, rChg, rID =
|
||||||
|
C_Item.GetWeaponEnchantInfo()
|
||||||
|
if slot == "oh" then
|
||||||
|
return hasO, oExp, oChg, oID
|
||||||
|
elseif slot == "ranged" then
|
||||||
|
return hasR, rExp, rChg, rID
|
||||||
|
end
|
||||||
|
return hasM, mExp, mChg, mID
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Localized name of an item-enchant ID (poison/oil/sharpening stone/permanent),
|
||||||
|
-- read straight from SpellItemEnchantment.dbc via ClassicAPI -- or nil for an
|
||||||
|
-- unknown id / a client without C_Item.GetEnchantInfo. Lets [mhenchant:Name]
|
||||||
|
-- resolve the applied enchant's name without scraping the weapon tooltip.
|
||||||
|
function API.GetEnchantName(enchantID)
|
||||||
|
if not enchantID or enchantID == 0 then return nil end
|
||||||
|
local info = C_Item.GetEnchantInfo(enchantID)
|
||||||
|
return info and info.name or nil
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Loss Of Control
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Locked spell-school mask from an active SCHOOL_INTERRUPT (Counterspell / Kick /
|
||||||
|
-- Pummel / Earth Shock lockout) on the player, or 0 when not kicked. Read from
|
||||||
|
-- C_LossOfControl, which synthesizes the lockout from the server's own
|
||||||
|
-- SMSG_SPELL_COOLDOWN packet -- a state no debuff scan can see. Also returns the
|
||||||
|
-- seconds remaining (nil if ClassicAPI didn't observe the applying cast). Returns
|
||||||
|
-- 0 for a client without C_LossOfControl. Player-only (vanilla LoC is local-only).
|
||||||
|
function API.GetSchoolLockout()
|
||||||
|
local n = C_LossOfControl.GetActiveLossOfControlDataCount() or 0
|
||||||
|
for i = 1, n do
|
||||||
|
local d = C_LossOfControl.GetActiveLossOfControlData(i)
|
||||||
|
if d and d.locType == "SCHOOL_INTERRUPT" then
|
||||||
|
return d.lockoutSchool or 0, d.timeRemaining
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return 0, nil
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Spell
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- WoW SpellMechanic enum ID for a spell, read straight from Spell.dbc -- covers
|
||||||
|
-- every spell the client knows, not just the spellbook (1=Charm, 5=Fear,
|
||||||
|
-- 7=Root, 12=Stun, 17=Polymorph, ...). Returns (mechanicID, enUS name); the ID
|
||||||
|
-- is 0 for a known spell with no mechanic, and the whole call is nil for an
|
||||||
|
-- invalid spell ID. Replaces hand-maintained spellID -> mechanic tables.
|
||||||
|
function API.GetSpellMechanicByID(spellID)
|
||||||
|
return C_Spell.GetSpellMechanicByID(spellID)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Per-effect SpellMechanic ids (Spell.dbc EffectMechanic[3]) as {m1, m2, m3},
|
||||||
|
-- or nil for an invalid spell / 0 for an effect with no mechanic. Complements
|
||||||
|
-- GetSpellMechanicByID, which only reads the spell-level Mechanic field: vanilla
|
||||||
|
-- stores some mechanics on an effect instead (e.g. Rake's bleed is effect-level,
|
||||||
|
-- so GetSpellMechanicByID returns 0 but this returns {0,15,0}). Nil-guarded so an
|
||||||
|
-- older ClassicAPI build without the function degrades gracefully.
|
||||||
|
function API.GetSpellEffectMechanics(spellID)
|
||||||
|
return C_Spell.GetSpellEffectMechanics(spellID)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flat spell-damage bonus (spell power) for a magic school, as a number.
|
||||||
|
-- school is 1-based: 1=Physical, 2=Holy, 3=Fire, 4=Nature, 5=Frost, 6=Shadow,
|
||||||
|
-- 7=Arcane. Reads the same client field nampower's GetSpellPower does -- exact,
|
||||||
|
-- with gear/enchants/buffs/talents/set bonuses baked in.
|
||||||
|
function API.GetSpellBonusDamage(school)
|
||||||
|
return GetSpellBonusDamage(school)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flat healing bonus (+healing), as a number. Vanilla has no healing-done field,
|
||||||
|
-- so ClassicAPI derives it from gear/enchant/buff MOD_HEALING_DONE plus
|
||||||
|
-- stat-conversion talents (e.g. Spiritual Guidance) -- exact, not a holy-damage
|
||||||
|
-- proxy.
|
||||||
|
function API.GetSpellBonusHealing()
|
||||||
|
return GetSpellBonusHealing()
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Unit Health
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Health deficit (max - current) for `unit` in one call. Falls back to
|
||||||
|
-- UnitHealthMax - UnitHealth without ClassicAPI.
|
||||||
|
API.UnitHealthMissing = UnitHealthMissing or function(unit)
|
||||||
|
return (UnitHealthMax(unit) or 0) - (UnitHealth(unit) or 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Unit Power
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Current power for a specific Enum.PowerType (0=Mana, 1=Rage, 2=Focus,
|
||||||
|
-- 3=Energy, 4=Happiness), or the unit's primary power when powerType is omitted.
|
||||||
|
-- Display-divided (rage reads 0..100). Falls back to UnitMana without ClassicAPI.
|
||||||
|
API.UnitPower = UnitPower or function(unit, powerType)
|
||||||
|
return UnitMana(unit)
|
||||||
|
end
|
||||||
|
|
||||||
|
API.UnitPowerMax = UnitPowerMax or function(unit, powerType)
|
||||||
|
return UnitManaMax(unit)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Power deficit (max - current) for the type / primary power, in one call.
|
||||||
|
API.UnitPowerMissing = UnitPowerMissing or function(unit, powerType)
|
||||||
|
return (UnitManaMax(unit) or 0) - (UnitMana(unit) or 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Unit's primary power type as an integer (0=Mana .. 4=Happiness).
|
||||||
|
function API.UnitPowerType(unit)
|
||||||
|
return UnitPowerType(unit)
|
||||||
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- State
|
-- State
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@@ -133,6 +332,51 @@ function API.IsSwimming()
|
|||||||
return IsSwimming() and true or false
|
return IsSwimming() and true or false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- True if the player is currently mounted.
|
||||||
|
function API.IsMounted()
|
||||||
|
return IsMounted() and true or false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- True if the player is under a WMO roof (building, cave, instance interior).
|
||||||
|
-- Live engine geometry query, not zone-based; nil (-> false) pre-world.
|
||||||
|
function API.IsIndoors()
|
||||||
|
return IsIndoors() and true or false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- True if the player is outdoors (open sky / not inside a WMO interior).
|
||||||
|
-- Exact complement of IsIndoors for a resolvable player.
|
||||||
|
function API.IsOutdoors()
|
||||||
|
return IsOutdoors() and true or false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Player's stand state: 0 = standing, non-zero = sitting/sleeping/kneeling/etc.
|
||||||
|
-- (see UnitStandState). Player-only.
|
||||||
|
function API.GetPlayerStandState()
|
||||||
|
return UnitStandState("player") or 0
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Cursor
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function API.GetCursorInfo()
|
||||||
|
return GetCursorInfo()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Tri-state check of whether the cursor holds the item with `itemID`:
|
||||||
|
-- true -> cursor holds exactly that item
|
||||||
|
-- false -> cursor holds a DIFFERENT item
|
||||||
|
-- nil -> can't tell (cursor empty / not an item / itemID unknown)
|
||||||
|
-- Callers should only act on an explicit `false`, leaving the nil case to the
|
||||||
|
-- existing CursorHasItem() behavior.
|
||||||
|
function API.CursorHoldsItemID(itemID)
|
||||||
|
if not itemID then return nil end
|
||||||
|
local kind, id = GetCursorInfo()
|
||||||
|
if kind ~= "item" then return nil end
|
||||||
|
if not id then return nil end
|
||||||
|
return id == itemID
|
||||||
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- NamePlate
|
-- NamePlate
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|||||||
+40
-67
@@ -32,6 +32,35 @@ CleveRoids.lastRakeCast = CleveRoids.lastRakeCast or {
|
|||||||
timestamp = 0
|
timestamp = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Family membership without hardcoded rank lists. C_Spell.GetSpellName resolves
|
||||||
|
-- ANY spellID from the client's Spell.dbc -- every rank (so no enumeration or
|
||||||
|
-- spellbook scan) and TWoW's custom spells alike -- so "is this spellID a Rip?"
|
||||||
|
-- is just a name match against one seed rank. seedNameCache memoizes the seed's
|
||||||
|
-- localized name (locale-safe: derived from the ID, not a hardcoded string; a
|
||||||
|
-- seed absent from the DBC, e.g. a TWoW spell on a stock client, resolves to nil
|
||||||
|
-- and the set simply never matches -- which is correct, that spell can't be cast).
|
||||||
|
local seedNameCache = {}
|
||||||
|
local function SeedName(seedID)
|
||||||
|
local n = seedNameCache[seedID]
|
||||||
|
if n == nil then
|
||||||
|
n = C_Spell.GetSpellName(seedID) or false
|
||||||
|
seedNameCache[seedID] = n
|
||||||
|
end
|
||||||
|
return n or nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Stand-in for a hardcoded {spellID=true,...} rank set: t[spellID] is true iff
|
||||||
|
-- spellID is any rank of the family seeded by seedID. Same read shape as the old
|
||||||
|
-- tables, so every membership consumer (`X and X[id]`) keeps working unchanged.
|
||||||
|
-- Only valid for membership tests -- these are not iterable (pairs() sees empty).
|
||||||
|
local function RankSet(seedID)
|
||||||
|
return setmetatable({}, { __index = function(_, spellID)
|
||||||
|
if type(spellID) ~= "number" then return nil end
|
||||||
|
local name = SeedName(seedID)
|
||||||
|
return (name and C_Spell.GetSpellName(spellID) == name) and true or nil
|
||||||
|
end })
|
||||||
|
end
|
||||||
|
|
||||||
-- Define spells that scale with combo points by SPELL ID and their duration formulas
|
-- Define spells that scale with combo points by SPELL ID and their duration formulas
|
||||||
-- Duration = base + (combo_points - 1) * increment
|
-- Duration = base + (combo_points - 1) * increment
|
||||||
CleveRoids.ComboScalingSpellsByID = {
|
CleveRoids.ComboScalingSpellsByID = {
|
||||||
@@ -70,32 +99,9 @@ CleveRoids.FerociousBiteSpellIDs = {
|
|||||||
[31018] = true, -- Rank 6
|
[31018] = true, -- Rank 6
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Rip spell IDs (for Carnage talent - refreshed when Carnage procs)
|
-- Rip / Rake families (for Carnage talent). Seeded by Rank 1; matches every rank.
|
||||||
CleveRoids.RipSpellIDs = {
|
CleveRoids.RipSpellIDs = RankSet(1079)
|
||||||
[1079] = true, -- Rank 1
|
CleveRoids.RakeSpellIDs = RankSet(1822)
|
||||||
[9492] = true, -- Rank 2
|
|
||||||
[9493] = true, -- Rank 3
|
|
||||||
[9752] = true, -- Rank 4
|
|
||||||
[9894] = true, -- Rank 5
|
|
||||||
[9896] = true, -- Rank 6
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Rake spell IDs (for Carnage talent - refreshed when Carnage procs)
|
|
||||||
CleveRoids.RakeSpellIDs = {
|
|
||||||
[1822] = true, -- Rank 1
|
|
||||||
[1823] = true, -- Rank 2
|
|
||||||
[1824] = true, -- Rank 3
|
|
||||||
[9904] = true, -- Rank 4
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Pounce Bleed spell IDs (for immunity detection - bleed portion of Pounce)
|
|
||||||
-- Note: Pounce (cast) TRIGGERS a separate Pounce Bleed spell with different IDs
|
|
||||||
-- Cast IDs: 9005, 9823, 9827 → Trigger Bleed IDs: 9007, 9824, 9826
|
|
||||||
CleveRoids.PounceBleedSpellIDs = {
|
|
||||||
[9007] = true, -- Rank 1 (triggered by Pounce 9005)
|
|
||||||
[9824] = true, -- Rank 2 (triggered by Pounce 9823)
|
|
||||||
[9826] = true, -- Rank 3 (triggered by Pounce 9827)
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Combined table for all bleed spells that need immunity detection
|
-- Combined table for all bleed spells that need immunity detection
|
||||||
-- Used when checking if a cast bleed failed to apply (indicates bleed immunity)
|
-- Used when checking if a cast bleed failed to apply (indicates bleed immunity)
|
||||||
@@ -132,14 +138,9 @@ CleveRoids.PounceToBleedMapping = {
|
|||||||
-- When Molten Blast hits, it refreshes Flame Shock duration on the target
|
-- When Molten Blast hits, it refreshes Flame Shock duration on the target
|
||||||
-- Detection: Monitor combat log for Molten Blast damage, then refresh Flame Shock
|
-- Detection: Monitor combat log for Molten Blast damage, then refresh Flame Shock
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
CleveRoids.MoltenBlastSpellIDs = {
|
-- TWoW custom; seed resolves on the TWoW client (nil/never-matches on stock,
|
||||||
[36916] = true, -- Rank 1
|
-- where Molten Blast can't be cast anyway).
|
||||||
[36917] = true, -- Rank 2
|
CleveRoids.MoltenBlastSpellIDs = RankSet(36916)
|
||||||
[36918] = true, -- Rank 3
|
|
||||||
[36919] = true, -- Rank 4
|
|
||||||
[36920] = true, -- Rank 5
|
|
||||||
[36921] = true, -- Rank 6
|
|
||||||
}
|
|
||||||
|
|
||||||
CleveRoids.FlameShockSpellIDs = {
|
CleveRoids.FlameShockSpellIDs = {
|
||||||
[8050] = true, -- Rank 1
|
[8050] = true, -- Rank 1
|
||||||
@@ -154,12 +155,7 @@ CleveRoids.FlameShockSpellIDs = {
|
|||||||
-- WARLOCK: Conflagrate → Immolate Duration Reduction
|
-- WARLOCK: Conflagrate → Immolate Duration Reduction
|
||||||
-- When Conflagrate is cast, it reduces Immolate duration by 3 seconds
|
-- When Conflagrate is cast, it reduces Immolate duration by 3 seconds
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
CleveRoids.ConflagrateSpellIDs = {
|
CleveRoids.ConflagrateSpellIDs = RankSet(17962)
|
||||||
[17962] = true, -- Rank 1
|
|
||||||
[18930] = true, -- Rank 2
|
|
||||||
[18931] = true, -- Rank 3
|
|
||||||
[18932] = true, -- Rank 4
|
|
||||||
}
|
|
||||||
|
|
||||||
CleveRoids.ImmolateSpellIDs = {
|
CleveRoids.ImmolateSpellIDs = {
|
||||||
[348] = true, -- Rank 1
|
[348] = true, -- Rank 1
|
||||||
@@ -177,11 +173,8 @@ CleveRoids.ImmolateSpellIDs = {
|
|||||||
-- Channeled spell that accelerates DoT tick rate by 30% while channeling
|
-- Channeled spell that accelerates DoT tick rate by 30% while channeling
|
||||||
-- Complex tracking: debuff expires 30% faster while Dark Harvest is active
|
-- Complex tracking: debuff expires 30% faster while Dark Harvest is active
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
CleveRoids.DarkHarvestSpellIDs = {
|
-- TWoW custom (see MoltenBlast note).
|
||||||
[52550] = true, -- Rank 1
|
CleveRoids.DarkHarvestSpellIDs = RankSet(52550)
|
||||||
[52551] = true, -- Rank 2
|
|
||||||
[52552] = true, -- Rank 3
|
|
||||||
}
|
|
||||||
|
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
-- DRUID: Rake Debuff Cap Boss Whitelist
|
-- DRUID: Rake Debuff Cap Boss Whitelist
|
||||||
@@ -489,7 +482,7 @@ function CleveRoids.TrackComboPointCastByID(spellID, targetGUID)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Second, check if name-based tracking has recent data for this spell
|
-- Second, check if name-based tracking has recent data for this spell
|
||||||
local spellName = GetSpellRecField(spellID, "name")
|
local spellName = C_Spell.GetSpellName(spellID)
|
||||||
if spellName then
|
if spellName then
|
||||||
-- Remove rank info for comparison
|
-- Remove rank info for comparison
|
||||||
local baseName = CleveRoids.StripRank(spellName)
|
local baseName = CleveRoids.StripRank(spellName)
|
||||||
@@ -548,26 +541,6 @@ function CleveRoids.TrackComboPointCastByID(spellID, targetGUID)
|
|||||||
return duration
|
return duration
|
||||||
end
|
end
|
||||||
|
|
||||||
-- API function to get last tracked combo points for a spell
|
|
||||||
function CleveRoids.GetLastComboPointsForSpell(spellName)
|
|
||||||
if CleveRoids.ComboPointTracking[spellName] then
|
|
||||||
return CleveRoids.ComboPointTracking[spellName].combo_points
|
|
||||||
elseif CleveRoids.spell_tracking[spellName] then
|
|
||||||
return CleveRoids.spell_tracking[spellName].last_combo_points
|
|
||||||
end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- API function to get last calculated duration for a spell
|
|
||||||
function CleveRoids.GetLastDurationForSpell(spellName)
|
|
||||||
if CleveRoids.ComboPointTracking[spellName] then
|
|
||||||
return CleveRoids.ComboPointTracking[spellName].duration
|
|
||||||
elseif CleveRoids.spell_tracking[spellName] then
|
|
||||||
return CleveRoids.spell_tracking[spellName].last_duration
|
|
||||||
end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Utility function to display current combo tracking info
|
-- Utility function to display current combo tracking info
|
||||||
function CleveRoids.ShowComboTracking()
|
function CleveRoids.ShowComboTracking()
|
||||||
CleveRoids.Print("=== Combo Point Tracking ===")
|
CleveRoids.Print("=== Combo Point Tracking ===")
|
||||||
@@ -683,7 +656,7 @@ if _G.UseAction then
|
|||||||
local spellName = nil
|
local spellName = nil
|
||||||
|
|
||||||
if actionType == "SPELL" and actionID then
|
if actionType == "SPELL" and actionID then
|
||||||
spellName = GetSpellRecField(actionID, "name")
|
spellName = C_Spell.GetSpellName(actionID)
|
||||||
end
|
end
|
||||||
|
|
||||||
if currentCP and currentCP > 0 then
|
if currentCP and currentCP > 0 then
|
||||||
|
|||||||
+25
-19
@@ -2,9 +2,10 @@ local _G = _G or getfenv(0)
|
|||||||
local CleveRoids = _G.CleveRoids or {}
|
local CleveRoids = _G.CleveRoids or {}
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("Compatibility_pfUI")
|
local Extension = CleveRoids.RegisterExtension("Compatibility_pfUI")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "ADDON_LOADED")
|
|
||||||
Extension.RegisterEvent("PLAYER_LOGIN", "PLAYER_LOGIN")
|
|
||||||
Extension.Debug = false
|
Extension.Debug = false
|
||||||
|
-- pfUI-loaded and player-login handlers are wired via ClassicAPI's EventUtil at
|
||||||
|
-- the bottom of the file (ContinueOnAddOnLoaded fires immediately if pfUI already
|
||||||
|
-- loaded, so no separate "we missed pfUI's ADDON_LOADED" fallback is needed).
|
||||||
|
|
||||||
-- Track pfUI state
|
-- Track pfUI state
|
||||||
Extension.pfUILoaded = false
|
Extension.pfUILoaded = false
|
||||||
@@ -99,7 +100,7 @@ local function GetCarnageOverride(effect)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for spellID, override in pairs(CleveRoids.carnageDurationOverrides) do
|
for spellID, override in pairs(CleveRoids.carnageDurationOverrides) do
|
||||||
local spellName = GetSpellRecField(spellID, "name")
|
local spellName = C_Spell.GetSpellName(spellID)
|
||||||
if spellName then
|
if spellName then
|
||||||
local baseName = CleveRoids.StripRank(spellName)
|
local baseName = CleveRoids.StripRank(spellName)
|
||||||
if baseName == effect and override.timestamp and (GetTime() - override.timestamp) < 5 then
|
if baseName == effect and override.timestamp and (GetTime() - override.timestamp) < 5 then
|
||||||
@@ -209,7 +210,7 @@ function Extension.HookPfUILibdebuff()
|
|||||||
for spellID, rec in pairs(CleveRoids.libdebuff.objects[unitGUID]) do
|
for spellID, rec in pairs(CleveRoids.libdebuff.objects[unitGUID]) do
|
||||||
if rec and rec.start and rec.duration then
|
if rec and rec.start and rec.duration then
|
||||||
-- Get spell name for this ID
|
-- Get spell name for this ID
|
||||||
local spellName = GetSpellRecField(spellID, "name")
|
local spellName = C_Spell.GetSpellName(spellID)
|
||||||
if spellName then
|
if spellName then
|
||||||
local baseName = CleveRoids.StripRank(spellName)
|
local baseName = CleveRoids.StripRank(spellName)
|
||||||
if baseName == effect then
|
if baseName == effect then
|
||||||
@@ -380,7 +381,7 @@ function Extension.SyncComboDurationToPfUI(guid, spellID, duration)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Get spell name from spell ID
|
-- Get spell name from spell ID
|
||||||
local spellName = GetSpellRecField(spellID, "name")
|
local spellName = C_Spell.GetSpellName(spellID)
|
||||||
if not spellName then
|
if not spellName then
|
||||||
if CleveRoids.debug then
|
if CleveRoids.debug then
|
||||||
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000[pfUI Sync]|r Could not find spell name for ID " .. spellID)
|
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000[pfUI Sync]|r Could not find spell name for ID " .. spellID)
|
||||||
@@ -726,23 +727,22 @@ function Extension.OnLoad()
|
|||||||
SLASH_PFUICD1 = "/pfuicd"
|
SLASH_PFUICD1 = "/pfuicd"
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.ADDON_LOADED()
|
-- Fires once pfUI has loaded (immediately if it loaded before us, via EventUtil).
|
||||||
-- Check if pfUI just loaded AND the global actually exists
|
function Extension.OnPfUILoaded()
|
||||||
-- (another addon could be named "pfUI" without being the real UI framework)
|
-- Guard: only the real pfUI framework sets this global (another addon could be
|
||||||
if arg1 == "pfUI" and pfUI then
|
-- named "pfUI" without being the UI framework).
|
||||||
Extension.pfUILoaded = true
|
if not pfUI then return end
|
||||||
-- pfUI modules load after ADDON_LOADED, so schedule a check
|
Extension.pfUILoaded = true
|
||||||
if CleveRoids.ScheduleTimer then
|
-- pfUI's submodules initialize after its ADDON_LOADED, so defer the setup.
|
||||||
CleveRoids.ScheduleTimer(function()
|
if CleveRoids.ScheduleTimer then
|
||||||
Extension.SetupCompatibility()
|
CleveRoids.ScheduleTimer(function()
|
||||||
end, 0.5)
|
Extension.SetupCompatibility()
|
||||||
end
|
end, 0.5)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.PLAYER_LOGIN()
|
function Extension.OnPlayerLogin()
|
||||||
-- If pfUI loaded before SCRM (alphabetical order), ADDON_LOADED for pfUI was missed.
|
-- Ensure lib.objects is linked correctly (InitPfUIIntegration is idempotent).
|
||||||
-- Re-run InitPfUIIntegration here to ensure lib.objects is linked correctly.
|
|
||||||
if pfUI and not CleveRoids.hasPfUI76 then
|
if pfUI and not CleveRoids.hasPfUI76 then
|
||||||
local lib = CleveRoids.libdebuff
|
local lib = CleveRoids.libdebuff
|
||||||
if lib and lib.InitPfUIIntegration then
|
if lib and lib.InitPfUIIntegration then
|
||||||
@@ -797,4 +797,10 @@ if not CleveRoids.ScheduleTimer then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Wire handlers via ClassicAPI EventUtil (fires immediately if the event already
|
||||||
|
-- happened, so load order relative to pfUI no longer matters). Registered here,
|
||||||
|
-- after the handlers are defined, since ContinueOnAddOnLoaded may fire inline.
|
||||||
|
EventUtil.ContinueOnAddOnLoaded("pfUI", Extension.OnPfUILoaded)
|
||||||
|
EventUtil.ContinueOnPlayerLogin(Extension.OnPlayerLogin)
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
_G["CleveRoids"] = CleveRoids
|
||||||
|
|||||||
+364
-361
File diff suppressed because it is too large
Load Diff
+14
@@ -63,10 +63,24 @@ SlashCmdList.EQSLOT13 = CleveRoids.DoEquipTrinket1
|
|||||||
SLASH_EQSLOT141 = "/equip14"
|
SLASH_EQSLOT141 = "/equip14"
|
||||||
SlashCmdList.EQSLOT14 = CleveRoids.DoEquipTrinket2
|
SlashCmdList.EQSLOT14 = CleveRoids.DoEquipTrinket2
|
||||||
|
|
||||||
|
-- Reclaim ClassicAPI's /equipset (command name EQUIP_SET) so it supports
|
||||||
|
-- conditionals. ClassicAPI registers the localized aliases against EQUIP_SET;
|
||||||
|
-- swapping the handler keeps every alias and adds the conditional engine.
|
||||||
|
if SlashCmdList.EQUIP_SET then
|
||||||
|
SlashCmdList.EQUIP_SET = CleveRoids.DoEquipSet
|
||||||
|
else
|
||||||
|
SLASH_EQUIPSET1 = "/equipset"
|
||||||
|
SlashCmdList.EQUIPSET = CleveRoids.DoEquipSet
|
||||||
|
end
|
||||||
|
|
||||||
SLASH_UNSHIFT1 = "/unshift"
|
SLASH_UNSHIFT1 = "/unshift"
|
||||||
|
|
||||||
SlashCmdList.UNSHIFT = CleveRoids.DoUnshift
|
SlashCmdList.UNSHIFT = CleveRoids.DoUnshift
|
||||||
|
|
||||||
|
SLASH_CANCELFORM1 = "/cancelform"
|
||||||
|
|
||||||
|
SlashCmdList.CANCELFORM = CleveRoids.DoCancelForm
|
||||||
|
|
||||||
SLASH_UNQUEUE1 = "/unqueue"
|
SLASH_UNQUEUE1 = "/unqueue"
|
||||||
SlashCmdList.UNQUEUE = SpellStopCasting
|
SlashCmdList.UNQUEUE = SpellStopCasting
|
||||||
|
|
||||||
|
|||||||
@@ -209,8 +209,8 @@ local function InjectCustomSpells()
|
|||||||
local count = 0
|
local count = 0
|
||||||
for spellID, data in pairs(CleveRoids.CustomCursiveSpells) do
|
for spellID, data in pairs(CleveRoids.CustomCursiveSpells) do
|
||||||
-- Get texture from GetSpellRecField + GetSpellIconTexture
|
-- Get texture from GetSpellRecField + GetSpellIconTexture
|
||||||
local name = GetSpellRecField(spellID, "name")
|
local name = C_Spell.GetSpellName(spellID)
|
||||||
local rank = GetSpellRecField(spellID, "rank")
|
local rank = C_Spell.GetSpellSubtext(spellID)
|
||||||
local texture = CleveRoids.libdebuff and CleveRoids.libdebuff:GetCachedIcon(spellID)
|
local texture = CleveRoids.libdebuff and CleveRoids.libdebuff:GetCachedIcon(spellID)
|
||||||
if texture then
|
if texture then
|
||||||
-- Always update/add (in case Cursive reloaded and cleared them)
|
-- Always update/add (in case Cursive reloaded and cleared them)
|
||||||
@@ -524,8 +524,8 @@ CleveRoids.HandleConsoleCommand = function(msg)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local name = GetSpellRecField(spellID, "name")
|
local name = C_Spell.GetSpellName(spellID)
|
||||||
local rank = GetSpellRecField(spellID, "rank")
|
local rank = C_Spell.GetSpellSubtext(spellID)
|
||||||
local texture = CleveRoids.libdebuff and CleveRoids.libdebuff:GetCachedIcon(spellID)
|
local texture = CleveRoids.libdebuff and CleveRoids.libdebuff:GetCachedIcon(spellID)
|
||||||
if not name then
|
if not name then
|
||||||
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000Error:|r Spell ID " .. spellID .. " not found.")
|
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000Error:|r Spell ID " .. spellID .. " not found.")
|
||||||
|
|||||||
+62
-13
@@ -1274,6 +1274,56 @@ end
|
|||||||
-- Hook Installation
|
-- Hook Installation
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Dynamic macro-list icons
|
||||||
|
-- Blizzard shows the default question-mark icon for macros with no chosen icon
|
||||||
|
-- (e.g. "#showtooltip Shoot"). Replace it with the icon the action bar would
|
||||||
|
-- show -- resolved from the macro's #showtooltip/first action -- but ONLY when
|
||||||
|
-- the saved icon is the question mark, so user-chosen icons are never touched.
|
||||||
|
-- Purely cosmetic: Blizzard repaints from GetMacroInfo on the next update, so
|
||||||
|
-- if resolution fails or the macro changes, the default simply returns.
|
||||||
|
-- ============================================================================
|
||||||
|
|
||||||
|
local QUESTION_MARK = string.lower(CleveRoids.unknownTexture or "Interface\\Icons\\INV_Misc_QuestionMark")
|
||||||
|
|
||||||
|
local function IsQuestionMark(iconTexture)
|
||||||
|
local tex = iconTexture and iconTexture:GetTexture()
|
||||||
|
return type(tex) == "string" and string.lower(tex) == QUESTION_MARK
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Resolved tooltip texture for a Blizzard macro index, or nil when it resolves
|
||||||
|
-- to nothing better than the question mark (no #showtooltip, unresolved spell).
|
||||||
|
local function ResolveMacroIcon(macroIndex)
|
||||||
|
if not macroIndex or macroIndex < 1 then return nil end
|
||||||
|
local ok, macro = pcall(CleveRoids.GetMacroByIndex, macroIndex)
|
||||||
|
if not ok or not macro or not macro.actions or not macro.actions.tooltip then return nil end
|
||||||
|
local tex = macro.actions.tooltip.texture
|
||||||
|
if type(tex) == "string" and string.lower(tex) ~= QUESTION_MARK then
|
||||||
|
return tex
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function FixMacroListIcons()
|
||||||
|
if not MacroFrame or not MacroFrame:IsVisible() then return end
|
||||||
|
|
||||||
|
local base = MacroFrame.macroBase or 0
|
||||||
|
for i = 1, (MAX_MACROS or 18) do
|
||||||
|
local icon = getglobal("MacroButton" .. i .. "Icon")
|
||||||
|
if icon and IsQuestionMark(icon) then
|
||||||
|
local tex = ResolveMacroIcon(base + i)
|
||||||
|
if tex then icon:SetTexture(tex) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Large icon for the currently-selected macro (details pane).
|
||||||
|
if MacroFrame.selectedMacro and MacroFrameSelectedMacroButtonIcon
|
||||||
|
and IsQuestionMark(MacroFrameSelectedMacroButtonIcon) then
|
||||||
|
local tex = ResolveMacroIcon(MacroFrame.selectedMacro)
|
||||||
|
if tex then MacroFrameSelectedMacroButtonIcon:SetTexture(tex) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function InstallHooks()
|
local function InstallHooks()
|
||||||
if hooked then return end
|
if hooked then return end
|
||||||
if not MacroFrameText or not MacroFrame then return end
|
if not MacroFrameText or not MacroFrame then return end
|
||||||
@@ -1325,6 +1375,15 @@ local function InstallHooks()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- After every Blizzard macro-list refresh, swap question-mark icons for the
|
||||||
|
-- dynamically-resolved ones. Post-hook so Blizzard has already set the
|
||||||
|
-- default texture we test against.
|
||||||
|
if hooksecurefunc and type(MacroFrame_Update) == "function" then
|
||||||
|
hooksecurefunc("MacroFrame_Update", function()
|
||||||
|
pcall(FixMacroListIcons)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
hooked = true
|
hooked = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1332,12 +1391,6 @@ end
|
|||||||
-- Extension Entry Points
|
-- Extension Entry Points
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
|
|
||||||
function Extension.OnAddonLoaded()
|
|
||||||
if arg1 == "Blizzard_MacroUI" then
|
|
||||||
InstallHooks()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad()
|
||||||
-- Skip if macro checker is disabled
|
-- Skip if macro checker is disabled
|
||||||
if CleveRoidMacros and CleveRoidMacros.macrocheck == 0 then return end
|
if CleveRoidMacros and CleveRoidMacros.macrocheck == 0 then return end
|
||||||
@@ -1345,13 +1398,9 @@ function Extension.OnLoad()
|
|||||||
-- Skip if SuperMacro is loaded (detected at load time)
|
-- Skip if SuperMacro is loaded (detected at load time)
|
||||||
if SuperMacroFrame ~= nil then return end
|
if SuperMacroFrame ~= nil then return end
|
||||||
|
|
||||||
-- Listen for macro UI loading
|
-- Install once Blizzard's macro UI is available (fires immediately if already
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnAddonLoaded")
|
-- loaded), replacing the ADDON_LOADED listener + manual "already loaded" check.
|
||||||
|
EventUtil.ContinueOnAddOnLoaded("Blizzard_MacroUI", InstallHooks)
|
||||||
-- If MacroFrame already exists (unlikely but safe), hook immediately
|
|
||||||
if MacroFrame and MacroFrameText then
|
|
||||||
InstallHooks()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
_G["CleveRoids"] = CleveRoids
|
||||||
|
|||||||
@@ -133,12 +133,6 @@ function Extension.OnMacroFrameLoad()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.OnAddonLoaded()
|
|
||||||
if arg1 == "Blizzard_MacroUI" then
|
|
||||||
Extension.OnMacroFrameLoad()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad()
|
||||||
-- Schedule messages to show after UI is ready
|
-- Schedule messages to show after UI is ready
|
||||||
local function ShowMessages()
|
local function ShowMessages()
|
||||||
@@ -178,16 +172,11 @@ function Extension.OnLoad()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Listen for macro UI loading
|
-- Hook the macro UI once available (fires immediately if already loaded).
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnAddonLoaded")
|
EventUtil.ContinueOnAddOnLoaded("Blizzard_MacroUI", Extension.OnMacroFrameLoad)
|
||||||
|
|
||||||
-- Also try to hook MacroFrame_SaveMacro if it already exists
|
-- Status messages on login (currently disabled inside OnPlayerLogin).
|
||||||
if MacroFrame_SaveMacro then
|
EventUtil.ContinueOnPlayerLogin(Extension.OnPlayerLogin)
|
||||||
Extension.OnMacroFrameLoad()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Register PLAYER_LOGIN to show status messages
|
|
||||||
Extension.RegisterEvent("PLAYER_LOGIN", "OnPlayerLogin")
|
|
||||||
|
|
||||||
-- Store the message function for later
|
-- Store the message function for later
|
||||||
Extension.ShowMessages = ShowMessages
|
Extension.ShowMessages = ShowMessages
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ local _G = _G or getfenv(0)
|
|||||||
local CleveRoids = _G.CleveRoids or {}
|
local CleveRoids = _G.CleveRoids or {}
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("CT_RaidAssist")
|
local Extension = CleveRoids.RegisterExtension("CT_RaidAssist")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
|
||||||
|
|
||||||
function Extension.OnEnter()
|
function Extension.OnEnter()
|
||||||
local tempOptions = CT_RAMenu_Options["temp"]
|
local tempOptions = CT_RAMenu_Options["temp"]
|
||||||
@@ -48,15 +47,14 @@ function Extension.OnLeave()
|
|||||||
CleveRoids.ClearMouseoverFrom("native")
|
CleveRoids.ClearMouseoverFrom("native")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad() end
|
||||||
if arg1 ~= "CT_RaidAssist" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
|
function Extension.OnAddOnLoad()
|
||||||
|
if not CT_RA_MemberFrame_OnEnter then return end
|
||||||
Extension.Hook("CT_RA_MemberFrame_OnEnter", "OnEnter")
|
Extension.Hook("CT_RA_MemberFrame_OnEnter", "OnEnter")
|
||||||
Extension.HookMethod(_G["GameTooltip"], "Hide", "OnLeave")
|
Extension.HookMethod(_G["GameTooltip"], "Hide", "OnLeave")
|
||||||
Extension.HookMethod(_G["GameTooltip"], "FadeOut", "OnLeave")
|
Extension.HookMethod(_G["GameTooltip"], "FadeOut", "OnLeave")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
EventUtil.ContinueOnAddOnLoaded("CT_RaidAssist", Extension.OnAddOnLoad)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ local _G = _G or getfenv(0)
|
|||||||
local CleveRoids = _G.CleveRoids or {}
|
local CleveRoids = _G.CleveRoids or {}
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("CT_UnitFrames")
|
local Extension = CleveRoids.RegisterExtension("CT_UnitFrames")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
|
||||||
|
|
||||||
function Extension.SetHook(widget)
|
function Extension.SetHook(widget)
|
||||||
local hookedOnEnter = widget:GetScript("OnEnter")
|
local hookedOnEnter = widget:GetScript("OnEnter")
|
||||||
@@ -24,8 +23,10 @@ function Extension.SetHook(widget)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad() end
|
||||||
if arg1 ~= "CT_UnitFrames" or not CT_AssistFrame then
|
|
||||||
|
function Extension.OnAddOnLoad()
|
||||||
|
if not CT_AssistFrame then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
CleveRoids.Print("CT_UnitFrames module loaded.")
|
CleveRoids.Print("CT_UnitFrames module loaded.")
|
||||||
@@ -36,4 +37,4 @@ function Extension.OnLoad()
|
|||||||
Extension.SetHook(CT_AssistFrame_Drag)
|
Extension.SetHook(CT_AssistFrame_Drag)
|
||||||
end
|
end
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
EventUtil.ContinueOnAddOnLoaded("CT_UnitFrames", Extension.OnAddOnLoad)
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ local CleveRoids = _G.CleveRoids or {}
|
|||||||
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("CursiveMouseover")
|
local Extension = CleveRoids.RegisterExtension("CursiveMouseover")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
|
||||||
|
|
||||||
local hooked = false
|
local hooked = false
|
||||||
|
|
||||||
@@ -66,21 +65,13 @@ local function HookCursiveUI()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad()
|
||||||
-- Try to hook when Cursive loads
|
-- Delay slightly to ensure Cursive.ui is initialized
|
||||||
if arg1 == "Cursive" then
|
local frame = CreateFrame("Frame")
|
||||||
-- Delay slightly to ensure Cursive.ui is initialized
|
frame:SetScript("OnUpdate", function()
|
||||||
local frame = CreateFrame("Frame")
|
if HookCursiveUI() then
|
||||||
frame:SetScript("OnUpdate", function()
|
this:Hide()
|
||||||
if HookCursiveUI() then
|
end
|
||||||
this:Hide()
|
end)
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Also try to hook immediately in case Cursive is already loaded
|
EventUtil.ContinueOnAddOnLoaded("Cursive", Extension.OnLoad)
|
||||||
if Cursive and Cursive.ui then
|
|
||||||
HookCursiveUI()
|
|
||||||
end
|
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ local _G = _G or getfenv(0)
|
|||||||
local CleveRoids = _G.CleveRoids or {}
|
local CleveRoids = _G.CleveRoids or {}
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("DiscordUnitFrames")
|
local Extension = CleveRoids.RegisterExtension("DiscordUnitFrames")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
|
||||||
|
|
||||||
function Extension.OnEnterFrame()
|
function Extension.OnEnterFrame()
|
||||||
CleveRoids.SetMouseoverFrom("duf", this.unit)
|
CleveRoids.SetMouseoverFrom("duf", this.unit)
|
||||||
@@ -26,11 +25,10 @@ function Extension.OnLeaveElement()
|
|||||||
CleveRoids.ClearMouseoverFrom("native")
|
CleveRoids.ClearMouseoverFrom("native")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad() end
|
||||||
if arg1 ~= "DiscordUnitFrames" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
|
function Extension.OnAddOnLoad()
|
||||||
|
if not DUF_UnitFrame_OnEnter then return end
|
||||||
CleveRoids.ClearHooks()
|
CleveRoids.ClearHooks()
|
||||||
Extension.Hook("DUF_UnitFrame_OnEnter", "OnEnterFrame")
|
Extension.Hook("DUF_UnitFrame_OnEnter", "OnEnterFrame")
|
||||||
Extension.Hook("DUF_UnitFrame_OnLeave", "OnLeaveFrame")
|
Extension.Hook("DUF_UnitFrame_OnLeave", "OnLeaveFrame")
|
||||||
@@ -39,4 +37,4 @@ function Extension.OnLoad()
|
|||||||
Extension.Hook("DUF_Element_OnLeave", "OnLeaveElement")
|
Extension.Hook("DUF_Element_OnLeave", "OnLeaveElement")
|
||||||
end
|
end
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
EventUtil.ContinueOnAddOnLoaded("DiscordUnitFrames", Extension.OnAddOnLoad)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ local CleveRoids = _G.CleveRoids or {}
|
|||||||
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("Grid")
|
local Extension = CleveRoids.RegisterExtension("Grid")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
|
||||||
|
|
||||||
function Extension.OnEnter(unit)
|
function Extension.OnEnter(unit)
|
||||||
CleveRoids.SetMouseoverFrom("grid", unit)
|
CleveRoids.SetMouseoverFrom("grid", unit)
|
||||||
@@ -19,11 +18,10 @@ function Extension.OnLeave()
|
|||||||
CleveRoids.ClearMouseoverFrom("native")
|
CleveRoids.ClearMouseoverFrom("native")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad() end
|
||||||
if arg1 ~= "Grid" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
|
function Extension.OnAddOnLoad()
|
||||||
|
if not GridFrame then return end
|
||||||
CleveRoids.Hooks.Grid = { CreateFrames = GridFrame.frameClass.prototype.CreateFrames}
|
CleveRoids.Hooks.Grid = { CreateFrames = GridFrame.frameClass.prototype.CreateFrames}
|
||||||
GridFrame.frameClass.prototype.CreateFrames = CleveRoids.GrdCreateFrames
|
GridFrame.frameClass.prototype.CreateFrames = CleveRoids.GrdCreateFrames
|
||||||
end
|
end
|
||||||
@@ -111,4 +109,4 @@ function CleveRoids:GrdCreateFrames()
|
|||||||
ClickCastFrames[self.frame] = true
|
ClickCastFrames[self.frame] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
EventUtil.ContinueOnAddOnLoaded("Grid", Extension.OnAddOnLoad)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ local CleveRoids = _G.CleveRoids or {}
|
|||||||
local CreateFrames = nil
|
local CreateFrames = nil
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("NotGrid")
|
local Extension = CleveRoids.RegisterExtension("NotGrid")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
|
||||||
|
|
||||||
function Extension.OnEnter()
|
function Extension.OnEnter()
|
||||||
CleveRoids.SetMouseoverFrom("ngrid", this.unit)
|
CleveRoids.SetMouseoverFrom("ngrid", this.unit)
|
||||||
@@ -39,7 +38,9 @@ function CleveRoids:NotGrid_CreateFrames()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad() end
|
||||||
|
|
||||||
|
function Extension.OnAddOnLoad()
|
||||||
-- NotGrid loads before CleveRoids, so if NotGrid is enabled, then it's global will exist.
|
-- NotGrid loads before CleveRoids, so if NotGrid is enabled, then it's global will exist.
|
||||||
if not NotGrid then
|
if not NotGrid then
|
||||||
return
|
return
|
||||||
@@ -48,7 +49,6 @@ function Extension.OnLoad()
|
|||||||
CreateFrames = NotGrid.CreateFrames
|
CreateFrames = NotGrid.CreateFrames
|
||||||
NotGrid.CreateFrames = CleveRoids.NotGrid_CreateFrames
|
NotGrid.CreateFrames = CleveRoids.NotGrid_CreateFrames
|
||||||
|
|
||||||
Extension.UnregisterEvent("ADDON_LOADED", "Onload")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
EventUtil.ContinueOnAddOnLoaded("NotGrid", Extension.OnAddOnLoad)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ local CleveRoids = _G.CleveRoids or {}
|
|||||||
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("PerfectRaid")
|
local Extension = CleveRoids.RegisterExtension("PerfectRaid")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
|
||||||
|
|
||||||
function Extension.OnEnter(unit)
|
function Extension.OnEnter(unit)
|
||||||
CleveRoids.SetMouseoverFrom("praid", unit)
|
CleveRoids.SetMouseoverFrom("praid", unit)
|
||||||
@@ -19,11 +18,10 @@ function Extension.OnLeave()
|
|||||||
CleveRoids.ClearMouseoverFrom("native")
|
CleveRoids.ClearMouseoverFrom("native")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad() end
|
||||||
if arg1 ~= "PerfectRaid" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
|
function Extension.OnAddOnLoad()
|
||||||
|
if not PerfectRaid then return end
|
||||||
CleveRoids.Hooks.PerfectRaid = { CreateFrame = PerfectRaid.CreateFrame }
|
CleveRoids.Hooks.PerfectRaid = { CreateFrame = PerfectRaid.CreateFrame }
|
||||||
PerfectRaid.CreateFrame = CleveRoids.PerfectRaidCreateFrame
|
PerfectRaid.CreateFrame = CleveRoids.PerfectRaidCreateFrame
|
||||||
end
|
end
|
||||||
@@ -134,4 +132,4 @@ function CleveRoids.PerfectRaidCreateFrame(self, num)
|
|||||||
--]]
|
--]]
|
||||||
end
|
end
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
EventUtil.ContinueOnAddOnLoaded("PerfectRaid", Extension.OnAddOnLoad)
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ local CleveRoids = _G.CleveRoids or {}
|
|||||||
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("ag_UnitFrames")
|
local Extension = CleveRoids.RegisterExtension("ag_UnitFrames")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
|
||||||
|
|
||||||
function Extension.OnEnter(unit)
|
function Extension.OnEnter(unit)
|
||||||
CleveRoids.SetMouseoverFrom("aguf", unit)
|
CleveRoids.SetMouseoverFrom("aguf", unit)
|
||||||
@@ -23,7 +22,6 @@ function Extension.OnLoad()
|
|||||||
CleveRoids.Hooks.ag_UnitFrames = { OnEnter = aUF.classes.aUFunit.prototype.OnEnter, OnLeave = aUF.classes.aUFunit.prototype.OnLeave}
|
CleveRoids.Hooks.ag_UnitFrames = { OnEnter = aUF.classes.aUFunit.prototype.OnEnter, OnLeave = aUF.classes.aUFunit.prototype.OnLeave}
|
||||||
aUF.classes.aUFunit.prototype.OnEnter = CleveRoids.aUFOnEnter
|
aUF.classes.aUFunit.prototype.OnEnter = CleveRoids.aUFOnEnter
|
||||||
aUF.classes.aUFunit.prototype.OnLeave = CleveRoids.aUFOnLeave
|
aUF.classes.aUFunit.prototype.OnLeave = CleveRoids.aUFOnLeave
|
||||||
Extension.UnregisterEvent("ADDON_LOADED", "Onload")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Taken from ag_UnitClass.lua
|
-- Taken from ag_UnitClass.lua
|
||||||
@@ -41,4 +39,4 @@ function CleveRoids:aUFOnLeave()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
EventUtil.ContinueOnAddOnLoaded("ag_UnitFrames", Extension.OnLoad)
|
||||||
|
|||||||
+14
-248
@@ -2,11 +2,17 @@
|
|||||||
Author: Dennis Werner Garske (DWG) / brian / Mewtiny
|
Author: Dennis Werner Garske (DWG) / brian / Mewtiny
|
||||||
License: MIT License
|
License: MIT License
|
||||||
|
|
||||||
Fixes pfUI mouseover issues by:
|
pfUI integration. pfUI's own unitframes now set the native mouseover unit
|
||||||
- Using a unique source key per pfUI frame (e.g., "pfui:party3", "pfui:raid7")
|
(Nampower SetMouseoverUnit, via pfUI.uf.OnEnter bound in pfUI.uf:EnableScripts
|
||||||
- Pairing Set/Clear with the same per-frame key
|
on every unitframe), so [@mouseover]/[mouseover] resolve against pfUI frames
|
||||||
- Resolving a real UnitID when .unit isn't set
|
through the native "mouseover" token -- every consumer checks UnitExists(
|
||||||
- Properly hooking party group[0] (your own party slot) with a safe closure and defaulting to "player"
|
"mouseover") before the CleveRoids.mouseoverUnit fallback, so no per-frame
|
||||||
|
hooking is needed here anymore. What remains is the two things pfUI doesn't
|
||||||
|
cover:
|
||||||
|
- Raid-marker rows: NOT unitframes (never go through EnableScripts), so pfUI
|
||||||
|
sets no mouseover for them. Hooked so hovering registers "mark1".."mark8"
|
||||||
|
via CleveRoids.mouseoverUnit.
|
||||||
|
- /pfcast: wrapped so its argument runs through CleveRoids conditionals.
|
||||||
]]
|
]]
|
||||||
local _G = _G or getfenv(0)
|
local _G = _G or getfenv(0)
|
||||||
local CleveRoids = _G.CleveRoids or {}
|
local CleveRoids = _G.CleveRoids or {}
|
||||||
@@ -95,241 +101,11 @@ local function PfClear(frame)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- PLAYER
|
|
||||||
function Extension.RegisterPlayerScripts()
|
|
||||||
if not pfUI or not pfUI.uf or not pfUI.uf.player then return end
|
|
||||||
local frame = pfUI.uf.player
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
PfSet(this, "player")
|
|
||||||
if onEnterFunc then onEnterFunc(this) end
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- TARGET
|
|
||||||
function Extension.RegisterTargetScripts()
|
|
||||||
if not pfUI or not pfUI.uf or not pfUI.uf.target then return end
|
|
||||||
local frame = pfUI.uf.target
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
PfSet(this, "target")
|
|
||||||
if onEnterFunc then onEnterFunc(this) end
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- TARGETTARGET
|
|
||||||
function Extension.RegisterTargetTargetScripts()
|
|
||||||
if not pfUI or not pfUI.uf or not pfUI.uf.targettarget then return end
|
|
||||||
local frame = pfUI.uf.targettarget
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
PfSet(this, "targettarget")
|
|
||||||
if onEnterFunc then onEnterFunc(this) end
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- PARTY (pfUI.uf.group[0..4]) -- include 0 to cover your own party slot
|
|
||||||
function Extension.RegisterPartyScripts()
|
|
||||||
if not pfUI or not pfUI.uf or not pfUI.uf.group then return end
|
|
||||||
|
|
||||||
local i
|
|
||||||
for i = 0, 4 do
|
|
||||||
local frame = pfUI.uf.group[i]
|
|
||||||
if frame then
|
|
||||||
-- bind loop index for closures (Vanilla-safe)
|
|
||||||
local idx = i
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
-- For group[0] (your own party frame), default to "player"
|
|
||||||
local defaultUnit = (idx == 0) and "player" or nil
|
|
||||||
PfSet(this, defaultUnit)
|
|
||||||
if onEnterFunc then onEnterFunc(this) end
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- RAID (pfUI.uf.raid[1..40])
|
|
||||||
function Extension.RegisterRaidScripts()
|
|
||||||
if not pfUI or not pfUI.uf or not pfUI.uf.raid then return end
|
|
||||||
|
|
||||||
local i
|
|
||||||
for i = 1, 40 do
|
|
||||||
local frame = pfUI.uf.raid[i]
|
|
||||||
if frame then
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
PfSet(this)
|
|
||||||
if onEnterFunc then onEnterFunc(this) end
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- FOCUS
|
|
||||||
function Extension.RegisterFocusScripts()
|
|
||||||
if not pfUI or not pfUI.uf or not pfUI.uf.focus then return end
|
|
||||||
local frame = pfUI.uf.focus
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
PfSet(this) -- ResolvePfUnit handles focus emulation
|
|
||||||
if onEnterFunc then onEnterFunc(this) end
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- FOCUSTARGET (if your pfUI build provides it)
|
|
||||||
function Extension.RegisterFocusTargetScripts()
|
|
||||||
if not pfUI or not pfUI.uf or not pfUI.uf.focustarget then return end
|
|
||||||
local frame = pfUI.uf.focustarget
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
PfSet(this)
|
|
||||||
if onEnterFunc then onEnterFunc(this) end
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- PETTARGET (if your pfUI build provides it)
|
|
||||||
function Extension.RegisterPetTargetScripts()
|
|
||||||
if not pfUI or not pfUI.uf or not pfUI.uf.pettarget then return end
|
|
||||||
local frame = pfUI.uf.pettarget
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
PfSet(this)
|
|
||||||
if onEnterFunc then onEnterFunc(this) end
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- TARGETTARGETTARGET (if your pfUI build provides it)
|
|
||||||
function Extension.RegisterTargetTargetTargetScripts()
|
|
||||||
if not pfUI or not pfUI.uf or not pfUI.uf.targettargettarget then return end
|
|
||||||
local frame = pfUI.uf.targettargettarget
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
PfSet(this)
|
|
||||||
if onEnterFunc then onEnterFunc(this) end
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- PARTYTARGET (party1target..party4target, plus player's target)
|
|
||||||
function Extension.RegisterPartyTargetScripts()
|
|
||||||
if not pfUI or not pfUI.uf then return end
|
|
||||||
|
|
||||||
-- This helper function is used to hook any given frame.
|
|
||||||
local function hookFrame(frame, defaultUnit)
|
|
||||||
if not frame then return end
|
|
||||||
local onEnterFunc = frame:GetScript("OnEnter")
|
|
||||||
local onLeaveFunc = frame:GetScript("OnLeave")
|
|
||||||
|
|
||||||
frame:SetScript("OnEnter", function()
|
|
||||||
PfSet(this, defaultUnit)
|
|
||||||
-- We remove the call to the original onEnterFunc to prevent overwritten tooltips.
|
|
||||||
end)
|
|
||||||
|
|
||||||
frame:SetScript("OnLeave", function()
|
|
||||||
PfClear(this)
|
|
||||||
if onLeaveFunc then onLeaveFunc(this) end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- This helper function is specifically for party member targets (1-4)
|
|
||||||
local function hookPartyMemberTarget(i, frame)
|
|
||||||
if not frame then return end
|
|
||||||
local defaultUnit = "party" .. i .. "target"
|
|
||||||
hookFrame(frame, defaultUnit)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Case A: Hook dedicated arrays for party members 1-4
|
|
||||||
if pfUI.uf.grouptarget then
|
|
||||||
for i = 1, 4 do hookPartyMemberTarget(i, pfUI.uf.grouptarget[i]) end
|
|
||||||
end
|
|
||||||
if pfUI.uf.partytarget then
|
|
||||||
for i = 1, 4 do hookPartyMemberTarget(i, pfUI.uf.partytarget[i]) end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Case B: Hook child target frames for party members 1-4
|
|
||||||
if pfUI.uf.group then
|
|
||||||
for i = 1, 4 do
|
|
||||||
local g = pfUI.uf.group[i]
|
|
||||||
if g and g.target then hookPartyMemberTarget(i, g.target) end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- START OF FIX to include party0target ---
|
|
||||||
-- Case C: Specifically find and hook the player's own target frame (group[0].target)
|
|
||||||
if pfUI.uf.group and pfUI.uf.group[0] and pfUI.uf.group[0].target then
|
|
||||||
-- The player's target UnitID is always "target", not "party0target".
|
|
||||||
hookFrame(pfUI.uf.group[0].target, "target")
|
|
||||||
end
|
|
||||||
--- END OF FIX ---
|
|
||||||
end
|
|
||||||
|
|
||||||
-- RAID MARKERS (pfUI raidmarkers module)
|
-- RAID MARKERS (pfUI raidmarkers module)
|
||||||
-- Rows are plain Buttons with label="mark" and id=1-8. They have no OnEnter/OnLeave
|
-- Rows are plain Buttons with label="mark" and id=1-8. They have no OnEnter/OnLeave
|
||||||
-- by default, so [mouseover] macros are blind to them. We hook each row so hovering
|
-- by default, so [mouseover] macros are blind to them. We hook each row so hovering
|
||||||
-- registers "mark1".."mark8" through the normal priority system.
|
-- registers "mark1".."mark8" through the normal priority system. pfUI's own
|
||||||
|
-- SetMouseoverUnit path only covers unitframes, so this stays.
|
||||||
function Extension.RegisterRaidMarkScripts()
|
function Extension.RegisterRaidMarkScripts()
|
||||||
if not pfUI or not pfUI.raidmarkers or not pfUI.raidmarkers.rows then return end
|
if not pfUI or not pfUI.raidmarkers or not pfUI.raidmarkers.rows then return end
|
||||||
|
|
||||||
@@ -371,17 +147,7 @@ function Extension.HookPfCast()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Extension.PLAYER_ENTERING_WORLD()
|
function Extension.PLAYER_ENTERING_WORLD()
|
||||||
if not pfUI or not pfUI.uf then return end
|
if not pfUI then return end
|
||||||
Extension.RegisterPlayerScripts()
|
|
||||||
Extension.RegisterTargetScripts()
|
|
||||||
Extension.RegisterTargetTargetScripts()
|
|
||||||
Extension.RegisterPartyScripts()
|
|
||||||
Extension.RegisterPartyTargetScripts()
|
|
||||||
Extension.RegisterRaidScripts()
|
|
||||||
Extension.RegisterFocusScripts()
|
|
||||||
Extension.RegisterFocusTargetScripts()
|
|
||||||
Extension.RegisterPetTargetScripts()
|
|
||||||
Extension.RegisterTargetTargetTargetScripts()
|
|
||||||
Extension.RegisterRaidMarkScripts()
|
Extension.RegisterRaidMarkScripts()
|
||||||
Extension.HookPfCast()
|
Extension.HookPfCast()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ local _G = _G or getfenv(0)
|
|||||||
local CleveRoids = _G.CleveRoids or {}
|
local CleveRoids = _G.CleveRoids or {}
|
||||||
|
|
||||||
local Extension = CleveRoids.RegisterExtension("sRaidFrames")
|
local Extension = CleveRoids.RegisterExtension("sRaidFrames")
|
||||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
|
||||||
|
|
||||||
function Extension:OnEnter(frame)
|
function Extension:OnEnter(frame)
|
||||||
CleveRoids.SetMouseoverFrom("sraid", frame.unit)
|
CleveRoids.SetMouseoverFrom("sraid", frame.unit)
|
||||||
@@ -17,14 +16,13 @@ function Extension.OnLeave()
|
|||||||
CleveRoids.ClearMouseoverFrom("native")
|
CleveRoids.ClearMouseoverFrom("native")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Extension.OnLoad()
|
function Extension.OnLoad() end
|
||||||
if arg1 ~= "sRaidFrames" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
|
function Extension.OnAddOnLoad()
|
||||||
|
if not sRaidFrames then return end
|
||||||
Extension.HookMethod(sRaidFrames, "UnitTooltip", "OnEnter")
|
Extension.HookMethod(sRaidFrames, "UnitTooltip", "OnEnter")
|
||||||
Extension.HookMethod(_G["GameTooltip"], "Hide", "OnLeave")
|
Extension.HookMethod(_G["GameTooltip"], "Hide", "OnLeave")
|
||||||
Extension.HookMethod(_G["GameTooltip"], "FadeOut", "OnLeave")
|
Extension.HookMethod(_G["GameTooltip"], "FadeOut", "OnLeave")
|
||||||
end
|
end
|
||||||
|
|
||||||
_G["CleveRoids"] = CleveRoids
|
EventUtil.ContinueOnAddOnLoaded("sRaidFrames", Extension.OnAddOnLoad)
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ local function CreateIconButton(parent, index, iconTable)
|
|||||||
GameTooltip:SetOwner(btn, "ANCHOR_BOTTOMLEFT")
|
GameTooltip:SetOwner(btn, "ANCHOR_BOTTOMLEFT")
|
||||||
local spellName
|
local spellName
|
||||||
if data.spellId then
|
if data.spellId then
|
||||||
spellName = GetSpellRecField and GetSpellRecField(data.spellId, "name") or ("Spell " .. data.spellId)
|
spellName = C_Spell.GetSpellName(data.spellId) or ("Spell " .. data.spellId)
|
||||||
else
|
else
|
||||||
spellName = data.displayName
|
spellName = data.displayName
|
||||||
end
|
end
|
||||||
@@ -649,7 +649,7 @@ local function InjectTestTargetData()
|
|||||||
for i = 1, table.getn(TEST_TARGET_SPELL_IDS) do
|
for i = 1, table.getn(TEST_TARGET_SPELL_IDS) do
|
||||||
local spellId = TEST_TARGET_SPELL_IDS[i]
|
local spellId = TEST_TARGET_SPELL_IDS[i]
|
||||||
local dur = targetDurations[i] or 60
|
local dur = targetDurations[i] or 60
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") or ("TestSpell" .. spellId)
|
local spellName = C_Spell.GetSpellName(spellId) or ("TestSpell" .. spellId)
|
||||||
if not CleveRoids.AllCasterAuraTracking[targetGuid][spellName] then
|
if not CleveRoids.AllCasterAuraTracking[targetGuid][spellName] then
|
||||||
CleveRoids.AllCasterAuraTracking[targetGuid][spellName] = {}
|
CleveRoids.AllCasterAuraTracking[targetGuid][spellName] = {}
|
||||||
end
|
end
|
||||||
|
|||||||
+71
-100
@@ -58,11 +58,7 @@ function CleveRoids.IndexSpells()
|
|||||||
bookType = CleveRoids.bookTypes[book]
|
bookType = CleveRoids.bookTypes[book]
|
||||||
spells[bookType] = {}
|
spells[bookType] = {}
|
||||||
else
|
else
|
||||||
local cost, reagent = CleveRoids.GetSpellCost(i, bookType)
|
local cost, reagent, reagentId = CleveRoids.GetSpellCost(i, bookType, spellId)
|
||||||
-- Fallback for known reagent spells if tooltip scan failed
|
|
||||||
if (not reagent or reagent == "") and CleveRoids.ReagentBySpell then
|
|
||||||
reagent = CleveRoids.ReagentBySpell[spellName]
|
|
||||||
end
|
|
||||||
if not spells[bookType][spellName] then
|
if not spells[bookType][spellName] then
|
||||||
spells[bookType][spellName] = {
|
spells[bookType][spellName] = {
|
||||||
spellSlot = i,
|
spellSlot = i,
|
||||||
@@ -71,7 +67,7 @@ function CleveRoids.IndexSpells()
|
|||||||
bookType = bookType,
|
bookType = bookType,
|
||||||
texture = texture,
|
texture = texture,
|
||||||
cost = cost,
|
cost = cost,
|
||||||
reagent = reagent,
|
reagentId = reagentId,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
if spellRank and not spells[bookType][spellName][spellRank] then
|
if spellRank and not spells[bookType][spellName][spellRank] then
|
||||||
@@ -83,7 +79,7 @@ function CleveRoids.IndexSpells()
|
|||||||
bookType = bookType,
|
bookType = bookType,
|
||||||
texture = texture,
|
texture = texture,
|
||||||
cost = cost,
|
cost = cost,
|
||||||
reagent = reagent
|
reagentId = reagentId,
|
||||||
}
|
}
|
||||||
spells[bookType][spellName].highest = spells[bookType][spellName][spellRank]
|
spells[bookType][spellName].highest = spells[bookType][spellName][spellRank]
|
||||||
end
|
end
|
||||||
@@ -94,6 +90,13 @@ function CleveRoids.IndexSpells()
|
|||||||
|
|
||||||
if reagent then
|
if reagent then
|
||||||
CleveRoids.countedItemTypes[reagent] = true
|
CleveRoids.countedItemTypes[reagent] = true
|
||||||
|
elseif reagentId and Item then
|
||||||
|
Item:CreateFromItemID(reagentId):ContinueOnItemLoad(function()
|
||||||
|
local loadedName = C_Item.GetItemNameByID(reagentId)
|
||||||
|
if loadedName and loadedName ~= "" then
|
||||||
|
CleveRoids.countedItemTypes[loadedName] = true
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -156,10 +159,9 @@ end
|
|||||||
function CleveRoids.IndexEquippedItems()
|
function CleveRoids.IndexEquippedItems()
|
||||||
local items = CleveRoids.Items or {}
|
local items = CleveRoids.Items or {}
|
||||||
|
|
||||||
for inventoryID = 0, 19 do
|
for inventoryID = 1, 19 do
|
||||||
local link = GetInventoryItemLink("player", inventoryID)
|
local itemID = GetInventoryItemID("player", inventoryID)
|
||||||
if link then
|
if itemID then
|
||||||
local _, _, itemID = string.find(link, "item:(%d+)")
|
|
||||||
local name, link, _, _, itemType, itemSubType, _, _, texture = GetItemInfo(itemID)
|
local name, link, _, _, itemType, itemSubType, _, _, texture = GetItemInfo(itemID)
|
||||||
if name then
|
if name then
|
||||||
local count = GetInventoryItemCount("player", inventoryID)
|
local count = GetInventoryItemCount("player", inventoryID)
|
||||||
@@ -199,10 +201,9 @@ function CleveRoids.IndexEquipSlot(inventoryID)
|
|||||||
if not inventoryID then return end
|
if not inventoryID then return end
|
||||||
|
|
||||||
local items = CleveRoids.Items or {}
|
local items = CleveRoids.Items or {}
|
||||||
local link = GetInventoryItemLink("player", inventoryID)
|
local itemID = GetInventoryItemID("player", inventoryID)
|
||||||
|
|
||||||
if link then
|
if itemID then
|
||||||
local _, _, itemID = string.find(link, "item:(%d+)")
|
|
||||||
local name, itemLink, _, _, itemType, itemSubType, _, _, texture = GetItemInfo(itemID)
|
local name, itemLink, _, _, itemType, itemSubType, _, _, texture = GetItemInfo(itemID)
|
||||||
if name then
|
if name then
|
||||||
local count = GetInventoryItemCount("player", inventoryID)
|
local count = GetInventoryItemCount("player", inventoryID)
|
||||||
@@ -265,21 +266,17 @@ function CleveRoids.IndexItems()
|
|||||||
|
|
||||||
-- PERFORMANCE: Local function references
|
-- PERFORMANCE: Local function references
|
||||||
local GetContainerNumSlots = GetContainerNumSlots
|
local GetContainerNumSlots = GetContainerNumSlots
|
||||||
local GetContainerItemLink = GetContainerItemLink
|
|
||||||
local GetContainerItemInfo = GetContainerItemInfo
|
local GetContainerItemInfo = GetContainerItemInfo
|
||||||
local GetInventoryItemLink = GetInventoryItemLink
|
|
||||||
local GetInventoryItemCount = GetInventoryItemCount
|
local GetInventoryItemCount = GetInventoryItemCount
|
||||||
|
|
||||||
-- Scan bags (reverse order to prefer first stack)
|
-- Scan bags (reverse order to prefer first stack)
|
||||||
for bagID = 0, NUM_BAG_SLOTS do
|
for bagID = 0, NUM_BAG_SLOTS do
|
||||||
local numSlots = GetContainerNumSlots(bagID)
|
local numSlots = GetContainerNumSlots(bagID)
|
||||||
for slot = numSlots, 1, -1 do
|
for slot = numSlots, 1, -1 do
|
||||||
local link = GetContainerItemLink(bagID, slot)
|
local itemID = C_Container.GetContainerItemID(bagID, slot)
|
||||||
if link then
|
if itemID then
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
-- Decorated name for the duplicate fast-path (no link string built)
|
||||||
|
local linkName = C_Item.GetItemName({ bagID = bagID, slotIndex = slot })
|
||||||
-- PERFORMANCE: Try to extract name from link first to check for duplicates
|
|
||||||
local _, _, linkName = string_find(link, "%[(.+)%]")
|
|
||||||
local existing = linkName and items[linkName]
|
local existing = linkName and items[linkName]
|
||||||
|
|
||||||
if existing then
|
if existing then
|
||||||
@@ -317,13 +314,11 @@ function CleveRoids.IndexItems()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Scan equipped items
|
-- Scan equipped items
|
||||||
for inventoryID = 0, 19 do
|
for inventoryID = 1, 19 do
|
||||||
local link = GetInventoryItemLink("player", inventoryID)
|
local itemID = GetInventoryItemID("player", inventoryID)
|
||||||
if link then
|
if itemID then
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
-- Decorated name for the duplicate fast-path (no link string built)
|
||||||
|
local linkName = C_Item.GetItemName({ equipmentSlotIndex = inventoryID })
|
||||||
-- PERFORMANCE: Try to extract name from link first
|
|
||||||
local _, _, linkName = string_find(link, "%[(.+)%]")
|
|
||||||
local existing = linkName and items[linkName]
|
local existing = linkName and items[linkName]
|
||||||
|
|
||||||
if existing then
|
if existing then
|
||||||
@@ -383,9 +378,9 @@ function CleveRoids.GetActionButtonInfo(slot)
|
|||||||
if not actionType then return end
|
if not actionType then return end
|
||||||
|
|
||||||
if actionType == "spell" and id then
|
if actionType == "spell" and id then
|
||||||
local rank = GetSpellRecField(id, "rank")
|
local rank = C_Spell.GetSpellSubtext(id)
|
||||||
if rank == "" then rank = nil end
|
if rank == "" then rank = nil end
|
||||||
return "SPELL", id, GetSpellRecField(id, "name"), rank
|
return "SPELL", id, C_Spell.GetSpellName(id), rank
|
||||||
elseif actionType == "item" and id then
|
elseif actionType == "item" and id then
|
||||||
local item = CleveRoids.GetItem(id)
|
local item = CleveRoids.GetItem(id)
|
||||||
return "ITEM", id, (item and item.name)
|
return "ITEM", id, (item and item.name)
|
||||||
@@ -477,10 +472,8 @@ local function makeInventoryItem(inventoryID, link, Items)
|
|||||||
if not link then link = GetInventoryItemLink("player", inventoryID) end
|
if not link then link = GetInventoryItemLink("player", inventoryID) end
|
||||||
if not link then return end
|
if not link then return end
|
||||||
|
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
local itemID = GetInventoryItemID("player", inventoryID)
|
||||||
itemID = itemID and tonumber(itemID) or nil
|
local name = C_Item.GetItemName({ equipmentSlotIndex = inventoryID })
|
||||||
|
|
||||||
local name = itemID and GetItemInfo(itemID) or nil
|
|
||||||
local texture = GetInventoryItemTexture("player", inventoryID)
|
local texture = GetInventoryItemTexture("player", inventoryID)
|
||||||
local count = GetInventoryItemCount("player", inventoryID)
|
local count = GetInventoryItemCount("player", inventoryID)
|
||||||
|
|
||||||
@@ -509,14 +502,12 @@ local function makeBagItem(bagID, slot, link, Items)
|
|||||||
end
|
end
|
||||||
if not link then return end
|
if not link then return end
|
||||||
|
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
local itemID = C_Container.GetContainerItemID(bagID, slot)
|
||||||
itemID = itemID and tonumber(itemID) or nil
|
|
||||||
|
|
||||||
local name, _, _, _, _, _, _, _, texture = GetItemInfo(itemID)
|
local name = C_Item.GetItemName({bagID = bagID, slotIndex = slot})
|
||||||
local count = 0
|
local count = 0
|
||||||
local tex, itemCount = GetContainerItemInfo(bagID, slot)
|
local texture, itemCount = GetContainerItemInfo(bagID, slot)
|
||||||
if itemCount then count = itemCount end
|
if itemCount then count = itemCount end
|
||||||
if not texture then texture = tex end
|
|
||||||
|
|
||||||
local it = {
|
local it = {
|
||||||
bagID = bagID,
|
bagID = bagID,
|
||||||
@@ -574,9 +565,7 @@ function CleveRoids.GetItem(text)
|
|||||||
for inv = 1, 19 do
|
for inv = 1, 19 do
|
||||||
local link = GetInventoryItemLink("player", inv)
|
local link = GetInventoryItemLink("player", inv)
|
||||||
if link then
|
if link then
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
local itemID = GetInventoryItemID("player", inv)
|
||||||
itemID = itemID and tonumber(itemID) or nil
|
|
||||||
|
|
||||||
if qid and itemID and qid == itemID then
|
if qid and itemID and qid == itemID then
|
||||||
return makeInventoryItem(inv, link, Items)
|
return makeInventoryItem(inv, link, Items)
|
||||||
elseif qname then
|
elseif qname then
|
||||||
@@ -595,9 +584,7 @@ function CleveRoids.GetItem(text)
|
|||||||
for slot = 1, slots do
|
for slot = 1, slots do
|
||||||
local link = GetContainerItemLink(bag, slot)
|
local link = GetContainerItemLink(bag, slot)
|
||||||
if link then
|
if link then
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
local itemID = C_Container.GetContainerItemID(bag, slot)
|
||||||
itemID = itemID and tonumber(itemID) or nil
|
|
||||||
|
|
||||||
if qid and itemID and qid == itemID then
|
if qid and itemID and qid == itemID then
|
||||||
return makeBagItem(bag, slot, link, Items)
|
return makeBagItem(bag, slot, link, Items)
|
||||||
elseif qname then
|
elseif qname then
|
||||||
@@ -720,18 +707,16 @@ function CleveRoids.FindItemQuick(text)
|
|||||||
if cached then
|
if cached then
|
||||||
-- Validate: check if item is actually at the cached location
|
-- Validate: check if item is actually at the cached location
|
||||||
if cached.inventoryID then
|
if cached.inventoryID then
|
||||||
local link = GetInventoryItemLink("player", cached.inventoryID)
|
if qid then
|
||||||
if link then
|
if GetInventoryItemID("player", cached.inventoryID) == qid then
|
||||||
local nm = GetNameFromLink(link)
|
cached._validated = true
|
||||||
|
return cached -- Cache is valid
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local nm = C_Item.GetItemName({ equipmentSlotIndex = cached.inventoryID })
|
||||||
if nm and qname and string_lower(nm) == qname then
|
if nm and qname and string_lower(nm) == qname then
|
||||||
cached._validated = true
|
cached._validated = true
|
||||||
return cached -- Cache is valid
|
return cached -- Cache is valid
|
||||||
elseif qid then
|
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
|
||||||
if itemID and tonumber(itemID) == qid then
|
|
||||||
cached._validated = true
|
|
||||||
return cached -- Cache is valid
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Cache is stale - item not at cached equipped slot, invalidate
|
-- Cache is stale - item not at cached equipped slot, invalidate
|
||||||
@@ -740,18 +725,16 @@ function CleveRoids.FindItemQuick(text)
|
|||||||
Items[string_lower(cached.name)] = nil
|
Items[string_lower(cached.name)] = nil
|
||||||
end
|
end
|
||||||
elseif cached.bagID and cached.slot then
|
elseif cached.bagID and cached.slot then
|
||||||
local link = GetContainerItemLink(cached.bagID, cached.slot)
|
if qid then
|
||||||
if link then
|
if C_Container.GetContainerItemID(cached.bagID, cached.slot) == qid then
|
||||||
local nm = GetNameFromLink(link)
|
cached._validated = true
|
||||||
|
return cached -- Cache is valid
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local nm = C_Item.GetItemName({ bagID = cached.bagID, slotIndex = cached.slot })
|
||||||
if nm and qname and string_lower(nm) == qname then
|
if nm and qname and string_lower(nm) == qname then
|
||||||
cached._validated = true
|
cached._validated = true
|
||||||
return cached -- Cache is valid
|
return cached -- Cache is valid
|
||||||
elseif qid then
|
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
|
||||||
if itemID and tonumber(itemID) == qid then
|
|
||||||
cached._validated = true
|
|
||||||
return cached -- Cache is valid
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Cache is stale - item not at cached bag slot, invalidate
|
-- Cache is stale - item not at cached bag slot, invalidate
|
||||||
@@ -767,20 +750,17 @@ function CleveRoids.FindItemQuick(text)
|
|||||||
for inv = 1, 19 do
|
for inv = 1, 19 do
|
||||||
local link = GetInventoryItemLink("player", inv)
|
local link = GetInventoryItemLink("player", inv)
|
||||||
if link then
|
if link then
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
local itemID = GetInventoryItemID("player", inv)
|
||||||
if itemID then
|
-- ID match: fast path
|
||||||
itemID = tonumber(itemID)
|
if qid and qid == itemID then
|
||||||
-- ID match: fast path
|
return makeInventoryItem(inv, link, Items)
|
||||||
if qid and qid == itemID then
|
end
|
||||||
|
-- Name match: extract name from link (faster than GetItemInfo)
|
||||||
|
if qname then
|
||||||
|
local nm = GetNameFromLink(link)
|
||||||
|
if nm and string_lower(nm) == qname then
|
||||||
return makeInventoryItem(inv, link, Items)
|
return makeInventoryItem(inv, link, Items)
|
||||||
end
|
end
|
||||||
-- Name match: extract name from link (faster than GetItemInfo)
|
|
||||||
if qname then
|
|
||||||
local nm = GetNameFromLink(link)
|
|
||||||
if nm and string_lower(nm) == qname then
|
|
||||||
return makeInventoryItem(inv, link, Items)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -791,20 +771,17 @@ function CleveRoids.FindItemQuick(text)
|
|||||||
for slot = 1, slots do
|
for slot = 1, slots do
|
||||||
local link = GetContainerItemLink(bag, slot)
|
local link = GetContainerItemLink(bag, slot)
|
||||||
if link then
|
if link then
|
||||||
local _, _, itemID = string_find(link, "item:(%d+)")
|
local itemID = C_Container.GetContainerItemID(bag, slot)
|
||||||
if itemID then
|
-- ID match: fast path
|
||||||
itemID = tonumber(itemID)
|
if qid and qid == itemID then
|
||||||
-- ID match: fast path
|
return makeBagItem(bag, slot, link, Items)
|
||||||
if qid and qid == itemID then
|
end
|
||||||
|
-- Name match: extract name from link (faster than GetItemInfo)
|
||||||
|
if qname then
|
||||||
|
local nm = GetNameFromLink(link)
|
||||||
|
if nm and string_lower(nm) == qname then
|
||||||
return makeBagItem(bag, slot, link, Items)
|
return makeBagItem(bag, slot, link, Items)
|
||||||
end
|
end
|
||||||
-- Name match: extract name from link (faster than GetItemInfo)
|
|
||||||
if qname then
|
|
||||||
local nm = GetNameFromLink(link)
|
|
||||||
if nm and string_lower(nm) == qname then
|
|
||||||
return makeBagItem(bag, slot, link, Items)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -818,25 +795,19 @@ end
|
|||||||
function CleveRoids.IsItemEquipped(text, inventoryId)
|
function CleveRoids.IsItemEquipped(text, inventoryId)
|
||||||
if not text or not inventoryId then return false end
|
if not text or not inventoryId then return false end
|
||||||
|
|
||||||
local link = GetInventoryItemLink("player", inventoryId)
|
local currentID = GetInventoryItemID("player", inventoryId)
|
||||||
if not link then return false end
|
|
||||||
|
|
||||||
local _, _, currentID = string_find(link, "item:(%d+)")
|
|
||||||
if not currentID then return false end
|
if not currentID then return false end
|
||||||
|
|
||||||
-- Check by ID (fast path)
|
-- Check by ID (fast path)
|
||||||
local textId = tonumber(text)
|
local textId = tonumber(text)
|
||||||
if textId and textId == tonumber(currentID) then
|
if textId and textId == currentID then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check by name - extract from link instead of GetItemInfo for performance
|
-- Check by name (decorated, so suffixed gear still matches)
|
||||||
local currentName = GetNameFromLink(link)
|
local currentName = C_Item.GetItemName({ equipmentSlotIndex = inventoryId })
|
||||||
if currentName then
|
if currentName and string_lower(currentName) == string_lower(text) then
|
||||||
local textLower = string_lower(text)
|
return true
|
||||||
if string_lower(currentName) == textLower then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ CleveRoids.mouseOverUnit = nil
|
|||||||
-- Environment flags
|
-- Environment flags
|
||||||
CleveRoids.hasSuperwow = SetAutoloot and true or false
|
CleveRoids.hasSuperwow = SetAutoloot and true or false
|
||||||
CleveRoids.hasTurtle = (type(_G.TURTLE_WOW_VERSION) ~= "nil")
|
CleveRoids.hasTurtle = (type(_G.TURTLE_WOW_VERSION) ~= "nil")
|
||||||
CleveRoids.hasReliquary = (RQ_GetVersion ~= nil)
|
|
||||||
CleveRoids.supported = CleveRoids.hasTurtle
|
CleveRoids.supported = CleveRoids.hasTurtle
|
||||||
|
|
||||||
CleveRoids.ParsedMsg = {}
|
CleveRoids.ParsedMsg = {}
|
||||||
@@ -242,28 +241,32 @@ CleveRoids.auraTextures = {
|
|||||||
|
|
||||||
|
|
||||||
-- I need to make a 2h modifier
|
-- I need to make a 2h modifier
|
||||||
-- Maps easy to use weapon type names (e.g. Axes, Shields) to their inventory slot name and their localized tooltip name
|
-- Maps easy-to-use weapon type names (e.g. Axes, Shields) to their inventory
|
||||||
|
-- slot plus the locale-independent item class/subclass IDs that identify them
|
||||||
|
-- (read via C_Item.GetItemInfoInstant). class 2 = Weapon, 4 = Armor (shields).
|
||||||
|
-- subClass is a set because the logical "Axes"/"Swords"/"Maces" types span both
|
||||||
|
-- the one-handed and two-handed weapon subclasses.
|
||||||
CleveRoids.WeaponTypeNames = {
|
CleveRoids.WeaponTypeNames = {
|
||||||
Daggers = { slot = "MainHandSlot", name = CleveRoids.Localized.Dagger },
|
Daggers = { slot = "MainHandSlot", class = 2, subClass = { [15] = true } },
|
||||||
Fists = { slot = "MainHandSlot", name = CleveRoids.Localized.FistWeapon },
|
Fists = { slot = "MainHandSlot", class = 2, subClass = { [13] = true } },
|
||||||
Axes = { slot = "MainHandSlot", name = CleveRoids.Localized.Axe },
|
Axes = { slot = "MainHandSlot", class = 2, subClass = { [0] = true, [1] = true } },
|
||||||
Swords = { slot = "MainHandSlot", name = CleveRoids.Localized.Sword },
|
Swords = { slot = "MainHandSlot", class = 2, subClass = { [7] = true, [8] = true } },
|
||||||
Staves = { slot = "MainHandSlot", name = CleveRoids.Localized.Staff },
|
Staves = { slot = "MainHandSlot", class = 2, subClass = { [10] = true } },
|
||||||
Maces = { slot = "MainHandSlot", name = CleveRoids.Localized.Mace },
|
Maces = { slot = "MainHandSlot", class = 2, subClass = { [4] = true, [5] = true } },
|
||||||
Polearms = { slot = "MainHandSlot", name = CleveRoids.Localized.Polearm },
|
Polearms = { slot = "MainHandSlot", class = 2, subClass = { [6] = true } },
|
||||||
-- OH
|
-- OH
|
||||||
Daggers2 = { slot = "SecondaryHandSlot", name = CleveRoids.Localized.Dagger },
|
Daggers2 = { slot = "SecondaryHandSlot", class = 2, subClass = { [15] = true } },
|
||||||
Fists2 = { slot = "SecondaryHandSlot", name = CleveRoids.Localized.FistWeapon },
|
Fists2 = { slot = "SecondaryHandSlot", class = 2, subClass = { [13] = true } },
|
||||||
Axes2 = { slot = "SecondaryHandSlot", name = CleveRoids.Localized.Axe },
|
Axes2 = { slot = "SecondaryHandSlot", class = 2, subClass = { [0] = true, [1] = true } },
|
||||||
Swords2 = { slot = "SecondaryHandSlot", name = CleveRoids.Localized.Sword },
|
Swords2 = { slot = "SecondaryHandSlot", class = 2, subClass = { [7] = true, [8] = true } },
|
||||||
Maces2 = { slot = "SecondaryHandSlot", name = CleveRoids.Localized.Mace },
|
Maces2 = { slot = "SecondaryHandSlot", class = 2, subClass = { [4] = true, [5] = true } },
|
||||||
Shields = { slot = "SecondaryHandSlot", name = CleveRoids.Localized.Shield },
|
Shields = { slot = "SecondaryHandSlot", class = 4, subClass = { [6] = true } },
|
||||||
-- ranged
|
-- ranged
|
||||||
Guns = { slot = "RangedSlot", name = CleveRoids.Localized.Gun },
|
Guns = { slot = "RangedSlot", class = 2, subClass = { [3] = true } },
|
||||||
Crossbows = { slot = "RangedSlot", name = CleveRoids.Localized.Crossbow },
|
Crossbows = { slot = "RangedSlot", class = 2, subClass = { [18] = true } },
|
||||||
Bows = { slot = "RangedSlot", name = CleveRoids.Localized.Bow },
|
Bows = { slot = "RangedSlot", class = 2, subClass = { [2] = true } },
|
||||||
Thrown = { slot = "RangedSlot", name = CleveRoids.Localized.Thrown },
|
Thrown = { slot = "RangedSlot", class = 2, subClass = { [16] = true } },
|
||||||
Wands = { slot = "RangedSlot", name = CleveRoids.Localized.Wand },
|
Wands = { slot = "RangedSlot", class = 2, subClass = { [19] = true } },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Detect available features
|
-- Detect available features
|
||||||
@@ -287,14 +290,6 @@ local function PrintFeatures()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if CleveRoids.hasUnitXP then table.insert(features, "UnitXP") end
|
if CleveRoids.hasUnitXP then table.insert(features, "UnitXP") end
|
||||||
if CleveRoids.hasReliquary then
|
|
||||||
local ok, major, minor, patch = pcall(RQ_GetVersion)
|
|
||||||
if ok and major then
|
|
||||||
table.insert(features, string.format("Reliquary v%d.%d.%d", major, minor, patch))
|
|
||||||
else
|
|
||||||
table.insert(features, "Reliquary")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if CleveRoids.hasTurtle then table.insert(features, "Turtle") end
|
if CleveRoids.hasTurtle then table.insert(features, "Turtle") end
|
||||||
|
|
||||||
if table.getn(features) > 0 then
|
if table.getn(features) > 0 then
|
||||||
|
|||||||
@@ -8,26 +8,9 @@ CleveRoids.Locale = GetLocale()
|
|||||||
CleveRoids.Localized = {}
|
CleveRoids.Localized = {}
|
||||||
|
|
||||||
if CleveRoids.Locale == "enUS" or CleveRoids.Locale == "enGB" then
|
if CleveRoids.Locale == "enUS" or CleveRoids.Locale == "enGB" then
|
||||||
-- place item in backpack slot 1 and run:
|
|
||||||
-- /script local l=GetContainerItemLink(0,1);local _,_,id=string.find(l,"item:(%d+)");local n,_,_,_,t,st=GetItemInfo(id);DEFAULT_CHAT_FRAME:AddMessage("\n\nID: ["..id.."]\nName: ["..n.."]\nType: ["..t.."]\nSub Type: ["..st.."]\n\n");
|
|
||||||
CleveRoids.Localized.Shield = "Shields"
|
|
||||||
CleveRoids.Localized.Bow = "Bows"
|
|
||||||
CleveRoids.Localized.Crossbow = "Crossbows"
|
|
||||||
CleveRoids.Localized.Gun = "Guns"
|
|
||||||
CleveRoids.Localized.Thrown = "Thrown"
|
|
||||||
CleveRoids.Localized.Wand = "Wands"
|
|
||||||
CleveRoids.Localized.Sword = "Swords"
|
|
||||||
CleveRoids.Localized.Staff = "Staves"
|
|
||||||
CleveRoids.Localized.Polearm = "Polearms"
|
|
||||||
CleveRoids.Localized.Mace = "Maces"
|
|
||||||
CleveRoids.Localized.FistWeapon = "Fist Weapons"
|
|
||||||
CleveRoids.Localized.Dagger = "Daggers"
|
|
||||||
CleveRoids.Localized.Axe = "Axes"
|
|
||||||
|
|
||||||
CleveRoids.Localized.Attack = "Attack"
|
CleveRoids.Localized.Attack = "Attack"
|
||||||
CleveRoids.Localized.AutoShot = "Auto Shot"
|
CleveRoids.Localized.AutoShot = "Auto Shot"
|
||||||
CleveRoids.Localized.Shoot = "Shoot"
|
CleveRoids.Localized.Shoot = "Shoot"
|
||||||
CleveRoids.Localized.SpellRank = "%(Rank %d+%)"
|
|
||||||
|
|
||||||
-- target creature and run:
|
-- target creature and run:
|
||||||
-- /script local ct, uc = UnitCreatureType("target"),UnitClassification("target"); DEFAULT_CHAT_FRAME:AddMessage("\n\nUnitCreatureType: ["..ct.."]\nUnitClassificationType: ["..uc.."]\n\n");
|
-- /script local ct, uc = UnitCreatureType("target"),UnitClassification("target"); DEFAULT_CHAT_FRAME:AddMessage("\n\nUnitCreatureType: ["..ct.."]\nUnitClassificationType: ["..uc.."]\n\n");
|
||||||
@@ -50,43 +33,11 @@ if CleveRoids.Locale == "enUS" or CleveRoids.Locale == "enGB" then
|
|||||||
["Stealth"] = "Stealth",
|
["Stealth"] = "Stealth",
|
||||||
["Prowl"] = "Prowl",
|
["Prowl"] = "Prowl",
|
||||||
["Shadowmeld"] = "Shadowmeld",
|
["Shadowmeld"] = "Shadowmeld",
|
||||||
["Revenge"] = "Revenge",
|
|
||||||
["Overpower"] = "Overpower",
|
|
||||||
["Riposte"] = "Riposte",
|
|
||||||
["Surprise Attack"] = "Surprise Attack",
|
|
||||||
["Lacerate"] = "Lacerate",
|
|
||||||
["Baited Shot"] = "Baited Shot",
|
|
||||||
["Counterattack"] = "Counterattack",
|
|
||||||
["Arcane Surge"] = "Arcane Surge",
|
|
||||||
}
|
|
||||||
|
|
||||||
-- place item in backpack slot 1 and run:
|
|
||||||
-- /script local l=GetContainerItemLink(0,1);local _,_,id=string.find(l,"item:(%d+)");local n,_,_,_,t,st=GetItemInfo(id);DEFAULT_CHAT_FRAME:AddMessage("\n\nID: ["..id.."]\nName: ["..n.."]\nType: ["..t.."]\nSub Type: ["..st.."]\n\n");
|
|
||||||
CleveRoids.Localized.ItemTypes = {
|
|
||||||
["Consumable"] = "Consumable",
|
|
||||||
["Reagent"] = "Reagent",
|
|
||||||
["Projectile"] = "Projectile",
|
|
||||||
["Trade Goods"] = "Trade Goods",
|
|
||||||
}
|
}
|
||||||
elseif CleveRoids.Locale == "deDE" then
|
elseif CleveRoids.Locale == "deDE" then
|
||||||
CleveRoids.Localized.Shield = "Schilde"
|
|
||||||
CleveRoids.Localized.Bow = "Bögen"
|
|
||||||
CleveRoids.Localized.Crossbow = "Armbrüste"
|
|
||||||
CleveRoids.Localized.Gun = "Waffen"
|
|
||||||
CleveRoids.Localized.Thrown = "Geworfen"
|
|
||||||
CleveRoids.Localized.Wand = "Zauberstäbe"
|
|
||||||
CleveRoids.Localized.Sword = "Schwerter"
|
|
||||||
CleveRoids.Localized.Staff = "Dauben"
|
|
||||||
CleveRoids.Localized.Polearm = "Stangenwaffen"
|
|
||||||
CleveRoids.Localized.Mace = "Streitkolben"
|
|
||||||
CleveRoids.Localized.FistWeapon = "Faustwaffen"
|
|
||||||
CleveRoids.Localized.Dagger = "Dolche"
|
|
||||||
|
|
||||||
CleveRoids.Localized.Axe = "Äxte"
|
|
||||||
CleveRoids.Localized.Attack = "Angriff"
|
CleveRoids.Localized.Attack = "Angriff"
|
||||||
CleveRoids.Localized.AutoShot = "Automatischer Schuss"
|
CleveRoids.Localized.AutoShot = "Automatischer Schuss"
|
||||||
CleveRoids.Localized.Shoot = "Schießen"
|
CleveRoids.Localized.Shoot = "Schießen"
|
||||||
CleveRoids.Localized.SpellRank = "%(Rank %d+%)"
|
|
||||||
|
|
||||||
CleveRoids.Localized.CreatureTypes = {
|
CleveRoids.Localized.CreatureTypes = {
|
||||||
["Beast"] = "Wildtier",
|
["Beast"] = "Wildtier",
|
||||||
@@ -108,42 +59,11 @@ elseif CleveRoids.Locale == "deDE" then
|
|||||||
["Stealth"] = "Verstohlenheit",
|
["Stealth"] = "Verstohlenheit",
|
||||||
["Prowl"] = "Schleichen",
|
["Prowl"] = "Schleichen",
|
||||||
["Shadowmeld"] = "Schattenmimik",
|
["Shadowmeld"] = "Schattenmimik",
|
||||||
["Revenge"] = "Rache",
|
|
||||||
["Overpower"] = "Überwältigen",
|
|
||||||
["Riposte"] = "Riposte",
|
|
||||||
["Surprise Attack"] = "Überraschungsangriff",
|
|
||||||
["Lacerate"] = "Zerfleischen",
|
|
||||||
["Baited Shot"] = "Köderschuss",
|
|
||||||
["Counterattack"] = "Gegenangriff",
|
|
||||||
["Arcane Surge"] = "Arkane Woge",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CleveRoids.Localized.ItemTypes = {
|
|
||||||
["Consumable"] = "Verbrauchsmaterial",
|
|
||||||
["Reagent"] = "Reagens",
|
|
||||||
["Projectile"] = "Projektil",
|
|
||||||
["Trade Goods"] = "Handwerkswaren",
|
|
||||||
}
|
}
|
||||||
elseif CleveRoids.Locale == "frFR" then
|
elseif CleveRoids.Locale == "frFR" then
|
||||||
CleveRoids.Localized.Shield = "Boucliers"
|
|
||||||
CleveRoids.Localized.Bow = "Arcs"
|
|
||||||
CleveRoids.Localized.Crossbow = "Arbalètes"
|
|
||||||
CleveRoids.Localized.Gun = "Armes à feu"
|
|
||||||
CleveRoids.Localized.Thrown = "Thrown"
|
|
||||||
CleveRoids.Localized.Wand = "Wands"
|
|
||||||
CleveRoids.Localized.Sword = "Swords"
|
|
||||||
CleveRoids.Localized.Staff = "Staves"
|
|
||||||
CleveRoids.Localized.Polearm = "Polearms"
|
|
||||||
CleveRoids.Localized.Mace = "Maces"
|
|
||||||
CleveRoids.Localized.FistWeapon = "Fist Weapons"
|
|
||||||
CleveRoids.Localized.Dagger = "Daggers"
|
|
||||||
CleveRoids.Localized.Axe = "Axes"
|
|
||||||
|
|
||||||
CleveRoids.Localized.Attack = "Attack"
|
CleveRoids.Localized.Attack = "Attack"
|
||||||
CleveRoids.Localized.AutoShot = "Auto Shot"
|
CleveRoids.Localized.AutoShot = "Auto Shot"
|
||||||
CleveRoids.Localized.Shoot = "Shoot"
|
CleveRoids.Localized.Shoot = "Shoot"
|
||||||
CleveRoids.Localized.SpellRank = "%(Rank %d+%)"
|
|
||||||
|
|
||||||
CleveRoids.Localized.CreatureTypes = {
|
CleveRoids.Localized.CreatureTypes = {
|
||||||
["Beast"] = "Bête",
|
["Beast"] = "Bête",
|
||||||
@@ -164,41 +84,11 @@ elseif CleveRoids.Locale == "frFR" then
|
|||||||
["Stealth"] = "Camouflage",
|
["Stealth"] = "Camouflage",
|
||||||
["Prowl"] = "Rôder",
|
["Prowl"] = "Rôder",
|
||||||
["Shadowmeld"] = "Camouflage dans l'ombre",
|
["Shadowmeld"] = "Camouflage dans l'ombre",
|
||||||
["Revenge"] = "Vengeance",
|
|
||||||
["Overpower"] = "Fulgurance",
|
|
||||||
["Riposte"] = "Riposte",
|
|
||||||
["Surprise Attack"] = "Attaque surprise",
|
|
||||||
["Lacerate"] = "Lacérer",
|
|
||||||
["Baited Shot"] = "Tir appâté",
|
|
||||||
["Counterattack"] = "Contre-attaque",
|
|
||||||
["Arcane Surge"] = "Éruption d’arcanes",
|
|
||||||
}
|
|
||||||
|
|
||||||
CleveRoids.Localized.ItemTypes = {
|
|
||||||
["Consumable"] = "Consommable",
|
|
||||||
["Reagent"] = "Reagent",
|
|
||||||
["Projectile"] = "Projectile",
|
|
||||||
["Trade Goods"] = "Artisanat",
|
|
||||||
}
|
}
|
||||||
elseif CleveRoids.Locale == "koKR" then
|
elseif CleveRoids.Locale == "koKR" then
|
||||||
CleveRoids.Localized.Shield = "Shields"
|
|
||||||
CleveRoids.Localized.Bow = "Bows"
|
|
||||||
CleveRoids.Localized.Crossbow = "Crossbows"
|
|
||||||
CleveRoids.Localized.Gun = "Guns"
|
|
||||||
CleveRoids.Localized.Thrown = "Thrown"
|
|
||||||
CleveRoids.Localized.Wand = "Wands"
|
|
||||||
CleveRoids.Localized.Sword = "Swords"
|
|
||||||
CleveRoids.Localized.Staff = "Staves"
|
|
||||||
CleveRoids.Localized.Polearm = "Polearms"
|
|
||||||
CleveRoids.Localized.Mace = "Maces"
|
|
||||||
CleveRoids.Localized.FistWeapon = "Fist Weapons"
|
|
||||||
CleveRoids.Localized.Dagger = "Daggers"
|
|
||||||
CleveRoids.Localized.Axe = "Axes"
|
|
||||||
|
|
||||||
CleveRoids.Localized.Attack = "Attack"
|
CleveRoids.Localized.Attack = "Attack"
|
||||||
CleveRoids.Localized.AutoShot = "Auto Shot"
|
CleveRoids.Localized.AutoShot = "Auto Shot"
|
||||||
CleveRoids.Localized.Shoot = "Shoot"
|
CleveRoids.Localized.Shoot = "Shoot"
|
||||||
CleveRoids.Localized.SpellRank = "%(Rank %d+%)"
|
|
||||||
|
|
||||||
CleveRoids.Localized.CreatureTypes = {
|
CleveRoids.Localized.CreatureTypes = {
|
||||||
["Beast"] = "야수",
|
["Beast"] = "야수",
|
||||||
@@ -219,41 +109,11 @@ elseif CleveRoids.Locale == "koKR" then
|
|||||||
["Stealth"] = "은신",
|
["Stealth"] = "은신",
|
||||||
["Prowl"] = "숨기",
|
["Prowl"] = "숨기",
|
||||||
["Shadowmeld"] = "그림자 숨기",
|
["Shadowmeld"] = "그림자 숨기",
|
||||||
["Revenge"] = "복수",
|
|
||||||
["Overpower"] = "제압",
|
|
||||||
["Riposte"] = "반격",
|
|
||||||
["Surprise Attack"] = "기습",
|
|
||||||
["Lacerate"] = "괴롭히다",
|
|
||||||
["Baited Shot"] = "베이티드 샷",
|
|
||||||
["Counterattack"] = "역습",
|
|
||||||
["Arcane Surge"] = "비전 쇄도",
|
|
||||||
}
|
|
||||||
|
|
||||||
CleveRoids.Localized.ItemTypes = {
|
|
||||||
["Consumable"] = "소모품",
|
|
||||||
["Reagent"] = "재료",
|
|
||||||
["Projectile"] = "발사체",
|
|
||||||
["Trade Goods"] = "거래 용품",
|
|
||||||
}
|
}
|
||||||
elseif CleveRoids.Locale == "zhCN" then
|
elseif CleveRoids.Locale == "zhCN" then
|
||||||
CleveRoids.Localized.Shield = "盾牌"
|
|
||||||
CleveRoids.Localized.Bow = "弓"
|
|
||||||
CleveRoids.Localized.Crossbow = "弩"
|
|
||||||
CleveRoids.Localized.Gun = "枪械"
|
|
||||||
CleveRoids.Localized.Thrown = "投掷武器"
|
|
||||||
CleveRoids.Localized.Wand = "魔杖"
|
|
||||||
CleveRoids.Localized.Sword = "剑"
|
|
||||||
CleveRoids.Localized.Staff = "法杖"
|
|
||||||
CleveRoids.Localized.Polearm = "长柄武器"
|
|
||||||
CleveRoids.Localized.Mace = "锤"
|
|
||||||
CleveRoids.Localized.FistWeapon = "拳套"
|
|
||||||
CleveRoids.Localized.Dagger = "匕首"
|
|
||||||
CleveRoids.Localized.Axe = "斧"
|
|
||||||
|
|
||||||
CleveRoids.Localized.Attack = "攻击"
|
CleveRoids.Localized.Attack = "攻击"
|
||||||
CleveRoids.Localized.AutoShot = "自动射击"
|
CleveRoids.Localized.AutoShot = "自动射击"
|
||||||
CleveRoids.Localized.Shoot = "射击"
|
CleveRoids.Localized.Shoot = "射击"
|
||||||
CleveRoids.Localized.SpellRank = "%(等级 %d+%)"
|
|
||||||
|
|
||||||
CleveRoids.Localized.CreatureTypes = {
|
CleveRoids.Localized.CreatureTypes = {
|
||||||
["Beast"] = "野兽",
|
["Beast"] = "野兽",
|
||||||
@@ -274,41 +134,11 @@ elseif CleveRoids.Locale == "zhCN" then
|
|||||||
["Stealth"] = "潜行",
|
["Stealth"] = "潜行",
|
||||||
["Prowl"] = "潜行",
|
["Prowl"] = "潜行",
|
||||||
["Shadowmeld"] = "影遁",
|
["Shadowmeld"] = "影遁",
|
||||||
["Revenge"] = "复仇",
|
|
||||||
["Overpower"] = "压制",
|
|
||||||
["Riposte"] = "还击",
|
|
||||||
["Surprise Attack"] = "偷袭",
|
|
||||||
["Lacerate"] = "划破",
|
|
||||||
["Baited Shot"] = "诱饵射击",
|
|
||||||
["Counterattack"] = "反击",
|
|
||||||
["Arcane Surge"] = "奥术涌动",
|
|
||||||
}
|
|
||||||
|
|
||||||
CleveRoids.Localized.ItemTypes = {
|
|
||||||
["Consumable"] = "消耗品",
|
|
||||||
["Reagent"] = "材料",
|
|
||||||
["Projectile"] = "弹药",
|
|
||||||
["Trade Goods"] = "商品",
|
|
||||||
}
|
}
|
||||||
elseif CleveRoids.Locale == "zhTW" then
|
elseif CleveRoids.Locale == "zhTW" then
|
||||||
CleveRoids.Localized.Shield = "盾牌"
|
|
||||||
CleveRoids.Localized.Bow = "長弓"
|
|
||||||
CleveRoids.Localized.Crossbow = "弩"
|
|
||||||
CleveRoids.Localized.Gun = "槍械"
|
|
||||||
CleveRoids.Localized.Thrown = "投擲武器"
|
|
||||||
CleveRoids.Localized.Wand = "魔杖"
|
|
||||||
CleveRoids.Localized.Sword = "劍"
|
|
||||||
CleveRoids.Localized.Staff = "法杖"
|
|
||||||
CleveRoids.Localized.Polearm = "長柄武器"
|
|
||||||
CleveRoids.Localized.Mace = "錘"
|
|
||||||
CleveRoids.Localized.FistWeapon = "拳套"
|
|
||||||
CleveRoids.Localized.Dagger = "匕首"
|
|
||||||
CleveRoids.Localized.Axe = "斧"
|
|
||||||
|
|
||||||
CleveRoids.Localized.Attack = "攻擊"
|
CleveRoids.Localized.Attack = "攻擊"
|
||||||
CleveRoids.Localized.AutoShot = "自動射擊"
|
CleveRoids.Localized.AutoShot = "自動射擊"
|
||||||
CleveRoids.Localized.Shoot = "射擊"
|
CleveRoids.Localized.Shoot = "射擊"
|
||||||
CleveRoids.Localized.SpellRank = "%(等級 %d+%)"
|
|
||||||
|
|
||||||
CleveRoids.Localized.CreatureTypes = {
|
CleveRoids.Localized.CreatureTypes = {
|
||||||
["Beast"] = "野獸",
|
["Beast"] = "野獸",
|
||||||
@@ -329,41 +159,11 @@ elseif CleveRoids.Locale == "zhTW" then
|
|||||||
["Stealth"] = "隱形",
|
["Stealth"] = "隱形",
|
||||||
["Prowl"] = "徘徊",
|
["Prowl"] = "徘徊",
|
||||||
["Shadowmeld"] = "影遁",
|
["Shadowmeld"] = "影遁",
|
||||||
["Revenge"] = "復仇",
|
|
||||||
["Overpower"] = "壓倒",
|
|
||||||
["Riposte"] = "還擊",
|
|
||||||
["Surprise Attack"] = "偷襲",
|
|
||||||
["Lacerate"] = "劃破",
|
|
||||||
["Baited Shot"] = "誘餌射擊",
|
|
||||||
["Counterattack"] = "反擊",
|
|
||||||
["Arcane Surge"] = "奧術湧動",
|
|
||||||
}
|
|
||||||
|
|
||||||
CleveRoids.Localized.ItemTypes = {
|
|
||||||
["Consumable"] = "消耗品",
|
|
||||||
["Reagent"] = "材料",
|
|
||||||
["Projectile"] = "彈藥",
|
|
||||||
["Trade Goods"] = "貿易貨物",
|
|
||||||
}
|
}
|
||||||
elseif CleveRoids.Locale == "ruRU" then
|
elseif CleveRoids.Locale == "ruRU" then
|
||||||
CleveRoids.Localized.Shield = "Shields"
|
|
||||||
CleveRoids.Localized.Bow = "Bows"
|
|
||||||
CleveRoids.Localized.Crossbow = "Crossbows"
|
|
||||||
CleveRoids.Localized.Gun = "Guns"
|
|
||||||
CleveRoids.Localized.Thrown = "Thrown"
|
|
||||||
CleveRoids.Localized.Wand = "Wands"
|
|
||||||
CleveRoids.Localized.Sword = "Swords"
|
|
||||||
CleveRoids.Localized.Staff = "Staves"
|
|
||||||
CleveRoids.Localized.Polearm = "Polearms"
|
|
||||||
CleveRoids.Localized.Mace = "Maces"
|
|
||||||
CleveRoids.Localized.FistWeapon = "Fist Weapons"
|
|
||||||
CleveRoids.Localized.Dagger = "Daggers"
|
|
||||||
CleveRoids.Localized.Axe = "Axes"
|
|
||||||
|
|
||||||
CleveRoids.Localized.Attack = "Attack"
|
CleveRoids.Localized.Attack = "Attack"
|
||||||
CleveRoids.Localized.AutoShot = "Auto Shot"
|
CleveRoids.Localized.AutoShot = "Auto Shot"
|
||||||
CleveRoids.Localized.Shoot = "Shoot"
|
CleveRoids.Localized.Shoot = "Shoot"
|
||||||
CleveRoids.Localized.SpellRank = "%(Rank %d+%)"
|
|
||||||
|
|
||||||
CleveRoids.Localized.CreatureTypes = {
|
CleveRoids.Localized.CreatureTypes = {
|
||||||
["Beast"] = "Животное",
|
["Beast"] = "Животное",
|
||||||
@@ -384,41 +184,11 @@ elseif CleveRoids.Locale == "ruRU" then
|
|||||||
["Stealth"] = "Незаметность",
|
["Stealth"] = "Незаметность",
|
||||||
["Prowl"] = "Крадущийся зверь",
|
["Prowl"] = "Крадущийся зверь",
|
||||||
["Shadowmeld"] = "Слияние с тенью",
|
["Shadowmeld"] = "Слияние с тенью",
|
||||||
["Revenge"] = "Реванш",
|
|
||||||
["Overpower"] = "Превосходство",
|
|
||||||
["Riposte"] = "Ответный удар",
|
|
||||||
["Surprise Attack"] = "Внезапная атака",
|
|
||||||
["Lacerate"] = "Разрыв",
|
|
||||||
["Baited Shot"] = "Выстрел с наживкой",
|
|
||||||
["Counterattack"] = "Контратака",
|
|
||||||
["Arcane Surge"] = "Чародейский выброс",
|
|
||||||
}
|
|
||||||
|
|
||||||
CleveRoids.Localized.ItemTypes = {
|
|
||||||
["Consumable"] = "Расходный материал",
|
|
||||||
["Reagent"] = "Reagent",
|
|
||||||
["Projectile"] = "Projectile",
|
|
||||||
["Trade Goods"] = "Хозяйственные товары",
|
|
||||||
}
|
}
|
||||||
elseif CleveRoids.Locale == "esES" then
|
elseif CleveRoids.Locale == "esES" then
|
||||||
CleveRoids.Localized.Shield = "Shields"
|
|
||||||
CleveRoids.Localized.Bow = "Bows"
|
|
||||||
CleveRoids.Localized.Crossbow = "Crossbows"
|
|
||||||
CleveRoids.Localized.Gun = "Guns"
|
|
||||||
CleveRoids.Localized.Thrown = "Thrown"
|
|
||||||
CleveRoids.Localized.Wand = "Wands"
|
|
||||||
CleveRoids.Localized.Sword = "Swords"
|
|
||||||
CleveRoids.Localized.Staff = "Staves"
|
|
||||||
CleveRoids.Localized.Polearm = "Polearms"
|
|
||||||
CleveRoids.Localized.Mace = "Maces"
|
|
||||||
CleveRoids.Localized.FistWeapon = "Fist Weapons"
|
|
||||||
CleveRoids.Localized.Dagger = "Daggers"
|
|
||||||
CleveRoids.Localized.Axe = "Axes"
|
|
||||||
|
|
||||||
CleveRoids.Localized.Attack = "Attack"
|
CleveRoids.Localized.Attack = "Attack"
|
||||||
CleveRoids.Localized.AutoShot = "Auto Shot"
|
CleveRoids.Localized.AutoShot = "Auto Shot"
|
||||||
CleveRoids.Localized.Shoot = "Shoot"
|
CleveRoids.Localized.Shoot = "Shoot"
|
||||||
CleveRoids.Localized.SpellRank = "%(Rank %d+%)"
|
|
||||||
|
|
||||||
CleveRoids.Localized.CreatureTypes = {
|
CleveRoids.Localized.CreatureTypes = {
|
||||||
["Beast"] = "Bestia",
|
["Beast"] = "Bestia",
|
||||||
@@ -439,21 +209,6 @@ elseif CleveRoids.Locale == "esES" then
|
|||||||
["Stealth"] = "Sigilo",
|
["Stealth"] = "Sigilo",
|
||||||
["Prowl"] = "Acechar",
|
["Prowl"] = "Acechar",
|
||||||
["Shadowmeld"] = "Fusión con las sombras",
|
["Shadowmeld"] = "Fusión con las sombras",
|
||||||
["Revenge"] = "Revancha",
|
|
||||||
["Overpower"] = "Abrumar",
|
|
||||||
["Riposte"] = "Estocada",
|
|
||||||
["Surprise Attack"] = "Ataque sorpresa",
|
|
||||||
["Lacerate"] = "Lacerar",
|
|
||||||
["Baited Shot"] = "Disparo con cebo",
|
|
||||||
["Counterattack"] = "Contraataque",
|
|
||||||
["Arcane Surge"] = "Oleada Arcana",
|
|
||||||
}
|
|
||||||
|
|
||||||
CleveRoids.Localized.ItemTypes = {
|
|
||||||
["Consumable"] = "Consumible",
|
|
||||||
["Reagent"] = "Reagent",
|
|
||||||
["Projectile"] = "Projectile",
|
|
||||||
["Trade Goods"] = "Objetos comerciables",
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -651,6 +651,8 @@ local function validateConditional(conditional, args, action)
|
|||||||
combo = true,
|
combo = true,
|
||||||
hp = true, myhp = true, rawhp = true, myrawhp = true,
|
hp = true, myhp = true, rawhp = true, myrawhp = true,
|
||||||
power = true, mypower = true, rawpower = true, myrawpower = true,
|
power = true, mypower = true, rawpower = true, myrawpower = true,
|
||||||
|
mana = true, mymana = true, rage = true, myrage = true,
|
||||||
|
energy = true, myenergy = true,
|
||||||
hplost = true, myhplost = true,
|
hplost = true, myhplost = true,
|
||||||
powerlost = true, mypowerlost = true,
|
powerlost = true, mypowerlost = true,
|
||||||
stat = true,
|
stat = true,
|
||||||
@@ -678,6 +680,8 @@ local function validateConditional(conditional, args, action)
|
|||||||
-- Check operator syntax for numeric comparisons
|
-- Check operator syntax for numeric comparisons
|
||||||
if args and type(args) == "string" then
|
if args and type(args) == "string" then
|
||||||
local hasHpOrPower = safeStringFind(baseCond, "hp") or safeStringFind(baseCond, "power") or
|
local hasHpOrPower = safeStringFind(baseCond, "hp") or safeStringFind(baseCond, "power") or
|
||||||
|
safeStringFind(baseCond, "mana") or safeStringFind(baseCond, "energy") or
|
||||||
|
safeStringFind(baseCond, "rage") or
|
||||||
safeStringFind(baseCond, "combo") or baseCond == "stat"
|
safeStringFind(baseCond, "combo") or baseCond == "stat"
|
||||||
if hasHpOrPower then
|
if hasHpOrPower then
|
||||||
local hasOperator = safeStringFind(args, "[<>=~]+")
|
local hasOperator = safeStringFind(args, "[<>=~]+")
|
||||||
|
|||||||
+61
-231
@@ -71,7 +71,6 @@
|
|||||||
|
|
||||||
Spell Miss Events (v2.31+):
|
Spell Miss Events (v2.31+):
|
||||||
- SPELL_MISS_SELF / SPELL_MISS_OTHER - Spell miss/resist/immune/dodge/etc.
|
- SPELL_MISS_SELF / SPELL_MISS_OTHER - Spell miss/resist/immune/dodge/etc.
|
||||||
- GetSpellPower([mode]) - Player mod damage done for all 7 schools
|
|
||||||
|
|
||||||
Aura Event State Parameter (v2.32+):
|
Aura Event State Parameter (v2.32+):
|
||||||
- Buff/debuff events include 7th `state` parameter (0=added, 1=removed, 2=modified)
|
- Buff/debuff events include 7th `state` parameter (0=added, 1=removed, 2=modified)
|
||||||
@@ -364,9 +363,8 @@ API.VERSION_REQUIREMENTS = {
|
|||||||
["AuraDurationEvents"] = { 2, 30, 0 },
|
["AuraDurationEvents"] = { 2, 30, 0 },
|
||||||
["GetPlayerAuraDuration"] = { 2, 30, 0, "GetPlayerAuraDuration" },
|
["GetPlayerAuraDuration"] = { 2, 30, 0, "GetPlayerAuraDuration" },
|
||||||
|
|
||||||
-- v2.31+ - Spell miss events and spell power query
|
-- v2.31+ - Spell miss events
|
||||||
["SpellMissEvents"] = { 2, 31, 0 }, -- SPELL_MISS_SELF/OTHER events
|
["SpellMissEvents"] = { 2, 31, 0 }, -- SPELL_MISS_SELF/OTHER events
|
||||||
["GetSpellPower"] = { 2, 31, 0, "GetSpellPower" },
|
|
||||||
|
|
||||||
-- v2.32+ - Aura event state parameter and stack removal fix
|
-- v2.32+ - Aura event state parameter and stack removal fix
|
||||||
["AuraEventState"] = { 2, 32, 0 },
|
["AuraEventState"] = { 2, 32, 0 },
|
||||||
@@ -575,9 +573,8 @@ local function InitializeFeatures()
|
|||||||
f.hasAuraDurationEvents = API.HasFeature("AuraDurationEvents")
|
f.hasAuraDurationEvents = API.HasFeature("AuraDurationEvents")
|
||||||
f.hasGetPlayerAuraDuration = API.HasFeature("GetPlayerAuraDuration")
|
f.hasGetPlayerAuraDuration = API.HasFeature("GetPlayerAuraDuration")
|
||||||
|
|
||||||
-- v2.31+ Spell miss events and spell power
|
-- v2.31+ Spell miss events
|
||||||
f.hasSpellMissEvents = API.HasFeature("SpellMissEvents")
|
f.hasSpellMissEvents = API.HasFeature("SpellMissEvents")
|
||||||
f.hasGetSpellPower = API.HasFeature("GetSpellPower")
|
|
||||||
|
|
||||||
-- v2.32+ Aura event state parameter
|
-- v2.32+ Aura event state parameter
|
||||||
f.hasAuraEventState = API.HasFeature("AuraEventState")
|
f.hasAuraEventState = API.HasFeature("AuraEventState")
|
||||||
@@ -1493,15 +1490,12 @@ function API.GetEquippedItems(unitToken)
|
|||||||
|
|
||||||
local items = {}
|
local items = {}
|
||||||
for slot = 0, 18 do
|
for slot = 0, 18 do
|
||||||
local link = GetInventoryItemLink("player", slot + 1)
|
local itemId = CleveRoids.ClassicAPI.GetInventoryItemID("player", slot + 1)
|
||||||
if link then
|
if itemId then
|
||||||
local _, _, itemId = string.find(link, "item:(%d+)")
|
items[slot] = {
|
||||||
if itemId then
|
itemId = itemId,
|
||||||
items[slot] = {
|
-- Other fields not available without native API
|
||||||
itemId = tonumber(itemId),
|
}
|
||||||
-- Other fields not available without native API
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1524,14 +1518,11 @@ function API.GetEquippedItem(unitToken, slot)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local link = GetInventoryItemLink("player", slot + 1) -- 1-indexed
|
local itemId = CleveRoids.ClassicAPI.GetInventoryItemID("player", slot + 1) -- 1-indexed
|
||||||
if link then
|
if itemId then
|
||||||
local _, _, itemId = string.find(link, "item:(%d+)")
|
return {
|
||||||
if itemId then
|
itemId = itemId,
|
||||||
return {
|
}
|
||||||
itemId = tonumber(itemId),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -1560,16 +1551,13 @@ function API.GetBagItems(bagIndex)
|
|||||||
local bagContents = {}
|
local bagContents = {}
|
||||||
local numSlots = GetContainerNumSlots(bagIndex) or 0
|
local numSlots = GetContainerNumSlots(bagIndex) or 0
|
||||||
for slot = 1, numSlots do
|
for slot = 1, numSlots do
|
||||||
local link = GetContainerItemLink(bagIndex, slot)
|
local itemId = CleveRoids.ClassicAPI.GetContainerItemID(bagIndex, slot)
|
||||||
if link then
|
if itemId then
|
||||||
local _, _, itemId = string.find(link, "item:(%d+)")
|
|
||||||
local _, count = GetContainerItemInfo(bagIndex, slot)
|
local _, count = GetContainerItemInfo(bagIndex, slot)
|
||||||
if itemId then
|
bagContents[slot] = {
|
||||||
bagContents[slot] = {
|
itemId = itemId,
|
||||||
itemId = tonumber(itemId),
|
stackCount = count or 1,
|
||||||
stackCount = count or 1,
|
}
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return bagContents
|
return bagContents
|
||||||
@@ -1582,16 +1570,13 @@ function API.GetBagItems(bagIndex)
|
|||||||
if numSlots > 0 then
|
if numSlots > 0 then
|
||||||
bags[bag] = {}
|
bags[bag] = {}
|
||||||
for slot = 1, numSlots do
|
for slot = 1, numSlots do
|
||||||
local link = GetContainerItemLink(bag, slot)
|
local itemId = CleveRoids.ClassicAPI.GetContainerItemID(bag, slot)
|
||||||
if link then
|
if itemId then
|
||||||
local _, _, itemId = string.find(link, "item:(%d+)")
|
|
||||||
local _, count = GetContainerItemInfo(bag, slot)
|
local _, count = GetContainerItemInfo(bag, slot)
|
||||||
if itemId then
|
bags[bag][slot] = {
|
||||||
bags[bag][slot] = {
|
itemId = itemId,
|
||||||
itemId = tonumber(itemId),
|
stackCount = count or 1,
|
||||||
stackCount = count or 1,
|
}
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1609,16 +1594,13 @@ function API.GetBagItem(bagIndex, slot)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Fallback: manual lookup
|
-- Fallback: manual lookup
|
||||||
local link = GetContainerItemLink(bagIndex, slot)
|
local itemId = CleveRoids.ClassicAPI.GetContainerItemID(bagIndex, slot)
|
||||||
if link then
|
if itemId then
|
||||||
local _, _, itemId = string.find(link, "item:(%d+)")
|
|
||||||
local _, count = GetContainerItemInfo(bagIndex, slot)
|
local _, count = GetContainerItemInfo(bagIndex, slot)
|
||||||
if itemId then
|
return {
|
||||||
return {
|
itemId = itemId,
|
||||||
itemId = tonumber(itemId),
|
stackCount = count or 1,
|
||||||
stackCount = count or 1,
|
}
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -1779,14 +1761,13 @@ function API.FindBagItem(itemIdOrName)
|
|||||||
for bag = 0, 4 do
|
for bag = 0, 4 do
|
||||||
local numSlots = GetContainerNumSlots(bag) or 0
|
local numSlots = GetContainerNumSlots(bag) or 0
|
||||||
for slot = 1, numSlots do
|
for slot = 1, numSlots do
|
||||||
local link = GetContainerItemLink(bag, slot)
|
if checkId then
|
||||||
if link then
|
if CleveRoids.ClassicAPI.GetContainerItemID(bag, slot) == checkId then
|
||||||
if checkId then
|
return bag, slot
|
||||||
local _, _, currentId = string.find(link, "item:(%d+)")
|
end
|
||||||
if currentId and tonumber(currentId) == checkId then
|
elseif checkName then
|
||||||
return bag, slot
|
local link = GetContainerItemLink(bag, slot)
|
||||||
end
|
if link then
|
||||||
elseif checkName then
|
|
||||||
local _, _, currentName = string.find(link, "|h%[(.-)%]|h")
|
local _, _, currentName = string.find(link, "|h%[(.-)%]|h")
|
||||||
if currentName and string.lower(currentName) == checkName then
|
if currentName and string.lower(currentName) == checkName then
|
||||||
return bag, slot
|
return bag, slot
|
||||||
@@ -2103,26 +2084,28 @@ function API.GetTrinkets(copy)
|
|||||||
for bag = 0, 4 do
|
for bag = 0, 4 do
|
||||||
local numSlots = GetContainerNumSlots(bag) or 0
|
local numSlots = GetContainerNumSlots(bag) or 0
|
||||||
for slot = 1, numSlots do
|
for slot = 1, numSlots do
|
||||||
local link = GetContainerItemLink(bag, slot)
|
local numItemId = CleveRoids.ClassicAPI.GetContainerItemID(bag, slot)
|
||||||
if link then
|
if numItemId then
|
||||||
local _, _, itemId = string.find(link, "item:(%d+)")
|
local invType = API.GetItemInventoryType(numItemId)
|
||||||
if itemId then
|
if invType == 12 then -- Trinket
|
||||||
local numItemId = tonumber(itemId)
|
-- Only build the link string for actual trinkets, to read the name.
|
||||||
local invType = API.GetItemInventoryType(numItemId)
|
local link = GetContainerItemLink(bag, slot)
|
||||||
if invType == 12 then -- Trinket
|
local name
|
||||||
local _, _, name = string.find(link, "|h%[(.-)%]|h")
|
if link then
|
||||||
local texture = GetContainerItemInfo(bag, slot)
|
local _
|
||||||
local itemLevel = API.GetItemLevel(numItemId)
|
_, _, name = string.find(link, "|h%[(.-)%]|h")
|
||||||
trinkets[index] = {
|
|
||||||
itemId = numItemId,
|
|
||||||
trinketName = name or "Unknown",
|
|
||||||
texture = texture,
|
|
||||||
itemLevel = itemLevel,
|
|
||||||
bagIndex = bag,
|
|
||||||
slotIndex = slot,
|
|
||||||
}
|
|
||||||
index = index + 1
|
|
||||||
end
|
end
|
||||||
|
local texture = GetContainerItemInfo(bag, slot)
|
||||||
|
local itemLevel = API.GetItemLevel(numItemId)
|
||||||
|
trinkets[index] = {
|
||||||
|
itemId = numItemId,
|
||||||
|
trinketName = name or "Unknown",
|
||||||
|
texture = texture,
|
||||||
|
itemLevel = itemLevel,
|
||||||
|
bagIndex = bag,
|
||||||
|
slotIndex = slot,
|
||||||
|
}
|
||||||
|
index = index + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2183,18 +2166,13 @@ function API.GetTrinketCooldown(slot)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Get item ID from equipped slot
|
-- Get item ID from equipped slot
|
||||||
local link = GetInventoryItemLink("player", equipSlot)
|
local itemId = CleveRoids.ClassicAPI.GetInventoryItemID("player", equipSlot)
|
||||||
if not link then
|
|
||||||
return -1
|
|
||||||
end
|
|
||||||
|
|
||||||
local _, _, itemId = string.find(link, "item:(%d+)")
|
|
||||||
if not itemId then
|
if not itemId then
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get cooldown info
|
-- Get cooldown info
|
||||||
return API.GetItemCooldownInfo(tonumber(itemId))
|
return API.GetItemCooldownInfo(itemId)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use an equipped trinket
|
-- Use an equipped trinket
|
||||||
@@ -3406,15 +3384,6 @@ API.MISS_INFO = {
|
|||||||
-- SPELL POWER QUERY (v2.31+)
|
-- SPELL POWER QUERY (v2.31+)
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Get spell power for all 7 damage schools (v2.31+)
|
|
||||||
-- mode: optional mode parameter passed to GetSpellPower
|
|
||||||
-- Returns: physical, holy, fire, nature, frost, shadow, arcane (or nil if unavailable)
|
|
||||||
function API.GetSpellPower(mode)
|
|
||||||
if not API.features.hasGetSpellPower or not _G.GetSpellPower then
|
|
||||||
return nil, nil, nil, nil, nil, nil, nil
|
|
||||||
end
|
|
||||||
return _G.GetSpellPower(mode)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Get duration of a spell in milliseconds (v2.38+)
|
-- Get duration of a spell in milliseconds (v2.38+)
|
||||||
-- For channeling spells: returns the channel duration.
|
-- For channeling spells: returns the channel duration.
|
||||||
@@ -3523,144 +3492,5 @@ function API.GetUnitMaxHealth(unitToken)
|
|||||||
return UnitHealthMax(unitToken)
|
return UnitHealthMax(unitToken)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- powerType: nil=current, 0=mana, 1=rage, 2=focus, 3=energy
|
|
||||||
-- GetUnitField uses power1-power4 fields
|
|
||||||
local POWER_FIELDS = { [0] = "power1", [1] = "power2", [2] = "power3", [3] = "power4" }
|
|
||||||
local MAX_POWER_FIELDS = { [0] = "maxPower1", [1] = "maxPower2", [2] = "maxPower3", [3] = "maxPower4" }
|
|
||||||
|
|
||||||
function API.GetUnitPower(unitToken, powerType)
|
|
||||||
if API.features.hasGetUnitField and GetUnitField and powerType then
|
|
||||||
local field = POWER_FIELDS[powerType]
|
|
||||||
if field then
|
|
||||||
local val = GetUnitField(unitToken, field)
|
|
||||||
if val then return val end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return UnitMana(unitToken)
|
|
||||||
end
|
|
||||||
|
|
||||||
function API.GetUnitMaxPower(unitToken, powerType)
|
|
||||||
if API.features.hasGetUnitField and GetUnitField and powerType then
|
|
||||||
local field = MAX_POWER_FIELDS[powerType]
|
|
||||||
if field then
|
|
||||||
local val = GetUnitField(unitToken, field)
|
|
||||||
if val then return val end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return UnitManaMax(unitToken)
|
|
||||||
end
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
-- RELIQUARY DBC FUNCTIONS (optional DLL)
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
-- Safe Reliquary call wrapper — returns nil on missing DLL or lookup failure
|
|
||||||
local function RQ_SafeCall(func, ...)
|
|
||||||
if not func then return nil end
|
|
||||||
local ok, result = pcall(func, unpack(arg))
|
|
||||||
if ok then return result end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Get item set data from DBC by set ID
|
|
||||||
-- Returns: { name, itemId_1..17, setSpellId_1..8, setThreshold_1..8 } or nil
|
|
||||||
function API.GetItemSet(setId)
|
|
||||||
if not setId or not _G.RQ_GetItemSet then return nil end
|
|
||||||
return RQ_SafeCall(_G.RQ_GetItemSet, setId)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Get the set ID for an item (via Nampower's GetItemStatsField)
|
|
||||||
-- Returns: setId (number) or nil if item has no set
|
|
||||||
function API.GetItemSetId(itemId)
|
|
||||||
if not itemId then return nil end
|
|
||||||
local setId = API.GetItemField(itemId, "itemSet")
|
|
||||||
if setId and setId ~= 0 then return setId end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Get all item IDs belonging to a set (from Reliquary DBC)
|
|
||||||
-- Returns: { itemId1, itemId2, ... } or nil
|
|
||||||
function API.GetItemSetItems(setId)
|
|
||||||
local setData = API.GetItemSet(setId)
|
|
||||||
if not setData then return nil end
|
|
||||||
|
|
||||||
local items = {}
|
|
||||||
for i = 1, 17 do
|
|
||||||
local id = setData["itemId_" .. i]
|
|
||||||
if id then
|
|
||||||
id = tonumber(id)
|
|
||||||
if id and id ~= 0 then
|
|
||||||
table.insert(items, id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if table.getn(items) > 0 then return items end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Get set bonus spell/threshold pairs from DBC
|
|
||||||
-- Returns: { { spellId = N, threshold = N }, ... } or nil
|
|
||||||
function API.GetItemSetBonuses(setId)
|
|
||||||
local setData = API.GetItemSet(setId)
|
|
||||||
if not setData then return nil end
|
|
||||||
|
|
||||||
local bonuses = {}
|
|
||||||
for i = 1, 8 do
|
|
||||||
local spellId = setData["setSpellId_" .. i]
|
|
||||||
local threshold = setData["setThreshold_" .. i]
|
|
||||||
if spellId and threshold then
|
|
||||||
spellId = tonumber(spellId)
|
|
||||||
threshold = tonumber(threshold)
|
|
||||||
if spellId and spellId ~= 0 and threshold and threshold > 0 then
|
|
||||||
table.insert(bonuses, { spellId = spellId, threshold = threshold })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if table.getn(bonuses) > 0 then return bonuses end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Get spell effect radius in yards from DBC
|
|
||||||
-- spellId: the spell to look up
|
|
||||||
-- effectIndex: 1, 2, or 3 (which effect slot, default 1)
|
|
||||||
-- Returns: radius (number) or nil
|
|
||||||
function API.GetSpellEffectRadius(spellId, effectIndex)
|
|
||||||
effectIndex = effectIndex or 1
|
|
||||||
if not spellId then return nil end
|
|
||||||
|
|
||||||
-- Get the radius index from the spell's effect via Nampower
|
|
||||||
local radiusField = "effectRadiusIndex"
|
|
||||||
local rec = API.GetSpellRecord(spellId)
|
|
||||||
if not rec then return nil end
|
|
||||||
|
|
||||||
-- effectRadiusIndex is an array field — access by effect index
|
|
||||||
local radiusIndex = nil
|
|
||||||
if rec.effectRadiusIndex then
|
|
||||||
if type(rec.effectRadiusIndex) == "table" then
|
|
||||||
radiusIndex = rec.effectRadiusIndex[effectIndex]
|
|
||||||
else
|
|
||||||
-- Single value (effect 1 only)
|
|
||||||
if effectIndex == 1 then
|
|
||||||
radiusIndex = rec.effectRadiusIndex
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not radiusIndex or radiusIndex == 0 then return nil end
|
|
||||||
|
|
||||||
-- Try Reliquary for the SpellRadius DBC lookup
|
|
||||||
if _G.RQ_GetSpellRadius then
|
|
||||||
local radiusData = RQ_SafeCall(_G.RQ_GetSpellRadius, radiusIndex)
|
|
||||||
if radiusData and radiusData.radius then
|
|
||||||
local radius = tonumber(radiusData.radius)
|
|
||||||
if radius and radius > 0 then return radius end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Expose API globally for other addons
|
-- Expose API globally for other addons
|
||||||
_G.CleveRoidsNampowerAPI = API
|
_G.CleveRoidsNampowerAPI = API
|
||||||
|
|||||||
+230
-310
File diff suppressed because it is too large
Load Diff
+9
-10
@@ -49,16 +49,15 @@ API references are line numbers into `C:\Git\ClassicAPI\docs\API.md`.
|
|||||||
- class-aware `[dispellable]` (only types this character can actually remove).
|
- class-aware `[dispellable]` (only types this character can actually remove).
|
||||||
- optional name filtering on the type keywords (e.g. `[magic:Polymorph]`).
|
- optional name filtering on the type keywords (e.g. `[magic:Polymorph]`).
|
||||||
|
|
||||||
### 2. `C_Item.GetWeaponEnchantInfo()` — temp-enchant IDs
|
### 2. ~~`C_Item.GetWeaponEnchantInfo()` — temp-enchant IDs~~ — DONE
|
||||||
- **API:** `API.md:7159` — returns 12-tuple including `enchantID` for main/off/ranged.
|
- Shipped as `[mhenchant]` / `[ohenchant]` (+ `no` variants). Matches the applied
|
||||||
- **Unlocks:** detect *which* temp enchant (poison/oil/sharpening stone) is
|
temp enchant by SpellItemEnchantment ID *or* localized name — the name path
|
||||||
applied to a weapon, not just that one exists.
|
resolves via `C_Item.GetEnchantInfo(id).name` (the ID→name table this doc
|
||||||
- **Naming:** `[poison]` is now taken by the target dispel-type conditional
|
assumed we lacked), so no tooltip scan. Wrappers `ClassicAPI.GetWeaponEnchant`
|
||||||
(slice 1 above). Use weapon-specific keywords for this — e.g.
|
/ `GetEnchantName`; `ValidateWeaponImbue` now reads through the former.
|
||||||
`[mhenchant:<id>]` / `[ohenchant:<id>]` (or `[mhpoison:<id>]`/`[ohpoison:<id>]`),
|
- Bare = any temp enchant; OR-lists supported (`[mhenchant:2823/Deadly_Poison]`).
|
||||||
not a bare `[poison]`.
|
- Follow-up (optional): route `[mhimbue:Name]`'s match through `GetEnchantName`
|
||||||
- Vanilla's global only reports presence; this is a genuinely new capability
|
too, retiring the green-text tooltip scan in `CheckWeaponImbueByName`.
|
||||||
(rogue/shaman/enhance).
|
|
||||||
|
|
||||||
### 3. `GetUnitSpeed(unit)` + `IsFalling()` / `IsSwimming()`
|
### 3. `GetUnitSpeed(unit)` + `IsFalling()` / `IsSwimming()`
|
||||||
- **API:** `API.md:8312`, `API.md:7629`.
|
- **API:** `API.md:8312`, `API.md:7629`.
|
||||||
|
|||||||
Reference in New Issue
Block a user