07/31/2004 This is a snippet for multiple PC and Mob attacks. Its originally based on a 100th level mud. This code can easily be changed to fit your needs. This patch is for a 3.17 windows version mud modified by Jason Yarber. Multiple attacks for mobs are based on the mobs level. Currently every 24 levels the mob has access to another attack. 1-23 One attack 24-47 two attacks 48-71 three attacks 72-95 four attacks This can easily be changed. Pc attacks are based on which classes and at what level you give the attacks to in class.c. Please be sure and give credit to Sudo and Roc for this modified version of Multiple attacks. You can email us with any questions or to just say you are using our version. graywolf9653@hotmail.com bsolis@splaudio.net In spellparser.c ------------------------------------------------------------------ at the end of spellparser.c skillo(SKILL_BACKSTAB, "backstab"); skillo(SKILL_BASH, "bash"); skillo(SKILL_HIDE, "hide"); skillo(SKILL_KICK, "kick"); skillo(SKILL_PICK_LOCK, "pick lock"); skillo(SKILL_PUNCH, "punch"); skillo(SKILL_RESCUE, "rescue"); skillo(SKILL_SNEAK, "sneak"); skillo(SKILL_STEAL, "steal"); skillo(SKILL_TRACK, "track"); add: skillo(SKILL_ATTACK2, "second attack"); /* second attack bs cjl */ skillo(SKILL_ATTACK3, "third attack"); /* third attack bs cjl */ skillo(SKILL_ATTACK4, "fourth attack"); /* fourth attack bs cjl */ In spells.h ---------------------------------------------------------------------- after... /* PLAYER SKILLS - Numbered from MAX_SPELLS+1 to MAX_SKILLS */ #define SKILL_RESCUE 137 /* Reserved Skill[] DO NOT CHANGE */ #define SKILL_SNEAK 138 /* Reserved Skill[] DO NOT CHANGE */ #define SKILL_STEAL 139 /* Reserved Skill[] DO NOT CHANGE */ #define SKILL_TRACK 140 /* Reserved Skill[] DO NOT CHANGE */ #define SKILL_FLY 141 /* Reserved Skill[] DO NOT CHANGE */ add... #define SKILL_ATTACK2 142 /* second attack bs cjl */ #define SKILL_ATTACK3 143 /* third attack bs cjl */ #define SKILL_ATTACK4 144 /* fourth attack bs cjl */ In class.c ------------------------------------------------------------------------ add the skill to which ever classes you want to have 2nd, 3rd, or 4th attack for instance... /* WARRIORS */ spell_level(SKILL_KICK, CLASS_WARRIOR, 1); spell_level(SKILL_RESCUE, CLASS_WARRIOR, 3); spell_level(SKILL_TRACK, CLASS_WARRIOR, 9); spell_level(SKILL_BASH, CLASS_WARRIOR, 12); * spell_level(SKILL_ATTACK2, CLASS_WARRIOR, 20); * spell_level(SKILL_ATTACK3, CLASS_WARRIOR, 50); * spell_level(SKILL_ATTACK4, CLASS_WARRIOR, 80); In fight.c ------------------------------------------------------------------------- void perform_violence(void) after...... if (GET_POS(ch) < POS_FIGHTING) { send_to_char("You can't fight while sitting!!\r\n", ch); continue; } if (!IS_NPC(ch)) { add_wprof(ch); /* Warriors and Human's learn twice as quick */ if (IS_HUMAN(ch) || IS_WARRIOR(ch)) add_wprof(ch); } hit(ch, FIGHTING(ch), TYPE_UNDEFINED); add... //2nd attack**************************************************************** 2nd, 3rd, and 4th attack - bs cjl //Mob multi attacks by level ************ NPC ATTACKS begin if (IS_NPC(ch)) { int level=GET_LEVEL(ch); while (level>24) {level-=24; if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) { stop_fighting(ch); continue; } if (number(1,GET_LEVEL(ch)) < (GET_LEVEL(ch)/2)) hit(ch, FIGHTING(ch), TYPE_UNDEFINED); } } if (!IS_NPC(ch)) { if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) { stop_fighting(ch); continue; } if (number( 1, 101 ) < (GET_SKILL(ch, SKILL_ATTACK2) / 2)) /* 50% chance to activate */ hit(ch, FIGHTING(ch), TYPE_UNDEFINED); } //3rd attack***************************************************************** if (!IS_NPC(ch)) { if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) { stop_fighting(ch); continue; } if (number( 1, 101 ) < (GET_SKILL(ch, SKILL_ATTACK3) / 4)) /* 25% chance to activate */ hit(ch, FIGHTING(ch), TYPE_UNDEFINED); } //4th attack***************************************************************** if (!IS_NPC(ch)) { if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) { stop_fighting(ch); continue; } if (number( 1, 101 ) < (GET_SKILL(ch, SKILL_ATTACK4) / 8)) /* 12.5% chance to activate */ hit(ch, FIGHTING(ch), TYPE_UNDEFINED); } //end snippet here*****************************************************************