Implemented the ExRequestClassChangeVerifying client packet.
This commit is contained in:
@@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCan
|
|||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChangeVerifying;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyInfo;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyInfo;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyItem;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyItem;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionCancel;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionCancel;
|
||||||
@@ -483,7 +484,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
|||||||
// 228
|
// 228
|
||||||
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, null, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, ExRequestClassChangeVerifying::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
||||||
|
@@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.l2jmobius.gameserver.network.clientpackets.classchange;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||||
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.classchange.ExRequestClassChangeUi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ExRequestClassChangeVerifying implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
private int _classId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean read(GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
_classId = packet.readD();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(GameClient client)
|
||||||
|
{
|
||||||
|
if (Config.DISABLE_TUTORIAL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final PlayerInstance player = client.getPlayer();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_classId != player.getClassId().getId())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.SECOND_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player) || !thirdClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player) || !thirdClassCheck(player) || !fourthClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(ExRequestClassChangeUi.STATIC_PACKET);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean firstClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11032_CurseOfUndying");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean secondClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11025_PathOfDestinyProving");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean thirdClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11026_PathOfDestinyConviction");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean fourthClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11027_PathOfDestinyOvercome");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
}
|
@@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCan
|
|||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChangeVerifying;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyInfo;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyInfo;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyItem;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyItem;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionCancel;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionCancel;
|
||||||
@@ -499,7 +500,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
|||||||
// 228
|
// 228
|
||||||
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, null, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, ExRequestClassChangeVerifying::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
||||||
|
@@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.l2jmobius.gameserver.network.clientpackets.classchange;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||||
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.classchange.ExClassChangeSetAlarm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ExRequestClassChangeVerifying implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
private int _classId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean read(GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
_classId = packet.readD();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(GameClient client)
|
||||||
|
{
|
||||||
|
if (Config.DISABLE_TUTORIAL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final PlayerInstance player = client.getPlayer();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_classId != player.getClassId().getId())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.SECOND_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player) || !thirdClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player) || !thirdClassCheck(player) || !fourthClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(ExClassChangeSetAlarm.STATIC_PACKET);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean firstClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11024_PathOfDestinyBeginning");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean secondClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11025_PathOfDestinyProving");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean thirdClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11026_PathOfDestinyConviction");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean fourthClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11027_PathOfDestinyOvercome");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
}
|
@@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCan
|
|||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChangeVerifying;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionCloseUI;
|
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionCloseUI;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionFavoriteList;
|
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionFavoriteList;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionReceiveReward;
|
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionReceiveReward;
|
||||||
@@ -508,7 +509,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
|||||||
// 228
|
// 228
|
||||||
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, null, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, ExRequestClassChangeVerifying::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
||||||
|
@@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.l2jmobius.gameserver.network.clientpackets.classchange;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||||
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.classchange.ExClassChangeSetAlarm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ExRequestClassChangeVerifying implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
private int _classId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean read(GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
_classId = packet.readD();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(GameClient client)
|
||||||
|
{
|
||||||
|
if (Config.DISABLE_TUTORIAL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final PlayerInstance player = client.getPlayer();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_classId != player.getClassId().getId())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.SECOND_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player) || !thirdClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player) || !thirdClassCheck(player) || !fourthClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(ExClassChangeSetAlarm.STATIC_PACKET);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean firstClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11024_PathOfDestinyBeginning");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean secondClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11025_PathOfDestinyProving");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean thirdClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11026_PathOfDestinyConviction");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean fourthClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q11027_PathOfDestinyOvercome");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
}
|
@@ -43,6 +43,7 @@ import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCan
|
|||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChangeVerifying;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyInfo;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyInfo;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyItem;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyItem;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionCancel;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionCancel;
|
||||||
@@ -477,7 +478,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
|||||||
// 228
|
// 228
|
||||||
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, null, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, ExRequestClassChangeVerifying::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
||||||
|
@@ -0,0 +1,136 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.l2jmobius.gameserver.network.clientpackets.classchange;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||||
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.classchange.ExRequestClassChangeUi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ExRequestClassChangeVerifying implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
private int _classId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean read(GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
_classId = packet.readD();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(GameClient client)
|
||||||
|
{
|
||||||
|
if (Config.DISABLE_TUTORIAL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final PlayerInstance player = client.getPlayer();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_classId != player.getClassId().getId())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.SECOND_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player) || !thirdClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(ExRequestClassChangeUi.STATIC_PACKET);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean firstClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
QuestState qs = null;
|
||||||
|
switch (player.getRace())
|
||||||
|
{
|
||||||
|
case HUMAN:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10982_SpiderHunt");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ELF:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10984_CollectSpiderweb");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DARK_ELF:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10986_SwampMonster");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ORC:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10988_Conspiracy");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DWARF:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10990_PoisonExtraction");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case KAMAEL:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10962_NewHorizons");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean secondClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
// SecondClassChange.java has only level check.
|
||||||
|
return player.getLevel() >= 40;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean thirdClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q10673_SagaOfLegend");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
}
|
@@ -46,6 +46,7 @@ import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCan
|
|||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChangeVerifying;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyInfo;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyInfo;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyItem;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionBuyItem;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionCancel;
|
import org.l2jmobius.gameserver.network.clientpackets.commission.RequestCommissionCancel;
|
||||||
@@ -504,7 +505,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
|||||||
// 228
|
// 228
|
||||||
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, null, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, ExRequestClassChangeVerifying::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
||||||
|
@@ -0,0 +1,143 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.l2jmobius.gameserver.network.clientpackets.classchange;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||||
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.classchange.ExClassChangeSetAlarm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ExRequestClassChangeVerifying implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
private int _classId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean read(GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
_classId = packet.readD();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(GameClient client)
|
||||||
|
{
|
||||||
|
if (Config.DISABLE_TUTORIAL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final PlayerInstance player = client.getPlayer();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_classId != player.getClassId().getId())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.SECOND_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player) || !thirdClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(ExClassChangeSetAlarm.STATIC_PACKET);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean firstClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
QuestState qs = null;
|
||||||
|
if (player.isDeathKnight())
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10959_ChallengingYourDestiny");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (player.getRace())
|
||||||
|
{
|
||||||
|
case HUMAN:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10982_SpiderHunt");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ELF:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10984_CollectSpiderweb");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DARK_ELF:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10986_SwampMonster");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ORC:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10988_Conspiracy");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DWARF:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10990_PoisonExtraction");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case KAMAEL:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10962_NewHorizons");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean secondClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
// SecondClassChange.java has only level check.
|
||||||
|
return player.getLevel() >= 40;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean thirdClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q10673_SagaOfLegend");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
}
|
@@ -19,6 +19,7 @@ package quests.Q10956_WeSylphs;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.gameserver.data.xml.CategoryData;
|
import org.l2jmobius.gameserver.data.xml.CategoryData;
|
||||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
import org.l2jmobius.gameserver.enums.QuestSound;
|
import org.l2jmobius.gameserver.enums.QuestSound;
|
||||||
@@ -26,6 +27,11 @@ import org.l2jmobius.gameserver.enums.Race;
|
|||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.events.EventType;
|
||||||
|
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||||
|
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||||
|
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||||
|
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||||
import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.NpcLogListHolder;
|
import org.l2jmobius.gameserver.model.holders.NpcLogListHolder;
|
||||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||||
@@ -211,4 +217,31 @@ public class Q10956_WeSylphs extends Quest
|
|||||||
}
|
}
|
||||||
return super.getNpcLogList(player);
|
return super.getNpcLogList(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RegisterEvent(EventType.ON_PLAYER_LOGIN)
|
||||||
|
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||||
|
public void OnPlayerLogin(OnPlayerLogin event)
|
||||||
|
{
|
||||||
|
if (Config.DISABLE_TUTORIAL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final PlayerInstance player = event.getPlayer();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CategoryData.getInstance().isInCategory(CategoryType.FIRST_CLASS_GROUP, player.getClassId().getId()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final QuestState qs = getQuestState(player, false);
|
||||||
|
if ((qs != null) && qs.isCompleted())
|
||||||
|
{
|
||||||
|
player.sendPacket(ExClassChangeSetAlarm.STATIC_PACKET);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -46,6 +46,7 @@ import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCan
|
|||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestCuriousHouseHtml;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
import org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos.RequestJoinCuriousHouse;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChangeVerifying;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionCloseUI;
|
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionCloseUI;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionFavoriteList;
|
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionFavoriteList;
|
||||||
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionReceiveReward;
|
import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionReceiveReward;
|
||||||
@@ -527,7 +528,7 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
|||||||
// 228
|
// 228
|
||||||
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
EX_OPEN_HTML(0x164, ExOpenHtml::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE(0x165, ExRequestClassChange::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, null, ConnectionState.IN_GAME),
|
EX_REQUEST_CLASS_CHANGE_VERIFYING(0x166, ExRequestClassChangeVerifying::new, ConnectionState.IN_GAME),
|
||||||
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
EX_REQUEST_TELEPORT(0x167, ExRequestTeleport::new, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
EX_COSTUME_USE_ITEM(0x168, null, ConnectionState.IN_GAME),
|
||||||
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
EX_COSTUME_LIST(0x169, null, ConnectionState.IN_GAME),
|
||||||
|
@@ -0,0 +1,142 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.l2jmobius.gameserver.network.clientpackets.classchange;
|
||||||
|
|
||||||
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||||
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.classchange.ExClassChangeSetAlarm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ExRequestClassChangeVerifying implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
private int _classId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean read(GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
_classId = packet.readD();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(GameClient client)
|
||||||
|
{
|
||||||
|
final PlayerInstance player = client.getPlayer();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_classId != player.getClassId().getId())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.SECOND_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))
|
||||||
|
{
|
||||||
|
if (!firstClassCheck(player) || !secondClassCheck(player) || !thirdClassCheck(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(ExClassChangeSetAlarm.STATIC_PACKET);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean firstClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
QuestState qs = null;
|
||||||
|
if (player.isDeathKnight())
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10959_ChallengingYourDestiny");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (player.getRace())
|
||||||
|
{
|
||||||
|
case HUMAN:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10982_SpiderHunt");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ELF:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10984_CollectSpiderweb");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DARK_ELF:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10986_SwampMonster");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ORC:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10988_Conspiracy");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DWARF:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10990_PoisonExtraction");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case KAMAEL:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10962_NewHorizons");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SYLPH:
|
||||||
|
{
|
||||||
|
qs = player.getQuestState("Q10956_WeSylphs");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean secondClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
// SecondClassChange.java has only level check.
|
||||||
|
return player.getLevel() >= 40;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean thirdClassCheck(PlayerInstance player)
|
||||||
|
{
|
||||||
|
final QuestState qs = player.getQuestState("Q10673_SagaOfLegend");
|
||||||
|
return (qs != null) && qs.isCompleted();
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user