LeavePartyAfterBuffs = true; -- true if you want buffer to leaveparty after buffs.
DDName = "DD Name" -- the player name of whom need to get buffed.
function RequestBuff(Buff,TargetName,IsNeedParty,IsNeedTarget)
local targetc = GetUserByName(TargetName);
if (GetMe() ~= nil) and (targetc ~= nil) and (targetc:GetRangeTo(GetMe()) < 2000) then
if (IsNeedParty) and (targetc:IsMyPartyMember() == false) then
repeat
if ((GetMyPtMembersCount() == 0) or (GetPartyMaster():GetName() == GetMe():GetName())) then
Command('/invite ' .. TargetName);
else
ShowToClient("Iss Buffer Script","Im Unable to Invite the player, Im already in party and not the party leader!");
Sleep(10000);
end;
Sleep(1000);
until targetc:IsMyPartyMember();
end;
if (IsNeedTarget) and ((GetTarget() == nil) or ((GetTarget() ~= nil) and (GetTarget():GetName() ~= TargetName))) then
Command('/target ' .. TargetName);
Sleep(1000);
end;
if (tonumber(Buff) ~= nil) then
UseSkillRaw(tonumber(Buff),false,false);
else
Command("/useskill " .. Buff);
end;
Sleep(1000);
end;
end;
function IsBuffRequireReCast(target,debuffid,timeallowed)
if (target ~= nil) and (target:GotBuff(debuffid) == true) then
local thebuff = target:GetBuff(debuffid);
if (thebuff.endTime > GetTime() + timeallowed) then
return false;
end;
end;
return true;
end;
function GetMyPtMembersCount()
local myptlist = GetPartyList():GetCount();
local count = 0;
if (tonumber(myptlist) ~= nil) then
count = myptlist;
end;
return count;
end;
repeat
if IsBuffRequireReCast(GetMe(),11524,30*1000) then
RequestBuff("Warrior's Harmony",DDName,true,true); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11517,30*1000) then
RequestBuff("Horn Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11518,30*1000) then
RequestBuff("Drum Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11519,30*1000) then
RequestBuff("Pipe Organ Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11520,30*1000) then
RequestBuff("Guitar Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11521,30*1000) then
RequestBuff("Harp Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11522,30*1000) then
RequestBuff("Lute Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
---------------------------------------------------
------------------ Protections --------------------
---------------------------------------------------
if IsBuffRequireReCast(GetMe(),11565,30*1000) then
RequestBuff("Elemental Protection",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11566,30*1000) then
RequestBuff("Divine Protection",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11567,30*1000) then
RequestBuff("Mental Protection",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
---------------------------------------------------
-------------------- Sonatas ----------------------
---------------------------------------------------
if IsBuffRequireReCast(GetMe(),11529,30*1000) then
RequestBuff("Prevailing Sonata",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11530,30*1000) then
RequestBuff("Daring Sonata",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if IsBuffRequireReCast(GetMe(),11532,30*1000) then
RequestBuff("Refreshing Sonata",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
if (LeavePartyAfterBuffs) and (GetMyPtMembersCount() ~= 0) then
Command("/leave");
end;
Sleep(1000);
until false;