Actually, it's probably far simpler than that, even.
Was having som issued with summoned mobs and what you'll need do to is add a
couple of lines prior to setting the desc like so:
sprintf(buf, "a shopkeeper for %s" ch->name);
free_string(mob->short_descr);
mob->short_descr = str_dup(buf);
sprintf(buf2, "A shopkeeper of %s is standing here.\n\r",ch->name);
free_string(mob->long_descr);
mob->long_descr = str_dup(buf2);
The key to setting and saving those values is using the free_string, the
just duplicating the buffer. I have tons of summonable mobs cavorting around
in my mud and I've yet have a problem with it.
Cheers,
UD
From: Tristan M <[EMAIL PROTECTED]>
To: [email protected]
Subject: setting mob stats and saving them...
Date: Mon, 28 Apr 2003 20:14:46 -0600
hey again:p ive been tryin to make a little player owned shop code for my
mud, everythings great except for one issue...this is the code:
mobVnum = ch->in_room->vnum;
pRoom = ch->in_room;
pMobIndex = get_mob_index( ch->in_room->vnum );
mob = create_mobile( pMobIndex );
char_to_room( mob, pRoom );
sprintf(buf,"{cA shopkeeper for {C%s{c's store.{x",ch->in_room->owner);
mob->short_descr = str_dup( buf );
sprintf(buf,"{cA shopkeeper for {C%s{c's store.{x",ch->in_room->owner);
mob->long_descr = str_dup( buf);
sprintf(buf,"%s player owner shopkeeper\n\r",ch->in_room->owner);
mob->name = str_dup( buf );
SET_BIT( mob->act, ACT_PLRSHOP);
SET_BIT( mob->act, ACT_NOPURGE);
/* make the mob reset into the room */
loc_reset = new_reset_data();
loc_reset->command = 'M';
loc_reset->arg1 = mobVnum;
loc_reset->arg2 = 1;
loc_reset->arg3 = ch->in_room->vnum;
loc_reset->arg4 = 1;
add_reset( loc, loc_reset, 0 );
SET_BIT(loc_area->area_flags, AREA_CHANGED);
it resets fine, that saves, no problems there, the problem comes with the
name, short, long and act flags not saving to the area file...once the
command is executed everything will work, just not save and goes to default
after a copyover...understand? i hope so.
for example, the player types
--- shop create confirm
so this is great, this is what it all looks like:
A shopkeeper for Orlis's store.
but after a reboot it repops as:
(no long description)
i could set it normally via olc, however the idea is for it to be automated
for players to do it, and since its expected a lot of shops will be around
it is much easier for the code to set it instead of an imm individually
doing it.
i hope ive provided enough information
(btw, dennis' solution to my tqcamount problem thing worked like a charm:D
thanks a lot)
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail