L2JLisvus

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

2 posters

    Geodata check for "randomwalk" [NOT MERGED]

    Karakan
    Karakan


    Posts : 756
    Join date : 2013-10-04

    Geodata check for "randomwalk" [NOT MERGED] Empty Geodata check for "randomwalk" [NOT MERGED]

    Post  Karakan 16th May 2020, 00:04

    Prevents random walking monster to run into walls.

    Tested at Cruma Tower ,with driftrange=500, for 30mins.
    Haven't seen a stuck mob so far.



    Code:

        Index: L2AttackableAI.java
        ===================================================================
        --- L2AttackableAI.java   (revision 724)
        +++ L2AttackableAI.java   (working copy)
        @@ -714,7 +723,11 @@
                  }
                  
                  // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
        -         moveTo(x1, y1, z1);
        +         //moveTo(x1, y1, z1);
        +         if (GeoData.getInstance().canMove(_actor.getX(), _actor.getY(), _actor.getZ(), x1, y1, z1))
        +         {
        +            moveTo(x1, y1, z1);
        +         }
               }
            }


    Last edited by Karakan on 16th May 2020, 02:44; edited 1 time in total
    DnR
    DnR
    Admin
    Admin


    Posts : 1475
    Join date : 2012-12-03
    Age : 34

    Geodata check for "randomwalk" [NOT MERGED] Empty Re: Geodata check for "randomwalk" [NOT MERGED]

    Post  DnR 16th May 2020, 02:10

    Karakan wrote:
    Prevents scared mobs from running into walls/up hills and getting stuck.


    Code:

    Index: EffectFear.java
    ===================================================================
    --- EffectFear.java (revision 724)
    +++ EffectFear.java (working copy)
    @@ -97,10 +97,14 @@
     
             Location dest = GeoData.getInstance().moveCheck(getEffected().getX(), getEffected().getY(), getEffected().getZ(), posX, posY, posZ);
     
    -        if (!(getEffected() instanceof L2PetInstance))
    -            getEffected().setRunning();
    + if (GeoData.getInstance().canMove(getEffected().getX(), getEffected().getY(), getEffected().getZ(), posX, posY, posZ))
    + {
    + if (!(getEffected() instanceof L2PetInstance))
    + getEffected().setRunning();
     
    -        getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, dest);
    -        return true;
    + getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, dest);
    + }
    +
    + return true;
         }
     }
    \ No newline at end of file


    This one doesn't make much sense, because there is already a geo check in this file.
    GeoData.getInstance().moveCheck makes sure that character won't run through walls or any other kind of textures.
    Did you notice any difference?
    Karakan
    Karakan


    Posts : 756
    Join date : 2013-10-04

    Geodata check for "randomwalk" [NOT MERGED] Empty Re: Geodata check for "randomwalk" [NOT MERGED]

    Post  Karakan 16th May 2020, 02:43

    You are right......I'll remove the code.
    My bad, i tested it on another location with the code above.



    GeoData.getInstance().moveCheck makes sure that character won't run through walls or any other kind of textures.

    VoS mobs still run up the hills and disappear.
    My intend was to fix that....

    https://i.imgur.com/rdl659s.jpg



    Sponsored content


    Geodata check for "randomwalk" [NOT MERGED] Empty Re: Geodata check for "randomwalk" [NOT MERGED]

    Post  Sponsored content


      Current date/time is 19th May 2024, 08:07