Jump to content
  • 0

Question

Can anyone help me fix when i buy runes it buys them like 1 at a time

[img]http://i.gyazo.com/38a90d7bb4adbfe2ba2e33b20209ee1a.gif[/img]

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
That's a little tough to do with such little information. Perhaps if you gave us some code to work with, then we could get started. For an example; the method that handles the buying from shops.

Share this post


Link to post
Share on other sites
  • 0
[quote name='Game Master']That's a little tough to do with such little information. Perhaps if you gave us some code to work with, then we could get started. For an example; the method that handles the buying from shops.[/QUOTE]

[QUOTE] public long buyDelay;
public boolean buyItem(int itemID, int fromSlot, int amount) {
if (c.myShopId == 14) {
skillBuy(itemID);
return false;
}
if (amount > 0) {
if(!shopSellsItem(itemID))
return false;
if (amount > ShopHandler.ShopItemsN[c.myShopId][fromSlot]) {
amount = ShopHandler.ShopItemsN[c.myShopId][fromSlot];
}
int TotPrice2 = 0;
int Slot = 0; // Coins
int Slot1 = 0;// Tokkul
if (c.myShopId >= 30) {
handleOtherShop(itemID);
return false;
}
boolean loop = false;
if (amount > 10000) {
TotPrice2 = (int)Math.floor(getItemShopValue(itemID, 0, fromSlot))*amount;
Slot = c.getItems().getItemSlot(995);
if (Slot == -1 && TotPrice2 != 0) {
c.sendMessage("You don't have enough coins.");
}
if(TotPrice2 <= 1) {
TotPrice2 = (int)Math.floor(getItemShopValue(itemID, 0, fromSlot));
}
if (TotPrice2 <= 0) {
if (c.getItems().freeSlotAmount() > 0) {
c.getItems().addItem(itemID, amount);
ShopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
ShopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
if ((fromSlot + 1) > ShopHandler.ShopItemsStandard[c.myShopId]) {
ShopHandler.ShopItems[c.myShopId][fromSlot] = 0;
}
} else {
c.sendMessage("Not enough space in your inventory.");
}
} else if (c.playerItemsN[Slot] >= TotPrice2) {
if (c.getItems().freeSlotAmount() > 0) {
c.getItems().deleteItem(995, c.getItems().getItemSlot(995), TotPrice2);
c.getItems().addItem(itemID, amount);
ShopHandler.ShopItemsN[c.myShopId][fromSlot] -= amount;
ShopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
if ((fromSlot + 1) > ShopHandler.ShopItemsStandard[c.myShopId]) {
ShopHandler.ShopItems[c.myShopId][fromSlot] = 0;
}
} else {
c.sendMessage("Not enough space in your inventory.");
}
} else {
c.sendMessage("You don't have enough coins.");
}
[/QUOTE]

cheers

Share this post


Link to post
Share on other sites
  • 0
It looks like it has something to due with ShopItemsDelay? May possibly be derived from the fromSlot if statement too. However, it's challenging for me to tell, as I'm on my phone and some of these methods are alien to me.

Share this post


Link to post
Share on other sites
  • 0
Honestly I think that looks pretty sick, but anyway

I can't see anything wrong with that method, perhaps it has something to do with this section, but idk.

[QUOTE]if (c.getItems().freeSlotAmount() > 0) {
c.getItems().addItem(itemID, amount);
ShopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
ShopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
if ((fromSlot + 1) > ShopHandler.ShopItemsStandard[c.myShopId]) {
ShopHandler.ShopItems[c.myShopId][fromSlot] = 0;
}[/QUOTE]

does it only happen to runes, or other items too?

Share this post


Link to post
Share on other sites

×