# Thread: Level 126 to Level 138? Doesn't calculate Summoning?

1. I am fully maxed. 99 Summoning. It show's Level 126 on my combat tab but Level 138 To everyone Else. How can I make it so that it shows Level 138 on my combat tab as well? So that it calculates the Summoning Level as well:

Thanks.

2. In you combat level calculation method, get the correct formula for 138 combat. A lot of sources in the downloads section got it.

3. ## Thankful user:

4. Originally Posted by Exidia
In you combat level calculation method, get the correct formula for 138 combat. A lot of sources in the downloads section got it.
This is my code, Can you tell me the fix?:

Code:
``````		int combatLevel = ((Client) this).getCombatLevel();

int mag = (int) ((getLevelForXP(playerXP[6])) * 1.5);
int ran = (int) ((getLevelForXP(playerXP[4])) * 1.5);
int attstr = (int) ((double) (getLevelForXP(playerXP[0])) + (double) (getLevelForXP(playerXP[2])));

combatLevel = 0;
if (ran > attstr) {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.25)
+ ((getLevelForXP(playerXP[3])) * 0.25)
+ ((getLevelForXP(playerXP[5])) * 0.125)
+ ((getLevelForXP(playerXP[4])) * 0.4875)
+ ((getLevelForXP(playerXP[21])) * 0.121212));
} else if (mag > attstr) {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.25)
+ ((getLevelForXP(playerXP[3])) * 0.25)
+ ((getLevelForXP(playerXP[5])) * 0.125)
+ ((getLevelForXP(playerXP[6])) * 0.4875)
+ ((getLevelForXP(playerXP[21])) * 0.121212));
} else {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.25)
+ ((getLevelForXP(playerXP[3])) * 0.25)
+ ((getLevelForXP(playerXP[5])) * 0.125)
+ ((getLevelForXP(playerXP[0])) * 0.325)
+ ((getLevelForXP(playerXP[2])) * 0.325)
+ ((getLevelForXP(playerXP[21])) * 0.121212));
}

playerProps.writeByte(combatLevel);		// combat level
playerProps.writeWord(playerTitle);
str.writeByteC(playerProps.currentOffset);
str.writeBytes(playerProps.buffer, playerProps.currentOffset, 0);
//}
}``````

5. Client.java

public int getCombatLevel() {
int mag = (int) ((getLevelForXP(playerXP[6])) * 1.5);
int ran = (int) ((getLevelForXP(playerXP[4])) * 1.5);
int attstr = (int) ((double) (getLevelForXP(playerXP[0])) + (double) (getLevelForXP(playerXP[2])));
if (ran > attstr) {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.25)
+ ((getLevelForXP(playerXP[3])) * 0.25)
+ ((getLevelForXP(playerXP[5])) * 0.125)
+ ((getLevelForXP(playerXP[4])) * 0.4875)
+ ((getLevelForXP(playerXP[22])) * 0.125));
} else if (mag > attstr) {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.25)
+ ((getLevelForXP(playerXP[3])) * 0.25)
+ ((getLevelForXP(playerXP[5])) * 0.125)
+ ((getLevelForXP(playerXP[6])) * 0.4875)
+ ((getLevelForXP(playerXP[22])) * 0.125));
} else {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.25)
+ ((getLevelForXP(playerXP[3])) * 0.25)
+ ((getLevelForXP(playerXP[5])) * 0.125)
+ ((getLevelForXP(playerXP[0])) * 0.325)
+ ((getLevelForXP(playerXP[2])) * 0.325)
+ ((getLevelForXP(playerXP[22])) * 0.125));
}
return combatLevel;
}

player.java

int mag = (int) ((getLevelForXP(playerXP[6])) * 1.5);
int ran = (int) ((getLevelForXP(playerXP[4])) * 1.5);
int attstr = (int) ((double) (getLevelForXP(playerXP[0])) + (double) (getLevelForXP(playerXP[2])));

combatLevel = 0;
if (ran > attstr) {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.25)
+ ((getLevelForXP(playerXP[3])) * 0.25)
+ ((getLevelForXP(playerXP[5])) * 0.125)
+ ((getLevelForXP(playerXP[4])) * 0.4875)
+ ((getLevelForXP(playerXP[22])) * 0.125));
} else if (mag > attstr) {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.25)
+ ((getLevelForXP(playerXP[3])) * 0.25)
+ ((getLevelForXP(playerXP[5])) * 0.125)
+ ((getLevelForXP(playerXP[6])) * 0.4875)
+ ((getLevelForXP(playerXP[22])) * 0.125));
} else {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.25)
+ ((getLevelForXP(playerXP[3])) * 0.25)
+ ((getLevelForXP(playerXP[5])) * 0.125)
+ ((getLevelForXP(playerXP[0])) * 0.325)
+ ((getLevelForXP(playerXP[2])) * 0.325)
+ ((getLevelForXP(playerXP[22])) * 0.125));
}
make sure it's in both player and client.java