Separate autouse for action shortcuts.
This commit is contained in:
parent
8650b7d095
commit
9526fd2ece
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user