Files
2006Scape/2006Redone Server/src/redone/net/packets/impl/BankX2.java
T
Gptaqbc b02950045c Buy/sell x buying loop lagging issue fix general shop using fixes trading amount fix (#133)
* Update NpcHandler.class

Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it.

Still have some issue around objects but that's another story.

* Update NpcHandler.java

Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it.

Still have some issue around objects but that's another story.

closes #47

* Buy/Sell-X--Buying-loop-lagging-issue-fix--General-shop-using-fixes--Trading-amount-fix

- Added buy/sell X feature
- Fixed a lag with the buying loop when buying high amount. Instead of spam buying 1 at a  times it divide the amount to buy in equal parts and buy in increments.
- Cant remember at all I'll edit after eating.
2019-11-03 22:02:39 -05:00

76 lines
2.2 KiB
Java

package redone.net.packets.impl;
import redone.game.content.random.PartyRoom;
import redone.game.players.Client;
import redone.net.packets.PacketType;
/**
* Bank X Items
**/
public class BankX2 implements PacketType {
@Override
public void processPacket(Client player, int packetType, int packetSize) {
player.endCurrentTask();
int Xamount = player.getInStream().readDWord();
if (Xamount < 0) {
Xamount = player.getItemAssistant().getItemAmount(player.xRemoveId);
}
if (Xamount == 0) {
Xamount = 1;
}
switch (player.xInterfaceId) {
case 5064:
if (player.inPartyRoom) {
PartyRoom.depositItem(player, player.xRemoveId, player.getItemAssistant().itemAmount(player.playerItems[player.xRemoveSlot]));
break;
}
if (player.inTrade) {
player.getActionSender().sendMessage("You can't store items while trading!");
return;
}
player.getItemAssistant().bankItem(player.playerItems[player.xRemoveSlot], player.xRemoveSlot, Xamount);
break;
case 5382:
player.getItemAssistant().fromBank(player.bankItems[player.xRemoveSlot], player.xRemoveSlot, Xamount);
break;
case 7423:
if (player.storing) {
return;
}
player.getItemAssistant().bankItem(player.playerItems[player.xRemoveSlot],
player.xRemoveSlot, Xamount);
player.getItemAssistant().resetItems(7423);
break;
case 3322:
if (player.duelStatus <= 0) {
player.getTrading().tradeItem(player.xRemoveId, player.xRemoveSlot, Xamount);
} else {
player.getDueling().stakeItem(player.xRemoveId, player.xRemoveSlot, Xamount);
}
break;
case 3415:
if (player.duelStatus <= 0) {
player.getTrading().fromTrade(player.xRemoveId, player.xRemoveSlot, Xamount);
}
break;
case 6669:
player.getDueling().fromDuel(player.xRemoveId, player.xRemoveSlot, Xamount);
break;
case 3900:
player.getShopAssistant().buyItem(player.xRemoveId, player.xRemoveSlot, Xamount);
break;
case 3823:
player.getShopAssistant().sellItem(player.xRemoveId, player.xRemoveSlot, Xamount);
break;
}
}
}