From: heldapu@home.corecom.net
Subject: forgeblade2
Resent-From: rom@rom.org

Update for ForgeDeath spell: 
sorry about the update, but people asked me to explain the 
spell in more detail and I fixed a few spelling errors and 
added a  few modifications  :)

Thanks to Russ Taylor for Rom2.4 source code!   
Thanks to origianl Diku Staff..!
Thanks to the Mud community for sharing code..:)                      
        If you decide to use this code I ask that you keep the below
header in tact. also on a side note this code hopefully will help
all those that have been asking about flagged objects set on a time
limit.................

Code Snippet for:  ForgeDeath and Deathblade for stock Rom24b4 Muds 
In this code I made the Deathblade bit for ITEM flag in object flags. 
It allows the caster to cast forgedeath on the weapon he currently is
wielding and flag it with Deathblade which is like Glowing or Humming.
When the weapon is flagged Deathblade it will do extra damage when
in a fight. It then allows the caster to have an extra 4 damroll, as well as 
the extra damage the weapon will do in a fight and sets the weapon to be 
flagged DeathBlade for a specified time; after that timer runs out on the 
weapon carried or wielded, it will be taken and extracted, and the caster 
must then find another weapon.
I suggest making it a high level spell and allowing it to last for 50 hours 
                      example obj->timer = 50  af. duration = 50 
This will allow high level players to get a better attacking weapon for
a limited time and will make them choose wisely as to what weapon 
to forgedeath on. Have fun codin and muddin! :)

If you have a better way to code this... or if you have suggestions 
email me(Kracus) at..    heldapu@corecom.net


/*This goes in Magic.c */
/* ForgeDeath and Deathblade code by Kracus 1997 */
void spell_forgedeath( int sn, int level, CHAR_DATA *ch, void *vo,int target ) 
{
  CHAR_DATA *victim = (CHAR_DATA *) vo;
  AFFECT_DATA af;
  OBJ_DATA *obj;

  if ( is_affected( ch, sn ) )
 {
  if (victim == ch)
  send_to_char("You have already forged a death edge on your weapon.\n\r",ch);
  else 
  act("$N already has a deathblade.",ch,NULL,victim,TO_CHAR); return; 
  }
  obj = get_eq_char(ch, WEAR_WIELD); /* list what obj equals-Kracus*/
  if ( get_eq_char(ch,WEAR_WIELD) == NULL) /* make sure they are wielding */ 
 {
  send_to_char("You have to be wielding the weapon to forge it in death.\n\r",ch); 
  return;
 }
 if (IS_OBJ_STAT(obj,ITEM_DEATHBLADE)) /*already is a deathblade! */ 
 {                                     
  send_to_char("Your blade is already forged in death.\n\r",ch);
  return;
 }
  SET_BIT(obj->extra_flags, ITEM_DEATHBLADE);
  obj->timer = 50; /* keep this number the same as the af.duration number */

    af.where      = TO_AFFECTS;
    af.type        = sn;
    af.level        = level;
    af.duration  = 50; /* keep number same as "obj->timer" number*/
    af.location   = APPLY_DAMROLL; 
    af.modifier  = 4;
    af.bitvector = 0;
    affect_to_char( victim, &af );
    act( "$n forges a weapon into a deathblade.", victim, NULL, NULL,TO_ROOM ); 
    send_to_char( "You forge a death edge on your weapon.\n\r", victim ); return;
}


/* This goes in Const.c */
 {
 "forgedeath", { 45, 45, 45, 45 }, 
  { 1,  1,  2,  2 },
  spell_forgedeath,      TAR_CHAR_SELF,          POS_STANDING,
  NULL,                  SLOT(554),      25,     18,
  "",                    "You feel death leave you.",    ""
  },

/* This goes at the end of Const.c remeber to add a comma if you put */
/* it higher in the list instead of the last spell group...*/
    {
        "forgedeath",           { 6, 6, 6, 6 },
        { "forgedeath" }
    }    /* <--add comma here if not the last spell group-Kracus */


/* This goes in Magic.h */
DECLARE_SPELL_FUN(      spell_forgedeath        );


/* This goes in Act_Info.c around line 121 */
if ( IS_OBJ_STAT(obj, ITEM_DEATHBLADE)       )   strcat( buf, "(Deathblade) " );


/* This goes in the Extra Flags for Objects section in Merc.h */
/* ALSO!: raise Max_Skill by one -and- raise Max_Group by one  */
#define ITEM_DEATHBLADE         (R) /* unused bit in stock rom-Kracus */


/* This goes in Fight.c in "void one_hit" around the weapon_frost */
  obj = get_eq_char(ch, WEAR_WIELD); /* gets deathblade ready */
  if (ch->fighting == victim && IS_OBJ_STAT(obj,ITEM_DEATHBLADE)) 
 { 
  dam = number_range(1,ch->level / 4 + 1);  /* amount of extra damage */
  act("$n is slashed by $p's edge of Death.",victim,obj,NULL,TO_ROOM); 
  act("$p slashes you with a deadly edge of Death.",victim,obj,NULL,TO_CHAR);
  fire_effect( (void *) victim,ch->level/2,dam,TARGET_CHAR);
  damage(ch,victim,dam,0,DAM_FIRE,FALSE); 
  }

/* This also goes in Fight.c at the top of the function */
  OBJ_DATA *obj;  /* = get_eq_char(ch,WEAR_WIELD); */


/* This goes in Act_Obj.c in  do_evnom function under ITEM_SHOCKING*/
    ||  IS_OBJ_STAT(obj,ITEM_DEATHBLADE)

/* This goes in Act_Obj.c either in remove_obj or do_buy at the end */
  if(IS_SET(obj->extra_flags, ITEM_DEATHBLADE 
  && !IS_OBJ_STAT(obj, ITEM_HAD_TIMER)))
  obj->timer = 0;
  REMOVE_BIT(obj->extra_flags,ITEM_HAD_TIMER);