Page 1 of 1

What mean is these code lines in "sub checkSelfCondition"

Posted: 28 Mar 2013, 20:47
by sofax222
Any one could tell me !
What mean is these code lines in "sub checkSelfCondition" of Misc.pm

Code: Select all

........
		my $skill = Skill->new(auto => $config{$prefix});
		return 0 unless ($char->getSkillLevel($skill)
						|| $config{$prefix."_equip_leftAccessory"}
						|| $config{$prefix."_equip_rightAccessory"}
						|| $config{$prefix."_equip_leftHand"}
						|| $config{$prefix."_equip_rightHand"}
						|| $config{$prefix."_equip_robe"}
						);
......

Re: What mean is these code lines in "sub checkSelfCondition"

Posted: 28 Mar 2013, 22:09
by Kaspy
Been implemented in r2940

Code: Select all

Revision: 2940
Author: damokles
Date: domingo, 17 de julho de 2005 11:25:58
Message:
Added Skill check, If you want to use the old equipAuto simply add
'equip_leftAccessory X' to your config

----
Modified : /trunk/openkore/src/Misc.pm
Before:
if ($prefix =~ /skill/i) {
return 0 unless ($char->{sp} >= $skillsSP_lut{$skills_rlut{lc($config{$prefix})}}{$config{$prefix . "_lvl"}})
}
After
if ($prefix =~ /skill/i) {
my $skill_handle = $skills_rlut{lc($config{$prefix})};
return 0 unless (($char->{skills}{$skill_handle} && $char->{skills}{$skill_handle}{lv} >= 1)
|| ($char->{permitSkill} && $char->{permitSkill}->name eq $config{$prefix})
|| $config{$prefix."_equip_leftAccessory"}
|| $config{$prefix."_equip_rightAccessory"}
|| $config{$prefix."_equip_leftHand"}
|| $config{$prefix."_equip_rightHand"}
|| $config{$prefix."_equip_robe"}
);
return 0 unless ($char->{sp} >= $skillsSP_lut{$skill_handle}{$config{$prefix . "_lvl"}});

}

Re: What mean is these code lines in "sub checkSelfCondition"

Posted: 29 Mar 2013, 03:19
by sofax222
What mean is the "old equipAuto" ?

I think these code lines seems not needs ?

Re: What mean is these code lines in "sub checkSelfCondition"

Posted: 29 Mar 2013, 13:22
by Kaspy
I believe we can delete without causing problems

Re: What mean is these code lines in "sub checkSelfCondition"

Posted: 30 Mar 2013, 08:28
by sofax222
Could I modify them to keep the "equip_?????"'s config paramemters.
Let them seem like the "whenEquipped" config paramemters.
Such as:

Code: Select all

	for my $slot (@Actor::Item::slots) {
		if ($config{$prefix."_equip_".$slot}) {
			my $item = Actor::Item::get($config{$prefix."_equip_".$slot});
			return 0 unless $item && $item->{equipped};
		}
	}

Re: What mean is these code lines in "sub checkSelfCondition"

Posted: 07 May 2013, 10:09
by EternalHarvest
That's a check if you have specified skill at all (it allows to ignore blocks with skills you don't currently have). Some skills are available via equipping something, so if a block has instructions to equip something in order to cast a skill, this check would be skipped. (http://forums.openkore.com/viewtopic.ph ... 51#p100051)

Re: What mean is these code lines in "sub checkSelfCondition"

Posted: 04 Jun 2013, 01:09
by c4c1n6kr3m1
once, i need to use Increase Agility from Shoes Of Valor.
and fail because of this?