Ok so problem one, I think your issue is in this method
Code:
public boolean buyItem(int itemID, int fromSlot, int amount)
It looks like right here
Code:
if (c.randomPoints >= TotPrice2) {
You are trying to see if the player has enough points to match the coined amount of the item. so maybe change it to this.
Code:
if (c.randomPoints >= getSpecialItemValue(itemID)) {
And that should stop you or at least stop that message from saying you don't have enough points, as it sounds like the first one is telling you, that you don't have enough, But then your handleOtherShop() method thinks that you do have enough points.
And for your second bug:
replace this:
Code:
case SECOND_CLICK:
c.npcClickIndex = c.inStream.readSignedWordBigEndian();
c.npcType = Server.npcHandler.npcs[c.npcClickIndex].npcType;
case 334:
case 233:
case 316:
case 312:
c.getFishing().fish(Server.npcHandler.npcs[c.npcClickIndex], false);
break;
c.NPCClicked = Server.npcHandler.npcs[c.npcClickIndex];
if(c.goodDistance(Server.npcHandler.npcs[c.npcClickIndex].getX(), Server.npcHandler.npcs[c.npcClickIndex].getY(), c.getX(), c.getY(), 1)) {
c.turnPlayerTo(Server.npcHandler.npcs[c.npcClickIndex].getX(), Server.npcHandler.npcs[c.npcClickIndex].getY());
c.getActions().secondClickNpc(c.npcType);
} else {
c.clickNpcType = 2;
}
break;
with this
Code:
case SECOND_CLICK:
c.npcClickIndex = c.inStream.readSignedWordBigEndian();
c.npcType = Server.npcHandler.npcs[c.npcClickIndex].npcType;
case 334:
case 233:
case 316:
case 312:
c.getFishing().fish(Server.npcHandler.npcs[c.npcClickIndex], false);
//break; This break is stopping your code from reaching everything under
// here. Its a common mistake that i used to make a lot.
c.NPCClicked = Server.npcHandler.npcs[c.npcClickIndex];
if(c.goodDistance(Server.npcHandler.npcs[c.npcClickIndex].getX(), Server.npcHandler.npcs[c.npcClickIndex].getY(), c.getX(), c.getY(), 1)) {
c.turnPlayerTo(Server.npcHandler.npcs[c.npcClickIndex].getX(), Server.npcHandler.npcs[c.npcClickIndex].getY());
c.getActions().secondClickNpc(c.npcType);
} else {
c.clickNpcType = 2;
}
break;
I wrote a note of what was happening. You had a break; that was stopping before it reached the rest of the code in that statement giving you your "unreachable statement" error.
I hope this helped good luck.