L2JMobius

Fafurion Cast canceling

Friendly · 8 · 5876

Offline Friendly

  • Vassal
  • *
    • Posts: 7
When i try to cancel cast any skill by using ESC - first canceling a TARGET and only 2nd time presing ESC cancel a CAST.     

Bug or retail for Fafurion?


Offline Iris

  • Distinguished King
  • *****
    • Posts: 1239
It's a bug (in retail, as soon as you use the Esc key, you cancel your casting), but this problem has already been reported before.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16159
Seems like a 1 minute fix.
Where has this been reported before?


Online Liamxroy

  • Grand Duke
  • *****
    • Posts: 761
    • Adenaplease!
1st cancel should stop casting and 2nd removes target


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16159
Code: [Select]
/*
 * 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;

import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.TargetUnselected;

/**
 * @author Mobius
 */
public class RequestTargetCanceld implements IClientIncomingPacket
{
private boolean _targetLost;

@Override
public boolean read(GameClient client, PacketReader packet)
{
_targetLost = packet.readH() != 0;
return true;
}

@Override
public void run(GameClient client)
{
final PlayerInstance player = client.getPlayer();
if (player == null)
{
return;
}

if (player.isLockedTarget())
{
player.sendPacket(SystemMessageId.FAILED_TO_REMOVE_ENMITY);
return;
}

if (player.isCastingNow())
{
player.abortAllSkillCasters();
}

if (_targetLost)
{
player.setTarget(null);
}

if (player.isInAirShip())
{
player.broadcastPacket(new TargetUnselected(player));
}
}
}


Offline Iris

  • Distinguished King
  • *****
    • Posts: 1239
Seems like a 1 minute fix.
Where has this been reported before?

Uh I remember this being (very badly) reported like a year ago xD


Offline Iris

  • Distinguished King
  • *****
    • Posts: 1239

Offline Friendly

  • Vassal
  • *
    • Posts: 7
Seems like a 1 minute fix.
Where has this been reported before?
Thx a lot, i made your fix and now working good.

p.s. before this topic i search "cast cancel" and didnt found this bug.