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


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

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

DECLARE_SPELL_FUN( spell_summon_ggolem  );

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

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

#define MOB_VNUM_GGOLEM      22

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

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

    {
        "summon greater golem",         { 50, 52, 52, 52 },       { 1,  1,  2,  2, },
        spell_summon_ggolem,     TAR_IGNORE,             POS_STANDING,
        NULL,           SLOT(600),      250,            32,
        "",     "You gained enough mana to summon more golems now.",""
        
    },


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

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

void spell_summon_ggolem( 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 greater golem.\n\r",ch);
  act("$n attempts to summon a greater 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_GGOLEM ) )
	{
	    send_to_char("More golems are more than you can control!\n\r",ch);
	    return;
	}
    }

  golem = create_mobile( get_mob_index(MOB_VNUM_GGOLEM) );


  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( (10 * ch->pcdata->perm_hit) + 4000, 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] = 13;   
  golem->damage[DICE_TYPE] = 9;
  golem->damage[DICE_BONUS] = ch->level / 2 + 10;

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

  af.where		= TO_AFFECTS;
  af.type               = sn;
  af.level              = level; 
  af.duration           = 30;
  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 */

#22
golem greater~
a greater golem~
A greater golem stands here looking very dangerous.
~
It looks strong and durable, but somewhat un-intelligent.
~
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 large 0


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