Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Old subject, but I'm in need of assistance (weapon levels in shops)
Old subject, but I'm in need of assistance (weapon levels in shops)
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
Posted by
| Grimm
(17 posts) Bio
|
Date
| Mon 27 Sep 2004 12:05 AM (UTC) |
Message
| 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 :) | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #1 on Mon 27 Sep 2004 12:06 AM (UTC) |
Message
| Simply in the do_wear function, remove the ifcheck checking the objects level. I don't think its checked anywhere else. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Grimm
(17 posts) Bio
|
Date
| Reply #2 on Mon 27 Sep 2004 12:13 AM (UTC) |
Message
| 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. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #3 on Mon 27 Sep 2004 12:20 AM (UTC) |
Message
| |
Posted by
| Grimm
(17 posts) Bio
|
Date
| Reply #4 on Mon 27 Sep 2004 12:30 AM (UTC) |
Message
| 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? | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #5 on Mon 27 Sep 2004 12:40 AM (UTC) |
Message
| Its probably in the function wear_obj then. And as for buying, check do_buy. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Grimm
(17 posts) Bio
|
Date
| Reply #6 on Mon 27 Sep 2004 12:43 AM (UTC) |
Message
| 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? | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #7 on Mon 27 Sep 2004 12:49 AM (UTC) |
Message
| Yes. Or you can comment it out. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Grimm
(17 posts) Bio
|
Date
| Reply #8 on Mon 27 Sep 2004 12:54 AM (UTC) |
Message
| Cool - gonna give it a try... | Top |
|
Posted by
| Grimm
(17 posts) Bio
|
Date
| Reply #9 on Mon 27 Sep 2004 12:58 AM (UTC) |
Message
| 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... | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #10 on Mon 27 Sep 2004 01:16 AM (UTC) |
Message
| I suggest searching for the functions. Its in shops.c |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Grimm
(17 posts) Bio
|
Date
| Reply #11 on Mon 27 Sep 2004 05:22 AM (UTC) |
Message
| 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 :) | Top |
|
Posted by
| Grimm
(17 posts) Bio
|
Date
| Reply #12 on Mon 27 Sep 2004 01:06 PM (UTC) |
Message
| 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? | Top |
|
Posted by
| Toy
(206 posts) Bio
|
Date
| Reply #13 on Mon 27 Sep 2004 05:56 PM (UTC) |
Message
| 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 |
It's always good to know how far you are willing to go to be the best...
Karl Mancine
aka
Toy the Dark Puppet | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #14 on Mon 27 Sep 2004 07:05 PM (UTC) |
Message
| Yeah, should be something like this ifcheck:
if ( object->level > ch->level )
|
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
47,843 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top