LK_TENSIONRELAX in sitAuto

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

Message
Author
blue_crim
Noob
Noob
Posts: 12
Joined: 18 Sep 2012, 09:49
Noob?: Yes

LK_TENSIONRELAX in sitAuto

#1 Post by blue_crim »

Hi guys

I am having trouble configuring openkore to use tension relax onAction sitAuto in useSelf_skill, so I figured why not incorp it in AI::CoreLogic :lol:

have fun :lol:

Code: Select all

Index: CoreLogic.pm
===================================================================
--- CoreLogic.pm	(revision 8224)
+++ CoreLogic.pm	(working copy)
@@ -2221,6 +2221,13 @@
 	# Sit if we're not already sitting
 	if ($action eq "sitAuto" && !$char->{sitting} && $char->{skills}{NV_BASIC}{lv} >= 3 &&
 	    !ai_getAggressives() && ($weight < 50 || $config{'sitAuto_over_50'})) {
+		if ($config{'sitAuto_tension_relax'} && defined binFind(\@skillsID, 'LK_TENSIONRELAX')) {
+			my $skill = new Skill(auto => 'LK_TENSIONRELAX');
+			if ($char->getSkillLevel($skill) && !$char->statusActive('LK_TENSIONRELAX') && $char->{sp} >= $skill->getSP(1)) {
+				$messageSender->sendSkillUse($skill->getIDN, 1, $char->{ID});
+				return;
+			}
+		} 
 		debug "sitAuto - sit\n", "sitAuto";
 		sit();