Axelut

Infinity SS and Arrows

May 15th, 2023
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: net.sf.l2j;Config.java
  2. ===================================================================
  3. --- net.sf.l2j;Config.java (revision 84)
  4. +++ net.sf.l2j;Config.java (working copy)
  5.  
  6. +   /** Infinity SS and Arrows */
  7. +   public static boolean INFINITY_SS;
  8. +   public static boolean INFINITY_ARROWS;
  9.  
  10. +   INFINITY_SS = player.getProperty("InfinitySS", false);
  11. +   INFINITY_ARROWS = player.getProperty("InfinityArrows", false);
  12.  
  13. Index: net.sf.l2j.gameserver.handler.itemhandlers;BeastSoulShot.java
  14. ===================================================================
  15. --- net.sf.l2j.gameserver.handler.itemhandlers;BeastSoulShot.java (revision 84)
  16. +++ net.sf.l2j.gameserver.handler.itemhandlers;BeastSoulShot.java (working copy)
  17.  
  18.     // SoulShots are already active.
  19.     if (activePet.isChargedShot(ShotType.SOULSHOT))
  20.         return;
  21.    
  22. +   // If the player doesn't have enough beast soulshot remaining, remove any auto soulshot task.
  23. +   if (!Config.INFINITY_SS && !activeOwner.destroyItemWithoutTrace("Consume", item.getObjectId(), activePet.getSoulShotsPerHit(), null, false))
  24. +   {
  25. +       if (!activeOwner.disableAutoShot(item.getItemId()))
  26. +           activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SOULSHOTS_FOR_PET);
  27. +       return;
  28. +   }
  29.  
  30. Index: net.sf.l2j.gameserver.handler.itemhandlers;BeastSpiritShot.java
  31. ===================================================================
  32. --- net.sf.l2j.gameserver.handler.itemhandlers;BeastSpiritShot.java (revision 84)
  33. +++ net.sf.l2j.gameserver.handler.itemhandlers;BeastSpiritShot.java (working copy)
  34.  
  35.     // shots are already active.
  36.     if (activePet.isChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOT : ShotType.SPIRITSHOT))
  37.         return;
  38.    
  39. +   if (!Config.INFINITY_SS && !activeOwner.destroyItemWithoutTrace("Consume", item.getObjectId(), activePet.getSpiritShotsPerHit(), null, false))
  40. +   {
  41. +       if (!activeOwner.disableAutoShot(itemId))
  42. +           activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS_FOR_PET);
  43. +       return;
  44. +   }
  45.  
  46. Index: net.sf.l2j.gameserver.handler.itemhandlers;BlessedSpiritShot.java
  47. ===================================================================
  48. --- net.sf.l2j.gameserver.handler.itemhandlers;BlessedSpiritShot.java (revision 84)
  49. +++ net.sf.l2j.gameserver.handler.itemhandlers;BlessedSpiritShot.java (working copy)
  50.  
  51.     // Check for correct grade.
  52.     if (weaponItem.getCrystalType() != item.getItem().getCrystalType())
  53.     {
  54.         if (!activeChar.getAutoSoulShot().contains(itemId))
  55.             activeChar.sendPacket(SystemMessageId.SPIRITSHOTS_GRADE_MISMATCH);
  56.        
  57.         return;
  58.     }
  59.    
  60. +   // Consume bss if player has enough of them
  61. +   if (!Config.INFINITY_SS && !activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false))
  62. +   {
  63. +       if (!activeChar.disableAutoShot(itemId))
  64. +           activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS);
  65. +      
  66. +       return;
  67. +   }
  68.  
  69. Index: net.sf.l2j.gameserver.handler.itemhandlers;SoulShots.java
  70. ===================================================================
  71. --- net.sf.l2j.gameserver.handler.itemhandlers;SoulShots.java (revision 84)
  72. +++ net.sf.l2j.gameserver.handler.itemhandlers;SoulShots.java (working copy)
  73.  
  74.     // Consume Soulshots if player has enough of them.
  75.     int ssCount = weaponItem.getSoulShotCount();
  76.     if (weaponItem.getReducedSoulShot() > 0 && Rnd.get(100) < weaponItem.getReducedSoulShotChance())
  77.         ssCount = weaponItem.getReducedSoulShot();
  78.    
  79. +   if (!Config.INFINITY_SS && !activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), ssCount, null, false))
  80. +   {
  81. +       if (!activeChar.disableAutoShot(itemId))
  82. +           activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_SOULSHOTS);
  83. +      
  84. +       return;
  85. +   }
  86.  
  87. Index: net.sf.l2j.gameserver.handler.itemhandlers;SpiritShot.java
  88. ===================================================================
  89. --- net.sf.l2j.gameserver.handler.itemhandlers;SpiritShot.java (revision 84)
  90. +++ net.sf.l2j.gameserver.handler.itemhandlers;SpiritShot.java (working copy)
  91.  
  92.     if (weaponItem.getCrystalType() != item.getItem().getCrystalType())
  93.     {
  94.         if (!activeChar.getAutoSoulShot().contains(itemId))
  95.             activeChar.sendPacket(SystemMessageId.SPIRITSHOTS_GRADE_MISMATCH);
  96.        
  97.         return;
  98.     }
  99.    
  100. +   // Consume sps if player has enough of them
  101. +   if (!Config.INFINITY_SS && !activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false))
  102. +   {
  103. +       if (!activeChar.disableAutoShot(itemId))
  104. +           activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS);
  105. +       return;
  106. +   }
  107.  
  108. Index: net.sf.l2j.gameserver.model.actor;Creature.java
  109. ===================================================================
  110. --- net.sf.l2j.gameserver.model.actor;Creature.java (revision 84)
  111. +++ net.sf.l2j.gameserver.model.actor;Creature.java (working copy)
  112.  
  113.     private boolean doAttackHitByBow(Attack attack, Creature target, int sAtk, Weapon weapon)
  114.     {
  115.         int damage1 = 0;
  116.         byte shld1 = 0;
  117.         boolean crit1 = false;
  118.        
  119.         // Calculate if hit is missed or not
  120.         boolean miss1 = Formulas.calcHitMiss(this, target);
  121.        
  122. +   // Consume arrows
  123. +   if (!Config.INFINITY_ARROWS)
  124. +   reduceArrowCount();
  125.  
  126.  
  127. Index: config/player.propertis
  128. ===================================================================
  129. --- config/player.propertis (revision 84)
  130. +++ config/player.propertis (working copy)
  131.  
  132. # Infinity SS and Arrows
  133. InfinitySS = True
  134. InfinityArrows = True
Add Comment
Please, Sign In to add comment