Welcome to the Builder Academy

Question Weapon Proficiency?

More
05 Jul 2012 22:39 #326 by Papaya Pete
Does anyone know of a weapon proficiency snippit that is out there?

Please Log in or Create an account to join the conversation.

More
06 Jul 2012 04:31 #330 by Vatiken
Replied by Vatiken on topic Re: Weapon Proficiency?
CircleMUD FTP

There are 2 near the bottom of the page.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
06 Jul 2012 07:35 - 06 Jul 2012 09:25 #332 by Papaya Pete
Replied by Papaya Pete on topic Re: Weapon Proficiency?
I should've looked there first! I'm wondering, if I see I snippit that I like and put it into tbaMUD, should I just post it here on the forums or upload it? I'm asking because I found one for two-hands only that looked good and seemed to have gone in seamlessly.

Edit:
Hmmm. Now there are some errors. Going to see what I can do before asking anymore questions.
Last edit: 06 Jul 2012 09:25 by Papaya Pete.

Please Log in or Create an account to join the conversation.

More
06 Jul 2012 09:37 #334 by Papaya Pete
Replied by Papaya Pete on topic Re: Weapon Proficiency?
Ah fixed! I had quite a problem with it but then realized that it was due to me putting the snippit into a back-up of the src folder. Wow, that's bad.

Anyways, I'll post the Two Hands Only snippit here. If it's Ok, I'll modify it to work with the current version of tbaMUD.
Code:
/* # By Vedic <vedic@thevedic.net> # From Aarait telnet://thevedic.net:4000 http://thevedic.net/~aarait # Share and share alike. */ Has it every bothered you that a person could hold a twig of intelligence, a lantern, a two handed sword of goblin slaying, and a shield all at the same time? This snippet will remedy that. Now a player will only be able to hold one item per hand. It also adds a new item flag, ITEM_TWO_HANDED, in order to force people to really use two hands for that two handed sword of goblin slaying. If you like this snippet, or any other snippet I have done, I ask that you please give back to the mud community by releasing your own snippets. For myself and other included the free areas and snippets found on the Internet were what turned us onto creating our muds. Dean Vaughan - 3/16/02 I've also changed some of the code here and there to fit it into tbaMUD 3.63 (latest version at the time of this release). All credit still goes to Vedic. -- Papaya Pete, 7/6/12 Now onto the good stuff. -- Open act.item.c. Before the perform_put() function add: int free_hands(struct char_data *ch) { int used = 2; if(GET_EQ(ch, WEAR_HOLD)) { used -= 1; } if(GET_EQ(ch, WEAR_LIGHT)) { used -= 1; } if(GET_EQ(ch, WEAR_SHIELD)) { used -= 1; } if(GET_EQ(ch, WEAR_WIELD)) { if(OBJ_FLAGGED(GET_EQ(ch, WEAR_WIELD), ITEM_TWO_HANDED)) { used -= 2; } else { used -= 1; } } return used; } Further down in act.item.c in the: void perform_wear(struct char_data * ch, struct obj_data * obj, int where) { function, look for this: if (GET_EQ(ch, where)) { send_to_char(already_wearing[where], ch); return; } Directly below that chunk of code add: if(where == WEAR_WIELD || where == WEAR_SHIELD || where == WEAR_LIGHT || where == WEAR_HOLD) { if(free_hands(ch) < 1 && !OBJ_FLAGGED(obj, ITEM_TWO_HANDED)) { send_to_char("You hands are full!\r\n", ch); return; } if(free_hands(ch) < 2 && OBJ_FLAGGED(obj, ITEM_TWO_HANDED)) { send_to_char("Your hands are full!\r\n", ch); return; } } Save the file and exit. In structs.h after #define ITEM_NOSELL (1 << 16)) add: #define ITEM_TWO_HANDED 17 // Item requires 2 Hands to use You may have to change the above numbers if you've made other modifications to your mud. If you have questions you may email me. Save the file and exit. In constants.c add: "TWO_HANDED", to the end of the const char *extra_bits[] array. Save the file and exit. That's it! If all went well you should be able to compile your mud and no long have to worry about four handed people.

Hope this is Ok, me doing this.

Please Log in or Create an account to join the conversation.

More
06 Jul 2012 20:48 #335 by Papaya Pete
Replied by Papaya Pete on topic Re: Weapon Proficiency?
It took me a bit of time and a night when I couldn't fall asleep, but I also got the Weapon Proficiency system for warriors done that is done by Fabrizio Baldi.

I don't really have the time to get all those pieces copied and pasted into a file, I'll do that sometime next week when I got another day off.
The following user(s) said Thank You: rudeboyrave

Please Log in or Create an account to join the conversation.

Time to create page: 0.187 seconds