Purpose: Adding new food + how much it heals.
Difficulty: 1
Tested On: Deltascape
first open up postions.java and look up for
and just replace that whole case with this....[IF you have duel arena added]
Code:
case 391:
if (c.duelRule[7] && c.inDuel && c.duelFight) {
c.sM("Food has been disabled for this duel.");
return;
}
if (System.currentTimeMillis() - c.foodDelay < 2000)
return;
c.foodDelay = System.currentTimeMillis();
c.setAnimation(0x33D);
//c.playSound(317, 000, 020);
c.sM("You eat the sea tutrle.");
if(c.currentHealth < c.playerLevel[c.playerHitpoints]){
c.sM("It heals some health.");
}
c.deleteItem(397, slot, 1);
c.currentHealth += $$;
if (c.currentHealth > c.playerLevel[c.playerHitpoints])
c.currentHealth = c.playerLevel[c.playerHitpoints];
c.sendQuest("" + c.currentHealth + "", 4016);
break;
Code:
c.currentHealth += $$;
change the $$ to how much u want it to heal.
Code:
if (System.currentTimeMillis() - c.foodDelay < 2000)
if u wanna make it 1 sec ea for eating the food just change the 2000 to 1000...
Code:
if (c.duelRule[7] && c.inDuel && c.duelFight) {
c.sM("Food has been disabled for this duel.");
return;
}
this is if u only have dueling on ur server.
Code:
c.deleteItem(397, slot, 1);
this deletes it from invo after it has been used.
If You Dont Have Duel Arena This Is How It Should Look.
Code:
if (System.currentTimeMillis() - c.foodDelay < 2000)
return;
c.foodDelay = System.currentTimeMillis();
c.setAnimation(0x33D);
//c.playSound(317, 000, 020);
c.sM("You eat the Sea Turtle.");
if(c.currentHealth < c.playerLevel[c.playerHitpoints]){
c.sM("It heals some health.");
}
c.deleteItem(397, slot, 1);
c.currentHealth += $$;
if (c.currentHealth > c.playerLevel[c.playerHitpoints])
c.currentHealth = c.playerLevel[c.playerHitpoints];
c.sendQuest("" + c.currentHealth + "", 4016);
break;
Save And Compile And Your Done!!
Extra: If You Wanna Make It Mod+ Food And they Can use it even if the duel arena to stop food just make the case look like this
Code:
case 397:
if (System.currentTimeMillis() - c.foodDelay < 1000)
return;
c.foodDelay = System.currentTimeMillis();
c.setAnimation(0x33D);
//c.playSound(317, 000, 020);
c.sM("You eat the Sea Turtle.");
if(c.currentHealth < c.playerLevel[c.playerHitpoints]){
c.sM("It heals some health.");
}
c.currentHealth += 60;
if (c.currentHealth > c.playerLevel[c.playerHitpoints])
c.currentHealth = c.playerLevel[c.playerHitpoints];
c.sendQuest("" + c.currentHealth + "", 4016);
break;
and then go into ur client java and search up
Code:
if (playerHasItem(395)) {
and it should look like this
Code:
if (playerHasItem(395)) {
if (misc.random(1) == 0 || misc.random(1) == 1) {
setAnimation(883);
deleteItem(395, getItemSlot(395), 1);
addSkillXP(50000, 7);
addItem(397, 1);
sM("You susuccessfuly cooked the sea turtle.");
lastAction = System.currentTimeMillis();
} else {
setAnimation(883);
deleteItem(395, getItemSlot(395), 1);
addItem(399, 1);
lastAction = System.currentTimeMillis();
sM("You accidentally burn a sea turtle.");
}
}
replace it with this..
Code:
if (playerHasItem(395)) {
if (misc.random(1) == 0 || misc.random(1) == 1) {
setAnimation(883);
deleteItem(395, getItemSlot(395), 1);
addSkillXP(50000, 7);
addItem(385, 1);
sM("sorry this is a admin food..have a manta ray");
lastAction = System.currentTimeMillis();
} else {
setAnimation(883);
deleteItem(395, getItemSlot(395), 1);
addItem(399, 1);
lastAction = System.currentTimeMillis();
sM("You accidentally burn a sea turtle..oh well it was a admin food any ways ;P");
}
}
this will give them a manta ray and tell them that it is a admin food only...and tell them they got a manta ray..and for me i changed the xp to give them 50k xp since they worked so hard to catch the food...u can change the xp givven by changing this
Code:
addSkillXP(50000, 7);
50000 is the xp given and the 7 is what skill the xp gose to. u can change that.
hope this helped some people!