Fixed auto consume items.

This commit is contained in:
MobiusDevelopment 2020-01-02 01:36:23 +00:00
parent 2afcbf6bd6
commit 235203c5f8
4 changed files with 26 additions and 18 deletions

View File

@ -25,15 +25,16 @@ import org.l2jmobius.gameserver.network.GameClient;
*/
public class RequestShortCutDel implements IClientIncomingPacket
{
private int _id;
private int _slot;
private int _page;
@Override
public boolean read(GameClient client, PacketReader packet)
{
final int id = packet.readD();
_slot = id % 12;
_page = id / 12;
_id = packet.readD();
_slot = _id % 12;
_page = _id / 12;
return true;
}
@ -52,6 +53,10 @@ public class RequestShortCutDel implements IClientIncomingPacket
}
player.deleteShortCut(_slot, _page);
// client needs no confirmation. this packet is just to inform the server
// Remove auto used ids.
player.removeAutoSupplyItem(_id);
player.removeAutoPotionItem(_id);
player.removeAutoSkill(_id);
}
}

View File

@ -72,7 +72,7 @@ public class ExRequestActivateAutoShortcut implements IClientIncomingPacket
if (item != null)
{
// auto supply
if (_room == -1)
if (_room > 263)
{
player.removeAutoSupplyItem(item.getId());
}
@ -81,7 +81,7 @@ public class ExRequestActivateAutoShortcut implements IClientIncomingPacket
player.removeAutoPotionItem(item.getId());
}
}
// TODO: auto skill
// auto skill
if (skill != null)
{
player.removeAutoSkill(skill.getId());
@ -90,13 +90,12 @@ public class ExRequestActivateAutoShortcut implements IClientIncomingPacket
}
// start
if (_room == -1)
if (_room > 263)
{
// auto supply
if (item != null)
{
player.addAutoSupplyItem(item.getId());
return;
}
}
else
@ -110,7 +109,7 @@ public class ExRequestActivateAutoShortcut implements IClientIncomingPacket
return;
}
}
// TODO: auto skill
// auto skill
if (skill != null)
{
player.addAutoSkill(skill.getId());

View File

@ -25,15 +25,16 @@ import org.l2jmobius.gameserver.network.GameClient;
*/
public class RequestShortCutDel implements IClientIncomingPacket
{
private int _id;
private int _slot;
private int _page;
@Override
public boolean read(GameClient client, PacketReader packet)
{
final int id = packet.readD();
_slot = id % 12;
_page = id / 12;
_id = packet.readD();
_slot = _id % 12;
_page = _id / 12;
return true;
}
@ -52,6 +53,10 @@ public class RequestShortCutDel implements IClientIncomingPacket
}
player.deleteShortCut(_slot, _page);
// client needs no confirmation. this packet is just to inform the server
// Remove auto used ids.
player.removeAutoSupplyItem(_id);
player.removeAutoPotionItem(_id);
player.removeAutoSkill(_id);
}
}

View File

@ -72,7 +72,7 @@ public class ExRequestActivateAutoShortcut implements IClientIncomingPacket
if (item != null)
{
// auto supply
if (_room == -1)
if (_room > 263)
{
player.removeAutoSupplyItem(item.getId());
}
@ -81,7 +81,7 @@ public class ExRequestActivateAutoShortcut implements IClientIncomingPacket
player.removeAutoPotionItem(item.getId());
}
}
// TODO: auto skill
// auto skill
if (skill != null)
{
player.removeAutoSkill(skill.getId());
@ -90,13 +90,12 @@ public class ExRequestActivateAutoShortcut implements IClientIncomingPacket
}
// start
if (_room == -1)
if (_room > 263)
{
// auto supply
if (item != null)
{
player.addAutoSupplyItem(item.getId());
return;
}
}
else
@ -110,7 +109,7 @@ public class ExRequestActivateAutoShortcut implements IClientIncomingPacket
return;
}
}
// TODO: auto skill
// auto skill
if (skill != null)
{
player.addAutoSkill(skill.getId());