Page 1 of 1

party healer question

Posted: Fri Oct 19, 2012 9:40 am
by botje
is there a way to keep the party healer on a distance?

it keeps running to close by, which gets him killed xd

Botje

Re: party healer question

Posted: Fri Oct 19, 2012 10:32 pm
by lisa
Anything is possible, of course.


ok as for distance from party member, it will look something like this.'

Code: Select all

local angle = math.atan2(partymemberpawn[2].Z - player.Z, partymemberpawn[2].X - player.X);
camera:setRotation(angle);
player:update()
X,Z = calccoords(150,player.Direction)
teleport((partymemberpawn[2].X - X), (partymemberpawn[2].Z-Z), partymemberpawn[2].Y)
that will teleport to a spot 150 from the first party member, just change the 150 to something else if you want a different distance.

WP would look like this.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onLoad>
	local function calccoords(dist,angle)
		if dist == nil or angle == nil then
			print("\nrequirements missing.\n")
			return
		end
		local degrees, theta, sn, cs, X, Z
		degrees = angle * 60
		theta=(degrees*math.pi)/180;
		sn=math.sin(theta);
		cs=math.cos(theta);
		X= (dist*cs)
		Z= (dist*sn)
		return X,Z
	end
	eventParty("start")
	while(true) do
	
		if memoryReadBytePtr(getProc(),addresses.loadingScreenPtr, addresses.loadingScreen_offset) ~= 0 then
			repeat
				printf("loading screen has appeared, waiting for it to end.\n")
				yrest(1000)
			until memoryReadBytePtr(getProc(),addresses.loadingScreenPtr, addresses.loadingScreen_offset) == 0
		end
		PartyTable()
		yrest(200)
		player:update()
		if not player.Mounted then
			player:checkSkills(true);
			player:checkPotions();
			for i,v in ipairs(partymemberpawn) do
				player:target(partymemberpawn[i])
				player:update()
				partymemberpawn[i]:update()
				partymemberpawn[i]:updateBuffs()
				local target = player:getTarget();
				if target.HP/target.MaxHP*100 > 10 then
					player:checkSkills(true);
				end
			end
		end
		if (not player.Battling) then
			if settings.profile.options.LOOT == true and
				settings.profile.options.LOOT_ALL == true then
				local Lootable = player:findEnemy(nil, nil, evalTargetLootable)
				if Lootable then
					player:target(Lootable)
					player:update()
					if player.TargetPtr ~= 0 then
						player:lootAll()
					end
				end
			end
		end
		Mount(true) -- check to (dismount only)	
		local angle = math.atan2(partymemberpawn[2].Z - player.Z, partymemberpawn[2].X - player.X);
		camera:setRotation(angle);
		player:update()
		X,Z = calccoords(150,player.Direction)
		teleport((partymemberpawn[2].X - X), (partymemberpawn[2].Z-Z), partymemberpawn[2].Y)
		partyCommands()		
	end

	</onLoad>
</waypoints>
Usual discalimer
completely untested and it uses teleport, if in public then use the player:moveTo() instead.

Re: party healer question

Posted: Sat Oct 20, 2012 4:15 am
by rock5
Maybe you could use the "player:moveInRange" function?

Re: party healer question

Posted: Sat Oct 20, 2012 4:22 am
by lisa
rock5 wrote:Maybe you could use the "player:moveInRange" function?

Yup, which just calls the moveto function with the range arg.

Code: Select all

player:moveTo(target, ignoreCycleTargets, nil, range)
so it would look like this

Code: Select all

player:moveTo(partymemberpawn[2],true,nil,150)

Re: party healer question

Posted: Sat Oct 20, 2012 5:03 am
by rock5
lisa wrote:Yup, which just calls the moveto function with the range arg.
Ah, that's what you meant. I see now.

Re: party healer question

Posted: Sat Oct 20, 2012 5:20 am
by botje
perhaps its a good idea to incorporate that in the healing party? seeying healers should not be there on the battlefield, like ever? xd

Re: party healer question

Posted: Sat Oct 20, 2012 7:18 am
by lisa
botje wrote:perhaps its a good idea to incorporate that in the healing party? seeying healers should not be there on the battlefield, like ever? xd
It all comes down to the user, for me I used it inside instances and in an instance you do want the healer on your butt (when not in combat) otherwise it constantly gets stuck on corners and stairs.

When in combat the healer doesn't follow and stays in the same spot.

with the adition of the party commands you can easily tell the healer to stop following you if you are going to hit a boss, then just tell it to follow again after boss is dead.

Re: party healer question

Posted: Sat Oct 20, 2012 7:46 am
by botje
i agree on the instance prt, but for normal questing, its very irritating if you ask me... xd

Re: party healer question

Posted: Sat Oct 20, 2012 9:53 am
by lisa
botje wrote:i agree on the instance prt, but for normal questing, its very irritating if you ask me... xd
so just use the wp code I posted or if you don't want to use teleport then use the moveto code I posted instead of the teleport.

The code required to counter for every single users need/want for party would be bigger than the current bot, slight exageration, so I just did the foundation work and people can adapt it to their own needs.

Re: party healer question

Posted: Sat Oct 20, 2012 11:03 am
by botje
i know, and i did just that :)

ill leave it at that, with 1 last remark, perhaps its a idea to add a profile option for it.

anyway, thanx for the waypoint :)