Advertisement
Guest User

Custom Blessed & Crystal Enchant System

a guest
Apr 17th, 2010
2,631
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 10.47 KB | None | 0 0
  1. Index: D:/WorkSpace/Lineage 2/Development/Workspace/GameServer/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
  2. ===================================================================
  3. --- D:/WorkSpace/Lineage 2/Development/Workspace/GameServer/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (revision 318)
  4. +++ D:/WorkSpace/Lineage 2/Development/Workspace/GameServer/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (working copy)
  5. @@ -201,6 +201,185 @@
  6.         SystemMessage sm;
  7.         int chance = 0;
  8.         int maxEnchantLevel = 0;
  9. +      
  10. +       if (Config.ENCHANT_SCROLL_CRYSTAL_SYSTEM)
  11. +       {
  12. +           if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
  13. +           {
  14. +               maxEnchantLevel = Config.ENCHANT_MAX_WEAPON_CRYSTAL;
  15. +               for (int scrollId : ENCHANT_SCROLLS)
  16. +               {
  17. +                   if (scroll.getItemId() == scrollId)
  18. +                   {
  19. +                       chance = Config.ENCHANT_CHANCE_WEAPON;
  20. +                       break;
  21. +                   }
  22. +               }
  23. +               for (int scrollId : CRYSTAL_SCROLLS)
  24. +               {
  25. +                   if (scroll.getItemId() == scrollId)
  26. +                   {
  27. +                       chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL;
  28. +                       ;
  29. +                       break;
  30. +                   }
  31. +               }
  32. +               for (int scrollId : BLESSED_SCROLLS)
  33. +               {
  34. +                   if (scroll.getItemId() == scrollId)
  35. +                   {
  36. +                       chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED;
  37. +                       break;
  38. +                   }
  39. +               }
  40. +           }
  41. +           else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
  42. +           {
  43. +               maxEnchantLevel = Config.ENCHANT_MAX_ARMOR_CRYSTAL;
  44. +               for (int scrollId : ENCHANT_SCROLLS)
  45. +               {
  46. +                   if (scroll.getItemId() == scrollId)
  47. +                   {
  48. +                       chance = Config.ENCHANT_CHANCE_ARMOR;
  49. +                       break;
  50. +                   }
  51. +               }
  52. +               for (int scrollId : CRYSTAL_SCROLLS)
  53. +               {
  54. +                   if (scroll.getItemId() == scrollId)
  55. +                   {
  56. +                       chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL;
  57. +                       break;
  58. +                   }
  59. +               }
  60. +               for (int scrollId : BLESSED_SCROLLS)
  61. +               {
  62. +                   if (scroll.getItemId() == scrollId)
  63. +                   {
  64. +                       chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED;
  65. +                       break;
  66. +                   }
  67. +               }
  68. +           }
  69. +           else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
  70. +           {
  71. +               maxEnchantLevel = Config.ENCHANT_MAX_JЕWELRY_CRYSTAL;
  72. +               for (int scrollId : ENCHANT_SCROLLS)
  73. +               {
  74. +                   if (scroll.getItemId() == scrollId)
  75. +                   {
  76. +                       chance = Config.ENCHANT_CHANCE_JEWELRY;
  77. +                       break;
  78. +                   }
  79. +               }
  80. +               for (int scrollId : CRYSTAL_SCROLLS)
  81. +               {
  82. +                   if (scroll.getItemId() == scrollId)
  83. +                   {
  84. +                       chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL;
  85. +                       break;
  86. +                   }
  87. +               }
  88. +               for (int scrollId : BLESSED_SCROLLS)
  89. +               {
  90. +                   if (scroll.getItemId() == scrollId)
  91. +                   {
  92. +                       chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED;
  93. +                       break;
  94. +                   }
  95. +               }
  96. +           }
  97. +       }
  98. +      
  99. +       if (Config.ENCHANT_SCROLL_BLESSED_SYSTEM)
  100. +       {
  101. +           if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
  102. +           {
  103. +               maxEnchantLevel = Config.ENCHANT_MAX_WEAPON_BLESSED;
  104. +               for (int scrollId : ENCHANT_SCROLLS)
  105. +               {
  106. +                   if (scroll.getItemId() == scrollId)
  107. +                   {
  108. +                       chance = Config.ENCHANT_CHANCE_WEAPON;
  109. +                       break;
  110. +                   }
  111. +               }
  112. +               for (int scrollId : CRYSTAL_SCROLLS)
  113. +               {
  114. +                   if (scroll.getItemId() == scrollId)
  115. +                   {
  116. +                       chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL;
  117. +                       ;
  118. +                       break;
  119. +                   }
  120. +               }
  121. +               for (int scrollId : BLESSED_SCROLLS)
  122. +               {
  123. +                   if (scroll.getItemId() == scrollId)
  124. +                   {
  125. +                       chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED;
  126. +                       break;
  127. +                   }
  128. +               }
  129. +           }
  130. +           else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
  131. +           {
  132. +               maxEnchantLevel = Config.ENCHANT_MAX_ARMOR_BLESSED;
  133. +               for (int scrollId : ENCHANT_SCROLLS)
  134. +               {
  135. +                   if (scroll.getItemId() == scrollId)
  136. +                   {
  137. +                       chance = Config.ENCHANT_CHANCE_ARMOR;
  138. +                       break;
  139. +                   }
  140. +               }
  141. +               for (int scrollId : CRYSTAL_SCROLLS)
  142. +               {
  143. +                   if (scroll.getItemId() == scrollId)
  144. +                   {
  145. +                       chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL;
  146. +                       break;
  147. +                   }
  148. +               }
  149. +               for (int scrollId : BLESSED_SCROLLS)
  150. +               {
  151. +                   if (scroll.getItemId() == scrollId)
  152. +                   {
  153. +                       chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED;
  154. +                       break;
  155. +                   }
  156. +               }
  157. +           }
  158. +           else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
  159. +           {
  160. +               maxEnchantLevel = Config.ENCHANT_MAX_JЕWELRY_BLESSED;
  161. +               for (int scrollId : ENCHANT_SCROLLS)
  162. +               {
  163. +                   if (scroll.getItemId() == scrollId)
  164. +                   {
  165. +                       chance = Config.ENCHANT_CHANCE_JEWELRY;
  166. +                       break;
  167. +                   }
  168. +               }
  169. +               for (int scrollId : CRYSTAL_SCROLLS)
  170. +               {
  171. +                   if (scroll.getItemId() == scrollId)
  172. +                   {
  173. +                       chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL;
  174. +                       break;
  175. +                   }
  176. +               }
  177. +               for (int scrollId : BLESSED_SCROLLS)
  178. +               {
  179. +                   if (scroll.getItemId() == scrollId)
  180. +                   {
  181. +                       chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED;
  182. +                       break;
  183. +                   }
  184. +               }
  185. +           }
  186. +       }
  187. +      
  188.         if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
  189.         {
  190.             maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
  191. Index: D:/WorkSpace/Lineage 2/Development/Workspace/GameServer/java/net/sf/l2j/Config.java
  192. ===================================================================
  193. --- D:/WorkSpace/Lineage 2/Development/Workspace/GameServer/java/net/sf/l2j/Config.java (revision 316)
  194. +++ D:/WorkSpace/Lineage 2/Development/Workspace/GameServer/java/net/sf/l2j/Config.java (working copy)
  195. @@ -309,6 +309,14 @@
  196.      public static boolean   JAIL_IS_PVP;
  197.      public static boolean   JAIL_DISABLE_CHAT;
  198.      public static boolean   JAIL_SET_PARA;
  199. +    public static boolean   ENCHANT_SCROLL_CRYSTAL_SYSTEM;
  200. +    public static int       ENCHANT_MAX_WEAPON_CRYSTAL;
  201. +    public static int       ENCHANT_MAX_ARMOR_CRYSTAL;
  202. +    public static int       ENCHANT_MAX_JЕWELRY_CRYSTAL;
  203. +    public static boolean   ENCHANT_SCROLL_BLESSED_SYSTEM;
  204. +    public static int       ENCHANT_MAX_WEAPON_BLESSED;
  205. +    public static int       ENCHANT_MAX_ARMOR_BLESSED;
  206. +    public static int       ENCHANT_MAX_JЕWELRY_BLESSED;
  207.      
  208.      /** Modification Settings Parameters */
  209.      public static boolean   CUSTOM_START_LEVEL;
  210. @@ -1364,6 +1372,14 @@
  211.                  ENCHANT_MAX_WEAPON                  = Integer.parseInt(Other.getProperty("EnchantMaxWeapon", "255"));
  212.                  ENCHANT_MAX_ARMOR                   = Integer.parseInt(Other.getProperty("EnchantMaxArmor", "255"));
  213.                  ENCHANT_MAX_JEWELRY                 = Integer.parseInt(Other.getProperty("EnchantMaxJewelry", "255"));
  214. +                ENCHANT_SCROLL_CRYSTAL_SYSTEM       = Boolean.parseBoolean(Other.getProperty("EnchantCrystalCustom", "False"));
  215. +                ENCHANT_MAX_JЕWELRY_CRYSTAL         = Integer.parseInt(Other.getProperty("EnchantMaxJewelryCrystal", "255"));
  216. +                ENCHANT_MAX_ARMOR_CRYSTAL           = Integer.parseInt(Other.getProperty("EnchantMaxArmorCrystal", "255"));
  217. +                ENCHANT_MAX_WEAPON_CRYSTAL          = Integer.parseInt(Other.getProperty("EnchantMaxWeaponCrystal", "255"));
  218. +                ENCHANT_SCROLL_BLESSED_SYSTEM       = Boolean.parseBoolean(Other.getProperty("EnchantBlessedCustom", "False"));
  219. +                ENCHANT_MAX_JЕWELRY_BLESSED         = Integer.parseInt(Other.getProperty("EnchantMaxJewelryBlessed", "255"));
  220. +                ENCHANT_MAX_ARMOR_BLESSED           = Integer.parseInt(Other.getProperty("EnchantMaxArmorBlessed", "255"));
  221. +                ENCHANT_MAX_WEAPON_BLESSED          = Integer.parseInt(Other.getProperty("EnchantMaxWeaponBlessed", "255"));
  222.                  ENCHANT_SAFE_MAX                    = Integer.parseInt(Other.getProperty("EnchantSafeMax", "3"));
  223.                  ENCHANT_SAFE_MAX_FULL               = Integer.parseInt(Other.getProperty("EnchantSafeMaxFull", "4"));
  224.                  HP_REGEN_MULTIPLIER                 = Double.parseDouble(Other.getProperty("HpRegenMultiplier", "100")) /100;
  225. @@ -2363,6 +2379,12 @@
  226.          else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
  227.          else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
  228.          else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
  229. +        else if (pName.equalsIgnoreCase("EnchantMaxJewelryCrystal")) ENCHANT_MAX_JЕWELRY_CRYSTAL = Integer.parseInt(pValue);
  230. +        else if (pName.equalsIgnoreCase("EnchantMaxArmorCrystal")) ENCHANT_MAX_ARMOR_CRYSTAL = Integer.parseInt(pValue);
  231. +        else if (pName.equalsIgnoreCase("EnchantMaxWeaponCrystal")) ENCHANT_MAX_WEAPON_CRYSTAL = Integer.parseInt(pValue);
  232. +        else if (pName.equalsIgnoreCase("EnchantMaxJewelryBlessed")) ENCHANT_MAX_JЕWELRY_BLESSED = Integer.parseInt(pValue);
  233. +        else if (pName.equalsIgnoreCase("EnchantMaxArmorBlessed")) ENCHANT_MAX_ARMOR_BLESSED = Integer.parseInt(pValue);
  234. +        else if (pName.equalsIgnoreCase("EnchantMaxWeaponBlessed")) ENCHANT_MAX_WEAPON_BLESSED = Integer.parseInt(pValue);
  235.          else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
  236.          else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
  237.          else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
  238. Index: D:/WorkSpace/Lineage 2/Development/Workspace/GameServer/Settings/General/Other.properties
  239. ===================================================================
  240. --- D:/WorkSpace/Lineage 2/Development/Workspace/GameServer/Settings/General/Other.properties   (revision 316)
  241. +++ D:/WorkSpace/Lineage 2/Development/Workspace/GameServer/Settings/General/Other.properties   (working copy)
  242. @@ -58,11 +58,29 @@
  243.  EnchantChanceArmorBlessed = 52
  244.  EnchantChanceJewelryBlessed = 54
  245.  
  246. -# Enchant limit [default = 0 (unlimited)]
  247. +# Enchant limit [Default = 0 (unlimited)] [Normal Scrolls]
  248.  EnchantMaxWeapon = 0
  249.  EnchantMaxArmor = 0
  250.  EnchantMaxJewelry = 0
  251.  
  252. +# Custom Crystal Scroll System
  253. +# Default: False
  254. +EnchantCrystalCustom = False
  255. +
  256. +# Enchant limit [Crystal Scrolls]
  257. +EnchantMaxWeaponCrystal = 0
  258. +EnchantMaxArmorCrystal = 0
  259. +EnchantMaxJewelryCrystal = 0
  260. +
  261. +# Custom Blessed Scroll System
  262. +# Default: False
  263. +EnchantBlessedCustom = False
  264. +
  265. +# Enchant limit [Blessed Scrolls]
  266. +EnchantMaxWeaponBlessed = 0
  267. +EnchantMaxArmorBlessed = 0
  268. +EnchantMaxJewelryBlessed = 0
  269. +
  270.  # If EnchantSafeMax is set to for ex '8' the item will be safly enchanted to '8'
  271.  # regardless of enchant chance(default = 3 for EnchantSafeMax and default = 4 for EnchantSafeMaxFull)
  272.  # EnchantSafeMaxFull is for full body armor (upper and lower)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement