Page 1 of 1

Support Healing Mercenary when hp low than what %

Posted: 07 Dec 2009, 10:56
by toro88
Version 2.1

in config

Code: Select all

mercenary_healAuto 1
mercenary_hp 70
src\AI\CoreLogic.pm



copy

Code: Select all

proccessslaveHealing(); 
and paste in under processAutoShopOpen();

Code: Select all

	processAutoEquip();
	processAutoAttack();
	processItemsTake();
	processItemsAutoGather();
	processItemsGather();
	processAutoTeleport();
	processAllowedMaps();
	processAutoResponse();
	processAvoid();
	processSendEmotion();
	processAutoShopOpen();

goto CoreLogic.pm lastline before 1;
paste this

Code: Select all

sub proccessslaveHealing {
			if ($config{mercenary_healAuto} && $char->{skills}{AL_HEAL}{lv} > 0) {
			if ($char->{mercenary}->{hpPercent} < $config{mercenary_hp}) {			
			my $target = $slavesList->get($char->{mercenary}->{'binID'});
	my $actorList = $slavesList;
	my $skill = new Skill(auto => 28, level => 10);

	require Task::UseSkill;
	my $skillTask = new Task::UseSkill(
		target => $target,
		actorList => $actorList,
		skill => $skill,
		priority => Task::USER_PRIORITY
	);
	my $task = new Task::ErrorReport(task => $skillTask);
	$taskManager->add($task);	
					}
				}		
}
	

Re: Support Healing Mercenary when hp low than what %

Posted: 07 Dec 2009, 13:20
by kLabMouse
Nice! But Some AutoVivifications may happen. And that's no good.

For Example here:

Code: Select all

$char->{skills}{AL_HEAL}{lv} > 0)
and Here:

Code: Select all

$slavesList->get($char->{mercenary}->{'binID'});
There is no validation whatever thus hash mambers exist.

Re: Support Healing Mercenary when hp low than what %

Posted: 07 Dec 2009, 17:43
by Technology
Isn't healing a merc already supported by partySkill? :?

Re: Support Healing Mercenary when hp low than what %

Posted: 28 Dec 2009, 09:17
by Technology
Can someone confirm if this is already supported trough partySkill?

Re: Support Healing Mercenary when hp low than what %

Posted: 28 Dec 2009, 09:32
by kLabMouse
Well it has to be supported suing PartySkill.
But, the auto Healing is Better. Shell we add support for this "Auto" feature?

Re: Support Healing Mercenary when hp low than what %

Posted: 28 Dec 2009, 10:44
by EternalHarvest
kLabMouse wrote:Well it has to be supported suing PartySkill.
But, the auto Healing is Better. Shell we add support for this "Auto" feature?
Then add self_healAuto, party_healAuto, etc... But why, if partySkill works?

(Also, somebody can heal mercs not via heal skill, but via merc potions.)