Before I start, I know this is simple knowledge but I couldn't find anything about it nor do I see a lot of PI servers with boss points so I thought I'd show everyone, lel . Post any errors you receive below and I'll help you with it.
Assumed Knowledge: How to Copy/Paste, Patience
Files Editted: Playersave.java, Player.java (Rest are optional), Shops.cfg, ShopAssistant.java, NPCHandler.java, ActionHandler.java
Difficulty: 1/10
Average Time Used: 5 Minutes, JUST 5 MINUTES -_-
First, in PlayerSave.java, search for
Code:
} else if (token.equals("pkPoints")) {
p.pkPoints = Integer.parseInt(token2);
Now below that, paste this
Code:
} else if (token.equals("bossPoints")) {
p.bossPoints = Integer.parseInt(token2);
While still in PlayerSave, search for this
Code:
characterfile.newLine();
characterfile.write("pkPoints = ", 0, ("pkPoints = ").length());
characterfile.write(Integer.toString(p.pkPoints), 0, Integer.toString(p.pkPoints).length());
Below that, paste this ...
Code:
characterfile.newLine();
characterfile.write("bossPoints = ", 0, ("bossPoints = ").length());
characterfile.write(Integer.toString(p.bossPoints), 0, Integer.toString(p.bossPoints).length());
Now save and close that and go to Player.java.
Once you're in Player.java, search for
Right below that, paste...
Save and compile and there you go!
This is optional but if you want a NPC to give you boss points...
In NPCHandler.java, search for...
Code:
if (npcs[i].npcType == 253) {
c.votePoints += 1;
}
Also, if that doesn't work, try searching just for
Code:
if (npcs[i].npcType ==
and just put this under that method...
Code:
if (npcs[i].npcType == ###) { //npcID as the ### you want to give the points
c.bossPoints += 1; //change the 1 to what however many points you want the NPC to give
}
Save and compile and now that NPC gives you bossing points!
This is optional but if you want a boss point shop....
Open up your ShopAssistant.java and search for...
Code:
c.sendMessage("You don't have enough PC Points.");
break;
}
}
Below that method, paste this below the last " } "...
Code:
else if(c. myShopId == ##) { //shop id you want to be boss point shop
if (c.bossPoints >= TotPrice2) {
if (c.getItems().freeSlots() > 0) {
c.bossPoints -= TotPrice2;
c.getItems().addItem(itemID, 1);
Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
}
} else {
c.sendMessage("You don't have enough space in your inventory.");
break;
}
} else {
c.sendMessage("@red@You don't have enough boss points.");
break;
}
}
After that, save and close that and open up Shops.cfg and paste this somewhere after a shop
Code:
shop = ## Boss_Point_Exchange 2 2 (itemIDhere) (itemAmounthere) (itemIDhere) (itemAmounthere)
Replace that ## with the same number you used in ShopAssistant.java as the bossPoints shop.
MAKE SURE THE ## YOU USE IT A POINTS SHOP. In most PI servers, just try something above 20 or 30, it should be considered a point shop then.
Now save and close that and then finally , open ActionHandler.java and search for this...
Code:
case 528:
c.getShops().openShop(1);
break;
or search for this...
Code:
case 461:
c.getShops().openShop(2);
break;
Now below one of the "break;"s, put this...
Code:
case ###: //replace the ## with whatever NPC you want to open the shop
c.getShops().openShop(##); //replace the ## with the shop = ## number you used in Shops.cfg
break;
Save and compile and now, you've added boss points, a boss points shop, and NPCs of your choice give boss points!
If you have any errors, just post it below and I'll tell you how to fix.
Please use the Thanks button if you use this. This is my first tutorial so yes, it's kind of noobish . ._.