Disarm Skill [by BoxBoy]
Snippet Posted Tuesday, August 1st @ 12:25:51 PM, by Brandon Brown in the Skills dept.
Boxboy writes, "My disarm skill. I saw disarm somewhere and though 'I must have, I must have!' so, well it is here. This skill was made just for pain in the arse little people. I personally love this skill, its quite funny to run past someone about four times you lvl and to smash their weapon from their hands and steal it."
/***** Start Here *********/

open structs.h,
find this line,
#define ITEM_NOSELL	       (1 << 12)/* Shopkeepers won't touch it*/
and below it add,
#define ITEM_NODISARM      (1 << 21)/* Cannot be disarmed from someone */

now open spells.h,
find the line,
#define SKILL_TRACK        140 /* Reserved Skill[] DO NOT CHANGE */
then add this below it,
#define SKILL_DISARM       141 /* Reserved Skill[] DO NOT CHANGE */

now go into act.offensive.c or act.other.c (it doesn't really matter) and paste this entire command.

ACMD(do_disarm)
{
  struct obj_data *obj;
  struct char_data *vict;

  one_argument(argument, buf);

  if (!*buf) {
        send_to_char("Whom do you want to disarm?\r\n", ch);
 return;
  }
  else if (!(vict = get_char_room_vis(ch, buf))) {
        send_to_char(NOPERSON, ch);
 return;
  }
  else if (!GET_SKILL(ch, SKILL_DISARM)) {
        send_to_char("You have no idea how.\r\n", ch);
   return;
  }
  else if (vict == ch) {
        send_to_char("That would be funny to watch.\r\n", ch);
   return;
  }
  else if (AFF_FLAGGED(ch, AFF_CHARM) && (ch->master == vict)) {
        send_to_char("The thought of disarming your master makes you weep.\r\n", ch);
   return;
  }
  if (ROOM_FLAGGED(ch->in_room, ROOM_PEACEFUL)) {
    send_to_char("This room just has such a peaceful, easy feeling...\r\n", ch);
    return;
  }
  else if (!(obj = GET_EQ(vict, WEAR_WIELD)))
        act("$N is unarmed!", FALSE, ch, 0, vict, TO_CHAR);
  else if (IS_SET(GET_OBJ_EXTRA(obj), ITEM_NODISARM) ||
      MOB_FLAGGED(vict, MOB_NOBASH) ||
           (number(1, 101) > (!IS_NPC(ch) ? 
             GET_SKILL(ch, SKILL_DISARM) : number(0, 100)))) {
        act("You failed to disarm $N and make $M rather angry!", FALSE, ch, 0, vict, TO_CHAR);
        damage(vict, ch, number(1, GET_LEVEL(vict)), TYPE_HIT);
    }
  else if (dice(2, GET_STR(ch)) + GET_LEVEL(ch) <= dice(2, GET_STR(vict)) + GET_LEVEL(vict)) {
        act("Your hand just misses $N's weapon, failing to disarm $M/", FALSE, ch, 0, vict, TO_CHAR);
        act("$N has tried and failed to disarm you!", FALSE, vict, 0, ch, TO_CHAR);
        damage(vict, ch, number(1, GET_LEVEL(vict) / 2), TYPE_HIT);
  } else {
        obj_to_room(unequip_char(vict, WEAR_WIELD), vict->in_room);
        act("You rip $N's weapon from $S hands and it falls the ground!", FALSE, ch, 0, vict, TO_CHAR);
        act("$N smashes you weapon from your hand!", FALSE, vict, obj, ch, TO_CHAR);
        act("$n disarms $N, $p drops to the ground.", FALSE, ch, obj, vict, TO_ROOM);
  }
  hit(vict , ch, TYPE_UNDEFINED);
  WAIT_STATE(ch, PULSE_VIOLENCE * 3);
}

That should be all.
On a side note, if you don't know this, the definitions for the NODISARM and SKILL_DISARM should go at the
end of the list. The line I have put for it to go under is just the last line in stock circle.

Hope that didn't confuse ya. Also if people wish, I will rip out my vampire and vampire slayer code for
ceramic mouse, but I need to know that people want. If you would like me to post the Vampire code Email
me at boxboy22nd@trust-me.com rather than my normal address.

Boxboy, is gone.......

<< AutoGold [by BoxBoy] | Reply | Threaded | Second-Hand Shops [by Jake Turner] >>

 


Related Links
  Ceramic Mouse
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
 
 


Bug in Disarm
by Blaize (garath@fl.freei.net) on Friday, August 4th @ 10:33:06 PM
http://
else if (!GET_SKILL(ch, SKILL_DISARM))
needs to read
else if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_DISARM))
otherwise, a switched imm using it or a forced or ordered mobile would crash the MUD (I think).

Blaize Imperitor,
Lord of Shadow
(Shadow is still in creation, but should be open to the public in several months.
[ Reply to this comment ]

It doesn't cause crashes
by BoxBoy () on Wednesday, January 10th @ 11:47:28 PM
http://
I was trying to get it so that the mobs COULD use this skill as it would allow mobiles to test players. I have however added the disarm as part of my mob_fighter flag, so i don't have mobs going through the command no more.
[ Reply to this comment ]