public int sellingId;
public int sellingN;
public int sellingS;
public int playerCollect;
public int playerShop[] = new int[10];
public int playerShopN[] = new int[10];
public int playerShopP[] = new int[10];
public Client myShopClient;

open PlayerSave.java and put this on loading (like above "} else if (token.equals("EP")) {"):
} else if (token.equals("shopcollect")) {
p.playerCollect = Integer.parseInt(token2);
case 10:
if (token.equals("character-shop")) {
p.playerShop[Integer.parseInt(token3[0])] = Integer.parseInt(token3[1]);
p.playerShopP[Integer.parseInt(token3[0])] = Integer.parseInt(token3[2]);
p.playerShopN[Integer.parseInt(token3[0])] = Integer.parseInt(token3[3]);
}
break;
characterfile.write("character-rights = ", 0, 19);
characterfile.write(Integer.toString(p.playerRights), 0, Integer.toString(p.playerRights).length());
characterfile.newLine();
characterfile.write("shopcollect = ", 0, 14);
characterfile.write(Integer.toString(p.playerCollect), 0, Integer.toString(p.playerCollect).length());
characterfile.newLine();
/*SHOP*/
characterfile.write("[SHOP]", 0, 6);
characterfile.newLine();
for (int i = 0; i < p.playerShop.length; i++) {
if (p.playerShop[i] > 0) {
characterfile.write("character-shop = ", 0, 17);
characterfile.write(Integer.toString(i), 0, Integer.toString(i).length());
characterfile.write(" ", 0, 1);
characterfile.write(Integer.toString(p.playerShop[i]), 0, Integer.toString(p.playerShop[i]).length());
characterfile.write(" ", 0, 1);
characterfile.write(Integer.toString(p.playerShopP[i]), 0, Integer.toString(p.playerShopP[i]).length());
characterfile.write(" ", 0, 1);
characterfile.write(Integer.toString(p.playerShopN[i]), 0, Integer.toString(p.playerShopN[i]).length());
characterfile.newLine();
}
}
characterfile.newLine();
Open shopassistant.java
if(c.myShopId == 7390){
return c.myShopClient.playerShopP[fromSlot];
}

public void openPlayerShop(Client o){
if(o == null || o.properLogout)
return;
c.getItems().resetItems(3823);
resetShop(o);
c.myShopClient = o;
c.myShopId = 7390;
c.isShopping = true;
c.getPA().sendFrame248(3824, 3822);
c.getPA().sendFrame126(o.playerName+"s shop!", 3901);
}
public int[] fixArray(int[] array){
int arrayPos = 0;
int[] newArray = new int[array.length];
for(int x = 0; x < array.length; x++){
if(array[x] != 0){
newArray[arrayPos] = array[x];
arrayPos++;
}
}
return newArray;
}
public void fixShop(Client o){
o.playerShop = fixArray(o.playerShop);
o.playerShopN = fixArray(o.playerShopN);
o.playerShopP = fixArray(o.playerShopP);
}
public void resetShop(Client o) {
synchronized(c) {
fixShop(o);
for (int x = 0; x < 10; x++) {
if (o.playerShopN[x] <= 0) {
o.playerShop[x] = 0;
}
}
int TotalItems = 0;
for (int i = 0; i < 10; i++) {
if (o.playerShop[i] > 0) {
TotalItems++;
}
}
if (TotalItems > 10) {
TotalItems = 10;
}
c.getOutStream().createFrameVarSizeWord(53);
c.getOutStream().writeWord(3900);
c.getOutStream().writeWord(TotalItems);
int TotalCount = 0;
for (int i = 0; i < o.playerShop.length; i++) {
if (o.playerShop[i] > 0) {
if (o.playerShopN[i] > 254) {
c.getOutStream().writeByte(255);
c.getOutStream().writeDWord_v2(o.playerShopN[i]);
} else {
c.getOutStream().writeByte(o.playerShopN[i]);
}
c.getOutStream().writeWordBigEndianA((o.playerShop[i]+1));
TotalCount++;
}
if (TotalCount > TotalItems) {
break;
}
}
c.getOutStream().endFrameVarSizeWord();
c.flushOutStream();
}
}
if (c.myShopId == 7390 && c.myShopClient != null && !c.myShopClient.playerName.equals(c.playerName)) {
c.sendMessage(c.getItems().getItemName(removeId)+": currently costs " + c.myShopClient.playerShopP[removeSlot] + " coins.");
return;
}else if (c.myShopId == 7390 && c.myShopClient != null && c.myShopClient.playerName.equals(c.playerName)) {
c.sendMessage(c.getItems().getItemName(removeId)+": currently costs " + c.playerShopP[removeSlot] + " coins.");
return;
}
then search for "sellToShopPrice"
and under it add
if(c.myShopId == 7390){
c.sendMessage("You choose your price when using POS.");
return;
}
then scroll down a lil or search for "sellItem" and under add
if(c.myShopId == 7390){
for (int i : Config.ITEM_TRADEABLE) {
if(i == itemID) {
c.sendMessage("You can't sell this item.");
return false;
}
}
if(c.playerName.equals(c.myShopClient.playerName)){
c.sellingId = itemID;
c.sellingN = amount;
c.sellingS = fromSlot;
c.xInterfaceId = 7390;
c.outStream.createFrame(27);
}else{
c.sendMessage("You can only sell items on your own store.");
}
return true;
}
then for the last part this class
search for buyItem and under it add alll this
if(c.myShopId == 7390 && c.myShopClient != null && !c.myShopClient.properLogout && !c.playerName.equals(c.myShopClient.playerName)){
int bought = 0;
int price = c.myShopClient.playerShopP[fromSlot];
if(amount > c.myShopClient.playerShopN[fromSlot])
amount = c.myShopClient.playerShopN[fromSlot];
for(int x = 0; x < amount; x++){
if(c.getItems().playerHasItem(995, c.myShopClient.playerShopP[fromSlot]) && c.getItems().freeSlots() > 0){
c.getItems().deleteItem2(995, c.myShopClient.playerShopP[fromSlot]);
c.getItems().addItem(c.myShopClient.playerShop[fromSlot], 1);
c.myShopClient.playerShopN[fromSlot]--;
c.myShopClient.playerCollect += c.myShopClient.playerShopP[fromSlot];
if(c.myShopClient.playerShopN[fromSlot] == 0){
c.myShopClient.playerShop[fromSlot] = 0;
c.myShopClient.playerShopP[fromSlot] = 0;
}
bought++;
}else{
c.sendMessage("Not enought space or money.");
break;
}
}
if(bought > 0){
resetShop(c.myShopClient);
c.getItems().resetItems(3823);;
c.sendMessage("You just bought "+bought+" "+c.getItems().getItemName(itemID)+" for "+ (bought*price));
c.myShopClient.sendMessage(c.playerName+" has bought "+bought+" "+c.getItems().getItemName(itemID)+" from you!");
c.myShopClient.sendMessage("You now have "+c.myShopClient.playerCollect+" coins to collect
:collect)");
}
return false;
}else if(c.myShopId == 7390 && c.myShopClient != null && !c.myShopClient.properLogout && c.playerName.equals(c.myShopClient.playerName)){
if(amount > c.myShopClient.playerShopN[fromSlot])
amount = c.myShopClient.playerShopN[fromSlot];
for(int x = 0; x < amount; x++){
if(c.getItems().freeSlots() > 0){
c.getItems().addItem(c.myShopClient.playerShop[fromSlot], 1);
c.myShopClient.playerShopN[fromSlot]--;
if(c.myShopClient.playerShopN[fromSlot] == 0){
c.myShopClient.playerShop[fromSlot] = 0;
c.myShopClient.playerShopP[fromSlot] = 0;
fixShop(c);
}
}else{
c.sendMessage("Not enought space.");
break;
}
}
resetShop(c.myShopClient);
c.getItems().resetItems(3823);
return false;
}else if(c.myShopId == 7390){
return false;
}
now open BankX2(at packets) and add following under "int Xamount = c.getInStream().readDWord();"
if(c.sellingId > 0 && c.sellingN > 0 && c.xInterfaceId == 7390){
for (int i : Config.ITEM_TRADEABLE) {
if(i == c.sellingId) {
c.sendMessage("You can't sell this item.");
c.sellingId = 0;
c.sellingN = 0;
c.sellingS = 0;
return;
}
}
if(c.sellingN > c.getItems().getItemAmount(c.sellingId))
c.sellingN = c.getItems().getItemAmount(c.sellingId);
int slot = -1;
for(int x = 0; x < 10; x++){
if(c.playerShop[x] == 0){
slot = x;
break;
}
}
if(slot == -1){
c.sendMessage("You can only be selling 10 items at once!");
c.sellingId = 0;
c.sellingN = 0;
c.sellingS = 0;
return;
}
if(c.getItems().playerHasItem(c.sellingId, c.sellingN, c.sellingS)){
c.getItems().deleteItem2(c.sellingId, c.sellingN);
c.playerShop[slot] = c.sellingId;
c.playerShopN[slot] = c.sellingN;
c.playerShopP[slot] = Xamount;
c.sendMessage("You put your items on sale.");
c.sendMessage("Check your items by using ::myshop and collect coins ::collect");
}
c.getShops().openPlayerShop(c);
c.sellingId = 0;
c.sellingN = 0;
c.sellingS = 0;
return;
}
if(playerCommand.equalsIgnoreCase("collect")){
if(c.playerCollect > 0){
c.sendMessage("You succesfully collected "+c.playerCollect+" coins.");
c.getItems().addItem(995, c.playerCollect);
c.playerCollect = 0;
}else{
c.sendMessage("You dont have anything to collect");
}
}
if(playerCommand.equalsIgnoreCase("myshop")){
if(c.absX > 2527 && c.absX < 2634 && c.absY > 3066 && c.absY < 3115){
c.getShops().openPlayerShop(c);
}else
c.sendMessage("You can only view your shops in home.");
}
No worries, it wont attack anyone nor cause
if(!Server.playerHandler.players[c.playerIndex].inWild() && !Server.playerHandler.players[c.playerIndex].inDuelArena()) {
c.getShops().openPlayerShop((Client)Server.playerHandler.players[c.playerIndex]);
c.getCombat().resetPlayerAttack();
return false;
}
Open client.java and search for "getPA().showOption(3, 0, "Attack", 1);"
} else if (!inWild() && !inDuelArena() && safeTimer <= 0 && !inGWD() && !inPcBoat() && !inPcGame()){ //this makes it so attack option is visible on wild and challenge in duel =)
getPA().showOption(3, 0, "View shop", 1);
getPA().walkableInterface(-1);
public int sellingId;
public int sellingN;
public int sellingS;
public int playerCollect;
public int playerShop[] = new int[10];
public int playerShopN[] = new int[10];
public int playerShopP[] = new int[10];
public Client myShopClient;

open PlayerSave.java and put this on loading (like above "} else if (token.equals("EP")) {"):
} else if (token.equals("shopcollect")) {
p.playerCollect = Integer.parseInt(token2);
case 10:
if (token.equals("character-shop")) {
p.playerShop[Integer.parseInt(token3[0])] = Integer.parseInt(token3[1]);
p.playerShopP[Integer.parseInt(token3[0])] = Integer.parseInt(token3[2]);
p.playerShopN[Integer.parseInt(token3[0])] = Integer.parseInt(token3[3]);
}
break;
characterfile.write("character-rights = ", 0, 19);
characterfile.write(Integer.toString(p.playerRights), 0, Integer.toString(p.playerRights).length());
characterfile.newLine();
characterfile.write("shopcollect = ", 0, 14);
characterfile.write(Integer.toString(p.playerCollect), 0, Integer.toString(p.playerCollect).length());
characterfile.newLine();
/*SHOP*/
characterfile.write("[SHOP]", 0, 6);
characterfile.newLine();
for (int i = 0; i < p.playerShop.length; i++) {
if (p.playerShop[i] > 0) {
characterfile.write("character-shop = ", 0, 17);
characterfile.write(Integer.toString(i), 0, Integer.toString(i).length());
characterfile.write(" ", 0, 1);
characterfile.write(Integer.toString(p.playerShop[i]), 0, Integer.toString(p.playerShop[i]).length());
characterfile.write(" ", 0, 1);
characterfile.write(Integer.toString(p.playerShopP[i]), 0, Integer.toString(p.playerShopP[i]).length());
characterfile.write(" ", 0, 1);
characterfile.write(Integer.toString(p.playerShopN[i]), 0, Integer.toString(p.playerShopN[i]).length());
characterfile.newLine();
}
}
characterfile.newLine();
Open shopassistant.java
if(c.myShopId == 7390){
return c.myShopClient.playerShopP[fromSlot];
}

public void openPlayerShop(Client o){
if(o == null || o.properLogout)
return;
c.getItems().resetItems(3823);
resetShop(o);
c.myShopClient = o;
c.myShopId = 7390;
c.isShopping = true;
c.getPA().sendFrame248(3824, 3822);
c.getPA().sendFrame126(o.playerName+"s shop!", 3901);
}
public int[] fixArray(int[] array){
int arrayPos = 0;
int[] newArray = new int[array.length];
for(int x = 0; x < array.length; x++){
if(array[x] != 0){
newArray[arrayPos] = array[x];
arrayPos++;
}
}
return newArray;
}
public void fixShop(Client o){
o.playerShop = fixArray(o.playerShop);
o.playerShopN = fixArray(o.playerShopN);
o.playerShopP = fixArray(o.playerShopP);
}
public void resetShop(Client o) {
synchronized(c) {
fixShop(o);
for (int x = 0; x < 10; x++) {
if (o.playerShopN[x] <= 0) {
o.playerShop[x] = 0;
}
}
int TotalItems = 0;
for (int i = 0; i < 10; i++) {
if (o.playerShop[i] > 0) {
TotalItems++;
}
}
if (TotalItems > 10) {
TotalItems = 10;
}
c.getOutStream().createFrameVarSizeWord(53);
c.getOutStream().writeWord(3900);
c.getOutStream().writeWord(TotalItems);
int TotalCount = 0;
for (int i = 0; i < o.playerShop.length; i++) {
if (o.playerShop[i] > 0) {
if (o.playerShopN[i] > 254) {
c.getOutStream().writeByte(255);
c.getOutStream().writeDWord_v2(o.playerShopN[i]);
} else {
c.getOutStream().writeByte(o.playerShopN[i]);
}
c.getOutStream().writeWordBigEndianA((o.playerShop[i]+1));
TotalCount++;
}
if (TotalCount > TotalItems) {
break;
}
}
c.getOutStream().endFrameVarSizeWord();
c.flushOutStream();
}
}
if (c.myShopId == 7390 && c.myShopClient != null && !c.myShopClient.playerName.equals(c.playerName)) {
c.sendMessage(c.getItems().getItemName(removeId)+": currently costs " + c.myShopClient.playerShopP[removeSlot] + " coins.");
return;
}else if (c.myShopId == 7390 && c.myShopClient != null && c.myShopClient.playerName.equals(c.playerName)) {
c.sendMessage(c.getItems().getItemName(removeId)+": currently costs " + c.playerShopP[removeSlot] + " coins.");
return;
}
then search for "sellToShopPrice"
and under it add
if(c.myShopId == 7390){
c.sendMessage("You choose your price when using POS.");
return;
}
then scroll down a lil or search for "sellItem" and under add
if(c.myShopId == 7390){
for (int i : Config.ITEM_TRADEABLE) {
if(i == itemID) {
c.sendMessage("You can't sell this item.");
return false;
}
}
if(c.playerName.equals(c.myShopClient.playerName)){
c.sellingId = itemID;
c.sellingN = amount;
c.sellingS = fromSlot;
c.xInterfaceId = 7390;
c.outStream.createFrame(27);
}else{
c.sendMessage("You can only sell items on your own store.");
}
return true;
}
then for the last part this class
search for buyItem and under it add alll this
if(c.myShopId == 7390 && c.myShopClient != null && !c.myShopClient.properLogout && !c.playerName.equals(c.myShopClient.playerName)){
int bought = 0;
int price = c.myShopClient.playerShopP[fromSlot];
if(amount > c.myShopClient.playerShopN[fromSlot])
amount = c.myShopClient.playerShopN[fromSlot];
for(int x = 0; x < amount; x++){
if(c.getItems().playerHasItem(995, c.myShopClient.playerShopP[fromSlot]) && c.getItems().freeSlots() > 0){
c.getItems().deleteItem2(995, c.myShopClient.playerShopP[fromSlot]);
c.getItems().addItem(c.myShopClient.playerShop[fromSlot], 1);
c.myShopClient.playerShopN[fromSlot]--;
c.myShopClient.playerCollect += c.myShopClient.playerShopP[fromSlot];
if(c.myShopClient.playerShopN[fromSlot] == 0){
c.myShopClient.playerShop[fromSlot] = 0;
c.myShopClient.playerShopP[fromSlot] = 0;
}
bought++;
}else{
c.sendMessage("Not enought space or money.");
break;
}
}
if(bought > 0){
resetShop(c.myShopClient);
c.getItems().resetItems(3823);;
c.sendMessage("You just bought "+bought+" "+c.getItems().getItemName(itemID)+" for "+ (bought*price));
c.myShopClient.sendMessage(c.playerName+" has bought "+bought+" "+c.getItems().getItemName(itemID)+" from you!");
c.myShopClient.sendMessage("You now have "+c.myShopClient.playerCollect+" coins to collect
:collect)");
}
return false;
}else if(c.myShopId == 7390 && c.myShopClient != null && !c.myShopClient.properLogout && c.playerName.equals(c.myShopClient.playerName)){
if(amount > c.myShopClient.playerShopN[fromSlot])
amount = c.myShopClient.playerShopN[fromSlot];
for(int x = 0; x < amount; x++){
if(c.getItems().freeSlots() > 0){
c.getItems().addItem(c.myShopClient.playerShop[fromSlot], 1);
c.myShopClient.playerShopN[fromSlot]--;
if(c.myShopClient.playerShopN[fromSlot] == 0){
c.myShopClient.playerShop[fromSlot] = 0;
c.myShopClient.playerShopP[fromSlot] = 0;
fixShop(c);
}
}else{
c.sendMessage("Not enought space.");
break;
}
}
resetShop(c.myShopClient);
c.getItems().resetItems(3823);
return false;
}else if(c.myShopId == 7390){
return false;
}
now open BankX2(at packets) and add following under "int Xamount = c.getInStream().readDWord();"
if(c.sellingId > 0 && c.sellingN > 0 && c.xInterfaceId == 7390){
for (int i : Config.ITEM_TRADEABLE) {
if(i == c.sellingId) {
c.sendMessage("You can't sell this item.");
c.sellingId = 0;
c.sellingN = 0;
c.sellingS = 0;
return;
}
}
if(c.sellingN > c.getItems().getItemAmount(c.sellingId))
c.sellingN = c.getItems().getItemAmount(c.sellingId);
int slot = -1;
for(int x = 0; x < 10; x++){
if(c.playerShop[x] == 0){
slot = x;
break;
}
}
if(slot == -1){
c.sendMessage("You can only be selling 10 items at once!");
c.sellingId = 0;
c.sellingN = 0;
c.sellingS = 0;
return;
}
if(c.getItems().playerHasItem(c.sellingId, c.sellingN, c.sellingS)){
c.getItems().deleteItem2(c.sellingId, c.sellingN);
c.playerShop[slot] = c.sellingId;
c.playerShopN[slot] = c.sellingN;
c.playerShopP[slot] = Xamount;
c.sendMessage("You put your items on sale.");
c.sendMessage("Check your items by using ::myshop and collect coins ::collect");
}
c.getShops().openPlayerShop(c);
c.sellingId = 0;
c.sellingN = 0;
c.sellingS = 0;
return;
}
if(playerCommand.equalsIgnoreCase("collect")){
if(c.playerCollect > 0){
c.sendMessage("You succesfully collected "+c.playerCollect+" coins.");
c.getItems().addItem(995, c.playerCollect);
c.playerCollect = 0;
}else{
c.sendMessage("You dont have anything to collect");
}
}
if(playerCommand.equalsIgnoreCase("myshop")){
if(c.absX > 2527 && c.absX < 2634 && c.absY > 3066 && c.absY < 3115){
c.getShops().openPlayerShop(c);
}else
c.sendMessage("You can only view your shops in home.");
}
No worries, it wont attack anyone nor cause
if(!Server.playerHandler.players[c.playerIndex].inWild() && !Server.playerHandler.players[c.playerIndex].inDuelArena()) {
c.getShops().openPlayerShop((Client)Server.playerHandler.players[c.playerIndex]);
c.getCombat().resetPlayerAttack();
return false;
}
Open client.java and search for "getPA().showOption(3, 0, "Attack", 1);"
} else if (!inWild() && !inDuelArena() && safeTimer <= 0 && !inGWD() && !inPcBoat() && !inPcGame()){ //this makes it so attack option is visible on wild and challenge in duel =)
getPA().showOption(3, 0, "View shop", 1);
getPA().walkableInterface(-1);
Copyright © 2026, NextGenUpdate.
All Rights Reserved.