diff -u3 old/defines.h new3/defines.h
--- old/defines.h	Fri Nov 23 03:49:08 2001
+++ new3/defines.h	Fri Nov 30 17:45:04 2001
@@ -1981,8 +1981,8 @@
 #define TR3_SEE_INVIS       0x00000020L /* See Invis */
 #define TR3_FREE_ACT        0x00000040L /* Free action */
 #define TR3_HOLD_LIFE       0x00000080L /* Hold life */
-#define TR3_XXX1            0x00000100L
-#define TR3_XXX2            0x00000200L
+#define TR3_MANA_CURSE      0x00000100L /* Mana curse */
+#define TR3_MANA_SHIELD     0x00000200L /* Mana shield */
 #define TR3_XXX3            0x00000400L
 #define TR3_XXX4            0x00000800L
 #define TR3_IMPACT          0x00001000L /* Earthquake blows */
diff -u3 old/init1.c new3/init1.c
--- old/init1.c	Fri Nov 23 03:46:36 2001
+++ new3/init1.c	Fri Nov 30 17:29:18 2001
@@ -448,8 +448,8 @@
 	"SEE_INVIS",
 	"FREE_ACT",
 	"HOLD_LIFE",
-	"XXX1",
-	"XXX2",
+        "MANA_CURSE",
+        "MANA_SHIELD",
 	"XXX3",
 	"XXX4",
 	"IMPACT",
diff -u3 old/l-object.pkg new3/l-object.pkg
--- old/l-object.pkg	Sun Nov 11 22:54:12 2001
+++ new3/l-object.pkg	Sun Dec  2 17:38:06 2001
@@ -811,8 +811,8 @@
 #define TR3_SEE_INVIS       0x00000020L /* See Invis */
 #define TR3_FREE_ACT        0x00000040L /* Free action */
 #define TR3_HOLD_LIFE       0x00000080L /* Hold life */
-#define TR3_XXX1            0x00000100L
-#define TR3_XXX2            0x00000200L
+#define TR3_MANA_CURSE      0x00000100L /* Mana curse */
+#define TR3_MANA_SHIELD     0x00000200L /* Mana shield */
 #define TR3_XXX3            0x00000400L
 #define TR3_XXX4            0x00000800L
 #define TR3_IMPACT          0x00001000L /* Earthquake blows */
Common subdirectories: old/lua and new3/lua
Only in new3: makefile
diff -u3 old/object1.c new3/object1.c
--- old/object1.c	Fri Nov 23 03:46:36 2001
+++ new3/object1.c	Sun Dec  2 18:19:26 2001
@@ -2187,6 +2187,18 @@
 		known = TRUE;
 	}
 
+        if (f3 & (TR3_MANA_CURSE))
+        {
+                text_out("It drains your mana.\n");
+                known = TRUE;
+        }
+
+        if (f3 & (TR3_MANA_SHIELD))
+        {
+                text_out("It generates a mana shield.\n");
+                known = TRUE;
+        }
+
 	if (f3 & (TR3_DRAIN_EXP))
 	{
 		text_out("It drains experience.\n");
diff -u3 old/spells1.c new3/spells1.c
--- old/spells1.c	Wed Nov  7 14:22:46 2001
+++ new3/spells1.c	Sun Dec  2 17:56:46 2001
@@ -437,6 +437,7 @@
 
 	int warning = (p_ptr->mhp * op_ptr->hitpoint_warn / 10);
 
+        int sp_dam;
 
 	/* Paranoia */
 	if (p_ptr->is_dead) return;
@@ -449,7 +450,36 @@
 	if (p_ptr->invuln && (dam < 9000)) return;
 
 	/* Hurt the player */
-	p_ptr->chp -= dam;
+        /* if the player has mana curse reduce also SP */
+        if (p_ptr->mana_curse)
+        {
+                sp_dam = dam * p_ptr->mana_curse / 10;
+                if (sp_dam>p_ptr->csp)
+                        p_ptr->csp = 0;
+                else
+                        p_ptr->csp-=sp_dam;
+                /* Display the mana */
+                p_ptr->redraw |= (PR_MANA);
+
+                p_ptr->chp -=dam;
+        }
+        /* if the player has mana shield, reduce sp when hp gets to 0 */
+        else if (p_ptr->mana_shield && dam>p_ptr->chp)
+        {
+                dam-=p_ptr->chp;
+                p_ptr->chp = 0;
+                if (dam>p_ptr->csp)
+                {
+                        p_ptr->chp = p_ptr->csp-dam;
+                        p_ptr->csp = 0;
+                }
+                else
+                        p_ptr->csp -= dam;
+                /* Display the mana */
+                p_ptr->redraw |= (PR_MANA);
+        }
+        else         
+                p_ptr->chp -= dam;
 
 	/* Display the hitpoints */
 	p_ptr->redraw |= (PR_HP);
diff -u3 old/spells2.c new3/spells2.c
--- old/spells2.c	Wed Nov  7 14:22:46 2001
+++ new3/spells2.c	Sun Dec  2 18:16:46 2001
@@ -464,6 +464,14 @@
 	{
 		info[i++] = "You aggravate monsters.";
 	}
+        if (p_ptr->mana_curse)
+        {
+                info[i++] = "You feel your magic energies being drained.";
+        }
+        if (p_ptr->mana_shield)
+        {
+                info[i++] = "A shield of mana protects you.";
+        }
 	if (p_ptr->teleport)
 	{
 		info[i++] = "Your position is very uncertain.";
diff -u3 old/types.h new3/types.h
--- old/types.h	Thu Nov  8 13:56:42 2001
+++ new3/types.h	Sun Dec  2 17:55:36 2001
@@ -1044,6 +1044,8 @@
 	bool hold_life;		/* Hold life */
 
 	bool impact;		/* Earthquake blows */
+        int mana_curse;        /* Mana curse */
+        bool mana_shield;       /* Mana shield */
 	bool aggravate;		/* Aggravate monsters */
 	bool teleport;		/* Random teleporting */
 	bool exp_drain;		/* Experience draining */
diff -u3 old/xtra1.c new3/xtra1.c
--- old/xtra1.c	Sat Aug 18 15:39:26 2001
+++ new3/xtra1.c	Sun Dec  2 18:00:04 2001
@@ -1702,6 +1702,24 @@
  */
 static void calc_bonuses(void)
 {
+        /* Table of percentages (actual percentage is 10 times the value)
+          for mana curse */
+        static int percentage_mana_curse[] =
+        {
+                10, /* pval<=-5 */
+                7,  /* pval==-4 */
+                5,  /* pval==-3 */
+                3,  /* pval==-2 */
+                2,  /* pval==-1 */
+                1,  /* pval==-0 */
+                2,  /* pval==-1 */
+                3,  /* pval==-2 */
+                5,  /* pval==-3 */
+                7,  /* pval==-4 */
+                10  /* pval>=-5 */
+        };
+        int temp_mana_curse;
+
 	int i, j, hold;
 
 	int old_speed;
@@ -1782,7 +1800,11 @@
 	p_ptr->dis_to_d = p_ptr->to_d = 0;
 	p_ptr->dis_to_a = p_ptr->to_a = 0;
 
+        /* Set mana_curse to 0 */
+        p_ptr->mana_curse = 0;
+
 	/* Clear all the flags */
+        p_ptr->mana_shield = FALSE;
 	p_ptr->aggravate = FALSE;
 	p_ptr->teleport = FALSE;
 	p_ptr->exp_drain = FALSE;
@@ -1873,6 +1895,7 @@
 	if (f3 & (TR3_SEE_INVIS)) p_ptr->see_inv = TRUE;
 	if (f3 & (TR3_FREE_ACT)) p_ptr->free_act = TRUE;
 	if (f3 & (TR3_HOLD_LIFE)) p_ptr->hold_life = TRUE;
+        if (f3 & (TR3_MANA_SHIELD)) p_ptr->mana_shield = TRUE;
 
 	/* Weird flags */
 	if (f3 & (TR3_BLESSED)) p_ptr->bless_blade = TRUE;
@@ -1972,10 +1995,23 @@
 		if (f3 & (TR3_SEE_INVIS)) p_ptr->see_inv = TRUE;
 		if (f3 & (TR3_FREE_ACT)) p_ptr->free_act = TRUE;
 		if (f3 & (TR3_HOLD_LIFE)) p_ptr->hold_life = TRUE;
+                if (f3 & (TR3_MANA_SHIELD)) p_ptr->mana_shield = TRUE;
 
 		/* Weird flags */
 		if (f3 & (TR3_BLESSED)) p_ptr->bless_blade = TRUE;
 
+                /* Set amount of mana curse */
+                if (f3 & (TR3_MANA_CURSE))
+                {
+                        if (o_ptr->pval<=-5 || o_ptr->pval>=5)
+                                temp_mana_curse = 10;
+                        else
+                                temp_mana_curse =
+                                        percentage_mana_curse[o_ptr->pval+5];
+                        if (temp_mana_curse > p_ptr->mana_curse)
+                                p_ptr->mana_curse = temp_mana_curse;
+                }
+
 		/* Bad flags */
 		if (f3 & (TR3_IMPACT)) p_ptr->impact = TRUE;
 		if (f3 & (TR3_AGGRAVATE)) p_ptr->aggravate = TRUE;
