Difficulty: 1/10
Files edited: Potions.Java
Credits: The Unholy
In this tutorial you will learn how to make items do things by simply clicking on them! (Provided they have a fourth option (Instead of the standard three: Use, Drop and Examine), such as 'Eat', 'Drink', 'Wear', 'Bury'.
This tutorial is based on two parts, Food and Bones.
FOODSearch for:
case 385:You should see the method for eating Shark (Case = ID. Shark ID = 385):
case 1891:
if (System.currentTimeMillis() - c.foodDelay < 2000) //Delay between eating cakes (2 Game ticks)
return;
c.foodDelay = System.currentTimeMillis();
c.setAnimation(0x33D); //Animation when consumed
//c.playSound(317, 000, 020);
c.sM("You eat the shark."); // Message sent when consumed
if(c.currentHealth < c.playerLevel[c.playerHitpoints]){
c.sM("It heals some health."); //If not at full HP, you'll get this message when consumed.
}
c.deleteItem(385, slot, 1); //Removes cake from your inventory
if(c.currentHealth < c.playerLevel[c.playerHitpoints] + 16){
c.currentHealth += 20; //Heals you by the set amount. (20 in this case).
if (c.currentHealth > c.playerLevel[c.playerHitpoints])
c.currentHealth = c.playerLevel[c.playerHitpoints];
}
c.sendQuest("" + c.currentHealth + "", 4016);
break;For example, if you'd like a player to be able to eat cakes, each piece healing 4).
if (System.currentTimeMillis() - c.foodDelay < 2000) //Delay between eating sharks (2 Game ticks)
return;
c.foodDelay = System.currentTimeMillis();
c.setAnimation(0x33D); //Animation when consumed
//c.playSound(317, 000, 020);
c.sM("You eat the shark."); // Message sent when consumed
if(c.currentHealth < c.playerLevel[c.playerHitpoints]){
c.sM("It heals some health."); //If not at full HP, you'll get this message when consumed.
}
c.deleteItem(1891, slot, 1); //Removes cake from your inventory
c.addItem(1893, slot, 1); //Adds cake 2/3
if(c.currentHealth < c.playerLevel[c.playerHitpoints] + 16){
c.currentHealth += 4; //Heals you by the set amount. (4 in this case).
if (c.currentHealth > c.playerLevel[c.playerHitpoints])
c.currentHealth = c.playerLevel[c.playerHitpoints];
}
c.sendQuest("" + c.currentHealth + "", 4016);
break;For the 2/3 cake to go to a 1/3, change case 1891 to 1893. And addItem 1893 to 1895. For eating the slice, change case 1893 to 1895, and remove the addItem.
BONESSearch for:
Case 536:You should see:
case 536:
if (System.currentTimeMillis() - c.foodDelay < 2000) //Delay between burying (2 game ticks)
return;
c.foodDelay = System.currentTimeMillis();
c.prayerMessage(72,536); // Gets the Item name and the Experience gain for the sM (message)
break;Let's say you wanted to add Dagannoth bones!
case 6729:
if (System.currentTimeMillis() - c.foodDelay < 2000) //Delay between burying (2 game ticks)
return;
c.foodDelay = System.currentTimeMillis();
c.prayerMessage(130,6729); // Gets the Item name and the Experience gain for the sM (message)
break;This will bury dagannoth bones and give you 130 prayer experience. NOTE: This will not affect using bones on an altar, that is Item on Object which is not covered here.
Save and compile, and enjoy your infernal ashes! And dare I say it, eating your tacos