ES2 MUD LIB :: 東方故事二(ES2) 天朝帝國 mudlib 瀏覽展示

/doc/lfuns/carry_object

HOME :: doc :: lfuns :: carry_object

carry_object(5)        ES2 Mudlib Functions       carry_object(5)

NNAAMMEE
       carry_object()  - create an item and move it to the inven-
       tory of the NPC.

SSYYNNOOPPSSIISS
       object carry_object( string file );

DDEESSCCRRIIPPTTIIOONN
       Clone specified object in filename and move to  the  NPC's
       inventory.  Normally, it does the following work:

       object ob = new(file); ob->move(this_object());

       carry_object() also supports items that inherits F_UNIQUE.
       When an unique item is to be created with  carry_object(),
       and  another copy of such item already exists, the replica
       object will be created instead. (If no replica defined  in
       the unique item, 0 is returned)

AAPPPPLLIIEEDD
       F_SUPPORT

TTEECCHHNNIICCAALL NNOOTTEE
       carry_object()  only  "actually"  creates  the  item  when
       called in an cloned NPC. When called in a master  copy  of
       NPC,  it  just  returns  VOID_OB and thus you can use this
       function in create() like this:

       carry_object(__DIR__"obj/sword")->wield();

       The reason for such design is to save memory used by those
       items to use them).

ES2                        11 Apr 1996                          1

HOME :: doc :: lfuns :: carry_object