Advertisement
Sarada-L2

Infinity SS Acis 398 Yo: Sarada

May 9th, 2021
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.47 KB | None | 0 0
  1. diff --git a/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShots.java b/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShots.java
  2. index 811c592..bc745a2 100644
  3. --- a/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShots.java
  4. +++ b/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShots.java
  5. @@ -46,7 +46,8 @@
  6. return;
  7.  
  8. // If the player doesn't have enough beast soulshot remaining, remove any auto soulshot task.
  9. - if (!player.destroyItemWithoutTrace(item.getObjectId(), summon.getSoulShotsPerHit()))
  10. + if (!item.getItem().isInfinity() && !player.destroyItemWithoutTrace(item.getObjectId(), summon.getSoulShotsPerHit()))
  11. +
  12. {
  13. if (!player.disableAutoShot(item.getItemId()))
  14. player.sendPacket(SystemMessageId.NOT_ENOUGH_SOULSHOTS_FOR_PET);
  15. diff --git a/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShots.java b/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShots.java
  16. index c6ebfb9..5edec8f 100644
  17. --- a/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShots.java
  18. +++ b/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShots.java
  19. @@ -48,7 +48,7 @@
  20. if (summon.isChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOT : ShotType.SPIRITSHOT))
  21. return;
  22.  
  23. - if (!player.destroyItemWithoutTrace(item.getObjectId(), summon.getSpiritShotsPerHit()))
  24. + if (!item.getItem().isInfinity() && !player.destroyItemWithoutTrace(item.getObjectId(), summon.getSpiritShotsPerHit()))
  25. {
  26. if (!player.disableAutoShot(itemId))
  27. player.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS_FOR_PET);
  28. diff --git a/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShots.java b/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShots.java
  29. index 82a2017..d5a518b 100644
  30. --- a/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShots.java
  31. +++ b/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShots.java
  32. @@ -45,7 +45,7 @@
  33. }
  34.  
  35. // Consume bss if player has enough of them
  36. - if (!player.destroyItemWithoutTrace(item.getObjectId(), weaponItem.getSpiritShotCount()))
  37. + if (!item.getItem().isInfinity() && !player.destroyItemWithoutTrace(item.getObjectId(), weaponItem.getSpiritShotCount()))
  38. {
  39. if (!player.disableAutoShot(item.getItemId()))
  40. player.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS);
  41. diff --git a/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java b/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java
  42. index c850b01..4bcb122 100644
  43. --- a/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java
  44. +++ b/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java
  45. @@ -50,7 +50,7 @@
  46. if (weaponItem.getReducedSoulShot() > 0 && Rnd.get(100) < weaponItem.getReducedSoulShotChance())
  47. ssCount = weaponItem.getReducedSoulShot();
  48.  
  49. - if (!player.destroyItemWithoutTrace(item.getObjectId(), ssCount))
  50. + if (!item.getItem().isInfinity() && !player.destroyItemWithoutTrace(item.getObjectId(), ssCount))
  51. {
  52. if (!player.disableAutoShot(item.getItemId()))
  53. player.sendPacket(SystemMessageId.NOT_ENOUGH_SOULSHOTS);
  54. diff --git a/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShots.java b/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShots.java
  55. index 9577cf5..af644ee 100644
  56. --- a/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShots.java
  57. +++ b/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShots.java
  58. @@ -44,7 +44,7 @@
  59. }
  60.  
  61. // Consume sps if player has enough of them
  62. - if (!player.destroyItemWithoutTrace(item.getObjectId(), weaponItem.getSpiritShotCount()))
  63. + if (!item.getItem().isInfinity() && !player.destroyItemWithoutTrace(item.getObjectId(), weaponItem.getSpiritShotCount()))
  64. {
  65. if (!player.disableAutoShot(item.getItemId()))
  66. player.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS);
  67. diff --git a/java/net/sf/l2j/gameserver/model/actor/attack/CreatureAttack.java b/java/net/sf/l2j/gameserver/model/actor/attack/CreatureAttack.java
  68. index ca6a4b7..3ac8afb 100644
  69. --- a/java/net/sf/l2j/gameserver/model/actor/attack/CreatureAttack.java
  70. +++ b/java/net/sf/l2j/gameserver/model/actor/attack/CreatureAttack.java
  71. @@ -333,6 +333,7 @@
  72. */
  73. private HitHolder[] doAttackHitByBow(Attack attack, Creature target, int sAtk, Weapon weapon)
  74. {
  75. + if (!weapon.isInfinity())
  76. _actor.reduceArrowCount();
  77. _actor.getStatus().reduceMp(_actor.getActiveWeaponItem().getMpConsume());
  78.  
  79. diff --git a/java/net/sf/l2j/gameserver/model/item/kind/Item.java b/java/net/sf/l2j/gameserver/model/item/kind/Item.java
  80. index ca4ba59..c2094bd 100644
  81. --- a/java/net/sf/l2j/gameserver/model/item/kind/Item.java
  82. +++ b/java/net/sf/l2j/gameserver/model/item/kind/Item.java
  83. @@ -115,7 +115,7 @@
  84. private final int _bodyPart;
  85. private final int _referencePrice;
  86. private final int _crystalCount;
  87. -
  88. + private final boolean _infinity;
  89. private final boolean _sellable;
  90. private final boolean _dropable;
  91. private final boolean _destroyable;
  92. @@ -155,13 +155,17 @@
  93.  
  94. _heroItem = (_itemId >= 6611 && _itemId <= 6621) || _itemId == 6842;
  95. _isOlyRestricted = set.getBool("is_oly_restricted", false);
  96. -
  97. + _infinity = set.getBool("is_infinity", true);
  98. _defaultAction = set.getEnum("default_action", ActionType.class, ActionType.none);
  99.  
  100. if (set.containsKey("item_skill"))
  101. _skillHolder = set.getIntIntHolderArray("item_skill");
  102. }
  103. -
  104. + public final boolean isInfinity()
  105. + {
  106. + return _infinity;
  107. + }
  108. +
  109. /**
  110. * @return Enum the itemType.
  111. */
  112.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement