What mean is these code lines in "sub checkSelfCondition"

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

What mean is these code lines in "sub checkSelfCondition"

#1 Post 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"}
						);
......

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

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

#2 Post 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"}});

}
Image

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

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

#3 Post by sofax222 »

What mean is the "old equipAuto" ?

I think these code lines seems not needs ?

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

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

#4 Post by Kaspy »

I believe we can delete without causing problems
Image

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

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

#5 Post 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};
		}
	}

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

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

#6 Post 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)

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

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

#7 Post by c4c1n6kr3m1 »

once, i need to use Increase Agility from Shoes Of Valor.
and fail because of this?

Locked