This fixes Archer type monsters AI.
They'll try to increase range between themselves and the attacker now.
For reference please check this thread --> HERE
Thanks xlinkinx for the contribution and mentioning the missing archer AI behaviour.
I removed the weapon check and added a AI type check, for "lighter" code.
Now only needs approval by DnR.
They'll try to increase range between themselves and the attacker now.
For reference please check this thread --> HERE
Thanks xlinkinx for the contribution and mentioning the missing archer AI behaviour.
I removed the weapon check and added a AI type check, for "lighter" code.
Now only needs approval by DnR.
- Code:
Index: L2AttackableAI.java
===================================================================
--- L2AttackableAI.java (revision 622)
+++ L2AttackableAI.java (working copy)
@@ -1031,7 +1043,25 @@
{
range += 50;
}
+
+ // for archers
+ if( _selfAnalysis.isArcher)
+ {
+ if (Util.checkIfInRange(100, _actor, _mostHatedAnalysis.character, false) && (Rnd.get(4) > 1))
+ {
+ final int posX = _actor.getX() + ((_mostHatedAnalysis.character.getX() < _actor.getX()) ? 300 : -300);
+ final int posY = _actor.getY() + ((_mostHatedAnalysis.character.getY() < _actor.getY()) ? 300 : -300);
+ final int posZ = _actor.getZ() + 30;
+
+ if (GeoData.getInstance().canMove(_actor.getX(), _actor.getY(), _actor.getZ(), posX, posY, posZ))
+ {
+ setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(posX, posY, posZ, 0));
+ }
+ return;
+ }
+ }
+
// Check if the actor is far from target
if (dist2 > (range * range))
{
Last edited by Karakan on 12th July 2019, 15:42; edited 3 times in total