Separate autouse for action shortcuts.

This commit is contained in:
MobiusDevelopment 2021-12-10 02:43:35 +00:00
parent 8650b7d095
commit 9526fd2ece
32 changed files with 176 additions and 112 deletions

View File

@ -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;

View File

@ -14280,10 +14280,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
{
@ -14359,7 +14362,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));
@ -14393,7 +14396,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));

View File

@ -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;
}

View File

@ -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)

View File

@ -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;

View File

@ -14349,10 +14349,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
{
@ -14428,7 +14431,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));
@ -14462,7 +14465,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));

View File

@ -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;
}

View File

@ -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)

View File

@ -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;

View File

@ -14386,10 +14386,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
{
@ -14465,7 +14468,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));
@ -14499,7 +14502,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));

View File

@ -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;
}

View File

@ -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)

View File

@ -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;

View File

@ -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));

View File

@ -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;
}

View File

@ -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)

View File

@ -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;

View File

@ -14227,10 +14227,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
{
@ -14306,7 +14309,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));
@ -14340,7 +14343,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));

View File

@ -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;
}

View File

@ -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)

View File

@ -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;

View File

@ -14499,10 +14499,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
{
@ -14578,7 +14581,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));
@ -14612,7 +14615,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));

View File

@ -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;
}

View File

@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets.autoplay;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.enums.ShortcutType;
import org.l2jmobius.gameserver.model.ShortCuts;
import org.l2jmobius.gameserver.model.Shortcut;
import org.l2jmobius.gameserver.model.actor.Player;
@ -70,12 +71,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)

View File

@ -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;

View File

@ -14576,10 +14576,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
{
@ -14655,7 +14658,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));
@ -14689,7 +14692,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));

View File

@ -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;
}

View File

@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets.autoplay;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.enums.ShortcutType;
import org.l2jmobius.gameserver.model.ShortCuts;
import org.l2jmobius.gameserver.model.Shortcut;
import org.l2jmobius.gameserver.model.actor.Player;
@ -70,12 +71,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)

View File

@ -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;

View File

@ -14576,10 +14576,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
{
@ -14655,7 +14658,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));
@ -14689,7 +14692,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));

View File

@ -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;
}

View File

@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets.autoplay;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.enums.ShortcutType;
import org.l2jmobius.gameserver.model.ShortCuts;
import org.l2jmobius.gameserver.model.Shortcut;
import org.l2jmobius.gameserver.model.actor.Player;
@ -70,12 +71,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)