Code:
public void levelUp(int skill) {
int totalLevel = (getLevelForXP(c.playerXP[0]) + getLevelForXP(c.playerXP[1]) + getLevelForXP(c.playerXP[2]) + getLevelForXP(c.playerXP[3]) + getLevelForXP(c.playerXP[4]) + getLevelForXP(c.playerXP[5]) + getLevelForXP(c.playerXP[6]) + getLevelForXP(c.playerXP[7]) + getLevelForXP(c.playerXP[8]) + getLevelForXP(c.playerXP[9]) + getLevelForXP(c.playerXP[10]) + getLevelForXP(c.playerXP[11]) + getLevelForXP(c.playerXP[12]) + getLevelForXP(c.playerXP[13]) + getLevelForXP(c.playerXP[14]) + getLevelForXP(c.playerXP[15]) + getLevelForXP(c.playerXP[16]) + getLevelForXP(c.playerXP[17]) + getLevelForXP(c.playerXP[18]) + getLevelForXP(c.playerXP[19]) + getLevelForXP(c.playerXP[20]));
sendFrame126("Total Lvl: "+totalLevel, 3984);
switch(skill) {
case 0:
sendFrame126("Congratulations, you just advanced an attack level!", 6248);
sendFrame126("Your attack level is now "+getLevelForXP(c.playerXP[skill])+".", 6249);
c.sendMessage("Congratulations, you just advanced an attack level.");
sendFrame164(6247);
if(c.playerLevel[0] == 99) { //or you can do > 98
c.getItems().addItem(9748, 1);
return;
}
break;
case 1:
sendFrame126("Congratulations, you just advanced a defence level!", 6254);
sendFrame126("Your defence level is now "+getLevelForXP(c.playerXP[skill])+".", 6255);
c.sendMessage("Congratulations, you just advanced a defence level.");
sendFrame164(6253);
if(c.playerLevel[1] == 99) { //or you can do > 98
c.getItems().addItem(9754, 1);
return;
}
break;
case 2:
sendFrame126("Congratulations, you just advanced a strength level!", 6207);
sendFrame126("Your strength level is now "+getLevelForXP(c.playerXP[skill])+".", 6208);
c.sendMessage("Congratulations, you just advanced a strength level.");
sendFrame164(6206);
if(c.playerLevel[2] == 99) { //or you can do > 98
c.getItems().addItem(9751, 1);
return;
}
break;
case 3:
sendFrame126("Congratulations, you just advanced a hitpoints level!", 6217);
sendFrame126("Your hitpoints level is now "+getLevelForXP(c.playerXP[skill])+".", 6218);
c.sendMessage("Congratulations, you just advanced a hitpoints level.");
sendFrame164(6216);
if(c.playerLevel[3] == 99) { //or you can do > 98
c.getItems().addItem(9769, 1);
return;
}
break;
case 4:
sendFrame126("Congratulations, you just advanced a ranged level!", 5453);
sendFrame126("Your ranged level is now "+getLevelForXP(c.playerXP[skill])+".", 6114);
c.sendMessage("Congratulations, you just advanced a ranging level.");
sendFrame164(4443);
if(c.playerLevel[4] == 99) { //or you can do > 98
c.getItems().addItem(9757, 1);
return;
}
break;
case 5:
sendFrame126("Congratulations, you just advanced a prayer level!", 6243);
sendFrame126("Your prayer level is now "+getLevelForXP(c.playerXP[skill])+".", 6244);
c.sendMessage("Congratulations, you just advanced a prayer level.");
sendFrame164(6242);
if(c.playerLevel[5] == 99) { //or you can do > 98
c.getItems().addItem(9760, 1);
return;
}
break;
case 6:
sendFrame126("Congratulations, you just advanced a magic level!", 6212);
sendFrame126("Your magic level is now "+getLevelForXP(c.playerXP[skill])+".", 6213);
c.sendMessage("Congratulations, you just advanced a magic level.");
sendFrame164(6211);
if(c.playerLevel[6] == 99) { //or you can do > 98
c.getItems().addItem(9763, 1);
return;
}
break;
case 7:
sendFrame126("Congratulations, you just advanced a cooking level!", 6227);
sendFrame126("Your cooking level is now "+getLevelForXP(c.playerXP[skill])+".", 6228);
c.sendMessage("Congratulations, you just advanced a cooking level.");
sendFrame164(6226);
if(c.playerLevel[7] == 99) { //or you can do > 98
c.getItems().addItem(9802, 1);
return;
}
break;
case 8:
sendFrame126("Congratulations, you just advanced a woodcutting level!", 4273);
sendFrame126("Your woodcutting level is now "+getLevelForXP(c.playerXP[skill])+".", 4274);
c.sendMessage("Congratulations, you just advanced a woodcutting level.");
sendFrame164(4272);
if(c.playerLevel[8] == 99) { //or you can do > 98
c.getItems().addItem(9808, 1);
return;
}
break;
case 9:
sendFrame126("Congratulations, you just advanced a fletching level!", 6232);
sendFrame126("Your fletching level is now "+getLevelForXP(c.playerXP[skill])+".", 6233);
c.sendMessage("Congratulations, you just advanced a fletching level.");
sendFrame164(6231);
if(c.playerLevel[9] == 99) { //or you can do > 98
c.getItems().addItem(9784, 1);
return;
}
break;
case 10:
sendFrame126("Congratulations, you just advanced a fishing level!", 6259);
sendFrame126("Your fishing level is now "+getLevelForXP(c.playerXP[skill])+".", 6260);
c.sendMessage("Congratulations, you just advanced a fishing level.");
sendFrame164(6258);
if(c.playerLevel[10] == 99) { //or you can do > 98
c.getItems().addItem(9799, 1);
return;
}
break;
case 11:
sendFrame126("Congratulations, you just advanced a fire making level!", 4283);
sendFrame126("Your firemaking level is now "+getLevelForXP(c.playerXP[skill])+".", 4284);
c.sendMessage("Congratulations, you just advanced a fire making level.");
sendFrame164(4282);
if(c.playerLevel[11] == 99) { //or you can do > 98
c.getItems().addItem(9805, 1);
return;
}
break;
case 12:
sendFrame126("Congratulations, you just advanced a crafting level!", 6264);
sendFrame126("Your crafting level is now "+getLevelForXP(c.playerXP[skill])+".", 6265);
c.sendMessage("Congratulations, you just advanced a crafting level.");
sendFrame164(6263);
if(c.playerLevel[12] == 99) { //or you can do > 98
c.getItems().addItem(9781, 1);
return;
}
break;
case 13:
sendFrame126("Congratulations, you just advanced a smithing level!", 6222);
sendFrame126("Your smithing level is now "+getLevelForXP(c.playerXP[skill])+".", 6223);
c.sendMessage("Congratulations, you just advanced a smithing level.");
sendFrame164(6221);
if(c.playerLevel[13] == 99) { //or you can do > 98
c.getItems().addItem(9796, 1);
return;
}
break;
case 14:
sendFrame126("Congratulations, you just advanced a mining level!", 4417);
sendFrame126("Your mining level is now "+getLevelForXP(c.playerXP[skill])+".", 4438);
c.sendMessage("Congratulations, you just advanced a mining level.");
sendFrame164(4416);
if(c.playerLevel[14] == 99) { //or you can do > 98
c.getItems().addItem(9793, 1);
return;
}
break;
case 15:
sendFrame126("Congratulations, you just advanced a herblore level!", 6238);
sendFrame126("Your herblore level is now "+getLevelForXP(c.playerXP[skill])+".", 6239);
c.sendMessage("Congratulations, you just advanced a herblore level.");
sendFrame164(6237);
if(c.playerLevel[15] == 99) { //or you can do > 98
c.getItems().addItem(9775, 1);
return;
}
break;
case 16:
sendFrame126("Congratulations, you just advanced a agility level!", 4278);
sendFrame126("Your agility level is now "+getLevelForXP(c.playerXP[skill])+".", 4279);
c.sendMessage("Congratulations, you just advanced an agility level.");
sendFrame164(4277);
if(c.playerLevel[16] == 99) { //or you can do > 98
c.getItems().addItem(9772, 1);
return;
}
break;
case 17:
sendFrame126("Congratulations, you just advanced a thieving level!", 4263);
sendFrame126("Your theiving level is now "+getLevelForXP(c.playerXP[skill])+".", 4264);
c.sendMessage("Congratulations, you just advanced a thieving level.");
sendFrame164(4261);
if(c.playerLevel[17] == 99) { //or you can do > 98
c.getItems().addItem(9778, 1);
return;
}
break;
case 18:
sendFrame126("Congratulations, you just advanced a slayer level!", 12123);
sendFrame126("Your slayer level is now "+getLevelForXP(c.playerXP[skill])+".", 12124);
c.sendMessage("Congratulations, you just advanced a slayer level.");
sendFrame164(12122);
if(c.playerLevel[18] == 99) { //or you can do > 98
c.getItems().addItem(9787, 1);
return;
}
break;
case 20:
sendFrame126("Congratulations, you just advanced a runecrafting level!", 4268);
sendFrame126("Your runecrafting level is now "+getLevelForXP(c.playerXP[skill])+".", 4269);
c.sendMessage("Congratulations, you just advanced a runecrafting level.");
sendFrame164(4267);
if(c.playerLevel[20] == 99) { //or you can do > 98
c.getItems().addItem(9766, 1);
return;
}
break;
}
c.dialogueAction = 0;
c.nextChat = 0;
}
Save, compile, your done! Now when you get a 99 in a stat the cape auto spawns in your inventory!