AutoAttack AI

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
streamsss
Posts: 186
Joined: Wed Jun 24, 2009 10:01 am

AutoAttack AI

Post by streamsss »

[en] When i play Turantom on server and at a spam abill charms should not attack by pressing "the camp" button for example, I press abill = it stuned and continues to attack, so should not be.
[ru] Когда я юзаю абилку, например нажимаю стан, он станит, а после продолжает атаковать. Как можно это отключить? Где это в AI?

http://www.l2jserver.com/trac/ticket/4005
streamsss
Posts: 186
Joined: Wed Jun 24, 2009 10:01 am

Re: AutoAttack AI

Post by streamsss »

up
streamsss
Posts: 186
Joined: Wed Jun 24, 2009 10:01 am

Re: AutoAttack AI

Post by streamsss »

up up
streamsss
Posts: 186
Joined: Wed Jun 24, 2009 10:01 am

Re: AutoAttack AI

Post by streamsss »

L2Character
* auto-attack after casting only if the skill was a melee skill, or the target is almost inside the attack range
* for example won't start auto-attacking automatically after a sonic attack was fired from it's cast range (500+)
L2character.java

Code: Select all

final L2Object currentTarget = L2Object.getActingCharacter(getTarget()); +L2Object newTarget = null; if (originalSkillTarget != null && originalSkillTarget != this && originalSkillTarget == currentTarget) -getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalSkillTarget); +newTarget = originalSkillTarget;  else if (originalTarget != null && originalTarget != this && originalTarget == currentTarget) -getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalTarget); +newTarget = originalTarget; 			 	if (//As far as I remember, you can move away after launching a skill without hitting			 			getAI().getIntention() != AI_INTENTION_MOVE_TO			 			//And you will not auto-attack a non-flagged player after launching a skill			 			&& newTarget != null && newTarget.isAutoAttackable(this))			 	{			 	 	double distance = Util.calculateDistance(this, newTarget, false); 			 	 	// if the skill is melee, or almost in the range of a normal attack			 	 	if (getMagicalAttackRange(skill) < 200 || getPhysicalAttackRange() + 200 > distance)			 	 	getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, newTarget);			 	}
Post Reply