In this file is a spell which acts on the BLOCKER code which this add-on is all about. To add the Blocker code do the following: In structs.h add a MOB_BLOCKER flag and in spells.h add the spell SPELL_INTERPOSING_HAND In act.offensive.c under ALL violent attack routines you need to setup checks to see if the player is being blocked so that they cannot attack another person or flee without magical aid and these are what my functions look like with + next to added lines. ALso if you use portals as regular doorways you may want to add something to the GO and ENTER commands to block people from stepping through a doorway to get away. TELEPORT spells and dimension doors should be acceptable escape routes from this spell. ACMD(do_hit) { struct char_data *vict; one_argument(argument, arg); if (!*arg) send_to_char("Hit who?\r\n", ch); else if (!(vict = get_char_room_vis(ch, arg))) send_to_char("They don't seem to be here.\r\n", ch); else if (vict == ch) { send_to_char("You hit yourself...OUCH!.\r\n", ch); act("$n hits $mself, and says OUCH!", FALSE, ch, 0, vict, TO_ROOM); } else if (AFF_FLAGGED(ch, AFF_CHARM) && (ch->master == vict)) act("$N is just such a good friend, you simply can't hit $M.", FALSE, ch, 0, vict, TO_CHAR); else { if (!pk_allowed) { if (!IS_NPC(vict) && !IS_NPC(ch)) { if (subcmd != SCMD_MURDER) { send_to_char("Use 'murder' to hit another player.\r\n", ch); return; } else { check_killer(ch, vict); } } if (AFF_FLAGGED(ch, AFF_CHARM) && !IS_NPC(ch->master) && !IS_NPC(vict)) return; /* you can't order a charmed pet to attack a * player */ } + if(FIGHTING(ch)) + if (MOB_FLAGGED(FIGHTING(ch), MOB_BLOCKER)) + { + act("$n tries to switch attacks and is blocked by $N!", TRUE, ch, 0, FIGHTING(ch), TO_ROOM); + act("Your attempt to change attacks fails when $N blocks you!", TRUE, ch, 0, FIGHTING(ch), TO_CHAR); + return; + } if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) { hit(ch, vict, TYPE_UNDEFINED); WAIT_STATE(ch, PULSE_VIOLENCE + 2); } else send_to_char("You do the best you can!\r\n", ch); } } ACMD(do_kill) No changes necessary here because it calls do_hit for PC's and well GODS are great and may do all they wish! NPC's however are not affected by a blocker at this time as I didn't want that to get out of hand (bad pun on the spell) ACMD(do_backstab) { struct char_data *vict; int percent, prob; one_argument(argument, buf); if (!(vict = get_char_room_vis(ch, buf))) { send_to_char("Backstab who?\r\n", ch); return; } if (vict == ch) { send_to_char("How can you sneak up on yourself?\r\n", ch); return; } if (!GET_EQ(ch, WEAR_WIELD)) { send_to_char("You need to wield a weapon to make it a success.\r\n", ch); return; } if (GET_OBJ_VAL(GET_EQ(ch, WEAR_WIELD), 3) != TYPE_PIERCE - TYPE_HIT) { send_to_char("Only piercing weapons can be used for backstabbing.\r\n", ch); return; } if (FIGHTING(vict)) { send_to_char("You can't backstab a fighting person -- they're too alert!\r\n", ch); return; } + if (FIGHTING(ch)) + if (MOB_FLAGGED(FIGHTING(ch), MOB_BLOCKER)) + { + act("$n tries to switch attacks and is blocked by $N!", TRUE, ch, 0, FIGHTING(ch), TO_ROOM); + act("Your attempt to change attacks fails when $N blocks you!", TRUE, ch, 0, FIGHTING(ch), TO_CHAR); + return; + } if (MOB_FLAGGED(vict, MOB_AWARE)) { act("You notice $N lunging at you!", FALSE, vict, 0, ch, TO_CHAR); act("$e notices you lunging at $m!", FALSE, vict, 0, ch, TO_VICT); act("$n notices $N lunging at $m!", FALSE, vict, 0, ch, TO_NOTVICT); hit(vict, ch, TYPE_UNDEFINED); return; } percent = number(1, 101); /* 101% is a complete failure */ prob = GET_SKILL(ch, SKILL_BACKSTAB); if (AWAKE(vict) && (percent > prob)) damage(ch, vict, 0, SKILL_BACKSTAB); else hit(ch, vict, SKILL_BACKSTAB); } ACMD(do_flee) { int i, attempt, loss; struct char_data *was_fighting; if (GET_POS(ch) < POS_FIGHTING) { send_to_char("You are in pretty bad shape, unable to flee!\r\n", ch); return; } + if (FIGHTING(ch)) + if (MOB_FLAGGED(FIGHTING(ch), MOB_BLOCKER)) + { + act("$n tries to run and is held in place by $N!", TRUE, ch, 0, FIGHTING(ch), TO_ROOM); + act("Your attempt to flee fails when $N blocks you!", TRUE, ch, 0, FIGHTING(ch), TO_CHAR); + return; + } for (i = 0; i < 6; i++) { attempt = number(0, NUM_OF_DIRS - 1); /* Select a random direction */ if (CAN_GO(ch, attempt) && !ROOM_FLAGGED(EXIT(ch, attempt)->to_room, ROOM_DEATH)) { act("$n panics, and attempts to flee!", TRUE, ch, 0, 0, TO_ROOM); was_fighting = FIGHTING(ch); if (do_simple_move(ch, attempt, TRUE)) { send_to_char("You flee head over heels.\r\n", ch); if (was_fighting && !IS_NPC(ch)) { loss = GET_MAX_HIT(was_fighting) - GET_HIT(was_fighting); loss *= GET_LEVEL(was_fighting); gain_exp(ch, -loss); } } else { act("$n tries to flee, but can't!", TRUE, ch, 0, 0, TO_ROOM); } return; } } send_to_char("PANIC! You couldn't escape!\r\n", ch); } ACMD(do_bash) { struct char_data *vict; int percent, prob; one_argument(argument, arg); if (!GET_SKILL(ch, SKILL_BASH)) { send_to_char("You have no idea how.\r\n", ch); return; } if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_PEACEFUL)) { send_to_char("This room just has such a peaceful, easy feeling...\r\n", ch); return; } if (!GET_EQ(ch, WEAR_WIELD)) { send_to_char("You need to wield a weapon to make it a success.\r\n", ch); return; } if (!(vict = get_char_room_vis(ch, arg))) { if (FIGHTING(ch) && IN_ROOM(ch) == IN_ROOM(FIGHTING(ch))) { vict = FIGHTING(ch); } else { send_to_char("Bash who?\r\n", ch); return; } } if (vict == ch) { send_to_char("Aren't we funny today...\r\n", ch); return; } + if (FIGHTING(ch)) + if (MOB_FLAGGED(FIGHTING(ch), MOB_BLOCKER)) + { + act("$n tries to switch attacks and is blocked by $N!", TRUE, ch, 0, FIGHTING(ch), TO_ROOM); + act("Your attempt to change attacks fails when $N blocks you!", TRUE, ch, 0, FIGHTING(ch), TO_CHAR); + return; + } percent = number(1, 101); /* 101% is a complete failure */ prob = GET_SKILL(ch, SKILL_BASH); if (MOB_FLAGGED(vict, MOB_NOBASH)) percent = 101; if (percent > prob) { damage(ch, vict, 0, SKILL_BASH); GET_POS(ch) = POS_SITTING; } else { if (damage(ch, vict, 1, SKILL_BASH) > 0) { /* -1 = dead, 0 = miss */ GET_POS(vict) = POS_SITTING; WAIT_STATE(vict, PULSE_VIOLENCE); } } WAIT_STATE(ch, PULSE_VIOLENCE * 2); } ACMD(do_rescue) { struct char_data *vict, *tmp_ch; int percent, prob; one_argument(argument, arg); if (!(vict = get_char_room_vis(ch, arg))) { send_to_char("Whom do you want to rescue?\r\n", ch); return; } if (vict == ch) { send_to_char("What about fleeing instead?\r\n", ch); return; } if (FIGHTING(ch) == vict) { send_to_char("How can you rescue someone you are trying to kill?\r\n", ch); return; } + if (FIGHTING(ch)) + if (MOB_FLAGGED(FIGHTING(ch), MOB_BLOCKER)) + { + act("$n tries to switch attacks and is blocked by $N!", TRUE, ch, 0, FIGHTING(ch), TO_ROOM); + act("Your attempt to change attacks fails when $N blocks you!", TRUE, ch, 0, FIGHTING(ch), TO_CHAR); + return; + } for (tmp_ch = world[ch->in_room].people; tmp_ch && (FIGHTING(tmp_ch) != vict); tmp_ch = tmp_ch->next_in_room); if (!tmp_ch) { act("But nobody is fighting $M!", FALSE, ch, 0, vict, TO_CHAR); return; } if (!GET_SKILL(ch, SKILL_RESCUE)) send_to_char("But you have no idea how!\r\n", ch); else { percent = number(1, 101); /* 101% is a complete failure */ prob = GET_SKILL(ch, SKILL_RESCUE); if (percent > prob) { send_to_char("You fail the rescue!\r\n", ch); return; } send_to_char("Banzai! To the rescue...\r\n", ch); act("You are rescued by $N, you are confused!", FALSE, vict, 0, ch, TO_CHAR); act("$n heroically rescues $N!", FALSE, ch, 0, vict, TO_NOTVICT); if (FIGHTING(vict) == tmp_ch) stop_fighting(vict); if (FIGHTING(tmp_ch)) stop_fighting(tmp_ch); if (FIGHTING(ch)) stop_fighting(ch); set_fighting(ch, tmp_ch); set_fighting(tmp_ch, ch); WAIT_STATE(vict, 2 * PULSE_VIOLENCE); } } ACMD(do_kick) { struct char_data *vict; int percent, prob; if (!GET_SKILL(ch, SKILL_KICK)) { send_to_char("You have no idea how.\r\n", ch); return; } one_argument(argument, arg); if (!(vict = get_char_room_vis(ch, arg))) { if (FIGHTING(ch) && IN_ROOM(ch) == IN_ROOM(FIGHTING(ch))) { vict = FIGHTING(ch); } else { send_to_char("Kick who?\r\n", ch); return; } } if (vict == ch) { send_to_char("Aren't we funny today...\r\n", ch); return; } +if (FIGHTING(ch)) + if (MOB_FLAGGED(FIGHTING(ch), MOB_BLOCKER)) + { + act("$n tries to switch attacks and is blocked by $N!", TRUE, ch, 0, FIGHTING(ch), TO_ROOM); + act("Your attempt to change attacks fails when $N blocks you!", TRUE, ch, 0, FIGHTING(ch), TO_CHAR); + return; + } percent = ((10 - (GET_AC(vict) / 10)) * 2) + number(1, 101); /* 101% is a complete * failure */ prob = GET_SKILL(ch, SKILL_KICK); if (percent > prob) { damage(ch, vict, 0, SKILL_KICK); } else damage(ch, vict, GET_LEVEL(ch) / 2, SKILL_KICK); WAIT_STATE(ch, PULSE_VIOLENCE * 3); } Don't forget to add the MOB into your mob files. Any stats you wish of course but I recommend a 1 damage attack as this is not meant to be offensive but rather defensive. A LOW thac0 would be good too. #define MOB_HAND 12 ASPELL(spell_interposing_hand) { struct char_data *mob; if (ch->player.existing_spells > GET_MAX_SPELLS(ch)) { send_to_char("You have too many spells to maintain already. Go dispel some.", ch); return; } else if(!FIGHTING(ch)) { send_to_char("The magic fails without the violence of combat", ch); return; } else { mob = read_mobile(MOB_HAND, VIRTUAL); GET_MAX_HIT(mob) = GET_MAX_HIT(ch); GET_HIT(mob) = GET_MAX_HIT(mob); GET_HITROLL(mob) = GET_HITROLL(ch); char_to_room(mob, victim->in_room); ch->player.existing_spells++; act("With a clap of thunder and gust of wind $n creates a giant hand to ward off $N", FALSE, ch, 0, victim, TO_ROOM); act("A thunderclap rips through the room and a giant hand interposes itself between you and $N", FALSE, ch, 0, victim, TO_CHAR); if (FIGHTING(victim)) stop_fighting(victim); hit(mob, victim, TYPE_UNDEFINED); } } Purpose: This spell was devised so that mages have a way of fending off brave warriors who try to pick on them and I recommend a HIGH casting cost so it is not abused or the implementation of a spell drain system which makes the mob fade away after a time. Also if you like to use sizes in your game then make the hand only able to stop large creatures but not huge or giant or gargantuan things. My original implementation of this spell used a special procedure but I found that to be a waste of memory and alot flakier so it was coded into the fight commands one by one. One more possible solution to this mob in limiting its power would make it have the thaco of the caster and on an attack on the caster the mob makes a to hit roll in order to block the attacker, but that would require a little more code. Justin P.