sorry bout size agian
k heres a monster summoning snippet i wrote. started from a hack of animate dead but got out
of hand =(
works by letting caster summon certain mobs, and i think it would be easier makin 1 spell that will summon like 5-10 monsters then making a bunch of little spells, will prob need a help file to list all diff ones or can add it to the 'you cannont summon that' line
-open mud.h
- after
DECLARE_SPELL_FUN( spell_sacral_divinity );
- add
DECLARE_SPELL_FUN( spell_monster_summoning );
-after
#define MOB_VNUM_ANIMATED_CORPSE 5
-add
#define MOB_VNUM_MONSTER 69 /* unused right? =) */
-open tables.c
-after
if ( spell == spell_sacral_divinity ) return "spell_sacral_divinity";
-add
if ( spell == spell_monster_summoning ) return "spell_monster_summoning";
-after
if ( !str_cmp( name, "spell_sacral_divinity" )) return spell_sacral_divinity;
-add
if ( !str_cmp( name, "spell_monster_summoning" )) return spell_monster_summoning;
-open magic.c
-before
ch_ret spell_summon( int sn, int level, CHAR_DATA *ch, void *vo )
-add
/* monster summoning by keshmori */
ch_ret spell_monster_summoning( int sn, int level, CHAR_DATA *ch, void *vo )
{
MOB_INDEX_DATA *pMobIndex;
CHAR_DATA *mob;
AFFECT_DATA af;
char buf[MAX_STRING_LENGTH];
if ( target_name[0] == '\0' )
{
send_to_char( "What would you like to summon?\n\r", ch );
return rSPELL_FAILED;
}
if ( ( pMobIndex = get_mob_index(MOB_VNUM_MONSTER) ) == NULL )
{
send_to_char( "The monster does not exist! tell someone.\n\r", ch );
return rSPELL_FAILED;
}
mob = create_mobile( pMobIndex ); /* makes mob */
char_to_room( mob, ch->in_room );
if ( !str_cmp( target_name, "golem" ) )
{
sprintf(buf, "%s golem stone", ch->name);
STRFREE(mob->name);
mob->name = STRALLOC(buf);
sprintf(buf, "the golem of %s", ch->name);
STRFREE(mob->short_descr);
mob->short_descr = STRALLOC(buf);
sprintf(buf, "A stone golem stands here unmoving with a mark on its forehead reading %s.\n\r", ch->name);
STRFREE(mob->long_descr);
mob->long_descr = STRALLOC(buf);
/*can add own mob additions here*/
}
/* this is a dummy one to show more in detail how to make own monster options and customize this spell lil more */
else if ( !str_cmp( target_name, "elephant" ) ) /* keyword for c 'monster summoning' elephant */
{
sprintf(buf, "%s pink large elephant", ch->name); /* mobs keywords */
STRFREE(mob->name); /* gets rid of old name */
mob->name = STRALLOC(buf); /* replaces with ur name from buf above */
sprintf(buf, "the large pink elephant of %s", ch->name); /* what seen when fights or talks etc */
STRFREE(mob->short_descr);
mob->short_descr = STRALLOC(buf);
sprintf(buf, "A pink elephant stands here stomping around %s.\n\r", ch->name); /* room name */
STRFREE(mob->long_descr);
mob->long_descr = STRALLOC(buf);
mob->damroll = number_fuzzy(ch->damroll + 2); /* can change attributes to mobs to make specific to whatever monster is being summoned --chris */
mob->level = number_fuzzy(ch->level); /* can make dependant on the caster too */
mob->hit = mob->max_hit = number_fuzzy(ch->hit / 2); /* have hp = maxhp and this sets it to half of casters hp */
mob->mana = mob->max_mana = 0; /* mobs dont need mana */
}
/* end dummy monster */
else
{
send_to_char( "You cannont summon that.\n\r", ch );
return rSPELL_FAILED;
}
act(AT_DGREY, "$n summons $T!", ch, NULL, pMobIndex->short_descr, TO_ROOM);
act(AT_DGREY, "You summon $T!", ch, NULL, pMobIndex->short_descr, TO_CHAR);
/* for aff_charm on the monster, then summoner can order it to do whatever */
add_follower( mob, ch );
af.type = sn;
af.duration = (number_fuzzy( (ch->level + 1) / 4 ) + 1) * DUR_CONV; /* might wanna make longer or shorter */
af.location = 0;
af.modifier = 0;
af.bitvector = meb(AFF_CHARM);
affect_to_char( mob, &af );
return rNONE;
}
-then compile and log on, once on using immy type the following
sset create skill monster summoning
slookup 'monster summoning'
-after sn: will have a number, put that in for sn in the following
sset sn type spell
sset sn code spell_monster_summoning
sset sn wearoff !Monster Summoning!
sset sn mana 25
sset sn beats 12
sset save skill table
aa limbo.are
mcreate 69 monster
-these customizeable, just for default stats, might wanna change more/less whatever
mset 69 hitdie 1d1+500
mset 69 damdie 1d30+20
mset 69 level 20
mset 69 armor 0
mpedit 69 add rand 100
emote disappears in a whisp of white light.
/s
aa none
foldarea limbo.are
c 'monster summoning' elephant
-end
tell me if works or if get errors or whatever |