Adjustments for Death Knight class change.

This commit is contained in:
MobiusDevelopment
2021-12-28 22:04:24 +00:00
parent 2d939006bc
commit 46d275e847
10 changed files with 84 additions and 27 deletions

View File

@@ -30,7 +30,9 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.CategoryData;
import org.l2jmobius.gameserver.data.xml.ClassListData;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
@@ -424,15 +426,30 @@ public class AdminEditChar implements IAdminCommandHandler
player.getAppearance().setFemale();
}
// Death Knight sex check.
if ((classidval >= 212) && (classidval <= 216))
// Death Knight checks.
if (CategoryData.getInstance().isInCategory(CategoryType.DEATH_KNIGHT_ALL_CLASS, classidval))
{
player.setDeathKnight(true);
player.getAppearance().setMale();
if (!player.isDeathKnight() && !player.isSubClassActive())
{
player.setDeathKnight(true);
// Fix Death Knight model animation.
player.transform(101, false);
ThreadPool.schedule(() -> player.stopTransformation(false), 50);
}
}
else
{
player.setDeathKnight(false);
// Fix Death Knight model animation.
if (player.isDeathKnight() && !player.isSubClassActive())
{
player.setDeathKnight(false);
// Fix Death Knight model animation.
player.transform(101, false);
ThreadPool.schedule(() -> player.stopTransformation(false), 50);
}
}
final String newclass = ClassListData.getInstance().getClass(player.getClassId()).getClassName();

View File

@@ -155,6 +155,13 @@ public class ClassChange extends AbstractEffect
}
}
}
// Fix Death Knight model animation.
if (player.isDeathKnight())
{
player.transform(101, false);
ThreadPool.schedule(() -> player.stopTransformation(false), 50);
}
}, 500);
}
}