You can use SetAttribute for this. For header units it has to be from within the factory function or else you'll get errors because of combat lockdown. For single spawned units it could be done from the style function too.
This is how I bound a spell based on the player's class:
lua Code:
local spellName = GetSpellInfo(cfg.clickSpell[playerClass] or 6603) -- 6603 Auto Attack
... some code missing ...
party = self:SpawnHeader(
"oUF_Rain_Party", nil, "party, raid",
"showParty", true,
"showRaid", true,
"maxColumns", 4,
"unitsPerColumn", 1,
"columnAnchorPoint", "LEFT",
"columnSpacing", 9.5,
"oUF-initialConfigFunction", ([[
self:SetWidth(110)
self:SetHeight(22)
self:SetAttribute("type3", "spell")
self:SetAttribute("spell3", "%s")
]]):format(spellName)
)
and the clickSpell from the config file:
lua Code:
clickSpell = {
["DEADKNIGHT"] = 61999, -- Raise Ally (61999)
["DRUID"] = 29166, -- Innervate (29166)
["HUNTER"] = 34477, -- Misdirection (34477)
["MAGE"] = 475, -- Remove Curse (475)
["PALADIN"] = 31789, -- Righteous Defense (31789)
["PRIEST"] = 73325, -- Leap of Faith (73325)
["ROGUE"] = 57934, -- Tricks of the Trade (57934)
["SHAMAN"] = 546, -- Water Walking (546)
["WARRIOR"] = 3411, -- Intervene (3411)
["WARLOCK"] = 80398, -- Dark Intent (80398)
}
Haven't tested whether this interferes with Clique though.
Here you could find more on that topic