if i were to do this, would i have to rework my prayers? the activeprayers seem off..
other source's prayers
Code:
/**Prayer**/
public void activatePrayer(int i) {
if(c.duelRule[7]){
for(int p = 0; p < c.PRAYER.length; p++) { // reset prayer glows
c.prayerActive[p] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[p], 0);
}
c.sendMessage("Prayer has been disabled in this duel!");
return;
}
if(c.inRfd()) {
for(int p = 0; p < c.PRAYER.length; p++) { // reset prayer glows
c.prayerActive[p] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[p], 0);
}
return;
}
if(c.playerLevel[5] > 0 || !Config.PRAYER_POINTS_REQUIRED){
if(c.getPA().getLevelForXP(c.playerXP[5]) >= c.PRAYER_LEVEL_REQUIRED[i] || !Config.PRAYER_LEVEL_REQUIRED) {
boolean headIcon = false;
int[] bad = {
0,1,2,-1,-1,5,6,7,-1,-1,-1,-1,-1,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
};
switch(i) {
case 0:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[5], 0);
c.prayerActive[5] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[13], 0);
c.prayerActive[13] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 1:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[6], 0);
c.prayerActive[6] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[14], 0);
c.prayerActive[14] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 2:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[7], 0);
c.prayerActive[7] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[15], 0);
c.prayerActive[15] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 3:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[11], 0);
c.prayerActive[11] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[19], 0);
c.prayerActive[19] = false;
}
break;
case 4:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[12], 0);
c.prayerActive[12] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[20], 0);
c.prayerActive[20] = false;
}
break;
case 5:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[0], 0);
c.prayerActive[0] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[13], 0);
c.prayerActive[13] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 6:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[1], 0);
c.prayerActive[1] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[14], 0);
c.prayerActive[14] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 7:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[2], 0);
c.prayerActive[2] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[15], 0);
c.prayerActive[15] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 8:
break;
case 11:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[3], 0);
c.prayerActive[3] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[19], 0);
c.prayerActive[19] = false;
}
break;
case 12:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[4], 0);
c.prayerActive[4] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[20], 0);
c.prayerActive[20] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 13:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[0], 0);
c.prayerActive[0] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[5], 0);
c.prayerActive[5] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 14:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[1], 0);
c.prayerActive[1] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[6], 0);
c.prayerActive[6] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 15:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[2], 0);
c.prayerActive[2] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[7], 0);
c.prayerActive[7] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[24], 0);
c.prayerActive[24] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[25], 0);
c.prayerActive[25] = false;
}
break;
case 19:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[3], 0);
c.prayerActive[3] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[11], 0);
c.prayerActive[11] = false;
}
break;
case 20:
if(c.prayerActive[i] == false) {
c.getPA().sendFrame36(c.PRAYER_GLOW[4], 0);
c.prayerActive[4] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[12], 0);
c.prayerActive[12] = false;
}
break;
case 16:
case 17:
case 18:
if(System.currentTimeMillis() - c.stopPrayerDelay < 5000) {
c.sendMessage("You have been injured and can't use this prayer!");
c.getPA().sendFrame36(c.PRAYER_GLOW[16], 0);
c.getPA().sendFrame36(c.PRAYER_GLOW[17], 0);
c.getPA().sendFrame36(c.PRAYER_GLOW[18], 0);
return;
}
case 21:
case 22:
case 23:
headIcon = true;
for(int p = 16; p < 24; p++) {
if(i != p) {
if(p != 19 && p != 20) {
c.prayerActive[p] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[p], 0);
}
}
}
break;
case 24:
if(c.prayerActive[i] == false) {
for(int h = 0; h < c.PRAYER.length; h++) {
if((h == 25) || (bad[h] == h && bad[h] != -1)) {
c.getPA().sendFrame36(c.PRAYER_GLOW[h], 0);
c.prayerActive[h] = false;
}
}
}
break;
case 25:
if(c.prayerActive[i] == false) {
for(int j = 0; j < c.PRAYER.length; j++) {
if((j == 24) || (bad[j] == j && bad[j] != -1)) {
c.getPA().sendFrame36(c.PRAYER_GLOW[j], 0);
c.prayerActive[j] = false;
}
}
}
break;
}
if(!headIcon) {
if(c.prayerActive[i] == false) {
c.prayerActive[i] = true;
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 1);
} else {
c.prayerActive[i] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 0);
}
} else {
if(c.prayerActive[i] == false) {
c.prayerActive[i] = true;
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 1);
c.headIcon = c.PRAYER_HEAD_ICONS[i];
c.getPA().requestUpdates();
} else {
c.prayerActive[i] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 0);
c.headIcon = -1;
c.getPA().requestUpdates();
}
}
} else {
c.getPA().sendFrame36(c.PRAYER_GLOW[i],0);
c.getPA().sendFrame126("You need a @blu@Prayer level of "+c.PRAYER_LEVEL_REQUIRED[i]+" to use "+c.PRAYER_NAME[i]+".", 357);
c.getPA().sendFrame126("Click here to continue", 358);
c.getPA().sendFrame164(356);
}
} else {
c.getPA().sendFrame36(c.PRAYER_GLOW[i],0);
c.sendMessage("You have run out of prayer points!");
}
}
pi's prayer
Code:
public void activatePrayer(int i) {
if(c.duelRule[7]){
for(int p = 0; p < c.PRAYER.length; p++) { // reset prayer glows
c.prayerActive[p] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[p], 0);
}
c.sendMessage("Prayer has been disabled in this duel!");
return;
}
if (i == 24 && c.playerLevel[1] < 65) {
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 0);
c.sendMessage("You may not use this prayer yet.");
return;
}
if (i == 25 && c.playerLevel[1] < 70) {
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 0);
c.sendMessage("You may not use this prayer yet.");
return;
}
int[] defPray = {0,5,13,24,25};
int[] strPray = {1,6,14,24,25};
int[] atkPray = {2,7,15,24,25};
int[] rangePray = {3,11,19};
int[] magePray = {4,12,20};
if(c.playerLevel[5] > 0 || !Config.PRAYER_POINTS_REQUIRED){
if(c.getPA().getLevelForXP(c.playerXP[5]) >= c.PRAYER_LEVEL_REQUIRED[i] || !Config.PRAYER_LEVEL_REQUIRED) {
boolean headIcon = false;
switch(i) {
case 0:
case 5:
case 13:
if(c.prayerActive[i] == false) {
for (int j = 0; j < defPray.length; j++) {
if (defPray[j] != i) {
c.prayerActive[defPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[defPray[j]], 0);
}
}
}
break;
case 1:
case 6:
case 14:
if(c.prayerActive[i] == false) {
for (int j = 0; j < strPray.length; j++) {
if (strPray[j] != i) {
c.prayerActive[strPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[strPray[j]], 0);
}
}
for (int j = 0; j < rangePray.length; j++) {
if (rangePray[j] != i) {
c.prayerActive[rangePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[rangePray[j]], 0);
}
}
for (int j = 0; j < magePray.length; j++) {
if (magePray[j] != i) {
c.prayerActive[magePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[magePray[j]], 0);
}
}
}
break;
case 2:
case 7:
case 15:
if(c.prayerActive[i] == false) {
for (int j = 0; j < atkPray.length; j++) {
if (atkPray[j] != i) {
c.prayerActive[atkPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[atkPray[j]], 0);
}
}
for (int j = 0; j < rangePray.length; j++) {
if (rangePray[j] != i) {
c.prayerActive[rangePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[rangePray[j]], 0);
}
}
for (int j = 0; j < magePray.length; j++) {
if (magePray[j] != i) {
c.prayerActive[magePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[magePray[j]], 0);
}
}
}
break;
case 3://range prays
case 11:
case 19:
if(c.prayerActive[i] == false) {
for (int j = 0; j < atkPray.length; j++) {
if (atkPray[j] != i) {
c.prayerActive[atkPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[atkPray[j]], 0);
}
}
for (int j = 0; j < strPray.length; j++) {
if (strPray[j] != i) {
c.prayerActive[strPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[strPray[j]], 0);
}
}
for (int j = 0; j < rangePray.length; j++) {
if (rangePray[j] != i) {
c.prayerActive[rangePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[rangePray[j]], 0);
}
}
for (int j = 0; j < magePray.length; j++) {
if (magePray[j] != i) {
c.prayerActive[magePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[magePray[j]], 0);
}
}
}
break;
case 4:
case 12:
case 20:
if(c.prayerActive[i] == false) {
for (int j = 0; j < atkPray.length; j++) {
if (atkPray[j] != i) {
c.prayerActive[atkPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[atkPray[j]], 0);
}
}
for (int j = 0; j < strPray.length; j++) {
if (strPray[j] != i) {
c.prayerActive[strPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[strPray[j]], 0);
}
}
for (int j = 0; j < rangePray.length; j++) {
if (rangePray[j] != i) {
c.prayerActive[rangePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[rangePray[j]], 0);
}
}
for (int j = 0; j < magePray.length; j++) {
if (magePray[j] != i) {
c.prayerActive[magePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[magePray[j]], 0);
}
}
}
break;
case 10:
c.lastProtItem = System.currentTimeMillis();
break;
case 16:
case 17:
case 18:
if(System.currentTimeMillis() - c.stopPrayerDelay < 5000) {
c.sendMessage("You have been injured and can't use this prayer!");
c.getPA().sendFrame36(c.PRAYER_GLOW[16], 0);
c.getPA().sendFrame36(c.PRAYER_GLOW[17], 0);
c.getPA().sendFrame36(c.PRAYER_GLOW[18], 0);
return;
}
if (i == 16)
c.protMageDelay = System.currentTimeMillis();
else if (i == 17)
c.protRangeDelay = System.currentTimeMillis();
else if (i == 18)
c.protMeleeDelay = System.currentTimeMillis();
case 21:
case 22:
case 23:
headIcon = true;
for(int p = 16; p < 24; p++) {
if(i != p && p != 19 && p != 20) {
c.prayerActive[p] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[p], 0);
}
}
break;
case 24:
case 25:
if (c.prayerActive[i] == false) {
for (int j = 0; j < atkPray.length; j++) {
if (atkPray[j] != i) {
c.prayerActive[atkPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[atkPray[j]], 0);
}
}
for (int j = 0; j < strPray.length; j++) {
if (strPray[j] != i) {
c.prayerActive[strPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[strPray[j]], 0);
}
}
for (int j = 0; j < rangePray.length; j++) {
if (rangePray[j] != i) {
c.prayerActive[rangePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[rangePray[j]], 0);
}
}
for (int j = 0; j < magePray.length; j++) {
if (magePray[j] != i) {
c.prayerActive[magePray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[magePray[j]], 0);
}
}
for (int j = 0; j < defPray.length; j++) {
if (defPray[j] != i) {
c.prayerActive[defPray[j]] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[defPray[j]], 0);
}
}
}
break;
}
if(!headIcon) {
if(c.prayerActive[i] == false) {
c.prayerActive[i] = true;
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 1);
} else {
c.prayerActive[i] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 0);
}
} else {
if(c.prayerActive[i] == false) {
c.prayerActive[i] = true;
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 1);
c.headIcon = c.PRAYER_HEAD_ICONS[i];
c.getPA().requestUpdates();
} else {
c.prayerActive[i] = false;
c.getPA().sendFrame36(c.PRAYER_GLOW[i], 0);
c.headIcon = -1;
c.getPA().requestUpdates();
}
}
} else {
c.getPA().sendFrame36(c.PRAYER_GLOW[i],0);
c.getPA().sendFrame126("You need a @blu@Prayer level of "+c.PRAYER_LEVEL_REQUIRED[i]+" to use "+c.PRAYER_NAME[i]+".", 357);
c.getPA().sendFrame126("Click here to continue", 358);
c.getPA().sendFrame164(356);
}
} else {
c.getPA().sendFrame36(c.PRAYER_GLOW[i],0);
c.sendMessage("You have run out of prayer points!");
}
}