Fixed autouse stop when learn skill or moving shortcuts.
Contributed by Serenitty.
This commit is contained in:
@@ -352,6 +352,7 @@ import org.l2jmobius.gameserver.network.serverpackets.TradeOtherDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.TradeStart;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.autoplay.ExActivateAutoShortcut;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.autoplay.ExAutoPlaySettingSend;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.commission.ExResponseCommissionInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.friend.FriendStatus;
|
||||
@@ -14367,6 +14368,36 @@ public class PlayerInstance extends Playable
|
||||
return _autoUseSettings;
|
||||
}
|
||||
|
||||
public void restoreVisualAutoUse()
|
||||
{
|
||||
if (_autoUseSettings.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Shortcut shortcut;
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
shortcut = getShortCut(i, 22);
|
||||
if ((shortcut != null) && _autoUseSettings.getAutoSupplyItems().contains(shortcut.getId()) && (getInventory().getItemByObjectId(shortcut.getId()) != null))
|
||||
{
|
||||
sendPacket(new ExActivateAutoShortcut((22 * 12) + i, true));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
for (int j = 0; j < 12; j++)
|
||||
{
|
||||
shortcut = getShortCut(j, i);
|
||||
if ((shortcut != null) && _autoUseSettings.getAutoSkills().contains(shortcut.getId()) && (getKnownSkill(shortcut.getId()) != null))
|
||||
{
|
||||
sendPacket(new ExActivateAutoShortcut(j + (i * 12), true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int zoneId)
|
||||
{
|
||||
return isInTimedHuntingZone(zoneId, getX(), getY());
|
||||
|
@@ -666,6 +666,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSkillLearn(trainer, player, skill, _skillType), player);
|
||||
}
|
||||
player.restoreVisualAutoUse();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -49,7 +49,7 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if ((_page > 23) || (_page < 0))
|
||||
if ((_page > 23) || (_page < 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -65,10 +65,12 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
||||
if (_slot > 263)
|
||||
{
|
||||
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, id);
|
||||
player.restoreVisualAutoUse();
|
||||
}
|
||||
else
|
||||
{
|
||||
AutoUseTaskManager.getInstance().removeAutoSkill(player, id);
|
||||
player.restoreVisualAutoUse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user