Advertisement
warc222

Auto Loot Exclude Items

Oct 4th, 2015
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. gameserver/model/actor/L2Attackable.java
  2.  
  3. if (item != null)
  4. {
  5. // Check if the autoLoot mode is active
  6. if ((isRaid() && Config.AUTO_LOOT_RAID) || (!isRaid() && Config.AUTO_LOOT))
  7. + if (Arrays.binarySearch(Config.AUTO_LOOT_LIST_EXCLUDE_ITEMS, item.getId()) >= 0)
  8. + dropItem(player, item); // drop the item on the ground
  9. + else
  10. player.doAutoLoot(this, item); // Give this or these Item(s) to the L2PcInstance that has killed the L2Attackable
  11. else
  12. dropItem(player, item); // drop the item on the ground
  13.  
  14. // Broadcast message if RaidBoss was defeated
  15. if (isRaid() && !isRaidMinion())
  16. broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_DIED_DROPPED_S3_S2).addCharName(this).addItemName(item.getId()).addNumber(item.getCount()));
  17. }
  18. /////////////////////////////////////////////////////////////////////////////////////////
  19. Config.java
  20.  
  21. /** Auto-loot */
  22. public static boolean AUTO_LOOT;
  23. +public static String AUTO_LOOT_EXCLUDE_ITEMS;
  24. +public static int[] AUTO_LOOT_LIST_EXCLUDE_ITEMS;
  25. public static boolean AUTO_LOOT_HERBS;
  26. public static boolean AUTO_LOOT_RAID;
  27.  
  28.  
  29. AUTO_LOOT = server.getProperty("AutoLoot", false);
  30. +AUTO_LOOT_EXCLUDE_ITEMS = server.getProperty("AutoLootExcludeItems", "1341,1342,1343,1344,1345");
  31.  
  32. +array = AUTO_LOOT_EXCLUDE_ITEMS.split(",");
  33. +AUTO_LOOT_LIST_EXCLUDE_ITEMS = new int[array.length];
  34.  
  35. +for (int i = 0; i < array.length; i++)
  36. +AUTO_LOOT_LIST_EXCLUDE_ITEMS[i] = Integer.parseInt(array[i]);
  37.  
  38. +// sorting so binarySearch can be used later
  39. +Arrays.sort(AUTO_LOOT_LIST_EXCLUDE_ITEMS);
  40.  
  41.  
  42. /////////////////////////////////////////////////////////////////////////////////////////
  43. config/server.properties
  44.  
  45.  
  46. # Items ID Cannot Auto Picked
  47. # Arrows IDS = 1341,1342,1343,1344,1345
  48. AutoLootExcludeItems = 1341,1342,1343,1344,1345,1047,1048,1049,1050,1051,\
  49. 1052,1053,1054,1055,1056,1057,1058,1059,1095,1096,\
  50. 1097,1098,1099,1150,1151,1152,1400,1401,1402,1403,\
  51. 1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,\
  52. 1414,1415,1416,1417,1418,1512,1513,1514,1515,1516,\
  53. 1517,1667,1668,1669,1670,1671,3039,3040,3041,3042,\
  54. 3043,3044,3045,3046,3047,3048,3049,3050,3051,3052,\
  55. 3053,3054,3055,3056,3057,3058,3059,3060,3061,3062,\
  56. 3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,\
  57. 3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,\
  58. 3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,\
  59. 3093,3094,3095,3096,3097,3098,3099,3100,3101,3102,\
  60. 3429,3430,3431,3432,3941,3942,3944,4200,4201,4203,\
  61. 4206,4207,4208,4906,4907,4908,4909,4910,4911,4912,\
  62. 4913,4914,4916,4917,4918,4919,4920,4922,4923,4924,\
  63. 4928,4929,4930,4931,4932,4933,4934,4935,5809,5810,\
  64. 5811,5812,5813,5814,5815,5816,7638,7639,7640,7641,\
  65. 7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,\
  66. 7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,\
  67. 7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,\
  68. 1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,\
  69. 1528,1529,1530,1531,1532,1533,1534,1535,1536,1537,\
  70. 1856,3103,3104,3105,3106,3107,3108,3109,3110,3111,\
  71. 3112,3113,3114,3115,3116,3117,3118,4204,4205,4925,\
  72. 4926,4927,6350,6351,6395,6396,6397
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement