Thread: [PI] Making Boss Points System Tut

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 [PI] Making Boss Points System Tut 
    Blow Coke, Not Kisses.
    King Bibby's Avatar
    Join Date
    May 2014
    Posts
    33
    Thanks given
    6
    Thanks received
    1
    Rep Power
    9
    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
    Code:
    	pkPoints,
    Right below that, paste...
    Code:
    	bossPoints,
    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 . ._.
    If he don't get down, make him lay down - If he try to run, get chased down.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jun 2014
    Posts
    9
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Rad, it'll help some people =)
    Quote Originally Posted by focus clutch View Post
    Can I build a snow man on this server? Doesn't have to be a snowman.
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Jun 2014
    Posts
    89
    Thanks given
    0
    Thanks received
    9
    Rep Power
    0
    Horrible way to do it.
    Reply With Quote  
     

  4. #4  
    Blow Coke, Not Kisses.
    King Bibby's Avatar
    Join Date
    May 2014
    Posts
    33
    Thanks given
    6
    Thanks received
    1
    Rep Power
    9
    Quote Originally Posted by The Blaze View Post
    Horrible way to do it.
    But it works , doesn't it? Shut the hell up and stop worrying about how to do it if it works.
    Also, I'd love to see your way of doing it. Please show me your tutorial with more work put into it than this, I would love to see your better way of doing it. Didn't think so.

    Quote Originally Posted by ImTheOne View Post
    Rad, it'll help some people =)
    Haha, hope it does.
    If he don't get down, make him lay down - If he try to run, get chased down.
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Myre


    Join Date
    Apr 2012
    Age
    26
    Posts
    1,519
    Thanks given
    407
    Thanks received
    367
    Rep Power
    475
    Quote Originally Posted by Skilled TS View Post
    But it works , doesn't it? Shut the hell up and stop worrying about how to do it if it works.
    Also, I'd love to see your way of doing it. Please show me your tutorial with more work put into it than this, I would love to see your better way of doing it. Didn't think so.
    It's a bad mentality to set if you think like that, especially with your code.. Code can always be improvised, shortened or find a better usage.

    Alright with the contribution although it has been done before.
    Use code tags next time.
    Reply With Quote  
     

  7. Thankful user:


  8. #6  
    (Official) Thanksgiver

    Arham's Avatar
    Join Date
    Jan 2013
    Age
    23
    Posts
    3,415
    Thanks given
    7,254
    Thanks received
    1,938
    Rep Power
    3905
    Quote Originally Posted by The Blaze View Post
    Horrible way to do it.
    To be honest with you, I don't see anything wrong in the code itself. Are you talking about placement? Then I can't really judge, I don't use PI.
    Attached image
    Attached image
    Quote Originally Posted by MrClassic View Post
    Arham is the official thanker!
    List of my work here!
    Reply With Quote  
     

  9. #7  
    Banned
    Join Date
    Jun 2014
    Posts
    89
    Thanks given
    0
    Thanks received
    9
    Rep Power
    0
    Quote Originally Posted by Skilled TS View Post
    But it works , doesn't it? Shut the hell up and stop worrying about how to do it if it works.
    Also, I'd love to see your way of doing it. Please show me your tutorial with more work put into it than this, I would love to see your better way of doing it. Didn't think so.
    Why would I make a tutorial just for you? Also what's with this playersave crap?
    Reply With Quote  
     

  10. #8  
    Blow Coke, Not Kisses.
    King Bibby's Avatar
    Join Date
    May 2014
    Posts
    33
    Thanks given
    6
    Thanks received
    1
    Rep Power
    9
    Quote Originally Posted by The Blaze View Post
    Why would I make a tutorial just for you? Also what's with this playersave crap?
    You criticize my work like something is wrong with it, it works just like a Pkp system , just with NPCs giving it instead.
    If you can do better, prove it. If not, don't complain.

    Quote Originally Posted by iRize View Post
    It's a bad mentality to set if you think like that, especially with your code.. Code can always be improvised, shortened or find a better usage.

    Alright with the contribution although it has been done before.
    Use code tags next time.
    Thanks for not being a douche about it like the other guy. I'll try to find a better way to do it if there is one.
    If he don't get down, make him lay down - If he try to run, get chased down.
    Reply With Quote  
     

  11. #9  
    Registered Member
    Join Date
    Dec 2010
    Posts
    354
    Thanks given
    17
    Thanks received
    61
    Rep Power
    47
    Thought we were done with these tuts 3 years ago. It's not terrible or anything but really has been released tons of times(even if it has been "boss" points you can look at a pk points tutorial and just change it a bit) only think I can think of that you can do to improve this more is using getters and setters.
    Reply With Quote  
     

  12. Thankful users:


  13. #10  
    Banned [PI] Making Boss Points System Tut Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    tragically generic
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PI] Adding a Point System
    By Radiation in forum Snippets
    Replies: 51
    Last Post: 05-15-2014, 05:02 AM
  2. [HELP] Boss point system error [PI]
    By Famouz in forum Help
    Replies: 6
    Last Post: 08-02-2013, 12:32 PM
  3. PI anti pk point system fails
    By 1defk0 in forum Help
    Replies: 0
    Last Post: 03-27-2013, 08:10 PM
  4. [PI] Vote for points system with shop etc.. $
    By Raw Envy in forum Buying
    Replies: 1
    Last Post: 09-02-2011, 08:26 PM
  5. [PI] Making a webclient ?? any tuts?
    By T-Sex in forum Requests
    Replies: 0
    Last Post: 10-22-2010, 12:18 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •