Page 1 of 1

Party Healer, but only when in combat.

Posted: Wed Jan 04, 2012 2:02 am
by woah
How can turn on the PartyHeals() function when I enter combat, and turn it off upon leaving combat?
I want my character to heal the other party members, but also follow the specific waypoints I set up for it, not just auto-follow.

Either that, or have the main char whisper the healer if he drops below 90% health, and the healer monitors chat and casts urgent heal on the main char when it gets that whisper. Which would eliminate the need for partyheals(). Thanks (:

Re: Party Healer, but only when in combat.

Posted: Wed Jan 04, 2012 4:08 am
by lisa
So basically you only want it to heal at a specific part of the waypoint, I'll do some thinking on it as it could be a little tricky.

Re: Party Healer, but only when in combat.

Posted: Wed Jan 04, 2012 4:52 am
by lisa
ok give this a try.

Add this to the onload for the WP

Code: Select all

function BossFightHeal()
	--=== stand around until fight is started by another character
	repeat
	yrest(100)
	player:update()
	until player.Battling
	
	while player.Battling do
	if settings.profile.options.HEAL_FIGHT ~= true then settings.profile.options.HEAL_FIGHT = false end
		_timexx = os.time()
		while(true) do
		PartyTable()
		for i,v in ipairs(partymemberpawn) do
			player:target(partymemberpawn[i])
			player:update()
			partymemberpawn[i]:update()
			partymemberpawn[i]:updateBuffs()
			target = player:getTarget();
			if target.HP/target.MaxHP*100 > 10 then
			player:checkSkills(true);
			end
			if (not player.Battling) then 
				return
			end	
		end	
	end
	end	
end
Then at the waypoint before the boss call the function.

Code: Select all

BossFightHeal()
For this to work though it has to not be the char that starts fight, I assume you wouldn't start the fight with a healer.

After combat ends it should continue on with the rest of the waypoints.
You might need to add a player:Loot_all type thing after calling the function as it may need it to be able to loot.

it probably doesn't need the check for not player.Battling, added it just to make sure it got out of the loop.

---=== edit ===---
I was 1 "end" short in the code lol

Re: Party Healer, but only when in combat.

Posted: Sat Jan 21, 2012 9:28 am
by woah
Hey sorry I took so long to respond. Ok so I tested it, and it works well except that it doesn't execute <onleavecombat> commands (I think), and it doesn't loot the boss after the fight.

Maybe because bossfightheals waits until its out of combat until continuing the waypoints, and the normal functions of rombot are to loot once it leaves combat so BossFightHeals interferes? Idk


Edit: What if I put

Code: Select all

PartyTable()
		for i,v in ipairs(partymemberpawn) do
			player:target(partymemberpawn[i])
			player:update()
			partymemberpawn[i]:update()
			partymemberpawn[i]:updateBuffs()
			target = player:getTarget();
			if target.HP/target.MaxHP*100 > 10 then
			player:checkSkills(true);
			end
end
in the <onSkillCast> section? Would that stop casting a skill and start casting a heal if it saw a party member with low health?

Re: Party Healer, but only when in combat.

Posted: Sat Jan 21, 2012 9:59 am
by lisa
lisa wrote:You might need to add a player:Loot_all type thing after calling the function as it may need it to be able to loot.

Code: Select all

<!-- # 3 --><waypoint x="4081" z="3600" y="28" >
BossFightHeal()
player:lootAll()
</waypoint>

Re: Party Healer, but only when in combat.

Posted: Sat Jan 21, 2012 11:11 am
by woah
Yep. Works nicely now, player:lootall() didnt work, but player:loot() with a target works. vvv

Code: Select all

BossFightHeal()
   yrest(4000)
   RackEmUp = player:findNearestNameOrId("Okander \"Mad Man\" Mallen")
   if RackEmUp then
   player:target(RackEmUp)
   player:loot()
   end
I could probly do without the "if/then". So I guess the simpler version would be

Code: Select all

RackEmUp = player:findNearestNameOrId("Okander \"Mad Man\" Mallen")
   player:target(RackEmUp)
   player:loot()

Re: Party Healer, but only when in combat.

Posted: Sun Feb 19, 2012 5:36 am
by woah
Is this function supposed to move closer if a party member is out of range for healing? From what I've seen, half the time it does and half the time it just does nothing.

Re: Party Healer, but only when in combat.

Posted: Sun Feb 19, 2012 7:11 am
by lisa
the function itself doesn't move at all, however the game will move you as you use skills.
So if you are casting a buff or heal on a player out of range the game will move you closer, this is unreliable movement though as a bump on the ground can stop the movement.
Why arn't your party members close together?

Re: Party Healer, but only when in combat.

Posted: Sun Feb 19, 2012 7:22 am
by woah
I'm using this in dod, I have my healer out of range of the boss aoe's and it should move in range if my main char needs a heal. I figured out why it only does this half the time -- when I run 2 clients my characters port, so the healer thinks its in range for the heal when it really isn't. Pretty easy fix though

Re: Party Healer, but only when in combat.

Posted: Thu Feb 23, 2012 5:10 am
by woah
Hmm, for some reason the healer keeps getting stuck at the waypoint with this code.

Code: Select all

<!-- #  8 --><waypoint x="2167" z="2553" y="413">
   changeProfileOption("AUTO_ELITE_FACTOR", 2500);
   BossFightHeal()
   yrest(6000)
Thats the code for the waypoint, and in the MM window it shows..
"Moving to waypoint 8, We changed the option 'AUTO_ELITE_FACTOR' from 100 to 2500"

And thats it, the character just stands there. Seems to me the only way this could happen is if it is waiting forever because it never saw that i was "battling." vvv

Code: Select all

repeat
   yrest(100)
   player:update()
   until player.Battling
I'm not too sure how to go about fixing this, because my character is in the boss room so it should definitely be in combat.. maybe adjust the code like this.. vvv

Code: Select all

repeat
   yrest(100)
   player:update()
   until player.Battling or checkparty(600) == false
Which would make it so after the fight when the main char exits the instance, the healer stops waiting no matter what. Hopefully.

Tell me what you think (: sorry about the long post lol

Re: Party Healer, but only when in combat.

Posted: Thu Feb 23, 2012 5:33 am
by rock5
If the other player is definately in range and battling, the healer should be in battling too. The only thing I can think of is you forgot to make a party or the code that makes the party might have failed.

Re: Party Healer, but only when in combat.

Posted: Thu Feb 23, 2012 12:31 pm
by woah
Hmm, well I was definitely in a party every time this happened.
That change I made doesn't work like its supposed to, so I guess ill just hope it was some weird bug. Random things happen when there's a lot of lag haha

Re: Party Healer, but only when in combat.

Posted: Sat Feb 25, 2012 11:27 am
by woah
I know this isn't the best thread to post this in, but it might be related.

I'm getting "Id not found" spammed in the MM window, and then weird things happen in the script. Here's a picture. vv
Image


All of that appeared in about 2 seconds.