SMAUG: "Optional Immortal deaths" snippet by Zeno
=======================================

Description
-----------
Simply put, this snippet for SMAUG allows Immortals to die. In stock
SMAUG, Immortals cannot die normally. After installing this snippet,
Immortals can toggle normal deaths on and off by using config.

Support
-------
All support for this snippet (and any of my snippets) must be posted on
MudBytes (mudbytes.net) under the appropriate code. Find this snippet
on MudBytes, post a new comment, and I will reply as soon as possible.

Sharing
-------
All of my released code can be distributed anywhere as long as credit
is given when due. Please do not claim my code as your own. If you
do distribute my code to other places, I'd like it if you notify me.
My email address is zenomcdohl-AT-gmail-DOT-com, but please do not
use this for support.

Background
----------
This code was originally released at MudBytes (mudbytes.net). Most
(if not all) of my released code originated from the MUD I run
(InuYasha Galaxy: iyg.arthmoor.com) which is a modified version of
SmaugFUSS. Therefor all code I release has been tested and is currently
running on a MUD open to the public. Everything should work as intended,
but since I wrote most of this code years ago, improvements can probably
be made to the code to make it more efficient. I'd appreciate it if you
improve any of the code, that you would post the changes on MudBytes. You
can find contact information and details about myself at the following URL:
http://en.wikipedia.org/wiki/User:Zeno_McDohl

Syntax
------
config +death  -- Turns on death for you (Immortals)
config -death  -- Turns off death for you (Immortals)

Installation
------------
1.) In mud.h, find the code section that contains the act bits for players,
found after these line:
/*
 * ACT bits for players.
 */
Add a bit bit called PLR_IMMDIE to that section.


2.) In build.c, find this line:
char *  const   plr_flags [] =
And in that section, add "immdie" to it at the end.


3.) In act_info.c, find this line:
        send_to_char( "\n\r\n\rImmortal toggles:  ", ch );
And below in the line that contains "Roomvnum", add after it:
  Death [%s]
And then below after the line containing PLR_ROOMVNUM, add another argument like this:
          xIS_SET(ch->act, PLR_IMMDIE )                 ? "+"
                                                        : "-" );
Then look for something like this line in the file:
 !str_prefix( arg+1, "vnum"     ) ) bit = PLR_ROOMVNUM;
and add another argument to the ifcheck that looks like this:
 !str_prefix( arg+1, "death" ) )  bit = PLR_IMMDIE;


4.) In fight.c, find these lines:
    /*
     * Get experience based on % of damage done                 -Thoric
     */
After that block of code, where it checks LEVEL_IMMORTAL and their hit being
less than 1, like this:
    if ( !IS_NPC(victim)
    &&   victim->level >= LEVEL_IMMORTAL
    &&   victim->hit < 1
add the following argument to that ifcheck, so it becomes:
    if ( !IS_NPC(victim)
    &&   victim->level >= LEVEL_IMMORTAL
    &&   victim->hit < 1
    &&   !xIS_SET(victim->act, PLR_IMMDIE) )
       victim->hit = 1;

Further in the file, find these lines:
    if ( !npcvict
    &&   get_trust(victim) >= LEVEL_IMMORTAL
    &&   get_trust(ch)     >= LEVEL_IMMORTAL
    &&   victim->hit < 1
And change that entire code so it looks like this:
    if ( !npcvict
    &&   get_trust(victim) >= LEVEL_IMMORTAL
    &&   get_trust(ch)     >= LEVEL_IMMORTAL
    &&   victim->hit < 1
    &&   !xIS_SET(victim->act, PLR_IMMDIE) )
        victim->hit = 1;


5.) Make clean, make and hotboot/reboot the MUD. Use config to toggle the death flag.