Fix for equipped item skills.

This commit is contained in:
MobiusDev
2017-10-06 02:00:56 +00:00
parent 174b9ca0b5
commit 3ab0d9c1c5
12 changed files with 72 additions and 48 deletions

View File

@@ -6746,14 +6746,6 @@ public final class L2PcInstance extends L2Playable
player.setOverrideCond(masks);
}
// Retrieve from the database all items of this L2PcInstance and add them to _inventory
player.getInventory().restore();
player.getFreight().restore();
if (!Config.WAREHOUSE_CACHE)
{
player.getWarehouse();
}
// Retrieve from the database all secondary data of this L2PcInstance
// Note that Clan, Noblesse and Hero skills are given separately and not here.
// Retrieve from the database all skills of this L2PcInstance and add them to _skills
@@ -6762,6 +6754,14 @@ public final class L2PcInstance extends L2Playable
// Reward auto-get skills and all available skills if auto-learn skills is true.
player.rewardSkills();
// Retrieve from the database all items of this L2PcInstance and add them to _inventory
player.getInventory().restore();
player.getFreight().restore();
if (!Config.WAREHOUSE_CACHE)
{
player.getWarehouse();
}
player.restoreItemReuse();
// Initialize status update cache

View File

@@ -1273,7 +1273,7 @@ public abstract class Inventory extends ItemContainer
try
{
unEquipItemInSlot(slot);
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
((L2PcInstance) getOwner()).refreshExpertisePenalty();
}
@@ -1431,7 +1431,7 @@ public abstract class Inventory extends ItemContainer
final L2ItemInstance old = setPaperdollItem(pdollSlot, null);
if (old != null)
{
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
((L2PcInstance) getOwner()).refreshExpertisePenalty();
}
@@ -1473,7 +1473,7 @@ public abstract class Inventory extends ItemContainer
return;
}
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
final L2PcInstance player = (L2PcInstance) getOwner();
@@ -1794,7 +1794,7 @@ public abstract class Inventory extends ItemContainer
while (rs.next())
{
final L2ItemInstance item = new L2ItemInstance(rs);
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
final L2PcInstance player = (L2PcInstance) getOwner();

View File

@@ -641,6 +641,12 @@ public class EnterWorld implements IClientIncomingPacket
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
}
// Fix for equipped item skills
if (!activeChar.getEffectList().getCurrentAbnormalVisualEffects().isEmpty())
{
activeChar.updateAbnormalVisualEffects();
}
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPoolManager.schedule(() ->

View File

@@ -6745,14 +6745,6 @@ public final class L2PcInstance extends L2Playable
player.setOverrideCond(masks);
}
// Retrieve from the database all items of this L2PcInstance and add them to _inventory
player.getInventory().restore();
player.getFreight().restore();
if (!Config.WAREHOUSE_CACHE)
{
player.getWarehouse();
}
// Retrieve from the database all secondary data of this L2PcInstance
// Note that Clan, Noblesse and Hero skills are given separately and not here.
// Retrieve from the database all skills of this L2PcInstance and add them to _skills
@@ -6761,6 +6753,14 @@ public final class L2PcInstance extends L2Playable
// Reward auto-get skills and all available skills if auto-learn skills is true.
player.rewardSkills();
// Retrieve from the database all items of this L2PcInstance and add them to _inventory
player.getInventory().restore();
player.getFreight().restore();
if (!Config.WAREHOUSE_CACHE)
{
player.getWarehouse();
}
player.restoreItemReuse();
// Initialize status update cache

View File

@@ -1303,7 +1303,7 @@ public abstract class Inventory extends ItemContainer
try
{
unEquipItemInSlot(slot);
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
((L2PcInstance) getOwner()).refreshExpertisePenalty();
}
@@ -1461,7 +1461,7 @@ public abstract class Inventory extends ItemContainer
final L2ItemInstance old = setPaperdollItem(pdollSlot, null);
if (old != null)
{
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
((L2PcInstance) getOwner()).refreshExpertisePenalty();
}
@@ -1503,7 +1503,7 @@ public abstract class Inventory extends ItemContainer
return;
}
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
final L2PcInstance player = (L2PcInstance) getOwner();
@@ -1824,7 +1824,7 @@ public abstract class Inventory extends ItemContainer
while (rs.next())
{
final L2ItemInstance item = new L2ItemInstance(rs);
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
final L2PcInstance player = (L2PcInstance) getOwner();

View File

@@ -652,6 +652,12 @@ public class EnterWorld implements IClientIncomingPacket
activeChar.sendPacket(new ExAutoSoulShot(0, true, 2));
activeChar.sendPacket(new ExAutoSoulShot(0, true, 3));
// Fix for equipped item skills
if (!activeChar.getEffectList().getCurrentAbnormalVisualEffects().isEmpty())
{
activeChar.updateAbnormalVisualEffects();
}
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPoolManager.schedule(() ->

View File

@@ -6748,14 +6748,6 @@ public final class L2PcInstance extends L2Playable
player.setOverrideCond(masks);
}
// Retrieve from the database all items of this L2PcInstance and add them to _inventory
player.getInventory().restore();
player.getFreight().restore();
if (!Config.WAREHOUSE_CACHE)
{
player.getWarehouse();
}
// Retrieve from the database all secondary data of this L2PcInstance
// Note that Clan, Noblesse and Hero skills are given separately and not here.
// Retrieve from the database all skills of this L2PcInstance and add them to _skills
@@ -6764,6 +6756,14 @@ public final class L2PcInstance extends L2Playable
// Reward auto-get skills and all available skills if auto-learn skills is true.
player.rewardSkills();
// Retrieve from the database all items of this L2PcInstance and add them to _inventory
player.getInventory().restore();
player.getFreight().restore();
if (!Config.WAREHOUSE_CACHE)
{
player.getWarehouse();
}
player.restoreItemReuse();
// Initialize status update cache

View File

@@ -1303,7 +1303,7 @@ public abstract class Inventory extends ItemContainer
try
{
unEquipItemInSlot(slot);
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
((L2PcInstance) getOwner()).refreshExpertisePenalty();
}
@@ -1461,7 +1461,7 @@ public abstract class Inventory extends ItemContainer
final L2ItemInstance old = setPaperdollItem(pdollSlot, null);
if (old != null)
{
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
((L2PcInstance) getOwner()).refreshExpertisePenalty();
}
@@ -1503,7 +1503,7 @@ public abstract class Inventory extends ItemContainer
return;
}
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
final L2PcInstance player = (L2PcInstance) getOwner();
@@ -1824,7 +1824,7 @@ public abstract class Inventory extends ItemContainer
while (rs.next())
{
final L2ItemInstance item = new L2ItemInstance(rs);
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
final L2PcInstance player = (L2PcInstance) getOwner();

View File

@@ -652,6 +652,12 @@ public class EnterWorld implements IClientIncomingPacket
activeChar.sendPacket(new ExAutoSoulShot(0, true, 2));
activeChar.sendPacket(new ExAutoSoulShot(0, true, 3));
// Fix for equipped item skills
if (!activeChar.getEffectList().getCurrentAbnormalVisualEffects().isEmpty())
{
activeChar.updateAbnormalVisualEffects();
}
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPoolManager.schedule(() ->

View File

@@ -6718,14 +6718,6 @@ public final class L2PcInstance extends L2Playable
player.setOverrideCond(masks);
}
// Retrieve from the database all items of this L2PcInstance and add them to _inventory
player.getInventory().restore();
player.getFreight().restore();
if (!Config.WAREHOUSE_CACHE)
{
player.getWarehouse();
}
// Retrieve from the database all secondary data of this L2PcInstance
// Note that Clan, Noblesse and Hero skills are given separately and not here.
// Retrieve from the database all skills of this L2PcInstance and add them to _skills
@@ -6734,6 +6726,14 @@ public final class L2PcInstance extends L2Playable
// Reward auto-get skills and all available skills if auto-learn skills is true.
player.rewardSkills();
// Retrieve from the database all items of this L2PcInstance and add them to _inventory
player.getInventory().restore();
player.getFreight().restore();
if (!Config.WAREHOUSE_CACHE)
{
player.getWarehouse();
}
player.restoreItemReuse();
// Initialize status update cache

View File

@@ -1303,7 +1303,7 @@ public abstract class Inventory extends ItemContainer
try
{
unEquipItemInSlot(slot);
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
((L2PcInstance) getOwner()).refreshExpertisePenalty();
}
@@ -1461,7 +1461,7 @@ public abstract class Inventory extends ItemContainer
final L2ItemInstance old = setPaperdollItem(pdollSlot, null);
if (old != null)
{
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
((L2PcInstance) getOwner()).refreshExpertisePenalty();
}
@@ -1503,7 +1503,7 @@ public abstract class Inventory extends ItemContainer
return;
}
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
final L2PcInstance player = (L2PcInstance) getOwner();
@@ -1824,7 +1824,7 @@ public abstract class Inventory extends ItemContainer
while (rs.next())
{
final L2ItemInstance item = new L2ItemInstance(rs);
if (getOwner() instanceof L2PcInstance)
if (getOwner().isPlayer())
{
final L2PcInstance player = (L2PcInstance) getOwner();

View File

@@ -652,6 +652,12 @@ public class EnterWorld implements IClientIncomingPacket
activeChar.sendPacket(new ExAutoSoulShot(0, true, 2));
activeChar.sendPacket(new ExAutoSoulShot(0, true, 3));
// Fix for equipped item skills
if (!activeChar.getEffectList().getCurrentAbnormalVisualEffects().isEmpty())
{
activeChar.updateAbnormalVisualEffects();
}
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPoolManager.schedule(() ->