You can right click on objects in your inventory to interact with it based on object_type and you can click on it for default actions such as equipped gear will be removed with a click, etc.
Code:
if (mxp_type != 0) {
one_argument(obj->name, keyword);
switch (mxp_type) {
case 1: // inventory
// loop through to ensure correct item, i.e. 2.dagger, 3.armor, etc.
for (temp_obj = ch->carrying; temp_obj; temp_obj = temp_obj->next_content) {
// check if the temp_obj contains keyword in the name list
if (isname(keyword, temp_obj->name)) {
if (temp_obj->short_description == obj->short_description)
// this is the item they are trying to interact with
// or at least has the same short description
break;
else
item_num++;
}
}
if (item_num > 0) {
sprintf(keyword1, "%d.%s", (item_num + 1), keyword);
strcpy(keyword, keyword1);
}
if (GET_OBJ_TYPE(obj) == ITEM_WEAPON)
strcpy(sendcmd, "wield");
else if (GET_OBJ_TYPE(obj) == ITEM_SCROLL)
strcpy(sendcmd, "recite");
else if (GET_OBJ_TYPE(obj) == ITEM_POTION)
strcpy(sendcmd, "quaff");
else if (GET_OBJ_TYPE(obj) == ITEM_ARMOR)
strcpy(sendcmd, "wear");
else if (GET_OBJ_TYPE(obj) == ITEM_WORN)
strcpy(sendcmd, "wear");
else if (GET_OBJ_TYPE(obj) == ITEM_FOOD)
strcpy(sendcmd, "eat");
else if (GET_OBJ_TYPE(obj) == ITEM_DRINKCON)
strcpy(sendcmd, "drink");
else if (GET_OBJ_TYPE(obj) == ITEM_NOTE)
strcpy(sendcmd, "read");
else if (GET_OBJ_TYPE(obj) == ITEM_SPELLBOOK)
strcpy(sendcmd, "look in");
else if (GET_OBJ_TYPE(obj) == ITEM_CONTAINER)
strcpy(sendcmd, "look in");
else if (GET_OBJ_TYPE(obj) == ITEM_AMMO_POUCH)
strcpy(sendcmd, "look in");
else
strcpy(sendcmd, "hold");
send_to_char(ch, "\t<send href='%s %s|drop %s|eat %s|hold %s|lore %s' hint='use/equip %s|drop %s|eat %s|hold %s|lore %s'>%s\t</send>", sendcmd, keyword,
keyword, keyword, keyword, keyword, keyword, keyword, keyword, keyword, keyword, obj->short_description);
break;
case 2: // equipment
send_to_char(ch, "\t<send href='remove %s'>%s\t</send>", keyword, obj->short_description);
break;
}
} else {
send_to_char(ch, "%s", obj->short_description);
}