Sorry to bring an old subject back to the forefront, but how can I turn off the level requirements for different armor and weapons in SMAUG? I have seen some posts with code snippets and such, but the best I have been able to do with cygwin is start the shell. After that I'm toast :P
Any help you folks could offer in regard to this would be amazingly helpful :)
Simply in the do_wear function, remove the ifcheck checking the objects level. I don't think its checked anywhere else.
Ok - I'm not a coder, but I can try and figure stuff out given enough info. Which file is this in, and where can I find instructions on compiling the win 32 exe using cygwin?
I'm really sorry to come across as such a dolt, but I'm really more of a builder type than a coder.
Read over the Smaug FAQs and documents.
It should be in act_obj.c
Not sure about win32. Basic compiling help is found here:
http://www.gammon.com.au/smaug/howtocompile.htm
Ok - here's what I found looking for that string:
void do_wear( CHAR_DATA *ch, char *argument )
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
OBJ_DATA *obj;
sh_int wear_bit;
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
if ( (!str_cmp(arg2, "on") || !str_cmp(arg2, "upon") || !str_cmp(arg2, "around"))
&& argument[0] != '\0' )
argument = one_argument( argument, arg2 );
if ( arg1[0] == '\0' )
{
send_to_char( "Wear, wield, or hold what?\n\r", ch );
return;
}
if ( ms_find_obj(ch) )
return;
if ( !str_cmp( arg1, "all" ) )
{
OBJ_DATA *obj_next;
for ( obj = ch->first_carrying; obj; obj = obj_next )
{
obj_next = obj->next_content;
if ( obj->wear_loc == WEAR_NONE && can_see_obj( ch, obj ) )
{
wear_obj( ch, obj, FALSE, -1 );
if ( char_died(ch) )
return;
}
}
return;
}
else
{
if ( ( obj = get_obj_carry( ch, arg1 ) ) == NULL )
{
send_to_char( "You do not have that item.\n\r", ch );
return;
}
if ( arg2[0] != '\0' )
wear_bit = get_wflag(arg2);
else
wear_bit = -1;
wear_obj( ch, obj, TRUE, wear_bit );
}
return;
}
I can't see the reference to level there, but maybe I'm just being blind. Also, does this affect shopkeepers who won't sell to lower level players?
Its probably in the function wear_obj then. And as for buying, check do_buy.
Ok - I truncated this to the relevant bit:
void wear_obj( CHAR_DATA *ch, OBJ_DATA *obj, bool fReplace, sh_int wear_bit )
{
char buf[MAX_STRING_LENGTH];
OBJ_DATA *tmpobj = NULL;
sh_int bit, tmp;
separate_obj( obj );
if ( get_trust( ch ) < obj->level )
{
sprintf( buf, "You must be level %d to use this object.\n\r",
obj->level );
send_to_char( buf, ch );
act( AT_ACTION, "$n tries to use $p, but is too inexperienced.",
ch, obj, NULL, TO_ROOM );
return;
}
if ( !IS_IMMORTAL(ch)
&& (( IS_OBJ_STAT(obj, ITEM_ANTI_WARRIOR)
&& ch->class == CLASS_WARRIOR )
|| ( IS_OBJ_STAT(obj, ITEM_ANTI_WARRIOR)
Should be, in my case:
void wear_obj( CHAR_DATA *ch, OBJ_DATA *obj, bool fReplace, sh_int wear_bit )
{
char buf[MAX_STRING_LENGTH];
OBJ_DATA *tmpobj = NULL;
sh_int bit, tmp;
separate_obj( obj );
}
if ( !IS_IMMORTAL(ch)
&& (( IS_OBJ_STAT(obj, ITEM_ANTI_WARRIOR)
&& ch->class == CLASS_WARRIOR )
|| ( IS_OBJ_STAT(obj, ITEM_ANTI_WARRIOR)
Correct?
Yes. Or you can comment it out.
Cool - gonna give it a try...
Ok - a bit of a problem here...
Which file is do_buy in? I can't seem to find it in any of the act files...
I suggest searching for the functions. Its in shops.c
Thanks LOADS Zeno :)
I had to change a few other values to get the prices to stop displaying the level as well, but now everything is peachy again :)
Sorry to be a pest, but another problem has reared it's ugly head:
Now, any items that are bgought that are above the player's level will not save with the player. They can be worn just fine, but they disappear when the player logs out. I can also see the server reporting the fact they were wearing the weapons and armor as a bug...
Any idea where this comes from?
There's a call in save.c to not keep items on a player if their level is either prototyped or above their level. Not sure where offhand, but I know it's in there.
-Toy
Yeah, should be something like this ifcheck:
if ( object->level > ch->level )
Found it - thanks again guys :)