Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: ArmorSet.JAVA
- ================================
- /**
- * Checks if all parts of set are enchanted to +6 or more
- * @param player
- * @return
- */
- public boolean isEnchanted6(Player player)
- {
- final Inventory inv = player.getInventory();
- final ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
- if (chestItem.getEnchantLevel() < 6)
- return false;
- int legs = 0;
- int head = 0;
- int gloves = 0;
- int feet = 0;
- final ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
- if (legsItem != null && legsItem.getEnchantLevel() > 5)
- legs = legsItem.getItemId();
- if (_legs != 0 && _legs != legs)
- return false;
- final ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
- if (headItem != null && headItem.getEnchantLevel() > 5)
- head = headItem.getItemId();
- if (_head != 0 && _head != head)
- return false;
- final ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
- if (glovesItem != null && glovesItem.getEnchantLevel() > 5)
- gloves = glovesItem.getItemId();
- if (_gloves != 0 && _gloves != gloves)
- return false;
- final ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
- if (feetItem != null && feetItem.getEnchantLevel() > 5)
- feet = feetItem.getItemId();
- if (_feet != 0 && _feet != feet)
- return false;
- return true;
- }
- + /**
- + * Checks if all parts of set are enchanted to +16 or more
- + * {@docRoot} BAN - L2JDev
- + * @param player
- + * @return
- + */
- + public boolean isEnchanted16(Player player)
- + {
- + // Player don't have full set
- + if(!containAll(player))
- + return false;
- +
- + Inventory inv = player.getInventory();
- +
- + ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
- + ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
- + ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
- + ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
- + ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
- +
- + if(chestItem.getEnchantLevel() < 16)
- + return false;
- + if(_legs != 0 && legsItem.getEnchantLevel() < 16)
- + return false;
- + if(_gloves != 0 && glovesItem.getEnchantLevel() < 16)
- + return false;
- + if(_head != 0 && headItem.getEnchantLevel() < 16)
- + return false;
- + if(_feet != 0 && feetItem.getEnchantLevel() < 16)
- + return false;
- +
- + return true;
- + }
- ================================================================
- Index: ArmorSetListener.JAVA
- ================================================================
- @Override
- public void onEquip(int slot, ItemInstance item, L2Playable actor)
- { if (armorSet.isEnchanted6(player)) // has all parts of set enchanted to 6 or more
- {
- int skillId = armorSet.getEnchant6skillId();
- if (skillId > 0)
- {
- L2Skill skille = SkillTable.getInstance().getInfo(skillId, 1);
- if (skille != null)
- {
- player.addSkill(skille, false);
- player.sendSkillList();
- }
- }
- }
- + if (armorSet.isEnchanted16(player))
- + {
- + player.startAbnormalEffect(AbnormalEffect.FLAME);
- + }
- @Override
- public void onUnequip(int slot, ItemInstance item, L2Playable actor)
- {
- if (removeSkillId4 != 0)
- {
- L2Skill skill = SkillTable.getInstance().getInfo(removeSkillId4, 1);
- if (skill != null)
- player.removeSkill(skill);
- }
- + player.stopAbnormalEffect(AbnormalEffect.FLAME);
- player.sendSkillList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement