untermud/DOC/
untermud/DOC/U/
untermud/DOC/U/U-examples/
untermud/DOC/internals/
untermud/DOC/wizard/
untermud/MISC/
untermud/MISC/dbchk/
untermud/RWHO/
untermud/RWHO/rwhod/
From Jeff.Bone@EBay.Sun.COM Tue Feb 18 20:50:19 1992
Received: by hussar (5.57/ULTRIX-fma-071791);
	id AA10996; Tue, 18 Feb 92 20:50:18 -0500
Received: from EBay.Sun.COM (female.EBay.Sun.COM) by Sun.COM (4.1/SMI-4.1)
	id AA05220; Tue, 18 Feb 92 17:48:46 PST
Received: from lilith.EBay.Sun.COM by EBay.Sun.COM (4.1/SMI-4.1)
	id AA03283; Tue, 18 Feb 92 17:52:10 PST
Received: by lilith.EBay.Sun.COM (4.1/SMI-4.1)
	id AA07757; Tue, 18 Feb 92 17:54:13 PST
Date: Tue, 18 Feb 92 17:54:13 PST
From: Jeff.Bone@EBay.Sun.COM (Jeff Bone)
Message-Id: <9202190154.AA07757@lilith.EBay.Sun.COM>
To: untermud@hussar.dco.dec.com
Subject: Nifty(?) U kill
Status: R



Here's a pretty spiffy (IMHO) U kill facility.   I don't know how this
fits in with Marcus' combat plans, but it's yours if you want it.

Notes:  my sysobj is set _wz.  This thing allows wizards/owners to set 
"kill" chance for the entire mud and also for individual rooms by specifying 
#sysobj.kill and #room.kill. The integer for those attributes is used as a 
percentage chance.  If neither of those is set, the percentage is assumed 
to be 100:  anyone has a 100% chance of killing someone at that location.

#room.hvn should be a string == "T" if you want to set your place haven.
haven/unhaven macros should be written to set/unset that. Duh. :)

Note that wizards can kill anyone or anything at any time regardless of
local kill chance, equivalent to "_force #  home".  OIDs work for wizards 
also.  Wizards can also be killed, but subject to kill chance.

If you try to kill a player whose name appears more than once in the WHO
list, it doesn't work.  Fixing this is left as an exercise. :)  Also,
you can do "kill player1 player2 player3" and it should work as expected.

This is derived from Russ's kill macro and the old Uber kill.  I may
add #player.die() support using the SUID stuff in a4, or maybe not.  Could
be dangerous --- endless kill loops. :)

Finally:  #sysobj._kill is pushing the limit on size... FYI.


Have fun!


set sysobj U _kill = {
   $p = matchWHO($1);
   if ($p.nam) {
      if ($p.loc != $actor.loc) {
         echo("I don't see " + $1 + " here!");
      } else {
         if (#sysobj.kill) {
            $t = #sysobj.kill;
         } else {
            if ($actor.loc) {
               $t = $actor.loc.kill;
            } else {
               $t = 100;
            };
         };
         $r = rnd(100);
         if ($r < $t) {
            @do("killed " + $1 + "!");
            @teleport($p, "home");
         } else {  
            @do("tried to kill " + $1 + "!");
            echo("Your attempted murder of " + $1 + " failed!");
         };
      };
   } else {
      echo("No one named " + $1 + " is logged on.");
   };
};

set sysobj U _wizkill = {
   $p = matchWHO($1);
   if ($p.nam) {
      @do("killed " + $1 + "!");
      @teleport($p, "home");
   } else {
      @teleport($1, "home");
   };
};

_mudconfig defUmac kill = {
   if ($actor.loc.hvn == "T") {
      if ($actor._wz == NULL) {
         echo("Sorry, this is a havened room.");
         return;
      };
   };
   foreacharg $f {
      if ($actor._wz == NULL) {
         #sysobj._kill($f);
      } else {
         #sysobj._wizkill($f);
      };
   };
};

_mudconfig privmac kill sysobj



From warlock@amber.ecst.csuchico.edu Sun Feb 23 01:10:05 1992
Received: by hussar (5.57/ULTRIX-fma-071791);
	id AA10269; Sun, 23 Feb 92 01:10:04 -0500
Received: by amber.ecst.csuchico.edu (5.64/10.36)
	id AA00296; Sun, 23 Feb 92 06:02:59 GMT
Date: Sun, 23 Feb 92 06:02:59 GMT
From: warlock@amber.ecst.csuchico.edu (John Kennedy)
Message-Id: <9202230602.AA00296@amber.ecst.csuchico.edu>
To: untermud@hussar.dco.DEC.COM
Subject: My U kill-code
Status: R


  This kill-scenario is set up to accomplish a few things.  Mainly, it's to
kill players easily.  (:  With this setup, when you are killed, you LEAVE THE
ROOM.  This behaves as expected for people with their home set somewhere,
*UNLESS* they happened to be linked to the current room.  If they're linked
to the current room, they get sent to limbo.  With me, what did you expect?  (:
Anybody can set their home to be havened if they own it, else they're nuked.
Havens are done with a "hvn" setting, "T" means that the room is protected.  It
doesn't have to be a string, but I haven't figured out how to get U to evaluate
booleans yet.

  I did *not* do death "chances".  Kill-fests are annoying as it is without
having people making multiple attempts with failure messages.  They're dead
or they're not, and everything else can wait for the combat code.

  Non-wizards can kill only players.  The players need not be logged in.  It
works even for multiple instances of the player name being logged in or present
(it chooses randomly between them).  Wizards can kill players and objects.  It
can be done outside the room by OID as well.

  I didn't code the stuff into the sysobj, rather into a regular object which
I wizzed.  I did this with the idea that I could probably "upgrade" all my
U code by walking around my muds carrying the object and reseting the wiz-bit.
No need to cruddy up the sysobj, either.

  It would be nicer if the "hvn" variable could be public, but U currently
chokes on this.  Have to do it this way for now, or add an silent evaluator
as a kill-pal so the user can check easily before spewing useless poses.

  The following is a defUmac (set with @_mudconfig defUmac kill=...) to do
the global dirty stuff.  You need to do a "@_mudconfig privmac kill 26@matrix"
in this case as well to empower the macro.  Any wizard object can have some-
thing like this imbedded in it to kill as well.

! U kill=if (str($actor.loc.hvn)=="T") if (!$actor._wz) {return echo("Sorry,
!  this is a havened room.");}; foreacharg $p if ($actor._wz)
!  #26@matrix._wkill($p) else #26@matrix._pkill($p);

  Here is the object with the guts in it.  When creating elsewhere, just
switch "26@matrix" with whatever object you make to stash it in, sysobj,
etc.  Small, easy to follow and it works.

! object 26@matrix
! lst own=2@matrix;21@matrix;
! obj loc=22@matrix
! obj home=22@matrix
! str nam=alter stone
! str desc=A large block of bloody marble with groves around the edges.
! boo lok=F
! flg _wz=
! flg lcl=
! U _pkill=$p=matchply($1,"MRQ"); if (!$p || ($p.loc != $actor.loc)) return
!  echo("I don't see "+$1+" here!"); #26@matrix._kill($p);
! U _kill=$p=oid($1); @do("killed "+$p.nam+"!"); if (str($p.home) !=
!  str($actor.loc)) @teleport(str($p),"home") else @teleport(str($p),"0");
! U _wkill=$p=matchply($1,"MRQN"); if (!$p) $p=matchloc($1,"MRQN"); if (!$p)
!  return echo("I don't see "+$1+"!"); #26@matrix._kill($p);
! endobj

From Jeff.Bone@EBay.Sun.COM Sun Feb 23 01:51:42 1992
Received: by hussar (5.57/ULTRIX-fma-071791);
	id AA10327; Sun, 23 Feb 92 01:51:41 -0500
Received: from EBay.Sun.COM (female.EBay.Sun.COM) by Sun.COM (4.1/SMI-4.1)
	id AA28385; Sat, 22 Feb 92 22:49:59 PST
Received: from lilith.EBay.Sun.COM by EBay.Sun.COM (4.1/SMI-4.1)
	id AA18336; Sat, 22 Feb 92 22:53:48 PST
Received: by lilith.EBay.Sun.COM (4.1/SMI-4.1)
	id AA00775; Sat, 22 Feb 92 22:56:21 PST
Date: Sat, 22 Feb 92 22:56:21 PST
From: Jeff.Bone@EBay.Sun.COM (Jeff Bone)
Message-Id: <9202230656.AA00775@lilith.EBay.Sun.COM>
To: untermud@hussar.dco.DEC.COM
Subject: Re: My U kill-code
Status: R


Fixed, I think (will be glad when we get a way to list out globals. :)

Again:

set sysobj U _kill = {
   $p = matchWHO($1);
   if ($p.nam) {
      if ($p.loc != $actor.loc) {
         echo("I don't see " + $1 + " here!");
      } else {
         if (#sysobj.kill) {
            $t = #sysobj.kill;
         } else {
            if ($actor.loc) {
               $t = $actor.loc.kill;
            } else {
               $t = 100;
            };
         };
         $r = rnd(100);
         if ($r < $t) {
            @do("killed " + $1 + "!");
            @teleport($p, "home");
         } else {  
            @do("tried to kill " + $1 + "!");
            echo("Your attempted murder of " + $1 + " failed!");
         };
      };
   } else {
      echo("No one named " + $1 + " is logged on.");
   };
};

set sysobj U _wizkill = {
   $p = matchWHO($1);
   if ($p.nam) {
      @do("killed " + $1 + "!");
      @teleport($p, "home");
   } else {
      @teleport($1, "home");
   };
};

_mudconfig defUmac kill = {
   if ($actor.loc.hvn == "T") {
      if ($actor._wz == NULL) {
         echo("Sorry, this is a havened room.");
         return;
      };
   };
   foreacharg $f {
      if ($actor._wz == NULL) {
         #sysobj._kill($f);
      } else {
         #sysobj._wizkill($f);
      };
   };
};