- local type = type
- local pairs = pairs
- local UnitBuff = UnitBuff
- local UnitDebuff = UnitDebuff
- function UnitAura(unit, aura, harmful, mine)
- if type(aura) ~= "string" then
- return
- end
- local func = harmful and UnitDebuff or UnitBuff
- if mine then
- return func(unit or "target", aura, nil, "PLAYER")
- else
- return func(unit or "target", aura)
- end
- end
- function PlayerBuff(aura, mine)
- return UnitAura("player", aura, nil, mine)
- end
- function PlayerDebuff(aura, mine)
- return UnitAura("player", aura, 1, mine)
- end
- function TargetBuff(aura, mine)
- return UnitAura("target", aura, nil, mine)
- end
- function TargetDebuff(aura, mine)
- return UnitAura("target", aura, 1, mine)
- end
复制代码
使用示例
- /if PlayerBuff(战斗怒吼)==nil
- /cast 战斗怒吼
- /if TargetDebuff(巨人打击)==nil
- /cast 巨人打击
复制代码 |