VANPER

Fix WaterZone

Jul 25th, 2021 (edited)
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/enums/ZoneId.java b/aCis_gameserver/java/net/sf/l2j/gameserver/enums/ZoneId.java
  2. index 412b17a..897e488 100644
  3. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/enums/ZoneId.java
  4. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/enums/ZoneId.java
  5. @@ -21,7 +21,8 @@
  6. CAST_ON_ARTIFACT(16),
  7. NO_RESTART(17),
  8. SCRIPT(18),
  9. - BOSS(19);
  10. + BOSS(19),
  11. + PAGAN (20);
  12.  
  13. private final int _id;
  14.  
  15. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  16. index edcfca7..03cedff 100644
  17. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  18. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  19. @@ -4347,6 +4347,14 @@
  20. _isIn7sDungeon = isIn7sDungeon;
  21. }
  22. index COLOQUE NO FINAL A CIMA DA CHAVE }
  23. + public boolean useTemporaryFix()
  24. + {
  25. + if (isInsideZone(ZoneId.PAGAN) || isInsideZone(ZoneId.WATER) || isInWater())
  26. + return true;
  27. +
  28. + return false;
  29. + }
  30. +
  31. /**
  32. * Update the characters table of the database with online status and lastAccess of this Player (called when login and logout).
  33. */
  34. @@ -7126,6 +7134,9 @@
  35. */
  36. public final boolean isFalling(int z)
  37. {
  38. + if (useTemporaryFix())
  39. + return false;
  40. +
  41. if (isDead() || getMove().getMoveType() != MoveType.GROUND)
  42. return false;
  43.  
  44. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/move/PlayerMove.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/move/PlayerMove.java
  45. index 36d0924..6969b46 100644
  46. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/move/PlayerMove.java
  47. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/move/PlayerMove.java
  48. @@ -293,7 +293,7 @@
  49. }
  50.  
  51. // Check if location can be reached (case of dynamic objects, such as opening doors/fences).
  52. - if (type == MoveType.GROUND && !GeoEngine.getInstance().canMoveToTarget(curX, curY, curZ, nextX, nextY, nextZ))
  53. + if (type == MoveType.GROUND && !GeoEngine.getInstance().canMoveToTarget(curX, curY, curZ, nextX, nextY, nextZ) && !_actor.useTemporaryFix()))
  54. {
  55. _blocked = true;
  56. return true;
  57. @@ -437,19 +437,13 @@
  58. // Retain some informations fur future use.
  59. final MoveType moveType = getMoveType();
  60.  
  61. - // We can process to next point without extra help ; return directly.
  62. - if (moveType != MoveType.GROUND)
  63. - {
  64. - if (GeoEngine.getInstance().canFlyToTarget(ox, oy, oz, 32, tx, ty, tz))
  65. - return null;
  66. - }
  67. - else if (GeoEngine.getInstance().canMoveToTarget(ox, oy, oz, tx, ty, tz))
  68. + if (GeoEngine.getInstance().canMoveToTarget(ox, oy, oz, tx, ty, tz))
  69. return null;
  70.  
  71. // Create dummy packet.
  72. final ExServerPrimitive dummy = _isDebugPath ? new ExServerPrimitive() : null;
  73.  
  74. - if (moveType != MoveType.GROUND)
  75. + if ((moveType != MoveType.GROUND) || _actor.useTemporaryFix())
  76. return GeoEngine.getInstance().getValidFlyLocation(ox, oy, oz, 32, tx, ty, tz, dummy);
  77.  
  78. // Calculate the path. If no path or too short, calculate the first valid location.
  79. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/WaterZone.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/WaterZone.java
  80. new file mode 100644
  81. index 0000000..0b63200
  82. --- /dev/null
  83. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/WaterZone.java
  84. @@ -0,0 +1,28 @@
  85. public class WaterZone extends ZoneType
  86. {
  87. public WaterZone(int id)
  88. {
  89. super(id);
  90. }
  91.  
  92. @Override
  93. protected void onEnter(Creature character)
  94. {
  95. character.setInsideZone(ZoneId.WATER, true);
  96. character.getMove().addMoveType(MoveType.SWIM);
  97. + character.setInsideZone(ZoneId.PAGAN, true);
  98.  
  99. }
  100.  
  101. @Override
  102. protected void onExit(Creature character)
  103. {
  104. character.setInsideZone(ZoneId.WATER, false);
  105. character.getMove().removeMoveType(MoveType.SWIM);
  106. + character.setInsideZone(ZoneId.PAGAN, false);
  107.  
  108. }
  109.  
  110. }
  111. \ No newline at end of file
  112. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java
  113. index 3677647..38ac3d3 100644
  114. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java
  115. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java
  116. @@ -51,7 +51,7 @@
  117. sendPacket(new GetOnVehicle(player.getObjectId(), _boatId, player.getBoatPosition()));
  118. }
  119. // For regular movement, send back if the desync is bigger than actual speed.
  120. - else
  121. + else if (!player.useTemporaryFix())
  122. {
  123. actualSpeed = player.getStatus().getMoveSpeed();
  124. dist = (player.getMove().getMoveType() == MoveType.GROUND) ? player.getPosition().distance2D(_x, _y) : player.getPosition().distance3D(_x, _y, _z);
  125.  
Add Comment
Please, Sign In to add comment