[317] Error adding in Prayer Altar

Im trying to code Prayer altar in and make it restore prayer, but my 317 base server doesnt use [PI] (so i think it doesnt.)
My case altar is object 409, which should mean i need case 409:
so here’s my case.
Server Isnt PI, or Delta.

case 409: //Prayer Altar @Home if(playerLevel[5] < getPA().getLevelForXP(playerXP[5])) { startAnimation(645); playerLevel[5] = getPA().getLevelForXP(playerXP[5]); sendMessage("You recharge your prayer points."); getPA().refreshSkill(5); } else { sendMessage("You already have full prayer points."); } break;
im getting these errors in cmd when i compile my work.

Here what it looks like in note++

i had to edit this because i thought it was a bit messy and very hard to understand if u were to help me out.

You are or aren’t using a PI server?

If you are, it’s because you’re missing the client object before the variables/methods.

If you aren’t, it’s because those don’t exist in your server and you’d have to use your server’s equivalent methods or variables related to it.

[quote=“sk8rdude461, post:2, topic:555614”]You are or aren’t using a PI server?

If you are, it’s because you’re missing the client object before the variables/methods.

If you aren’t, it’s because those don’t exist in your server and you’d have to use your server’s equivalent methods or variables related to it.[/quote]

My server isnt PI, after i took a long look at the files, i looked at some PI Codes and compared to mine, so my server isnt PI, I now know that, I went and looked through the files and found getPA is the same as my setSkillLevel, so i added in the new code but now, i get 3 different errors, i kinda understand the error but it doesnt make entire since to me.


here’s what i have in Note++

case 409: //Prayer Altar @Home
if(playerLevel[5] < setSkillLevel(5, playerLevel[5], playerXP[5])) {
				startAnimation(645);
				playerLevel[5] = setSkillLevel(5, 99, playerLevel[5]);
				currentpray = 99;
				sendMessage("You recharge your prayer points.");
				setSkillLevel().refreshSkill(5);
			} else {
				sendMessage("You already have full prayer points.");
			}
		break;

So im guessing i need to make a int for it for all 3 to be accepted, right? or am i completely reading the “required int, int, int” wrong?

Uh…

“getPA()” is not like “setSkillLevel” - I don’t know how you made that connection.

the method “getPA()” in PI servers returns a PlayerAssistant object. Which allows the client object (AKA the player) to use the methods that are within the PlayerAssistant class. Within that class there are numerous methods that “assist” the player class (Hence the class name). One of them being setSkillLevel.

That being said, don’t try and look for the equivalent of “getPA()” - because you probably don’t have it.

Your error here is because you’re trying to compare an int to a void - which is impossible to compare.
You need to compare an int with an int.

Somewhere within your server you should have a method called “getLevelForXP” - or similar.
You should use it in this scenario.

case 409: //Prayer Altar @Home int maxLevel = getLevelForXP(playerXP[5]); if(playerLevel[5] < maxLevel) { startAnimation(645); playerLevel[5] = maxLevel; currentpray = maxLevel; sendMessage("You recharge your prayer points."); refreshSkill(5); } else { sendMessage("You already have full prayer points."); } break;
Something like that.

You’ll still have to find your equivalent method for refreshSkill.

Your second error is because you’re applying a method that requires 3 arguments and you supplied none.

By any chance are you using a delta base? Is basically everything your editing within the Client class?

Yes, everything is basically in client.java, and I originally made a connection because when I looked over the pi and my source I searched getPA() and looked at the code for the getPA and it somehow matched to setSkillLevel, so that’s how I made that connection.

Odd.

Anyways, what errors are left?

[quote=“sk8rdude461, post:6, topic:555614”][quote author=CourageCodes link=topic=674825.msg4509755#msg4509755 date=1466180371]
Yes, everything is basically in client.java, and I originally made a connection because when I looked over the pi and my source I searched getPA() and looked at the code for the getPA and it somehow matched to setSkillLevel, so that’s how I made that connection.
[/quote]
Odd.
Anyways, what errors are left?[/quote]
okay, so once i got back, i tried and changed what u told me to and all i get now is the refreshskill().

that’s my only error now, so I went to myrefreshskill()[/color it turned out that mine is [color=red]refreshskills()[/color] but, my color=red]refreshskills() doesn’t have anything there…, theres the code:

[code]
public void refreshSkills() {

}[/code]
thats all thats there. so i guess i need this for it to work? :palm:

I opened up another delta and this is what the refreshSkills() method was:

[code=java] public void refreshSkills() {

sendQuest(""+playerLevel[0]+"", 4004);
sendQuest(""+playerLevel[2]+"", 4006);
sendQuest(""+playerLevel[1]+"", 4008);
sendQuest(""+playerLevel[4]+"", 4010);
sendQuest(""+playerLevel[5]+"", 4012);
sendQuest(""+playerLevel[6]+"", 4014);
sendQuest(""+playerLevel[3]+"", 4016);
sendQuest(""+playerLevel[16]+"", 4018);
sendQuest(""+playerLevel[15]+"", 4020);
sendQuest(""+playerLevel[17]+"", 4022);
sendQuest(""+playerLevel[12]+"", 4024);
sendQuest(""+playerLevel[9]+"", 4026);
sendQuest(""+playerLevel[14]+"", 4028);
sendQuest(""+playerLevel[13]+"", 4030);
sendQuest(""+playerLevel[10]+"", 4032);
sendQuest(""+playerLevel[7]+"", 4034);
sendQuest(""+playerLevel[11]+"", 4036);
sendQuest(""+playerLevel[8]+"", 4038);
sendQuest(""+playerLevel[20]+"", 4152);
sendQuest(""+playerLevel[18]+"", 12166);
sendQuest(""+playerLevel[19]+"", 13926);

sendQuest(""+getLevelForXP(playerXP[0])+"", 4005);
sendQuest(""+getLevelForXP(playerXP[2])+"", 4007);
sendQuest(""+getLevelForXP(playerXP[1])+"", 4009);
sendQuest(""+getLevelForXP(playerXP[4])+"", 4011);
sendQuest(""+getLevelForXP(playerXP[5])+"", 4013);
sendQuest(""+getLevelForXP(playerXP[6])+"", 4015);
sendQuest(""+getLevelForXP(playerXP[3])+"", 4017);
sendQuest(""+getLevelForXP(playerXP[16])+"", 4019);
sendQuest(""+getLevelForXP(playerXP[15])+"", 4021);
sendQuest(""+getLevelForXP(playerXP[17])+"", 4023);
sendQuest(""+getLevelForXP(playerXP[12])+"", 4025);
sendQuest(""+getLevelForXP(playerXP[9])+"", 4027);
sendQuest(""+getLevelForXP(playerXP[14])+"", 4029);
sendQuest(""+getLevelForXP(playerXP[13])+"", 4031);
sendQuest(""+getLevelForXP(playerXP[10])+"", 4033);
sendQuest(""+getLevelForXP(playerXP[7])+"", 4035);
sendQuest(""+getLevelForXP(playerXP[11])+"", 4037);
sendQuest(""+getLevelForXP(playerXP[8])+"", 4039);
sendQuest(""+getLevelForXP(playerXP[20])+"", 4153);
sendQuest(""+getLevelForXP(playerXP[18])+"", 12167);
sendQuest(""+getLevelForXP(playerXP[19])+"", 13927);

sendQuest(""+playerXP[0]+"", 4044);
sendQuest(""+playerXP[2]+"", 4050);
sendQuest(""+playerXP[1]+"", 4056);
sendQuest(""+playerXP[4]+"", 4062);
sendQuest(""+playerXP[5]+"", 4068);
sendQuest(""+playerXP[6]+"", 4074);
sendQuest(""+playerXP[3]+"", 4080);
sendQuest(""+playerXP[16]+"", 4086);
sendQuest(""+playerXP[15]+"", 4092);
sendQuest(""+playerXP[17]+"", 4098);
sendQuest(""+playerXP[12]+"", 4104);
sendQuest(""+playerXP[9]+"", 4110);
sendQuest(""+playerXP[14]+"", 4116);
sendQuest(""+playerXP[13]+"", 4122);
sendQuest(""+playerXP[10]+"", 4128);
sendQuest(""+playerXP[7]+"", 4134);
sendQuest(""+playerXP[11]+"", 4140);
sendQuest(""+playerXP[8]+"", 4146);
sendQuest(""+playerXP[20]+"", 4157);
sendQuest(""+playerXP[18]+"", 12171);
sendQuest(""+playerXP[19]+"", 13921);

}[/code]