SHOW:
|
|
- or go back to the newest paste.
1 | Index: ArmorSet.JAVA | |
2 | ================================ | |
3 | ||
4 | /** | |
5 | * Checks if all parts of set are enchanted to +6 or more | |
6 | * @param player | |
7 | * @return | |
8 | */ | |
9 | public boolean isEnchanted6(Player player) | |
10 | { | |
11 | final Inventory inv = player.getInventory(); | |
12 | ||
13 | final ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST); | |
14 | if (chestItem.getEnchantLevel() < 6) | |
15 | return false; | |
16 | ||
17 | int legs = 0; | |
18 | int head = 0; | |
19 | int gloves = 0; | |
20 | int feet = 0; | |
21 | ||
22 | final ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS); | |
23 | if (legsItem != null && legsItem.getEnchantLevel() > 5) | |
24 | legs = legsItem.getItemId(); | |
25 | ||
26 | if (_legs != 0 && _legs != legs) | |
27 | return false; | |
28 | ||
29 | final ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD); | |
30 | if (headItem != null && headItem.getEnchantLevel() > 5) | |
31 | head = headItem.getItemId(); | |
32 | ||
33 | if (_head != 0 && _head != head) | |
34 | return false; | |
35 | ||
36 | final ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES); | |
37 | if (glovesItem != null && glovesItem.getEnchantLevel() > 5) | |
38 | gloves = glovesItem.getItemId(); | |
39 | ||
40 | if (_gloves != 0 && _gloves != gloves) | |
41 | return false; | |
42 | ||
43 | final ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET); | |
44 | if (feetItem != null && feetItem.getEnchantLevel() > 5) | |
45 | feet = feetItem.getItemId(); | |
46 | ||
47 | if (_feet != 0 && _feet != feet) | |
48 | return false; | |
49 | ||
50 | return true; | |
51 | } | |
52 | ||
53 | + /** | |
54 | + * Checks if all parts of set are enchanted to +16 or more | |
55 | + * {@docRoot} BAN - L2JDev | |
56 | + * @param player | |
57 | + * @return | |
58 | + */ | |
59 | + public boolean isEnchanted16(Player player) | |
60 | + { | |
61 | + // Player don't have full set | |
62 | + if(!containAll(player)) | |
63 | + return false; | |
64 | + | |
65 | + Inventory inv = player.getInventory(); | |
66 | + | |
67 | + ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST); | |
68 | + ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS); | |
69 | + ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD); | |
70 | + ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES); | |
71 | + ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET); | |
72 | + | |
73 | + if(chestItem.getEnchantLevel() < 16) | |
74 | + return false; | |
75 | + if(_legs != 0 && legsItem.getEnchantLevel() < 16) | |
76 | + return false; | |
77 | + if(_gloves != 0 && glovesItem.getEnchantLevel() < 16) | |
78 | + return false; | |
79 | + if(_head != 0 && headItem.getEnchantLevel() < 16) | |
80 | + return false; | |
81 | + if(_feet != 0 && feetItem.getEnchantLevel() < 16) | |
82 | + return false; | |
83 | + | |
84 | + return true; | |
85 | + } | |
86 | ||
87 | ================================================================ | |
88 | Index: ArmorSetListener.JAVA | |
89 | ================================================================ | |
90 | @Override | |
91 | public void onEquip(int slot, ItemInstance item, L2Playable actor) | |
92 | { if (armorSet.isEnchanted6(player)) // has all parts of set enchanted to 6 or more | |
93 | { | |
94 | int skillId = armorSet.getEnchant6skillId(); | |
95 | if (skillId > 0) | |
96 | { | |
97 | L2Skill skille = SkillTable.getInstance().getInfo(skillId, 1); | |
98 | if (skille != null) | |
99 | { | |
100 | player.addSkill(skille, false); | |
101 | player.sendSkillList(); | |
102 | } | |
103 | } | |
104 | } | |
105 | ||
106 | ||
107 | + if (armorSet.isEnchanted16(player)) | |
108 | + { | |
109 | + player.startAbnormalEffect(AbnormalEffect.FLAME); | |
110 | + } | |
111 | ||
112 | @Override | |
113 | public void onUnequip(int slot, ItemInstance item, L2Playable actor) | |
114 | { | |
115 | ||
116 | if (removeSkillId4 != 0) | |
117 | { | |
118 | L2Skill skill = SkillTable.getInstance().getInfo(removeSkillId4, 1); | |
119 | if (skill != null) | |
120 | player.removeSkill(skill); | |
121 | } | |
122 | ||
123 | + player.stopAbnormalEffect(AbnormalEffect.FLAME); | |
124 | ||
125 | ||
126 | player.sendSkillList(); |