(feat/Prototypes): Add 'Item Type Equipped' Trigger and Load Trigger

This commit is contained in:
NoM0Re
2025-08-24 17:05:59 +02:00
parent 01c878e33f
commit 3247c6112a
3 changed files with 71 additions and 0 deletions
+4
View File
@@ -4597,6 +4597,10 @@ WeakAuras.CheckForItemEquipped = function(itemId, specificSlot)
end
end
Private.ExecEnv.IsEquippedItemType = function(itemType)
return IsEquippedItemType(Private.item_weapon_types[itemType] or '')
end
WeakAuras.GetCritChance = function()
-- Based on what the wow paper doll does
local spellCrit = 0
+35
View File
@@ -1350,6 +1350,14 @@ Private.load_prototype = {
events = { "UNIT_INVENTORY_CHANGED", "PLAYER_EQUIPMENT_CHANGED"},
only_exact = true,
},
{
name = "itemtypeequipped",
display = L["Item Type Equipped"],
type = "multiselect",
test = "Private.ExecEnv.IsEquippedItemType(%s or '')",
events = { "UNIT_INVENTORY_CHANGED", "PLAYER_EQUIPMENT_CHANGED"},
values = "item_weapon_types"
},
}
};
@@ -6500,6 +6508,33 @@ Private.event_prototypes = {
automaticrequired = true,
progressType = "none"
},
["Item Type Equipped"] = {
type = "item",
events = {
["events"] = {
"PLAYER_EQUIPMENT_CHANGED",
},
["unit_events"] = {
["player"] = {"UNIT_INVENTORY_CHANGED"}
}
},
internal_events = { "WA_DELAYED_PLAYER_ENTERING_WORLD", },
force_events = "UNIT_INVENTORY_CHANGED",
name = L["Item Type Equipped"],
args = {
{
name = "itemTypeName",
display = L["Item Type"],
type = "multiselect",
values = "item_weapon_types",
required = true,
test = "Private.ExecEnv.IsEquippedItemType(%s)",
multiNoSingle = true
},
},
automaticrequired = true,
progressType = "none"
},
["Equipment Set"] = {
type = "item",
events = {
+32
View File
@@ -3672,6 +3672,38 @@ Private.noreset_swing_spells = {
--35474 Drums of Panic DO reset the swing timer, do not add
}
Private.item_weapon_types = {}
do
local weapon = { GetAuctionItemSubClasses(1) }
local armor = { GetAuctionItemSubClasses(2) }
Private.item_weapon_types = {
[512] = weapon[1], -- One-Handed Axes
[513] = weapon[2], -- Two-Handed Axes
[514] = weapon[3], -- Bows
[515] = weapon[4], -- Guns
[516] = weapon[5], -- One-Handed Maces
[517] = weapon[6], -- Two-Handed Maces
[518] = weapon[7], -- Polearms
[519] = weapon[8], -- One-Handed Swords
[520] = weapon[9], -- Two-Handed Swords
-- [521] = nil, -- Warglaives
[522] = weapon[10], -- Staves
-- [523] = nil, -- Bear Claws
-- [524] = nil, -- Cat Claws
[525] = weapon[11], -- Fist Weapons
[526] = weapon[12], -- Misc
[527] = weapon[13], -- Daggers
[528] = weapon[14], -- Thrown
-- [529] = nil, -- Spears
[530] = weapon[15], -- Crossbows
[531] = weapon[16], -- Wands
[532] = weapon[17], -- Fishing Poles
[1030] = armor[6], -- Shields
}
end
WeakAuras.item_weapon_types = Private.item_weapon_types
WeakAuras.StopMotion = WeakAuras.StopMotion or {}
WeakAuras.StopMotion.texture_types = WeakAuras.StopMotion.texture_types or {}
WeakAuras.StopMotion.texture_data = WeakAuras.StopMotion.texture_data or {}