Create a load artifacts function and call it during load.
To make sure its not in someones possession (pfile) during the initial
load do this:

Example:

void load_artifacts( void )
{
    CHAR_DATA *ch;
    OBJ_DATA *obj;
    ROOM_INDEX_DATA *location, *room;


    obj = create_object( get_obj_index( 1207 ), 0 );
    if ((obj->pIndexData->count -1 ) >= obj->pIndexData->limit)
    {
     extract_obj(obj);
    }
    else
    {
      room = rand_room();
      obj_to_room(obj,room);
    }
}

Now with this code you shouldn't have it on a standard reset, and if you
want it to 
Load on a mob you can do :

    pMob = create_mobile( get_mob_index( 25122 ) );   //Loads mob vnum
25122
    room = rand_room();                               //Randomly pick a
room
    char_to_room( pMob, room );                       //Place the mob in
the room
    obj = create_object( get_obj_index( 8102 ), 0 );  //Create the
object to put on the mob
    obj_to_char( obj, pMob );                         //Put the object
on the mob inventory
    
This will ensure that the object will only load IF no-one has it in
their inventory.

I use it to load the individual pieces of the "Rod of Seven Parts"

This will load the object and if it already exists (in pfiles) it will
extract it.  Otherwise it places it where you want (in this example a
random room)

Place the function call somewhere after loading the limited objects.
(Somewhere in boot_db)
Im not sure about Tartarus code but the function load_limited_objects is
in the Anatolia code.

Hope this helps.

Keith

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rainer
Roomet
Sent: Saturday, April 24, 2004 7:53 AM
To: [email protected]
Subject: question about limiting items


I want to add limit item code to my rom 2.4. I look Tartarus code base
but 
it is not that what i need. There was somet item limit code but it's not

work properly. For example, if i set "the One Ring" limit 1. Then "the
One 
Ring" loads only one time per game. And if some player have the One Ring
and 
mud reboots then it dosen't load. Even the player is offline. It load
again 
when player lost this ring (is he sacrifice it etc.).

Anyone have idea ? And i apologize for my bad Englis :)

-- Ranka

The Lost Lands of Arion -- telnet irc.nohik.ee 4242
http://www.zone.ee/gain/forum.php

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


-- 
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom



Reply via email to