The problem with what your doing here is simple:
When you run create_mobile you make a instance of the mobile, however your
not changing the database instance of the mobile. What you should be doing
is something like this:
pMobIndex = get_mob_index( ch->in_room->vnum);
sprintf(buf,"{cA shopkeeper for {C%s{c's store.{x",ch->in_room->owner);
pMobIndex->short_descr = str_dup( buf );
// Soforth and so on for the rest of them
SET_BIT(pMobIndex->act, ACT_PLRSHOP);
//soforth for the rest of them!
/* Add the Reset nonsense here */
/* Set the AREA_CHANGED FLAG */
then do:
mob = create_mobile(pMobIndex);
char_to_room(mob, ch->in_room);
---------------------------------------------------------------------------
The problem with what you did is that just like objects, you have
OBJECT_INDEX_DATA and OBJ_DATA. OBJ_DATA is just a instance of
OBJECT_INDEX_DATA... This alllows for the stats and such for objects to be
changed, but not touching the origonal data. It is the same with
mobiles. They could be changed in the instances.
When you reboot, you simply are loosing the mob settings. You need to make
it on the entry in the MOB_INDEX_DATA database
Hope this makes sense.
Steven Radziul
Redkoala Mud Creator
----- Original Message -----
From: "Tristan M" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, April 28, 2003 10:14 PM
Subject: setting mob stats and saving them...
> 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