L2JLisvus

Would you like to react to this message? Create an account in a few clicks or log in to continue.

2 posters

    Archer AI - fix [COMMITED]

    Karakan
    Karakan


    Posts : 756
    Join date : 2013-10-04

    Archer AI - fix [COMMITED] Empty Archer AI - fix [COMMITED]

    Post  Karakan 8th July 2019, 15:54

    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

    Archer AI - fix [COMMITED] L2_20110


    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.  Cool





    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
    xlinkinx
    xlinkinx


    Posts : 244
    Join date : 2012-12-11
    Age : 32
    Location : Russian Federation

    Archer AI - fix [COMMITED] Empty Re: Archer AI - fix [COMMITED]

    Post  xlinkinx 8th July 2019, 15:56

    thanks for posting.

      Current date/time is 19th May 2024, 10:03