mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 16:49:07 +00:00
Merge branch 'master' of https://github.com/dginovker/2006rebotted
This commit is contained in:
@@ -111,6 +111,14 @@ public final class RSInterface {
|
|||||||
rsInterface.actions[l3] = null;
|
rsInterface.actions[l3] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(rsInterface.parentID == 3822) {
|
||||||
|
rsInterface.actions[2] = "Sell 10";
|
||||||
|
rsInterface.actions[3] = "Sell X";
|
||||||
|
}
|
||||||
|
if(rsInterface.id == 3900) {
|
||||||
|
rsInterface.actions[2] = "Buy 10";
|
||||||
|
rsInterface.actions[3] = "Buy X";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (rsInterface.type == 3) {
|
if (rsInterface.type == 3) {
|
||||||
rsInterface.aBoolean227 = stream.readUnsignedByte() == 1;
|
rsInterface.aBoolean227 = stream.readUnsignedByte() == 1;
|
||||||
|
|||||||
@@ -970,31 +970,8 @@ public abstract class Player {
|
|||||||
wQueueWritePtr = next;
|
wQueueWritePtr = next;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
public boolean goodDistance(int objectX, int objectY, int playerX, int playerY, int distance) {
|
||||||
public boolean goodDistance(int objectX, int objectY, int playerX,
|
return ((objectX-playerX <= distance && objectX-playerX >= -distance) && (objectY-playerY <= distance && objectY-playerY >= -distance));
|
||||||
int playerY, int distance) {
|
|
||||||
for (int i = 0; i <= distance; i++) {
|
|
||||||
for (int j = 0; j <= distance; j++) {
|
|
||||||
if (objectId == 2282 || objectId == 10883 || objectId == 2322
|
|
||||||
|| objectId == 4493 || objectId == 12164
|
|
||||||
|| objectId == 1721 || objectId == 1722
|
|
||||||
|| objectId == 4304 && playerX == 2619
|
|
||||||
&& playerY == 3667) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (objectX + i == playerX
|
|
||||||
&& (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) {
|
|
||||||
return true;
|
|
||||||
} else if (objectX - i == playerX
|
|
||||||
&& (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) {
|
|
||||||
return true;
|
|
||||||
} else if (objectX == playerX
|
|
||||||
&& (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextWalkingDirection() {
|
public int getNextWalkingDirection() {
|
||||||
|
|||||||
@@ -252,7 +252,10 @@ public class Trading {
|
|||||||
if (o == null) {
|
if (o == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(player.playerItems[fromSlot] == itemID + 1 && player.playerItemsN[fromSlot] >= amount)) {
|
player.getActionSender().sendMessage("amount: " + amount);
|
||||||
|
player.getActionSender().sendMessage("player.playerItems[fromSlot]: " + player.playerItems[fromSlot]);
|
||||||
|
player.getActionSender().sendMessage("itemID + 1: " + itemID + 1);
|
||||||
|
if (!(player.playerItems[fromSlot] == itemID + 1 )){//&& player.playerItemsN[fromSlot] >= amount)) { I removed this check to permit trading max amount of item in inventory even when amount is higher than quantity in inventory.
|
||||||
player.getActionSender().sendMessage("You don't have that amount!");
|
player.getActionSender().sendMessage("You don't have that amount!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import redone.game.items.ItemDefinitions;
|
|||||||
import redone.game.players.Client;
|
import redone.game.players.Client;
|
||||||
import redone.game.players.Player;
|
import redone.game.players.Player;
|
||||||
import redone.game.players.PlayerHandler;
|
import redone.game.players.PlayerHandler;
|
||||||
import redone.net.ActionSender;
|
|
||||||
import redone.util.GameLogger;
|
import redone.util.GameLogger;
|
||||||
|
|
||||||
|
|
||||||
@@ -68,13 +67,13 @@ public class ShopAssistant {
|
|||||||
public void resetShop(int ShopID) {
|
public void resetShop(int ShopID) {
|
||||||
synchronized (player) {
|
synchronized (player) {
|
||||||
int TotalItems = 0;
|
int TotalItems = 0;
|
||||||
for (int i = 0; i < ShopHandler.MaxShopItems; i++) {
|
for (int i = 0; i < ShopHandler.MaxShopItems; i++) { //adds items in store when items are sold until max value.
|
||||||
if (ShopHandler.ShopItems[ShopID][i] > 0) {
|
if (ShopHandler.ShopItems[ShopID][i] > 0) {
|
||||||
TotalItems++;
|
TotalItems++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (TotalItems > ShopHandler.MaxShopItems) {
|
if (TotalItems > ShopHandler.MaxShopItems) {
|
||||||
TotalItems = ShopHandler.MaxShopItems;
|
TotalItems = ShopHandler.MaxShopItems; //sets the stack of item sold to max value if the resulting amount is higher than max value.
|
||||||
}
|
}
|
||||||
player.getOutStream().createFrameVarSizeWord(53);
|
player.getOutStream().createFrameVarSizeWord(53);
|
||||||
player.getOutStream().writeWord(3900);
|
player.getOutStream().writeWord(3900);
|
||||||
@@ -334,6 +333,7 @@ public class ShopAssistant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean sellItem(int itemID, int fromSlot, int amount) {
|
public boolean sellItem(int itemID, int fromSlot, int amount) {
|
||||||
|
player.getItemAssistant();
|
||||||
for (int i : Constants.ITEM_SELLABLE) {
|
for (int i : Constants.ITEM_SELLABLE) {
|
||||||
if (i == itemID) {
|
if (i == itemID) {
|
||||||
player.getItemAssistant();
|
player.getItemAssistant();
|
||||||
@@ -364,14 +364,11 @@ public class ShopAssistant {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (amount > player.playerItemsN[fromSlot] && (ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isNoteable == true || ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isStackable == true)) {
|
if (amount > player.playerItemsN[fromSlot] && (ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isNoteable == true || ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isStackable == true)) {
|
||||||
amount = player.playerItemsN[fromSlot];
|
amount = player.playerItemsN[fromSlot];
|
||||||
} else if (amount > player.getItemAssistant().getItemAmount(itemID) && ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isNoteable == false && ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isStackable == false) {
|
} else if (amount > player.getItemAssistant().getItemAmount(itemID) && ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isNoteable == false && ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isStackable == false) {
|
||||||
amount = player.getItemAssistant().getItemAmount(itemID);
|
amount = player.getItemAssistant().getItemAmount(itemID);
|
||||||
}
|
}
|
||||||
// double ShopValue;
|
|
||||||
// double TotPrice;
|
|
||||||
String itemName = ItemAssistant.getItemName(itemID).toLowerCase();
|
String itemName = ItemAssistant.getItemName(itemID).toLowerCase();
|
||||||
int TotPrice2 = 0;
|
int TotPrice2 = 0;
|
||||||
if (player.myShopId == 138 || player.myShopId == 58 || player.myShopId == 139) {
|
if (player.myShopId == 138 || player.myShopId == 58 || player.myShopId == 139) {
|
||||||
@@ -381,9 +378,13 @@ public class ShopAssistant {
|
|||||||
}
|
}
|
||||||
if (player.getItemAssistant().freeSlots() > 0 || player.getItemAssistant().playerHasItem(995) || player.getItemAssistant().playerHasItem(6529)) { //Checks to see if player has room for coins.
|
if (player.getItemAssistant().freeSlots() > 0 || player.getItemAssistant().playerHasItem(995) || player.getItemAssistant().playerHasItem(6529)) { //Checks to see if player has room for coins.
|
||||||
if (!ItemDefinitions.getDef()[itemID].isNoteable) { //Check to see if its notable.
|
if (!ItemDefinitions.getDef()[itemID].isNoteable) { //Check to see if its notable.
|
||||||
player.getItemAssistant().deleteItem(itemID, player.getItemAssistant().getItemSlot(itemID), amount); //don't really understand if the item isn't notable why it still needs to find the slot.
|
player.getItemAssistant().deleteItem2(itemID, amount);
|
||||||
} else {
|
} else {
|
||||||
player.getItemAssistant().deleteItem(itemID, fromSlot, amount);
|
player.getItemAssistant().deleteItem2(itemID, amount);
|
||||||
|
String ItemNameUnNotedItem = ItemAssistant.getItemName(itemID - 1).toLowerCase();
|
||||||
|
if (itemName.contains(ItemNameUnNotedItem)) {
|
||||||
|
itemID = itemID - 1; //Replace the noted item by it's un-noted version.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (player.myShopId == 138 || player.myShopId == 139 || player.myShopId == 58) {
|
if (player.myShopId == 138 || player.myShopId == 139 || player.myShopId == 58) {
|
||||||
player.getItemAssistant().addItem(6529, TotPrice2); //Add the tokkul to your inventory.
|
player.getItemAssistant().addItem(6529, TotPrice2); //Add the tokkul to your inventory.
|
||||||
@@ -401,7 +402,7 @@ public class ShopAssistant {
|
|||||||
player.getItemAssistant().resetItems(3823);
|
player.getItemAssistant().resetItems(3823);
|
||||||
resetShop(player.myShopId);
|
resetShop(player.myShopId);
|
||||||
updatePlayerShop();
|
updatePlayerShop();
|
||||||
player.getActionSender().sendMessage("You sold " + amount + " " +itemName + " for " + TotPrice2 + " gp." );
|
player.getActionSender().sendMessage("You sold " + amount + " " +itemName + " for " + TotPrice2 + " coins." );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -437,10 +438,50 @@ public class ShopAssistant {
|
|||||||
private static final int FISHING_ITEMS[] = {383, 371, 377, 359, 321, 341, 353, 345, 327, 317};
|
private static final int FISHING_ITEMS[] = {383, 371, 377, 359, 321, 341, 353, 345, 327, 317};
|
||||||
|
|
||||||
public boolean buyItem(int itemID, int fromSlot, int amount) {
|
public boolean buyItem(int itemID, int fromSlot, int amount) {
|
||||||
|
int iValue = 0;
|
||||||
|
int boughtQty = 0;
|
||||||
|
boolean boughtItem = false;
|
||||||
if (amount > 0) {
|
if (amount > 0) {
|
||||||
if (amount > ShopHandler.ShopItemsN[player.myShopId][fromSlot]) {
|
//S4
|
||||||
|
if (ShopHandler.ShopItemsN[player.myShopId][fromSlot] == 0) {
|
||||||
|
player.getActionSender().sendMessage("You can't buy that right now!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (amount > ShopHandler.ShopItemsN[player.myShopId][fromSlot] && ShopHandler.ShopItemsN[player.myShopId][fromSlot] > 0) {
|
||||||
amount = ShopHandler.ShopItemsN[player.myShopId][fromSlot];
|
amount = ShopHandler.ShopItemsN[player.myShopId][fromSlot];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (amount % 23 == 0) {
|
||||||
|
amount = amount / 23;
|
||||||
|
iValue = 23; }
|
||||||
|
else if (amount % 19 == 0) {
|
||||||
|
amount = amount / 19;
|
||||||
|
iValue = 19;
|
||||||
|
} else if (amount % 17 == 0) {
|
||||||
|
amount = amount / 17;
|
||||||
|
iValue = 17;
|
||||||
|
} else if (amount % 13 == 0) {
|
||||||
|
amount = amount / 13;
|
||||||
|
iValue = 13;
|
||||||
|
} else if (amount % 11 == 0) {
|
||||||
|
amount = amount / 11;
|
||||||
|
iValue = 11;
|
||||||
|
} else if (amount % 7 == 0) {
|
||||||
|
amount = amount / 7;
|
||||||
|
iValue = 7;
|
||||||
|
} else if (amount % 5 == 0) {
|
||||||
|
amount = amount / 5;
|
||||||
|
iValue = 5;
|
||||||
|
}
|
||||||
|
else if (amount % 3 == 0) {
|
||||||
|
amount = amount / 3;
|
||||||
|
iValue = 3;
|
||||||
|
} else if (amount % 2 == 0) {
|
||||||
|
amount = amount / 2;
|
||||||
|
iValue = 2;
|
||||||
|
} else{
|
||||||
|
iValue = 1;
|
||||||
|
}
|
||||||
if(!player.isShopping) {
|
if(!player.isShopping) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -456,15 +497,13 @@ public class ShopAssistant {
|
|||||||
if (!shopSellsItem(itemID)) {
|
if (!shopSellsItem(itemID)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// double ShopValue;
|
int TotPrice2 = 0; //ShopPrice
|
||||||
// double TotPrice;
|
int RemainingToBuy; //Remaining of item to buy to fill the order. It's the remaining that can't fit in the loop. It has to be processed by itself after the loop.
|
||||||
int TotPrice2 = 0;
|
int Slot = 0; //gp (995)
|
||||||
// int Overstock;
|
int tokkulSlot = 0;
|
||||||
int Slot = 0;
|
|
||||||
int tokkulSlot = 0;// Tokkul
|
|
||||||
int rangeSlot = 0;
|
int rangeSlot = 0;
|
||||||
int castleSlot = 0;
|
int castleSlot = 0;
|
||||||
for (int i = amount; i > 0; i--) {
|
for (int i = amount; iValue > 0; iValue--) {
|
||||||
if (player.myShopId != 138 && player.myShopId != 58 && player.myShopId != 139 && player.myShopId != RANGE_SHOP && player.myShopId != PEST_SHOP && player.myShopId != CASTLE_SHOP) {
|
if (player.myShopId != 138 && player.myShopId != 58 && player.myShopId != 139 && player.myShopId != RANGE_SHOP && player.myShopId != PEST_SHOP && player.myShopId != CASTLE_SHOP) {
|
||||||
TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 0, false));
|
TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 0, false));
|
||||||
} else if (player.myShopId == 138 || player.myShopId == 58 || player.myShopId == 139) {
|
} else if (player.myShopId == 138 || player.myShopId == 58 || player.myShopId == 139) {
|
||||||
@@ -577,34 +616,93 @@ public class ShopAssistant {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (player.playerItemsN[Slot] >= TotPrice2) {
|
if (player.playerItemsN[Slot] >= TotPrice2 * amount) {
|
||||||
if (player.getItemAssistant().freeSlots() > 0 || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable)) {
|
if (player.getItemAssistant().freeSlots() >= amount || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable) || player.getItemAssistant().freeSlots() >= 1 && ItemDefinitions.getDef()[itemID].isStackable) {
|
||||||
player.getItemAssistant().deleteItem(995,
|
player.getItemAssistant().deleteItem(995,
|
||||||
player.getItemAssistant().getItemSlot(995),
|
player.getItemAssistant().getItemSlot(995),
|
||||||
TotPrice2);
|
TotPrice2 * amount);
|
||||||
player.getItemAssistant().addItem(itemID, 1);
|
player.getItemAssistant().addItem(itemID, amount); //All of these actions are performed in a loop. We are in the loop right now.
|
||||||
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1;
|
boughtQty+=amount;
|
||||||
|
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= amount; //Delete X item from shop at the slot the item is.
|
||||||
|
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0; //Shit ass delay
|
||||||
|
if (fromSlot + 1 > ShopHandler.ShopItemsStandard[player.myShopId]) {
|
||||||
|
ShopHandler.ShopItems[player.myShopId][fromSlot] = itemID + 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (player.getItemAssistant().freeSlots() == 0) {
|
||||||
|
player.getActionSender().sendMessage(
|
||||||
|
"You don't have enough space in your inventory.");
|
||||||
|
} else {
|
||||||
|
//Buys the remaining item to fill the inventory slots.
|
||||||
|
RemainingToBuy = player.getItemAssistant().freeSlots();
|
||||||
|
amount = RemainingToBuy;
|
||||||
|
player.getItemAssistant().deleteItem(995,
|
||||||
|
player.getItemAssistant().getItemSlot(995),
|
||||||
|
TotPrice2 * amount);
|
||||||
|
player.getItemAssistant().addItem(itemID, amount);
|
||||||
|
boughtQty+=amount;
|
||||||
|
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= amount;
|
||||||
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0;
|
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0;
|
||||||
if (fromSlot + 1 > ShopHandler.ShopItemsStandard[player.myShopId]) {
|
if (fromSlot + 1 > ShopHandler.ShopItemsStandard[player.myShopId]) {
|
||||||
ShopHandler.ShopItems[player.myShopId][fromSlot] = 0;
|
ShopHandler.ShopItems[player.myShopId][fromSlot] = itemID + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
player.getActionSender()
|
|
||||||
.sendMessage(
|
|
||||||
"You don't have enough space in your inventory.");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
boughtItem = true;
|
||||||
} else {
|
} else {
|
||||||
|
if (player.playerItemsN[Slot] / TotPrice2 > 0) {
|
||||||
|
amount = (int)Math.floor(player.playerItemsN[Slot] / TotPrice2);
|
||||||
|
} else {
|
||||||
|
player.getActionSender().sendMessage("You don't have enough coins.");
|
||||||
|
player.getItemAssistant().resetItems(3823);
|
||||||
|
resetShop(player.myShopId);
|
||||||
|
updatePlayerShop();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (player.getItemAssistant().freeSlots() >= amount || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable) || player.getItemAssistant().freeSlots() >= 1 && ItemDefinitions.getDef()[itemID].isStackable) {
|
||||||
|
player.getItemAssistant().deleteItem(995,
|
||||||
|
player.getItemAssistant().getItemSlot(995),
|
||||||
|
TotPrice2 * amount);
|
||||||
|
player.getItemAssistant().addItem(itemID, amount); //All of these actions are performed in a loop. We are in the loop right now.
|
||||||
|
boughtQty+=amount;
|
||||||
|
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= amount; //Delete X item from shop at the slot the item is.
|
||||||
|
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0; //Shit ass delay
|
||||||
|
if (fromSlot + 1 > ShopHandler.ShopItemsStandard[player.myShopId]) {
|
||||||
|
ShopHandler.ShopItems[player.myShopId][fromSlot] = itemID + 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (player.getItemAssistant().freeSlots() == 0) {
|
||||||
player.getActionSender().sendMessage(
|
player.getActionSender().sendMessage(
|
||||||
"You don't have enough coins.");
|
"You don't have enough space in your inventory.");
|
||||||
|
} else {
|
||||||
|
//Buys the remaining item to fill the inventory slots.
|
||||||
|
RemainingToBuy = player.getItemAssistant().freeSlots();
|
||||||
|
amount = RemainingToBuy;
|
||||||
|
player.getItemAssistant().deleteItem(995,
|
||||||
|
player.getItemAssistant().getItemSlot(995),
|
||||||
|
TotPrice2 * amount);
|
||||||
|
player.getItemAssistant().addItem(itemID, amount);
|
||||||
|
boughtQty+=amount;
|
||||||
|
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= amount;
|
||||||
|
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0;
|
||||||
|
if (fromSlot + 1 > ShopHandler.ShopItemsStandard[player.myShopId]) {
|
||||||
|
ShopHandler.ShopItems[player.myShopId][fromSlot] = itemID + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
boughtItem = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (boughtItem) {
|
||||||
|
player.getActionSender().sendMessage("You bought " + boughtQty + " " + ItemAssistant.getItemName(itemID).toLowerCase() + " for " + TotPrice2 * boughtQty + " coins." );
|
||||||
|
}
|
||||||
player.getItemAssistant().resetItems(3823);
|
player.getItemAssistant().resetItems(3823);
|
||||||
resetShop(player.myShopId);
|
resetShop(player.myShopId);
|
||||||
updatePlayerShop();
|
updatePlayerShop();
|
||||||
return true;
|
return true; //return TRUE / FALSE Update = shop&Inventory / Doesnt Update
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class Bank5 implements PacketType {
|
|||||||
JewelryMaking.mouldItem(player, removeId, 5);
|
JewelryMaking.mouldItem(player, removeId, 5);
|
||||||
break;
|
break;
|
||||||
case 3900:
|
case 3900:
|
||||||
player.getShopAssistant().buyItem(removeId, removeSlot, 1);
|
player.getShopAssistant().buyItem(removeId, removeSlot, 1); //this says 1 in BANKx5 but it's banking 5 for real... strange shit.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3823:
|
case 3823:
|
||||||
|
|||||||
@@ -20,15 +20,21 @@ public class BankAll implements PacketType {
|
|||||||
player.endCurrentTask();
|
player.endCurrentTask();
|
||||||
switch (interfaceId) {
|
switch (interfaceId) {
|
||||||
case 3900:
|
case 3900:
|
||||||
player.getShopAssistant().buyItem(removeId, removeSlot, 10);
|
player.outStream.createFrame(27);
|
||||||
|
player.xRemoveSlot = removeSlot;
|
||||||
|
player.xRemoveId = removeId;
|
||||||
|
player.xInterfaceId = interfaceId;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3823:
|
case 3823:
|
||||||
if(!player.getItemAssistant().playerHasItem(removeId)) {
|
if(!player.getItemAssistant().playerHasItem(removeId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
player.getShopAssistant().sellItem(removeId,
|
|
||||||
removeSlot, player.playerItemsN[removeSlot] );
|
player.outStream.createFrame(27);
|
||||||
|
player.xRemoveSlot = removeSlot;
|
||||||
|
player.xRemoveId = removeId;
|
||||||
|
player.xInterfaceId = interfaceId;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7423:
|
case 7423:
|
||||||
|
|||||||
@@ -20,14 +20,7 @@ public class BankX1 implements PacketType {
|
|||||||
c.xInterfaceId = c.getInStream().readUnsignedWordA();
|
c.xInterfaceId = c.getInStream().readUnsignedWordA();
|
||||||
c.xRemoveId = c.getInStream().readSignedWordBigEndian();
|
c.xRemoveId = c.getInStream().readSignedWordBigEndian();
|
||||||
}
|
}
|
||||||
if (c.xInterfaceId == 3900) {
|
else {
|
||||||
c.getShopAssistant().buyItem(c.xRemoveId, c.xRemoveSlot, 20);// buy
|
|
||||||
// 20
|
|
||||||
c.xRemoveSlot = 0;
|
|
||||||
c.xInterfaceId = 0;
|
|
||||||
c.xRemoveId = 0;
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
if (c.xInterfaceId == 7423) {
|
if (c.xInterfaceId == 7423) {
|
||||||
c.getItemAssistant().bankItem(c.xRemoveId, c.xRemoveSlot,
|
c.getItemAssistant().bankItem(c.xRemoveId, c.xRemoveSlot,
|
||||||
Xamount);// Depo
|
Xamount);// Depo
|
||||||
@@ -35,7 +28,6 @@ public class BankX1 implements PacketType {
|
|||||||
c.getItemAssistant().resetItems(7423);
|
c.getItemAssistant().resetItems(7423);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packetType == PART1) {
|
if (packetType == PART1) {
|
||||||
synchronized (c) {
|
synchronized (c) {
|
||||||
c.getOutStream().createFrame(27);
|
c.getOutStream().createFrame(27);
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ public class BankX2 implements PacketType {
|
|||||||
}
|
}
|
||||||
switch (player.xInterfaceId) {
|
switch (player.xInterfaceId) {
|
||||||
case 5064:
|
case 5064:
|
||||||
/*if(!player.getItemAssistant().playerHasItem(player.playerItems[player.xRemoveSlot], Xamount))
|
|
||||||
return;*/
|
|
||||||
if (player.inPartyRoom) {
|
if (player.inPartyRoom) {
|
||||||
PartyRoom.depositItem(player, player.xRemoveId, player.getItemAssistant().itemAmount(player.playerItems[player.xRemoveSlot]));
|
PartyRoom.depositItem(player, player.xRemoveId, player.getItemAssistant().itemAmount(player.playerItems[player.xRemoveSlot]));
|
||||||
break;
|
break;
|
||||||
@@ -35,8 +33,6 @@ public class BankX2 implements PacketType {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 5382:
|
case 5382:
|
||||||
/*if(!player.getItemAssistant().playerHasItem(player.playerItems[player.xRemoveSlot], Xamount))
|
|
||||||
return;*/
|
|
||||||
player.getItemAssistant().fromBank(player.bankItems[player.xRemoveSlot], player.xRemoveSlot, Xamount);
|
player.getItemAssistant().fromBank(player.bankItems[player.xRemoveSlot], player.xRemoveSlot, Xamount);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -66,6 +62,14 @@ public class BankX2 implements PacketType {
|
|||||||
case 6669:
|
case 6669:
|
||||||
player.getDueling().fromDuel(player.xRemoveId, player.xRemoveSlot, Xamount);
|
player.getDueling().fromDuel(player.xRemoveId, player.xRemoveSlot, Xamount);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 3900:
|
||||||
|
player.getShopAssistant().buyItem(player.xRemoveId, player.xRemoveSlot, Xamount);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3823:
|
||||||
|
player.getShopAssistant().sellItem(player.xRemoveId, player.xRemoveSlot, Xamount);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user