Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot, Yandex, Google

Members: 0
Guests: 24
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
619
Alexander
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Wear issue
Forum Rules | Mark all | Recent Posts

Wear issue
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 17, 2005, 2:50 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,874
JoinedJul 26, 2005

Ok, going to try and make sure I give enough info for this here as well as the fix so bare with me
Problem
<24hp 145m 110mv> wear empty
You hold an empty flask in your hands.

<24hp 145m 110mv> wear shield
You use a shield with the Darkhaven Academy crest as a shield.

<24hp 145m 110mv> wear sword
You wield a finely honed sword.

*output from equipment:*
<worn as shield>    a shield with the Darkhaven Academy crest
<wielded>           a finely honed sword
<held>              an empty flask

*now lets try it in another order*
<24hp 145m 110mv> wear sword
You wield a finely honed sword.

<24hp 145m 110mv> wear empty
You hold an empty flask in your hands.

<24hp 145m 110mv> wear shield
You can't use a shield AND two weapons!
  (Notice it says im wearing two weapons when im only wearing a sword and an empty flask)

*output from equipment:*
You are using:
<wielded>           a finely honed sword
<held>              an empty flask
*That is just a slight typo no biggy*

*Now lets try it in another order*
<24hp 145m 110mv> wear sword
You wield a finely honed sword.

<24hp 145m 110mv> wear shield
You use a shield with the Darkhaven Academy crest as a shield.

<24hp 145m 110mv> wear empty
You hold an empty flask in your hands.

*ouptput from equipment:*
<worn as shield>    a shield with the Darkhaven Academy crest
<wielded>           a finely honed sword
<held>              an empty flask
*Notice that the change in order allows it to work*


So now we will assume you shouldn't be able to wear a shield and hold an item at the same time and
This fix will be based on that assumption.
First lets take care of the typo.
in act_obj.c function wear_obj
find
      case ITEM_WEAR_SHIELD:
         if( get_eq_char( ch, WEAR_DUAL_WIELD )
             || ( get_eq_char( ch, WEAR_WIELD ) && get_eq_char( ch, WEAR_MISSILE_WIELD ) )
             || ( get_eq_char( ch, WEAR_WIELD ) && get_eq_char( ch, WEAR_HOLD ) ) )
         {
            send_to_char( "You can't use a shield AND two weapons!\n\r", ch );
            return;
         }

change that to this
      case ITEM_WEAR_SHIELD:
         if( get_eq_char( ch, WEAR_DUAL_WIELD )
             || ( get_eq_char( ch, WEAR_WIELD ) && get_eq_char( ch, WEAR_MISSILE_WIELD ) )
             || ( get_eq_char( ch, WEAR_WIELD ) && get_eq_char( ch, WEAR_HOLD ) ) )
         {
            if( get_eq_char( ch, WEAR_HOLD ) )
               send_to_char( "You can't use a shield while using a weapon and holding something!\n\r", ch );
            else
               send_to_char( "You can't use a shield AND two weapons!\n\r", ch );
            return;
         }

Yea i just tossed it into the same thing and made it output a different thing instead of making two different parts to handle it, while still giving the right info.
Now to fix the hold issue
find
      case ITEM_HOLD:
         if( get_eq_char( ch, WEAR_DUAL_WIELD )
         || ( get_eq_char( ch, WEAR_WIELD ) && get_eq_char( ch, WEAR_MISSILE_WIELD ) ) )
         {
            send_to_char( "You cannot hold something AND two weapons!\n\r", ch );
            return;
         }

change that with this (again why not just fully combine these instead of checking again for wield and dual and missile)
      case ITEM_HOLD:
         if( get_eq_char( ch, WEAR_DUAL_WIELD )
         || ( get_eq_char( ch, WEAR_WIELD )
         && ( get_eq_char( ch, WEAR_MISSILE_WIELD ) || get_eq_char( ch, WEAR_SHIELD ) ) ) )
         {
            if( get_eq_char( ch, WEAR_SHIELD ) )
               send_to_char( "You cannot hold something while using a weapon and a shield!\n\r", ch );
            else
               send_to_char( "You cannot hold something AND two weapons!\n\r", ch );
            return;
         }

Now to fix the wearing weapon issue
find
            OBJ_DATA *mw, *dw, *hd, *sd;
            tmpobj = get_eq_char( ch, WEAR_WIELD );
            mw = get_eq_char( ch, WEAR_MISSILE_WIELD );
            dw = get_eq_char( ch, WEAR_DUAL_WIELD );
            hd = get_eq_char( ch, WEAR_HOLD );
            sd = get_eq_char( ch, WEAR_SHIELD );

change that to like this
            OBJ_DATA *mw, *dw, *hd, *sd;
            tmpobj = get_eq_char( ch, WEAR_WIELD );
            mw = get_eq_char( ch, WEAR_MISSILE_WIELD );
            dw = get_eq_char( ch, WEAR_DUAL_WIELD );
            hd = get_eq_char( ch, WEAR_HOLD );
            sd = get_eq_char( ch, WEAR_SHIELD );

            if( hd && sd )
            {
               send_to_char( "You are already holding something and wearing a shield.\n\r", ch );
               return;
            }


Now on to how this affects it (although obvious ill go ahead and show it too)
<24hp 145m 110mv> wear empty
You hold an empty flask in your hands.

<24hp 145m 110mv> wear shield
You use a shield with the Darkhaven Academy crest as a shield.

<24hp 145m 110mv> wear sword
You are already holding something and wearing a shield.
  *Notice this now handles right*

<24hp 145m 110mv> wear sword
You wield a finely honed sword.

<24hp 145m 110mv> wear shield
You use a shield with the Darkhaven Academy crest as a shield.

<24hp 145m 110mv> wear empty
You cannot hold something while using a weapon and a shield!
  *notice now it wont allow it*

<24hp 145m 110mv> wear sword
You wield a finely honed sword.

<24hp 145m 110mv> wear empty
You hold an empty flask in your hands.

<24hp 145m 110mv> wear shield
You can't use a shield while using a weapon and holding something!
  *Now thats a more correct message to get*

Up to you all on how you want to handle but from my test these were the only issues i found in wearing eq.
Notice i didnt check everything but a good bit of it.

If your having other issues then might be best to check the latest release and check it for previous fixes.
This was found in a fresh download of smaugfuss.
       
Pages:<< prev 1 next >>