Jump to content
Existing user? Sign In

Sign In



Sign Up

[PI] Adding Custom Points


Solnes

TUTORIAL/SNIPPET  

8 members have voted

  1. 1. Did this tutorial/snippet help?

    • YES
      4
    • KINDA
      2
    • NO
      2


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
Link to comment
Share on other sites

  • 1 year later...
  • Replies 34
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 months later...
  • 1 month later...
  • 2 months later...
  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...
  • 4 weeks later...
  • 1 year later...
  • 1 month later...

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



Contact

ltlimes

RSPS Partners

RedemptionRSPS

What is a RSPS?

A RSPS, also known as RuneScape private server, is an online game based on RuneScape, and controlled by independent individuals.

Popular RSPS Servers

oldschoolrsps Runewild RedemptionRSPS

Disclaimer

Runesuite is not affiliated with runescape, jagex, rune-server and runelocus in any way & exists solely for educational purposes.

×
×
  • Create New...