… | |
… | |
1023 | op->level = rndm (creator->level); |
1023 | op->level = rndm (creator->level); |
1024 | |
1024 | |
1025 | tailor_readable_ob (op, (creator && creator->stats.sp) ? creator->stats.sp : -1); |
1025 | tailor_readable_ob (op, (creator && creator->stats.sp) ? creator->stats.sp : -1); |
1026 | /* books w/ info are worth more! */ |
1026 | /* books w/ info are worth more! */ |
1027 | op->value *= ((op->level > 10 ? op->level : (op->level + 1) / 2) * ((strlen (op->msg) / 250) + 1)); |
1027 | op->value *= ((op->level > 10 ? op->level : (op->level + 1) / 2) * ((strlen (op->msg) / 250) + 1)); |
1028 | /* creator related stuff */ |
|
|
1029 | |
|
|
1030 | /* for library, chained books. Note that some monsters have no_pick |
|
|
1031 | * set - we don't want to set no pick in that case. |
|
|
1032 | */ |
|
|
1033 | if (QUERY_FLAG (creator, FLAG_NO_PICK) && !QUERY_FLAG (creator, FLAG_MONSTER)) |
|
|
1034 | SET_FLAG (op, FLAG_NO_PICK); |
|
|
1035 | if (creator->slaying && !op->slaying) /* for check_inv floors */ |
|
|
1036 | op->slaying = creator->slaying; |
|
|
1037 | |
1028 | |
1038 | /* add exp so reading it gives xp (once) */ |
1029 | /* add exp so reading it gives xp (once) */ |
1039 | op->stats.exp = op->value > 10000 ? op->value / 5 : op->value / 10; |
1030 | op->stats.exp = op->value > 10000 ? op->value / 5 : op->value / 10; |
1040 | } |
1031 | } |
|
|
1032 | |
|
|
1033 | /* creator related stuff */ |
|
|
1034 | |
|
|
1035 | /* for library, chained books. Note that some monsters have no_pick |
|
|
1036 | * set - we don't want to set no pick in that case. |
|
|
1037 | */ |
|
|
1038 | if (QUERY_FLAG (creator, FLAG_NO_PICK) && !QUERY_FLAG (creator, FLAG_MONSTER)) |
|
|
1039 | SET_FLAG (op, FLAG_NO_PICK); |
|
|
1040 | if (creator->slaying && !op->slaying) /* for check_inv floors */ |
|
|
1041 | op->slaying = creator->slaying; |
1041 | break; |
1042 | break; |
1042 | |
1043 | |
1043 | case SPELLBOOK: |
1044 | case SPELLBOOK: |
1044 | op->value = op->value * op->inv->value; |
1045 | op->value = op->value * op->inv->value; |
1045 | /* add exp so learning gives xp */ |
1046 | /* add exp so learning gives xp */ |