判断自己释放的buff和debuff
local type = typelocal 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 巨人打击 小红猫 发表于 2014-4-14 23:59
我LUA不怎么会,能请教下。
local type = type
local pairs = pairs
作用域不同,这样写效率高一点 我LUA不怎么会,能请教下。
local type = type
local pairs = pairs
local UnitBuff = UnitBuff
这样写是啥意思不。 每一个帖子里都能学到东西,所以每一个帖子都要回复,并表示感谢。 这个不错,学习下 :):):)自身的BUFF 不是很好判斷嗎 学习到了,谢谢 yj里面的方案是用lua吗那am函数是哪里的 顶贴赚金币!!!!!!!! 每个帖子都学习到了,感谢!
页:
[1]
2