Code:
#define TAN_SHIELD 3095
#define TAN_JACKET 3043
#define TAN_BOOTS 3084
#define TAN_GLOVES 3071
#define TAN_LEGGINGS 3081
#define TAN_SLEEVES 3086
#define TAN_HELMET 3076
#define TAN_BAG 3032
ACMD(do_tan)
{
struct obj_data *corpse, *hide;
char buf[MAX_STRING_LENGTH];
char itemname[MAX_INPUT_LENGTH], itemtype[MAX_INPUT_LENGTH];
int r_num = 0;
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_TAN)) {
send_to_char(ch, "You haven't learned how to tan.\r\n");
return;
}
two_arguments(argument, itemname, itemtype);
if (!*itemname) {
send_to_char(ch, "Tan what?\r\n");
return;
}
if (!*itemtype) {
send_to_char(ch, "I see that, but what do you wanna make?\r\n");
return;
}
if (!(corpse = get_obj_in_list_vis(ch, itemname, NULL, world[IN_ROOM(ch)].contents)))
{
send_to_char(ch, "Where did that corpse go?\r\n");
return;
} else {
if(rand_number(1,150) > GET_SKILL(ch, SKILL_TAN)) {
sprintf(buf, "You hack at %s but manage to only destroy the hide.\r\n", corpse->short_description);
send_to_char(ch, buf);
sprintf(buf,"%s tries to skins %s for it's hide, but destroys it.", GET_NAME(ch), corpse->short_description);
act(buf, TRUE, ch, 0, 0, TO_ROOM);
improve_skill(ch, SKILL_TAN);
extract_obj(corpse);
WAIT_STATE(ch, PULSE_VIOLENCE*3);
return;
} else {
sprintf(buf, "You hack at the %s and finally make the %s.\r\n", corpse->short_description, itemtype);
send_to_char(ch, buf);
sprintf(buf, "%s skins %s for it's hide.", GET_NAME(ch), corpse->short_description);
act(buf, TRUE, ch, 0, 0, TO_ROOM);
extract_obj(corpse);
WAIT_STATE(ch, PULSE_VIOLENCE*1);
return;
}
if (!strcmp(itemtype, "shield"))
{
if ((r_num = real_object(TAN_SHIELD)) >= 0)
{
hide = read_object(r_num, VIRTUAL);
obj_to_char(hide, ch);
}
}
else if (!strcmp(itemtype, "jacket"))
{
if ((r_num = real_object(TAN_JACKET)) >= 0)
{
hide = read_object(r_num, VIRTUAL);
obj_to_char(hide, ch);
}
}
else if (!strcmp(itemtype, "boots"))
{
if ((r_num = real_object(TAN_BOOTS)) >= 0)
{
hide = read_object(r_num, VIRTUAL);
obj_to_char(hide, ch);
}
}
else if (!strcmp(itemtype, "gloves"))
{
if ((r_num = real_object(TAN_GLOVES)) >= 0)
{
hide = read_object(r_num, VIRTUAL);
obj_to_char(hide, ch);
}
}
else if (!strcmp(itemtype, "leggings"))
{
if ((r_num = real_object(TAN_LEGGINGS)) >= 0)
{
hide = read_object(r_num, VIRTUAL);
obj_to_char(hide, ch);
}
}
else if (!strcmp(itemtype, "sleeves"))
{
if ((r_num = real_object(TAN_SLEEVES)) >= 0)
{
hide = read_object(r_num, VIRTUAL);
obj_to_char(hide, ch);
}
}
else if (!strcmp(itemtype, "helmet"))
{
if ((r_num = real_object(TAN_HELMET)) >= 0)
{
hide = read_object(r_num, VIRTUAL);
obj_to_char(hide, ch);
}
}
else if (!strcmp(itemtype, "bag"))
{
if ((r_num = real_object(TAN_BAG)) >= 0)
{
hide = read_object(r_num, VIRTUAL);
obj_to_char(hide, ch);
}
} else {
send_to_char(ch, "Illegal type of equipment!\r\n");
return;
}
}
}
necklace.
And if i try with one of the names from the list, it now loads a letter.
Think brackets are wrongly placed, but not my strong side, might also just be something else that i cant see...Any idea ?
File error shows: Nov 18 20:06:11 :: SYSERR: NULL obj ((nil)) or char (0x9c34958) passed to obj_to_char.