Purpose: Making High alch and low Alch work proper
Difficulty: Depends on your knowledge of Java
Assumed Knowledge: C&P??
Tested Server Base: Cleaned v4.
Classes Modified: Client.java
DONT FORGET TO LOOK FOR MY [Only registered and activated users can see links. ]
Step 1: Open up client.java and search
Code:
case 237:
This is the case we use for magic on items (in invertory)
Step 2:
When u found that it should look like this
Code:
case 237: //Magic on Items
int castOnSlot = inStream.readSignedWord();
int castOnItem = inStream.readSignedWordA();
int e3 = inStream.readSignedWord();
int castSpell = inStream.readSignedWordA();
Wit some stuff under.. perhaps enchants (if u added my other tut)
Step 3:
If u found the case .. add right under those lines ore above another spell
the following :
Code:
if(castSpell == 1178) //H Alch
{
if(playerLevel[6] >= 55)
{
if((playerHasItemAmount(561, 1)==false) || (playerHasItemAmount(554, 5)==false))
{
sendMessage("You do not have enough runes to cast this spell.");
}
else if((playerHasItemAmount(561, 1)==true) && (playerHasItemAmount(554, 5)==true))
{
alchvaluez = (alchvaluez / 3);
deleteItem(castOnItem, castOnSlot, 1);
addItem(995, alchvaluez);
addSkillXP(150, 6);
startAnimation(713);
gfx100(113);
deleteItem(561,getItemSlot(561), 1);
deleteItem(554,getItemSlot(554), 5);
setSidebarMage();
}
}
else if(playerLevel[6] <= 55)
{
sendMessage("Your magic level is not high enough for this spell.");
}
}
if(castSpell == 1162) //L Alch
{
if(playerLevel[6] >= 21)
{
if((playerHasItemAmount(561, 1)==false) || (playerHasItemAmount(554, 3)==false))
{
sendMessage("You do not have enough runes to cast this spell.");
}
else if((playerHasItemAmount(561, 1)==true) && (playerHasItemAmount(554, 3)==true))
{
alchvaluez = (alchvaluez / 5);
deleteItem(castOnItem, castOnSlot, 1);
addItem(995, alchvaluez);
addSkillXP(70, 6);
startAnimation(712);
gfx100(112);
deleteItem(561,getItemSlot(561), 1);
deleteItem(554,getItemSlot(554), 3);
setSidebarMage();
}
}
else if(playerLevel[6] <= 21)
{
sendMessage("Your magic level is not high enough for this spell.");
}
}
Step 4:
Add the following also to make it after u click on a item that it goes back the magic book.. (i didnt knew if it was like this )
Code:
private void setSidebarMage() {
try {
outStream.createFrame(106); //Writes the frame 106 out.
outStream.writeByteC(6); //Tells client to switch to the magic interface
updateRequired = true; //Updates
appearanceUpdateRequired = true; //Updates
} catch(Exception E) {
sendMessage("Error switching sidebar back to the magic interface! ~ Called Enzo");
}
}
Thats about it... dont forget to check my [Only registered and activated users can see links. ]