TheQQmaster
Trolling the Trolls
Posts: 1,532
Joined: Jun 2012
Reputation: 642
Version:
1.4.2.133
|
RE: A Simple OOP Cleanse Script
(03-18-2014 02:58 AM)schubbel2208 Wrote: not all toons for example 5 healers nothing more, and lets say every minute
LUA Programming
ShowToClient("PURGE","AERO PURGE ON");
cleanseskillid = 11763; -- put here the cleanse skill Id atm its Radiant Purge
DebuffList = {11259,11260,11261,11262,11777,11029,11273,11296,11276,11047,11050,11055,11052,1​0539,10516,14639,14638,11048,10011,10012,10258,10269,10267,10769,10780,10801,115​59,11539} ; -- 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
if NeedCleanse(me) then
if not me:IsAlikeDeath() then
ClearTarget();
TargetRaw(me:GetId());
Sleep(500);
UseSkillRaw(cleanseskillid,false,false);
Sleep(500);
ClearTarget();
CancelTarget(false);
Sleep(500);
end;
elseif not NeedCleanse(me) 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();
Sleep(500);
TargetRaw(PMember:GetId());
Sleep(500);
else
UseSkillRaw(cleanseskillid,false,false);
Sleep(500);
ClearTargets();
CancelTarget(false);
Sleep(500);
end;
break;
end;
end;
end;
end;
end;
Sleep(500);
until false;
u can edit this, u just need replace party list to player list and add targeting function to update player debuffs
btw i used smth like that for my overlord
LUA Programming
WarriorHarmonyList = {"","",""};
WizardHarmonyList = {""};
WarriorFrenzyId = 11596;
WarriorFrenzySkill = GetSkills():FindById(WarriorFrenzyId);
WizardFrenzyId = 11597;
WizardFrenzySkill = GetSkills():FindById(WizardFrenzyId);
function Search(user,list)
for x,b in pairs(list) do
if (user == b) then
return true;
end;
end;
end;
repeat
playerlist = GetPlayerList();
for player in playerlist.list do
if player:GetDistance() < 1000 then
if player:GetClanName() == GetMe():GetClanName() then
Target(player:GetId());
-- ShowToClient("Debugger","Checked "..player:GetName());
if (Search(player:GetName(),WarriorHarmonyList)) then
if GetTarget() ~= nil and GetTarget():GotBuff(WarriorFrenzyId) == false then
if (WarriorFrenzySkill ~= nil) and (WarriorFrenzySkill:CanBeUsed()) and (WarriorFrenzySkill:IsSkillAvailable()) then
UseSkillRaw(WarriorFrenzyId,false,false);
--ShowToClient("Debugger","WarriorFrenzy Buff casted ON "..player:GetName());
ClearTargets();
Sleep(1000);
end;
end;
end;
if (Search(player:GetName(),WizardHarmonyList)) then
if GetTarget() ~= nil and GetTarget():GotBuff(WizardFrenzyId) == false then
if (WizardFrenzySkill ~= nil) and (WizardFrenzySkill:CanBeUsed()) and (WizardFrenzySkill:IsSkillAvailable()) then
UseSkillRaw(WizardFrenzyId,false,false);
--ShowToClient("Debugger","WizardFrenzy Buff casted ON "..player:GetName());
ClearTargets();
Sleep(1000);
end;
end;
end;
Sleep(1000);
ClearTargets();
end;
end;
end;
Sleep(20*1000);
until false;
PUSH IF HELPED
(This post was last modified: 03-18-2014 11:49 AM by TheQQmaster.)
|
|