Separate autouse for action shortcuts.
This commit is contained in:
@ -136,18 +136,18 @@ public class Shortcut
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets is shortcut is auto use enabled.
|
||||
* @return if shortcut is auto use enabled.
|
||||
*/
|
||||
* Gets is shortcut is auto use enabled.
|
||||
* @return if shortcut is auto use enabled.
|
||||
*/
|
||||
public boolean isAutoUse()
|
||||
{
|
||||
return _autoUse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the auto use status.
|
||||
* @param value of shortcut auto use status.
|
||||
*/
|
||||
* Sets the auto use status.
|
||||
* @param value of shortcut auto use status.
|
||||
*/
|
||||
public void setAutoUse(boolean value)
|
||||
{
|
||||
_autoUse = value;
|
||||
|
@ -14436,10 +14436,13 @@ public class Player extends Playable
|
||||
continue;
|
||||
}
|
||||
|
||||
final Skill knownSkill = getKnownSkill(shortcut.getId());
|
||||
if (knownSkill != null)
|
||||
if (shortcut.getType() == ShortcutType.SKILL)
|
||||
{
|
||||
sendPacket(new ExActivateAutoShortcut(shortcut, true));
|
||||
final Skill knownSkill = getKnownSkill(shortcut.getId());
|
||||
if (knownSkill != null)
|
||||
{
|
||||
sendPacket(new ExActivateAutoShortcut(shortcut, true));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -14515,7 +14518,7 @@ public class Player extends Playable
|
||||
{
|
||||
for (Shortcut shortcut : getAllShortCuts())
|
||||
{
|
||||
if (usedShortcut.getId() == shortcut.getId())
|
||||
if ((usedShortcut.getId() == shortcut.getId()) && (usedShortcut.getType() == shortcut.getType()))
|
||||
{
|
||||
shortcut.setAutoUse(true);
|
||||
sendPacket(new ExActivateAutoShortcut(shortcut, true));
|
||||
@ -14549,7 +14552,7 @@ public class Player extends Playable
|
||||
{
|
||||
for (Shortcut shortcut : getAllShortCuts())
|
||||
{
|
||||
if (usedShortcut.getId() == shortcut.getId())
|
||||
if ((usedShortcut.getId() == shortcut.getId()) && (usedShortcut.getType() == shortcut.getType()))
|
||||
{
|
||||
shortcut.setAutoUse(false);
|
||||
sendPacket(new ExActivateAutoShortcut(shortcut, false));
|
||||
|
@ -93,7 +93,7 @@ public class RequestShortCutReg implements IClientIncomingPacket
|
||||
// Activate if any other similar shortcut is activated.
|
||||
for (Shortcut shortcut : player.getAllShortCuts())
|
||||
{
|
||||
if (!shortcut.isAutoUse())
|
||||
if (!shortcut.isAutoUse() || (shortcut.getType() != _type))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.clientpackets.autoplay;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.gameserver.data.xml.ActionData;
|
||||
import org.l2jmobius.gameserver.enums.ShortcutType;
|
||||
import org.l2jmobius.gameserver.handler.IPlayerActionHandler;
|
||||
import org.l2jmobius.gameserver.handler.PlayerActionHandler;
|
||||
import org.l2jmobius.gameserver.model.ActionDataHolder;
|
||||
@ -74,12 +75,16 @@ public class ExRequestActivateAutoShortcut implements IClientIncomingPacket
|
||||
player.removeAutoShortcut(_slot, _page);
|
||||
}
|
||||
|
||||
final Item item = player.getInventory().getItemByObjectId(shortcut.getId());
|
||||
Item item = null;
|
||||
Skill skill = null;
|
||||
if (item == null)
|
||||
if (shortcut.getType() == ShortcutType.SKILL)
|
||||
{
|
||||
skill = player.getKnownSkill(shortcut.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
item = player.getInventory().getItemByObjectId(shortcut.getId());
|
||||
}
|
||||
|
||||
// stop
|
||||
if (!_active)
|
||||
|
Reference in New Issue
Block a user