diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java index b713669b7c..f3fd78b99a 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -2677,6 +2677,7 @@ public class Player extends Playable sendPacket(new ShortCutInit(this)); sendMessage("You have learned " + skillCounter + " new skills."); } + restoreAutoShortcutVisual(); return skillCounter; } @@ -14265,29 +14266,29 @@ public class Player extends Playable public void restoreAutoShortcutVisual() { - if (_autoUseSettings.isEmpty()) + if (!getVariables().contains(PlayerVariables.AUTO_USE_SHORTCUTS)) { return; } + final List positions = getVariables().getIntegerList(PlayerVariables.AUTO_USE_SHORTCUTS); for (Shortcut shortcut : getAllShortCuts()) { - if (!shortcut.isAutoUse()) + final Integer position = shortcut.getSlot() + (shortcut.getPage() * ShortCuts.MAX_SHORTCUTS_PER_BAR); + if (!positions.contains(position)) { continue; } - if (_autoUseSettings.isAutoSkill(shortcut.getId())) + final Skill knownSkill = getKnownSkill(shortcut.getId()); + if (knownSkill != null) { - if (getKnownSkill(shortcut.getId()) != null) - { - sendPacket(new ExActivateAutoShortcut(shortcut, true)); - } + sendPacket(new ExActivateAutoShortcut(shortcut, true)); } else { final Item item = getInventory().getItemByObjectId(shortcut.getId()); - if ((item != null) && _autoUseSettings.getAutoSupplyItems().contains(item.getId())) + if (item != null) { sendPacket(new ExActivateAutoShortcut(shortcut, true)); } diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java index d67b486ee0..dfe79e023e 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -2707,6 +2707,7 @@ public class Player extends Playable sendPacket(new ShortCutInit(this)); sendMessage("You have learned " + skillCounter + " new skills."); } + restoreAutoShortcutVisual(); return skillCounter; } @@ -14334,29 +14335,29 @@ public class Player extends Playable public void restoreAutoShortcutVisual() { - if (_autoUseSettings.isEmpty()) + if (!getVariables().contains(PlayerVariables.AUTO_USE_SHORTCUTS)) { return; } + final List positions = getVariables().getIntegerList(PlayerVariables.AUTO_USE_SHORTCUTS); for (Shortcut shortcut : getAllShortCuts()) { - if (!shortcut.isAutoUse()) + final Integer position = shortcut.getSlot() + (shortcut.getPage() * ShortCuts.MAX_SHORTCUTS_PER_BAR); + if (!positions.contains(position)) { continue; } - if (_autoUseSettings.isAutoSkill(shortcut.getId())) + final Skill knownSkill = getKnownSkill(shortcut.getId()); + if (knownSkill != null) { - if (getKnownSkill(shortcut.getId()) != null) - { - sendPacket(new ExActivateAutoShortcut(shortcut, true)); - } + sendPacket(new ExActivateAutoShortcut(shortcut, true)); } else { final Item item = getInventory().getItemByObjectId(shortcut.getId()); - if ((item != null) && _autoUseSettings.getAutoSupplyItems().contains(item.getId())) + if (item != null) { sendPacket(new ExActivateAutoShortcut(shortcut, true)); } diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java index e835351a77..74c0fe1085 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -2724,6 +2724,7 @@ public class Player extends Playable sendPacket(new ShortCutInit(this)); sendMessage("You have learned " + skillCounter + " new skills."); } + restoreAutoShortcutVisual(); return skillCounter; } @@ -14371,29 +14372,29 @@ public class Player extends Playable public void restoreAutoShortcutVisual() { - if (_autoUseSettings.isEmpty()) + if (!getVariables().contains(PlayerVariables.AUTO_USE_SHORTCUTS)) { return; } + final List positions = getVariables().getIntegerList(PlayerVariables.AUTO_USE_SHORTCUTS); for (Shortcut shortcut : getAllShortCuts()) { - if (!shortcut.isAutoUse()) + final Integer position = shortcut.getSlot() + (shortcut.getPage() * ShortCuts.MAX_SHORTCUTS_PER_BAR); + if (!positions.contains(position)) { continue; } - if (_autoUseSettings.isAutoSkill(shortcut.getId())) + final Skill knownSkill = getKnownSkill(shortcut.getId()); + if (knownSkill != null) { - if (getKnownSkill(shortcut.getId()) != null) - { - sendPacket(new ExActivateAutoShortcut(shortcut, true)); - } + sendPacket(new ExActivateAutoShortcut(shortcut, true)); } else { final Item item = getInventory().getItemByObjectId(shortcut.getId()); - if ((item != null) && _autoUseSettings.getAutoSupplyItems().contains(item.getId())) + if (item != null) { sendPacket(new ExActivateAutoShortcut(shortcut, true)); } diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java index 7d98c7385b..5a1daf89c2 100644 --- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -2726,6 +2726,7 @@ public class Player extends Playable sendPacket(new ShortCutInit(this)); sendMessage("You have learned " + skillCounter + " new skills."); } + restoreAutoShortcutVisual(); return skillCounter; } @@ -14421,29 +14422,29 @@ public class Player extends Playable public void restoreAutoShortcutVisual() { - if (_autoUseSettings.isEmpty()) + if (!getVariables().contains(PlayerVariables.AUTO_USE_SHORTCUTS)) { return; } + final List positions = getVariables().getIntegerList(PlayerVariables.AUTO_USE_SHORTCUTS); for (Shortcut shortcut : getAllShortCuts()) { - if (!shortcut.isAutoUse()) + final Integer position = shortcut.getSlot() + (shortcut.getPage() * ShortCuts.MAX_SHORTCUTS_PER_BAR); + if (!positions.contains(position)) { continue; } - if (_autoUseSettings.isAutoSkill(shortcut.getId())) + final Skill knownSkill = getKnownSkill(shortcut.getId()); + if (knownSkill != null) { - if (getKnownSkill(shortcut.getId()) != null) - { - sendPacket(new ExActivateAutoShortcut(shortcut, true)); - } + sendPacket(new ExActivateAutoShortcut(shortcut, true)); } else { final Item item = getInventory().getItemByObjectId(shortcut.getId()); - if ((item != null) && _autoUseSettings.getAutoSupplyItems().contains(item.getId())) + if (item != null) { sendPacket(new ExActivateAutoShortcut(shortcut, true)); } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Player.java index 407c381c2e..1be47d9822 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -2604,6 +2604,7 @@ public class Player extends Playable sendPacket(new ShortCutInit(this)); sendMessage("You have learned " + skillCounter + " new skills."); } + restoreAutoShortcutVisual(); return skillCounter; } @@ -14212,29 +14213,29 @@ public class Player extends Playable public void restoreAutoShortcutVisual() { - if (_autoUseSettings.isEmpty()) + if (!getVariables().contains(PlayerVariables.AUTO_USE_SHORTCUTS)) { return; } + final List positions = getVariables().getIntegerList(PlayerVariables.AUTO_USE_SHORTCUTS); for (Shortcut shortcut : getAllShortCuts()) { - if (!shortcut.isAutoUse()) + final Integer position = shortcut.getSlot() + (shortcut.getPage() * ShortCuts.MAX_SHORTCUTS_PER_BAR); + if (!positions.contains(position)) { continue; } - if (_autoUseSettings.isAutoSkill(shortcut.getId())) + final Skill knownSkill = getKnownSkill(shortcut.getId()); + if (knownSkill != null) { - if (getKnownSkill(shortcut.getId()) != null) - { - sendPacket(new ExActivateAutoShortcut(shortcut, true)); - } + sendPacket(new ExActivateAutoShortcut(shortcut, true)); } else { final Item item = getInventory().getItemByObjectId(shortcut.getId()); - if ((item != null) && _autoUseSettings.getAutoSupplyItems().contains(item.getId())) + if (item != null) { sendPacket(new ExActivateAutoShortcut(shortcut, true)); } diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Player.java index 5ef3783140..1319f48a7e 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -2676,6 +2676,7 @@ public class Player extends Playable sendPacket(new ShortCutInit(this)); sendMessage("You have learned " + skillCounter + " new skills."); } + restoreAutoShortcutVisual(); return skillCounter; } @@ -14479,29 +14480,29 @@ public class Player extends Playable public void restoreAutoShortcutVisual() { - if (_autoUseSettings.isEmpty()) + if (!getVariables().contains(PlayerVariables.AUTO_USE_SHORTCUTS)) { return; } + final List positions = getVariables().getIntegerList(PlayerVariables.AUTO_USE_SHORTCUTS); for (Shortcut shortcut : getAllShortCuts()) { - if (!shortcut.isAutoUse()) + final Integer position = shortcut.getSlot() + (shortcut.getPage() * ShortCuts.MAX_SHORTCUTS_PER_BAR); + if (!positions.contains(position)) { continue; } - if (_autoUseSettings.isAutoSkill(shortcut.getId())) + final Skill knownSkill = getKnownSkill(shortcut.getId()); + if (knownSkill != null) { - if (getKnownSkill(shortcut.getId()) != null) - { - sendPacket(new ExActivateAutoShortcut(shortcut, true)); - } + sendPacket(new ExActivateAutoShortcut(shortcut, true)); } else { final Item item = getInventory().getItemByObjectId(shortcut.getId()); - if ((item != null) && _autoUseSettings.getAutoSupplyItems().contains(item.getId())) + if (item != null) { sendPacket(new ExActivateAutoShortcut(shortcut, true)); } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java index 8cfb288f54..ba6c2c8496 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -2707,6 +2707,7 @@ public class Player extends Playable sendPacket(new ShortCutInit(this)); sendMessage("You have learned " + skillCounter + " new skills."); } + restoreAutoShortcutVisual(); return skillCounter; } @@ -14556,29 +14557,29 @@ public class Player extends Playable public void restoreAutoShortcutVisual() { - if (_autoUseSettings.isEmpty()) + if (!getVariables().contains(PlayerVariables.AUTO_USE_SHORTCUTS)) { return; } + final List positions = getVariables().getIntegerList(PlayerVariables.AUTO_USE_SHORTCUTS); for (Shortcut shortcut : getAllShortCuts()) { - if (!shortcut.isAutoUse()) + final Integer position = shortcut.getSlot() + (shortcut.getPage() * ShortCuts.MAX_SHORTCUTS_PER_BAR); + if (!positions.contains(position)) { continue; } - if (_autoUseSettings.isAutoSkill(shortcut.getId())) + final Skill knownSkill = getKnownSkill(shortcut.getId()); + if (knownSkill != null) { - if (getKnownSkill(shortcut.getId()) != null) - { - sendPacket(new ExActivateAutoShortcut(shortcut, true)); - } + sendPacket(new ExActivateAutoShortcut(shortcut, true)); } else { final Item item = getInventory().getItemByObjectId(shortcut.getId()); - if ((item != null) && _autoUseSettings.getAutoSupplyItems().contains(item.getId())) + if (item != null) { sendPacket(new ExActivateAutoShortcut(shortcut, true)); } diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java index 8cfb288f54..ba6c2c8496 100644 --- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -2707,6 +2707,7 @@ public class Player extends Playable sendPacket(new ShortCutInit(this)); sendMessage("You have learned " + skillCounter + " new skills."); } + restoreAutoShortcutVisual(); return skillCounter; } @@ -14556,29 +14557,29 @@ public class Player extends Playable public void restoreAutoShortcutVisual() { - if (_autoUseSettings.isEmpty()) + if (!getVariables().contains(PlayerVariables.AUTO_USE_SHORTCUTS)) { return; } + final List positions = getVariables().getIntegerList(PlayerVariables.AUTO_USE_SHORTCUTS); for (Shortcut shortcut : getAllShortCuts()) { - if (!shortcut.isAutoUse()) + final Integer position = shortcut.getSlot() + (shortcut.getPage() * ShortCuts.MAX_SHORTCUTS_PER_BAR); + if (!positions.contains(position)) { continue; } - if (_autoUseSettings.isAutoSkill(shortcut.getId())) + final Skill knownSkill = getKnownSkill(shortcut.getId()); + if (knownSkill != null) { - if (getKnownSkill(shortcut.getId()) != null) - { - sendPacket(new ExActivateAutoShortcut(shortcut, true)); - } + sendPacket(new ExActivateAutoShortcut(shortcut, true)); } else { final Item item = getInventory().getItemByObjectId(shortcut.getId()); - if ((item != null) && _autoUseSettings.getAutoSupplyItems().contains(item.getId())) + if (item != null) { sendPacket(new ExActivateAutoShortcut(shortcut, true)); }