/* Here is my summon lesser golem spell.  What it does is, it summons a lesser golem
   as a pet, until it dies.  After it dies, you cant cast it again for 25 ticks.
   It also, has the same amount of mana and hp as you. */


/***/ magic.h /***/

/* add this to the bottom, or anywhere else */

DECLARE_SPELL_FUN( spell_summon_lgolem  );

/***/ merc.h /***/

-first of all increment MAX_SKILLS by 1.
then
-add to the rest of the mob_vnum's.

#define MOB_VNUM_LGOLEM      21

/***/ const.c /***/

/* add this with the rest of the spells */

    {
        "summon lgolem",         { 45, 52, 52, 52 },       { 1,  1,  2,  2, },
        spell_summon_lgolem,     TAR_IGNORE,             POS_STANDING,
        NULL,           SLOT(600),      200,            32,
        "",     "You gained enough mana to make more golems now.",""
        
    },


-then add the spell to a spell group, i used creation.

/***/ magic2.c /***/

void spell_summon_lgolem( int sn, int level, CHAR_DATA *ch, void *vo, int target ) 
{
  CHAR_DATA *gch;
  CHAR_DATA *golem;
  AFFECT_DATA af;
  int i=0;

  if (is_affected(ch,sn))
    {
      send_to_char("You lack the power to summon another golem right now.\n\r",
		   ch);
      return;
    }

  send_to_char("You attempt to summon a lesser golem.\n\r",ch);
  act("$n attempts to summon a lesser golem.",ch,NULL,NULL,TO_ROOM);

  for (gch = char_list; gch != NULL; gch = gch->next)
    {
      if (IS_NPC(gch) && IS_AFFECTED(gch,AFF_CHARM) && gch->master == ch &&
          ( gch->pIndexData->vnum == MOB_VNUM_LGOLEM ) )
	{
	  i++;
	  if (i > 2)
           {
	    send_to_char("More golems are more than you can control!\n\r",ch);
	    return;
	   }
	}
    }

  golem = create_mobile( get_mob_index(MOB_VNUM_LGOLEM) );


  for (i = 0; i < MAX_STATS; i ++)
       golem->perm_stat[i] = UMIN(25,15 + ch->level/10);
            
  golem->perm_stat[STAT_STR] += 3;
  golem->perm_stat[STAT_INT] -= 1;
  golem->perm_stat[STAT_CON] += 2;

  golem->max_hit = IS_NPC(ch)? URANGE(ch->max_hit,1 * ch->max_hit,30000)
		: UMIN( (2 * ch->pcdata->perm_hit) + 400,30000);
  golem->hit = golem->max_hit;
  golem->max_mana = IS_NPC(ch)? ch->max_mana : ch->pcdata->perm_mana;
  golem->mana = golem->max_mana;
  golem->level = ch->level;
  for (i=0; i < 3; i++)
    golem->armor[i] = interpolate(golem->level,100,-100);
  golem->armor[3] = interpolate(golem->level,100,0);
  golem->gold = 0;
  golem->timer = 0;
  golem->damage[DICE_NUMBER] = 3;   
  golem->damage[DICE_TYPE] = 10;
  golem->damage[DICE_BONUS] = ch->level / 2;

  char_to_room(golem,ch->in_room);
  send_to_char("You summoned a lesser golem!\n\r",ch);
  act("$n summons a lesser golem!",ch,NULL,NULL,TO_ROOM);

  af.where		= TO_AFFECTS;
  af.type               = sn;
  af.level              = level; 
  af.duration           = 25;
  af.bitvector          = 0;
  af.modifier           = 0;
  af.location           = APPLY_NONE;
  affect_to_char(ch, &af);  

  SET_BIT(golem->affected_by, AFF_CHARM);
  golem->master = golem->leader = ch;

}

/***/ limbo.are /***/
/* put this with the other mobiles, if this vnum is taken, use a different one */

#21
golem lesser~
a lesser golem~
A lesser golem is here.
~
The golem appears to be made of some kind of clay, enchanted to come to life!.
~
golem~
AT V 0 0
0 1 1d1+1 1d1+1 3d10+12 crush
0 0 0 0
EFO 0 0 0
stand stand none 0
0 0 small 0

/* Thats it folks, remember if you need help email me or icq me! */
-Azalin
