Looks alittle like tbamud code. But not quite. If anyone feel up to the Challenge, plus make a tbamud snippet and repost.
Code:
void do_carve( struct char_data *ch, char *argument, int cmd)
{
char arg1[MAX_STRING_LENGTH];
char arg2[MAX_STRING_LENGTH];
char buffer[MAX_STRING_LENGTH];
struct obj_data *corpse;
struct obj_data *food;
int i,r_num;
struct affected_type af;
if (!ch->skills)
return;
if (IS_PC(ch) || IS_SET(ch->specials.act,ACT_POLYSELF))
if (!HasClass(ch,CLASS_RANGER)) {
send_to_char ("Hum, you wonder how you would do this...\n\r",ch);
return;
}
if (!ch->skills[SKILL_RATION].learned) {
send_to_char ("Best leave the carving to the skilled.\n\r",ch);
return;
}
half_chop(argument,arg1,arg2);
corpse=get_obj_in_list_vis(ch,arg1,(real_roomp(ch->in_room)->contents));
if(!corpse) {
send_to_char("That's not here.\n\r",ch);
return;
}
if (!IS_CORPSE(corpse)) {
send_to_char("You can't carve that!\n\r",ch);
return;
}
if(corpse->obj_flags.weight<70) {
send_to_char("There is no good meat left on it.\n\r",ch);
return;
}
if ((GET_MANA(ch) < 10) && GetMaxLevel(ch) < LOW_IMMORTAL) {
send_to_char ("You don't have the concentration to do this.\n\r",ch);
return;
}
if (ch->skills[SKILL_RATION].learned < dice (1,101)) {
send_to_char ("You can't seem to locate the choicest parts of the corpse.\n\r",ch);
GET_MANA(ch) -= 5;
LearnFromMistake(ch, SKILL_RATION, 0, 95);
WAIT_STATE(ch, PULSE_VIOLENCE*3);
return;
}
act("$n carves up the $p and creates a healthy ration.",FALSE,ch,corpse,0,TO_ROOM);
send_to_char("You carve up a fat ration.\n\r",ch);
if ((r_num = real_object(FOUND_FOOD)) >= 0) {
food = read_object(r_num, REAL);
food->name= (char *)strdup("ration slice filet food");
sprintf(buffer,"a Ration%s",corpse->short_description+10);
food->short_description= (char *)strdup(buffer);
food->action_description= (char *)strdup(buffer);
sprintf(arg2,"%s is lying on the ground.",buffer);
food->description= (char *)strdup(arg2);
corpse->obj_flags.weight=corpse->obj_flags.weight-50;
i=number(1,6);
if(i==6)
food->obj_flags.value[3]=1;
obj_to_room(food,ch->in_room);
WAIT_STATE(ch, PULSE_VIOLENCE*3);
} /* we got the numerb of the item... */
}