CostyKiller

cloak enchant fix

May 8th, 2021
871
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: dist/game/data/stats/items/28500-28599.xml
  2. ===================================================================
  3. --- dist/game/data/stats/items/28500-28599.xml  (revision 8684)
  4. +++ dist/game/data/stats/items/28500-28599.xml  (working copy)
  5. @@ -1232,7 +1252,7 @@
  6.         <set name="is_sellable" val="false" />
  7.         <set name="is_stackable" val="true" />
  8.         <set name="default_action" val="SKILL_REDUCE" />
  9. -       <set name="etcitem_type" val="BLESS_ENCHT_AM" />
  10. +       <set name="etcitem_type" val="BLESS_ENCHT_AM_DOWN" />
  11.         <set name="immediate_effect" val="true" />
  12.         <set name="handler" val="EnchantScrolls" />
  13.         <skills>
  14. @@ -1246,7 +1266,7 @@
  15.         <set name="is_sellable" val="false" />
  16.         <set name="is_stackable" val="true" />
  17.         <set name="default_action" val="SKILL_REDUCE" />
  18. -       <set name="etcitem_type" val="BLESS_ENCHT_AM" />
  19. +       <set name="etcitem_type" val="BLESS_ENCHT_AM_DOWN" />
  20.         <set name="immediate_effect" val="true" />
  21.         <set name="handler" val="EnchantScrolls" />
  22.         <skills>
  23. @@ -1260,7 +1280,7 @@
  24.         <set name="is_sellable" val="false" />
  25.         <set name="is_stackable" val="true" />
  26.         <set name="default_action" val="SKILL_REDUCE" />
  27. -       <set name="etcitem_type" val="BLESS_ENCHT_AM" />
  28. +       <set name="etcitem_type" val="BLESS_ENCHT_AM_DOWN" />
  29.         <set name="immediate_effect" val="true" />
  30.         <set name="handler" val="EnchantScrolls" />
  31.         <skills>
  32.  
  33.  
  34. Index: java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java
  35. ===================================================================
  36. --- java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java  (revision 8684)
  37. +++ java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java  (working copy)
  38. @@ -39,6 +39,7 @@
  39.         EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM,
  40.         EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP,
  41.         EtcItemType.BLESS_ENCHT_AM,
  42. +       EtcItemType.BLESS_ENCHT_AM_DOWN,
  43.         EtcItemType.BLESS_ENCHT_WP,
  44.         EtcItemType.ENCHT_AM,
  45.         EtcItemType.ENCHT_WP,
  46.  
  47.  
  48. Index: java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java
  49. ===================================================================
  50. --- java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java    (revision 8684)
  51. +++ java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java    (working copy)
  52. @@ -37,6 +37,7 @@
  53.  {
  54.     private final boolean _isWeapon;
  55.     private final boolean _isBlessed;
  56. +   private final boolean _isBlessedDown;
  57.     private final boolean _isSafe;
  58.     private final boolean _isGiant;
  59.     private final int _scrollGroupId;
  60. @@ -50,6 +51,7 @@
  61.         final ItemType type = getItem().getItemType();
  62.         _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP);
  63.         _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP);
  64. +       _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN);
  65.         _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP);
  66.         _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP);
  67.     }
  68. @@ -69,6 +71,14 @@
  69.     }
  70.    
  71.     /**
  72. +    * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise
  73. +    */
  74. +   public boolean isBlessedDown()
  75. +   {
  76. +       return _isBlessedDown;
  77. +   }
  78. +  
  79. +   /**
  80.      * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise
  81.      */
  82.     public boolean isSafe()
  83.  
  84.  
  85. Index: java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java
  86. ===================================================================
  87. --- java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java (revision 8684)
  88. +++ java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java (working copy)
  89. @@ -48,6 +48,7 @@
  90.     GIANT_ENCHT_AM,
  91.     BLESS_ENCHT_WP,
  92.     BLESS_ENCHT_AM,
  93. +   BLESS_ENCHT_AM_DOWN,
  94.     COUPON,
  95.     ELIXIR,
  96.     ENCHT_ATTR,
  97.  
  98.  
  99. Index: java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
  100. ===================================================================
  101. --- java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java (revision 8684)
  102. +++ java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
  103. @@ -312,11 +312,12 @@
  104.                             player.broadcastUserInfo();
  105.                         }
  106.                        
  107. -                       if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isDown()) || ((supportTemplate != null) && supportTemplate.isBlessed()))
  108. +                       if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isDown()) || ((supportTemplate != null) && supportTemplate.isBlessed()))
  109.                         {
  110.                             // blessed enchant - enchant value down by 1
  111. -                           if (((supportTemplate != null) && supportTemplate.isDown()))
  112. +                           if (scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isDown()))
  113.                             {
  114. +                               client.sendPacket(SystemMessageId.THE_ENCHANT_VALUE_IS_DECREASED_BY_1);
  115.                                 item.setEnchantLevel(item.getEnchantLevel() - 1);
  116.                             }
  117.                             else // blessed enchant - clear enchant value
  118.  
  119.  
  120.  
  121. Index: java/org/l2jmobius/gameserver/network/SystemMessageId.java
  122. ===================================================================
  123. --- java/org/l2jmobius/gameserver/network/SystemMessageId.java  (revision 8684)
  124. +++ java/org/l2jmobius/gameserver/network/SystemMessageId.java  (working copy)
  125. @@ -17647,6 +17647,9 @@
  126.     @ClientString(id = 13086, message = "The XP recovery fee has changed. Please try again.")
  127.     public static SystemMessageId THE_XP_RECOVERY_FEE_HAS_CHANGED_PLEASE_TRY_AGAIN;
  128.    
  129. +   @ClientString(id = 13136, message = "The enchant value is decreased by 1.")
  130. +   public static SystemMessageId THE_ENCHANT_VALUE_IS_DECREASED_BY_1;
  131. +  
  132.     @ClientString(id = 19000, message = "KR Live/Classic new numbers (13001-19000)")
  133.     public static SystemMessageId KR_LIVE_CLASSIC_NEW_NUMBERS_13001_19000_2;
  134.    
  135.  
RAW Paste Data