[SOLVED] Manual stop of autoattack.

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
XavierElf
Posts: 92
Joined: Wed May 14, 2008 3:39 am
Location: Russia

[SOLVED] Manual stop of autoattack.

Post by XavierElf »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: 3448
L2JDP Revision Number: 6554

Hi all!
I have a little problem with blow skills. When character does blow he always does a simple hit after that, for example, the such doesn't happen for pdam skills. To explain more visually:
1) I try to make blow and immediately stop attack after that(simply click somewhere near the target). But attack doesn't stops and character do autoattack on target.
2) I try to use pdam type skill and immediately stop attack after that(simply click somewhere near the target). And i's ok. Character stops at once the further attack.

So, the question is: how to fix that? I've tried to set CtrlEvent.EVT_READY_TO_ACT immediately after skill use in onMagicFinalizer method, but it doesn't helps. Can anybody help me?

PS. Sorry for bad English... :oops:
Last edited by XavierElf on Thu Sep 03, 2009 10:41 pm, edited 1 time in total.
Sry for my bad english...
User avatar
XavierElf
Posts: 92
Joined: Wed May 14, 2008 3:39 am
Location: Russia

Re: Manual stop of autoattack.

Post by XavierElf »

Upd.
I've trying to check next intention in onMagicFinalizer method for 2 states: when i do nothing after skill (just allow character to autoattack target) and when i click somewhere near target during skil use.
Results are:
Trying PDAM type skill (Sting):
1) NextIntention: null (ok)
2) NextIntention: AI_INTENTION_MOVE_TO (ok)
Trying BLOW type skill (Lethal Blow):
1) NextIntention: null (ok)
2) NextIntention: null (not ok)

So, it seems that at use of blow skills next intention doesn't remain...
Anybody knows how to fix that?

Thanks in advance.
Sry for my bad english...
User avatar
XavierElf
Posts: 92
Joined: Wed May 14, 2008 3:39 am
Location: Russia

Re: Manual stop of autoattack.

Post by XavierElf »

Nobody faced with that problem? Or nobody knows the solution?
Sry for my bad english...
User avatar
XavierElf
Posts: 92
Joined: Wed May 14, 2008 3:39 am
Location: Russia

Re: Manual stop of autoattack.

Post by XavierElf »

It seems, I've found the solution.
File: L2Character.java, onMagicFinalizer method.

Code: Select all

 [color=#FF0000]-[/color] if (getAI().getNextIntention() == null && skill.getSkillType() == L2SkillType.PDAM                                || skill.getSkillType() == L2SkillType.BLOW                                || skill.getSkillType() == L2SkillType.DRAIN_SOUL                                || skill.getSkillType() == L2SkillType.SOW                                || skill.getSkillType() == L2SkillType.CHARGEDAM[color=#FF0000]-[/color]                               || skill.getSkillType() == L2SkillType.SPOIL)		{			if (getTarget() instanceof L2Character && getTarget() != this && target == getTarget())				getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getTarget());		} [color=#00FF00]+[/color] if (getAI().getNextIntention() == null && (skill.getSkillType() == L2SkillType.PDAM                                || skill.getSkillType() == L2SkillType.BLOW                                || skill.getSkillType() == L2SkillType.DRAIN_SOUL                                || skill.getSkillType() == L2SkillType.SOW                                || skill.getSkillType() == L2SkillType.CHARGEDAM[color=#00FF00]+[/color]                               || skill.getSkillType() == L2SkillType.SPOIL))		{			if (getTarget() instanceof L2Character && getTarget() != this && target == getTarget())				getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getTarget());		} 
Sry for my bad english...
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: [SOLVED] Manual stop of autoattack.

Post by _DS_ »

Bad solution, actually :)
We need boolean "autoAttack" for skills, not hardcode on skilltypes. Anyone can create list of skills, which should not autoattack ?
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
XavierElf
Posts: 92
Joined: Wed May 14, 2008 3:39 am
Location: Russia

Re: [SOLVED] Manual stop of autoattack.

Post by XavierElf »

I've just add missing brackets.
PS. As far as I can remember, previously it was a parameter in skill definition, that set next action. Now almost all (may be all) physical skills have next action "Attack" not depends on skill definition.
Sry for my bad english...
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: [SOLVED] Manual stop of autoattack.

Post by _DS_ »

Thanks, committed.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Re: [SOLVED] Manual stop of autoattack.

Post by momo61 »

committed in [3451]

can be moved to committed user contributions
Post Reply