Unequip shield on Death Knight class change.

This commit is contained in:
MobiusDevelopment 2022-01-02 01:07:11 +00:00
parent 41da7eaf3c
commit fc4cd3eddb

View File

@ -25,6 +25,8 @@ import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.item.type.ArmorType;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId;
@ -42,9 +44,10 @@ import org.l2jmobius.gameserver.taskmanager.AutoUseTaskManager;
*/
public class ClassChange extends AbstractEffect
{
private final int _index;
private static final int IDENTITY_CRISIS_SKILL_ID = 1570;
private final int _index;
public ClassChange(StatSet params)
{
_index = params.getInt("index", 0);
@ -156,9 +159,17 @@ public class ClassChange extends AbstractEffect
}
}
// Fix Death Knight model animation.
// Death Knight adjustments.
if (player.isDeathKnight())
{
// Unequip shield.
final Item lhand = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
if ((lhand != null) && lhand.isArmor() && (lhand.getItemType() == ArmorType.SHIELD))
{
player.disarmShield();
}
// Fix Death Knight model animation.
player.transform(101, false);
ThreadPool.schedule(() -> player.stopTransformation(false), 50);
}