MegaMediaLife
Welcome to MegaMediaLife. Register to post Have fun!!!!
MegaMediaLife
Welcome to MegaMediaLife. Register to post Have fun!!!!
MegaMediaLife
Would you like to react to this message? Create an account in a few clicks or log in to continue.


MegaMediaLife
 
HomeHomeLatest imagesSearchRegisterLog in

 

 Adding XP Lock to your server (Stops your getting EXP when activated.)

Go down 
5 posters
AuthorMessage
Fanny Ballz
Admin



Posts : 11
Reputation : 0
Join date : 2009-11-16

Adding XP Lock to your server (Stops your getting EXP when activated.) Empty
PostSubject: Adding XP Lock to your server (Stops your getting EXP when activated.)   Adding XP Lock to your server (Stops your getting EXP when activated.) EmptyMon Nov 16, 2009 2:52 am

Purpose: To be able to Lock XP

Difficulty: 1, (Copy & Paste) - Explanation at bottem.

Tested On: Tragik Pkz

------------------------------------------------------------------------------------------------------


Step One:

Open up your Player.java and add this to it.

Code:

Code:
public boolean expLock;


Step Two:

open your client.java and search for
Code:

Code:
public boolean addSkillXP(int amount, int skill) {

You should see something like...

Code:

Code:
public boolean addSkillXP(int amount, int skill) {
      int oldLevel = getLevelForXP(playerXP[skill]);
      playerXP[skill] += amount;
      if (oldLevel < getLevelForXP(playerXP[skill])) {
         animation(199, absY, absX);
         playerLevel[skill] = getLevelForXP(playerXP[skill]);
         updateRequired = true;
         appearanceUpdateRequired = true;
         levelup(skill);
         
         setSkillLevel(skill, playerLevel[skill], playerXP[skill]);
      }
      refreshSkills();
      if (skill == 2) {
         CalculateMaxHit();
      }
      return true;

   }

Now underneath public boolean addSkillXP(int amount, int skill) {

Add this:

Code:

Code:
if (expLock) {
    return;
}

So it is at the top of the method.



Step Three:

You can decide how to add this, with a button or command, ill show you both ways.

Command:
Code:

Code:
if (command.equalsIgnoreCase("lock")) {
    expLock = true;
    sendMessage("EXP Lock Activated.");
}
if (command.equalsIgnoreCase("unlock")) {
    expLock = false;
    sendMessage("EXP Lock De-Activated.");
}

Button:
Code:

Code:
case ####:
if (expLock) {
  expLock = false;
  sendMessage("EXP Lock De-Activated);
} else if (expLock == false) {
  expLock = true;
  sendMessage("EXP Lock Activated);
}
break;

Step Four:

This will make your button status save if you login and out.

Add this with your other saves
Code:

Code:
characterfile.write("character-expLock = ", 0, 20);
         characterfile.write(Boolean.toString(expLock), 0, Boolean.toString(expLock).length());
         characterfile.newLine();

And this.

Code:

Code:
else if (token.equals("character-expLock")) {
                  expLock = Boolean.parseBoolean(token2);
               }



NOW YOU HAVE AN EXP LOCK
Back to top Go down
java
Pwner
Pwner



Posts : 22
Reputation : 2
Join date : 2009-11-16

Adding XP Lock to your server (Stops your getting EXP when activated.) Empty
PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Adding XP Lock to your server (Stops your getting EXP when activated.) EmptyMon Nov 16, 2009 3:19 am

nice tutorial even tho this stuff is pretty easy:p
Back to top Go down
clayd
Moderator



Posts : 8
Reputation : 0
Join date : 2009-11-15

Adding XP Lock to your server (Stops your getting EXP when activated.) Empty
PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Adding XP Lock to your server (Stops your getting EXP when activated.) EmptyMon Nov 16, 2009 6:47 am

Leeched FTL?
Back to top Go down
kurta
Legend
Legend
kurta


Posts : 59
Reputation : 0
Join date : 2009-11-16
Location : Australia

Adding XP Lock to your server (Stops your getting EXP when activated.) Empty
PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Adding XP Lock to your server (Stops your getting EXP when activated.) EmptyFri Nov 20, 2009 12:09 pm

if you would like to add it to a button instead of a command just ask and ill show you how to do that
Back to top Go down
http://www.runescape.com
Antto
Noob
Noob



Posts : 1
Reputation : 0
Join date : 2009-11-20

Adding XP Lock to your server (Stops your getting EXP when activated.) Empty
PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Adding XP Lock to your server (Stops your getting EXP when activated.) EmptyFri Nov 20, 2009 6:40 pm

This is 100% leeched from rune-server.org! lol! lol!
Back to top Go down
kurta
Legend
Legend
kurta


Posts : 59
Reputation : 0
Join date : 2009-11-16
Location : Australia

Adding XP Lock to your server (Stops your getting EXP when activated.) Empty
PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Adding XP Lock to your server (Stops your getting EXP when activated.) EmptyTue Nov 24, 2009 2:20 pm

that command is easy any one can write it, how would you know if its leeched?
Back to top Go down
http://www.runescape.com
kurta
Legend
Legend
kurta


Posts : 59
Reputation : 0
Join date : 2009-11-16
Location : Australia

Adding XP Lock to your server (Stops your getting EXP when activated.) Empty
PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Adding XP Lock to your server (Stops your getting EXP when activated.) EmptyTue Nov 24, 2009 2:21 pm

Antto wrote:
This is 100% leeched from rune-server.org! lol! lol!
are u 100% sure? cause dont make untrue statments
Back to top Go down
http://www.runescape.com
Sponsored content





Adding XP Lock to your server (Stops your getting EXP when activated.) Empty
PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Adding XP Lock to your server (Stops your getting EXP when activated.) Empty

Back to top Go down
 
Adding XP Lock to your server (Stops your getting EXP when activated.)
Back to top 
Page 1 of 1
 Similar topics
-
» adding pest control with npc's and portals
» Adding Health and Prayer at top of client screen.
» How to portforward a server
» welcome and join our new server now! :D
» Template for rsps server

Permissions in this forum:You cannot reply to topics in this forum
MegaMediaLife :: Runescape Private Servers :: 317 Related Boards :: Tutorials-
Jump to: