Two-Handed weapons [by Boxboy]
Snippet Posted Sunday, July 23rd @ 08:56:37 AM, by Brandon Brown.
Boxboy writes, 'I was rather disappointed with the fact that many Muds have things like 'a Two-Handed sword' which you can use whilst holding something with your other whilst wielding it. So, here is my oh so basic idea for two handed weapons...'
I was rather disappointed with the fact that many Muds have things
like 'a Two-Handed sword' which you can use whilst holding something
with your other whilst wielding it. Well this seemed rather, stupid,
So, here is my oh so basic idea for two handed weapons, and don't
hurt me for this contribution......

/***** START HERE ******/

Start in structs.h
-------------------

Find,

#define ITEM_NOSELL	       (1 << 16)	/* Shopkeepers won't touch it	*/

then below it add,

#define ITEM_TWO_HANDED	       (1 << 17)    /* Both hands mustbe free to wield it */

Note: Make sure this has the right number.

Now move on to act.item.c,
--------------------------

Find the function, do_wield, in it you will find a line which looks like,

      send_to_char("You can't wield that.\r\n", ch);

right below it just add,

    if (IS_OBJ_STAT(obj, ITEM_TWO_HANDED) && GET_EQ(ch, WEAR_HOLD))
      send_to_char("Your other hand is already holding something.\r\n", ch);

right now find the function, do_grab,
At the top there should be,

  struct obj_data *obj;

below it add,

  struct obj_data *wielded = GET_EQ(ch, WEAR_WIELD);

Now search for the line,

      perform_wear(ch, obj, WEAR_LIGHT);

add right below it just add,

	else if ((GET_EQ(ch, WEAR_WIELD) && IS_OBJ_STAT(wielded, ITEM_TWO_HANDED))) {
    send_to_char("You cannot hold something as you are wielding a two handed weapon.\r\n", ch);
	return;
	}

/***** FINISH HERE *****/

Well thats all, piece of, er pie.

Well you could add things like, if you strength is 18/100 then you 
can wield a TWO_HANDED weapon AND hold something.

Well that is all for now, hopefully this will be put in many Muds,
as this will make them just that much more realistic

If you use this, please can you just send me an Email saying that you 
liked, were insulted by, due to it you want my head on a pole, what 
ever takes your fancy, just let me know how you feel about this kind
of snippet, thanks.

baez@as-if.com

PS: This is my first piece of code/snippet that I have given, but
I hope to give more soon...

Bye bye from Boxboy

<< Zone Saving [by BlueDragon] | Reply | Flattened >>

 


Related Links
  Boxboy
Related Articles
More by bbrown
 
 

Quick Links
 
The CircleMUD FAQ
The CircleMUD home page
Alex's Snippets
Wintermute Snippets
CircleMUD Bug Reporting or Help
CircleMUD List Archives
CircleMUD Resources
Death Gate's Scripts
(Author of C conversion)
Sammy's code site
Erwin S. Andreasen's page
(Author of mudFTP and other goodies)
Death's Gate Scripting site
Help for CircleMUD in Windows
The OasisOLC Maintenance Effort
George's Random Stuff
Imaginary Realities
MUD Dictionary