Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ItemModify[] generateItemModify(Item[] items, Item[] cosmetics) {
- ItemModify[] modify = new ItemModify[15];
- for (int slotId = 0; slotId < modify.length; slotId++) {
- int id = items[slotId] == null ? -1 : items[slotId].getId();
- if (id == 32152 || id == 32153 || id == 20768 || id == 20770 || id == 20772 || id == 20767 || id == 20769
- || id == 20771)
- setItemModifyColor(items[slotId], slotId, modify, id == 32151 || id == 20768 || id == 20767
- ? player.getMaxedCapeCustomized() : player.getCompletionistCapeCustomized());
- else if (id == 20708 || id == 20709) {
- ClansManager manager = player.getClanManager();
- if (manager == null)
- continue;
- int[] colors = manager.getClan().getMottifColors();
- setItemModifyColor(items[slotId], slotId, modify, colors);
- setItemModifyTexture(items[slotId], slotId, modify,
- new short[] { (short) ClansManager.getMottifTexture(manager.getClan().getMottifTop()),
- (short) ClansManager.getMottifTexture(manager.getClan().getMottifBottom()) });
- } else if (player.getAuraManager().isActivated() && slotId == Equipment.SLOT_AURA) {
- int auraId = player.getEquipment().getAuraId();
- if (auraId == -1)
- continue;
- int modelId = player.getAuraManager().getAuraModelId();
- int modelId2 = player.getAuraManager().getAuraModelId2();
- setItemModifyModel(items[slotId], slotId, modify, modelId, modelId, modelId2, modelId2, -1, -1);
- }
- }
- return modify;
- }
- private void setItemModifyModel(Item item, int slotId, ItemModify[] modify, int maleModelId1, int femaleModelId1,
- int maleModelId2, int femaleModelId2, int maleModelId3, int femaleModelId3) {
- ItemDefinitions defs = item.getDefinitions();
- if (defs.getMaleWornModelId1() == -1 || defs.getFemaleWornModelId1() == -1)
- return;
- if (modify[slotId] == null)
- modify[slotId] = new ItemModify();
- modify[slotId].maleModelId1 = maleModelId1;
- modify[slotId].femaleModelId1 = femaleModelId1;
- if (defs.getMaleWornModelId2() != -1 || defs.getFemaleWornModelId2() != -1) {
- modify[slotId].maleModelId2 = maleModelId2;
- modify[slotId].femaleModelId2 = femaleModelId2;
- }
- if (defs.getMaleWornModelId3() != -1 || defs.getFemaleWornModelId3() != -1) {
- modify[slotId].maleModelId2 = maleModelId3;
- modify[slotId].femaleModelId2 = femaleModelId3;
- }
- }
- private void setItemModifyTexture(Item item, int slotId, ItemModify[] modify, short[] textures) {
- ItemDefinitions defs = item.getDefinitions();
- if (defs.originalTextureColors == null || defs.originalTextureColors.length != textures.length)
- return;
- if (Arrays.equals(textures, defs.originalTextureColors))
- return;
- if (modify[slotId] == null)
- modify[slotId] = new ItemModify();
- modify[slotId].textures = textures;
- }
- private void setItemModifyColor(Item item, int slotId, ItemModify[] modify, int[] colors) {
- ItemDefinitions defs = item.getDefinitions();
- if (defs.originalModelColors == null || defs.originalModelColors.length != colors.length)
- return;
- if (Arrays.equals(colors, defs.originalModelColors))
- return;
- if (modify[slotId] == null)
- modify[slotId] = new ItemModify();
- modify[slotId].colors = colors;
- }
- private static class ItemModify {
- private int[] colors;
- private short[] textures;
- private int maleModelId1;
- private int femaleModelId1;
- private int maleModelId2;
- private int femaleModelId2;
- private int maleModelId3;
- private int femaleModelId3;
- private ItemModify() {
- maleModelId1 = femaleModelId1 = -1;
- maleModelId2 = femaleModelId2 = -2;
- maleModelId3 = femaleModelId3 = -2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment