Here's a mend code snippet. It has skill checks, 25% healing and skill advancement.
NOTE: This won't increase skill beyond 101, since skill above 100 is useless :p
Insert into client_process.cpp
(EDIT: Fixed a couple dumb errors)
Code:
case OP_Mend:
{
int mendhp = GetMaxHP() / 4;
int noadvance = (rand()%200);
int currenthp = GetHP();
if (rand()%100 <= GetSkill(MEND)) {
SetHP(GetHP() + mendhp);
SendHPUpdate();
Message(4, "You mend your wounds and heal some damage");
}
else if (noadvance > 175 && currenthp > mendhp) {
SetHP(GetHP() - mendhp);
SendHPUpdate();
Message(4, "You have worsened your wounds!"
}
else if (noadvance > 175 && currenthp <= mendhp) {
SetHP(1);
SendHPUpdate();
Message(4, "You have worsened your wounds!");
}
else {
Message(4, "You fail to mend your wounds");
}
if ((GetSkill(MEND) < noadvance) && (rand()%100 < 35) && (GetSkill(MEND) < 101))
this->SetSkill(MEND,++pp.skills[MEND]);
break;
}