Lineage 2 Tower Forum

Full Version: "Accept party invite" bugs sometimes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a script that invites my iss for buffs. However, sometimes he fails to buff because he is trying to move. If I try to quickly invite him back to the party he won't accept. I did fix this problem by putting a longer invite delay on, but I don't understand why it bugs out if you dismiss and try to invite him back instantly.
try something like this
    LUA Programming
ShowToClient("SYS","Script Ask Pt For Sonata Started");
IssName = "Zoi";	--here write name of your Iss
----------------------------------------------------------------
WhoToInv = nil;
function CheakIfBuffMissing()
	user = GetMe();
	if((user:GotBuff(1040) == false) or  --Shield
		(user:GotBuff(1035) == false) or --Mental Shield
		(user:GotBuff(1204) == false) or --Wind Walk
		(user:GotBuff(1068) == false) or --Might
		(user:GotBuff(1077) == false) or --Focus
		(user:GotBuff(1242) == false) or --Death Whisper
		(user:GotBuff(1240) == false) or --Guidance
		(user:GotBuff(1268) == false)) then --Vampiric Rage
		return true;
		end;
	return false;
end;
 
function CheakIfHaveAllBuffs()
	user = GetMe();
	if((user:GotBuff(1040)) and  --Shield
		(user:GotBuff(1035)) and --Mental Shield
		(user:GotBuff(1204)) and --Wind Walk
		(user:GotBuff(1068)) and --Might
		(user:GotBuff(1077)) and --Focus
		(user:GotBuff(1242)) and --Death Whisper
		(user:GotBuff(1240)) and --Guidance
		(user:GotBuff(1268))) then --Vampiric Rage
		return true;
		end;
	return false;
end;
 
function LocateBuffer(BuffName)
	if(GetUserByName(BuffName) == nil)then
		ShowToClient("SYS","Your buffer is out of range, w8ing on him");
		repeat
			Sleep(1000);
		until (GetUserByName(BuffName) ~= nil);
		ShowToClient("SYS","Your buffer is in range");
		WhoToInv = GetUserByName(IssName);
	elseif(GetUserByName(IssName) ~= nil)then
		WhoToInv = GetUserByName(IssName);
	end;	
end;
repeat
	LocateBuffer(IssName);
	if(CheakIfBuffMissing())and (WhoToInv ~= nil) and (WhoToInv:IsMyPartyMember() == false) and (GetMe():GetRangeTo(WhoToInv) < 750)then
		ShowToClient("SYS", "Inviting " ..IssName .. " for buff");
		InviteToParty(IssName,2);
		Sleep(14000);
		if(WhoToInv:IsMyPartyMember())then
			repeat 
				Sleep(3000);
			until CheakIfHaveAllBuffs();
			ShowToClient("SYS", "Buffs up, kiking buffer from pt...");
			Sleep(500);
			KickPartyMember(IssName);
		end;
	end;
	Sleep(1000)
until false;



delays between invites must be 14 because this time you get window with inviting option.
Reference URL's