Thanks Nick!!,
I removed all of the cases associated with generate_objectlevel (with the exception of the default 0) in reset.c... then I started my quest to find how to bind olevel (which seems to be the varible for the object level) to an area file. I ended up with two files grub.c and mpxset.c, I decided on the latter... mpxset.c after lookin through the file.. I made some alterations that seemed to make sense... I want to bind olevel to value5 within the area file.
This is the relevant code:
switch( obj->item_type )
{
case ITEM_WEAPON:
if ( !str_cmp( arg2, "weapontype" ) )
{
int x;
value = -1;
for ( x = 0; x < sizeof( attack_table ) / sizeof( attack_table[0] ); x++ )
if ( !str_cmp( arg3, attack_table[x] ) )
value = x;
if ( value < 0 )
{
progbug("MpOset: Invalid weapon type", ch);
return;
}
tmp = 3;
break;
}
if ( !str_cmp( arg2, "condition" ) ) tmp = 0;
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_ARMOR:
if ( !str_cmp( arg2, "condition" ) ) tmp = 3;
if ( !str_cmp( arg2, "ac" ) ) tmp = 1;
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_SALVE:
if ( !str_cmp( arg2, "slevel" ) ) tmp = 0;
if ( !str_cmp( arg2, "maxdoses" ) ) tmp = 1;
if ( !str_cmp( arg2, "doses" ) ) tmp = 2;
if ( !str_cmp( arg2, "delay" ) ) tmp = 3;
if ( !str_cmp( arg2, "spell1" ) ) tmp = 4;
if ( !str_cmp( arg2, "spell2" ) ) tmp = 5;
if ( tmp >=4 && tmp <= 5 ) value = skill_lookup(arg3);
break;
case ITEM_SCROLL:
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_POTION:
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_PILL:
if ( !str_cmp( arg2, "slevel" ) ) tmp = 0;
if ( !str_cmp( arg2, "spell1" ) ) tmp = 1;
if ( !str_cmp( arg2, "spell2" ) ) tmp = 2;
if ( !str_cmp( arg2, "spell3" ) ) tmp = 3;
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
if ( tmp >=1 && tmp <= 3 ) value = skill_lookup(arg3);
break;
case ITEM_STAFF:
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_WAND:
if ( !str_cmp( arg2, "slevel" ) ) tmp = 0;
if ( !str_cmp( arg2, "spell" ) )
{
tmp = 3;
value = skill_lookup(arg3);
}
if ( !str_cmp( arg2, "maxcharges" ) ) tmp = 1;
if ( !str_cmp( arg2, "charges" ) ) tmp = 2;
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
I added the lines with "olevel" in them.
Anyways... after a recompile, My shopkeepers sell everything at level 0 (Which makes sense because that is the default). However... the value5 value in the object has no effect on the level. Im wondering if I need to override the default olevel listed in reset.c somehow.... If you have any thoughts on this matter, please tell me what im doing wrong :). In any case, thanks for pointing me in the right direction.
|