MegaMediaLife
Welcome to MegaMediaLife. Register to post Have fun!!!!


MegaMediaLife
 
HomeHomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

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

Go down 
AuthorMessage
Fanny Ballz
Admin


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

PostSubject: Adding XP Lock to your server (Stops your getting EXP when activated.)   Mon 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
View user profile
java
Pwner
Pwner


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

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

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


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

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

Leeched FTL?
Back to top Go down
View user profile
kurta
Legend
Legend
avatar

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

PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Fri 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
View user profile http://www.runescape.com
Antto
Noob
Noob


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

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

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

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

PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Tue 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
View user profile http://www.runescape.com
kurta
Legend
Legend
avatar

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

PostSubject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.)   Tue 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
View user profile http://www.runescape.com
Sponsored content




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

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
-
» Can't enter my Cub Condo [LOCK]
» Photo Filtre font- PLease lock
» No server response
» New online chess server, www.easychess.com
» Chess-Tournament-Results-Server

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