Moved crude brooch jewel checks in L2PcInstance.
This commit is contained in:
@@ -2154,6 +2154,11 @@ public final class L2PcInstance extends L2Playable
|
|||||||
final int oldInvLimit = getInventoryLimit();
|
final int oldInvLimit = getInventoryLimit();
|
||||||
SystemMessage sm = null;
|
SystemMessage sm = null;
|
||||||
|
|
||||||
|
if ((item.getItem().getBodyPart() == L2Item.SLOT_BROOCH_JEWEL) || (item.getItem().getBodyPart() == L2Item.SLOT_BROOCH))
|
||||||
|
{
|
||||||
|
updateActiveBroochJewel();
|
||||||
|
}
|
||||||
|
|
||||||
if (isEquiped)
|
if (isEquiped)
|
||||||
{
|
{
|
||||||
if (item.getEnchantLevel() > 0)
|
if (item.getEnchantLevel() > 0)
|
||||||
@@ -2212,6 +2217,7 @@ public final class L2PcInstance extends L2Playable
|
|||||||
sendPacket(SystemMessageId.YOU_DO_NOT_MEET_THE_REQUIRED_CONDITION_TO_EQUIP_THAT_ITEM);
|
sendPacket(SystemMessageId.YOU_DO_NOT_MEET_THE_REQUIRED_CONDITION_TO_EQUIP_THAT_ITEM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshExpertisePenalty();
|
refreshExpertisePenalty();
|
||||||
|
|
||||||
broadcastUserInfo();
|
broadcastUserInfo();
|
||||||
@@ -2230,6 +2236,11 @@ public final class L2PcInstance extends L2Playable
|
|||||||
sendPacket(new ExStorageMaxCount(this));
|
sendPacket(new ExStorageMaxCount(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((item.getItem().getBodyPart() == L2Item.SLOT_BROOCH_JEWEL) || (item.getItem().getBodyPart() == L2Item.SLOT_BROOCH))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
// Notify to scripts
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||||
}
|
}
|
||||||
@@ -8674,6 +8685,44 @@ public final class L2PcInstance extends L2Playable
|
|||||||
_activeShappireJewel = jewel;
|
_activeShappireJewel = jewel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateActiveBroochJewel()
|
||||||
|
{
|
||||||
|
// Update active Ruby jewel.
|
||||||
|
if ((getInventory().getItemByItemId(BroochJewel.RUBY_LV5.getItemId()) != null) && (getInventory().getItemByItemId(BroochJewel.RUBY_LV5.getItemId()).isEquipped()))
|
||||||
|
{
|
||||||
|
setActiveRubyJewel(BroochJewel.RUBY_LV5);
|
||||||
|
}
|
||||||
|
else if ((getInventory().getItemByItemId(BroochJewel.RUBY_LV4.getItemId()) != null) && (getInventory().getItemByItemId(BroochJewel.RUBY_LV4.getItemId()).isEquipped()))
|
||||||
|
{
|
||||||
|
setActiveRubyJewel(BroochJewel.RUBY_LV4);
|
||||||
|
}
|
||||||
|
else if ((getInventory().getItemByItemId(BroochJewel.RUBY_LV3.getItemId()) != null) && (getInventory().getItemByItemId(BroochJewel.RUBY_LV5.getItemId()).isEquipped()))
|
||||||
|
{
|
||||||
|
setActiveRubyJewel(BroochJewel.RUBY_LV3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setActiveRubyJewel(null);
|
||||||
|
}
|
||||||
|
// Update active Sapphire jewel.
|
||||||
|
if ((getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV5.getItemId()) != null) && (getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV5.getItemId()).isEquipped()))
|
||||||
|
{
|
||||||
|
setActiveShappireJewel(BroochJewel.SHAPPHIRE_LV5);
|
||||||
|
}
|
||||||
|
else if ((getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV4.getItemId()) != null) && (getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV4.getItemId()).isEquipped()))
|
||||||
|
{
|
||||||
|
setActiveShappireJewel(BroochJewel.SHAPPHIRE_LV4);
|
||||||
|
}
|
||||||
|
else if ((getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV3.getItemId()) != null) && (getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV3.getItemId()).isEquipped()))
|
||||||
|
{
|
||||||
|
setActiveShappireJewel(BroochJewel.SHAPPHIRE_LV3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setActiveShappireJewel(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private ScheduledFuture<?> _taskWarnUserTakeBreak;
|
private ScheduledFuture<?> _taskWarnUserTakeBreak;
|
||||||
|
|
||||||
public EnumIntBitmask<ClanPrivilege> getClanPrivileges()
|
public EnumIntBitmask<ClanPrivilege> getClanPrivileges()
|
||||||
|
@@ -39,7 +39,6 @@ import com.l2jmobius.commons.database.DatabaseFactory;
|
|||||||
import com.l2jmobius.commons.util.CommonUtil;
|
import com.l2jmobius.commons.util.CommonUtil;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.ArmorSetsData;
|
import com.l2jmobius.gameserver.data.xml.impl.ArmorSetsData;
|
||||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
import com.l2jmobius.gameserver.enums.BroochJewel;
|
|
||||||
import com.l2jmobius.gameserver.enums.ItemLocation;
|
import com.l2jmobius.gameserver.enums.ItemLocation;
|
||||||
import com.l2jmobius.gameserver.enums.ItemSkillType;
|
import com.l2jmobius.gameserver.enums.ItemSkillType;
|
||||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||||
@@ -389,11 +388,6 @@ public abstract class Inventory extends ItemContainer
|
|||||||
{
|
{
|
||||||
player.sendPacket(new SkillCoolTime(player));
|
player.sendPacket(new SkillCoolTime(player));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((item.getItem().getBodyPart() == L2Item.SLOT_BROOCH_JEWEL) || (item.getItem().getBodyPart() == L2Item.SLOT_BROOCH))
|
|
||||||
{
|
|
||||||
updateActiveBroochJewel(player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -477,49 +471,6 @@ public abstract class Inventory extends ItemContainer
|
|||||||
{
|
{
|
||||||
player.handleAutoShots(Config.ENABLE_AUTO_SHOTS);
|
player.handleAutoShots(Config.ENABLE_AUTO_SHOTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((item.getItem().getBodyPart() == L2Item.SLOT_BROOCH_JEWEL) || (item.getItem().getBodyPart() == L2Item.SLOT_BROOCH))
|
|
||||||
{
|
|
||||||
updateActiveBroochJewel(player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateActiveBroochJewel(L2PcInstance player)
|
|
||||||
{
|
|
||||||
// Update active Ruby jewel.
|
|
||||||
if ((player.getInventory().getItemByItemId(BroochJewel.RUBY_LV5.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.RUBY_LV5.getItemId()).isEquipped()))
|
|
||||||
{
|
|
||||||
player.setActiveRubyJewel(BroochJewel.RUBY_LV5);
|
|
||||||
}
|
|
||||||
else if ((player.getInventory().getItemByItemId(BroochJewel.RUBY_LV4.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.RUBY_LV4.getItemId()).isEquipped()))
|
|
||||||
{
|
|
||||||
player.setActiveRubyJewel(BroochJewel.RUBY_LV4);
|
|
||||||
}
|
|
||||||
else if ((player.getInventory().getItemByItemId(BroochJewel.RUBY_LV3.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.RUBY_LV5.getItemId()).isEquipped()))
|
|
||||||
{
|
|
||||||
player.setActiveRubyJewel(BroochJewel.RUBY_LV3);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.setActiveRubyJewel(null);
|
|
||||||
}
|
|
||||||
// Update active Sapphire jewel.
|
|
||||||
if ((player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV5.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV5.getItemId()).isEquipped()))
|
|
||||||
{
|
|
||||||
player.setActiveShappireJewel(BroochJewel.SHAPPHIRE_LV5);
|
|
||||||
}
|
|
||||||
else if ((player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV4.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV4.getItemId()).isEquipped()))
|
|
||||||
{
|
|
||||||
player.setActiveShappireJewel(BroochJewel.SHAPPHIRE_LV4);
|
|
||||||
}
|
|
||||||
else if ((player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV3.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV3.getItemId()).isEquipped()))
|
|
||||||
{
|
|
||||||
player.setActiveShappireJewel(BroochJewel.SHAPPHIRE_LV3);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.setActiveShappireJewel(null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,6 +504,11 @@ public abstract class Inventory extends ItemContainer
|
|||||||
{
|
{
|
||||||
player.sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((item.getItem().getBodyPart() == L2Item.SLOT_BROOCH_JEWEL) || (item.getItem().getBodyPart() == L2Item.SLOT_BROOCH))
|
||||||
|
{
|
||||||
|
player.updateActiveBroochJewel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean applySkills(L2PcInstance player, L2ItemInstance item, L2ArmorSet armorSet, Function<L2ItemInstance, Integer> idProvider)
|
private static boolean applySkills(L2PcInstance player, L2ItemInstance item, L2ArmorSet armorSet, Function<L2ItemInstance, Integer> idProvider)
|
||||||
@@ -668,6 +624,11 @@ public abstract class Inventory extends ItemContainer
|
|||||||
player.checkItemRestriction();
|
player.checkItemRestriction();
|
||||||
player.sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((item.getItem().getBodyPart() == L2Item.SLOT_BROOCH_JEWEL) || (item.getItem().getBodyPart() == L2Item.SLOT_BROOCH))
|
||||||
|
{
|
||||||
|
player.updateActiveBroochJewel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user