r7499 - PartySkill on target_hp conditions not perfect

This place is for Closed bug reports only. NOT for asking help!

Moderators: Moderators, Developers

shadowillusion
Noob
Noob
Posts: 9
Joined: 22 Sep 2010, 19:03
Noob?: Yes

r7499 - PartySkill on target_hp conditions not perfect

#1 Post by shadowillusion »

PartySkill Highness Heal not working in r7499... The bot won't heal the party... But another skill such as Blessing, Increase agi is working... It seems Kore is unable to detect target_hp...

This is what I wrote:
partySkill Highness Heal {
lv 5
target_hp < 95%
}

But UseSelfSkill is working fine... The bot can heal itself...

Both PartySkill and UseSelfSkill is working fine in r7489... Then I download r7499, import the config folder and didn't touch anything... After this, the bot won't heal the party...

So the problem must be because of some code changes since r7489 to 7499

Btw, I play in eA server. I'm glad that since r7499 double angelus (status+ailment) bug is fixed (http://forums.openkore.com/viewtopic.php?f=56&t=11084) :)
Last edited by shadowillusion on 23 Sep 2010, 06:49, edited 1 time in total.
shadowillusion
Noob
Noob
Posts: 9
Joined: 22 Sep 2010, 19:03
Noob?: Yes

Re: r7499 - PartySkill Highness Heal not working

#2 Post by shadowillusion »

Hi. I found the problem. I look at the SVN News and found this:
Commit by kLabMouse :: r7494 /openkore/trunk/src/Misc.pm:
Fix Misc::checkPlayerCondition to support "_target <your_char_name>" too.
So I checked src/Misc.pm line 3893 (on sub checkPlayerCondition)

Code: Select all

# Target is Actor::Player in our Party
		} elsif ($char->{party} && $char->{party}{users}{$id}) {
			# Fix Heal when Target HP is not set yet.
			return 0 if (!defined($player->{hp}) || $player->{hp} == 0);
			# return 0 if ($char->{party}{users}{$id}{hp} == 0);
			if ($config{$prefix."_hp"} =~ /^(.*)\%$/) {
				return 0 if (!inRange(percent_hp($player), $1));
				# return 0 if (!inRange(percent_hp($char->{party}{users}{$id}), $1));
			} else {
				return 0 if (!inRange($player->{hp}, $config{$prefix . "_hp"}));
				# return 0 if (!inRange($char->{party}{users}{$id}{hp}, $config{$prefix . "_hp"}));
			}
It is changed like this since r7494...

I tinkering a bit with this code and the skills works again... So it's not only Highness Heal, but also any PartySkill that checks target_hp... So far I only used it to heal all my party, not other unknown player :)
User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: r7499 - PartySkill Highness Heal not working

#3 Post by kLabMouse »

shadowillusion wrote:Hi. I found the problem. I look at the SVN News and found this:
Commit by kLabMouse :: r7494 /openkore/trunk/src/Misc.pm:
Fix Misc::checkPlayerCondition to support "_target <your_char_name>" too.
So I checked src/Misc.pm line 3893 (on sub checkPlayerCondition)

It is changed like this since r7494...

I tinkering a bit with this code and the skills works again... So it's not only Highness Heal, but also any PartySkill that checks target_hp... So far I only used it to heal all my party, not other unknown player :)
well. if uncomentinf first line and comenting second one in this little patch works for you, please report.

Code: Select all

			return 0 if (!defined($player->{hp}) || $player->{hp} == 0);
			# return 0 if ($char->{party}{users}{$id}{hp} == 0);

Code: Select all

				return 0 if (!inRange(percent_hp($player), $1));
				# return 0 if (!inRange(percent_hp($char->{party}{users}{$id}), $1));

Code: Select all

				return 0 if (!inRange($player->{hp}, $config{$prefix . "_hp"}));
				# return 0 if (!inRange($char->{party}{users}{$id}{hp}, $config{$prefix . "_hp"}));
if the Coment/Uncoment works for you, we will try to somehow merge thus two options.
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: r7499 - PartySkill on target_hp conditions not perfect

#4 Post by EternalHarvest »

Hp is currently stored in Actor::Party, not in Actor::Player ($player).
shadowillusion
Noob
Noob
Posts: 9
Joined: 22 Sep 2010, 19:03
Noob?: Yes

Re: r7499 - PartySkill on target_hp conditions not perfect

#5 Post by shadowillusion »

@kLabMouse,

Yes, that's what I do anyway (commenting and uncommenting... the commented one is the old code), and it works...

Maybe it's like what EternalHarvest said (Actor::Player doesn't has hp)...

@all,
does anyone know how to tell Kore to avoid certain spells on the ground?

If I do 'Monster 1 0 1 1' in mon_control.txt it will avoid the ground spells casted by monster... But after the monster use the skill (for example Quagmire), sometimes Kore will just jump in again to Quagmire area in order to attack the monster...

I only managed something like this:

Code: Select all

useSelf_skill Teleport {
	lvl 1
	whenGround Quagmire
}
But I just want Kore to walk away from Quagmire area, not to teleport :)
User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: r7499 - PartySkill on target_hp conditions not perfect

#6 Post by kLabMouse »

Returned old code for target_hp check in r7501

As for Changeable Field, and dynamic path find. Kore is not yet able to do that, and avoid ground statuses.