Disintegrate Spell [by Franco]
Snippet Posted Wednesday, August 12th @ 11:26:16 PM, by George Greer in the Skills dept.
. Click the link below to read it or download it.

ASPELL(spell_disintegrate)
{
   struct obj_data *foolz_objs;
   int save, i;

   if (ch == NULL)

return;
   if (obj) {
    /* Used on my mud
    if (GET_OBJ_EXTRA(obj) == ITEM_IMMORT && GET_LEVEL(ch) < LVL_IMMORT) {

send_to_char("Your mortal magic fails.\r\n", ch);

return;
    }
    */
    switch (GET_OBJ_TYPE(obj)) {
    case ITEM_LIGHT:

save = 19;

break;
    case ITEM_SCROLL:

save = 20;

break;
    case ITEM_STAFF:
    /*
    case ITEM_ROD:
    */
    case ITEM_WAND:

save = 19;

break;
    case ITEM_WEAPON:

save = 18;

break;
    case ITEM_MISSILE:

save = 20;

break;
    case ITEM_ARMOR:

save = 16;

break;
    case ITEM_WORN:

save = 18;

break;
    /*
    case ITEM_SPELLBOOK:

save = 15;

break;
    case ITEM_PORTAL:

save = 13;

break;
    */
    default:

save = 19;

break;
    }
    /*  Save modified by affect on weapons..this is kinda based
     *  on +5 or so being high
     */
    if (GET_OBJ_EXTRA(obj) == ITEM_MAGIC && GET_OBJ_TYPE(obj) == ITEM_WEAPON) {
      for (i = 0; i < MAX_OBJ_AFFECT; i++) {

  if (obj->affected[i].location == APPLY_DAMROLL)


save -= obj->;affected[i].modifier;

}
    }
    /* A bonus for ac affecting items also */
    for (i = 0; i < MAX_OBJ_AFFECT; i++) {

if (obj->;affected[i].location == APPLY_AC)

   save -= obj->;affected[i].modifier / 10;
    }
    if (number(1, 20) < save) {

act("$n disintegrates $p.", FALSE, ch, obj, 0, TO_NOTVICT);

act("You disintegrate $p.", FALSE, ch, obj, 0, TO_CHAR);

extract_obj(obj);

return;
    }
    else {

act("You fail to disintegrate $p.", FALSE, ch, obj, 0, TO_CHAR);

return;
    }
   }
   if (victim) {

    if (GET_LEVEL(victim) >= LVL_IMMORT) {

send_to_char("Nice try..\r\n", ch);
        return;
    }

    /* Note this is extremely powerful, therefore im giving it 2 saves */
    if (mag_savingthrow(victim, 1)) {

act("You resist $n's attempt to disintegrate you.", FALSE, ch, 0, 0, TO_VICT);

if (IS_NPC(victim))

    hit(victim, ch, TYPE_UNDEFINED);

return;
    }
    if (mag_savingthrow(victim, 1)) {

act("You resist $n's attempt to disintegrate you.", FALSE, ch, 0, 0, TO_VICT);

if (IS_NPC(victim))
            hit(victim, ch, TYPE_UNDEFINED);

return;
    }
    if (victim->desc) {

close_socket(victim->desc);

victim->desc = NULL;
    }


    /* Note this is for disintegrating all items the vict carries also..
       may wish to comment this off if you feel it too powerful */
    for (i = 0; i < NUM_WEARS; i++)

if (GET_EQ(victim, i))

  unequip_char(victim, i);
    while (victim->carrying) {

foolz_objs = victim->carrying;

extract_obj(foolz_objs);
    }





    extract_char(victim);
    act("$n disintegrates $N!", FALSE, ch, 0, victim, TO_NOTVICT);
    act("You disintegrate $N!", FALSE, ch, 0, victim, TO_CHAR);

    return;
  }
  else
    return;
}


<< Disallow mob names for players [by Dez] | Reply | View as text | Threaded | DNS Caching Code [by AOW Admin] >>

 


Related Links
  download
Related Articles
More by greerga
 
 

CircleMUD Snippets
 
Note: Not all of these snippets will work perfectly with your version of code, so be prepared to fix one or two bugs that may arise, and please let me know what you needed to do to fix it. Sending a corrected version is always welcome.
Finally, if you wish to use any of the snippets from this page, you are more than welcome, just mention the authors in your credits. If you wish to release any of these snippets to the public on another site, contact me FIRST.