Jump to content
RuneSuite
Existing user? Sign In

Sign In



Sign Up
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Solnes

[PI] Adding Custom Points

TUTORIAL/SNIPPET  

3 members have voted

  1. 1. Did this tutorial/snippet help?

    • YES
      1
    • KINDA
      1
    • NO
      1


Recommended Posts

NOTE: This has been released on several other sites, but I decided to post my own version.

This is also my first snippet / tutorial, I hope I helped you in any way :)

Source: PI

Files: Playersave.java, Player.java, npcHandler.java

Difficulity: 1/10

CHANGE WHERE I PUT ASDF TO YOUR CUSTOM POINT.

Step 1: open Playersave.java (src/server/model/players)

Search for this -

} else if (token.equals("character-rights")) {

Then you will see this - 

} else if (token.equals("character-rights")) {
p.playerRights = Integer.parseInt(token2);

Under that somewhere add this - 

} else if (token.equals("ASDF")) {
p.ASDFPoints = Integer.parseInt(token2);

In the same file search for this - 

characterfile.write("character-rights = ", 0, 19);

Then you will see this - 

characterfile.newLine();
characterfile.write("character-rights = ", 0, 19);
characterfile.write(Integer.toString(p.playerRights), 0, Integer.toString(p.playerRights).length());

Under that somewhere add this - 

characterfile.newLine();
characterfile.write("ASDF = ", 0, 9);
characterfile.write(Integer.toString(p.ASDF), 0, Integer.toString(p.ASDF).length());

SAVE AND CLOSE

Step 2: open Player.save (src/server/model/players)

Search for - 

public int

Keep searching until you see something like this - 

public int
    safeTimer = 0,
    degradeTime, 
    KC,
    DC,
    bond,
    untbond,
    recoil = 0,	
    kingQuest = 0,
    rMQ = 0,
    bMQ = 0,

Then add this - 

public int
    safeTimer = 0,
    degradeTime, 
    KC,
    DC,
    bond,
    untbond,
    recoil = 0,	
    kingQuest = 0,
    rMQ = 0,
    bMQ = 0,
	ASDF, //<this is where your custom points go

SAVE AND CLOSE

That is it for that part of adding points to your character files.

STEP 3: open npcHandler.java (src/server/model/npcs)

Search for this - 

public void dropItems(int i) {

Under that put this - 

if (npcs[i].npcType == NPCID) {// npc that you kill to give you the points
c.ASDF += 1;
c.sendMessage("You currently have "+ c.ASDF + " ASDF Points.");
}

SAVE AND COMPILE AND YOUR DONE.

Edited by Solnes
  • Like 1

Share this post


Link to post
Share on other sites

Simple but will help a lot of people :)

Share this post


Link to post
Share on other sites

Should hopefully help some newer people

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

Get connected with us on social networks:

Contact

Lumbridge Castle

@ace

Discord

Discord

About Us

We run the scene

×
×
  • Create New...