Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LF
Author Message
modefury34 Offline
Expired VIP Member
**

Posts: 10
Joined: Mar 2014
Reputation: 0
Version: 1.4.2.138
Post: #1
LF

Hello there im looking for a script/plugin for a "targetfix".
BTW: sory for the wrong place of topic but only here i have a ability to add a post.
06-09-2014 00:56 AM
Find all posts by this user Quote this message in a reply
Fox Away
Fraka-kaka-kaka-kaka-kow!
******

Posts: 5,635
Joined: Oct 2011
Reputation: -6666548
Version: 1.4.2.142
Post: #2
RE: LF



G2A is a fantastic web-store where you can buy games cheap (40%+ Discounts!)
[Image: uaFndGu.gif]
06-09-2014 01:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
modefury34 Offline
Expired VIP Member
**

Posts: 10
Joined: Mar 2014
Reputation: 0
Version: 1.4.2.138
Post: #3
RE: LF

I dont have privileges for that post :/
06-09-2014 15:39 PM
Find all posts by this user Quote this message in a reply
diegol Offline
Expired VIP Member
**

Posts: 89
Joined: Jun 2013
Reputation: 15
Version: 1.4.1.121
Post: #4
RE: LF

It's a plugin, use it.
    LUA Programming
TimeTillRequestChangeTarget = 1000*10 ; -- in mile seconds
TimeTillTryFixMovement = 1000*3 ; -- in mile seconds
 
TargetFixStatus = false;
unstuckingstatus = false;
mytargetid = 0;
MyTargetTimeStamp = GetTime();
unstuckmovementstamp = GetTime();
 
function OnCreate()
	this:RegisterCommand("targetfix", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME);
end;
 
function OnCommand_targetfix(vCommandChatType, vNick, vCommandParam)
	if (TargetFixStatus == false) then
		TargetFixStatus = true;
		ShowToClient("Auto Fix","Target Fix Is Activated.");
	else
		TargetFixStatus = false;
		ShowToClient("Auto Fix","Target Fix Is Is Deactivated.");	
	end;
end;
 
 
 
function OnChatSystemMessage(id, msg)
	if (id == 181) then  --cannot see target
		if (GetMe():GetTarget() ~= 0) then 
			ShowToClient("Auto Fix"," Cannot See Target");
			GetTarget():SetBlock(true);
			CancelTargets();
		end;
	end;
end;
 
function OnLTick1s()
if (TargetFixStatus == true) then
	if (mylastcordcheck ~= nil) then
		if (IsMoving() == false)  then
			if (GetTarget() ~= nil) and (GetMe():GetTarget() ~= 0)  then
				if (GetTarget():IsAlikeDeath() == false) and (GetTarget():IsMonster()) then
					if (mytargetid ~= GetTarget():GetId()) then
						mytargetid = GetTarget():GetId();
						MyTargetTimeStamp = GetTime();					
					end;					
				end;			
			end;
		else
			MyTargetTimeStamp = GetTime();
		end;
	end;	
if (GetTarget() ~= nil) and (GetMe():GetTarget() ~= 0)  then
	if GetTarget():IsMonster()  and (GetTarget():IsAlikeDeath() == false) then
		if (MyTargetTimeStamp + TimeTillRequestChangeTarget < GetTime()) then
			ShowToClient("Auto Fix"," Char Didnt Move/Hit/Nuke for the last " .. tostring(TimeTillRequestChangeTarget/1000) .. " seconds, so Changing Target!");
			GetTarget():SetBlock(true);
			CancelTargets();		
		elseif (MyTargetTimeStamp + TimeTillTryFixMovement < GetTime()) and (unstuckingstatus == false) then
			SetPause(true);
			unstuckmovementstamp = GetTime();
			unstuckingstatus = true;
			MovePerpendicularlyFromUser(GetTarget(),800);
		end;
	end;
end;
 
end;
mylastcordcheck = GetMe():GetLocation();
 
if (GetTarget() == nil) or (GetMe():GetTarget() == 0) or (GetMe():IsBlocked(true))  then
	MyTargetTimeStamp = GetTime();
end;
 
if (unstuckmovementstamp +2000 < GetTime()) and (unstuckingstatus == true) then
unstuckingstatus = false;
SetPause(false);
ShowToClient("Auto Fix","char should be unstuck by now");
end;
 
 
end;
 
 
function MovePerpendicularlyFromUser(user,dist) -- took me an hour to write this down!
	YQ = user:GetLocation().Y
	YP = GetMe():GetLocation().Y
	XQ = user:GetLocation().X
	XP = GetMe():GetLocation().X
	Mp = -1/((YQ-YP)/(XQ-XP))		
	if ((-2*XP-2*Mp*Mp*XP)*(-2*XP-2*Mp*Mp*XP) -4*(Mp*Mp+1)*(Mp*Mp*XP*XP + XP*XP-dist*dist) > 0) then
		undersqrt = (-2*XP-2*Mp*Mp*XP)*(-2*XP-2*Mp*Mp*XP) -4*(Mp*Mp+1)*(Mp*Mp*XP*XP + XP*XP-dist*dist);
	else
		undersqrt = (-2*XP-2*Mp*Mp*XP)*(-2*XP-2*Mp*Mp*XP) -4*(Mp*Mp+1)*(Mp*Mp*XP*XP + XP*XP+dist*dist);
	end;		
	XN = (-1*(-2*XP-2*Mp*Mp*XP)+math.sqrt(undersqrt))/(2*(Mp*Mp+1));
	YN = YP + Mp*(XN-XP)		
	MoveToNoWait(XN,YN,GetMe():GetLocation().Z);
end;
 
 
function IsMoving()
	if (GetDistanceVector(GetMe():GetLocation(),mylastcordcheck) > 100) then
		return true;
	end;
return false;
end;
 
function OnMagicSkillUse(user, target, skillId, skillvl, skillHitTime, skillReuse)
	if (user:IsMe()) then
		MyTargetTimeStamp = GetTime();
	end;
end;
 
function OnAttack(user, target)
	if (user:IsMe()) or (target:IsMe()) then
		MyTargetTimeStamp = GetTime();
	end;
end;
 
function CancelTargets()
ClearTargets();
CancelTarget(true);
end;

06-10-2014 08:43 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)