Guest User

dada

a guest
Aug 7th, 2010
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.23 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P Game
  3. Index: java/realtek/gameserver/network/clientpackets/RequestEnchantItem.java
  4. ===================================================================
  5. --- java/realtek/gameserver/network/clientpackets/RequestEnchantItem.java (revision 681)
  6. +++ java/realtek/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
  7. @@ -205,87 +205,177 @@
  8. SystemMessage sm;
  9. int chance = 0;
  10. int maxEnchantLevel = 0;
  11. - if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
  12. +
  13. + if (!Config.DONATOR_ENCH_RATES && !activeChar.isDonator())
  14. {
  15. - maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
  16. - for (int scrollId : ENCHANT_SCROLLS)
  17. + if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
  18. {
  19. - if (scroll.getItemId() == scrollId)
  20. + maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
  21. + for (int scrollId : ENCHANT_SCROLLS)
  22. {
  23. - chance = Config.ENCHANT_CHANCE_WEAPON;
  24. - break;
  25. + if (scroll.getItemId() == scrollId)
  26. + {
  27. + chance = Config.ENCHANT_CHANCE_WEAPON;
  28. + break;
  29. + }
  30. }
  31. - }
  32. - for (int scrollId : CRYSTAL_SCROLLS)
  33. - {
  34. - if (scroll.getItemId() == scrollId)
  35. + for (int scrollId : CRYSTAL_SCROLLS)
  36. {
  37. - chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL;
  38. - ;
  39. - break;
  40. + if (scroll.getItemId() == scrollId)
  41. + {
  42. + chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL;
  43. + ;
  44. + break;
  45. + }
  46. }
  47. - }
  48. - for (int scrollId : BLESSED_SCROLLS)
  49. - {
  50. - if (scroll.getItemId() == scrollId)
  51. + for (int scrollId : BLESSED_SCROLLS)
  52. {
  53. - chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED;
  54. - break;
  55. + if (scroll.getItemId() == scrollId)
  56. + {
  57. + chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED;
  58. + break;
  59. + }
  60. }
  61. - }
  62. - } else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
  63. - {
  64. - maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
  65. - for (int scrollId : ENCHANT_SCROLLS)
  66. + } else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
  67. {
  68. - if (scroll.getItemId() == scrollId)
  69. + maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
  70. + for (int scrollId : ENCHANT_SCROLLS)
  71. {
  72. - chance = Config.ENCHANT_CHANCE_ARMOR;
  73. - break;
  74. + if (scroll.getItemId() == scrollId)
  75. + {
  76. + chance = Config.ENCHANT_CHANCE_ARMOR;
  77. + break;
  78. + }
  79. }
  80. - }
  81. - for (int scrollId : CRYSTAL_SCROLLS)
  82. - {
  83. - if (scroll.getItemId() == scrollId)
  84. + for (int scrollId : CRYSTAL_SCROLLS)
  85. {
  86. - chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL;
  87. - break;
  88. + if (scroll.getItemId() == scrollId)
  89. + {
  90. + chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL;
  91. + break;
  92. + }
  93. }
  94. - }
  95. - for (int scrollId : BLESSED_SCROLLS)
  96. + for (int scrollId : BLESSED_SCROLLS)
  97. + {
  98. + if (scroll.getItemId() == scrollId)
  99. + {
  100. + chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED;
  101. + break;
  102. + }
  103. + }
  104. + } else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
  105. {
  106. - if (scroll.getItemId() == scrollId)
  107. + maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
  108. + for (int scrollId : ENCHANT_SCROLLS)
  109. {
  110. - chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED;
  111. - break;
  112. + if (scroll.getItemId() == scrollId)
  113. + {
  114. + chance = Config.ENCHANT_CHANCE_JEWELRY;
  115. + break;
  116. + }
  117. }
  118. + for (int scrollId : CRYSTAL_SCROLLS)
  119. + {
  120. + if (scroll.getItemId() == scrollId)
  121. + {
  122. + chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL;
  123. + break;
  124. + }
  125. + }
  126. + for (int scrollId : BLESSED_SCROLLS)
  127. + {
  128. + if (scroll.getItemId() == scrollId)
  129. + {
  130. + chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED;
  131. + break;
  132. + }
  133. + }
  134. }
  135. - } else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
  136. + }
  137. + else
  138. {
  139. - maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
  140. - for (int scrollId : ENCHANT_SCROLLS)
  141. + if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
  142. {
  143. - if (scroll.getItemId() == scrollId)
  144. + maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
  145. + for (int scrollId : ENCHANT_SCROLLS)
  146. {
  147. - chance = Config.ENCHANT_CHANCE_JEWELRY;
  148. - break;
  149. + if (scroll.getItemId() == scrollId)
  150. + {
  151. + chance = Config.ENCHANT_CHANCE_WEAPON_DONATOR;
  152. + break;
  153. + }
  154. }
  155. - }
  156. - for (int scrollId : CRYSTAL_SCROLLS)
  157. + for (int scrollId : CRYSTAL_SCROLLS)
  158. + {
  159. + if (scroll.getItemId() == scrollId)
  160. + {
  161. + chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL_DONATOR;
  162. + ;
  163. + break;
  164. + }
  165. + }
  166. + for (int scrollId : BLESSED_SCROLLS)
  167. + {
  168. + if (scroll.getItemId() == scrollId)
  169. + {
  170. + chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED_DONATOR;
  171. + break;
  172. + }
  173. + }
  174. + } else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
  175. {
  176. - if (scroll.getItemId() == scrollId)
  177. + maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
  178. + for (int scrollId : ENCHANT_SCROLLS)
  179. {
  180. - chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL;
  181. - break;
  182. + if (scroll.getItemId() == scrollId)
  183. + {
  184. + chance = Config.ENCHANT_CHANCE_ARMOR_DONATOR;
  185. + break;
  186. + }
  187. }
  188. - }
  189. - for (int scrollId : BLESSED_SCROLLS)
  190. + for (int scrollId : CRYSTAL_SCROLLS)
  191. + {
  192. + if (scroll.getItemId() == scrollId)
  193. + {
  194. + chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL_DONATOR;
  195. + break;
  196. + }
  197. + }
  198. + for (int scrollId : BLESSED_SCROLLS)
  199. + {
  200. + if (scroll.getItemId() == scrollId)
  201. + {
  202. + chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED_DONATOR;
  203. + break;
  204. + }
  205. + }
  206. + } else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
  207. {
  208. - if (scroll.getItemId() == scrollId)
  209. + maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
  210. + for (int scrollId : ENCHANT_SCROLLS)
  211. {
  212. - chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED;
  213. - break;
  214. + if (scroll.getItemId() == scrollId)
  215. + {
  216. + chance = Config.ENCHANT_CHANCE_JEWELRY_DONATOR;
  217. + break;
  218. + }
  219. }
  220. + for (int scrollId : CRYSTAL_SCROLLS)
  221. + {
  222. + if (scroll.getItemId() == scrollId)
  223. + {
  224. + chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL_DONATOR;
  225. + break;
  226. + }
  227. + }
  228. + for (int scrollId : BLESSED_SCROLLS)
  229. + {
  230. + if (scroll.getItemId() == scrollId)
  231. + {
  232. + chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED_DONATOR;
  233. + break;
  234. + }
  235. + }
  236. }
  237. }
  238.  
  239. Index: java/realtek/Config.java
  240. ===================================================================
  241. --- java/realtek/Config.java (revision 699)
  242. +++ java/realtek/Config.java (working copy)
  243. @@ -832,6 +832,16 @@
  244. public static boolean DONATOR_TITLE_COLOR_ENABLED;
  245. public static int DONATOR_NAME_COLOR;
  246. public static int DONATOR_TITLE_COLOR;
  247. + public static boolean DONATOR_ENCH_RATES;
  248. + public static int ENCHANT_CHANCE_WEAPON_DONATOR;
  249. + public static int ENCHANT_CHANCE_ARMOR_DONATOR;
  250. + public static int ENCHANT_CHANCE_JEWELRY_DONATOR;
  251. + public static int ENCHANT_CHANCE_WEAPON_CRYSTAL_DONATOR;
  252. + public static int ENCHANT_CHANCE_ARMOR_CRYSTAL_DONATOR;
  253. + public static int ENCHANT_CHANCE_JEWELRY_CRYSTAL_DONATOR;
  254. + public static int ENCHANT_CHANCE_WEAPON_BLESSED_DONATOR;
  255. + public static int ENCHANT_CHANCE_ARMOR_BLESSED_DONATOR;
  256. + public static int ENCHANT_CHANCE_JEWELRY_BLESSED_DONATOR;
  257.  
  258. /** Flood Protector */
  259. public static final FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM = new FloodProtectorConfig("UseItemFloodProtector");
  260. @@ -1929,10 +1939,20 @@
  261. Donator.load(is);
  262. is.close();
  263.  
  264. - DONATOR_NAME_COLOR_ENABLED = Boolean.parseBoolean(Donator.getProperty("DonatorNameColorEnabled", "False"));
  265. - DONATOR_TITLE_COLOR_ENABLED = Boolean.parseBoolean(Donator.getProperty("DonatorTitleColorEnabled", "False"));
  266. - DONATOR_NAME_COLOR = Integer.decode("0x" + Donator.getProperty("DonatorColorName", "00FFFF"));
  267. + DONATOR_NAME_COLOR_ENABLED = Boolean.parseBoolean(Donator.getProperty("DonatorNameColorEnabled", "False"));
  268. + DONATOR_TITLE_COLOR_ENABLED = Boolean.parseBoolean(Donator.getProperty("DonatorTitleColorEnabled", "False"));
  269. + DONATOR_NAME_COLOR = Integer.decode("0x" + Donator.getProperty("DonatorColorName", "00FFFF"));
  270. DONATOR_TITLE_COLOR = Integer.decode("0x" + Donator.getProperty("DonatorTitleColor", "00FF00"));
  271. + DONATOR_ENCH_RATES = Boolean.parseBoolean(Donator.getProperty("DonatorNameColorEnabled", "False"));
  272. + ENCHANT_CHANCE_WEAPON_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceWeaponDonator", "68"));
  273. + ENCHANT_CHANCE_ARMOR_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceArmorDonator", "52"));
  274. + ENCHANT_CHANCE_JEWELRY_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceJewelryDonator", "54"));
  275. + ENCHANT_CHANCE_WEAPON_CRYSTAL_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceWeaponCrystalDonator", "68"));
  276. + ENCHANT_CHANCE_ARMOR_CRYSTAL_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceArmorCrystalDonator", "52"));
  277. + ENCHANT_CHANCE_JEWELRY_CRYSTAL_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceJewelryCrystalDonator", "54"));
  278. + ENCHANT_CHANCE_WEAPON_BLESSED_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceWeaponBlessedDonator", "68"));
  279. + ENCHANT_CHANCE_ARMOR_BLESSED_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceArmorBlessedDonator", "52"));
  280. + ENCHANT_CHANCE_JEWELRY_BLESSED_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceJewelryBlessedDonator", "54"));
  281. }
  282. catch (Exception e)
  283. {
  284. Index: Settings/Modifications/Donator.ini
  285. ===================================================================
  286. --- Settings/Modifications/Donator.ini (revision 682)
  287. +++ Settings/Modifications/Donator.ini (working copy)
  288. @@ -27,3 +27,26 @@
  289. # Buffslots
  290. # Default: 24
  291. DonatorBuffs = 24
  292. +
  293. +
  294. +# --------------------------- #
  295. +# Donator Bonuses #
  296. +# --------------------------- #
  297. +# Modification Control
  298. +# Default: Disabled
  299. +EnableDonatorEnchRates = False
  300. +
  301. +# Chance of success to enchant an item for donator. [Normal]
  302. +EnchantChanceWeaponDonator = 68
  303. +EnchantChanceArmorDonator = 52
  304. +EnchantChanceJewelryDonator = 54
  305. +
  306. +# Chance of success to enchant an item for donator. [Crystal]
  307. +EnchantChanceWeaponCrystalDonator = 68
  308. +EnchantChanceArmorCrystalDonator = 52
  309. +EnchantChanceJewelryCrystalDonator = 54
  310. +
  311. +# Chance of success to enchant an item for donator. [Blessed]
  312. +EnchantChanceWeaponBlessedDonator = 68
  313. +EnchantChanceArmorBlessedDonator = 52
  314. +EnchantChanceJewelryBlessedDonator = 54
Advertisement
Add Comment
Please, Sign In to add comment