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.
This commit is contained in:
Gptaqbc
2019-11-03 22:02:39 -05:00
committed by Daniel Ginovker
parent dcf6cbdc45
commit b02950045c
8 changed files with 200 additions and 112 deletions
@@ -20,52 +20,56 @@ public class BankX2 implements PacketType {
Xamount = 1;
}
switch (player.xInterfaceId) {
case 5064:
/*if(!player.getItemAssistant().playerHasItem(player.playerItems[player.xRemoveSlot], Xamount))
return;*/
if (player.inPartyRoom) {
PartyRoom.depositItem(player, player.xRemoveId, player.getItemAssistant().itemAmount(player.playerItems[player.xRemoveSlot]));
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;
}
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:
/*if(!player.getItemAssistant().playerHasItem(player.playerItems[player.xRemoveSlot], Xamount))
return;*/
player.getItemAssistant().fromBank(player.bankItems[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 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 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 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 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;
}
}
}