Adjustments for Death Knight class change.
This commit is contained in:
parent
2d939006bc
commit
46d275e847
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class CharInfo implements IClientOutgoingPacket
|
||||
packet.writeS(_player.getAppearance().getVisibleName()); // Confirmed
|
||||
packet.writeH(_player.getRace().ordinal()); // Confirmed
|
||||
packet.writeC(_player.getAppearance().isFemale() ? 1 : 0); // Confirmed
|
||||
packet.writeD(_player.getBaseTemplate().getClassId().getRootClassId().getId());
|
||||
packet.writeD(_player.isDeathKnight() && _player.isSubClassActive() ? 0 : _player.getBaseTemplate().getClassId().getRootClassId().getId());
|
||||
|
||||
for (int slot : getPaperdollOrder())
|
||||
{
|
||||
|
@ -152,7 +152,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
||||
packet.writeC(_player.isGM() ? 1 : 0);
|
||||
packet.writeC(_player.getRace().ordinal());
|
||||
packet.writeC(_player.getAppearance().isFemale() ? 1 : 0);
|
||||
packet.writeD(_player.getBaseTemplate().getClassId().getRootClassId().getId());
|
||||
packet.writeD(_player.isDeathKnight() && _player.isSubClassActive() ? 0 : _player.getBaseTemplate().getClassId().getRootClassId().getId());
|
||||
packet.writeD(_player.getClassId().getId());
|
||||
packet.writeD(_player.getLevel()); // 270
|
||||
packet.writeD(_player.getClassId().getId()); // 286
|
||||
|
@ -31,7 +31,9 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
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.enums.CategoryType;
|
||||
import org.l2jmobius.gameserver.enums.ClassId;
|
||||
import org.l2jmobius.gameserver.enums.Race;
|
||||
import org.l2jmobius.gameserver.enums.SubclassInfoType;
|
||||
@ -411,21 +413,23 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
}
|
||||
|
||||
// Death Knight checks.
|
||||
if ((classidval >= 196) && (classidval <= 207))
|
||||
if (CategoryData.getInstance().isInCategory(CategoryType.DEATH_KNIGHT_ALL_CLASS, classidval))
|
||||
{
|
||||
player.setDeathKnight(true);
|
||||
player.getAppearance().setMale();
|
||||
if (!player.isDeathKnight())
|
||||
{
|
||||
player.setDeathKnight(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setDeathKnight(false);
|
||||
if (player.isDeathKnight())
|
||||
{
|
||||
player.setDeathKnight(false);
|
||||
}
|
||||
}
|
||||
|
||||
final String newclass = ClassListData.getInstance().getClass(player.getClassId()).getClassName();
|
||||
// if (player.isInCategory(CategoryType.SIXTH_CLASS_GROUP))
|
||||
// {
|
||||
// SkillTreeData.getInstance().cleanSkillUponChangeClass(player, false);
|
||||
// }
|
||||
player.store(false);
|
||||
player.broadcastUserInfo();
|
||||
player.sendSkillList();
|
||||
|
@ -152,6 +152,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);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,9 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
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.enums.CategoryType;
|
||||
import org.l2jmobius.gameserver.enums.ClassId;
|
||||
import org.l2jmobius.gameserver.enums.Race;
|
||||
import org.l2jmobius.gameserver.enums.SubclassInfoType;
|
||||
@ -411,21 +413,23 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
}
|
||||
|
||||
// Death Knight checks.
|
||||
if ((classidval >= 196) && (classidval <= 207))
|
||||
if (CategoryData.getInstance().isInCategory(CategoryType.DEATH_KNIGHT_ALL_CLASS, classidval))
|
||||
{
|
||||
player.setDeathKnight(true);
|
||||
player.getAppearance().setMale();
|
||||
if (!player.isDeathKnight())
|
||||
{
|
||||
player.setDeathKnight(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setDeathKnight(false);
|
||||
if (player.isDeathKnight())
|
||||
{
|
||||
player.setDeathKnight(false);
|
||||
}
|
||||
}
|
||||
|
||||
final String newclass = ClassListData.getInstance().getClass(player.getClassId()).getClassName();
|
||||
// if (player.isInCategory(CategoryType.SIXTH_CLASS_GROUP))
|
||||
// {
|
||||
// SkillTreeData.getInstance().cleanSkillUponChangeClass(player, false);
|
||||
// }
|
||||
player.store(false);
|
||||
player.broadcastUserInfo();
|
||||
player.sendSkillList();
|
||||
|
@ -152,6 +152,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);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,9 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
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.enums.CategoryType;
|
||||
import org.l2jmobius.gameserver.enums.ClassId;
|
||||
import org.l2jmobius.gameserver.enums.Race;
|
||||
import org.l2jmobius.gameserver.enums.SubclassInfoType;
|
||||
@ -411,21 +413,23 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
}
|
||||
|
||||
// Death Knight checks.
|
||||
if ((classidval >= 196) && (classidval <= 207))
|
||||
if (CategoryData.getInstance().isInCategory(CategoryType.DEATH_KNIGHT_ALL_CLASS, classidval))
|
||||
{
|
||||
player.setDeathKnight(true);
|
||||
player.getAppearance().setMale();
|
||||
if (!player.isDeathKnight())
|
||||
{
|
||||
player.setDeathKnight(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setDeathKnight(false);
|
||||
if (player.isDeathKnight())
|
||||
{
|
||||
player.setDeathKnight(false);
|
||||
}
|
||||
}
|
||||
|
||||
final String newclass = ClassListData.getInstance().getClass(player.getClassId()).getClassName();
|
||||
// if (player.isInCategory(CategoryType.SIXTH_CLASS_GROUP))
|
||||
// {
|
||||
// SkillTreeData.getInstance().cleanSkillUponChangeClass(player, false);
|
||||
// }
|
||||
player.store(false);
|
||||
player.broadcastUserInfo();
|
||||
player.sendSkillList();
|
||||
|
@ -152,6 +152,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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user