Attack code: First off, this is the basics as I have already modified beyond the attack code so I can not do a patch directly. I will do my best to get all the parts so if you have errors let me know so I can add in the missing parts The part of Numattacks was based on zones that were given to me. In order to use the inteded builders idea's I had to add it in this way for NPC's. It works that I can see.. I have people testing the code while I refine it. So far so good. The standard Disclaimer applies. If it breaks your mud, which I really hope you make a backup of EVERYTHING.. MEANING mob files too!!!!!!!! As this will alter them as does any OLC. In the score command I plan on adding in so the player can see how many attacks he/she has.. You can do this easily. ------------------ structs.h Change one of the spare PC int's to: int pc_attacks; /* Number of attacks for PC */ Under Specials used by NPCs, not PCs: add after int wait_state; int num_attacks; /* Number of attacks */ ------------------ utils.h I added these two right after SEC_PER_REAL_YEAR #define GET_PC_ATTACKS(ch) ((ch)->player_specials->saved.pc_attacks) #define GET_MOB_ATTACKS(ch) ((ch)->mob_specials.num_attacks) ------------------ db.c just above CASE("Str") { add: CASE("NumAttacks") { RANGE (0, 10); /* limits setting the attacks from 0 to 10 */ mob_proto[i].mob_specials.num_attacks = num_arg; } ------------------ class.c to set the new PC with attacks > 0 right after ch->player.time.logon = time(0); add: ch->player_specials->saved.pc_attacks = 1; note: I also set player flags at this point.. if you don't want to set them for your players.. disregard the next 6 lines. SET_BIT(PRF_FLAGS(ch), PRF_DISPHP); SET_BIT(PRF_FLAGS(ch), PRF_DISPMANA); SET_BIT(PRF_FLAGS(ch), PRF_DISPMOVE); SET_BIT(PRF_FLAGS(ch), PRF_AUTOEXIT); SET_BIT(PRF_FLAGS(ch), PRF_COLOR_1); SET_BIT(PRF_FLAGS(ch), PRF_COLOR_2); ------------------- act.wizard.c if (IS_MOB(k)) { sprintf(buf, "Mob Spec-Proc: %s, NPC Bare Hand Dam: %dd%d\r\n", (mob_index[GET_MOB_RNUM(k)].func ? "Exists" : "None"), k->mob_specials.damnodice, k->mob_specials.damsizedice); + sprintf(buf, "Number of Attacks: %d \r\n", GET_MOB_ATTACKS(k)); send_to_char(buf, ch); if (!IS_NPC(k)) { + sprintf(buf, "Number of Attacks: %d ", GET_PC_ATTACKS(k)); + send_to_char(buf, ch); sprintf(buf, "Hunger: %d, Thirst: %d, Drunk: %d\r\n", GET_COND(k, FULL), GET_COND(k, THIRST), GET_COND(k, DRUNK)); send_to_char(buf, ch); } { "age", LVL_GRGOD, BOTH, NUMBER }, + { "attacks", LVL_GRGOD, BOTH, NUMBER }, { "\n", 0, BOTH, MISC } add in the case number for your mud: case 49: if (value < 1 || value > 5) { send_to_char("Number of attacks can only be 1 to 5\r\n", ch); return (0); } if (!IS_NPC(vict)) vict->player_specials->saved.pc_attacks = value; else if (IS_NPC(vict)) vict->mob_specials.num_attacks = value; else send_to_char("Sorry you can't do that right now", ch); break; /* just noticed I contradicted myself here * /* can be set 1-5 for mobs and pc's */ /* but olc can set mobs to 10 .. oh well.. fix as you see fit*/ ------------------- olc.h right after #define MEDIT_CONFIRM_SAVESTRING 7 add: #define MEDIT_NUM_ATTACKS 8 ------------------- medit.c Right after #define GET_ATTACK(mob) ((mob)->mob_specials.attack_type) add: #define GET_NUM_ATTACKS(mob) ((mob)->mob_specials.num_attacks) right before if (GET_STR(mob) != 11) add: if (GET_NUM_ATTACKS(mob) != 0) fprintf(mob_file, "NumAttacks: %d\n", GET_NUM_ATTACKS(mob)); now for the menu portion: "%sK%s) Attack : %s%s\r\n" + "%sN%s) Num Attacks : %s%d\r\n" "%sL%s) NPC Flags : %s%s\r\n" "%sM%s) AFF Flags : %s%s\r\n" just down below this: grn, nrm, yel, attack_hit_text[GET_ATTACK(mob)].singular, + grn, nrm, yel, GET_NUM_ATTACKS(mob), grn, nrm, cyn, buf1, right after case 'm': add: case 'n': case 'N': OLC_MODE(d) = MEDIT_NUM_ATTACKS; i++; break; right after the section case MEDIT_AFF_FLAGS: add: /*-------------------------------------------------------------------*/ case MEDIT_NUM_ATTACKS: GET_NUM_ATTACKS(OLC_MOB(d)) = MAX(0, MIN(10, atoi(arg))); break; --------------- and now for the fight.c + if(!ch || !victim) + return; + /* This appears to fix my crash problem, Thanks to Chuck Reed */ + /* if you notice anything */ + /* please email me about it so I can fix it or if you know of a fix */ + /* caminturn@earthlink.net */ /* Do some sanity checking, in case someone flees, etc. */ down further in void perform_violence add: struct char_data *ch; + int attacks = 1, i; for (ch = combat_list; ch; ch = next_combat_list) { next_combat_list = ch->next_fighting; + attacks = 1; /* needs to be here or all char have same attacks */ + + if (IS_NPC(ch) && (GET_MOB_ATTACKS(ch) > 0)) + attacks = GET_MOB_ATTACKS(ch); + + if (!IS_NPC(ch) && (GET_PC_ATTACKS(ch) > 0)) + attacks = GET_PC_ATTACKS(ch); + /* added to ensure that attacks are > 0 if not defaults to 1 */ and again.. down further in code: + for (i = 0; i < attacks; i++) hit(ch, FIGHTING(ch), TYPE_UNDEFINED); /* XXX: Need to see if they can handle "" instead of NULL. */