|
@@ -28,7 +28,6 @@ import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
|
|
|
|
|
|
/**
|
|
/**
|
|
* This class ...
|
|
* This class ...
|
|
- *
|
|
|
|
* @version $Revision: 1.7.2.1.2.3 $ $Date: 2005/03/27 15:29:30 $
|
|
* @version $Revision: 1.7.2.1.2.3 $ $Date: 2005/03/27 15:29:30 $
|
|
*/
|
|
*/
|
|
public final class RequestMagicSkillUse extends L2GameClientPacket
|
|
public final class RequestMagicSkillUse extends L2GameClientPacket
|
|
@@ -42,9 +41,9 @@ public final class RequestMagicSkillUse extends L2GameClientPacket
|
|
@Override
|
|
@Override
|
|
protected void readImpl()
|
|
protected void readImpl()
|
|
{
|
|
{
|
|
- _magicId = readD(); // Identifier of the used skill
|
|
|
|
- _ctrlPressed = readD() != 0; // True if it's a ForceAttack : Ctrl pressed
|
|
|
|
- _shiftPressed = readC() != 0; // True if Shift pressed
|
|
|
|
|
|
+ _magicId = readD(); // Identifier of the used skill
|
|
|
|
+ _ctrlPressed = readD() != 0; // True if it's a ForceAttack : Ctrl pressed
|
|
|
|
+ _shiftPressed = readC() != 0; // True if Shift pressed
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -81,8 +80,7 @@ public final class RequestMagicSkillUse extends L2GameClientPacket
|
|
// Check the validity of the skill
|
|
// Check the validity of the skill
|
|
if (skill != null)
|
|
if (skill != null)
|
|
{
|
|
{
|
|
- if ((activeChar.isTransformed() || activeChar.isInStance())
|
|
|
|
- && !activeChar.containsAllowedTransformSkill(skill.getId()))
|
|
|
|
|
|
+ if ((activeChar.isTransformed() || activeChar.isInStance()) && !activeChar.containsAllowedTransformSkill(skill.getId()))
|
|
{
|
|
{
|
|
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
|
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
|
return;
|
|
return;
|
|
@@ -90,23 +88,27 @@ public final class RequestMagicSkillUse extends L2GameClientPacket
|
|
|
|
|
|
if (Config.DEBUG)
|
|
if (Config.DEBUG)
|
|
{
|
|
{
|
|
- _log.fine(" skill:"+skill.getName() + " level:"+skill.getLevel() + " passive:"+skill.isPassive());
|
|
|
|
- _log.fine(" range:"+skill.getCastRange()+" targettype:"+skill.getTargetType()+" power:"+skill.getPower());
|
|
|
|
- _log.fine(" reusedelay:"+skill.getReuseDelay()+" hittime:"+skill.getHitTime());
|
|
|
|
|
|
+ _log.fine(" skill:" + skill.getName() + " level:" + skill.getLevel() + " passive:" + skill.isPassive());
|
|
|
|
+ _log.fine(" range:" + skill.getCastRange() + " targettype:" + skill.getTargetType() + " power:" + skill.getPower());
|
|
|
|
+ _log.fine(" reusedelay:" + skill.getReuseDelay() + " hittime:" + skill.getHitTime());
|
|
}
|
|
}
|
|
|
|
|
|
// If Alternate rule Karma punishment is set to true, forbid skill Return to player with Karma
|
|
// If Alternate rule Karma punishment is set to true, forbid skill Return to player with Karma
|
|
- if (skill.getSkillType() == L2SkillType.RECALL && !Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT && activeChar.getKarma() > 0)
|
|
|
|
|
|
+ if ((skill.getSkillType() == L2SkillType.RECALL) && !Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT && (activeChar.getKarma() > 0))
|
|
|
|
+ {
|
|
return;
|
|
return;
|
|
|
|
+ }
|
|
|
|
|
|
// players mounted on pets cannot use any toggle skills
|
|
// players mounted on pets cannot use any toggle skills
|
|
if (skill.isToggle() && activeChar.isMounted())
|
|
if (skill.isToggle() && activeChar.isMounted())
|
|
|
|
+ {
|
|
return;
|
|
return;
|
|
|
|
+ }
|
|
|
|
|
|
activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);
|
|
activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);
|
|
|
|
|
|
- // Stop if use self-buff.
|
|
|
|
- if(skill.getSkillType() == L2SkillType.BUFF && skill.getTargetType() == L2TargetType.TARGET_SELF)
|
|
|
|
|
|
+ // Stop if use self-buff (except if on AirShip or Boat).
|
|
|
|
+ if (((skill.getSkillType() == L2SkillType.BUFF) && (skill.getTargetType() == L2TargetType.TARGET_SELF)) && (!activeChar.isInAirShip() || !activeChar.isInBoat()))
|
|
{
|
|
{
|
|
final PcPosition charPos = activeChar.getPosition();
|
|
final PcPosition charPos = activeChar.getPosition();
|
|
final L2CharPosition stopPos = new L2CharPosition(charPos.getX(), charPos.getY(), charPos.getZ(), charPos.getHeading());
|
|
final L2CharPosition stopPos = new L2CharPosition(charPos.getX(), charPos.getY(), charPos.getZ(), charPos.getHeading());
|