Fixed Class Change skill not been able to cast.

This commit is contained in:
MobiusDev 2017-12-07 00:59:44 +00:00
parent ce761fbc1c
commit d5c7a92b95
5 changed files with 45 additions and 45 deletions

View File

@ -17,7 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.CommonSkill;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@ -48,21 +50,19 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket
return;
}
if (activeChar.isSpawnProtected())
{
activeChar.onActionRequest();
}
// Get the level of the used skill
Skill skill = activeChar.getKnownSkill(_magicId);
if (skill == null)
{
// Player doesn't know this skill, maybe it's the display Id.
skill = activeChar.getCustomSkill(_magicId);
if (skill == null)
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
{
skill = SkillData.getInstance().getSkill(_magicId, 1);
}
else
{
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
_log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class.");
_log.warning("Skill Id " + _magicId + " not found in player!");
return;
}
}

View File

@ -17,7 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.CommonSkill;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@ -48,21 +50,19 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket
return;
}
if (activeChar.isSpawnProtected())
{
activeChar.onActionRequest();
}
// Get the level of the used skill
Skill skill = activeChar.getKnownSkill(_magicId);
if (skill == null)
{
// Player doesn't know this skill, maybe it's the display Id.
skill = activeChar.getCustomSkill(_magicId);
if (skill == null)
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
{
skill = SkillData.getInstance().getSkill(_magicId, 1);
}
else
{
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
_log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class.");
_log.warning("Skill Id " + _magicId + " not found in player!");
return;
}
}

View File

@ -17,7 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.CommonSkill;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@ -48,21 +50,19 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket
return;
}
if (activeChar.isSpawnProtected())
{
activeChar.onActionRequest();
}
// Get the level of the used skill
Skill skill = activeChar.getKnownSkill(_magicId);
if (skill == null)
{
// Player doesn't know this skill, maybe it's the display Id.
skill = activeChar.getCustomSkill(_magicId);
if (skill == null)
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
{
skill = SkillData.getInstance().getSkill(_magicId, 1);
}
else
{
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
_log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class.");
_log.warning("Skill Id " + _magicId + " not found in player!");
return;
}
}

View File

@ -17,7 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.CommonSkill;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@ -48,21 +50,19 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket
return;
}
if (activeChar.isSpawnProtected())
{
activeChar.onActionRequest();
}
// Get the level of the used skill
Skill skill = activeChar.getKnownSkill(_magicId);
if (skill == null)
{
// Player doesn't know this skill, maybe it's the display Id.
skill = activeChar.getCustomSkill(_magicId);
if (skill == null)
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
{
skill = SkillData.getInstance().getSkill(_magicId, 1);
}
else
{
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
_log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class.");
_log.warning("Skill Id " + _magicId + " not found in player!");
return;
}
}

View File

@ -17,7 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.CommonSkill;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@ -48,21 +50,19 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket
return;
}
if (activeChar.isSpawnProtected())
{
activeChar.onActionRequest();
}
// Get the level of the used skill
Skill skill = activeChar.getKnownSkill(_magicId);
if (skill == null)
{
// Player doesn't know this skill, maybe it's the display Id.
skill = activeChar.getCustomSkill(_magicId);
if (skill == null)
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
{
skill = SkillData.getInstance().getSkill(_magicId, 1);
}
else
{
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
_log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class.");
_log.warning("Skill Id " + _magicId + " not found in player!");
return;
}
}