Thread: [718 basic boss rating/points system 718 snippet]

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 [718 basic boss rating/points system 718 snippet] 
    Registered Member im insane's Avatar
    Join Date
    Jul 2013
    Posts
    203
    Thanks given
    11
    Thanks received
    4
    Rep Power
    13
    Hello rune-server and welcome to my first RSPS tutorial

    Difficulty 1/10
    Basic java knowledge.. is needed if not i recommend [Only registered and activated users can see links. ]

    Firstly, go in to your npc class

    and search for this

    Code:
    public void drop() {
    and underneath this

    Code:
    Drop[] drops = NPCDrops.getDrops(id);
                if (drops == null) {
                    return;
    }
                Player killer = getMostDamageReceivedSourcePlayer();


    Add this

    Code:
    if (this.getId() == xxxxx) {
                killer.PLAYER.JAVA VARIABLE HERE += xxxxx;
                killer.BossRating += xxxxx;
                killer.sm("You now have "+ killer.(YOUR VARIABLE THAT YOU CREATED INPLAYER.JAVA HERE +" YOUR POINTS NAME HERE");
                killer.sm("You now have a boss killing rating of "+ killer.BossRating +" ");
                }
    And you can keep adding this little bit of code underneath each other for how many bosses you would like to give points for killing them to
    AND ON THE XXXXX bits of code you need to change the if (this.getId() == 'xxxxxx') { to the id of the npc you would like to obtain points from for killing them, and so forth
    dont close the npc.java class just yet because you will need to edit the your variable here parts

    Open up your player.java class and these with your other variables they should be easy to locate just scroll down a little bit from all the imports and look for code indentical to these variables

    Code:
    public int BossRating = 0;
            public int ArmadylPoints = 0;
            public int BandosPoints = 0;
            public int SaradominPoints = 0;
            public int NexPoints = 0;
            public int ZamorakPoints = 0;
    save, and then back to your npc.java class

    Code:
    killer.PLAYER.JAVA VARIABLE HERE
    Edit the player.java variable here part with this for example

    killer.ArmadylPoints += 1;

    and edit all the xxxxx's parts in the npc.java class code i gave to you on step one to the amount of points/boss rating score you want your player to recieve per kill


    If you would like to add a shop for this here is a basic dialogue for spending the points edit however you want to what items you want for rewards/the amount of points needed ect.ect.
    Place this folder in src/com/rs/game/player/dialogues Save as ArmadylPoint.java

    Code:
    package com.rs.game.player.dialogues;
    
    public class ArmadylPoint extends Dialogue {
    
    	int npcId;
    
    	@Override
    	public void start() {
    		npcId = (Integer) parameters[0];
    		sendNPCDialogue(npcId, 9827, "Spend your Armadyl points here." );
    	}
    	@Override
    	public void run(int interfaceId, int componentId) {
    		if (stage == -1) {
    			stage = 0;
    			sendOptionsDialogue("Armadyl point shop",
    					"Armadyl Staff (200)",
    					"Armadyl Range set (350)",
    					"Armadyl Hilt(500)",
    					"Armadyl Rune armour set(150)",
    					"Oracle Of Balance(250)");
    		} else if (stage == 0) {
    			if (componentId == OPTION_1) {
    				if (player.ArmadylPoints >= 200) {
    					player.getInventory().addItem(21777, 1);
    					player.ArmadylPoints -= 200;
    					player.sm("you have "+player.ArmadylPoints +" Armadyl points left");
    				} else {
    					player.sm("you need 200 Armadylpoints to purchase this");
    				}
    				end();
    			} else if (componentId == OPTION_2) {
    				if (player.ArmadylPoints >= 350) {
    					player.getInventory().addItem(11718, 1);
                                            player.getInventory().addItem(11720, 1);
                                            player.getInventory().addItem(11722, 1);
                                            player.getInventory().addItem(25010, 1);
                                            player.getInventory().addItem(25013, 1);
                                            player.getInventory().addItem(25016, 1);
    					player.ArmadylPoints -= 350;
    					player.sm("you have "+player.ArmadylPoints +" points left");
    				} else {
    					player.sm("you need 350 Armadyl points to buy this");
    				}
    				end();
    			} else if (componentId == OPTION_3) {
    				if (player.ArmadylPoints >= 500) {
    					player.getInventory().addItem(11702, 1);
    					player.ArmadylPoints -= 500;
    					player.sm("you have "+player.ArmadylPoints +" points left");
    				} else {
    					player.sm("you need 500 Armadyl points to buy this.");
    				}
    				end();
    			} else if (componentId == OPTION_4) {
    				if (player.ArmadylPoints >= 150) {
    					player.getInventory().addItem(19413, 1);
                                            player.getInventory().addItem(19416, 1);
                                            player.getInventory().addItem(19419, 1);
                                            player.getInventory().addItem(19422, 1);
                                            player.getInventory().addItem(19425, 1);
    					player.ArmadylPoints -= 150;
    					player.sm("you have "+player.ArmadylPoints +" points left");
    				} else {
    					player.sm("you need 150 ArmadylPoints to buy this");
    				}
    				end();
    			} else if (componentId == OPTION_5) {
    				if (player.ArmadylPoints >= 250) {
    					player.getAppearence().setTitle(475);
    					player.ArmadylPoints -= 250;
    					player.sm("you have "+player.ArmadylPoints +" points left");
    				} else {
    					player.sm("you need 250 Armadyl points to buy this");
    				}
    				end();
    				
    			}
    		}
    	}
    
    	@Override
    	public void finish() {
    
    	}
    
    }
    Thanks for reading my snippet/tutorial and no hate please as this is my first one, and it is very basic but should hopefully be understandable for the noobies at java programming

    If anyone has any problems post here, if that still doesnt help you then yet again i recommend..... [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]


    Don't eat at mcdonalds kids...its genocide on a plate but they don't want you to know that.....

    Reply With Quote  
     

  2. #2  
    Aganoth Developer

    Aust1n's Avatar
    Join Date
    Aug 2012
    Posts
    1,862
    Thanks given
    280
    Thanks received
    406
    Rep Power
    60
    Thanks for Contributing, this will help some people.



    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member im insane's Avatar
    Join Date
    Jul 2013
    Posts
    203
    Thanks given
    11
    Thanks received
    4
    Rep Power
    13
    Thanks, it should help a few out, like i say its very basic but its detailed enough so even the newest of coders can do this
    [Only registered and activated users can see links. ]


    Don't eat at mcdonalds kids...its genocide on a plate but they don't want you to know that.....

    Reply With Quote  
     

  4. #4  
    Registered Member Rich guy's Avatar
    Join Date
    May 2013
    Posts
    759
    Thanks given
    33
    Thanks received
    30
    Rep Power
    43
    Thanks for Contributing
    "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.” ― Albert Einstein
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2013
    Posts
    37
    Thanks given
    4
    Thanks received
    4
    Rep Power
    11
    This has been posted many times before but I guess this would be more of a tutorial, also you can shorten the length of all the ints by declaring them like
    Code:
    public int BossRating, ArmadylPoints, etc;
    instead of
    Code:
    public int BossRating = 0;
    public int ArmadylPoints = 0;
    Reply With Quote  
     

  6. #6  
    Registered Member im insane's Avatar
    Join Date
    Jul 2013
    Posts
    203
    Thanks given
    11
    Thanks received
    4
    Rep Power
    13
    Quote Originally Posted by Third Age View Post
    This has been posted many times before but I guess this would be more of a tutorial, also you can shorten the length of all the ints by declaring them like
    Code:
    public int BossRating, ArmadylPoints, etc;
    instead of
    Code:
    public int BossRating = 0;
    public int ArmadylPoints = 0;
    No it actually hasn't been posted before? because this is what i use for my server....but yeah thanks for the suggestion
    [Only registered and activated users can see links. ]


    Don't eat at mcdonalds kids...its genocide on a plate but they don't want you to know that.....

    Reply With Quote  
     

  7. #7  
    Registered Member Grown's Avatar
    Join Date
    Oct 2012
    Posts
    839
    Thanks given
    647
    Thanks received
    86
    Rep Power
    54
    Not much to it, but good snippet. Thanks for the contribution.
    "Programs aren’t just built in one go, like a bridge. They are talked about,
    sketched out, prototyped, played with, refactored, tuned, tested, tweaked,
    deleted, rewritten....
    A program is not built; it is grown.
    Because a program is always growing and always changing, it must be written
    with change in mind."
    Reply With Quote  
     

  8. #8  
    Registered Member im insane's Avatar
    Join Date
    Jul 2013
    Posts
    203
    Thanks given
    11
    Thanks received
    4
    Rep Power
    13
    Quote Originally Posted by Afghan Dream View Post
    Not much to it, but good snippet. Thanks for the contribution.
    Yep, There'll probably be more to come in the future, i'm sticking with my 718 base, so i'll learn alot of new stuff, and share it with the community, because whats the point in knowledge if you cant share it?
    [Only registered and activated users can see links. ]


    Don't eat at mcdonalds kids...its genocide on a plate but they don't want you to know that.....

    Reply With Quote  
     

  9. #9  
    私はちょうど何が重要か

    Jae`'s Avatar
    Join Date
    Mar 2012
    Posts
    1,496
    Thanks given
    236
    Thanks received
    246
    Rep Power
    79
    nice share, beat me to it.
    Reply With Quote  
     

  10. #10  
    Registered Member Grown's Avatar
    Join Date
    Oct 2012
    Posts
    839
    Thanks given
    647
    Thanks received
    86
    Rep Power
    54
    Quote Originally Posted by im insane View Post
    Yep, There'll probably be more to come in the future, i'm sticking with my 718 base, so i'll learn alot of new stuff, and share it with the community, because whats the point in knowledge if you cant share it?


    Knowledge is freedom
    We are anonymous
    We are legion
    We do not forgive
    We do not forget
    Expect us
    That's great.

    Don't start with that anonymous bullshit.
    "Programs aren’t just built in one go, like a bridge. They are talked about,
    sketched out, prototyped, played with, refactored, tuned, tested, tweaked,
    deleted, rewritten....
    A program is not built; it is grown.
    Because a program is always growing and always changing, it must be written
    with change in mind."
    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. [718+] Basic LootShare System
    By kalo93 in forum Tutorials
    Replies: 49
    Last Post: 02-20-2016, 01:31 AM
  2. [667-718] - Looking for PK point system!!
    By berke203 in forum Help
    Replies: 1
    Last Post: 06-26-2013, 08:43 PM
  3. [718] Basic Version System
    By Benji in forum Snippets
    Replies: 13
    Last Post: 05-17-2013, 12:14 PM
  4. 718 npc point system
    By legend 349 in forum Help
    Replies: 4
    Last Post: 12-07-2012, 12:02 AM
  5. Replies: 1
    Last Post: 03-16-2011, 07:30 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
  •