Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hi... Some fixes, I used on my server...



Hi.

I'm running a crossfire server over here with some patches.
People can die, and be resurrected. The corpses of dead people keep
90% of the items (d.h. they stay stored in the .dead-file), so that
dying is not too hard (I still think, this is a cludge, but most
people over here preferred that). The rest 10% are (hopefully)
correctly dumped on the floor where the player died. (This means, that
if he died by fire or cold or some other nasties, the items are
propably gone for good.) Corpses are no more immune to everything, to
make getting back a badly damaged character a bit harder
(reincarnation still works...).

Our changes to the game follow (as a diff to the original).

cu

AW

--- include/spellist.h
+++ include/spellist.h	1995/06/11 15:32:21
@@ -211,11 +211,11 @@
  PATH_MISSILE, NULL,},							/* 90 */
 {"mystic fist",                  5,10,  0, 15, 0, 0,  1,  1, 0, 0, 0,
  PATH_SUMMON, "mystic_fist",}, 
-{"raise dead",                  10,50,  0, 60, 0, 0,  0,  1, 0, 1, 0,
+{"raise dead",                  10,50,  0, 60, 0, 0,  1,  1, 0, 1, 0,
  PATH_RESTORE, "enchantment",},
-{"resurrection",                25,250, 0, 180, 0, 0,  0,  0, 0, 1, 0,
+{"resurrection",                25,250, 0, 180, 0, 0,  1,  0, 0, 1, 0,
  PATH_RESTORE, "enchantment",},
-{"reincarnation",               20,150, 0,100, 0, 0,  0,  0, 0, 1, 0,
+{"reincarnation",               20,150, 0,100, 0, 0,  1,  0, 0, 1, 0,
  PATH_RESTORE, "enchantment",},
 /* mlee - Keep these spells 0 book chance, as they are low level quest items.*/
 {"immunity to cold",            6, 45,  0, 10, 0, 0,  0,  1, 1, 1, 1,
--- lib/archetypes
+++ lib/archetypes	1995/06/11 15:32:22
@@ -6578,7 +6578,6 @@
 type 157
 material 32
 weight 75000
-immune 262143
 end
 Object crown
 name crown
--- server/player.c
+++ server/player.c	1995/06/11 15:32:23
@@ -2459,6 +2459,7 @@
   }
 }
 
+#if 0
 void loot_object(object *op) { /* Grab and destroy some treasure */
   object *tmp,*tmp2,*next;
 
@@ -2473,21 +2474,51 @@
     next=tmp->below;
     remove_ob(tmp);
     tmp->x=op->x,tmp->y=op->y;
+#ifdef NO_LOOT
     if (tmp->type == CONTAINER) { /* empty container to ground */
-	loot_object(tmp);
+        loot_object(tmp);
     }
-    if(!QUERY_FLAG(tmp, FLAG_UNIQUE) && (QUERY_FLAG(tmp, FLAG_STARTEQUIP) 
+    if(!QUERY_FLAG(tmp, FLAG_UNIQUE) && (QUERY_FLAG(tmp, FLAG_STARTEQUIP)
        || QUERY_FLAG(tmp,FLAG_NO_DROP) || !(RANDOM()%3))) {
       if(tmp->nrof>1) {
-	tmp2=get_split_ob(tmp,1+RANDOM()%(tmp->nrof-1));
-	free_object(tmp2);
-	insert_ob_in_map(tmp,op->map);
+        tmp2=get_split_ob(tmp,1+RANDOM()%(tmp->nrof-1));
+        free_object(tmp2);
+        insert_ob_in_map(tmp,op->map);
       } else
-	free_object(tmp);
+        free_object(tmp);
     } else
+#endif
       insert_ob_in_map(tmp,op->map);
   }
 }
+
+#else
+
+#define DROP_CHANCE 10
+
+void loot_object(object *op) { /* Grab and drop some treasure */
+  object *curinv, *nextinv;
+
+  curinv = op->inv;
+  op->contr->freeze_inv=1;
+  op->contr->freeze_look=1;
+
+  while(curinv!=NULL) {
+    nextinv=curinv->below;
+    if((!curinv->invisible) && (RANDOM()%100<DROP_CHANCE)) {
+      if(QUERY_FLAG(curinv, FLAG_INV_LOCKED)) CLEAR_FLAG(curinv, FLAG_INV_LOCKED);
+      drop(op,curinv);
+    }
+    curinv = nextinv;
+  }
+
+  op->contr->freeze_inv=0;
+  op->contr->freeze_look=0;
+  draw_all_inventory(op);
+  draw_look(op);
+}
+
+#endif
 
 /*
  * fix_weight(): Check recursively the weight of all players, and fix
--- server/resurrection.c
+++ server/resurrection.c	1995/06/11 15:32:23
@@ -87,7 +87,7 @@
           temp!=NULL;
             temp=temp->above)
           /* really need a better way to spot corpseobjects */
-          if(temp->type == 157 && temp->immune==262143)  /* corpses immune to everything, so that they cannot be destroyed.  */
+          if(temp->type == 157 /* && temp->immune==262143 */ )  /* corpses immune to everything, so that they cannot be destroyed.  */
             break;
 	     } else {
       temp = corpseobj;
--- utils/crossloop
+++ utils/crossloop	1995/06/11 15:32:23
@@ -3,7 +3,9 @@
 # This is a replacement for the crosserv.pl perl script.,
 # No point in using perl for such a simple task.
 
-CMDNAME="BINDIR/crossfire"
+ulimit -c 0
+
+CMDNAME="/aw/crossfire/bin/crossfire"
 maxrestart=100
 logdir="/tmp/crosservlog"
 
@@ -13,8 +15,8 @@
 mkdir $logdir
 
 while [ ! "$logcount"x = "$maxrestart"x ]; do
-  echo "Starting Crossfire `date` for the $logcount time..." 1>2 2>>$logdir/$logcount
-  $CMDNAME -d -f -server 1>2 2>>$logdir/$logcount
+  echo "Starting Crossfire `date` for the $logcount time..." >>$logdir/$logcount
+  $CMDNAME -d -f -server 2>>$logdir/$logcount 1>&2
   logcount=`expr $logcount + 1`
   sleep 5
 done

-- 
Wer geteilt ist hat nichts mitzuteilen (Einstuerzende Neubauten)

Arne Wichmann (aw@math.uni-sb.de)