pretty sure u gotta modify the buyitem method
|
Need to make it so I can buy more than 1 item at a time. Any help? Even if I push buy 100, it still takes cost of 1 let's say fire cape and only gives 1 fire cape.
I know I need to change something with c.getItems().addItem(itemID, 1); but I'm not sure about what to put as itemAmount doesn't work. Any help?Code:public void handleOtherShop(int itemID) { if (c.myShopId == 8) { if (c.pkp >= getSpecialItemValue(itemID)) { if (c.getItems().freeSlots() > 0) { c.pkp -= getSpecialItemValue(itemID); c.getPA().loadQuests(); c.getItems().addItem(itemID, 1); c.getItems().resetItems(3823); c.getPA().sendFrame126( "@whi@Pk Points: @gre@" + c.pkp + " ", 7333); } } else { c.sendMessage("You do not have enough pk points to buy this item."); }
pretty sure u gotta modify the buyitem method
You're entirely right. The buyItem method parameters already support the concept of buying more than one of a certain item. The real problem is the 'handleOtherShop' method. You need to directly modify this method. It should look something along the lines of;
Code:void handleOtherShop(int itemId, int itemAmount) { //check and see if the player has enough room //check if the player has enough currency for the amount they want to buy //increase amount given and currency taken away based on the cost * amount }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |