Code: Select all
function CPlayer:hasBuff(buff)
local buffs = {RoMScript("} for i=1,16 do w,x,y,z=UnitBuff('player', i) table.insert(a,w) table.insert(a,y) end z={")};
local bool = false;
for i = 1,#buffs,2 do
local buffname = buffs[i];
local count = buffs[i+1] or 0;
if( count == 0 ) then count = 1; end;
if( buffname == buff) then
bool = true;
end
end
if( bool ) then return true; else return false; end
end
function CPlayer:hasDebuff(deBuff)
local deBuffs = {RoMScript("} for i=1,16 do w,x,y,z=UnitBuff('player', i) table.insert(a,w) table.insert(a,y) end z={")};
local bool = false;
for i = 1,#deBuffs,2 do
local debuffname = deBuffs[i];
local count = deBuffs[i+1] or 0;
if( count == 0 ) then count = 1; end;
if( debuffname == deBuff) then
bool = true;
end
end
if( bool ) then return true; else return false; end
end