Proper solution for class change unequip issue.

This commit is contained in:
MobiusDevelopment
2021-08-23 21:12:01 +00:00
parent bda02389c6
commit 8975ca9f7e
171 changed files with 536 additions and 261 deletions

View File

@@ -158,7 +158,6 @@ public class CreatureAI extends AbstractAI
// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
clientStopAutoAttack();
}
/**

View File

@@ -365,7 +365,6 @@ public class InstanceManager implements IXmlReader
// Save template
_instanceTemplates.put(id, template);
}
// --------------------------------------------------------------------

View File

@@ -2434,6 +2434,11 @@ public class PlayerInstance extends Playable
}
}
public boolean isChangingClass()
{
return _subclassLock;
}
/**
* @return the Experience of the PlayerInstance.
*/

View File

@@ -85,7 +85,6 @@ public class PlayerEventHolder
_player.setPvpKills(_pvpKills);
_player.setPkKills(_pkKills);
_player.setReputation(_reputation);
}
public void setSitForced(boolean sitForced)

View File

@@ -894,6 +894,11 @@ public abstract class Inventory extends ItemContainer
@Override
public void notifyUnequiped(int slot, ItemInstance item, Inventory inventory)
{
if (item.getActingPlayer().isChangingClass())
{
return;
}
if (item.getItem().getBodyPart() == Item.SLOT_R_BRACELET)
{
inventory.unEquipItemInSlot(PAPERDOLL_DECO1);
@@ -924,6 +929,11 @@ public abstract class Inventory extends ItemContainer
@Override
public void notifyUnequiped(int slot, ItemInstance item, Inventory inventory)
{
if (item.getActingPlayer().isChangingClass())
{
return;
}
if (item.getItem().getBodyPart() == Item.SLOT_BROOCH)
{
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_JEWEL1);
@@ -960,7 +970,6 @@ public abstract class Inventory extends ItemContainer
// common
addPaperdollListener(StatsListener.getInstance());
}
protected abstract ItemLocation getEquipLocation();
@@ -2215,7 +2224,8 @@ public abstract class Inventory extends ItemContainer
}
/**
* Re-notify to paperdoll listeners every equipped item
* Re-notify to paperdoll listeners every equipped item.<br>
* Only used by player ClassId set methods.
*/
public void reloadEquippedItems()
{
@@ -2239,6 +2249,7 @@ public abstract class Inventory extends ItemContainer
listener.notifyEquiped(slot, item, this);
}
}
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@@ -305,7 +305,6 @@ public class LongTimeEvent extends Quest
}
}
}.load();
}
protected class ScheduleStart implements Runnable

View File

@@ -52,6 +52,5 @@ public class SnoopQuit implements IClientIncomingPacket
target.removeSnooper(player);
player.removeSnooped(target);
}
}