Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- L2AttackableAi.java
- ----------------------------------------
- if (hated.isMoving())
- {
- - range -= 100;
- - }
- - if (range < 5)
- - range = 5;
- range -= 30;
- }
- + if (!GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), attackTarget.getX(), attackTarget.getY(), attackTarget.getZ()))
- + moveTo(attackTarget.getX(), attackTarget.getY(), attackTarget.getZ());
- + else
- + moveToPawn(attackTarget, Math.max(range, 5));
- - moveToPawn(attackTarget, range);
- return;
- }
- ---------------------------------
- L2Character.java
- ---------------------------------
- newMd.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, this instanceof L2Playable);
- if (newMd.geoPath == null || newMd.geoPath.size() < 2)
- {
- - // No path found
- - // Even though there's no path found (remember geonodes aren't perfect), the mob is attacking and right now we set it so that the mob will go after target anyway, is dz is small enough.
- - // With cellpathfinding this approach could be changed but would require taking off the geonodes and some more checks.
- - // Summons will follow their masters no matter what.
- - // Currently minions also must move freely since L2AttackableAI commands them to move along with their leader
- - if (this instanceof L2PcInstance || (!(this instanceof L2Playable) && !isMinion() && Math.abs(z - curZ) > 140) || (this instanceof L2Summon && !((L2Summon) this).getFollowStatus()))
- - return;
- -
- - newMd.disregardingGeodata = true;
- - x = originalX;
- - y = originalY;
- - z = originalZ;
- - distance = originalDistance;
- + if (!GeoEngine.getInstance().canMoveToTarget(curX, curY, curZ, x, y, z))
- + {
- + Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z);
- + x = destiny.getX();
- + y = destiny.getY();
- + z = destiny.getZ();
- + }
- }
- else
- {
- @@ -3499,6 +3493,13 @@
- }
- }
- }
- + else if (!GeoEngine.getInstance().canMoveToTarget(curX, curY, curZ, x, y, z))
- + {
- + Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z);
- + x = destiny.getX();
- + y = destiny.getY();
- + z = destiny.getZ();
- + }
- ------------------------------------------------------
- AbstractAI.java
- ------------------------------------------------------
- - if (!_actor.isInsideRadius(follow, _range, true, false))
- - {
- - moveToPawn(follow, _range);
- - }
- + if (!_actor.isInsideRadius(follow, _range, true, false))
- + {
- + if(GeoEngine.getInstance().canMoveFromToTarget(_actor.getX(), _actor.getY(), _actor.getZ(),follow.getX(), follow.getY(), follow.getZ()))
- + moveToPawn(follow, _range);
- + else
- + moveTo(follow.getX(), follow.getY(), follow.getZ());
- + }
Advertisement
Add Comment
Please, Sign In to add comment