06-22-2012, 18:34 PM
LUA Programming
cleanseskillid = 11763; -- put here the cleanse skill Id atm its Radiant Purge.
DebuffList = {15116, 92, 102} ; -- put here the Debuff Skill Ids
function NeedCleanse(Tehuser) -- for long debuff list better this way so we wont ask GotBuff from l2 tower many times.
local MyBuffs = {} ;
for x=1,50 do
local value = nil;
value = Tehuser:GetBuffByIdx(x);
if value ~= nil then
MyBuffs[#MyBuffs+1] = value.skillId;
end;
end;
for x=1,#DebuffList do
for t=1,#MyBuffs do
if (MyBuffs ~= nil) and (MyBuffs[t] == DebuffList[x]) then
return true;
end;
end;
end;
return false;
end;
repeat
me = GetMe();
if (me ~= nil) then
myptlist = GetPartyList();
for PMember in myptlist.list do
if NeedCleanse(PMember) then
if not PMember:IsAlikeDeath() and (PMember:GetDistance() < 1000) then
if (me:GetTarget() ~= PMember:GetId()) then
ClearTargets();
TargetRaw(PMember:GetId());
else
UseSkillRaw(cleanseskillid,false,false);
end;
break;
end;
end;
end;
end;
Sleep(2000);
until false;