View Single Post
Old September 24, 2014, 15:50   #4
kaypy
Swordsman
 
Join Date: May 2009
Posts: 294
kaypy is on a distinguished road
Dig dig dig

OK, aquirement(...)
calls make_object(level,good=TRUE,great=TRUE...)
which calls apply_magic(level,allow_artifacts=TRUE,good=TRUE,g reat=TRUE...)
which calls make_ego_item(level...)
which calls ego_find_random(level...) to find the type of ego

ego_find_random may fail, if there isn't any appropriate ego available, but that normally only applies to depths with no generatable ego. Some form of helm should be available anywhere... (or L1 to 127 at least)

...

Hmm. I think not giving the Helm of Beauty an A line may be winding up with garbage allocation numbers instead of uncreatable... Nope nothing to see here move along

...

I went into tweak object mode on a leather cap rerolling it at excellent, and every so often the initial loop on ego_find_random seems to skip entirely

...

Ah. Occasionally the GREAT_EGO level boost in make_ego_item sets it to generate items on eg level 257 which is way out of the generation range of any of egos.

While min depth should be checked against the boosted depth, max depth should really be vs actual depth. You would need to store the original level in make_ego_item and pass that as a new argument to ego_find_random

Code:
static struct ego_item *ego_find_random(object_type *o_ptr, int eff_level, int level)
{

...

		/* Reset any previous probability of this type being picked */
		table[i].prob3 = 0;
		
		if (eff_level < table[i].level)
			continue;

		/* Access the ego item */
		ego = &e_info[table[i].index];
        
		/* enforce maximum */
		if (level > ego->alloc_max) continue;	

		/* roll for Out of Depth (ood) */
		if (eff_level < ego->alloc_min){
			ood_chance = MAX(2, (ego->alloc_min - level) / 3);
			if (!one_in_(ood_chance)) continue;
		}
...

}

...

static void make_ego_item(object_type *o_ptr, int level)
{
	int orig_level = level;

...

	/* Try to get a legal ego type for this item */
	o_ptr->ego = ego_find_random(o_ptr, level, orig_level);

...

}

Last edited by kaypy; September 24, 2014 at 17:33.
kaypy is offline   Reply With Quote