Fanny Ballz Admin
Posts : 11 Reputation : 0 Join date : 2009-11-16
| Subject: 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 | |
|
java Pwner
Posts : 22 Reputation : 2 Join date : 2009-11-16
| Subject: 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 | |
|
clayd Moderator
Posts : 8 Reputation : 0 Join date : 2009-11-15
| Subject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.) Mon Nov 16, 2009 6:47 am | |
| | |
|
kurta Legend
Posts : 59 Reputation : 0 Join date : 2009-11-16 Location : Australia
| Subject: 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 | |
|
Antto Noob
Posts : 1 Reputation : 0 Join date : 2009-11-20
| |
kurta Legend
Posts : 59 Reputation : 0 Join date : 2009-11-16 Location : Australia
| Subject: 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? | |
|
kurta Legend
Posts : 59 Reputation : 0 Join date : 2009-11-16 Location : Australia
| |
Sponsored content
| Subject: Re: Adding XP Lock to your server (Stops your getting EXP when activated.) | |
| |
|