bool_t can_give_obj(OBJ_DATA *obj, CHAR_DATA *ch, CHAR_DATA *victim) {
//if is is a pk looted object or a container containing a pk looted object
if (obj->item_type == ITEM_CONTAINER) {
bool_t found = FALSE;
OBJ_DATA *objInContainer;
for (objInContainer = obj->contains;objInContainer;objInContainer = objInContainer->next_content)
if (( !victim ? !IS_PK(ch) : !IS_PK(victim)) && IS_SET(objInContainer->extra2_flags, ITEM2_PK_LOOTED)) {
found = TRUE;
break;
}
}
if (found) {
chprintf(ch, "You cannot %s %s without removing %s from it\n\r", !victim ? "get" : "give",
obj->short_descr, objInContainer->short_descr);
send_to_char("as it has been cursed by the gods and cannot be touched by a non PK.\n\r", ch);
return FALSE;
}
}
else {
if (( !victim ? !IS_PK(ch) : !IS_PK(victim)) && IS_SET(obj->extra2_flags, ITEM2_PK_LOOTED)) {
send_to_char("This item has been cursed by the gods, only a PK can touch it\n\r", ch);
return FALSE;
}
}
return TRUE;
}